From dd9af147c73404fbca6afa31abc01aa451d18a9a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Benjamin=20B=C3=A4dorf?= Date: Fri, 27 Oct 2023 22:54:39 +0200 Subject: [PATCH] chore: add Mastodon maintenance page Depends on https://git.pub.solar/pub-solar/pub.solar/pulls/15 being merged and deployed. --- hosts/flora-6/caddy.nix | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) diff --git a/hosts/flora-6/caddy.nix b/hosts/flora-6/caddy.nix index c76da453..0bcd80ad 100644 --- a/hosts/flora-6/caddy.nix +++ b/hosts/flora-6/caddy.nix @@ -4,7 +4,24 @@ pkgs, self, ... -}: { +}: let + maintenanceMode = { + logFormat = lib.mkForce '' + output discard + ''; + extraConfig = '' + root * /srv/www/pub.solar + + error * "Scheduled Maintenance" 503 + + handle_errors { + root * /srv/www/pub.solar + rewrite * /maintenance/index.html + file_server + } + ''; + }; +in { systemd.tmpfiles.rules = [ "d '/data/srv/www/os/download/' 0750 hakkonaut hakkonaut - -" ]; @@ -79,6 +96,9 @@ redir https://pub.solar{uri} ''; }; + + "mastodon.pub.solar" = maintenanceMode; + "auth.pub.solar" = { logFormat = lib.mkForce '' output discard