- Building

It's in ../README .

If you expected the README to be full of Github-style bullshit and promotional
material and build status and animated GIFs of screen recordings of people using
the software, I sympathize.  Good news: all of the information in the README is
included because it is expected to be useful to *someone*.

The sole exception is the slick fuckin' block lettering at the top.

- Theory of Operation

The program expects to have read/write access to the directory in which it is
invoked.  It creates two directories: `accounts` and `log`.  If there is a file
called bbs_config.json, that file will be read and used.  If you want an MOTD,
add a file called `motd.txt`.  Users will be able to write on the bathroom wall,
that goes into `rumors.txt`.  There is minimal effort to keep `rumors.txt` from
including duplicate data or filling up your disk; its size is capped at the size
of a high-density 3.5" floppy disk (ten gross kilobytes).

The first argument to the program is a username.  It can't include "/", but
otherwise whatever you can name a file.

Because the accounts files and can contain tokens and passwords, you will want
to make sure not to botch the permissions on `accounts`.  (Lazy admins get
owned.)

You might want to make a wrapper script that sets proxy variables.  The standard
$http_proxy and $https_proxy variables are respected.  If you want to log into a
Tor-only instance, you will need to set them.

- Single-user

Just run `fedibbs $username`.  Tested on Plan 9 and Linux.

It does expect to be in the directory where its data is.  You can write a
wrapper script, chroot it, whatever.

- OpenSSH

To deploy it for opensshd, it works like gitolite but without the automatic
management.  You create a dedicated user on the OS, and then make use of an
(apparenly little-known) OpenSSH feature that allows you to pin pubkeys to
specific shells in the .ssh/authorized_keys file.  Easy:

	# useradd -m -d /opt/fedibbs fedibbs
	# mkdir /opt/fedibbs/.ssh
	# chmod 700 /opt/fedibbs/.ssh
	# touch /opt/fedibbs/.ssh/authorized_keys
	# chmod 600 /opt/fedibbs/.ssh/authorized_keys
	# chown fedibbs:fedibbs /opt/fedibbs/.ssh /opt/fedibbs/.ssh/authorized_keys
	# cat >> /opt/fedibbs/.ssh/authorized_keys
	command="/path/to/bin/fedibbs firstuser",no-port-forwarding,no-X11-forwarding,no-agent-forwarding,no-pty ssh-rsa $the_actal_contents_of_the_key firstuser@hosta
	command="/path/to/bin/fedibbs otheruser",no-port-forwarding,no-X11-forwarding,no-agent-forwarding,no-pty ssh-rsa $contents_of_the_other_key whoever@hostb
	^D
	# echo Or just go crazy with it.
	# cat /home/*/.ssh/*.pub | awk -f doc/adduser.awk
	# curl https://github.com/samyk.pub | awk -f doc/adduser.awk

If it doesn't work, keep in mind that sshd will ignore the authorized keys
completely if the file permissions are too open.  Check your ssh logs.

So now, whoever@hostb can do this from another system:

	whoever@hostb:~$ ssh fedibbs@server

And then they'll be prompted to set up an account.  If you are using an inferior
operating system where your shell lives inside a VT-100 emulator and you want
line-editing or history or whatever, use rlwrap:

	firstuser@hosta:~$ rlwrap ssh fedibbs@server

bash made the mistake of putting line-editing in the shell instead of the
terminal, and other programs followed suit.  FediBBS does not make this mistake.
I recommend using Plan 9.

- Inferno

Even easier.  The server on Inferno looks like this:

	% listen -v 'tcp!*!10122' {os -d /opt/fedibbs /path/to/bin/fedibbs $user &}

Inferno handles the authentication and encryption and setting $user, just
dial(1).  Anyone with an account on the auth server can now connect, and `$user`
will be set by the auth system.

- The TRS-80 Model 100

I don't own a DEC VT-100, because a working one costs something like $10,000
last time I checked.  (Feel free to donate one if you want official support.)

But you can get a Model 100 for about $50 to $100, plus the cost of four AAA
batteries and a serial cable (DB-25 on one end and DB-9 on the other), and a
machine to actually run FediBBS.  You can then enjoy fedi at 19200 baud on a
40x4 character screen!  No UTF-8 support, unfortunately; the machine was built
in 1983.  Essentially the same hardware went into the NEC PC-8201, there was an
Olivetti model; there were several revisions of each (no UTF-8 on any of them!),
and instructions will be similar until we open the TERM program, after which,
please consult your manual.

For the host machine, these instructions are going to be tailored to a Unix-like
system with a regular init daemon and agetty and what-have-ye.  To set up a
terminal server if your OS is not Unix, please consult your manual.  If you made
the mistake of using Oracle's init daemon ("SystemD"), please consult a series
of web pages, the Wayback Machine for some of RedHat's old docs, the CVE list,
some flame wars in some now-locked Github issues to fill in the gaps on the CVE
list, and then read between the lines on Lennart Poettering's blog, and then
give up and get a real operating system (or at least a Linux).

Anyway, tack this onto your inittab:

	s1:2:respawn:/sbin/agetty -L 19200,8N1 ttyS0 dumb -a fedibbs --login-program /path/to/fedibbs --login-options bbsusername

If you want to use a better terminal type than "dumb", see
https://bytemyvdu.wordpress.com/2016/09/03/tandy-trs80-m100-serial-terminal/

Cheat sheet for the "98N1E,10" for 19200bps, "88N1E,10" for 9600bps.  The
settings are in the manual.  If you have the hardware and are missing the
manuals, http://www.club100.org/ has a lot of documentation and ROM dumps and
all kinds of amazing shit.
