From 25ab4ba949a5501ed25e5d4a620088826a2ec09c Mon Sep 17 00:00:00 2001 From: Kibi Kelburton Date: Mon, 27 Jul 2026 12:32:08 +0200 Subject: [PATCH] adding tor switch and update readme --- .env.example | 6 +++--- README.md | 22 ++++++++++++++++++++++ config_example.json | 3 +++ docker-compose.yml | 2 ++ 4 files changed, 30 insertions(+), 3 deletions(-) diff --git a/.env.example b/.env.example index 251d415..02ed0d3 100644 --- a/.env.example +++ b/.env.example @@ -1,9 +1,9 @@ POSTGRES_USER=f0ckm POSTGRES_DB=f0ckm POSTGRES_PASSWORD=f0ckm -# --- Nginx & Let's Encrypt Configuration (Optional) --- -# Set to 'f0ckm-nginx' to enable the Nginx & Let's Encrypt proxy stack -# COMPOSE_PROFILES=f0ckm-nginx +# --- Nginx & Tor Profiles (Optional) --- +# Set to 'f0ckm-nginx' for Nginx, 'tor' for Tor hidden service, or 'f0ckm-nginx,tor' for both +# COMPOSE_PROFILES=tor # # VIRTUAL_HOST=yourdomain.com # LETSENCRYPT_HOST=yourdomain.com diff --git a/README.md b/README.md index 684b5ca..9f16bd9 100644 --- a/README.md +++ b/README.md @@ -78,3 +78,25 @@ now visit http://localhost:1337 in your browser, you can develop without needing ## NGINX uncomment in .env # COMPOSE_PROFILES=f0ckm-nginx to enable nginx proxy with automatic lets encrypt. + +## Tor Hidden Service (.onion) + +Tor is bundled in `docker-compose.yml` and preconfigured with a hidden service pointing to the application (`f0ckm:1337`). + +When running `docker compose up -d`, Tor automatically generates a `.onion` address for your node. You can find your onion address by running: + +```bash +cat ./f0ckm-data/tor/f0ckm_hs/hostname +``` + +### Automatic Onion-Location Header +To advertise your `.onion` address to Tor Browser users visiting your clearnet site, add your `.onion` address to `config.json`: + +```json +"main": { + "onion": "http://yourgeneratedaddress.onion" +} +``` + +When set, Tor Browser users visiting the HTTPS clearweb site will see a purple **".onion available"** pill in the address bar. + diff --git a/config_example.json b/config_example.json index 62b7b13..25acd84 100644 --- a/config_example.json +++ b/config_example.json @@ -62,6 +62,7 @@ "show_koepfe": false, "hide_sidebar_default": true, "koepfe": [], + "enable_tor_hs": true, "enable_global_chat": true, "enable_danmaku": true, "private_messages": true, @@ -133,6 +134,8 @@ "open_registration_require_mail_andor_token": false, "private_society": false, "private_society_gate": "cloudflare", + "private_society_gate_location": "Frankfurt", + "private_society_gate_template": "_gate_template", "public_nsfw": false, "paths": { "images": "/b", diff --git a/docker-compose.yml b/docker-compose.yml index 2f9e161..c29b2c2 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -49,6 +49,8 @@ services: tor: image: dockurr/tor container_name: tor + profiles: + - tor ports: - "9050:9050" - "8118:8118" -- 2.50.1