A GitHub login per room
Room · mainGH_CONFIG_DIR=~/.gonogo/gh gh: logged in as ulm0Room · clientGH_CONFIG_DIR=~/.gonogo/rooms/client/gh gh: not logged inA console of client$ gh auth login ? Where do you use GitHub? GitHub.com Logged in as client-bot (only room client)
Every agent of a room starts with GH_CONFIG_DIR=<the room's home>/gh, so the GitHub CLI (gh) logs in once per room, not once per machine. An agent of one room cannot push as another room's account. Room main: <gonogo home>/rooms/main/gh (<gonogo home>/gh on a home made before 0.9); another room: <gonogo home>/rooms/<id>/gh. Made (0700) when an agent starts.
Use it
- In a console of the room run
gh auth login; it writes only that room's folder. Other rooms and your own shell are untouched.gh auth statusin a console says who the room is. - Override:
GH_CONFIG_DIRin the environment gonogo itself runs in (containerenvironment:, shell) is kept for every room; a Clearance keyGH_CONFIG_DIR(hire or edit form, KEYS) sets it for one agent (not a reserved name). A Clearance keyGH_TOKENalso works for one agent: gh prefers it to any login. - Share the old login: agents used to use the machine user's
~/.config/gh. A room now has no login until someone logs in. To keep sharing, setGH_CONFIG_DIR=$HOME/.config/ghin gonogo's environment. gonogo never copies a login. - Docker: the room's home is under the home volume, so the login survives restarts and updates.
docker exec -it gonogo gh auth loginlogs in the container's shell, not a room: use a console of the room, or give the room's environment a token.
What breaks
git push: if~/.gitconfighascredential.helper = !gh auth git-credential,ghnow looks in the room's empty folder and a push fails with a credential error (not "logged out") until you rungh auth loginin a console of that room.- Clean Room: gets no GitHub login (the
ghfolder is not mounted,GH_CONFIG_DIRnot passed). If it must reach GitHub, give that agent a narrow Clearance keyGH_TOKEN.
Security
- This separates logins, it does not isolate them. Agents of every room outside a Clean Room run as the same OS user, so one can read another room's
gh/hosts.yml. A Clean Room is the only boundary. <room home>/ghholds the tokenghsaves (or the system keyring key). An agent inbypassPermissionsoutside a Clean Room runs as you and can read it. Log in as an account whose reach you accept, per room.
Tried
Tests start agents of two rooms and check the folder, its mode, the override by key and by environment, and that a Clean Room is not given it. A real gh auth login against GitHub was not run.