[server] Tweak configs

This commit is contained in:
Abhishek Shroff
2025-05-19 00:40:40 +05:30
parent 9212d6c287
commit ca296fbe34
4 changed files with 11 additions and 9 deletions

View File

@@ -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

View File

@@ -11,7 +11,7 @@ var defaultConfig = Config{
DB: db.Config{
Host: "localhost",
Port: 5432,
DBName: "phylum",
Name: "phylum",
User: "phylum",
Password: "phylum",
NoMigrate: false,

View File

@@ -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"`

View File

@@ -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)