agentbbs/internal
Anthony Ettinger ce0758b0ec
Email members their git + mailbox credentials on provisioning (#57)
* feat(files): SFTP member storage — private workspaces + shared public area + mgmt TUI

Implements M4 (Files). A fully virtual Go SFTP server (pkg/sftp + crypto/ssh,
no OS users) wired as an "sftp" subsystem on the existing :22 wish listener, so
members reach their files with their login key:

    sftp files@bbs.profullstack.com     # scp/rsync ride the same endpoint

Identity is the SSH key (the username is conventional/ignored). Two areas per
session: a private, quota-limited /me workspace and a single shared public file
area /public (old-school BBS file area; world-read, members-only write by
default, operator-moderated). This reverses the old NG1 "no sharing" boundary in
favour of one sanctioned, inspectable sharing surface (PRD §9.3 amended).

internal/files:
- backend.go  service, layout, quota/usage, live-session registry, operator API
- fs.go       per-session virtual FS; resolve() is the single security
              chokepoint (area confinement + symlink-escape guard) + pkg/sftp
              request handlers
- server.go   subsystem handler: key auth -> member session -> request server,
              with byte metering and force-disconnect
- tui.go      in-BBS member browser (hub plugin "Files")
- admin.go    operator management TUI: sessions, workspaces/quotas, public area

Operator console: ssh sftp@<host> (allowlist-gated; sftpadmin@/filesadmin@
aliases) — list/disconnect sessions, set per-user quotas, revoke SFTP access,
toggle public write, moderate the public area.

store: files_access (per-user quota override + revoked) and files_settings
(public-write mode) tables + methods. main.go wiring guarded by AGENTBBS_FILES
(+ AGENTBBS_FILES_QUOTA_MB, default 1 GiB). Route names reserved.

Tests (incl -race): path traversal/confinement, symlink-escape rejection,
public-write ACL, quota enforcement, usage accounting, and an end-to-end run
against a real SFTP client. Docs: docs/files.md; PRD §5.3/§5.3.1/§9.3 + README
updated.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>

* Add notify-creds subcommand to (re)email members git + mailbox creds

`agentbbs notify-creds` backfills credential emails to verified members
who signed up before the git/mailbox welcome emails existed.

- git (all verified): forgejo.EnsureUserReset resets each account to a
  fresh one-time password (must-change) and emails the web login link,
  username, and password. New method since the original one-time
  password is not recoverable for existing accounts.
- mailbox (all verified): ensures the forwardemail alias and emails the
  address + webmail link.
- Preview by default; --send executes. --git/--mail/--user filters.
  Refuses --send without SMTP; warns+skips when Forgejo/forwardemail
  are unconfigured.

Also folds in the welcome-email functions (gitWelcomeEmailBody,
mailWelcomeEmailBody, EnsureUser password return, provisionGit/
ensurePremium sends) that this builds on. README ops + forgejo tests.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-23 03:48:11 -07:00
..
admin Fix/pod public html bind mount (#30) 2026-06-15 08:06:32 -07:00
ascii Video calls (PairUX→ASCII), agent@ chat, and finger routes 2026-06-11 11:43:38 +00:00
auth Merge remote-tracking branch 'origin/main' into feat/files-sftp 2026-06-23 10:42:32 +00:00
brand Use the Profullstack </> ASCII logo as the BBS banner 2026-06-14 16:46:59 +00:00
calls Video calls (PairUX→ASCII), agent@ chat, and finger routes 2026-06-11 11:43:38 +00:00
chat Video calls (PairUX→ASCII), agent@ chat, and finger routes 2026-06-11 11:43:38 +00:00
files feat(files): SFTP member storage — private workspaces + shared public area + mgmt TUI 2026-06-23 09:35:04 +00:00
forgejo Email members their git + mailbox credentials on provisioning (#57) 2026-06-23 03:48:11 -07:00
forwardemail Autonomous deploy + free-pod/Premium-email membership 2026-06-14 07:58:51 +00:00
games M3: AgentGames — agent-vs-agent games, ELO ladder, replays (#7) 2026-06-14 03:30:12 -07:00
hub Fix/pod public html bind mount (#30) 2026-06-15 08:06:32 -07:00
mail bbs.profullstack.com launch kit: provisioner, custom domains, email verify, ascii-live 2026-06-11 15:53:19 +00:00
mailbox Feat/mail all members (#55) 2026-06-23 03:38:31 -07:00
mailu Feat/mail all members (#55) 2026-06-23 03:38:31 -07:00
news fix: reject malformed NNTP OVER ranges instead of returning all articles (#48) 2026-06-22 05:22:58 -07:00
payments Rebrand paid tier to $99 Founding Lifetime Member 2026-06-14 12:46:23 +00:00
plugin fix(arcade): give ncurses games a TERM so they launch 2026-06-18 12:01:26 +00:00
pods feat(pods): SSH agent forwarding → git push from the pod with your key 2026-06-23 09:16:29 +00:00
qryptinvite Fix flaky TestTamperedTokenFails in qryptinvite 2026-06-14 17:05:30 +00:00
sandbox AgentBBS: M0 core hub, M1 arcade, pods with CoinPay membership 2026-06-11 11:08:17 +00:00
sites Free per-user homepages at <name>.<host> (wildcard subdomains) 2026-06-14 09:20:34 +00:00
source fix: block shared/reserved IP ranges in SSRF guard (#47) 2026-06-22 05:23:15 -07:00
store Merge remote-tracking branch 'origin/main' into feat/files-sftp 2026-06-23 10:42:32 +00:00
tor tor: premium tor-url / tor-irc / tor routes over Tor 2026-06-14 10:54:21 +00:00
ui Fix/pod public html bind mount (#30) 2026-06-15 08:06:32 -07:00