From ca296fbe3462ce7ab2173b63be767ebb82605182 Mon Sep 17 00:00:00 2001 From: Abhishek Shroff Date: Mon, 19 May 2025 00:40:40 +0530 Subject: [PATCH] [server] Tweak configs --- example.env | 14 ++++++++------ server/internal/command/config.go | 2 +- server/internal/core/db/config.go | 2 +- server/internal/core/db/db.go | 2 +- 4 files changed, 11 insertions(+), 9 deletions(-) diff --git a/example.env b/example.env index 96dc077c..baa06ac2 100644 --- a/example.env +++ b/example.env @@ -4,15 +4,17 @@ STORAGE_LOCATION=./data/storage # The location where your database files are stored PG_DATA_LOCATION=./data/postgres +# PHYLUM_DEBUG=0 + # PHYLUM_SERVER_HOST= # PHYLUM_SERVER_PORT=2448 # PHYLUM_SERVER_CORS_ENABLED=0 # PHYLUM_SERVER_CORS_ORIGINS=http://localhost:5000,http://localhost:5001 -# PHYLUM_SERVER_LOG_BODY=0 -# PHYLUM_SERVER_WEB_APP_SRC=web -# PHYLUM_SERVER_PUBLINK_PATH=/publink -# PHYLUM_SERVER_WEBDAV_PATH=/webdav +# PHYLUM_SERVER_LOGBODY=0 +# PHYLUM_SERVER_WEBAPPSRC=web +# PHYLUM_SERVER_PUBLINKPATH=/pub +# PHYLUM_SERVER_WEBDAVPATH=/webdav -PHYLUM_DB_NAME=phylum -PHYLUM_DB_USER=phylum +# PHYLUM_DB_NAME=phylum +# PHYLUM_DB_USER=phylum PHYLUM_DB_PASSWORD=phylum diff --git a/server/internal/command/config.go b/server/internal/command/config.go index d3888e4c..f9a77fed 100644 --- a/server/internal/command/config.go +++ b/server/internal/command/config.go @@ -11,7 +11,7 @@ var defaultConfig = Config{ DB: db.Config{ Host: "localhost", Port: 5432, - DBName: "phylum", + Name: "phylum", User: "phylum", Password: "phylum", NoMigrate: false, diff --git a/server/internal/core/db/config.go b/server/internal/core/db/config.go index 27bb01bb..1e9ce07e 100644 --- a/server/internal/core/db/config.go +++ b/server/internal/core/db/config.go @@ -3,7 +3,7 @@ package db type Config struct { Host string `koanf:"host"` Port int `koanf:"port"` - DBName string `koanf:"dbname"` + Name string `koanf:"name"` User string `koanf:"user"` Password string `koanf:"password"` NoMigrate bool `koanf:"nomigrate"` diff --git a/server/internal/core/db/db.go b/server/internal/core/db/db.go index 40141996..c7d28950 100644 --- a/server/internal/core/db/db.go +++ b/server/internal/core/db/db.go @@ -37,7 +37,7 @@ func initPool(ctx context.Context) error { var dsn strings.Builder dsn.WriteString("host=" + Cfg.Host) dsn.WriteString(" port=" + strconv.Itoa(Cfg.Port)) - dsn.WriteString(" dbname=" + Cfg.DBName) + dsn.WriteString(" dbname=" + Cfg.Name) dsn.WriteString(" user=" + Cfg.User) if Cfg.Password != "" { dsn.WriteString(" password=" + Cfg.Password)