feat(settings): add browser setup and administration (#10)
This commit is contained in:
+12
-5
@@ -15,9 +15,11 @@ LAN/Tailscale addresses. No password is set initially: API access fails closed.
|
||||
`SHELLBOOK_PORT`, `SHELLBOOK_TRUSTED_PROXIES` (comma-separated proxy IPs),
|
||||
and `TS_AUTHKEY` in the host environment. Auth keys are transferred in a
|
||||
mode-0600 temporary file and removed, never stored in the service env.
|
||||
3. In the CT run the printed password command. It also accepts one password
|
||||
line on stdin; do not pass passwords as arguments. Source-checkout command:
|
||||
`SHELLBOOK_DATA_DIR=/var/lib/shellbook pnpm --filter @shellbook/server set-password`.
|
||||
3. Open ShellBook in your browser. In the CT run `cat /var/lib/shellbook/setup-token`
|
||||
and enter the token with a new password (at least 12 characters) in the setup screen.
|
||||
This token is private, survives restart, and is deleted after setup. It is never logged.
|
||||
Alternative password CLI: `SHELLBOOK_DATA_DIR=/var/lib/shellbook pnpm --filter @shellbook/server set-password`
|
||||
from the checkout (hidden prompt or one password line on stdin; never arguments).
|
||||
4. Run `claude` as shellbook and use `/login`. Authorize
|
||||
`/home/shellbook/.ssh/id_ed25519.pub` on managed hosts. The service user has
|
||||
no sudo access. Initialize notebooks manually if templates were absent.
|
||||
@@ -36,8 +38,13 @@ leaves the running service in place. Check `journalctl -u shellbook`.
|
||||
Configuration is `/etc/shellbook/env`; data is `/var/lib/shellbook` (back it up
|
||||
along with workspace and service-user home). `SHELLBOOK_SESSION_SECONDS` defaults
|
||||
to 2592000 (30 days). Cookies survive restart. Logout clears the browser cookie;
|
||||
password changes do not revoke existing cookies. For emergency revocation stop
|
||||
the service, delete `session-secret` from the data directory and start it again.
|
||||
Settings supports changing the password and signing out all sessions; both revoke
|
||||
older cookies and close active WebSockets, while the current browser receives a fresh
|
||||
cookie. CLI password changes invalidate cookies on their next request. For emergency
|
||||
revocation stop the service, delete `session-secret`, and restart it.
|
||||
Settings also shows paths, versions, and Claude CLI status, and opens the terminal
|
||||
for `claude` then `/login` as the service user. A credentials file's existence is only
|
||||
a hint, not proof that a login is valid.
|
||||
|
||||
Forward auth is off by default. To enable it set
|
||||
`SHELLBOOK_FORWARD_AUTH_HEADER=Remote-User` and trusted proxy IPs. The header is
|
||||
|
||||
+3
-1
@@ -122,7 +122,9 @@ systemctl enable shellbook
|
||||
systemctl restart shellbook
|
||||
cat <<'EOF'
|
||||
Next steps:
|
||||
1. Set the password (hidden prompt):
|
||||
1. Open ShellBook in the browser and enter the setup token shown by:
|
||||
cat /var/lib/shellbook/setup-token
|
||||
Alternative password CLI (hidden prompt):
|
||||
runuser -u shellbook -- env SHELLBOOK_DATA_DIR=/var/lib/shellbook node /opt/shellbook/apps/server/dist/cli/set-password.js
|
||||
2. Log into Claude as the service user:
|
||||
runuser -l shellbook -c '/home/shellbook/.local/bin/claude'
|
||||
|
||||
Reference in New Issue
Block a user