feat(server): add HOME_ADDR and HOME_PASSWORD env var fallback for home flags
Allow configuring the home control plane connection via environment variables HOME_ADDR and HOME_PASSWORD as an alternative to the --home and --home-password command-line flags. This enables Docker Swarm stack deployments without needing docker service update --args. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
@@ -247,6 +247,18 @@ func main() {
|
|||||||
// Parse the command-line flags.
|
// Parse the command-line flags.
|
||||||
flag.Parse()
|
flag.Parse()
|
||||||
|
|
||||||
|
// Allow env var fallback for home flags so they can be configured without command args.
|
||||||
|
if strings.TrimSpace(homeAddr) == "" {
|
||||||
|
if v, ok := os.LookupEnv("HOME_ADDR"); ok {
|
||||||
|
homeAddr = strings.TrimSpace(v)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if strings.TrimSpace(homePassword) == "" {
|
||||||
|
if v, ok := os.LookupEnv("HOME_PASSWORD"); ok {
|
||||||
|
homePassword = strings.TrimSpace(v)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// Core application variables.
|
// Core application variables.
|
||||||
var err error
|
var err error
|
||||||
var cfg *config.Config
|
var cfg *config.Config
|
||||||
|
|||||||
Reference in New Issue
Block a user