diff --git a/assets/wrapper b/assets/wrapper index 185e33d..580630d 100755 --- a/assets/wrapper +++ b/assets/wrapper @@ -19,7 +19,7 @@ function failed_pg_upgrade() { function clean_stale_pids() { # cleanup known pid/socket files - for x in /opt/gitlab/sv /run $(ls -d /tmp/gitaly-ruby* 2>/dev/null) ; do + for x in /opt/gitlab/sv /run ; do # find # - any (s)ocket or regular (f)ile # - by the name of "*.pid" or "socket.?" @@ -54,7 +54,7 @@ function unmigrated_data_check() { if [ $? -ne 0 ]; then echo "Upgrade failed. Could not check for unmigrated data on legacy storage." echo "" - echo $output + echo $found echo "" echo "" echo "If you would like to restart the instance without performing this" @@ -112,7 +112,7 @@ if old_version=$(cat /var/opt/gitlab/gitlab-rails/VERSION) then GITLAB_UPGRADE='true' new_version=$(awk '/^gitlab-(ce|ee|jh)/ {print $NF}' /opt/gitlab/version-manifest.txt) - MIN_VERSION="15.0" gitlab-ctl upgrade-check "${old_version}" "${new_version}" + MIN_VERSION="15.11" gitlab-ctl upgrade-check "${old_version}" "${new_version}" fi # Copy gitlab.rb for the first time @@ -128,16 +128,28 @@ if [[ ! -f /etc/gitlab/ssh_host_rsa_key ]]; then ssh-keygen -f /etc/gitlab/ssh_host_rsa_key -N '' -t rsa chmod 0600 /etc/gitlab/ssh_host_rsa_key fi +# sshd loads the keys from /etc/gitlab, but the GitLab backend looks for keys +# from within /etc/ssh +ln -fs /etc/gitlab/ssh_host_rsa_key.pub /etc/ssh/ssh_host_rsa_key.pub + if [[ ! -f /etc/gitlab/ssh_host_ecdsa_key ]]; then echo "Generating ssh_host_ecdsa_key..." ssh-keygen -f /etc/gitlab/ssh_host_ecdsa_key -N '' -t ecdsa chmod 0600 /etc/gitlab/ssh_host_ecdsa_key fi +# sshd loads the keys from /etc/gitlab, but the GitLab backend looks for keys +# from within /etc/ssh +ln -fs /etc/gitlab/ssh_host_ecdsa_key.pub /etc/ssh/ssh_host_ecdsa_key.pub + if [[ ! -f /etc/gitlab/ssh_host_ed25519_key ]]; then echo "Generating ssh_host_ed25519_key..." ssh-keygen -f /etc/gitlab/ssh_host_ed25519_key -N '' -t ed25519 chmod 0600 /etc/gitlab/ssh_host_ed25519_key fi +# sshd loads the keys from /etc/gitlab, but the GitLab backend looks for keys +# from within /etc/ssh +ln -fs /etc/gitlab/ssh_host_ed25519_key.pub /etc/ssh/ssh_host_ed25519_key.pub + # Remove all services, the reconfigure will create them echo "Preparing services..." @@ -148,6 +160,11 @@ mkdir -p /var/run/sshd mkdir -p /var/log/gitlab/sshd mkdir -p /var/log/gitlab/reconfigure +if [ -n "${GITLAB_PRE_RECONFIGURE_SCRIPT+x}" ]; then + echo "Running Pre Reconfigure Script..." + eval "${GITLAB_PRE_RECONFIGURE_SCRIPT}" +fi + # Start service manager echo "Starting services..." GITLAB_OMNIBUS_CONFIG= /opt/gitlab/embedded/bin/runsvdir-start &