aboutsummaryrefslogtreecommitdiffstats
path: root/roles/jails/22_forge/templates
diff options
context:
space:
mode:
authorJan Sydänviita <jan@sydanviita.fi>2026-08-20 18:39:12 +0300
committerJan Sydänviita <jan@sydanviita.fi>2026-08-20 18:51:22 +0300
commit76f5c19d272b7f73198751a65d8ca6a5a4864bb1 (patch)
treefb8071125b587d60a7577c0660fc63a233a8fd2d /roles/jails/22_forge/templates
parent55a67ef35de8b425b83372667de223c46f3307ea (diff)
Add multi user support to forge
Diffstat (limited to 'roles/jails/22_forge/templates')
-rw-r--r--roles/jails/22_forge/templates/etc_ssh_sshd_config.j29
-rw-r--r--roles/jails/22_forge/templates/usr_local_etc_cgitrc.j22
-rw-r--r--roles/jails/22_forge/templates/usr_local_etc_nginx_nginx.conf.j22
3 files changed, 8 insertions, 5 deletions
diff --git a/roles/jails/22_forge/templates/etc_ssh_sshd_config.j2 b/roles/jails/22_forge/templates/etc_ssh_sshd_config.j2
index c99143c..11cf4a7 100644
--- a/roles/jails/22_forge/templates/etc_ssh_sshd_config.j2
+++ b/roles/jails/22_forge/templates/etc_ssh_sshd_config.j2
@@ -8,11 +8,14 @@ HostKey /etc/ssh/ssh_host_ed25519_key
PermitRootLogin no
PubkeyAuthentication yes
-AuthorizedKeysFile .ssh/authorized_keys
+AuthorizedKeysFile /var/db/forge-config/%u/.ssh/authorized_keys
PasswordAuthentication no
ChallengeResponseAuthentication no
-AllowUsers git
-
UseDNS no
PrintMotd no
+
+{% for user in forge_users %}
+Match User {{ user.name }}
+ SetEnv GIT_CONFIG_GLOBAL=/var/db/forge-config/{{ user.name }}/.gitconfig
+{% endfor %}
diff --git a/roles/jails/22_forge/templates/usr_local_etc_cgitrc.j2 b/roles/jails/22_forge/templates/usr_local_etc_cgitrc.j2
index 1fac7f1..7a0e040 100644
--- a/roles/jails/22_forge/templates/usr_local_etc_cgitrc.j2
+++ b/roles/jails/22_forge/templates/usr_local_etc_cgitrc.j2
@@ -27,4 +27,4 @@ readme=:README
readme=:README.txt
# Scan /home/git for bare repositories
-scan-path=/home/git
+scan-path=/var/db/repos
diff --git a/roles/jails/22_forge/templates/usr_local_etc_nginx_nginx.conf.j2 b/roles/jails/22_forge/templates/usr_local_etc_nginx_nginx.conf.j2
index 7baf367..c154f2c 100644
--- a/roles/jails/22_forge/templates/usr_local_etc_nginx_nginx.conf.j2
+++ b/roles/jails/22_forge/templates/usr_local_etc_nginx_nginx.conf.j2
@@ -22,7 +22,7 @@ http {
include fastcgi_params;
fastcgi_param SCRIPT_FILENAME /usr/local/bin/git-http-backend;
fastcgi_param GIT_HTTP_EXPORT_ALL "";
- fastcgi_param GIT_PROJECT_ROOT /home/git;
+ fastcgi_param GIT_PROJECT_ROOT /var/db/repos;
fastcgi_param GIT_CONFIG_GLOBAL /usr/local/etc/git/gitconfig-www;
fastcgi_param PATH_INFO /$1/$2;
fastcgi_pass unix:/var/run/fcgiwrap/fcgiwrap.sock;