feat(cli): support HAPI_HOSTNAME env to override machine hostname#94
Merged
tiann merged 1 commit intotiann:mainfrom Jan 21, 2026
Merged
feat(cli): support HAPI_HOSTNAME env to override machine hostname#94tiann merged 1 commit intotiann:mainfrom
tiann merged 1 commit intotiann:mainfrom
Conversation
| return { | ||
| host: os.hostname(), | ||
| host: process.env.HAPI_HOSTNAME || os.hostname(), | ||
| platform: os.platform(), |
There was a problem hiding this comment.
[NIT] [DOCS] HAPI_HOSTNAME not documented in CLI env list
Why this is a problem: Users won't discover the new override because cli/README.md enumerates env vars and doesn't mention HAPI_HOSTNAME.
Suggested fix:
- `HAPI_HOSTNAME` - Override hostname reported to the server (default: OS hostname).There was a problem hiding this comment.
Findings
- [NIT] HAPI_HOSTNAME not documented in CLI env list — users won’t discover the override, evidence
cli/src/agent/sessionFactory.ts:38
Suggested fix:- `HAPI_HOSTNAME` - Override hostname reported to the server (default: OS hostname).
Summary
- Doc update needed for new env var; no other diff issues found.
Testing
- Not run (automation)
There was a problem hiding this comment.
Findings
- [Nit] HAPI_HOSTNAME not documented in CLI env list — users won’t discover the override, evidence
cli/src/agent/sessionFactory.ts:38
Suggested fix:- `HAPI_HOSTNAME` - Override hostname reported to the server (default: OS hostname).
Summary
- Doc update needed for new env var; no other diff issues found.
Testing
- Not run (automation)
HAPI Bot
Owner
|
@tiann Modify this pr and update the documentation |
|
Change: add HAPI_HOSTNAME override in CLI machine metadata (cli/src/agent/sessionFactory.ts:38); docs update in cli/README.md:76 and docs/guide/installation.md:96. Tests: bun typecheck failed (bun not found in runner). PR Created: #95 HAPI Bot |
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.
Summary
Allow users without root privileges to customize machine hostname via environment variable
HAPI_HOSTNAME.Changes
cli/src/agent/sessionFactory.ts: Addprocess.env.HAPI_HOSTNAMEfallback inbuildMachineMetadata()Usage
HAPI_HOSTNAME="my-server" hapi runner startMotivation
On systems where users don't have root access, changing the OS hostname requires elevated privileges. This PR provides a simple workaround by allowing the hostname to be overridden via environment variable.