From 9e3c4ee13e80a45aaeef8b5e470c78df0fd99755 Mon Sep 17 00:00:00 2001 From: Chandler Swift Date: Tue, 12 Nov 2024 01:56:24 -0600 Subject: [PATCH] bert: Add handle_errors clause to all sites It looks like this was CLOSED WONTFIX: How can we _possibly_ know that upon an error, the developer might want us to send an indication of that error??!!1! Snark aside (mine and his): it looks like there's not a great way to enable sane error behavior globally :/ https://caddy.community/t/handling-errors-globally/17174/2 In the future, I should probably make this a snippet or something. --- bert/services/http/files.chandlerswift.com.nix | 4 ++++ bert/services/http/harborpaperco.com.nix | 4 ++++ bert/services/http/home.chandlerswift.com.nix | 4 ++++ bert/services/http/katherineandchandler.com.nix | 4 ++++ bert/services/http/maps.chandlerswift.com.nix | 4 ++++ bert/services/http/swiftgang.net.nix | 4 ++++ 6 files changed, 24 insertions(+) diff --git a/bert/services/http/files.chandlerswift.com.nix b/bert/services/http/files.chandlerswift.com.nix index 74c5e0c..7aead1e 100644 --- a/bert/services/http/files.chandlerswift.com.nix +++ b/bert/services/http/files.chandlerswift.com.nix @@ -4,6 +4,10 @@ encode zstd gzip file_server root * /srv/www/files.chandlerswift.com + + handle_errors { + respond "{err.status_code} {err.status_text}" + } ''; systemd.tmpfiles.settings."10-files-chandlerswift-com" = { "/srv/www/files.chandlerswift.com" = { diff --git a/bert/services/http/harborpaperco.com.nix b/bert/services/http/harborpaperco.com.nix index 705b0b1..8b46fa2 100644 --- a/bert/services/http/harborpaperco.com.nix +++ b/bert/services/http/harborpaperco.com.nix @@ -6,6 +6,10 @@ encode zstd gzip file_server root * /srv/www/harborpaperco.com + + handle_errors { + respond "{err.status_code} {err.status_text}" + } ''; }; # services.caddy.virtualHosts."pureserendipityweddings.com" = { diff --git a/bert/services/http/home.chandlerswift.com.nix b/bert/services/http/home.chandlerswift.com.nix index 506ef7d..1c11558 100644 --- a/bert/services/http/home.chandlerswift.com.nix +++ b/bert/services/http/home.chandlerswift.com.nix @@ -16,6 +16,10 @@ # it sorta feels wrong to do this without a `/sheets` suffix. root /mnt/bigbird-public } + + handle_errors { + respond "{err.status_code} {err.status_text}" + } ''; systemd.tmpfiles.settings."10-home-chandlerswift-com" = { "/srv/www/home.chandlerswift.com" = { diff --git a/bert/services/http/katherineandchandler.com.nix b/bert/services/http/katherineandchandler.com.nix index 352cf32..2aa308d 100644 --- a/bert/services/http/katherineandchandler.com.nix +++ b/bert/services/http/katherineandchandler.com.nix @@ -5,6 +5,10 @@ file_server root * /srv/www/katherineandchandler.com # hide .git # ??? + + handle_errors { + respond "{err.status_code} {err.status_text}" + } ''; systemd.tmpfiles.settings."10-katherineandchandler-com" = { "/srv/www/katherineandchandler.com" = { diff --git a/bert/services/http/maps.chandlerswift.com.nix b/bert/services/http/maps.chandlerswift.com.nix index fb21cb8..101820b 100644 --- a/bert/services/http/maps.chandlerswift.com.nix +++ b/bert/services/http/maps.chandlerswift.com.nix @@ -5,6 +5,10 @@ file_server root * /srv/www/maps.chandlerswift.com # hide .git # ??? + + handle_errors { + respond "{err.status_code} {err.status_text}" + } ''; systemd.tmpfiles.settings."10-maps-chandlerswift-com" = { "/srv/www/maps.chandlerswift.com" = { diff --git a/bert/services/http/swiftgang.net.nix b/bert/services/http/swiftgang.net.nix index 82bee79..1de094e 100644 --- a/bert/services/http/swiftgang.net.nix +++ b/bert/services/http/swiftgang.net.nix @@ -4,6 +4,10 @@ encode zstd gzip file_server root * /srv/www/swiftgang.net + + handle_errors { + respond "{err.status_code} {err.status_text}" + } ''; systemd.tmpfiles.settings."10-swiftgang-net" = { "/srv/www/swiftgang.net" = {