From 37ae3fd19009e6cdc0efbe00a055b9a1173d21ea Mon Sep 17 00:00:00 2001 From: tzlil Date: Sun, 26 Feb 2023 14:26:26 +0200 Subject: expose cgit and lain, will switch to git.* subdomain once i get one --- hosts/vps/git.nix | 45 +++++++++++++++++++++++---------------------- 1 file changed, 23 insertions(+), 22 deletions(-) (limited to 'hosts/vps/git.nix') 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"; })} + } } - } } ''; }; -- cgit 1.4.1