From 31d6a1ec801d11157297e16aa42a149c610d95c5 Mon Sep 17 00:00:00 2001 From: Guanran Wang Date: Sat, 5 Oct 2024 20:13:21 +0800 Subject: [PATCH] sin0/redlib: add settings --- hosts/vultr/sin0/services/redlib.nix | 23 +++++++++++------------ 1 file changed, 11 insertions(+), 12 deletions(-) diff --git a/hosts/vultr/sin0/services/redlib.nix b/hosts/vultr/sin0/services/redlib.nix index afbd6a4..6535037 100644 --- a/hosts/vultr/sin0/services/redlib.nix +++ b/hosts/vultr/sin0/services/redlib.nix @@ -9,19 +9,18 @@ in address = "127.0.0.1"; }; + systemd.services."redlib".environment = { + # Google's indexing caused a DoS with 800k requests... + # https://developers.google.com/search/docs/crawling-indexing/block-indexing + REDLIB_ROBOTS_DISABLE_INDEXING = "on"; + REDLIB_DEFAULT_USE_HLS = "on"; + }; + services.caddy.settings.apps.http.servers.srv0.routes = lib.singleton { match = lib.singleton { host = [ "reddit.ny4.dev" ]; }; - handle = [ - { - # Google's indexing caused a DoS with 800k requests... - # https://developers.google.com/search/docs/crawling-indexing/block-indexing - handler = "headers"; - response.set."X-Robots-Tag" = [ "noindex" ]; - } - { - handler = "reverse_proxy"; - upstreams = [ { dial = "localhost:${toString port}"; } ]; - } - ]; + handle = lib.singleton { + handler = "reverse_proxy"; + upstreams = [ { dial = "localhost:${toString port}"; } ]; + }; }; }