summaryrefslogtreecommitdiffstats
path: root/krebs/3modules
diff options
context:
space:
mode:
authormakefu <github@syntax-fehler.de>2020-07-13 11:43:34 +0200
committermakefu <github@syntax-fehler.de>2020-07-13 11:43:34 +0200
commitcf87c49f2cc5fc36f5b011d627df38443fe419f7 (patch)
tree5f6d721b5fee6f29d2155a4d922f1e2b9dda1c9e /krebs/3modules
parent48b953d8118c0d4dbe214e4ef6e3d923b356accf (diff)
parent2e26408bfecf27bc70f7b4955c499029bccfa9f4 (diff)
Merge remote-tracking branch 'tv/master'
Diffstat (limited to 'krebs/3modules')
-rw-r--r--krebs/3modules/git.nix16
1 files changed, 16 insertions, 0 deletions
diff --git a/krebs/3modules/git.nix b/krebs/3modules/git.nix
index 895d9b3b6..4eb881341 100644
--- a/krebs/3modules/git.nix
+++ b/krebs/3modules/git.nix
@@ -186,6 +186,12 @@ let
type = types.nullOr types.str;
default = null;
};
+ source-filter = mkOption {
+ type = types.nullOr types.absolute-pathname;
+ default = null;
+ example = literalExample
+ "\${pkgs.cgit}/lib/cgit/filters/syntax-highlighting.py";
+ };
virtual-root = mkOption {
type = types.nullOr types.absolute-pathname;
default = "/";
@@ -452,6 +458,16 @@ let
fastcgi_param HTTP_HOST $server_name;
fastcgi_pass unix:${config.services.fcgiwrap.socketAddress};
'';
+ # Smart HTTP transport. Regex based on.
+ # https://github.com/git/git/blob/v2.27.0/http-backend.c#L708-L721
+ locations."~ \"^/[0-9A-Za-z._-]+/(HEAD|info/refs|objects/info/(alternates|http-alternates|packs)|[0-9a-f]{2}/([0-9a-f]{38}|[0-9a-f]{62})|pack/pack-([0-9a-f]{40}|[0-9a-f]{64})\\.(pack|idx)|git-upload-pack|git-receive-pack)$\"".extraConfig = ''
+ include ${pkgs.nginx}/conf/fastcgi_params;
+ fastcgi_param GIT_HTTP_EXPORT_ALL "";
+ fastcgi_param GIT_PROJECT_ROOT ${cfg.dataDir};
+ fastcgi_param PATH_INFO $fastcgi_script_name;
+ fastcgi_param SCRIPT_FILENAME ${pkgs.git}/bin/git-http-backend;
+ fastcgi_pass unix:${config.services.fcgiwrap.socketAddress};
+ '';
locations."/static/".extraConfig = ''
root ${pkgs.cgit}/cgit;
rewrite ^/static(/.*)$ $1 break;