generate and store ssh host keys at the data store, fixes #62

This commit is contained in:
Sameer Naik 2014-05-10 16:38:41 +05:30
parent 0a21530bc4
commit 0649c69302
3 changed files with 13 additions and 0 deletions

View File

@ -1,6 +1,7 @@
# Changelog
**latest**
- generate and store ssh host keys at the data store.
- default GITLAB_PROJECTS_LIMIT is now set to 100
- use sameersbn/ubuntu:14.04.20140508 base image, the trusted build of sameersbn/ubuntu:14.04.20140505 seems to be broken
- use sameersbn/ubuntu:14.04.20140505 base image

View File

@ -131,6 +131,15 @@ ROOT_PASSWORD=$(pwgen -c -n -1 12)
echo "root:$ROOT_PASSWORD" | chpasswd
echo User: root Password: $ROOT_PASSWORD
if [ ! -e /home/git/data/ssh/ssh_host_rsa_key ]; then
# create ssh host keys and move them to the data store.
dpkg-reconfigure openssh-server
mkdir -p /home/git/data/ssh/
mv /etc/ssh/ssh_host_*_key /etc/ssh/ssh_host_*_key.pub /home/git/data/ssh/
fi
# configure sshd to pick up the host keys from /home/git/data/ssh/
sed -i 's,HostKey /etc/ssh/,HostKey /home/git/data/ssh/,g' -i /etc/ssh/sshd_config
# start supervisord
/usr/bin/supervisord -c /etc/supervisor/supervisord.conf
supervisorctl start sshd

View File

@ -4,6 +4,9 @@ set -e
GITLAB_VERSION=6.8.1
SHELL_VERSION=1.9.4
# remove the host keys generated during openssh-server installation
rm -rf /etc/ssh/ssh_host_*_key /etc/ssh/ssh_host_*_key.pub
# add git user
adduser --disabled-login --gecos 'GitLab' git
passwd -d git