From 8e73fab30f3dbe2d1cdbe9149fdbc50d4f76a59b Mon Sep 17 00:00:00 2001 From: Chandler Swift Date: Fri, 14 Feb 2025 19:09:38 -0600 Subject: [PATCH 1/4] bert: Add troop352.us --- bert/services/http/index.nix | 1 + bert/services/http/troop352.us.nix | 19 +++++++++++++++++++ 2 files changed, 20 insertions(+) create mode 100644 bert/services/http/troop352.us.nix diff --git a/bert/services/http/index.nix b/bert/services/http/index.nix index 751d1de..409986b 100644 --- a/bert/services/http/index.nix +++ b/bert/services/http/index.nix @@ -17,6 +17,7 @@ ./stjohnscccc.com.nix ./stjohnscccc.org.nix ./swiftgang.net.nix + ./troop352.us.nix ./whereis.chandlerswift.com.nix ]; diff --git a/bert/services/http/troop352.us.nix b/bert/services/http/troop352.us.nix new file mode 100644 index 0000000..a34e233 --- /dev/null +++ b/bert/services/http/troop352.us.nix @@ -0,0 +1,19 @@ +{ + services.caddy.virtualHosts."troop352.us" = { + serverAliases = ["www.troop352.us" "troop352-demo.chandlerswift.com"]; + extraConfig = '' + encode zstd gzip + file_server + root * /srv/www/troop352.us + + handle_errors { + respond "{err.status_code} {err.status_text}" + } + ''; + }; + systemd.tmpfiles.settings."10-troop352-us" = { + "/srv/www/troop352.us" = { + d = {}; + }; + }; +} From 646eb50ebab5cde2c901939f4e81822e6f9c4c0b Mon Sep 17 00:00:00 2001 From: Chandler Swift Date: Fri, 14 Feb 2025 19:15:25 -0600 Subject: [PATCH 2/4] bert: Redirect all troop352.us URLs to / This is for backwards compatibility with the old site, which had e.g. the calendar at `/calendar/`, etc. --- bert/services/http/troop352.us.nix | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/bert/services/http/troop352.us.nix b/bert/services/http/troop352.us.nix index a34e233..bd92dd2 100644 --- a/bert/services/http/troop352.us.nix +++ b/bert/services/http/troop352.us.nix @@ -6,6 +6,12 @@ file_server root * /srv/www/troop352.us + @notRoot { + not path / + not file + } + redir @notRoot / + handle_errors { respond "{err.status_code} {err.status_text}" } From 6a86383de96e96d081457590a9f0a7576b4f747b Mon Sep 17 00:00:00 2001 From: Chandler Swift Date: Fri, 14 Feb 2025 19:17:43 -0600 Subject: [PATCH 3/4] bert: Add sharontrahan.com redirect --- bert/services/http/index.nix | 1 + bert/services/http/sharontrahan.com.nix | 8 ++++++++ 2 files changed, 9 insertions(+) create mode 100644 bert/services/http/sharontrahan.com.nix diff --git a/bert/services/http/index.nix b/bert/services/http/index.nix index 409986b..c4135ff 100644 --- a/bert/services/http/index.nix +++ b/bert/services/http/index.nix @@ -13,6 +13,7 @@ ./maps.chandlerswift.com.nix ./music.chandlerswift.com.nix ./preview.chandlerswift.com.nix + ./sharontrahan.com.nix ./social.chandlerswift.com.nix ./stjohnscccc.com.nix ./stjohnscccc.org.nix diff --git a/bert/services/http/sharontrahan.com.nix b/bert/services/http/sharontrahan.com.nix new file mode 100644 index 0000000..b6a759d --- /dev/null +++ b/bert/services/http/sharontrahan.com.nix @@ -0,0 +1,8 @@ +{ + services.caddy.virtualHosts."sharontrahan.com" = { + serverAliases = ["www.sharontrahan.com"]; + extraConfig = '' + redir https://fusion-living.com/ + ''; + }; +} From b700b281607d23a2fe9d033deb42ae9e8534e7c1 Mon Sep 17 00:00:00 2001 From: Chandler Swift Date: Fri, 14 Feb 2025 19:29:31 -0600 Subject: [PATCH 4/4] bert: Add nau-sidewalks.chandlerswift.com --- bert/services/http/index.nix | 1 + .../http/nau-sidewalks.chandlerswift.com.nix | 34 +++++++++++++++++++ 2 files changed, 35 insertions(+) create mode 100644 bert/services/http/nau-sidewalks.chandlerswift.com.nix diff --git a/bert/services/http/index.nix b/bert/services/http/index.nix index c4135ff..577cdf0 100644 --- a/bert/services/http/index.nix +++ b/bert/services/http/index.nix @@ -12,6 +12,7 @@ ./lawrencedeerclub.chandlerswift.com.nix ./maps.chandlerswift.com.nix ./music.chandlerswift.com.nix + ./nau-sidewalks.chandlerswift.com.nix ./preview.chandlerswift.com.nix ./sharontrahan.com.nix ./social.chandlerswift.com.nix diff --git a/bert/services/http/nau-sidewalks.chandlerswift.com.nix b/bert/services/http/nau-sidewalks.chandlerswift.com.nix new file mode 100644 index 0000000..3920b62 --- /dev/null +++ b/bert/services/http/nau-sidewalks.chandlerswift.com.nix @@ -0,0 +1,34 @@ +{config, ...}: { + services.caddy.virtualHosts."nau-sidewalks.chandlerswift.com".extraConfig = '' + reverse_proxy localhost:8003 + ''; +} + +# { config, pkgs, lib, ... }: +# let +# nau-sidewalks = pkgs.buildGoModule { +# pname = "nau-sidewalks"; +# version = "0.2.0"; +# src = pkgs.fetchgit { +# url = "https://git.chandlerswift.com/chandlerswift/nau-sidewalks"; +# rev = "v0.2.0"; +# sha256 = "sha256-D8f7jPcgs6yD9D+V4uy3FIBqqqZVehZM7hJ6tdERKqc="; +# }; +# vendorHash = "sha256-yKZdNhNyUOqywLy/RDjcziJ0FfrpuNcNMwyUAnRov60="; +# }; +# in +# { +# systemd.services.nau-sidewalks = { +# enable = true; +# after = [ "network.target" ]; +# wantedBy = [ "multi-user.target" ]; +# serviceConfig = { +# ExecStart = "${nau-sidewalks}/bin/nau-sidewalks"; +# Restart = "on-failure"; +# }; +# }; + +# services.caddy.virtualHosts."nau-sidewalks.chandlerswift.com".extraConfig = '' +# reverse_proxy localhost:8001 +# ''; +# }