create .ssh/authorized_keys in postinst

This commit is contained in:
Praveen Arimbrathodiyil 2016-07-20 23:09:19 +05:30
parent 1cb605e1d8
commit 184238ef63
2 changed files with 11 additions and 1 deletions

6
debian/changelog vendored
View file

@ -1,3 +1,9 @@
gitlab (8.9.0+dfsg-6) UNRELEASED; urgency=medium
* Create .ssh/authorized_keys in postinst
-- Pirate Praveen <praveen@debian.org> Wed, 20 Jul 2016 23:08:55 +0530
gitlab (8.9.0+dfsg-5) unstable; urgency=medium gitlab (8.9.0+dfsg-5) unstable; urgency=medium
* Tighten dependencies * Tighten dependencies

6
debian/postinst vendored
View file

@ -53,13 +53,17 @@ case "$1" in
# Create directories and change ownership # Create directories and change ownership
echo "Creating runtime directories for gitlab..." echo "Creating runtime directories for gitlab..."
# Setup ssh key file
mkdir ${gitlab_data_dir}/.ssh
touch ${gitlab_data_dir}/.ssh/authorized_keys
chown -R ${gitlab_user}: ${gitlab_data_dir}/.ssh
# Create more required directories
for i in ${gitlab_repo_path} ${gitlab_cache_path} ${gitlab_uploads_path}\ for i in ${gitlab_repo_path} ${gitlab_cache_path} ${gitlab_uploads_path}\
${gitlab_pid_path} ${gitlab_log_dir} ${gitlab_shell_log} ${gitlab_builds_log}; do ${gitlab_pid_path} ${gitlab_log_dir} ${gitlab_shell_log} ${gitlab_builds_log}; do
mkdir -p $i mkdir -p $i
chown -R ${gitlab_user}: $i chown -R ${gitlab_user}: $i
done done
# nginx/httpd should be able to connect to gitlab-workhorse.socket and serve public # nginx/httpd should be able to connect to gitlab-workhorse.socket and serve public
chown ${gitlab_user}:${nginx_user} -R ${gitlab_uploads_path}/.. ${gitlab_pid_path} chown ${gitlab_user}:${nginx_user} -R ${gitlab_uploads_path}/.. ${gitlab_pid_path}