From cc79f53510c4a766965aed1808490931bc6ade6b Mon Sep 17 00:00:00 2001 From: tzlil Date: Mon, 7 Aug 2023 23:22:45 +0300 Subject: try to add cyberchef search engine, move vps to networkd, change website, move git to git.tzlil.net --- hosts/vps/services/git.nix | 83 ++++++++++++++++++++++------------------------ 1 file changed, 40 insertions(+), 43 deletions(-) (limited to 'hosts/vps/services/git.nix') diff --git a/hosts/vps/services/git.nix b/hosts/vps/services/git.nix index 8bd4653..b6006e2 100644 --- a/hosts/vps/services/git.nix +++ b/hosts/vps/services/git.nix @@ -32,52 +32,49 @@ group = "fcgiwrap"; }; caddy = { - virtualHosts."tzlil.net".extraConfig = '' + virtualHosts."git.tzlil.net".extraConfig = '' bind 0.0.0.0 ${config.website.defaultHeaders} - handle_path /cgit/* { - handle /cgit.png { - root * ${pkgs.cgit}/cgit - file_server - } - handle /cgit.css { - try_files ${pkgs.fetchurl { - url = "https://jeremias.stotter.eu/cgi-bin/cgit.cgi/cgit-dark/plain/cgit.css"; - sha256 = "sha256-wqszujnWV5PRh3L23L1BFj/PKUElpyu1KhjqrHS8lCw="; - }} / - 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" - "ssh://git@tzlil.net:$CGIT_REPO_URL" - ]; - enable-log-filecount = 1; - enable-log-linecount = 1; - enable-git-config = 1; - root-title = "tzlil.net"; - root-desc = "Tzlil's Git Repositories"; - scan-path = "/home/git"; - 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"; - readme = ":README.md"; - })} - } - } + handle_path /cgit.png { + try_files ${pkgs.cgit}/cgit/cgit.png / + file_server } + handle_path /cgit.css { + try_files ${pkgs.fetchurl { + url = "https://jeremias.stotter.eu/cgi-bin/cgit.cgi/cgit-dark/plain/cgit.css"; + sha256 = "sha256-wqszujnWV5PRh3L23L1BFj/PKUElpyu1KhjqrHS8lCw="; + }} / + file_server + } + handle_path /favicon.ico { + try_files ${pkgs.cgit}/cgit/favicon.ico / + file_server + } + handle_path / { + 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"; + favicon = "/favicon.ico"; + clone-url = pkgs.lib.concatStringsSep " " [ + "http://git.tzlil.net/$CGIT_REPO_URL" + # "ssh://git@tzlil.net:$CGIT_REPO_URL" + ]; + enable-log-filecount = 1; + enable-log-linecount = 1; + enable-git-config = 1; + root-title = "tzlil.net"; + root-desc = "Tzlil's Git Repositories"; + scan-path = config.users.users.git.home; + about-filter = "${pkgs.cgit}/lib/cgit/filters/about-formatting.py"; + source-filter = "${pkgs.cgit}/lib/cgit/filters/syntax-highlighting.py"; + logo-link = "/"; + readme = ":README.md"; + })} + } + } } ''; }; -- cgit 1.4.1