user/gitlab-foss: fix shell secret generator

This commit is contained in:
Antoine Martin 2023-01-14 10:04:48 -05:00
parent dfeca8184d
commit eb114fea0c
Signed by: forge
GPG key ID: D62A472A4AA7D541
2 changed files with 2 additions and 7 deletions

View file

@ -4,7 +4,7 @@ pkgname=gitlab-foss
_pkgname=${pkgname%-foss}
pkgver=15.7.2
_gittag=v$pkgver
pkgrel=2
pkgrel=3
pkgdesc="A version control for your server"
url="https://gitlab.com/gitlab-org/gitlab-foss"
arch="x86_64"

View file

@ -8,11 +8,6 @@ shell_secret_file='/etc/gitlab/gitlab_shell_secret'
workhorse_secret_file='/etc/gitlab/gitlab_workhorse_secret'
kas_secret_file='/etc/gitlab/gitlab_kas_secret'
gen_random_hex() {
local bits="$1"
ruby -e "require 'securerandom'; puts SecureRandom.hex($bits)"
}
gen_random_b64() {
local bits="$1"
ruby <<-EOF
@ -57,7 +52,7 @@ chown root:$group "$secrets_file"
if [ ! -f "$shell_secret_file" ]; then
echo "* Generating random secret in $shell_secret_file" >&2
gen_random_hex 16 > "$shell_secret_file"
head -c 512 /dev/urandom | LC_CTYPE=C tr -cd 'a-zA-Z0-9' | head -c 64 > "$shell_secret_file"
chown root:$group "$shell_secret_file"
chmod 0640 "$shell_secret_file"
fi