diff --git a/config/config.go b/config/config.go index 89caf4e..cb94946 100644 --- a/config/config.go +++ b/config/config.go @@ -78,8 +78,13 @@ func getDefaultSocketPath() string { return "" } // LoadConfig reads the config file or creates one with defaults. -func LoadConfig() *Config { +// If customPath is non-empty, it overrides the OS-aware config file path. +func LoadConfig(customPath string) *Config { configDir, configFile := getConfigPath() + if customPath != "" { + configFile = customPath + configDir = filepath.Dir(configFile) + } defaultPath := getDefaultStoragePath() // Check if config file exists; create with defaults if not. diff --git a/install_linux.sh b/install_linux.sh index 3464852..79801ef 100755 --- a/install_linux.sh +++ b/install_linux.sh @@ -42,13 +42,17 @@ chmod 0755 "${INSTALL_DIR}" find "${INSTALL_DIR}/templates" -type d -exec chmod 0755 {} \; find "${INSTALL_DIR}/templates" -type f -exec chmod 0644 {} \; +SOCKET_PATH="${INSTALL_DIR}/web.sock" + if [[ ! -f "${CONFIG_DIR}/config.yaml" ]]; then SECRET=$(openssl rand -hex 32) cat > "${CONFIG_DIR}/config.yaml" <