Make deployment-friendly defaults: no env vars needed to run
Some checks failed
CI / build (push) Failing after 3s

- Go binary defaults DATA_DIR=./data, SERVERFILE_DIR=./serverfiles
  (relative to cwd) — just copy the binary and run
- MODS_DIR, CFG_DIR, PROFILES_DIR are derived from SERVERFILE_DIR
- Removed DEV_DEPLOY_DIR indirection (was only used for development)
- Makefile expands defaults to ../dev-deploy/... directly for dev
This commit is contained in:
MrFastwind
2026-07-09 15:42:50 +02:00
parent 9aa6fca50e
commit 914e0fbe48
2 changed files with 13 additions and 16 deletions

View File

@@ -21,12 +21,11 @@ import (
)
func main() {
devDeploy := getEnv("DEV_DEPLOY_DIR", filepath.Join("..", "dev-deploy"))
dataDir := mustAbs(getEnv("DATA_DIR", filepath.Join(devDeploy, "data")))
serverfileDir := mustAbs(getEnv("SERVERFILE_DIR", filepath.Join(devDeploy, "serverfiles")))
modsDir := mustAbs(getEnv("MODS_DIR", filepath.Join(devDeploy, "serverfiles", "mods")))
cfgDir := mustAbs(getEnv("CFG_DIR", filepath.Join(devDeploy, "serverfiles", "cfg")))
profilesDir := mustAbs(getEnv("PROFILES_DIR", filepath.Join(devDeploy, "serverfiles", "profiles")))
serverfileDir := mustAbs(getEnv("SERVERFILE_DIR", "./serverfiles"))
dataDir := mustAbs(getEnv("DATA_DIR", "./data"))
modsDir := mustAbs(getEnv("MODS_DIR", filepath.Join(serverfileDir, "mods")))
cfgDir := mustAbs(getEnv("CFG_DIR", filepath.Join(serverfileDir, "cfg")))
profilesDir := mustAbs(getEnv("PROFILES_DIR", filepath.Join(serverfileDir, "profiles")))
listen := getEnv("LISTEN", ":8080")
log.Printf("data dir: %s", dataDir)