citadel style bbs for plan 9, written in rc



hg clone


9bbs is started by a listen(8) script that runs on an arbitrary port. The example files included with this distribution are setup to run on port 666, but may be modified to suit. The following instructions assume that a listener is already scanning the directory /rc/bin/service (true by default for cpu servers).

First, edit src/tcp666 to reflect the location of the 9bbs files on your system, and set any desired options. Edit etc/motd and etc/welcome according to taste.

Next, build and install the programs:

cd 9bbs/src
mk install
cd ..
mk log
mk perms

Note: 9bbs uses a modified copy of the Plan 9 pager, p(1). It is identical in all ways to the original except that the ! command for issuing shell commands has been removed. The resulting np binary is copied to $objtype/bin/, the tcp666 script is copied to /rc/bin/service/, and a log file is created in /sys/log/9bbs. All other 9bbs files remain within the 9bbs directory.

All of that completed, 9bbs will now answer telnet connections on port 666.


The following commands have been implemented:

[0-9]+  print specified message
b       back
C       change password
d [...]     delete message
D [...]     view, set message delimiter
>D      truncate message delimiter
e       enter message
E [...]     view, set editor (choices: sam, simple)
f       jump to first message
g [...]     list rooms with unread messages, go to specified room
h, help     print this help message
k [...]     print roomlist or grep for specified regexp
l       jump to last message
L [...]     view, set number of lines to print before engaging pager (enter to continue, q to quit)
man ...     read man page (man sam for help with the sam editor)
n       next
p, re [...]     print message with minimal headers
P [...]     print message with full headers
r [...]     reply to message
q       quit
S [...]     view, set signature
>S      truncate signature
u       list users
w       who is online
W [...]     view, set line wrap width
y       synchronize message list for current room
z       mark all messages (on the entire bbs) as read
" [...]     print message in quoted form, suitable for reply
?       print debug information


A room is a directory somewhere under rooms/ that contains at least one numbered message file. An example room has been included: rooms/lobby/. Room creation presently requires manual effort (script pending).

To create a room, copy the example directory rooms/lobby/ to the desired location and edit the initial message file rooms/[name]/1 to suit. Next, add the room name to etc/roomlist, add the initial message count to etc/rooms and (sorry) etc/users/*/rooms. Finally, run mk perms from the 9bbs install directory.

Note: any user account created after a room already exists will automatically pick up the existence of the room in their personal etc/users/[name]/rooms when the account is created.


The message format is as follows:

To: lobby
Date: Wed, 31 Dec 1969 19:00:01 EST
X-Date-N: 1

This is a placeholder message created to bootstrap the system.


• Add room creation command or script.