diff --git a/README.md b/README.md index 5fc38334..06c9a949 100644 --- a/README.md +++ b/README.md @@ -51,18 +51,15 @@ You should now have GitLab ready for testing. If you want to use GitLab for more GitLab is a code hosting software and as such you don't want to lose your code when the docker container is stopped/deleted. To avoid losing any data, you should mount volumes at. * /home/git/data -* /home/git/gitlab-satellites * /home/git/.ssh Volumes can be mounted in docker by specifying the **'-v'** option in the docker run command. ```bash mkdir /opt/gitlab/data -mkdir /opt/gitlab/gitlab-satellites mkdir /opt/gitlab/.ssh docker run -d \ -v /opt/gitlab/data:/home/git/data \ - -v /opt/gitlab/gitlab-satellites:/home/git/gitlab-satellites \ -v /opt/gitlab/.ssh:/home/git/.ssh sameersbn/gitlab ``` @@ -76,7 +73,6 @@ This docker image is configured to use a MySQL database backend. The database co mkdir /opt/gitlab/mysql docker run -d \ -v /opt/gitlab/data:/home/git/data \ - -v /opt/gitlab/gitlab-satellites:/home/git/gitlab-satellites \ -v /opt/gitlab/.ssh:/home/git/.ssh \ -v /opt/gitlab/mysql:/var/lib/mysql sameersbn/gitlab ``` @@ -105,7 +101,6 @@ To make sure the database is initialized start the container with **app:db:initi docker run -d \ -e "DB_HOST=192.168.1.100" -e "DB_NAME=gitlabhq_production" -e "DB_USER=gitlab" -e "DB_PASS=password" \ -v /opt/gitlab/data:/home/git/data \ - -v /opt/gitlab/gitlab-satellites:/home/git/gitlab-satellites \ -v /opt/gitlab/.ssh:/home/git/.ssh sameersbn/gitlab app:db:initialize ``` @@ -115,7 +110,6 @@ This will initialize the gitlab database. Now that the database is initialized, docker run -d \ -e "DB_HOST=192.168.1.100" -e "DB_NAME=gitlabhq_production" -e "DB_USER=gitlab" -e "DB_PASS=password" \ -v /opt/gitlab/data:/home/git/data \ - -v /opt/gitlab/gitlab-satellites:/home/git/gitlab-satellites \ -v /opt/gitlab/.ssh:/home/git/.ssh sameersbn/gitlab ``` @@ -133,7 +127,6 @@ The following environment variables need to be specified to get mail support to docker run -d \ -e "SMTP_USER=USER@gmail.com" -e "SMTP_PASS=PASSWORD" \ -v /opt/gitlab/data:/home/git/data \ - -v /opt/gitlab/gitlab-satellites:/home/git/gitlab-satellites \ -v /opt/gitlab/.ssh:/home/git/.ssh sameersbn/gitlab ``` @@ -148,7 +141,6 @@ I have only tested standard gmail and google apps login. I expect that the curre ```bash docker run -d -h git.local.host \ -v /opt/gitlab/data:/home/git/data \ - -v /opt/gitlab/gitlab-satellites:/home/git/gitlab-satellites \ -v /opt/gitlab/.ssh:/home/git/.ssh \ -v /opt/gitlab/mysql:/var/lib/mysql \ -e "GITLAB_HOST=git.local.host" -e "GITLAB_EMAIL=gitlab@local.host" -e "GITLAB_SUPPORT=support@local.host" \ @@ -161,7 +153,6 @@ If you are using an external mysql database ```bash docker run -d -h git.local.host \ -v /opt/gitlab/data:/home/git/data \ - -v /opt/gitlab/gitlab-satellites:/home/git/gitlab-satellites \ -v /opt/gitlab/.ssh:/home/git/.ssh \ -e "DB_HOST=192.168.1.100" -e "DB_NAME=gitlabhq_production" -e "DB_USER=gitlab" -e "DB_PASS=password" \ -e "GITLAB_HOST=git.local.host" -e "GITLAB_EMAIL=gitlab@local.host" -e "GITLAB_SUPPORT=support@local.host" \ @@ -186,7 +177,6 @@ mkdir -p /opt/gitlab/backups docker run -i -t -h git.local.host \ -v /opt/gitlab/backups:/home/git/gitlab/tmp/backups \ -v /opt/gitlab/data:/home/git/data \ - -v /opt/gitlab/gitlab-satellites:/home/git/gitlab-satellites \ -v /opt/gitlab/.ssh:/home/git/.ssh \ sameersbn/gitlab app:backup ``` diff --git a/resources/gitlab b/resources/gitlab index ae994dba..cd0fcdac 100755 --- a/resources/gitlab +++ b/resources/gitlab @@ -159,11 +159,12 @@ sudo chmod ug-s /home/git/data/repositories/ find /home/git/data/repositories/ -type d -print0 | sudo xargs -0 chmod g+s chown git:git /home/git/data/repositories -# make sure /home/git/gitlab-satellites/ has the right permissions in case it is mounted as a volume. -sudo chmod ug+rwX,o-rwx /home/git/gitlab-satellites/ -sudo chmod ug-s /home/git/gitlab-satellites/ -find /home/git/gitlab-satellites/ -type d -print0 | sudo xargs -0 chmod g+s -chown git:git /home/git/gitlab-satellites +# create the satellites directory and make sure it has the right permissions +sudo -u git -H mkdir -p /home/git/data/gitlab-satellites/ +sudo chmod ug+rwX,o-rwx /home/git/data/gitlab-satellites/ +sudo chmod ug-s /home/git/data/gitlab-satellites/ +find /home/git/data/gitlab-satellites/ -type d -print0 | sudo xargs -0 chmod g+s +chown git:git /home/git/data/gitlab-satellites # make sure /home/git/.ssh/ has the right permissions in case it is mounted as a volume. touch /home/git/.ssh/authorized_keys diff --git a/resources/setup/install b/resources/setup/install index 30e2428c..e126692a 100755 --- a/resources/setup/install +++ b/resources/setup/install @@ -34,6 +34,7 @@ sudo -u git -H cp config/initializers/rack_attack.rb.example config/initializers # configure repositories path sudo -u git -H sed 's/repos_path: \/home\/git\/repositories\//repos_path: \/home\/git\/data\/repositories\//' -i config/gitlab.yml +sudo -u git -H sed 's/path: \/home\/git\/gitlab-satellites\//path: \/home\/git\/data\/gitlab-satellites\//' -i config/gitlab.yml # create required tmp and log directories sudo -u git -H mkdir -p tmp/pids/ tmp/sockets/ @@ -46,9 +47,6 @@ chmod -R u+rwX public/uploads # create backups directory sudo -u git -H mkdir -p tmp/backups -# create satellites directory -sudo -u git -H mkdir -p /home/git/gitlab-satellites - # create production log sudo -u git -H touch log/production.log