diff --git a/docker-compose.yml b/docker-compose.yml index 0d499db..60a8f1f 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -107,7 +107,7 @@ services: # `ps` inside this container, unlike the zenmoney and IMAP secrets which are # read from files. command: ["mavweb", "-addr", ":9201", "-voice", "mavend:9100", "-core", "/run/maven/mavend.sock", - "-ambient-enabled", "${MAVEN_AMBIENT_ENABLED:-false}", + "-ambient-enabled=${MAVEN_AMBIENT_ENABLED:-false}", "-ambient-token", "${MAVEN_AMBIENT_TOKEN:-}", "-nexus", "http://nexus:9740", "-praxis", "http://praxis:8989", "-hexis", "http://hexis:9741"] depends_on: [mavend] diff --git a/internal/config/deployconfig_test.go b/internal/config/deployconfig_test.go index 090bf55..44416f7 100644 --- a/internal/config/deployconfig_test.go +++ b/internal/config/deployconfig_test.go @@ -108,3 +108,23 @@ func TestCanonicalDeployEnvExampleNamesEverySecret(t *testing.T) { } } } + +// Go's flag package treats a bare boolean flag as true and does not consume a +// following "true"/"false" argument. That following value becomes the first +// positional argument and stops parsing, so every flag after it silently keeps +// its default. Keep the Compose boolean in -name=value form (V-691 live QA). +func TestComposeAmbientBooleanDoesNotStopFlagParsing(t *testing.T) { + path := filepath.Join("..", "..", "docker-compose.yml") + b, err := os.ReadFile(path) + if err != nil { + t.Fatalf("read %s: %v", path, err) + } + compose := string(b) + const joined = `"-ambient-enabled=${MAVEN_AMBIENT_ENABLED:-false}"` + if !strings.Contains(compose, joined) { + t.Fatalf("mavweb ambient boolean must be one argv element %s", joined) + } + if strings.Contains(compose, `"-ambient-enabled",`) { + t.Fatal("bare -ambient-enabled leaves its value positional and prevents -ambient-token from being parsed") + } +}