fix(lightsail): derive Remote Control name from the public host - #156
Open
defangdevs wants to merge 1 commit into
Open
fix(lightsail): derive Remote Control name from the public host#156defangdevs wants to merge 1 commit into
defangdevs wants to merge 1 commit into
Conversation
The Lightsail template hardcoded remoteControlName = "<user>@<stack>", so the entry in the Claude apps named the CloudFormation stack — which says nothing about how to reach the box — and pinned one name for every session the user runs, since remoteControlName is per-user rather than per-session. Drop it and set remoteControlHost = hostname instead, mirroring aws/template.yaml. Sessions are then identifiable as "<user>-<session>@<host>", where <host> is the sslip.io address the box is actually reached at, and runtime-added sessions get distinct names. The stack Output moves in lockstep (it advertised the old name), using the same dashed-IP form the userdata bakes into the hostname and that WebUrl already reports. The Fn::Sub StackName variable is now unused, so it goes too. README's EC2 walkthrough claimed the same <UserName>@<stack name> shape; that has been stale since aws/template.yaml started setting remoteControlHost, so it is corrected here as well. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01PsqGhkpjsb4kKAdVz25xKN
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.
Problem
aws/lightsail-template.yamlhardcoded the Remote Control session name:Two issues with that:
remoteControlNameis a per-user option, so it pinned one name across every session that user runs. Sessions added at runtime all collided on the same label.The EC2 template already does the right thing (
aws/template.yaml:634), so this was Lightsail-only drift.Fix
Drop the hardcoded name and set
remoteControlHost = hostnameat theservices.agent-boxlevel, mirroring EC2. The module then derives<user>-<session>@<host>per session, where<host>is the sslip.io address the box is actually reached at.Before → after, for stack
my-boxat1.2.3.4:agent@my-boxagent-main@1-2-3-4.sslip.ioThree coupled edits fall out of it:
RemoteControlSessionOutput advertised the old shape, so it moves in lockstep. It uses the same dashed-IP form the userdata bakes intohostname(tr . -) and thatWebUrlalready reports — verified the two agree.Fn::SubStackNamevariable is now unreferenced in the userdata, so it is removed.UserNameparameter description mentioned the old<user>@<stack>shape.Also here
README.md:43documented<UserName>@<stack name>for the EC2 walkthrough. That has been stale sinceaws/template.yamlstarted settingremoteControlHost— it is corrected in the same pass since it is the identical claim.Verification
yamllintparses the template clean (withkey-duplicatesenabled).hostnameis in scope whereremoteControlHostnow reads it — sameletblock,aws/lightsail-template.yaml:368.${StackName}reference inside theFn::Sub: none.Not deploy-tested — I have no Lightsail stack to launch, and the change is in userdata that only runs on first boot. Worth a real launch before merge if you want the Output confirmed end-to-end.
🤖 Generated with Claude Code
https://claude.ai/code/session_01PsqGhkpjsb4kKAdVz25xKN