feat(cli): configurable bind host (--host flag + config host field) - #5
Open
addadi wants to merge 1 commit into
Open
feat(cli): configurable bind host (--host flag + config host field)#5addadi wants to merge 1 commit into
addadi wants to merge 1 commit into
Conversation
Server previously hardcoded 127.0.0.1. Multi-host/container deployments had to recompile to change the bind address. - Config.host (JSON config, default 127.0.0.1, empty falls back to default) - --host CLI flag; precedence CLI > config file > default, mirroring --port - listen/log messages include the resolved host - tests: default host, config-file host parse, host-unset keeps default
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Bind address was hardcoded to
127.0.0.1. This adds:Config.hostJSON field (default127.0.0.1; empty value falls back to default)--host <addr>CLI flag--host> config filehost> default — mirrors the existing--portbehaviorWhy
Multi-host and container deployments (e.g. reaching the server from another host or a container bridge) previously required a recompile to change the bind address.
--portwas already configurable;--hostwas the missing half.Validation
zig buildcleanzig build testgreen (new tests: default host, config-file host parse, host-unset keeps default)nulltickets --host 127.0.0.2 --port 7799binds and serves/healthon the given addressNo behavior change for existing deployments: without
--hostand without a confighostkey, the server still binds127.0.0.1.