# Ironbark BBS - sysop guide

Ironbark is a bulletin board system for Linux and Windows. One program does everything:
telnet, SSH and rlogin for callers, message areas and private mail, file areas with Zmodem and FTP,
door games (native ones, and DOS ones in DOSBox), FidoNet-style echomail with a built-in
binkp mailer and tosser, DOVE-Net and other QWK networks, QWK offline mail for callers, and a
web page with the sysop's admin pages.

Settings are plain text files. Screens are files you drop into a folder. Synchronet screen
files (Ctrl-A colour codes, @-codes) work as they are, so a Synchronet theme can be moved over.

## 1. Installing

### Linux

```
tar xf ironbark-VERSION-linux-x64.tar.gz
cd ironbark-VERSION-linux-x64
sudo ./install.sh
```

This puts the program in `/opt/ironbark`, makes a user called `ironbark`, sets up a new BBS
in `/var/lib/ironbark`, and adds the `ironbark` systemd service (not started yet). Then:

```
sudo nano /var/lib/ironbark/ironbark.toml                  # your BBS name, sysop, ports
sudo -u ironbark ironbark user add YOURNAME 99 -d /var/lib/ironbark
sudo systemctl enable --now ironbark
```

The service may use ports below 1024 (telnet 23). `sudo ./install.sh --uninstall` removes the
program and the service and leaves your BBS folder alone.

DOS doors need DOSBox-X (`sudo apt install dosbox-x`) or DOSBox.

### Windows

Run `ironbark-VERSION-windows-x64-setup.exe`. It installs the program, makes a new BBS in
`C:\IronbarkBBS`, and adds the **IronbarkBBS** Windows service. Tick **Firewall rule** on the
components page to let callers in from the network (or allow `ironbark.exe` in Windows
Firewall yourself). For a new BBS the components page also offers the **theme** (section 4)
and the **InterBBS oneliners** wall (section 3); an existing BBS keeps its own settings. Afterwards, from an administrator command prompt:

```
"C:\Program Files\Ironbark\ironbark.exe" user add YOURNAME 99 -d C:\IronbarkBBS
```

then restart the service (Services, or `sc stop IronbarkBBS` and `sc start IronbarkBBS`).
For DOS doors install DOSBox-X and put the full path of `dosbox-x.exe` in `[dosbox] program`.

### By hand

`ironbark init FOLDER` makes a new BBS folder anywhere; `ironbark run -d FOLDER` runs it in the
foreground (Ctrl-C stops it). `ironbark check -d FOLDER` checks the settings files.

If there are no users yet, the first person to sign up (type **New** at the login) becomes the
sysop. Adding yourself with `ironbark user add NAME 99` first is safer.

## 2. The BBS folder

| | |
|---|---|
| `ironbark.toml` | the system, servers, paths, DOSBox, gazette, timed events |
| `areas.toml` | message groups and areas |
| `files.toml` | file areas |
| `doors.toml` | door sections and doors |
| `ftn.toml` | FidoNet-style networks (optional) |
| `qwk.toml` | QWK networks such as DOVE-Net (optional) |
| `screens/` | **your** screens; they replace the built-in ones |
| `text/` | the built-in screens |
| `menus/` | custom menus (Rhai scripts) |
| `xtrn/` | doors; DOS doors see it as drive E: |
| `files/` | file areas |
| `dos/` | drive C: for DOS doors (KFOSSIL.COM is here) |
| `nodes/` | one folder per node, with the drop files |
| `data/ironbark.db` | users, messages, files and the log (SQLite) |

The Configuration program (section 18) edits every `.toml` file from inside the BBS and puts
the changes in use at once. After editing a `.toml` file by hand, press **Reload settings** on
the web admin's front page (or restart Ironbark). Listening addresses ([servers]), the node
count, the data folder and the binkp mailer's settings always need a restart. Screens and menus
are read each time they are shown, so they need nothing.

## 3. ironbark.toml

`[bbs]`: name, sysop, location, `qwk_id` (up to 8 letters), `hostname`, `nodes` (callers at
once), `new_user_level`, `new_user_minutes` (time a day), `max_calls_per_day`, the questions new
users are asked, `new_user_password` (for a private board), idle times, `timezone_name`
("AWST"), the main and file prompts, `default_editor` (the message editor new users start
with, see 5), and `logon`: what happens after logon, in order:

```
logon = ["screen:welcome", "bulletins", "oneliners", "gazette",
         "screen-nopause:menu/logoninfo", "mail", "newscan"]
```

Steps: `screen:NAME` (shown, then [Hit a key]), `screen-nopause:NAME`, `bulletins`,
`oneliners`, `gazette`, `lastcallers`, `automsg`, `mail` (offers to read new mail), `newscan`,
`door:CODE`, `script:NAME`.

`[bbs] theme`: the look of the BBS (section 4, Themes).

`[oneliners]`: the oneliners wall (the `oneliners` logon step and built-in program). With
`interbbs = true` it is the **shared InterBBS wall** that Synchronet BBSes use (echicken's
Synchronet Oneliners, `server = "bbs.electronicchicken.com"`, `port = 10088`): callers see the
newest lines from every BBS on it, as `name@BBS: text` (pipe colour codes in the lines are
shown as colours), and what they add goes on the shared wall, signed with your `[bbs] name`,
`hostname` and `qwk_id`. Guests can read it but not post to it. If the server can't be
reached, the BBS's own wall is shown instead (and a post goes there). `interbbs = false` (the
default) is a wall of this BBS's own. `show` is how many lines are shown (3-18). It can also be
switched on when setting up: `ironbark init FOLDER --interbbs-oneliners`, `--ask`, or the
Windows installer's components page; later in Configuration > Oneliners.

`[bbslist]`: the BBS list shared between BBSes over DOVE-Net, and this BBS's entry in it
(section 10, The BBS list).

`[servers]`: `telnet`, `ssh`, `rlogin`, `web`, `ftp` addresses ("0.0.0.0:23"); empty turns one
off (FTP is off until you set it, e.g. `ftp = "0.0.0.0:21"`; see 6 for `[ftp]`).
`rlogin_allow` lists the addresses rlogin is taken from (other BBSes you trust); with
`rlogin_trust = true` those callers need no password. Like Synchronet, rlogin takes the name and
password in either order: name first and password second (SyncTERM and most clients), or password
first and name second (Synchronet, DoorParty, Door Hub). The name is whichever field is a user. `web_terminal` (true or false) is the
terminal in the browser and `trusted_proxies` lists reverse proxies in front of the web server
(both in 14, The web terminal).

**RLogin straight to a door** (`rlogin_auto_door = true`, the default; Synchronet's
`rlogin_auto_xtrn`): an rlogin call whose terminal-type field is `xtrn=CODE` (a speed may
follow, `xtrn=CODE/115200`) is logged on, put straight into the door with that code and logged
off when the door ends, with no logon screens and no menus. This is how another BBS offers one
of your games: its rlogin door names your door in the terminal type (in Ironbark:
`rlogin_term = "xtrn=LORD"`). The caller must be allowed to use the door exactly as from the
door menu (the door's and its sections' level, access and sysop_only; time left, credits);
otherwise they are told it is not available and the call ends. `rlogin_auto_door = false`
treats such calls as ordinary rlogin logons.

**Ironbark as a Door Hub's game board** (Door Hub 0.2.0 and later): set `rlogin` to a local port
such as `"127.0.0.1:5513"` with `rlogin_allow = ["127.0.0.1"]`, put the shared doors in `doors.toml`,
and tell the hub `door_bbs ironbark`, `ironbark` (this program) and `ironbark_dir` (this folder). The hub
makes each player with `ironbark user ensure "Name (TAG)"`, which reads the password from standard
input, makes the user at the new-user level if needed, and prints `OK NUMBER NAME`.

SSH callers log in with their BBS name and password, or as `new` to sign up. The SSH host key
is made on first start in `data/ssh_host_ed25519_key`.

Levels: 0-99. 90 and above is a sysop (no time limit, the sysop menu, the web admin pages).

### New-user questions

Your own questions for new users (like Synchronet's new-user questions), asked at the end of
sign-up on the terminal and on the web sign-up page, after name, password, real name and
location:

```toml
[[newuser_question]]
prompt = "How did you find this BBS?"
kind = "choice"                  # "text", "yesno" or "choice"
choices = ["A friend", "A BBS list", "Searching the web"]
required = true                  # must be answered (a yes/no always is)

[[newuser_question]]
prompt = "Your favourite door game:"
kind = "text"
max_len = 30                     # longest answer (text; default 60)
```

The answers are kept with the user, put at the end of the "New user" mail you get, and shown in
the User Editor (key A on a user) and on the web admin's user page. They are also in
Configuration as a list (**New-user questions**). The first user (the sysop) isn't asked.

### Welcome mail

A new user gets a mail from the sysop as soon as the account is made (on the terminal and on
the web sign-up page), which the logon mail check then offers to read. It is the text file
`welcome-mail.txt`: `ironbark init` writes a plain one in `text/`; put your own in `screens/`
and it is used instead. The first line is the subject, then a blank line, then the body:

```
Welcome to @BBS@

Hello @ALIAS@,

Welcome to @BBS@. You are user number @UN@.
...
@SYSOP@
```

These @-codes are filled in, with the values they have on screens: `@ALIAS@` (`@USER@`),
`@FIRST@`, `@NAME@` (`@REALNAME@`), `@LOCATION@`, `@EMAIL@`, `@UN@` (`@USERNUM@`), `@LEVEL@`,
`@BBS@`, `@SYSOP@`, `@SYS_LOCATION@`, `@HOSTNAME@`, `@QWKID@`, `@DATE@` and `@TIME@`; other
codes and colour codes are not (it is a mail, not a screen). The file may be UTF-8 or CP437.
The mail is from the sysop's account (user #1), so a reply reaches you, and it shows in your
sent mail. No file, or an empty one, means no welcome mail: a BBS folder made before this was
added has none until you add the file (or run `ironbark init FOLDER` again, which only adds
missing files). The first user (the sysop) and users added with `ironbark user add` or the
User Editor get none.

## 4. Screens

Every screen is a file. Put yours in `screens/` with the name of the screen it replaces; the
built-in one in `text/` is then not used. The web admin page (Screens) can upload and preview.

### Themes

A theme is the look of the whole BBS: a set of screens and the colours of everything Ironbark
draws itself (prompts, lists, the full-screen sysop programs). `[bbs] theme` in ironbark.toml
names one; screens are looked for in your `screens/` folder first, then the theme's, then the
built-in ones in `text/`, so your own screens always win.

| Theme | Look |
|---|---|
| `ironbark` | the built-in screens; blue, cyan and yellow |
| `kalgoorlie` | the Kalgoorlie Retro Gaming BBS screens (logon, menus, information, log-off) |
| `outback` | red earth and gold: blues become red, cyans gold, boxes on black |
| `amber` | an amber-screen terminal: all of Ironbark's text amber on black |
| `green` | a green-screen terminal, the same in green |

Pick one with `ironbark theme use NAME` (`ironbark theme` lists them, `*` = in use), in
Configuration > BBS settings > Theme, or when setting up: `ironbark init FOLDER --theme NAME`,
`--ask` (the Linux installer asks), or the Windows installer's components page. A running BBS
takes a change at the next Configuration save (or a restart).

Each theme is a folder `themes/NAME` with `theme.toml` and, if it has its own screens,
`themes/NAME/screens/`. `ironbark init` writes the built-in ones there (missing files only), so
the easiest way to make your own is to copy one:

```toml
title = "Outback"
description = "Red earth and gold."
recolour_screens = true   # the colours apply to screen files written with colour codes too
[foreground]              # the text colour each one becomes
blue = "red"
cyan = "yellow"
[background]              # the background each one becomes
blue = "black"
```

Colours are black red green yellow blue magenta cyan white. ANSI art (`.ans` with escape
codes) always keeps its own colours. The web admin's Screens page lists the theme's screens;
editing one saves your own copy in `screens/`.

| Name | Shown |
|---|---|
| `answer` | before the login prompt |
| `newuser` | before sign-up |
| `badpassword` | after a wrong password |
| `welcome` | after logon (the standard logon sequence) |
| `random_*` | one picked at random, wherever a screen name has a `*` |
| `bulletin1`, `bulletin2` ... | each shown once at logon, and again when the file changes (the sysop's Bulletin Manager, section 18, looks after them) |
| `bullseye` + `bullseye.cfg` | the bulletin list (Synchronet BullsEye format) |
| `menu/main` | the main menu (`main.ans` at the top of `screens/` works too) |
| `menu/head`, `menu/tail` | often included by other menus |
| `menu/logoninfo` | your statistics at logon |
| `menu/transfer`, `menu/e-mail`, `menu/qwk`, `menu/maininfo`, `menu/sysmain` | section menus |
| `menu/xtrn_sec_head`, `menu/xtrn_head` | above the door section and door lists |
| `menu/msghdr` | the message header (built-in one if missing) |
| `menu/logoff` | when callers leave |
| `system` | system information (I, I) |
| `textfiles/*` | the G text file section |

Formats, by file ending:

- `.ans`, `.asc`: ANSI art. Ctrl-A codes and @-codes work here too.
- `.msg`: Synchronet style, Ctrl-A colour codes (`^Ah^Ay` = bright yellow).
- `.pcb`: PCBoard `@X1F` colour codes.
- `.pip`: Renegade/Mystic pipe codes (`|07`, `|14`, `|17` for backgrounds).
- A `.40col` version (`main.40col.msg`) is used for terminals narrower than 80 columns.
- SAUCE records are ignored. A UTF-8 file starting with a byte-order mark is converted.

@-codes are filled in when shown, for example `@BBS@`, `@SYSOP@`, `@ALIAS@`, `@NODE@`,
`@TIME@`, `@DATE@`, `@TLEFT@`, `@MINLEFT@`, `@CALLS@`, `@LASTDATEON@`, `@UPTIME@`, `@TCALLS@`,
`@MAILW@`, `@CONN@`, `@IP@`, `@COLS@`, `@ROWS@`, `@CHARSET@`, `@GRP@`, `@SUB@`, `@DIR@`,
`@MSG_SUBJECT@`, `@MSG_FROM@`, `@MSG_DATE@` ... Widths as in Synchronet: `@ALIAS-L20@`
(left in 20), `@NODE-R4@` (right in 4), `@TIME-L@` (the width of the code itself).
`@INCLUDE:%zmenu/head.msg@` and `@MENU:../banner*@` include other screens; `@SYSONLY@ ...
@SYSONLY@` is only shown to sysops; `@CLS@` and `@PAUSE@` do what they say.

System statistics (see 14, Statistics): `@TCALLS@` (calls in all), `@TODAYCALLS@`,
`@TPOSTS@`, `@TODAYPOSTS@`, `@TEMAIL@`, `@TODAYEMAIL@`, `@TUSERS@` (users on file),
`@TNEWUSERS@`, `@TODAYUSERS@` (new users today), `@TUPLOADS@`, `@TODAYUPLOADS@`,
`@TDOWNLOADS@`, `@TODAYDOWNLOADS@`, `@TMINUTES@`, `@TODAYMINUTES@`, and Synchronet's names:
`@STATS.LOGONS@`, `@STATS.LTODAY@`, `@STATS.TIMEON@`, `@STATS.TTODAY@`, `@STATS.ULS@`,
`@STATS.ULB@`, `@STATS.UTODAY@`, `@STATS.ULBTODAY@`, `@STATS.DLS@`, `@STATS.DLB@`,
`@STATS.DTODAY@`, `@STATS.DLBTODAY@`, `@STATS.PTODAY@`, `@STATS.ETODAY@`, `@STATS.NUSERS@`
(new users today, as in Synchronet), `@STATS.POSTS@`, `@STATS.EMAIL@`, `@STATS.SINCE@`.

### Editing screens in the browser

The web admin's Screens page has an **Edit** button on each screen and a **New screen** button.
The editor draws with a VGA font in the 16 DOS colours, 80 columns (40 to 132 can be chosen),
and grows downwards as you type.

- Type at the cursor; arrows, Home/End, PgUp/PgDn, Enter, Backspace, Delete, Tab. Insert switches
  between insert and overwrite.
- F1-F10 type a character from the current set (TheDraw-style: lines, double lines, blocks and
  shades ...); Shift+F1-F10 or the arrows beside the set choose the set. The character chart
  picks the current character (Shift-click types it).
- Colours: click a colour for the foreground, right-click or Shift-click for the background.
  Ctrl+Up/Down and Ctrl+Left/Right step through them; Alt+U picks up the colour under the
  cursor, Alt+click picks up colour and character. Tick iCE colours for 16 backgrounds (SyncTERM
  shows them; other terminals blink instead).
- Tools: Type/select (drag or Shift+arrows to select), Paint, Recolour, Half-block (two "pixels"
  a cell), Line and Box (single or double lines that join up with lines already there, or the
  current character).
- With a selection: Copy, Cut, Paste, Move (arrows or drag, then Enter or click to drop, Esc to
  cancel), Fill, Colour, Erase. +Row/-Row/+Col/-Col insert and delete at the cursor.
  Ctrl+Z/Ctrl+Y undo and redo.
- @-codes are typed as text (`@ALIAS@`, `@TLEFT@` ...). "Show @-codes filled in" shows them
  with sample values; "Caller's view" shows the last 80x25 a caller sees.
- "Caller's cursor ends" sets where the cursor is left after the screen, which is where a menu
  prompt appears. A screen read from a file keeps what the file did.

**Save** always writes to `screens/` (a built-in screen in `text/` is never changed): as `.ans`
(ANSI, CP437, CR LF, with a SAUCE title/author/group if ticked), or as `.msg`/`.asc` with
Synchronet Ctrl-A codes. The version it replaces goes to `screens/.backup/` with the date and
time on its name; another file of the same name with a different ending (say `main.msg` when
you save `main.ans`) is moved there too, so the new one is shown. **Download .ans** saves a
copy to your computer and **Import .ans** reads an `.ans`, `.msg`, `.pcb` or `.pip` file from
your computer into the editor. `.pcb` and `.pip` screens open in the editor and are saved as
`.ans` or `.msg`.

Terminals: Ironbark finds out ANSI, the window size and UTF-8 by itself (SyncTERM, NetRunner and
other BBS terminals get CP437; xterm-style terminals get UTF-8). Callers can change it with D.

## 5. Message areas (areas.toml)

```
[[group]]
name = "Local"

[[group.area]]
code = "GENERAL"        # unique
name = "General"
short_name = "General"  # optional, for prompts
read_level = 0
post_level = 0
default_scan = true     # in new users' new-message scan
max_msgs = 1000         # trimmed nightly (0 = keep all)
```

Echomail areas add `ftn_network` (a network in ftn.toml) and `ftn_tag`; QWK network areas add
`qwk_hub` and `qwk_conf`. Private mail lives in its own area and needs no setting.

A networked area has three settings of its own for the line added under each post sent out,
the same three as Synchronet's Network Options (in Configuration they are in each message
area's settings):

- `origin_line`: the text of the origin line on echomail posted from the area
  (` * Origin: your text (your address)`). Empty = `origin` from ftn.toml.
- `qwk_tagline`: the tagline on posts to a QWK network. Empty = `tagline` from qwk.toml.
- `add_tagline = false`: add no tear line and no origin line or tagline at all (normally
  left on; echomail networks expect an origin line).

```toml
[[group.area]]
code = "FSXNETFSX_RETRO"
name = "Retro Computing"
ftn_network = "fsxnet"
ftn_tag = "FSX_RETRO"
origin_line = "My BBS - the retro corner"
```

Access strings (see section 17) can be added on top of the levels: `access` on a group,
`read_access` and `post_access` on an area. `moderated = "!SYSOP"` (or any access string) makes
posts from callers who match it wait for the sysop: they are not shown or sent to the networks
until approved with V in the sysop menu.

Reading: Enter/+ next, - previous, a number to jump, R reply, E reply by mail, P post, L list
titles, T show this thread, > and < next and previous message in the thread, D delete your own
message (sysops: any), M move a message to another area (sysops), N next area, Q quit.

### The message editor

Callers write messages and mail in the full-screen editor or the line editor. Each caller picks
one under **D**, Your settings, **E** Message editor. The full-screen editor is used when the
caller chose it and the terminal is ANSI with at least 16 rows; otherwise the line editor comes
up. New users start with `default_editor` in `[bbs]` ("full", the default, or "line"); this also
applies to users made with `ironbark user add`. Users brought over from Synchronet start on the
line editor and can switch.

The full-screen editor shows To, Subject and Area at the top, the text in the middle and a status
line at the bottom. Text wraps by itself at the window width (79 at most) and closes up again
when words are deleted; Enter ends a paragraph. The keys: arrows, Home/End, PgUp/PgDn,
Ctrl-Left/Right (word), Ctrl-E/X/S/D (up/down/left/right), Insert or Ctrl-V (overtype), Tab,
Ctrl-Y (delete the line), Ctrl-L (redraw), Ctrl-A (colour code), Ctrl-Q (quote), Ctrl-Z or `/S`
on a line by itself (save), `/A` (abort), Ctrl-C (abort), Esc (menu: Save, Abort, Quote, Help,
Continue). When replying, Ctrl-Q opens a window of the original message: Space marks lines, A
marks all, N none, Enter puts the marked lines (or the one under the bar) in as ` XX> text`.
Restriction J turns quoting off and restriction A colour codes. The screen sends only the
characters that change, so it works on slow links too.

## 6. File areas (files.toml)

```
[[area]]
code = "MAIN"
name = "Main files"
path = "main"           # under files/, or a full path
download_level = 0
upload_level = 90
```

Copy files into the folder and they appear. Descriptions come from `FILES.BBS` (or
`DESCRIPT.ION`) in the folder, or `FILE_ID.DIZ` inside zips. Callers download with Zmodem,
Ymodem or Xmodem (Z is the default), as a batch.

The File Manager (section 18, or the web admin's Files page) edits descriptions, moves, copies
and removes files, lists files in a folder that aren't listed yet (and records whose file has
gone), and imports a FILES.BBS list.

**Upload validation.** With

```
[uploads]
validate = true
```

new uploads (terminal and FTP) are listed as waiting: only sysops and the caller who sent the
file see them, until you validate them in the File Manager (V) or on the web admin's Files
page. Sysops' own uploads never wait. Off by default.

### FTP

With `[servers] ftp = "0.0.0.0:21"` callers can use any FTP client (FileZilla, WinSCP, a
browser add-on, `curl`, `lftp`, Windows Explorer) with their BBS name and password, as on
Synchronet. The top folder holds one folder per file area the caller may see, **named by the
area code** (`MAIN`, `UPLOADS`; any case works); inside are the area's files with their sizes and
dates. Nothing else on the computer can be reached: paths are only matched against area codes
and the file list, `..` stops at the top, and links that point out of an area folder are not
shown or sent.

The terminal's rules apply. Downloads: restriction D refuses them, credits are charged and the
ratio is checked (section 17), and the download is counted (the file's download count, the
caller's downloads and bytes, credits taken) only when the whole file has gone. Clients can
resume a broken download (REST); a resumed download is charged in full when it finishes, an
unfinished one costs nothing. Uploads go only into areas the caller may upload to
(`upload_level`, `upload_access`, not with restriction U, never guests). Each file lands in the
temp folder first and gets the same checks as a Zmodem upload (`file.can`, duplicates, the zip
test and `test_commands`, `scan_command`, the quarantine folder); then it moves into the area,
with its `FILE_ID.DIZ` as the description (empty otherwise; the caller or sysop can add one
later), and earns upload credits. A name already in the area is refused, so files are never
overwritten. FTP callers can't delete, rename or make folders. Restriction T (no file section)
refuses the FTP login. Deleted users can't log in; a failed login counts towards
`[security] max_login_failures` like any other, and `ip.can`, `ip-silent.can`, `host.can` and
blocks apply on connect. The log shows `ftp: NAME logged in from IP`, downloads, uploads and
refusals. FTP callers don't take a node and aren't in Who's online.

```
[ftp]
passive_port_min = 50000      # data connections (passive mode) use these ports
passive_port_max = 50099
passive_address = ""          # behind NAT: your public IPv4 address or host name
anonymous = true              # "anonymous" or "ftp" logs in as the guest account
max_sessions = 10             # FTP connections at once
idle_timeout_secs = 300
max_upload_mb = 512           # largest upload taken
```

- **Anonymous**: with `anonymous = true` and a guest account (`ironbark user add Guest 10
  --guest`, the name in `[security] guest_name`), the names `anonymous` and `ftp` log in as the
  guest with any password (an e-mail address, by custom). Guests only download, from the areas
  the guest may see (`download_access = "!GUEST"` hides an area). `false` refuses the guest
  account over FTP.
- **Firewall and router**: open the FTP port (21) **and** the passive range. On a router,
  forward both to the BBS computer and set `passive_address` to your public address or host
  name (callers from private addresses, 10.x, 192.168.x, 172.16-31.x, 100.64.x, still get the
  BBS's own address). Active mode (PORT/EPRT) also works, but only back to the caller's own
  address and to ports from 1024 up, so the server can't be used to attack someone else.
  Linux: the systemd service may bind port 21 (CAP_NET_BIND_SERVICE); with ufw, for example,
  `sudo ufw allow 21/tcp` and `sudo ufw allow 50000:50099/tcp`. Windows: the installer's
  **Firewall rule** allows `ironbark.exe` on every port, so the passive range is covered.
- **No encryption**: this is plain FTP; names, passwords and files cross the network as they
  are, as with telnet. There is no FTPS (TLS) and no SFTP. Callers who care can use SSH and
  Zmodem instead.
- Transfer type A (ASCII) is accepted, but files are always sent as they are (binary).

## 7. Doors (doors.toml)

```
[[section]]
code = "GAMES"
name = "Games"

[[section.door]]
code = "LORD"
name = "Legend of the Red Dragon"
kind = "dos"
dir = "lord"            # xtrn/lord = E:\LORD
command = "start.bat %#"
fossil = true           # load KFOSSIL first
```

Kinds:

- `dos`: a DOS door, in its own DOSBox-X (or DOSBox) per caller, with no window. Drive C: is
  `dos/`, D: is the node folder with the drop files, E: is `xtrn/`. The caller is connected to
  COM1 (3F8, IRQ 4) through DOSBox's serial port. FOSSIL doors need `fossil = true`: KFOSSIL is
  loaded first. Under DOSBox-X the door sees real carrier detect, so a caller hanging up is
  noticed at once and the door saves and exits; plain DOSBox has no carrier line, so there
  KFOSSIL reports carrier as always on. Use DOSBox-X: it also has SHARE (file locking), which
  doors such as TradeWars 2002 need.
- `native`: a Linux or Windows program. `io = "stdio"` (the default) runs it on a
  pseudo-terminal (Linux) or pipes (Windows); `io = "socket"` gives it a DOOR32 socket handle
  (%h, and line 2 of DOOR32.SYS).
- `rlogin` / `telnet`: passes the caller to another system: `host = "192.168.1.20:5130"`,
  `rlogin_user` (default: the caller's name), `rlogin_server_user` (`%p` passes the password
  the caller logged on with), `rlogin_term` (LORD Server uses `xtrn=A`). **Door Hub**: point an
  rlogin door at the connector's local port with `rlogin_term = "xtrn=CODE"`.
  **DoorParty**: run DoorParty's connector as usual and add rlogin doors pointing at it, with
  `rlogin_user = "%k"` (the caller's own DoorParty password, made once and kept, as Synchronet
  does), `rlogin_server_user = "%a"` and `rlogin_term` set to the DoorParty game code (`lord`,
  `tw2002` ..., or empty for the full list). Synchronet's Door Hub connector works the same way
  with `rlogin_user = "%{doorhub}"`.
- `bbslink`: a BBSLink.net game. Put the codes BBSLink gave you in ironbark.toml:

  ```
  [bbslink]
  syscode = "..."
  authcode = "..."
  schemecode = "..."
  ```

  and set the door's `command` to the BBSLink door code (`lord`, `teos`, ... or `menu`).
- `builtin`: `bulletins`, `oneliners`, `gazette`, `lastcallers`, `who`, `automsg`,
  `bbslist` (the BBS list, section 10), `script:NAME`, the two built-in games `minefield` and
  `ridgeguns` (below), and the sysop's programs `useredit`, `config`, `menuedit`, `fileman` and
  `bulletinmgr` (section 18).

Command codes: `%#` node, `%n` node folder (with a trailing slash; `D:\` for DOS), `%f`
DOOR.SYS, `%a` alias, `%u` user number, `%r` rows, `%c` columns, `%t` minutes left, `%h` socket
handle, `%p` password, `%k` the caller's DoorParty password, `%{NAME}` their password for
another service such as `%{doorhub}`, `%%` a percent sign. The Synchronet importer brings over
the DoorParty and Door Hub passwords Synchronet kept, so callers keep their accounts there.

A door can also have `access` (an access string, e.g. `"!GUEST"`) and `cost` (credits charged
each time; users with exemption X play free).

Every door gets DOOR.SYS, DORINFO1.DEF (and DORINFOn.DEF), CHAIN.TXT and DOOR32.SYS in its node
folder (in upper and lower case on Linux). Other options: `level`, `sysop_only`, `ansi_only`,
`single_node` (one caller at a time), `cycles` (DOSBox speed for this door).

When a caller hangs up inside a DOS door that doesn't notice by itself, Ironbark waits
`[dosbox] hangup_grace_secs` (120) for it to give up, then stops DOSBox.

Door maintenance runs as a timed event (below) with `dos = true`.

### Sections inside sections

A section with `parent` set to another section's code is a sub-menu of that section. It shows
in the parent's list among the doors, with a » after its name, in the order of doors.toml
(sub-sections written before the parent come before its doors, ones written after come after).
Choosing it opens it; Q or Enter goes back up one level. Sections nest to any depth.

```
[[section]]
code = "GAMES"
name = "Games"

[[section]]
code = "LORDGAMES"
name = "LORD games"
parent = "GAMES"          # shows as "LORD games »" in Games

[[section]]
code = "TESTS"
name = "Sysop tests"
parent = "LORDGAMES"
sysop_only = true         # hidden from everyone else
```

The door menu's first list has only the top-level sections (no `parent`). `level`, `access`
and `sysop_only` apply at every level: a sub-section a caller can't use is not shown, and
nothing inside it can be reached. The heading shows the path ("Games » LORD games External
Programs"), and `@XTRN_SEC@` gives the same path in `menu/xtrn_head`. A parent must be a section
that exists, a section can't be its own parent and there can be no loops; `ironbark check`,
Configuration and the BBS at start-up refuse such settings. In Configuration > Doors the
sections show as a tree and **Inside section** picks the parent; + and - move a section past its
neighbour at the same level. The web admin's Doors page shows the tree too.

### Built-in games

Two games come with Ironbark and need nothing installed. A new BBS has both in the Games
section; to add them to an existing doors.toml:

```
[[section.door]]
code = "MINEFIELD"
name = "Goldfields Minefield"
kind = "builtin"
builtin = "minefield"

[[section.door]]
code = "RIDGEGUNS"
name = "Ridge Guns"
kind = "builtin"
builtin = "ridgeguns"
```

**Goldfields Minefield** is a minesweeper game: open every safe square without opening an old
shaft. Cursor keys (or h j k l) move, Space or Enter opens, F or M puts a flag, and Space on an
opened number whose flags are all placed opens the squares around it. The first square opened
is never a shaft. Boards: Beginner 9 x 9 with 10 shafts, Intermediate 16 x 16 with 40, Expert
30 x 16 with 99. The **daily board** is an Intermediate board that is the same for every caller
that day, with a clear patch already opened; each caller gets one scored try (the first move
uses it) and can replay it unscored. Each board keeps its own top ten fastest times, shown
before and after a game. Callers without ANSI get a plain-text board and type squares such as
`C12` (row C, column 12) or `F C12` to flag.

**Ridge Guns** is a two-gun artillery game on a random ridge, drawn with block characters. Each
turn the gunner sets the angle (0-90) and charge (1-100) - Up/Down and Left/Right, PgUp/PgDn
for steps of 10, or A and C to type a value - and fires. The wind changes every turn, shells
dig craters, and a gun knocked to 0 loses. It needs ANSI.

- **Against the computer**: easy, medium or hard. The computer walks its aim in from where its
  shells land; the harder levels allow for the wind and wobble less.
- **Against another caller**: C lists the callers on other nodes; the one picked gets a node
  message and has two minutes to open Ridge Guns and accept. The moves pass through the
  database, so nothing else is needed. Each gunner has two minutes to fire. A caller who hangs
  up, gives up or runs out of time loses; if a session stops answering for 45 seconds, the
  other gunner is given the game.
- **Standings** shows wins and losses against callers and against the computer.

The scores live in the BBS database (tables `mines_scores`, `mines_daily`, `ridge_matches`,
`ridge_moves`, `ridge_results`). Node messages that arrive during a game are shown after it.

## 8. Timed events

```
[[event]]
name = "twmaint"
time = "00:00"          # local time, once a day; or every_minutes = 30
run = "twmaint.bat"     # or ftn-poll, ftn-toss, qwk-exchange, maintenance, backup, bbslist, or any command
dir = "tw2002"
dos = true              # run in DOSBox (E: = xtrn)
exclusive = true        # wait until nobody is in a door
```

Nightly maintenance (old messages trimmed, the log kept to 60 days, inactive users removed
and the backup, see section 19) runs at 00:05 by itself.

Every run is recorded: when it started and ended, who started it (the timer, or "Run now" by
a sysop on the web or the terminal), ok or failed, the exit code of a command and the last 20
lines it printed (for built-in jobs, what they wrote to the log). The last 200 runs of each
event are kept. A command that ends with an exit code other than 0 counts as failed.

See them, and run an event now, on the web admin's **Events** page or in the sysop menu with
**E**: each event with its schedule, next run, last run and result, then the recent runs. Run
now doesn't move the event's next timed run. Events run one at a time; an exclusive event
first waits (up to an hour) until no one is in a door, and shows as waiting. An event already
waiting or running can't be asked for again until it ends.

## 9. FidoNet and fsxNet (ftn.toml)

Ironbark has its own binkp mailer and tosser: no binkd or sbbsecho needed. A leaf node set-up:

```
inbound = "ftn/nonsecure"
secure_inbound = "ftn/inbsecure"
outbound = "ftn/outbound"
temp = "temp/ftn"
origin = "My BBS - bbs.example.com"
listen = "0.0.0.0:24554"      # answer calls ("" = don't)
poll_interval_mins = 60

[[network]]
name = "fidonet"
address = "3:633/290"
zones = [1, 2, 3, 4, 5, 6, 7]

[[link]]
network = "fidonet"
address = "3:633/280"
host = "ftn.example.net:24554"
session_password = "..."
packet_password = "..."
archive = "none"              # or "zip" (ArcMail bundles)
areas = ["*"]
poll = true
route_netmail = true
auto_add_areas = false        # true: see "New areas" below
```

Areas join a network with `ftn_network` and `ftn_tag` in areas.toml. New local posts go out
straight away; incoming mail is filed when it arrives. Callers send netmail from E-mail with
`name@zone:net/node`. `ironbark ftn poll|toss|scan` does the same from the command line.

Housekeeping (the first two go at the top of ftn.toml, with `system_name` and the folders; all
three are also in Configuration > FidoNet):

- **Old echomail**: `max_message_age_days = 60` (the default when the line is left out; `0` =
  no limit). Echomail written longer ago than this is dropped when it is tossed and counted
  in the toss line in the log ("... 3 too old ..."), so a hub's rescan or an old packet that
  comes round again does not fill the areas. The age is taken from the message's own date
  (and its TZUTC time zone). Netmail is never dropped for its age. To take in a hub's
  back-messages on purpose (a `%RESCAN`), set it to 0 for that toss.
- **The sysop's names**: `sysop_aliases = ["Sysop"]` (the default). Netmail addressed to any
  of these names, in any case, goes to the sysop's mailbox (user #1), as does netmail to the
  `sysop` name in ironbark.toml or ftn.toml; add names such as `"Postmaster"` or one you use
  on a network. Netmail for a caller goes to that caller. Netmail for a name that is none of
  these is not delivered: it is noted in the log ("netmail for unknown user ...").
- **New areas**: `auto_add_areas = true` on a `[[link]]` (default false). When echomail
  arrives from that link for an area tag you do not have, Ironbark makes the message area and
  files the message, instead of counting a bad area: it is added to areas.toml in the group
  that holds that network's other echo areas (or a group named after the network, made if
  need be), with the tag as its name and as its code (with the prefix the group's other echo
  areas use, if they share one, so areas brought over from Synchronet stay in step; `-2`,
  `-3` if the code is taken), and the tag is added to the link's `areas` in ftn.toml if no
  pattern there matches it, so posts in the new area go out. Each area made is noted in the
  log, the old areas.toml and ftn.toml are kept in data/config-backup, and the running BBS
  takes the new area straight away. Rename it or move it to another group in Configuration
  afterwards. Old echomail (above) never makes an area. Leave it off for a link that carries
  areas you do not want.

## 10. DOVE-Net and other QWK networks (qwk.toml)

Ironbark calls a Synchronet QWK hub by FTP, the way Synchronet's qnet-ftp does: it uploads your
REP packet and downloads your QWK packet. Set your `qwk_id`, the hub (`id = "VERT"`,
`host = "dove.synchro.net"`, your node password, `poll_minutes`) and the conference list
(`number` at the hub, `area` code here). Areas join with `qwk_hub` and `qwk_conf`.

Never run two systems with the same FidoNet address or QWK ID polling the same hub: the hub
gives the mail to whichever calls first.

### The BBS list

Synchronet BBSes share a list of BBSes (their "Synchronet BBS List", sbbslist) over DOVE-Net:
each system posts its entry as a message in the conference **SYNCDATA** ("Synchronet Data",
number 2013 at VERT), and every system builds the list from those messages. Ironbark does the
same: it takes the list in, shows it to callers, can post this BBS's own entry, and can write
the list as a SyncTERM dialling directory.

To set it up, carry the conference (an area in areas.toml with `qwk_hub = "VERT"` and
`qwk_conf = 2013`, and the conference in qwk.toml's list; give the area `default_scan = false`,
because its messages are data, not reading for callers), then in ironbark.toml:

```
[bbslist]
enabled = true
area = "DOVE-SYNCDATA"        # the area's code in areas.toml
import_hours = 6              # scan the area this often (0 = only after hub calls)
max_age_days = 180            # drop entries nobody has posted for this long (0 = keep them)
publish = false               # true: post this BBS's own entry
republish_days = 30           # post it again this often even if unchanged (0 = only when changed)
name = ""                     # the name listed (empty = [bbs] name)
posted_by = ""                # the name it is posted under (empty = [bbs] sysop)
software = "Ironbark"
description = ["A friendly board in the goldfields.", "Doors, files and DOVE-Net."]
web_site = "bbs.example.com"
email = ""                    # the sysop's e-mail address, if you want it listed
first_online = "2026-01-31"
```

**Taking the list in.** The area is scanned for new entries every `import_hours`, after every
QWK hub call, and by `ironbark bbslist import`; only messages newer than the last one looked at
are read. The rules are Synchronet's: a message to `SBL` adds or replaces the entry named in
its subject, a message to `SBL-Remove` takes it off, and only the name and network address that
first posted an entry may change or remove it. An older message never replaces a newer one.
Where two entries are plainly the same system (the same first address, or the same name apart
from "The" and "BBS" posted by the same person), only the one posted most recently is shown. Entries that nobody has posted
for in `max_age_days` are dropped. The entries come from other systems, so they are treated
with care: a message over 64 KB is skipped, names, lines and lists are cut to fixed lengths,
control characters are removed, and anything that doesn't parse is ignored. The screen
previews some systems attach are not kept. The entries are kept in the database, so the list
is still there if the area is trimmed.

**For callers.** The built-in program `bbslist` (in a new BBS it is "BBS List" in the Main
door section; in menus.toml the command is `bbslist`):

```
[[section.door]]
code = "BBSLIST"
name = "BBS List"
kind = "builtin"
builtin = "bbslist"
```

It shows the list a page at a time (name, location, software and the address to call), sorted
by name, location, software or newest; S searches all of an entry's text; a number shows one
entry in full: sysop, location, every address and port, the description, the networks, who
listed it and when it was last updated. Callers can't add or change entries.

**This BBS's own entry.** With `enabled = true` the BBS is in its own list. With
`publish = true` the entry is also posted to the area (to `SBL`, from `posted_by`), so that
Synchronet systems list it. It is posted when it has changed since it was last posted, at
most once a day, and again every `republish_days` because other systems drop entries they
hear nothing of for about six months. The post goes out with the next hub call.
`ironbark bbslist publish` posts it now if it is due; `--force` posts it whatever was posted
before. The name, sysop and location come from `[bbs]` (a name over 25 characters is cut,
because that is what a QWK subject holds). The services are telnet, ssh and rlogin as
switched on in `[servers]`, at `[bbs] hostname`, which must be the name callers use from
outside. If they reach you on other ports or names than the BBS listens on (a router
forwarding port 23 to 2323, say), list the services yourself:

```
[bbslist]
services = [{ protocol = "telnet", address = "bbs.example.com", port = 23 },
            { protocol = "ssh", address = "bbs.example.com", port = 22 }]
networks = [{ name = "DOVE-Net", address = "MYBBS" }, { name = "FidoNet", address = "3:633/999" }]
```

Without `networks`, the network listed is the QWK network of the area, with your `qwk_id`.

If the BBS is already on the list (it was a Synchronet BBS before), other systems will only
take the new entry if it comes from the same name and the same QWK ID as the old one: set
`posted_by` to the name the old entry was posted under, and keep `name` exactly as it was.

**The SyncTERM list.** `ironbark bbslist export syncterm [-o FILE]` writes the list as a
SyncTERM dialling directory (syncterm.lst), as Synchronet's `sbbslist.js syncterm` does: every
telnet, rlogin and ssh address of every BBS, ssh first. With `--telnet-only` it is one entry
for each BBS, its telnet address if it has one, otherwise rlogin or ssh (Synchronet's
`syncterm-telnet`). Entries are in name order. Modem numbers and addresses that are not a
valid host name are left out; an address written as `host:port` is split into the two.
Without `-o` the list goes to the screen. To keep a copy on the web site up to date, run it
as a timed event:

```
[[event]]
name = "syncterm-list"
time = "04:15"
run = "ironbark bbslist export syncterm --telnet-only -o /var/www/bbslist/synchronet.lst"
```

`ironbark bbslist list` prints the list. As a timed event of your own, `run = "bbslist"`
does what the built-in timer does (post the entry if due, then scan the area).

## 11. QWK offline mail for callers

Q at the main menu: D downloads a QWK packet of new messages (Zmodem), U uploads a REP packet of
replies. QWKE and Synchronet's HEADERS.DAT are supported, so long names, subjects and UTF-8 come
through.

## 12. Custom menus (menus.toml and menus/*.rhai)

### Menus as data (menus.toml)

Menus can be kept as data in `menus.toml` in the BBS folder and edited with the **Menu Editor**
(Operator section, section 18) or the web admin's **Menus** page; the file is made the first
time either saves. `ironbark init` puts a full example in `menus.example.toml`: a main menu
with Messages and Games sub-menus.

```toml
[[menu]]
code = "main"
title = "Main Menu"
# screen = "menu/mymain"   # a screen instead of the drawn box
# prompt = "\u0001n\u0001h\u0001y@TLEFT@ > "
# hotkeys = true           # false: type a key word, then Enter
# access = "!GUEST"

[[menu.item]]
key = "G"
description = "Games"
action = "menu:games"

[[menu.item]]
key = "*"
description = "Operator programs"
action = "doorsection:OPERATOR"
access = "SYSOP"
hidden = true              # works, but isn't drawn

[[menu]]
code = "games"
title = "Games"

[[menu.item]]
key = "A"
description = "All door games"
action = "doorsection:GAMES"

[[menu.item]]
key = "Q"
description = "Back"
action = "back"
```

A menu has a `code`, a `title`, an optional `screen` (shown in place of the drawn menu), a
`prompt` (Ctrl-A colour codes and @-codes; empty = a standard one with the title and time
left), `hotkeys` (true: one key picks; false: the caller types the key, up to 8 letters, and
Enter) and an `access` string. Without a screen the menu is drawn from its items: a box of
"key │ description" in the BBS's colours, in two columns when there are many. Items have a
`key`, a `description`, an `action`, an `access` string (callers who don't meet it don't see
the item and can't use it) and `hidden`. Keys that aren't on the menu are ignored; `?` or Enter
draws the menu again. Expert-mode callers get only the prompt.

Actions: `menu:CODE` (a sub-menu; a Rhai menu `menus/CODE.rhai` when there is no such menu in
menus.toml), `back` (the menu before), `doors` (the door sections), `doorsection:CODE`,
`door:CODE`, `screen:NAME` (show a screen, then Hit a key), `logoff` (asks first),
`script:NAME` (a Rhai menu), and the commands Rhai menus' `run()` takes: `newscan`, `scan`,
`read`, `list`, `post`, `email`, `findtext`, `scantoyou`, `areas`, `groups`, `files`, `qwk`,
`who`, `chat`, `groupchat` (or `groupchat:ROOM`), `pagesysop`, `nodemsg`, `oneliners`,
`bulletins`, `gazette`, `lastcallers`, `automsg`, `polls`, `userconfig`, `userlist`, `info`,
`textfiles`, `sysop`. Menus nest to any depth; `back` in the first menu goes back to where the
caller came from (on the main menu it just draws it again). Opening a menu that is already
open goes back to it.

**The main menu**: set `main_menu = "main"` under `[bbs]` in ironbark.toml (or press M on a menu
in the Menu Editor, or Make main menu on the web page) and that menu replaces the built-in one
from the next logon. Leave it empty (the default) for the built-in Synchronet-style main menu.
If the menu is missing or the caller can't use it (its `access`), they get the built-in one.
Give a replacement main menu a way to the sysop programs (like the hidden `*` item above),
since the built-in `!` and `X` keys are not there.

Saving (in either editor) checks the menus first: every action must be one of the above, menus,
doors, sections and scripts named must exist, keys must be unique in a menu (one character when
the menu uses hot keys), codes are letters, digits, - and _, and access strings must work; the
main menu must exist. Anything wrong is listed and nothing is written. Otherwise the old file is
copied to `data/config-backup/menus.toml.DATE-TIME`. `ironbark check` and Configuration make
the same checks, so removing a door that a menu runs is refused until the menu is changed.
Callers get changes the next time a menu is drawn.

### Menus in Rhai (menus/*.rhai)

Menus can be written in Rhai, a small scripting language. `menus/main.rhai` replaces the
built-in main menu. A menu runs other menus with `run("menu:NAME")`, and a door can run one
with `kind = "builtin"`, `builtin = "script:NAME"`.

```
loop {
    cls();
    show("menu/games");                     // screens/menu/games.ans
    print("\r\n\x01n\x01cYour choice: \x01h\x01w");
    let k = getkey();
    if k == "L" { run("door:LORD"); }
    else if k == "N" { run("newscan"); }
    else if k == "Q" { break; }
    else if k == "O" { run("logoff"); break; }
}
```

Functions: `show(name)`, `print(text)`, `println(text)`, `cls()`, `pause()`, `getkey()`
(returns "A", "ENTER", "ESC", "UP" ...), `getstr(max)`, `password(max)`, `yes_no(q, default)`,
`user("alias"|"level"|"location"|"calls"|"node"|"minutes_left")`, `is_sysop()`, `log(text)`,
`run(command)`.

Commands for `run`: `newscan`, `scan`, `read`, `list`, `post`, `email`, `findtext`,
`scantoyou`, `areas`, `groups`, `files`, `doors`, `door:CODE`, `qwk`, `who`, `chat`,
`nodemsg`, `oneliners`, `bulletins`, `gazette`, `lastcallers`, `automsg`, `polls`, `userconfig`,
`userlist`, `info`, `textfiles`, `sysop`, `menu:NAME` (a menu from menus.toml when there is one,
else menus/NAME.rhai), `logoff`.

## 13. The main menu

(A menu of your own from menus.toml can replace it: `[bbs] main_menu`, section 12.)
The built-in main menu uses Synchronet's keys, so a Synchronet `menu/main` screen fits it:
N new scan, J jump to new area, E e-mail, R read, L list, P post, A auto-message, S scan for
mail to you, F find text, Q QWK, `*` list areas, `/*` list groups, `{ }` previous/next area,
`[ ]` previous/next group, `#` pick an area, T files, G text files, C chat, X doors,
D settings, U user list, I information, O or /O log off, /L who's online, V polls, /A your
avatar, ! sysop menu, Ctrl-U who's online, Ctrl-P message another node.

**Chat** (C): J group chat (rooms; `/W` who's here, `/ME` an action, `/J ROOM` another room,
`/Q` quit), P private chat with another caller, S page the sysop, A answer a request, M a
one-line message to a node. Private chat is split-screen on ANSI terminals. Paging tells any
sysop who is on a node, and shows on the web admin's Chat page, where the sysop can answer and
chat from a browser (and set themselves available or not; callers with exemption C can page
any time).

**Polls** (V): callers vote once (or pick several when the poll allows it) and see the results.
Who can start a poll is `[bbs] poll_access` (default `"!GUEST"`). Add `"polls"` to `logon` to
offer unanswered polls at logon.

**Avatars** (/A): 10x6 character pictures chosen from the collections in `text/avatars` or
`screens/avatars` (Synchronet's `.bin` collections work as they are). They show beside the
message header on ANSI screens. Imported users keep their Synchronet avatars.

**Sysop menu** (!): U edit a user (level, minutes, flags, exemptions, restrictions, credits,
expiry, birth date, note, password, delete), L log, W who, K hang up a node, B message to all
nodes, N run the networks now, V approve held messages, O the Operator section (section 18),
S spy on a node, C node control (lock, down, up), I quiet mode, P inactive users (section 19),
F find text in every message area (mail too; read a hit, then D delete or M move it), M bulk
mail (below). On ANSI terminals of 80 x 24 or more, U opens the full-screen User Editor.

**Bulk mail** (M, or the web admin's Messages page), like Synchronet's BULKMAIL: private mail from
you to every user meeting an access string (section 17), e.g. `LEVEL 50`, `FLAG B`,
`LEVEL 60 AND NOT FLAG X`, or to everyone when it is left empty. It says how many users match
before you write; deleted users, guests and you are skipped. Each send is noted in the log.

## 14. The web pages

`http://yourbbs:8080/` shows how to call, who's online and recent public messages.
`/admin` (sysops only, with their BBS name and password) has the nodes (hang up a caller),
users (every setting: level, flags, exemptions, restrictions, credits, expiry ...), screens
(upload, preview, edit, remove), doors (the section tree), menus (below), messages and files
(below), chat (answer pages, chat with callers),
blocked addresses and the filter files, the log, statistics, timed events (below), buttons to
poll the networks now, Back up now, and Reload settings (reads the `.toml` files again after you
edit them by hand). The Nodes page also has Node control (spy, lock, down/up, quiet mode); a
user's page lists their recent calls and their answers to the new-user questions (section 3);
the Users page links to Inactive users (section 19).

**Statistics** (`/admin/stats`), like Synchronet's system and node statistics: today and in all
(calls, minutes on line, new users, posts, e-mail, uploads and downloads with bytes), calls per
node, the last 30 days day by day, and the busiest hours of the day and days of the week, with
bars. They are counted as things happen: a call at logon, a new user at sign-up, a post or
e-mail written here (not network mail, not the BBS's own notes), an upload or download (terminal,
FTP and web), the minutes of a call when it ends. Each start also brings the numbers up to at
least what the records show (the callers list, users, messages, file lists), so history
brought over from Synchronet counts from the first day; a file found in a file area's folder
counts as an upload on the day of its file date. The busiest hours and days come from the
callers list. The same is in the sysop menu (**T**), and today's and total calls, new users
and posts are on the Information menu's system page (I, I) for everyone.

**Events** (`/admin/events`): every timed event with its schedule, next run, last run and
result, a **Run now** button, and the last 50 runs with their output (section 8).

**Menus** (`/admin/menus`) edits menus.toml (section 12) with forms: the list of menus with Add,
Copy, Rename (items that open the menu are changed too), Remove and Make main menu; and each
menu's settings and items, with up / down / remove buttons, a row to add an item, and an action
box that offers every action, menu, door and section there is. Every button saves the whole
form after the same checks as the Menu Editor; if something is wrong it is listed and the form
comes back as you sent it, unsaved. **Preview** draws the menu as callers see it (its screen,
or the box drawn from its items, then the prompt) with a table of what each key does. **Edit
screen** opens the screen editor on the menu's screen; a menu without one gets
`screens/menu/CODE.ans`, drawn from its items, and its `screen` set to `menu/CODE`, so the box
can be turned into ANSI art.

**Messages** (`/admin/messages`): every message area, and private mail, with its messages
(newest first, 50 a page). A message's page shows it with an edit form (subject and text: a
local edit, so copies already sent out on a network stay as they were; the log notes who
changed what), Delete, and Move to another area. **Search all areas** finds text in the
subject, text, from or to of every message, mail too, newest first, each linking to its page.
**Bulk mail** has a form with the access string, which says live how many users it matches,
the subject and the text.

**Files** (`/admin/files`): every file area with its count of files, uploads waiting for
validation, files new on disk and missing files, and the validation queue (Validate, Validate
all). An area's page lists its files; each file's page edits the description (several lines),
uploader, date (YYYY-MM-DD HH:MM), downloads and validation, and moves or copies it to another
area or removes it. **New on disk** lists files in the folder that aren't listed, each with a
description box filled from FILES.BBS or FILE_ID.DIZ, and Add (or Add all). **Missing files**
lists records whose file has gone, with Remove record. **Import a FILES.BBS** takes a folder
(the area's own, or another one: then the files are copied in).

### The web terminal

`http://yourbbs:8080/term` is the BBS in a browser, for callers without a telnet or SSH
program: the same logon, menus, messages, files and doors as a telnet call, drawn in the IBM PC
(CP437) character set and the 16 ANSI colours. The public page and the members' pages link to
it ("Connect in your browser"). Nothing is fetched from other sites: the page, its script and
the font are part of the `ironbark` program.

- It is on whenever the web server is. `[servers] web_terminal = false` switches it off (the
  links go and `/term` answers "not found"); Reload settings is enough, no restart.
- **A web caller is a node** like any other: listed in who's online and on the Nodes page (as
  `Web`), counted against `[bbs] nodes`, put off by the idle time-out, and able to be spied on
  or hung up. When every node is busy the caller is told so and the page shows Disconnected.
- The address filters and limits of section 17 apply as they do to telnet: `ip.can`,
  `ip-silent.can`, `host.can`, too many connections a minute, and blocking after failed logins.
- The screen is 80 columns by 24 lines. Another size can be asked for in the address:
  `/term?cols=132&rows=50` (40 to 132 columns, 10 to 60 lines).
- Keys: the cursor keys, Home, End, Page Up, Page Down, Insert, Delete, F1 to F10 and Ctrl with
  a letter go to the BBS. Ctrl+Shift+V or Shift+Insert pastes. On a phone or tablet, tap the
  screen for the keyboard; the bar under the screen has Esc, Tab, Ctrl (for the next letter),
  the arrows and Enter. The screen is scaled to the width of the device.
- File transfers (Zmodem and the like) do not work in the web terminal: callers can use the
  members' pages (`/bbs`) or FTP for files.

**Behind a reverse proxy** (Nginx Proxy Manager, nginx, Caddy ...) two things are needed:

1. The proxy must pass **WebSocket upgrades** to `/term/ws`. In Nginx Proxy Manager tick
   **Websockets Support** on the proxy host. In plain nginx:

   ```
   location / {
       proxy_pass http://192.168.1.5:8080;
       proxy_http_version 1.1;
       proxy_set_header Upgrade $http_upgrade;
       proxy_set_header Connection "upgrade";
       proxy_set_header Host $host;
       proxy_set_header X-Real-IP $remote_addr;
       proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
   }
   ```

   Without it the page loads but says "Could not connect". The BBS sends a small keep-alive
   every 25 seconds, so the proxy's usual 60-second time-out does not cut a caller off who
   is reading.
2. Tell Ironbark which addresses are your proxies, or every web caller appears to come from the
   proxy, and one caller tripping a limit blocks them all:

   ```
   [servers]
   trusted_proxies = ["192.168.1.10"]      # or a range: ["192.168.1.0/24"], IPv6 too
   ```

   Only when a connection comes from one of these is the caller's address taken from the
   `X-Forwarded-For` header (the last address in it that is not one of your proxies) or, when
   there is none, `X-Real-IP`. From anyone else those headers are ignored, since a caller
   could write anything in them. The default is empty: no proxy is trusted. A proxy on the
   same machine is `"127.0.0.1"`. Use `https` on the proxy and the terminal uses a secure
   WebSocket (`wss`) by itself.

## 15. Command line

`ironbark user add Guest 10 --guest` makes the guest account. Restriction G is what makes it
the guest: no password at logon, and it can't change its settings or vote in polls. It also
gets restrictions E (no mail), M (no netmail), P (no posting) and W (no auto-message); remove
any of those in the user editor (sysop menu U, or the web admin's Users page) to let guests do
that. Exemption G lets several guests be on at once. The name is `[security] guest_name`; a
Guest account imported from Synchronet keeps the restrictions it had there.

```
ironbark run [-d FOLDER]
ironbark init FOLDER [--theme NAME] [--interbbs-oneliners] [--ask]
ironbark theme [list] | use NAME [-d FOLDER]
ironbark check [-d FOLDER]
ironbark user add NAME [LEVEL] | passwd NAME | ensure NAME [LEVEL] | list
ironbark ftn toss|scan|poll
ironbark qwk HUB
ironbark bbslist import | list | publish [--force]
ironbark bbslist export syncterm [--telnet-only] [-o FILE]
ironbark import-sbbs SBBS_DIR [--users] [--messages] [--mail] [--files] [--dry-run]
ironbark render FILE [--term] [--html]
ironbark service install|remove -d FOLDER     (Windows)
```

## 16. Moving from Synchronet

- Screens: copy `sbbs/text` into `screens/`. Menus, `answer.msg`, bulletins and BullsEye work.
- Doors: copy the door folders into `xtrn/`, then add each to doors.toml with the same command
  line (`start.bat %#`). D: and E: are set up as in Synchronet's dosemu, so node files that say
  `D:\` keep working.
- Message areas: the groups and areas, with their network tags, go in areas.toml. Give each
  area the code Synchronet uses inside (the group's code prefix and the sub code, as in
  msgs.ini: `DOVE-GENERAL`, `FSXNETFSX_GEN`), and each file area the code from file.ini
  (`HEISENBERG`). Case does not matter. That is how the import below finds them.

### Bringing over users, messages, mail and file lists

```
ironbark import-sbbs /sbbs -d FOLDER --dry-run     see what would be copied
ironbark import-sbbs /sbbs -d FOLDER               copy it
```

`/sbbs` is the Synchronet folder (the one holding `ctrl/`). Synchronet 3.20 or later is needed
(user.tab). Stop Synchronet first, or work from a copy, so nothing changes while it reads.
If the data folder is not where `ctrl/main.ini` says, add `--sbbs-data /path/to/data`.
`--users`, `--messages`, `--mail` and `--files` copy only those parts (none given: all).
`--bulletins-seen` is explained under the logon bulletins below.
Synchronet's files are only read, never changed.

- Users keep their numbers (the sysop stays #1), names, location, email, level, flags,
  exemptions, restrictions, credits, calls, posts, upload and download counts, dates, birth
  date, terminal settings and the sysop's note. Deleted users come over as deleted.
  The message editor follows what they used: a user with an external editor in Synchronet
  (FSEditor, SlyEdit) gets the full-screen editor, the others the line editor.
  Passwords keep working: they are stored hashed here and, as in Synchronet, are not case
  sensitive until the user sets a new one. A user already here with the same name is left as
  it is (the report says so), and so is a number already taken: that user gets the next one.
- Messages keep their numbers, dates, time zones, message ids, replies and network
  addresses, so last-read pointers and new-message scan settings (also copied) stay right.
  They are marked as already sent, so nothing goes out to FidoNet or DOVE-Net again. Deleted
  messages and votes are left out; so are compressed (LZH) messages, which are counted.
  Areas in Synchronet with no area here are listed and skipped.
- Private mail goes to the same users, read or unread as it was. Netmail sent out stays
  with no one here.
- File lists: names, sizes, descriptions, uploader, date and download counts. The files
  themselves stay where they are: copy them into the area's folder (or point `path` in
  files.toml at Synchronet's folder for that area). Ironbark drops a listing whose file is
  not in the folder the next time the area is listed or searched, so copy the files first.

- Logon bulletins already seen (with the users): copy Synchronet's `text/bulletin*.ans` into
  `screens/` first. If the BBS showed them with a logon script that keeps
  `data/bulletin_views.ini` (a section per bulletin file, `user number = file time seen`),
  each caller's "seen" mark is carried over for every bulletin here that is the same one
  there: the same file name and, when Synchronet's text folder still has the file, the same
  contents (without it, the file here must not be newer than the mark, so copy with dates
  kept: `cp -p`). A caller who had only seen an older version is shown it again, as they
  would have been. Bulletins that can't be matched are listed in the report and shown to
  everyone again; to avoid that, add `--bulletins-seen`, which marks every logon bulletin
  here as seen for every user that came from Synchronet (new bulletins and changed files are
  still shown).

Running it again is safe: what is already here is skipped.

## 17. Security: access strings, flags, credits and blocking

**Access strings** use Synchronet's ARS syntax, so strings from SCFG carry over:
`LEVEL 60 AND FLAG A`, `60$FA`, `!GUEST`, `ANSI AND COLS 80`, `(LEVEL 90 OR FLAG S) AND AGE 18`,
`USER=1`, `NOT FLAG 2G`. Keywords: LEVEL, FLAG (FLAG1-4), EXEMPT, REST, AGE, SEX, CREDIT, DAY,
TIME, NODE, USER, PCR, UDR, UDFR, EXPIRE, LASTON, TLEFT, TUSED, CALLS, POSTS, ULS, DLS, COLS,
ROWS, ANSI, UTF8, SYSOP, GUEST, EXPERT, SSH, TELNET, RLOGIN, UNIX, WINDOWS. A string that can't
be read lets only sysops in.

**Flags** are four sets of letters A-Z that you give users and test with FLAG. **Exemptions**:
A anonymous posts, C page the sysop any time, D downloads without credits or ratio, E the
account never expires, G several nodes at once, H no idle hang-up, L unlimited logons a day, N
log on to locked nodes, P permanent (never expires, never removed as inactive), R manage any
file, T no time limit, X doors cost nothing. **Restrictions**: A no colour codes in
posts, B no beeps, C no chat, D no downloads, E no mail (except to the sysop), G guest, J no
quoting, K can't read sent mail, L one logon a day, M no netmail, N no posting in networked
areas, P no posting, S can't mail the sysop, T no file section, U no uploads, W no
auto-message, X no doors. When an account's expiry date passes it drops to `[bbs]
expired_level` (0 = it can't log on).

**Credits** are off unless you switch them on:

```
[credits]
enabled = true
new_user = 102400          # starting credits
per_day = 0                # given on the first call each day
per_post = 0
per_upload_byte = 1.0      # credits earned per byte uploaded
per_download_byte = 1.0    # credits charged per byte downloaded
min_ratio_percent = 0      # uploads must be at least this % of downloads (0 = no ratio)
ratio_free_bytes = 1048576 # downloads allowed before the ratio applies
```

A file area with `free = true` costs nothing. @CREDITS@, @UPBYTES@ and @DLBYTES@ show the
numbers on screens.

**Blocking** uses Synchronet's filter files, read from `screens/` or `text/` (a Synchronet text
folder works as it is): `ip.can` (refused, with the `badip` screen), `ip-silent.can` (dropped
without a word), `host.can` (`badhost`), `name.can`, `email.can`, `password.can` (for new users),
`file.can` (uploads), `subject.can` (posts). One entry per line; `*` and `?` are wildcards,
`~` at the start means "contains", `^` "begins with", `!` "not", and IP files take ranges like
`10.1.2.0/24`. Failed logins and floods block an address for a while:

```
[security]
max_login_failures = 5      # within failure_window_minutes
failure_window_minutes = 10
block_minutes = 60
block_permanently = false   # also add it to ip.can
max_connects_per_minute = 10
lookup_hosts = true         # reverse DNS for host.can
guest_name = "Guest"
guest_check = true          # guests press a letter shown on screen first
hide_short_guest_secs = 30  # guest calls shorter than this are not listed or counted (0 = off)
system_password = ""        # sysops must also give this after logging in (empty = off)
```

**Guests and login robots.** Programs that scan the internet for telnet logins try the usual
names and passwords, and sooner or later type "guest" and get in, then leave a few seconds
later. With `guest_check` on (the default), a guest is asked to press a letter shown on the
screen (`Guest login: to show you are a person, press the letter W:`); anything typed before it
is thrown away, so a robot that sends its password straight after the name fails. A miss is
logged ("guest key check failed from IP") and counts towards `max_login_failures`. With
`hide_short_guest_secs` (30 by default), a guest call shorter than that is taken out of the
callers list (last callers, the Gazette) and the call counts when it ends; the log keeps a
line for it. Set it to 0 to keep every call.

**System password.** With `system_password` set, every sysop (level 90 or more) is asked
`System password:` straight after logging in, as Synchronet's SY: prompt does. It is asked on
telnet, SSH and RLogin alike, also when an SSH key or RLogin logged the sysop in. Case doesn't
matter. Three misses end the call; each miss is logged ("wrong system password for NAME from
IP") and counts towards `max_login_failures`. Other users never see it. The web admin's
log-in page then has a third box, System password, and a sysop needs all three to get in.

The web admin's Blocked page lists blocked addresses (with an Unblock button) and the filter
files. Local connections (127.0.0.1) are never blocked.

**Uploads** are checked before they go into a file area:

```
[uploads]
scan_command = "clamscan --no-summary %f"   # exit code 0 = clean
test_archives = true                        # zip built in; others with test_commands
test_commands = { arj = "arj t %f", rar = "unrar t %f" }
reject_duplicates = true                    # same name, or same contents, anywhere
quarantine = "data/quarantine"              # refused files are kept here
validate = false                            # true: new uploads wait for the sysop (section 6)
```

## 18. The Operator section: User Editor, Configuration, Menu Editor, File Manager and Bulletin Manager

Like Synchronet's SCFG and user editor, Ironbark has full-screen programs for the sysop. They
are built-in doors in the door section with code `OPERATOR` (new BBS folders have it; for an
older one add this to doors.toml), and the sysop menu's O opens that section:

```toml
[[section]]
code = "OPERATOR"
name = "Operator"
access = "SYSOP"

[[section.door]]
code = "USEREDIT"
name = "User Editor"
kind = "builtin"
builtin = "useredit"
sysop_only = true

[[section.door]]
code = "CONFIG"
name = "Configuration"
kind = "builtin"
builtin = "config"
sysop_only = true

[[section.door]]
code = "MENUEDIT"
name = "Menu Editor"
kind = "builtin"
builtin = "menuedit"
sysop_only = true

[[section.door]]
code = "FILEMAN"
name = "File Manager"
kind = "builtin"
builtin = "fileman"
sysop_only = true

[[section.door]]
code = "BULLMGR"
name = "Bulletin Manager"
kind = "builtin"
builtin = "bulletinmgr"
sysop_only = true
```

The first four need an ANSI terminal of at least 80 x 24 (larger screens get bigger boxes).
Messages from other nodes wait until you leave them. The Bulletin Manager (at the end of this
section) is a plain list and works on any terminal.

### Keys (the four full-screen programs)

| Key | What it does |
| --- | --- |
| Up, Down, PgUp, PgDn, Home, End | move the bar |
| Enter | open the item or edit the value under the bar |
| Esc | back (in an edit field: cancel) |
| Insert / Delete (or Backspace) | add / remove an item in a list (removing asks first) |
| + / - | move the item under the bar down / up |
| Y / N | set a Yes/No value |
| * | show or hide passwords (they show as dots) |
| a letter | in menus, jump to the next item starting with it |
| Ctrl-L | redraw the screen |

Editing a value in place: Left/Right/Home/End move, Insert switches insert/overtype, Ctrl-U
clears, Ctrl-K cuts to the end, Enter keeps it, Esc leaves it as it was. Tab shows a password
while you type it. The bottom line always says what the setting under the bar does. Choices
(door kind, network, editor ...) open a list to pick from; letter sets (flags, exemptions,
restrictions) open a list of A-Z with what each letter means: Space or Enter turns the letter
under the bar on or off, typing a letter turns that one on or off, Esc finishes.

### User Editor

A list of users: number, name, level, last call and status (sysop, new, guest, expired,
deleted). Keys: Enter edit, / or F find by name, real name, location, e-mail or note, A users
meeting an access string (`LEVEL 60 AND NOT FLAG B`), U unvalidated users (at the new-user
level; U again for all), X all users, # go to a user by number, V apply a quick validation set,
D show deleted users too, Insert add a user, Delete delete or undelete, ? the key list. On the
user form, C lists the user's recent calls (time, node, connection type, address, minutes).

The user form has every field: name, real name, location, e-mail, level, minutes per day, flag
sets 1-4, exemptions, restrictions, credits, expiry (YYYY-MM-DD or never), birth date, gender,
note, message editor, expert mode, deleted, a new password, quick validation, and the counts
(calls, posts, uploads and downloads with bytes, first and last call). A shows the user's answers
to the new-user questions. Esc asks whether to save.
You can't take your own sysop level away or delete yourself. A user who is online keeps the copy
their session loaded, so their call can undo changes when they log off.

**Quick validation sets** are in ironbark.toml (and in Configuration):

```toml
[[validation]]
name = "Validated user"
level = 60
flags1 = ""        # these three replace the user's letters
exempt = ""
restrict = ""
minutes = 240      # 0 = leave as it is
credits = 0        # added
expire_days = 0    # the account expires this many days from now; 0 = never
```

### Configuration

The menu has every part of the settings: BBS settings, servers, paths, security and blocking,
credits, uploads, the FTP server, BBSLink, DOSBox, the Gazette, quick validation sets, timed
events, new-user questions, message groups and areas, file areas, door sections and doors, FidoNet / echomail
(general settings, networks with our addresses and AKAs, links with their passwords, area
patterns and polling, and the echo area list) and QWK networking (this BBS, hubs and their
conferences). A setting marked * takes effect after a restart.

**Echo areas** (under FidoNet) lists which message area carries which tag on which network.
Insert asks for the network and tag, then makes a new message area for it (or ties an existing
one); Delete takes an area off the network. In an area's own form the FidoNet network and QWK
hub are picked from those set up. If ftn.toml or qwk.toml doesn't exist yet, Configuration
offers to start one.

Changes are kept in memory until you pick **Save changes** (or answer Save when you leave).
Saving first checks everything, as `ironbark check` does: the files must read, area, door,
file-area and section codes must be unique, access strings must work, areas must name networks
and hubs that exist (with a tag), doors need what their kind needs (a host for rlogin/telnet, a
command, a built-in name), events need a valid time, and ftn.toml / qwk.toml must pass their own
checks. Anything wrong is listed and nothing is written. Otherwise each changed file is copied
to `data/config-backup/NAME.YYYYmmdd-HHMMSS` and written, and the running BBS takes up the new
settings: new callers get them at once, callers online get them at their next main menu.

The files stay readable: values are changed where they are, your comments and order are kept,
and new entries are added at the end of their list in the same style. **Undo all changes**
reads the files again.

### Menu Editor

Edits every menu callers see in one place. The first list ("All menus") has:

- **Door menus** (lines starting `Doors`): the door sections in doors.toml as a tree, each
  with its doors, the door menus inside it and links to other menus. Top-level ones are what
  callers pick from after the door key.
- **Menus of commands** (lines starting `Menu`): the menus in menus.toml (section 12). One that
  nothing opens yet is marked "not linked".

Keys on the list: Enter open; Insert add a door menu (code, name, where it goes) or a menu of
commands (code, title; it starts with Q Back, opens its items, then offers to link it); Delete
remove (a door menu only when empty); + / - move; **L link** (put a menu on another menu: a new
key on the main menu or another menu, or an entry in a door menu; put a door menu on a menu, or
inside another door menu); P preview; M make it the main menu; C copy; R rename (links follow);
B built-in copy (a copy of the built-in main menu); S save; Esc quit.

**A door menu** lists doors, door menus inside it (marked ») and entries that open a menu of
commands, in the order callers see them. Enter: a door's settings (the Configuration door form),
open a door menu inside, or open a linked menu's items. Insert: a new door, a door moved here
from another door menu, a new door menu inside this one (it opens to be filled), or an entry
that opens a menu of commands (an existing one or a new one). Delete: a door (with its
settings), a link (the menu stays) or an empty door menu. + / - move doors. E: this door menu's
settings (name, inside which section, level, access, sysop only).

An entry that opens a menu of commands is a door of kind `builtin` with `builtin = "menu:CODE"`.

**Adding an item to a menu** (Insert in its items) asks for the key, then what it opens: **a new
door** (set up right there: code, name, kind, then the door form; it is kept in the hidden door
section MENUDOORS, "Doors used on menus", so it shows only where your menus put it), **a door
that is already set up**, **a sub-menu** (a new menu, or one you already have), **a door menu**,
or **something else** (the full list of actions). New items go above Q Back. Enter on an item
that runs a door offers the door's own settings. A door section with `hidden = true` is not
listed with the door sections; its doors are used from menus.

**A menu's form:** Title, Screen, Prompt (`\1` stands for Ctrl-A), Hot keys, Access, **Items**,
**Opened from** (Enter links it) and **Preview**. The items list takes Enter, Insert (key, then
action, then description), Delete and + / -. Enter on an item that opens another menu or door
menu asks whether to open that menu (to edit what is on it) or change the item. Picking an
action opens the list of actions; `menu:` picks from the menus or makes a new one (it opens
straight away to be filled), `door:` from every door, `doorsection:` from the section tree,
`script:` from menus/*.rhai, and `screen:` and `groupchat:` ask for a name.

**Preview** (P) leaves the editor and runs a menu as it is in the editor, unsaved, on your own
screen: sub-menus and back work, other items only say what they would do.

Changes are kept until you save (S, or Save when you leave). Saving checks doors.toml and
menus.toml together, backs both up in data/config-backup, writes them and reloads the settings,
then warns about any menu that nothing opens. M saves first, then sets `[bbs] main_menu` in
ironbark.toml (also checked and backed up).

### File Manager

Like Synchronet's fileman.js. The first list has the file areas with their files and notes:
uploads to validate, files new on disk, missing files. Enter opens an area; V opens the
validation queue (every upload waiting, in all areas: V validate, A validate all, Enter edit,
R remove).

An area's list shows each file's name, size, date, uploader, downloads and the first line of its
description; `*` marks an upload waiting for validation, `!` a file missing from the folder.
Keys: Enter edit, M move to another area, C copy to another area, Delete (or R) remove, V
validate (or put back in the queue), I (or Insert) the folder and the list, B import a
FILES.BBS, ? keys, Esc back.

- **Edit**: Description (a list of lines: Enter edits one, Insert adds, Delete removes, + / -
  move), Uploader, Date (YYYY-MM-DD HH:MM; the new-files scan goes by it), Downloads,
  Validated, and Move / Copy / Remove. Esc asks to save when something changed.
- **Move** takes the file to the other area's folder and its record (description, uploader,
  date, downloads) to that area. **Copy** makes a second file and record (no downloads yet).
  Both refuse when the other area already has a file of that name.
- **Remove** asks first, then moves the file to the quarantine folder (`[uploads] quarantine`,
  or `data/removed` when that is empty) as TIME-removed-NAME and drops the record. Nothing is
  deleted; empty the folder yourself.
- **I** lists `+` files in the folder that aren't listed and `-` records whose file has gone.
  Enter on a new file shows its description from FILES.BBS or FILE_ID.DIZ to change (or asks
  for one) and adds it; A adds them all with those descriptions. Enter on a missing one removes
  the record. (Callers listing an area also add new files and drop missing ones, as before; the
  File Manager shows them first.)
- **B** asks for a folder (the area's own to start with) holding a FILES.BBS: `NAME  description`
  lines, continuation lines starting with spaces (a leading `|` or `+` is dropped), comment
  lines starting with `;` or `-`, and `[03]` download counters or size and date columns are
  dropped from the description. Each file named and present is listed (a listed one gets the
  new description); from another folder the files are copied into the area's folder. It ends
  with what was added, updated, copied and not found.

Every change is noted in the log.

### Bulletin Manager

For the numbered logon bulletins: the screens `bulletin1.ans`, `bulletin2.ans` ... (`.msg` and
`.asc` too; a first one named `bulletin.ans`, as on Synchronet, counts as number 1) in your
screens folder, or in the built-in screens folder (`text/`, marked `(text)` in the list). The
`bulletins` logon step shows each of them to a caller once, and again when the file changes.

The list has each bulletin's file name, size, date of last change, how many callers have seen
this version, and its first line of text. Keys:

| Key | What it does |
| --- | --- |
| V | view a bulletin as callers see it |
| D | delete a bulletin: it is moved to the folder `bulletin_archive` beside it (as `NAME.YYYYmmdd-HHMMSS`), not erased, and the rest are renumbered |
| R | renumber so there are no gaps (offered when there is one): only the number in each file name changes, and each caller's "seen" mark moves with the file, so nobody is shown a bulletin again because its name changed |
| S | reset "seen" for one bulletin, or (Enter) for all: everybody is shown it again at their next logon |
| Q | leave |

To add a bulletin, put the next `bulletinN` file in the screens folder (or upload it on the web
admin's Screens page); to bring one back, move it out of `bulletin_archive` under a free
number. Renumbering stops without changing anything if a new name is already taken by another
file. Deletes, renumbering and resets are noted in the log.

## 19. Sysop tools: spy, node control, call history, inactive users, backups, disk space

**Spy** (sysop menu S, or Spy on the web Nodes page) shows a node's screen as it happens,
starting with what is on it now, doors and file transfers included. In the terminal: Ctrl-Z
stops, Ctrl-T takes over the caller's keyboard (your keys go to their session as if they typed
them; their own keys still work) and Ctrl-T again gives it back. On the web page the screen
updates every second; tick Take over and the keys you press on the page go to the caller, or
type text in the box and press Send. Callers are told "The sysop is watching your screen"
unless `[security] spy_notice = false`. Spying and taking over are written to the log. A spy
that falls behind a very fast screen misses some output; the caller is never slowed down.

**Node control** (sysop menu C, or the Node control buttons on the web Nodes page):

- **Lock**: only sysops and users with exemption N may log on there; others are told the node
  is locked. New callers are put on unlocked nodes first.
- **Take down**: the node takes no calls. With a caller on it, it goes down when they leave.
  **Bring up** puts it back.
- **Quiet mode** (sysop menu I for yourself; Quiet on/off on the web for a sysop on a node): you
  are not listed in who's online (callers see "waiting for a caller"), not on the public web
  page or the Gazette, and no logon/logoff alerts go out for you. It stays on for your later
  calls.

All of this lasts until the BBS restarts. Sysops see the state in who's online ("locked",
"down", "down after this call", "quiet").

**Call history**: each call records the node, connection type, address and logon and logoff
times. C on the User Editor's user form and the web user page show the recent calls with
minutes on.

**Inactive users** and **backups** run in the nightly maintenance (00:05), set in
ironbark.toml (or Configuration, Backups and inactive users):

```toml
[maintenance]
backup = true              # back up the database and the *.toml settings each night
backup_dir = ""            # empty = data/backup; each night a YYYYmmdd folder
backup_keep = 7            # nightly backups kept (older YYYYmmdd folders are removed)
purge_inactive_days = 0    # mark users deleted after this many days without a call (0 = off)
purge_min_age_days = 30    # accounts younger than this are never removed
min_free_mb = 500          # warn when the data folder's disk has less than this free (0 = off)
```

The removal never touches sysops, users with exemption P, the guest account (restriction G or
`[security] guest_name`), anyone online, or accounts younger than `purge_min_age_days`. Users are
only marked deleted (undelete them on the web user page or in the User Editor), and each one is
logged. Sysop menu P and the web page `/admin/purge` (Inactive users, on the Users page) list
who would go now, with a button to do it at once.

The backup copies the database with SQLite's online backup (safe while callers are on) and the
settings files into the dated folder; a second backup the same day replaces it. Back up now on
the web Nodes page makes one at any time, and a timed event with `run = "backup"` works too. To
restore, stop the BBS, copy `ironbark.db` back into `data/` (and the `.toml` files into the BBS
folder) and start it again.

**Disk space**: every ten minutes Ironbark looks at the free space on the disk (file system)
that holds the data folder. When it is below `[maintenance] min_free_mb` megabytes (500 by
default), a line goes in the log ("low disk space: ...") and a mail from Ironbark to the sysop
(user #1), at most once a day for as long as space is short. `min_free_mb = 0` switches the
check off. It looks only at the data folder's disk: if the file areas or backups are on another
disk, that one is not watched.

## Licence

Ironbark is free software under the GNU General Public License, version 3 or later.
Copyright (C) 2026 Michael Slater <slaterm@theiguru.au>. KFOSSIL is included under its own
GPL licence.
