summary refs log tree commit diff
diff options
context:
space:
mode:
authortzlil <tzlils@protonmail.com>2023-02-26 14:26:26 +0200
committertzlil <tzlils@protonmail.com>2023-02-26 14:26:26 +0200
commit37ae3fd19009e6cdc0efbe00a055b9a1173d21ea (patch)
tree44a1203327cfdd52e4cd9f009d0ab6cb5fdf50d8
parent9259ed8b7941c8211223491b1069a8a7573ccbc7 (diff)
expose cgit and lain, will switch to git.* subdomain once i get one
-rw-r--r--hosts/vps/git.nix45
-rw-r--r--hosts/vps/website.nix12
2 files changed, 31 insertions, 26 deletions
diff --git a/hosts/vps/git.nix b/hosts/vps/git.nix
index 53afa3d..a8568b9 100644
--- a/hosts/vps/git.nix
+++ b/hosts/vps/git.nix
@@ -33,29 +33,29 @@
         group = "fcgiwrap";
       };
       caddy = {
-        virtualHosts."http://git.95.179.168.209.vultrusercontent.com".extraConfig = ''
+        virtualHosts."http://95.179.168.209".extraConfig = ''
           bind 0.0.0.0
           ${config.website.defaultHeaders}
-          header -Server
-          handle /cgit.png {
-            root * ${pkgs.cgit}/cgit
-            file_server
-          }
-          handle /cgit.css {
-            root * ${pkgs.cgit}/cgit
-            file_server
-          }
-          handle /favicon.ico {
-            root * ${pkgs.cgit}/cgit
-            file_server
-          }
-          handle {
-            reverse_proxy unix//run/fcgiwrap.sock {
-              transport fastcgi {
-                env SCRIPT_FILENAME ${pkgs.cgit}/cgit/cgit.cgi
-                env CGIT_CONFIG ${pkgs.writeText "cgitrc" (pkgs.lib.generators.toKeyValue {} {
-            css = "/cgit.css";
-            logo = "/cgit.png";
+          handle_path /cgit/* {
+            handle /cgit.png {
+              root * ${pkgs.cgit}/cgit
+              file_server
+            }
+            handle /cgit.css {
+              root * ${pkgs.cgit}/cgit
+              file_server
+            }
+            handle /favicon.ico {
+              root * ${pkgs.cgit}/cgit
+              file_server
+            }
+            handle {
+              reverse_proxy unix//run/fcgiwrap.sock {
+                transport fastcgi {
+                  env SCRIPT_FILENAME ${pkgs.cgit}/cgit/cgit.cgi
+                  env CGIT_CONFIG ${pkgs.writeText "cgitrc" (pkgs.lib.generators.toKeyValue {} {
+            css = "/cgit/cgit.css";
+            logo = "/cgit/cgit.png";
             favicon = "/favicon.ico";
             clone-url = pkgs.lib.concatStringsSep " " [
               "http://$HTTP_HOST$SCRIPT_NAME/$CGIT_REPO_URL"
@@ -70,9 +70,10 @@
             about-filter = "${pkgs.cgit}/lib/cgit/filters/about-formatting.py";
             source-filter = "${pkgs.cgit}/lib/cgit/filters/syntax-highlighting.py";
             logo-link = "/";
+            virtual-root = "/cgit";
           })}
+                }
               }
-            }
           }
         '';
       };
diff --git a/hosts/vps/website.nix b/hosts/vps/website.nix
index 25157a1..ff5d0d9 100644
--- a/hosts/vps/website.nix
+++ b/hosts/vps/website.nix
@@ -33,9 +33,10 @@
     services.caddy = {
       enable = true;
       virtualHosts = {
-        "http://95.179.168.209.vultrusercontent.com ".extraConfig = ''
+        "http://95.179.168.209".extraConfig = ''
           bind 0.0.0.0
-          try_files ${pkgs.writeText "index.html" ''
+          handle_path / {
+            try_files ${pkgs.writeText "index.txt" ''
 ~?~+=I?~~IIIII++,:   .?= .,I=O8OZ.DNNO, ZD7:::=.? ,,:,,I,,:,~+?II?I?II?=+=~+7$ZO
 ?==++??==+I???7..:.   :II$77?I+ID~NND8.ZMN7~=~I7:,., :?7,.,.~+?I???????,+~7+$ZOZ
 7+===I+~===?I77:  ?   ,$7$.:.,I?=7NNNINMMMNOI=++ .~==I$7, ..++?I???I+=?.+:O+ZZOZ
@@ -57,8 +58,11 @@ I??:==?I++I?~==+=~:.?I7I77$?IZ$ZODDOIDNNNNNMMMMNM8?.:. ,,+=,::~+==II=~,=?+?IIIII
 ??III7II+~:?II7+II?, ~,:,~7777$$$I$8DNMMNO   .~I  .Z:.,:~: ,+???+=,IIIIII??IIIII
 ???I7I:,~=:,+II+=~I??:.,,,.:77777777$ODMM8 .:+ZI. ,~,..~~ :II?==~:?II??IIIIIIIII
 No matter where you go, everybody's connected
-          ''} /
-          file_server
+
+/cgit/ for repositories
+            ''} /
+            file_server
+          }
         '';
       };
     };