From 2270fe4deb7b68939df48fe7937b852da159591c Mon Sep 17 00:00:00 2001 From: ditatompel Date: Thu, 23 May 2024 03:57:29 +0700 Subject: [PATCH] Secret key environment variable no longer needed --- .env.example | 5 +++-- internal/config/app.go | 4 ++-- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/.env.example b/.env.example index ec81394..fea2525 100644 --- a/.env.example +++ b/.env.example @@ -11,14 +11,15 @@ TOR_SOCKS="127.0.0.1:9050" # Server Config # ############# -SECRET_KEY="" # must be 32 char length, use `openssl rand -base64 32` to generate random secret + # Fiber Config APP_PREFORK=true APP_HOST="127.0.0.1" APP_PORT=18090 APP_PROXY_HEADER="X-Real-Ip" # CF-Connecting-IP APP_ALLOW_ORIGIN="http://localhost:5173,http://127.0.0.1:5173,https://ditatompel.com" -# DB settings: + +#DB settings: DB_HOST=127.0.0.1 DB_PORT=3306 DB_USER=root diff --git a/internal/config/app.go b/internal/config/app.go index 8db273d..eced19a 100644 --- a/internal/config/app.go +++ b/internal/config/app.go @@ -9,13 +9,14 @@ import ( type App struct { // general config LogLevel string + // configuration for server Prefork bool Host string Port int ProxyHeader string AllowOrigin string - SecretKey string + // configuration for prober (client) ServerEndpoint string ApiKey string @@ -50,7 +51,6 @@ func LoadApp() { app.Prefork, _ = strconv.ParseBool(os.Getenv("APP_PREFORK")) app.ProxyHeader = os.Getenv("APP_PROXY_HEADER") app.AllowOrigin = os.Getenv("APP_ALLOW_ORIGIN") - app.SecretKey = os.Getenv("SECRET_KEY") // prober configuration app.ServerEndpoint = os.Getenv("SERVER_ENDPOINT")