Make deployment-friendly defaults: no env vars needed to run
Some checks failed
CI / build (push) Failing after 3s
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:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user