mirror of
https://github.com/D-Modem/bbs.git
synced 2026-11-28 17:38:04 -08:00
[general] database = takes SQLite's file as before, or a server's address: postgres://... (pgx) or mysql://... / mysql:DSN (go-sql-driver). The store's SQL is written once; internal/store's dialect gives each engine its forms of what differs: ? placeholders ($1 for PostgreSQL), ids returned by RETURNING or LastInsertId, upserts (ON DUPLICATE KEY UPDATE), INSERT OR IGNORE, GREATEST, booleans, unique violations, column checks for migrations, indexes. The schema is one list with types per engine: names match in any case (NOCASE, an ICU collation made on PostgreSQL, utf8mb4_0900_as_ci), MySQL keeps indexed text in VARCHARs and connects with the SQL mode the store wants (ANSI quotes for "read" and "key", strict, rows matched not changed). Existing SQLite databases are kept as they are. bbs db copy DATABASE copies every table into a new database of any engine, keeping ids (PostgreSQL's sequences set after). Logs and bbs check never show a server's password. Under go test, BBS_TEST_DATABASE puts every test's store on a PostgreSQL or MySQL server (a schema or database each, dropped after): the whole suite passes on PostgreSQL 16 and MySQL 8.4 as on SQLite. The store's own tests check what the engines do differently, and copying from SQLite into each. Also: the FTP tests' readiness probe now waits to be counted out, so the per-address limit test no longer fails at random. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01AFQhReUqUc7F5srk2hViqr
2.5 KiB
2.5 KiB
Everything is done with the bbs command, on the configuration the BBS
runs with (-config FILE; without it, the defaults and bbs.db here).
These are safe to run while the BBS is serving.
Users
bbs user list
bbs user add NAME [-sysop] # asks for the password (or reads it from a pipe)
bbs user passwd NAME
bbs user lock NAME # and unlock
bbs user sysop NAME # and unsysop
bbs user del NAME # their mail goes; their messages stay
The database
bbs db copy DATABASE # into a new one: a path, postgres://..., mysql://...
See Databases.
Access
bbs user level NAME N # 0-255
bbs user flags NAME +AB -C # or AB: exactly those
bbs user waiting # under validated_level
bbs user validate NAME
bbs area require AREA READ POST # "30 F", sysop, - for none
bbs filearea require AREA DOWNLOAD UPLOAD
See Access levels.
SSH keys
bbs sshkey add USER FILE # each authorized_keys line in FILE (- : stdin)
bbs sshkey list [USER]
bbs sshkey del ID
Users add their own from their profile, or by the API: SSH.
Message areas
bbs area list
bbs area add NAME "DESCRIPTION" [-sysop-only]
bbs area del NAME # and its messages
bbs area newsgroup AREA GROUP # make it a newsgroup (- : no longer)
bbs area echo AREA TAG # make it a FidoNet echo (- : no longer)
A sysop also adds areas from the BBS (+ in the message areas) and
deletes any message. Newsgroups: Newsgroups and NNTP;
echoes: FidoNet.
File areas
bbs filearea list
bbs filearea add NAME "DESCRIPTION" [-sysop-upload]
bbs filearea del NAME
bbs file add AREA PATH ["DESCRIPTION"] # as the first sysop
bbs file list AREA
bbs file del AREA NAME
See Files and FTP.
Mail exchange
bbs news sync [PEER] # exchange articles with news peers now
bbs fido poll [LINK] # call FidoNet links now
bbs fido scan [LINK] # pack new mail into the outbound
bbs fido toss [LINK] # take in what has come
The server does all of these on its own schedule; these are for now.
The rest
bbs check # read the configuration, show its warnings
bbs init # make the database, with two areas
bbs [serve] # answer callers
See also: Running, Configuration