Slircdocs Open chat

Slirc is in early access. Come say hi in #open-chat.

Connect / Self-hosting

Run your own Slirc

Slirc runs as two containers on a private network behind Caddy. Bun serves the app, and Ergo handles chat. This guide takes you from a fresh Linux server to your first message.

The Elastic License 2.0 lets you run Slirc for your own group. Hosting it for others requires permission from the author.

Source coming soon

The repository is private for now, so the clone step below won't work yet. We'll post on the blog when the source opens.

What you need

1. Clone and set your host

On your machine:

git clone https://github.com/bitbonsai/slirc
cd slirc

Open justfile and set the SSH host, checkout path, and config directory at the top to your own values. Every recipe below uses them.

2. Config on the server

Slirc keeps secrets out of git. Two files live in the config directory on the server, both mode 0600:

ssh yourserver
mkdir -p ~/.config/slirc && chmod 700 ~/.config/slirc

~/.config/slirc/env is the app's environment:

APP_HOST=app.yourdomain
OWNER_NICK=yournick
USERS_JSON={"yournick":"you@example.com"}
ERGO_OPER_USER=slirc-org
ERGO_OPER_PASS=another-long-random-password
RESEND_API_KEY=re_...
RESEND_FROM=Slirc <slirc@yourdomain>
VAPID_CONTACT=mailto:you@example.com

Optional keys: GIPHY_API_KEY for GIPHY search, OPENROUTER_API_KEY for the help bot and natural-language reminders, which reach every model through OpenRouter, HELP_ANSWER_MODEL for the model that writes help answers (default anthropic/claude-haiku-5.5), HELP_CLASSIFIER_MODEL for the cheaper model that first sorts each message into a Slirc question, small talk, or off topic, TYPESAFE_API_KEY to do that sorting with TypeSafe's Jev (the classifier then defaults to jev-latest instead of xiaomi/mimo-v2.6-flash; TYPESAFE_BASE_URL and TYPESAFE_INPUT_PRICE_PER_BILLION are optional), HELP_MODEL for reminders and the other helpers (default xiaomi/mimo-v2.5), SLIRC_HELPERS to pick which helpers run, as a comma list such as help,remind (unset runs help, remind, poll and welcome; links runs only when listed; an unknown name stops the app at start). To turn a helper on later, add its name and restart the app: it creates the helper's IRC account on start, and the helper joins channels as people add it, SLIRC_HELPERS_ENABLED=false to run none of them. SLIRC_AGENTS_ENABLED=false refuses agent pairing on the instance. SLIRC_EMOJI_BUDGET_BYTES caps the total bytes of custom emoji on the instance (default 104857600, which is 100 MB); each member can add 50 custom emoji per 24 hours. TESTFLIGHT_URL is the iPhone beta's public TestFlight link, in the form https://testflight.apple.com/join/<code>: signed-in, verified members see Get the iPhone app in More on a phone and in Devices → Add your phone on desktop. Unset, or any other link, hides it. The app counts the mail it hands to Resend per day and kind, and logs one line when a day's sent mail reaches MAIL_DAILY_WARN (default 80) and MAIL_DAILY_LIMIT (default 100), the free tier's daily cap. Bulk email invites stop at 75% of MAIL_DAILY_LIMIT, so sign-in emails still get through. Each instance counts only its own mail, so when several instances share one Resend key, split the account's daily limit between them. bun scripts/mail-count.ts in the app container prints today, the last 7 days and the month so far. Model names are OpenRouter ids; older bare names such as mimo-v2.5 still work. SLIRC_HELPER_DAILY_LIMIT caps the model calls the help bot and natural-language reminders make for one account in 24 hours, both together (default 100); past it, help says to try again tomorrow and reminders take only the short forms. Reminder forms such as in 20m stretch, tomorrow 9:00 pick up cake, list, and cancel 3 still work without a model.

The welcome helper sits in #open-chat and posts a G'day gif there once a day when GIPHY_API_KEY is set. The gif goes through Ergo like any message, so IRC clients see it too.

The app makes every IRC password from a key: 32 random bytes in a file outside ~/.config/slirc, so a backup of that folder or of the database never holds anything that logs in to IRC. Create it once and keep a copy in your password manager, not next to the backups:

mkdir -p ~/.config/slirc-keys/org && chmod 700 ~/.config/slirc-keys
openssl rand -out ~/.config/slirc-keys/org/irc-key 32 && chmod 600 ~/.config/slirc-keys/org/irc-key

The app refuses to start without it. Never replace it while people use the instance: every IRC client on a password, and every bot, then needs a new password.

~/.config/slirc/ergo.yaml is Ergo's config. Start from the one in the repo:

scp ergo/ergo.example.yaml yourserver:~/.config/slirc/ergo.yaml

Then edit two things in it. Set network.name and server.name to your domain. Replace the password hash of the slirc-org oper with one for the ERGO_OPER_PASS you chose:

podman run --rm -it ghcr.io/bitbonsai/slirc-ergo:v2.19.1 ergo genpasswd

Keep accounts.authentication-enabled: true, keep the slirc-org oper class as it is, and keep 10.0.0.0/8 in ip-limits.exempted. Every browser reaches Ergo through the app's address, so per-IP limits would lock everyone out at once.

3. Caddy

Copy caddy/slirc.caddy to your Caddy sites directory and replace slirc.org with your domain and the checkout paths with yours. The app block is the one that matters:

app.yourdomain {
    handle {
        reverse_proxy 127.0.0.1:9010 {
            lb_try_duration 20s
        }
    }
}

Port 9010 is the app and binds to localhost only. Browsers reach IRC through the app's /irc relay, so Ergo needs no WebSocket listener. Reload Caddy.

4. Bootstrap

Back on your machine, with a clean tree:

just bootstrap

This pushes main, resets the server checkout to it, creates the slirc-org network and the three volumes, starts Ergo, then builds and starts the app. The app registers your account with Ergo from USERS_JSON, creates #open-chat and #help, and starts the helpers. Check it:

just status
just logs app

The first line you want in the log is app listening on :8080.

5. First sign-in

Open https://app.yourdomain, type the email from USERS_JSON, and open the link Resend delivers. That account is the owner and an admin, so it can create channels and invite people. Other people join by invitation; ordinary sign-in does not create an account for an uninvited address. Only a public instance (SLIRC_MODE=public_playground) signs up a new address from the sign-in form, and only while the day's mail count plus that day's signups is under MAIL_DAILY_LIMIT (SIGNUP_DOMAIN_LIMIT, default 30, caps new signups per receiving domain per hour); it also shows recent #open-chat messages to signed-out visitors at /open-chat. See Getting started.

Day to day

just deploy          # tests, then rebuild and recreate the app; Ergo keeps running
just deploy-ergo     # recreate Ergo; the app keeps running
just deploy-docs     # publish the docs site, if you serve one
just logs ergo

deploy refuses to run if Ergo restarted underneath it, and deploy-ergo refuses if the app did.

Backups

Three things hold state:

Copy the config directory into private backup storage. Do not export a live database volume and assume the result is consistent: SQLite's WAL must be included in a transactionally consistent snapshot. Use SQLite's backup API for the app database and Ergo's SQLite history. A full Ergo account-store backup needs a separately authorized maintenance stop unless a supported live-backup method is available. With services stopped, podman volume export and podman volume import can back up and restore complete volumes.

Before upgrading, rehearse app schema migrations on a consistent snapshot, never the live database:

cd app
bun scripts/rehearse-migration.ts /private/backups/app.sqlite

The rehearsal runs migrations twice on a disposable copy, checks SQLite integrity, and verifies existing rows and account IDs stay unchanged. It does not run IRC provisioning or connect to production.

History retention

The supplied Ergo config uses history.restrictions.expire-time: 0s: persistent messages do not expire automatically. Explicit message deletion still works. Existing installations must update their mounted config separately; changing the example does not change a running server. Ergo can apply this setting by rehash without restarting. Disabling expiry does not restore messages already purged under an earlier policy. Monitor disk usage and keep backups.

When something is off