diff --git a/scripts/Common/Software/docker/services/forgejo/docker-compose.base.yml b/scripts/Common/Software/docker/services/forgejo/docker-compose.base.yml index 05c36f0b..b74510bc 100644 --- a/scripts/Common/Software/docker/services/forgejo/docker-compose.base.yml +++ b/scripts/Common/Software/docker/services/forgejo/docker-compose.base.yml @@ -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 diff --git a/scripts/Common/Software/docker/services/forgejo/main.fish b/scripts/Common/Software/docker/services/forgejo/main.fish index 218dda24..6d3f3d36 100755 --- a/scripts/Common/Software/docker/services/forgejo/main.fish +++ b/scripts/Common/Software/docker/services/forgejo/main.fish @@ -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"