archives/gitlab-shell: new aport

This commit is contained in:
Antoine Martin 2024-08-09 22:27:57 -04:00
parent f690124a2f
commit 9f6c072b60
Signed by: ayakael
GPG key ID: D62A472A4AA7D541
6 changed files with 270 additions and 0 deletions

View file

@ -0,0 +1,23 @@
#!/bin/sh
set -eu
keys_file='/var/lib/gitlab/.ssh/authorized_keys'
if [ ! -f "$keys_file" ]; then
keys_dir="$(dirname "$keys_file")"
echo "* Initializing authorized_keys file in $keys_dir" 1>&2
mkdir -m0700 -p "$keys_dir"
chown git:git "$keys_dir"
touch "$keys_file"
chmod 0600 "$keys_file"
chown git:git "$keys_file"
fi
cat <<EOF >&2
*
* GitLab Shell has been initialized. Read /etc/gitlab/gitlab-shell.yml and
* modify settings as need.
*
EOF