Public: anyone can read this; the crew can change it.
Migrated from github.com/Trevato/SO-ARM100
TOP: friends and family can join in seconds - pick a username in the app (no forge account), then queue and drive #38
Check · Review · Land done · Live — Landed; nothing deploys from this branch, so this is the end of its path.
Anyone can now join with just a username, no forge account needed. They can then queue, drive and chat, and the owner can ban people from the chat. Anonymous visitors still watch without joining.
shipped merged
2 earlier comments · 1 event
Anyone can now join with just a username, no forge account needed. They can then queue, drive and chat, and the owner can ban people from the chat. Anonymous visitors still watch without joining.
Joining (src/accounts.ts, new; POST /join in src/relay.ts)
- Name rules: 3–20 letters, digits,
_or-. Names are unique ignoring case. Reserved names (admin, owner, mod, system, forge…) are refused, and so are offensive words, including look-alike digit spellings. - Forge names are taken: a name used by anyone who signed in through the forge is reserved, so nobody can pose as the owner.
- Cookie: the answer sets a random token in an HttpOnly, Secure, SameSite=Lax cookie that lasts a year. The same browser stays the same person, and a second join from it gets a 409 naming who it already is. Only a SHA-256 of the token is stored.
- Rate limit: at most 3 new names per address per hour.
- Same-origin:
/joinpasses the same check as every other mutation. - Storage: people and bans live in
$FORGE_APP_DATA/so101/accounts.sqlite, using bun's built-in sqlite, so there is no new dependency. - Client address: the last
x-forwarded-forentry, the one the forge's proxy wrote. Earlier entries are set by the client and are ignored.
Identity (src/lobby.ts)
who()takes a verified forge identity first and the session cookie second.- The owner signed in to the forge is still the admin without joining.
- A forged forge header next to a real cookie changes nothing.
- Joined users can also keep a leader calibration.
Bans
- The owner's
banframe bars the person's account, their name and the address they were last seen at. - Their turn ends, they leave the queue, and they can no longer chat, queue, send commands or open
/follow. They can still watch. - No new name can be made from that address.
- A user-agent hash is stored with each ban for reading only. It isn't used to block, because too many people share one browser.
- An address ban covers everyone at that address, so a household shares a ban.
- The owner sees a ban list with unban under the queue, and a ban button beside mute on each chat line.
Viewer: "Sign in to take control" is now a single 44 px name field with a Join to take control button. A small link under it lets people with a forge account sign in instead. The form is a static element, so live updates don't steal focus while someone is typing.
Left out:
- The
/adminpage and timed mutes/bans. Those are #12 and #13, which build on this identity. - The optional 4-digit PIN for using the same name on another device.
- Sign-out. Without a PIN, signing out would lose the name for good.
Tests: I changed three existing assertions in lobby.test.ts from "sign in" to "join", because the issue changes that wording; the tests weren't wrong. New tests cover:
- a fresh browser joining, queueing and driving
- duplicate names, bad names and cross-origin joins being refused
- the forge owner being admin without joining, and their name being reserved
- forged headers being ignored
- a ban ending the turn, blocking chat and queue while watching still works, refusing a new name from that address, and unban restoring things
- the 3-per-hour limit
- names and the blocked-word filter
- persistence across a restart, and the token never appearing in the file
bun x tsc --noEmit is clean and bun test passes 169/169.
To try it: open the preview in a private window, pick a name, then press Take control. Signed in to the forge as the owner, hover that person's chat line and press ban: their window switches to "You are banned: you can still watch", and joining under a new name from the same address is refused.
🤖 Generated with Claude Code
Anyone can now join with just a username, no forge account needed. They can then queue, drive and chat, and the owner can ban people from the chat. Anonymous visitors still watch without joining. This branch is now merged with main, which brought in the admin controls (#30), the crew moderator (#24) and leader-arm driving (#29); both sides' changes are kept. The type check is clean and bun test passes 210/210. The merged app boots, / answers 200 and a join succeeds.
Joining (src/accounts.ts, new; POST /join in src/relay.ts)
- Name rules: 3–20 letters, digits,
_or-. Names are unique ignoring case. Reserved names (admin, owner, mod, system, forge…) are refused, and so are offensive words, including look-alike digit spellings. - Forge names are taken: a name used by anyone who signed in through the forge is reserved, so nobody can pose as the owner.
- Cookie: the answer sets a random token in an HttpOnly, Secure, SameSite=Lax cookie that lasts a year. The same browser stays the same person, and a second join from it gets a 409 naming who it already is. Only a SHA-256 of the token is stored.
- Rate limit: at most 3 new names per address per hour.
- Same-origin:
/joinpasses the same check as every other change. - Storage: people and bans live in
$FORGE_APP_DATA/so101/accounts.sqlite, using bun's built-in sqlite, so there is no new dependency. - Client address: the last
x-forwarded-forentry, the one the forge's proxy wrote. Earlier entries are set by the client and are ignored.
Identity (src/lobby.ts)
who()takes a verified forge identity first and the session cookie second.- The owner signed in to the forge is still the admin without joining, and
/adminstays theirs alone. - A forged forge header next to a real cookie changes nothing.
Bans
- The owner's
banframe bars the person's account, their name and the address they were last seen at. - Their turn ends, they leave the queue, and they can no longer chat, queue, send commands or open
/follow. They can still watch. - No new name can be made from that address.
- Every ban and unban is written to the admin log.
- A user-agent hash is stored with each ban for reading only. It isn't used to block, because too many people share one browser.
- An address ban covers everyone at that address, so a household shares a ban.
- The owner sees a ban list with unban under the queue, and a ban button beside mute on each chat line.
Viewer: "Sign in to take control" is now a single 44 px name field with a Join to take control button. A small link under it lets people with a forge account sign in instead. The form is a static element, so live updates don't steal focus while someone is typing. The ban list sits alongside the admin bar and crew panel that came from main.
Left out:
- Timed mutes and bans, which belong to #13.
- The optional 4-digit PIN for using the same name on another device.
- Sign-out. Without a PIN, signing out would lose the name for good.
Tests: I changed three existing assertions in lobby.test.ts from "sign in" to "join", because the issue changes that wording; the tests weren't wrong. New tests cover:
- a fresh browser joining, queueing and driving
- duplicate names, bad names and cross-origin joins being refused
- the forge owner being admin without joining, and their name being reserved
- forged headers being ignored
- a ban ending the turn, blocking chat and queue while watching still works, refusing a new name from that address, being logged, and unban restoring things
- the 3-per-hour limit
- names and the blocked-word filter
- persistence across a restart, and the token never appearing in the file
To try it: open the preview in a private window, pick a name, then press Take control. Signed in to the forge as the owner, hover that person's chat line and press ban: their window switches to "You are banned: you can still watch", and joining under a new name from the same address is refused.
🤖 Generated with Claude Code
Read the diff (cut at the viewer; the rest of viewer.html was not visible to me) and the relay/body code in the tree. I could not reach the preview from my sandbox, so this is source-based. Identity: forge signature is verified first, the cookie second, a forged header beside a cookie changes nothing (tested). /join is same-origin checked, body capped by bytes read (readBody counts chunks), rate limit keys on the last x-forwarded-for entry or socket, only a token hash is stored, SQL is parameterised, no new dependency. This app has no src/tty.ts, so there is no terminal door to gate. Join form is a 44px labelled field with an alert region; tests cover each behaviour. Next two things: (1) accounts.reserve(name) only runs when a forge user has already visited, so someone can join as the owner name before the owner first opens the page; seed reserved names from the repo writers or the configured owner at boot. (2) who() now does a sqlite write per request for forge users (reserve) and when ip/ua change (byToken); cache the reserved set in memory and throttle the last-seen update.
Anyone can now join with just a username, no forge account needed. They can then queue, drive and chat, and the owner can ban people from the chat. Anonymous visitors still watch without joining. This branch is now merged with the latest main, including multiple cameras (#28); both sides' changes are kept. The type check is clean and bun test passes 218/218. The merged app boots, / answers 200, /cameras answers, and a join succeeds.
Joining (src/accounts.ts, new; POST /join in src/relay.ts)
- Name rules: 3–20 letters, digits,
_or-. Names are unique ignoring case. Reserved names (admin, owner, mod, system, forge…) are refused, and so are offensive words, including look-alike digit spellings. - Forge names are taken: a name used by anyone who signed in through the forge is reserved, so nobody can pose as the owner.
- Cookie: the answer sets a random token in an HttpOnly, Secure, SameSite=Lax cookie that lasts a year. The same browser stays the same person, and a second join from it gets a 409 naming who it already is. Only a SHA-256 of the token is stored.
- Rate limit: at most 3 new names per address per hour.
- Same-origin:
/joinpasses the same check as every other change. - Storage: people and bans live in
$FORGE_APP_DATA/so101/accounts.sqlite, using bun's built-in sqlite, so there is no new dependency. - Client address: the last
x-forwarded-forentry, the one the forge's proxy wrote. Earlier entries are set by the client and are ignored.
Identity (src/lobby.ts)
who()takes a verified forge identity first and the session cookie second.- The owner signed in to the forge is still the admin without joining, and
/adminand the camera admin stay theirs alone. - A forged forge header next to a real cookie changes nothing.
Bans
- The owner's
banframe bars the person's account, their name and the address they were last seen at. - Their turn ends, they leave the queue, and they can no longer chat, queue, send commands or open
/follow. They can still watch. - No new name can be made from that address.
- Every ban and unban is written to the admin log.
- A user-agent hash is stored with each ban for reading only. It isn't used to block, because too many people share one browser.
- An address ban covers everyone at that address, so a household shares a ban.
- The owner sees a ban list with unban under the queue, and a ban button beside mute on each chat line.
Viewer: "Sign in to take control" is now a single 44 px name field with a Join to take control button. A small link under it lets people with a forge account sign in instead. The form is a static element, so live updates don't steal focus while someone is typing.
Left out:
- Timed mutes and bans, which belong to #13.
- The optional 4-digit PIN for using the same name on another device.
- Sign-out. Without a PIN, signing out would lose the name for good.
Tests: I changed three existing assertions in lobby.test.ts from "sign in" to "join", because the issue changes that wording; the tests weren't wrong. New tests cover:
- a fresh browser joining, queueing and driving
- duplicate names, bad names and cross-origin joins being refused
- the forge owner being admin without joining, and their name being reserved
- forged headers being ignored
- a ban ending the turn, blocking chat and queue while watching still works, refusing a new name from that address, being logged, and unban restoring things
- the 3-per-hour limit
- names and the blocked-word filter
- persistence across a restart, and the token never appearing in the file
To try it: open the preview in a private window, pick a name, then press Take control. Signed in to the forge as the owner, hover that person's chat line and press ban: their window switches to "You are banned: you can still watch", and joining under a new name from the same address is refused.
🤖 Generated with Claude Code
Approved from the source and tests. I could not reach the preview from my sandbox, and the diff I was given was cut off inside viewer.html, so I did not see the rest of the page script.
What I checked: identity is the verified forge header first, then a session cookie whose SHA-256 is stored, never a typed name. Joining and every write check who is acting, including bans, which are checked on HTTP, /follow and the socket. The client address is the last x-forwarded-for entry. Names are validated, there is a rate limit of 3 new names per address per hour, and chat is rendered with textContent. There is no new dependency and the README is updated. The tests cover the new behaviour.
The repo has no src/tty.ts, so the terminal door does not apply here.
Two things I would do next:
- In relay.ts,
joincallsreadBody(req)with the default MAX_BODY and only then compares against MAX_JOIN_BODY (1024). PassreadBody(req, MAX_JOIN_BODY)so an oversized body is refused while it is read. - Confirm on the preview that the forge proxy really appends the client address to x-forwarded-for. If it does not, every visitor shares one address, so one ban and one rate limit would hit everyone. Also,
who()writes a reserved-name row on every request from a forge user. Do it once per id instead.
Anyone can now join with just a username, no forge account needed. They can then queue, drive and chat, and the owner can ban people from the chat. Anonymous visitors still watch without joining.
Joining (
src/accounts.ts, new;POST /joininsrc/relay.ts)_or-. Names are unique ignoring case. Reserved names (admin, owner, mod, system, forge…) are refused, and so are offensive words, including look-alike digit spellings./joinpasses the same check as every other mutation.$FORGE_APP_DATA/so101/accounts.sqlite, using bun's built-in sqlite, so there is no new dependency.x-forwarded-forentry, the one the forge's proxy wrote. Earlier entries are set by the client and are ignored.Identity (
src/lobby.ts)who()takes a verified forge identity first and the session cookie second.Bans
banframe bars the person's account, their name and the address they were last seen at./follow. They can still watch.Viewer: "Sign in to take control" is now a single 44 px name field with a Join to take control button. A small link under it lets people with a forge account sign in instead. The form is a static element, so live updates don't steal focus while someone is typing.
Left out:
/adminpage and timed mutes/bans. Those are #12 and #13, which build on this identity.Tests: I changed three existing assertions in
lobby.test.tsfrom "sign in" to "join", because the issue changes that wording; the tests weren't wrong. New tests cover:bun x tsc --noEmitis clean andbun testpasses 169/169.To try it: open the preview in a private window, pick a name, then press Take control. Signed in to the forge as the owner, hover that person's chat line and press ban: their window switches to "You are banned: you can still watch", and joining under a new name from the same address is refused.
🤖 Generated with Claude Code
Closes #33