From dec6902f7cdac02ccf2eb28885bc42a5775a80b2 Mon Sep 17 00:00:00 2001 From: Gregor Kleen Date: Mon, 19 Jun 2017 22:48:48 +0200 Subject: git.rheperire.org --- custom/ymir-nginx.nix | 23 ++++++++++++++++- ymir.nix | 70 +++++++++++++++++++++++++++++++++++++++++++-------- 2 files changed, 82 insertions(+), 11 deletions(-) diff --git a/custom/ymir-nginx.nix b/custom/ymir-nginx.nix index 94e6f1ed..a1de81c3 100644 --- a/custom/ymir-nginx.nix +++ b/custom/ymir-nginx.nix @@ -132,7 +132,28 @@ in { location @cgit { include ${uwsgi_params}; - uwsgi_pass unix:/tmp/cgit.sock; + uwsgi_pass unix:/tmp/git.yggdrasil.li.sock; + uwsgi_modifier1 9; + } + } + + server { + listen *:80; + listen *:443 ssl; + listen [::]:80; + listen [::]:443 ssl; + server_name ~^(.*\.)?git\.rheperire\.org$; + + root ${pkgs.cgit}/cgit; + + try_files $uri @cgit; + + include ${favicon}; + include ${acme}; + + location @cgit { + include ${uwsgi_params}; + uwsgi_pass unix:/tmp/git.rheperire.org.sock; uwsgi_modifier1 9; } } diff --git a/ymir.nix b/ymir.nix index 8b6298fc..6448c568 100644 --- a/ymir.nix +++ b/ymir.nix @@ -295,20 +295,35 @@ in rec { enable = true; plugins = ["python3" "cgi"]; instance = { - type = "normal"; - processes = 1; - threads = 8; - chdir = "${pkgs.cgit}/cgit"; - cgi = "${pkgs.cgit}/cgit/cgit.cgi"; - socket = "/tmp/cgit.sock"; - chmod-socket = "660"; - chown-socket = "uwsgi:nginx"; + type = "emperor"; + vassals = { + "git.yggdrasil.li" = { + processes = 1; + threads = 8; + chdir = "${pkgs.cgit}/cgit"; + cgi = "${pkgs.cgit}/cgit/cgit.cgi"; + env = "CGIT_CONFIG=/etc/cgit/git.yggdrasil.li"; + socket = "/tmp/git.yggdrasil.li.sock"; + chmod-socket = "660"; + chown-socket = "uwsgi:nginx"; + }; + "git.rheperire.org" = { + processes = 1; + threads = 8; + chdir = "${pkgs.cgit}/cgit"; + cgi = "${pkgs.cgit}/cgit/cgit.cgi"; + env = "CGIT_CONFIG=/etc/cgit/git.rheperire.org"; + socket = "/tmp/git.rheperire.org.sock"; + chmod-socket = "660"; + chown-socket = "uwsgi:nginx"; + }; + }; }; }; users.extraUsers."uwsgi".extraGroups = ["git"]; - environment.etc."cgitrc" = { + environment.etc."cgit/git.yggdrasil.li" = { enable = true; text = '' robots=noindex, nofollow @@ -335,7 +350,7 @@ in rec { readme=:readme.txt readme=:readme - clone-prefix=git://git.yggdrasil.li http://git.yggdrasil.li + clone-prefix=git://git.yggdrasil.li https://git.yggdrasil.li strict-export=git-daemon-export-ok project-list=/srv/git/projects.list @@ -343,6 +358,41 @@ in rec { scan-path=/srv/git/repositories ''; }; + environment.etc."cgit/git.rheperire.org" = { + enable = true; + text = '' + robots=noindex, nofollow + virtual-root=/ + enable-git-config=1 + remove-suffix=1 + + root-title=git.rheperire.org + root-desc= + + enable-http-clone=1 + + enable-commit-graph=1 + snapshots=tar tar.gz tar.bz2 tar.xz zip + side-by-side-diffs=1 + + source-filter=${pkgs.cgit}/lib/cgit/filters/syntax-highlighting.py + about-filter=${pkgs.cgit}/lib/cgit/filters/about-formatting.sh + + readme=:README.md + readme=:README.txt + readme=:README + readme=:readme.md + readme=:readme.txt + readme=:readme + + clone-prefix=git://git.rheperire.org https://git.rheperire.org + + strict-export=git-daemon-export-ok + project-list=${pkgs.writeText "project-list" "rheperire.git"} + section-from-path=2 + scan-path=/srv/git/repositories + ''; + }; services.gitolite = { enable = true; -- cgit v1.2.3