Repository navigation
Conversation
…othing `machine` in config.toml names this computer when it creates or joins a team, after REASON_NETWORK_MACHINE and before the host name. Unlike the environment variable it reaches a daemon the login service starts. In a team the roster's name still stands. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: Sven Myhre <sven@mac.lan>
Member
|
Review of 4165ca4 (independent, full suite, plus a live rename over the internet): the code is right, it just needs a test.
What we checked: names go through |
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.
Why
A user (CLI 0.2.529) on a hosted runtime is on the network as
htch-runtime, the host name that runtime sets. They want their own name for the machine. There is no command for it and no config key. The only override isREASON_NETWORK_MACHINE(src/util.rshostname()), and it only reaches a daemon started from a shell that has it set, not one the login service (launchd/systemd) starts.Where the name comes from on main:
src/util.rs:8-16hostname():REASON_NETWORK_MACHINE, else the slugged short host name, elsemachine.src/daemon/mod.rs:216-220: used only when this machine is not in the signed roster. In a team, the roster entry'smachinestands.src/daemon/teamops.rsinit (239, 261), join (329), and 379/515/528/622 send or signself.machine.Change
machineinconfig.toml(optional, not written unless set), read in the same place:REASON_NETWORK_MACHINE, thenmachine, then the host name. It goes through the sameutil::slugas the other two, so it meets the roster'splain_namesrule (lowercase ASCII, digits,-, at most 64 bytes; slug stops past 40).Deliberately not in this PR: renaming a machine already in a team
In a team, a machine's name is its signed roster entry. The roster merge (
src/team.rsmerge, "A machine may sign its own departure, never its own return") refuses an active entry a machine signs for itself, so a self-signed rename would be dropped by every peer on every build, today's included. Allowing it would change the roster protocol:@machineaddresses would then differ from machine to machine.So
reason-network renameneeds its own design (for example, another member's machine signs the new entry). Until then the way to change it is: setmachine, then leave and join again. Mail queued for the machine is kept by peers per endpoint id, not per name, so it still arrives. Addresses written with the old@machinestop resolving.Guarantees
machine.Verification (run)
cargo test: 254 + 2 passed.cargo clippy --all-targets: no warnings.cargo fmt --check: clean.REASON_NETWORK_HOMEwithmachine = "Rahul Almusca!":who --jsonbefore a team: machinerahul-almusca;init testteam --as rahul --no-setup: roster machinerahul-almusca;machine = "other"and the daemon restarted:team --jsonstillrahul-almusca(the roster stands).Uncertainty
cli/network-sign-in.tssendshostname()to/network/start). That is display only.🤖 Generated with Claude Code