Skip to content

feat(cli): configurable bind host (--host flag + config host field) - #5

Merged
vernonstinebaker merged 1 commit into
nullclaw:mainfrom
addadi:feat/configurable-bind-host
Sep 29, 2026
Merged

vernonstinebaker merged 1 commit into
nullclaw:mainfrom
addadi:feat/configurable-bind-host

Conversation

@addadi

@addadi addadi commented Aug 20, 2026

Copy link
Copy Markdown
Contributor

What

Bind address was hardcoded to 127.0.0.1. This adds:

  • Config.host JSON field (default 127.0.0.1; empty value falls back to default)
  • --host <addr> CLI flag
  • Precedence: CLI --host > config file host > default — mirrors the existing --port behavior
  • Startup log / listen error messages now include the resolved host

Why

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. --port was already configurable; --host was the missing half.

Validation

  • zig build clean
  • zig build test green (new tests: default host, config-file host parse, host-unset keeps default)
  • Manual run: nulltickets --host 127.0.0.2 --port 7799 binds and serves /health on the given address

No behavior change for existing deployments: without --host and without a config host key, the server still binds 127.0.0.1.

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

@vernonstinebaker vernonstinebaker left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Clean, minimal, and convention-consistent: host config field (default 127.0.0.1 — zero behavior change unless explicitly configured) + --host CLI override, matching nullboiler's flag style. Tests cover default, override, and unset cases. Note: this branch predates #9's test wiring, so its CI ran an empty suite — after merge, main's 18+ test suite covers it (and these host tests will actually execute for the first time). Merging.

@vernonstinebaker
vernonstinebaker merged commit e601c1f into nullclaw:main Sep 29, 2026
3 checks passed
@vernonstinebaker

Copy link
Copy Markdown
Contributor

Merged — but heads-up: the textual auto-merge spliced this PR's new test onto #9's refactored test region in config.zig, leaving pre-0.16 tmp.dir.writeFile/realpathAlloc forms that broke the build on main (the PR's CI check predated #9, so the merge result never got re-validated — the empty-suite gap we documented). Repaired in a follow-up commit on main; 19/19 tests pass (18 from #9 + this PR's host-default test now actually running).

vernonstinebaker added a commit that referenced this pull request Oct 3, 2026
fix(tests): repair config.zig test after #5/#9 merge
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants