Skip to content

Read /etc/hypeman/config.yaml on macOS when no user config exists - #606

Open
chruffins wants to merge 1 commit into
mainfrom
hypeship/darwin-etc-config
Open

chruffins wants to merge 1 commit into
mainfrom
hypeship/darwin-etc-config

Conversation

@chruffins

@chruffins chruffins commented Nov 24, 2026 •

Copy link
Copy Markdown
Contributor

Summary

On macOS, hypeman-token and hypeman-api only look for a config at ~/.config/hypeman/config.yaml when CONFIG_PATH isn't set. Hosts on macOS keep it at /etc/hypeman/config.yaml, as Linux hosts do. hypeman-api there gets CONFIG_PATH from its launch agent, but other callers don't.

This adds /etc/hypeman/config.yaml to the macOS default paths, after ~/.config/hypeman/config.yaml.

Existing and new flows

Existing (darwin): CONFIG_PATH -> ~/.config/hypeman/config.yaml -> not found
New (darwin):      CONFIG_PATH -> ~/.config/hypeman/config.yaml -> /etc/hypeman/config.yaml
Linux:             unchanged (/etc/hypeman/config.yaml -> ~/.config/hypeman/config.yaml)

A user config still wins on macOS, so dev setups that use ~/.config/hypeman/config.yaml behave as before.

Testing

  • go test ./cmd/gen-jwt/ passes; GOOS=darwin GOARCH=arm64 go build ./cmd/gen-jwt/ builds.

Note

Low Risk
Low-risk change to config file search order on macOS; user config still takes precedence and behavior matches documented Linux paths.

Overview
On macOS, default config discovery now checks /etc/hypeman/config.yaml after ~/.config/hypeman/config.yaml (when CONFIG_PATH is unset), matching how infra-installed hosts lay out config and how Linux already behaves.

GetDefaultConfigPaths in cmd/api/config/config.go is updated accordingly; DEVELOPMENT.md documents the extra macOS search path. A user config under ~/.config still wins when present, so local dev setups are unchanged.

This fixes callers such as hypeman-token / gen-jwt that run with an empty environment (e.g. metro-api minting JWTs) and previously failed with missing jwt_secret on macOS when only /etc/hypeman/config.yaml existed.

Reviewed by Cursor Bugbot for commit dea6aa3. Configure here.

@chruffins
chruffins marked this pull request as ready for review November 24, 2026 16:22
@kernel-internal

Copy link
Copy Markdown
Contributor

Would auto-approve: no · medium risk · dea6aa3

Denied: Adds a macOS fallback that can load system-wide configuration, including JWT authentication secrets, when user configuration is absent. This changes production config resolution and touches authentication and secrets handling.

Shadow mode: nothing is auto-approved and a human review is still required. React 👍 or 👎 if this call looks right or wrong.

This branch has not been deployed

No deployments
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.

1 participant