about summary refs log tree commit diff
diff options
context:
space:
mode:
authorNguyễn Gia Phong <cnx@loang.net>2023-09-11 19:11:46 +0900
committerNguyễn Gia Phong <cnx@loang.net>2023-09-11 19:11:46 +0900
commitcf4baa6815f50c0b2ec08788db700ee720f295c2 (patch)
tree3c8ec15f8b5a601ab65178d94c7fea885e555cb3
parentbdb52bca2f047282b1b0e766134905eda6948231 (diff)
downloadnixos-conf-cf4baa6815f50c0b2ec08788db700ee720f295c2.tar.gz
Drop auth for comics from OpenNIC
-rw-r--r--static.nix36
1 files changed, 23 insertions, 13 deletions
diff --git a/static.nix b/static.nix
index 71889e8..c8e4eb2 100644
--- a/static.nix
+++ b/static.nix
@@ -17,7 +17,10 @@
 # along with loang configuration.  If not, see <https://www.gnu.org/licenses/>.
 
 { config, lib, pkgs, ... }:
-let inherit (config.networking) domain;
+let
+  inherit (config.networking) domain;
+  inherit (config.services) phylactery;
+  phylacteryAddress = "http://${phylactery.host}:${toString phylactery.port}";
 in {
   networking.firewall.allowedTCPPorts = [
     80 # HTTP
@@ -74,6 +77,24 @@ in {
           root = "/var/lib/www/khoanh.${domain}";
         };
 
+        "xem.${domain}" = {
+          enableACME = true;
+          forceSSL = true;
+          locations."/" = {
+            extraConfig = ''
+              auth_pam "Password Required";
+              auth_pam_service_name "nginx";
+            '';
+            proxyPass = phylacteryAddress;
+          };
+        };
+
+        "striproman.pirate" = {
+          addSSL = true;
+          useACMEHost = "xem.${domain}";
+          locations."/".proxyPass = phylacteryAddress;
+        };
+
         "cercle.libre" = {
           addSSL = true;
           useACMEHost = "khoanh.${domain}";
@@ -129,18 +150,7 @@ in {
           '';
         };
         root = "/mnt/nas/www/px.cnx.gdn";
-      }) // (aliasOpenNIC "striproman.pirate" "xem.${domain}" (let
-        address = "http://${phylactery.host}:${toString phylactery.port}";
-        phylactery = config.services.phylactery;
-      in {
-        locations."/" = {
-          proxyPass = address;
-          extraConfig = ''
-            auth_pam "Password Required";
-            auth_pam_service_name "nginx";
-          '';
-        };
-      })));
+      }));
     };
 
     phylactery = {