{"record":{"id":"216814cdc2f387b6","repo":"router-for-me/CLIProxyAPI","slug":"decode-codex-live-media-relay-allow-private-remote","errorCode":null,"errorMessage":"decode codex.live-media-relay.allow-private-remote-ips: %w","messagePattern":"decode codex\\.live-media-relay\\.allow-private-remote-ips: %w","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"internal/config/codex_live.go","lineNumber":34,"sourceCode":"\n// UnmarshalYAML supports the deprecated allow-private-remote-ips setting while\n// preserving the default behavior of allowing private downstream candidates.\nfunc (c *CodexLiveMediaRelayConfig) UnmarshalYAML(value *yaml.Node) error {\n\ttype plain CodexLiveMediaRelayConfig\n\tvar decoded plain\n\tif errDecode := value.Decode(&decoded); errDecode != nil {\n\t\treturn errDecode\n\t}\n\tvar allowPrivate *bool\n\tvar disablePrivate *bool\n\tif value.Kind == yaml.MappingNode {\n\t\tfor index := 0; index+1 < len(value.Content); index += 2 {\n\t\t\tkey := value.Content[index].Value\n\t\t\tswitch key {\n\t\t\tcase \"allow-private-remote-ips\":\n\t\t\t\tvar setting bool\n\t\t\t\tif errDecode := value.Content[index+1].Decode(&setting); errDecode != nil {\n\t\t\t\t\treturn fmt.Errorf(\"decode codex.live-media-relay.allow-private-remote-ips: %w\", errDecode)\n\t\t\t\t}\n\t\t\t\tallowPrivate = &setting\n\t\t\tcase \"disable-private-remote-ips\":\n\t\t\t\tvar setting bool\n\t\t\t\tif errDecode := value.Content[index+1].Decode(&setting); errDecode != nil {\n\t\t\t\t\treturn fmt.Errorf(\"decode codex.live-media-relay.disable-private-remote-ips: %w\", errDecode)\n\t\t\t\t}\n\t\t\t\tdisablePrivate = &setting\n\t\t\t}\n\t\t}\n\t}\n\tif allowPrivate != nil && disablePrivate != nil {\n\t\treturn errors.New(\"codex.live-media-relay cannot set both allow-private-remote-ips and disable-private-remote-ips\")\n\t}\n\tif allowPrivate != nil {\n\t\tdecoded.DisablePrivateRemoteIPs = !*allowPrivate\n\t\tlog.Warn(\"codex.live-media-relay.allow-private-remote-ips is deprecated; use disable-private-remote-ips with the inverse value\")\n\t}","sourceCodeStart":16,"sourceCodeEnd":52,"githubUrl":"https://github.com/router-for-me/CLIProxyAPI/blob/78f0c4079e3e6273d65d03b5549cffc898703264/internal/config/codex_live.go#L16-L52","documentation":"While decoding the codex.live-media-relay YAML node, the key allow-private-remote-ips was found but its value could not be decoded into a bool. This is a config-type error: the user wrote a string, number, or nested structure where a boolean is required.","triggerScenarios":"UnmarshalYAML walks the mapping node and value.Content[index+1].Decode(&setting) fails for allow-private-remote-ips — e.g. 'allow-private-remote-ips: \"yes\"', ': 1', or ': [true]'.","commonSituations":"Copy-pasted config from docs using quoted 'yes'/'on' (valid in some YAML apps, not here); env-var templating inserting a string; typo adding a nested block.","solutions":["Set the key to a plain YAML boolean: allow-private-remote-ips: true (no quotes).","Prefer migrating to the new key disable-private-remote-ips with the inverse value — the old key only logs a deprecation warning.","Run the config through a YAML linter and this project's config validation before deploy."],"exampleFix":"# before\nallow-private-remote-ips: \"yes\"\n\n# after\ndisable-private-remote-ips: false","handlingStrategy":"validation","validationCode":"# yamllint or a dry load before starting the server\ngo run ./cmd/server --config config.yaml --help 2>&1 | grep -i 'allow-private-remote-ips' || true","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Use bare booleans (true/false) in YAML; never quoted strings.","Migrate off the deprecated allow-private-remote-ips key to disable-private-remote-ips.","Lint generated configs in CI."],"tags":["config","yaml","codex-live","type-error"],"backgroundTag":null,"analyzedSha":"78f0c4079e3e6273d65d03b5549cffc898703264","analyzedAt":"2026-08-15T12:26:37.444Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}