Repository navigation
Conversation
…7.12) roster setup and sync now write the user's own ~/.claude: an import of ROSTER.md in CLAUDE.md, and in settings.json the allow rules for ssh, scp, rsync and roster ls/check/run, the ~/.ssh deny rules, and an autoMode.allow entry ($defaults kept) so auto mode lets the logins through. On each Mesh Host the login user gets the same (a missing ~/.claude is made), and so does root through sudo -n, since Claude often runs as root: root's settings, an import of the login's ROSTER.md, and an Include of its own copy of the Mesh config (ssh refuses a config file another user owns). Where sudo asks for a password, root is left out with one hint line. `claude: false` in roster.yml opts out and takes it all out again; setup --undo removes it too. The user's own keys and rules are kept (serde_json writes keys sorted). ROSTER.md says Claude may log in. Also `make autocomplete`: install the bash completion and source it from ~/.bashrc, once; `make uninstall` removes the line.
Let Claude ssh to the Hosts from ~/.claude, for the user and root; make autocomplete (0.7.12)
UniFi OS consoles log in with a session cookie, not a header, so `roster web` couldn't reach them and dropped any service with `login: unifi` (which the Python roster had). roster now POSTs the Login to /api/auth/login, takes the TOKEN cookie and X-CSRF-Token from the reply's headers (curl -D -), and sends both in the stdin config. The session is kept up to 10 minutes in a 0600 file under $XDG_RUNTIME_DIR/roster/sessions (or ~/.cache), so a loop of calls logs in once instead of hitting the console's 429 limit. A kept session the console answers with 401 logs in again and retries once. HTTP 429 now says "too many logins" with a hint.
Add login: unifi to roster web
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.
roster 0.7.12
Install on a fresh machine, with every dependency (source only):
Since 0.7.11:
roster weblogs in to UniFi OS consoles (login: unifi, Add login: unifi to roster web #59). roster logs in at/api/auth/login, then sends theTOKENcookie and the CSRF token in curl's stdin config, never in argv. The session is kept for up to 10 minutes in a private file under$XDG_RUNTIME_DIR/roster/sessions(or~/.cache), so a loop of calls logs in once rather than hitting the console's HTTP 429 limit. If a kept session gets a 401, roster logs in again and retries once. A 429 saystoo many loginswith a hint.setupandsyncwrite~/.claude: an import of ROSTER.md, and allow rules for ssh, scp, rsync androster ls/check/run, plus the~/.sshdeny rules. Mesh Hosts get the same for the login user and, throughsudo -n, for root.claude: falseandsetup --undotake it out again.make autocompleteinstalls the bash completion.