From 1cdcf7c5f94f54739fa7d79f1d29377a7a5dacbc Mon Sep 17 00:00:00 2001 From: "Casper V. Kristensen" Date: Tue, 26 Nov 2024 00:42:39 +0100 Subject: [PATCH] tor: exit relay notice --- hosts/tor/tor.nix | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/hosts/tor/tor.nix b/hosts/tor/tor.nix index 7ac8c0f..25cfc58 100644 --- a/hosts/tor/tor.nix +++ b/hosts/tor/tor.nix @@ -76,8 +76,19 @@ nyx # Command-line monitor for Tor ]; - # TODO: serve `builtins.toFile "tor-exit-notice.html" (builtins.readFile ./tor-exit-notice.html)` on HTTP - # Exit Notice HTML page (https://community.torproject.org/relay/setup/exit/) + # Serve Exit Relay Notice HTML page + # https://community.torproject.org/relay/setup/exit/ + services.caddy = { + enable = true; + virtualHosts = { + "http://" = { + extraConfig = '' + header Content-Type text/html + respond `${builtins.readFile ./tor-exit-notice.html}` + ''; + }; + }; + }; # https://support.torproject.org/relay-operators/#relay-operators_relay-bridge-overloaded # https://lists.torproject.org/pipermail/tor-talk/2012-August/025296.html