act icon indicating copy to clipboard operation
act copied to clipboard

docs(man): redact IP-like defaults for address flags in generated man page - Fixes #5894

Open AbhinavSivanandhan opened this issue 2 months ago • 0 comments

Problem: act --man-page embeds the local outbound IP in defaults for address flags (e.g., --artifact-server-addr, --cache-server-addr). That breaks reproducible builds and leaks a private detail.

Approach: Only for documentation generation, replace printed defaults that:

  • are for address-like flags (*-addr, *-address), and
  • look like an IPv4 (optionally with :port) with a deterministic placeholder: [auto-detected IP].

Runtime behavior is unchanged. When act actually runs, it still uses the dynamic outbound IP.

Implementation:

  • Added a small sanitizer called from generateManPage() that walks the root command (and subcommands) and rewrites DefValue for matching flags.
  • Unit test TestSanitizeFlagDefaultsForDocs validates behavior across persistent/local flags and subcommands.

Testing

  • go test ./cmd -run Sanitize -v passes
  • Manual: ./act --man-page shows [auto-detected IP] in place of a real IP for address flags.

Fixes #5894

AbhinavSivanandhan avatar Oct 10 '25 08:10 AbhinavSivanandhan