- C 88.6%
- JavaScript 6.3%
- Meson 1.7%
- Just 1.3%
- PowerShell 1%
- Other 1.1%
| Filename | Latest commit message | Latest commit date |
|---|---|---|
| lib | ||
| nginx | ||
| scripts | ||
| src | ||
| test | ||
| .clang-format | ||
| .clang-tidy | ||
| .containerignore | ||
| .gitignore | ||
| .gitmodules | ||
| Containerfile | ||
| example-conf.json | ||
| justfile | ||
| LICENSE | ||
| meson.build | ||
| native.ini | ||
| README.md | ||
slopbridge
An IRC ↔ Discord bridge.
Requirements
- Meson (>= 1.3) and Ninja
- A C11 compiler
- OpenSSL >= 3.0 development headers (the bridge uses
EVP_Q_digest) - libcurl >= 8.7.1 built with
--enable-websockets(required by concord)
Building
git clone ...
cd slopbridge
git submodule update --init --recursive
meson setup build
meson compile -C build
./build/slopbridge <path-to-config>
The vendored lib/concord is built in-tree via its own Makefile and linked
statically; lib/yyjson and lib/lirc are compiled directly by Meson.
Configuration
See example-conf.json for the expected layout. Required Discord fields are
bot_token, webhook_id, webhook_token and channel_id. The bot's
application id (used to print the invite URL) is resolved automatically from
the Discord READY event.
Any string value may reference an environment variable with ${VAR} syntax,
which is expanded at startup — useful for keeping credentials out of the
config file:
{ "discord": { "bot_token": "${DISCORD_TOKEN}", "webhook_token": "${WEBHOOK_TOKEN}" } }
Container (Podman)
Build the image (assumes submodules are already initialized):
just container # or: podman build -t slopbridge .
Run it, mounting the config and data directories from the host — nothing sensitive is baked into the image:
podman run --rm \
-v "$PWD/config.json:/config.json:ro" \
-v /var/redirects:/var/redirects \
-v /var/txt:/var/txt \
slopbridge /config.json
Credentials can instead be passed as environment variables, with the config
referencing them via ${VAR}:
podman run --rm \
-e DISCORD_TOKEN=... -e WEBHOOK_ID=... -e WEBHOOK_TOKEN=... -e CHANNEL_ID=... \
-v "$PWD/config.json:/config.json:ro" \
slopbridge /config.json
scripts/test-container.ps1 smoke-tests the image from Windows PowerShell.