Sign inSign up

xeze/onion-forum

By xeze

•Updated about 2 months ago

Self-hosted Rust forum with a Tor v3 onion service, SQLite, and no JavaScript.

Image
Security
Web servers
0

263

xeze/onion-forum repository overview

⁠Onion Forum

A lightweight, self-hosted forum published as a Tor v3 onion service.

Onion Forum uses a Rust backend with Axum and SQLite. Its interface is server-rendered HTML and CSS with no JavaScript, analytics, or external services.

⁠Features

  • Tor v3 onion service included
  • Accounts, categories, threads, replies, and comments
  • Admin controls for users, categories, threads, and registration
  • CAPTCHA and login rate limiting
  • CSRF protection and expiring sessions
  • HTML sanitization and strict security headers
  • Persistent database and Tor identity
  • Automatic Tor private-key backup

⁠Quick start

Create compose.yml:

services:
  onion-forum:
    image: xeze/onion-forum:latest
    container_name: onion-forum-app
    restart: unless-stopped
    environment:
      PORT: "8080"
      FORUM_DB_PATH: /data/forum.db
    volumes:
      - ./data:/data

Start the container:

docker compose up -d

⁠Get the onion address

Follow the startup logs:

docker compose logs -f onion-forum

Or read the generated hostname directly:

docker compose exec onion-forum cat /data/tor/hs/hostname

Open the resulting address using Tor Browser:

http://your-address.onion

The first Tor bootstrap may take several minutes. Press Ctrl+C to stop following logs; the container will continue running.

⁠Persistent data

Everything is stored under ./data:

data/
|-- forum.db
|-- .env
`-- tor/

The generated Tor private key is stored inside data/tor. A base64 backup is also saved as TOR_PRIVATE_KEY_B64 in data/.env.

Back up the complete data directory to preserve the forum database and onion address. Never publish this directory.

⁠Update

docker compose pull
docker compose up -d

⁠Build from source

Source code:

https://code.xeze.org/cyber/onion-forum-container⁠

git clone https://code.xeze.org/cyber/onion-forum-container
cd onion-forum-container
docker compose up -d --build

⁠Stop

docker compose down

Your persistent data remains under ./data.

⁠License

Licensed under the Apache License 2.0.

Tag summary

Content type

Image

Digest

sha256:05fc07c74…

Size

13 MB

Last updated

about 2 months ago

docker pull xeze/onion-forum