citadel

My dotfiles, scripts and nix configs
git clone git://jb55.com/citadel
Log | Files | Refs | README | LICENSE

commit e064741f347a31dd739a506473eb20fb5c6ac0b2
parent 34024450c7ae550161dc7b835db95432fe314ccd
Author: William Casarin <jb55@jb55.com>
Date:   Tue,  2 Mar 2021 15:55:06 -0800

BACKPORT: fix public git stuff

Signed-off-by: William Casarin <jb55@jb55.com>

Diffstat:
Mnix-config/machines/charon/default.nix | 32+++++++++++++++++++++++++++++---
1 file changed, 29 insertions(+), 3 deletions(-)

diff --git a/nix-config/machines/charon/default.nix b/nix-config/machines/charon/default.nix @@ -1,8 +1,8 @@ extra: { config, lib, pkgs, ... }: let gitExtra = { - git = {projectroot = "/var/git";}; - host = "git.zero.jb55.com"; + git = {projectroot = "/var/git-public/repos";}; + host = "git.jb55.com"; }; httpipePort = "8899"; # httpiped = (import (pkgs.fetchgit { @@ -30,6 +30,7 @@ let gitExtra = { }; gitCfg = extra.git-server { inherit config pkgs; extra = extra // gitExtra; }; + hearpress = (import <jb55pkgs> { nixpkgs = pkgs; }).hearpress; myemail = "jb55@jb55.com"; xmpp_modules = [ @@ -132,6 +133,17 @@ in services.gitDaemon.basePath = "/var/git-public/repos"; services.gitDaemon.enable = true; + users.users = { + git = { + uid = config.ids.uids.git; + description = "Git daemon user"; + }; + }; + + users.groups = { + git.gid = config.ids.gids.git; + }; + services.radicale.enable = true; services.radicale.config = '' [auth] @@ -272,7 +284,6 @@ in services.fcgiwrap.enable = true; services.nginx.httpConfig = '' - ${gitCfg} server { listen 443 ssl; @@ -331,6 +342,21 @@ in root /var/www/challenges; } + location ~ ^(/[^/]+)/?$ { + if (-f $document_root$1/file/README.md.html) { + return 302 $1/file/README.md.html; + } + if (-f $document_root$1/file/README.html) { + return 302 $1/file/README.html; + } + if (-f $document_root$1/file/README.txt.html) { + return 302 $1/file/README.txt.html; + } + if (-f $document_root$1/log.html) { + return 302 $1/log.html; + } + } + root /var/git-public/stagit; index index.html index.htm;