Make forgejo work under Arch Linux

This commit is contained in:
Manuel Thalmann 2024-12-11 03:30:36 +01:00
parent 84818c2bac
commit ce70e66c70
2 changed files with 5 additions and 2 deletions

View file

@ -24,7 +24,7 @@ services:
- ./data/forgejo:/data
- config:/data/gitea/conf
- /etc/timezone:/etc/timezone:ro
- /home/forgejo/.ssh:/data/git/.ssh
- /srv/git/.ssh:/data/git/.ssh
db:
image: mariadb
restart: unless-stopped

View file

@ -48,6 +48,7 @@ begin
set -l port
set -l file (mktemp)
set -l root (getServiceRoot $argv)
set -l home /srv/git
set -l dir "$root/data"
set -l bin /usr/local/bin/forgejo
set -l config "$root/docker-compose.base.yml"
@ -60,18 +61,20 @@ begin
--system \
--shell /bin/bash \
--comment 'Git Version Control' \
--create-home \
$user
set uid (id -u $user)
set gid (id -g $user)
and sudo usermod -d "$home" "$user"
and yq "$envKey.USER_UID = $uid" "$file" |
yq "$envKey.USER_GID = $gid" |
sudo tee "$config" >/dev/null
and sudo mkdir -p "$dir"
and sudo mkdir -p "$home"
and sudo chown -R $uid:$gid "$dir"
and sudo chown -R $uid:$gid "$home"
and sudo -u "#$uid" mkdir -p ~"$user"/.ssh
rm "$file"