fix config file handling
This commit is contained in:
parent
4d8567fd50
commit
a00a4d5093
6 changed files with 34 additions and 9 deletions
8
debian/changelog
vendored
8
debian/changelog
vendored
|
@ -1,3 +1,11 @@
|
|||
gitlab (8.9.0+dfsg-4) unstable; urgency=medium
|
||||
|
||||
* Move config files to /usr/share/doc as examples and
|
||||
copy them to /var/lib for modification (Closes: #821086)
|
||||
* Fix gitlab-shell's config.yml handling (Closes: #827846)
|
||||
|
||||
-- Pirate Praveen <praveen@debian.org> Thu, 14 Jul 2016 19:53:16 +0530
|
||||
|
||||
gitlab (8.9.0+dfsg-3) unstable; urgency=medium
|
||||
|
||||
* Relax grape and rouge in Gemfile
|
||||
|
|
|
@ -5,10 +5,13 @@ gitlab_app_root=/usr/share/gitlab
|
|||
gitlab_data_dir=/var/lib/gitlab
|
||||
gitlab_cache_path=/var/cache/gitlab
|
||||
gitlab_scripts=/usr/lib/gitlab/scripts
|
||||
gitlab_yml_example=/usr/share/doc/gitlab/gitlab.yml.example
|
||||
gitlab_yml_private=/var/lib/gitlab/gitlab.yml
|
||||
gitlab_yml=/etc/gitlab/gitlab.yml
|
||||
gitlab_debian_conf_example=/usr/share/doc/gitlab/gitlab-debian.conf.example
|
||||
gitlab_debian_conf_private=/var/lib/gitlab/gitlab-debian.conf
|
||||
gitlab_debian_conf=/etc/gitlab/gitlab-debian.conf
|
||||
gitlab_shell_config_example=/usr/share/doc/gitlab-shell/config.yml.example
|
||||
gitlab_shell_config_private=/var/lib/gitlab/gitlab-shell-config.yml
|
||||
gitlab_shell_config=/etc/gitlab-shell/config.yml
|
||||
gitlab_nginx_log=/var/log/gitlab
|
2
debian/control
vendored
2
debian/control
vendored
|
@ -29,7 +29,7 @@ Depends: ${shlibs:Depends}, ${misc:Depends}, ruby | ruby-interpreter,
|
|||
postfix | exim4 | mail-transport-agent,
|
||||
openssh-client,
|
||||
ucf,
|
||||
gitlab-shell (>= 3.0.0~),
|
||||
gitlab-shell (>= 3.0.0-4~),
|
||||
gitlab-workhorse (>= 0.6.2~),
|
||||
ruby-rails (>= 2:4.2.6~),
|
||||
ruby-rails (<< 2:5),
|
||||
|
|
4
debian/install
vendored
4
debian/install
vendored
|
@ -1,9 +1,9 @@
|
|||
debian/conf/gitlab etc/default
|
||||
debian/conf/unicorn.rb etc/gitlab
|
||||
debian/conf/database.yml etc/gitlab
|
||||
debian/conf/gitlab.yml var/lib/gitlab
|
||||
debian/conf/gitlab.yml.example usr/share/doc/gitlab
|
||||
debian/conf/resque.yml etc/gitlab
|
||||
debian/conf/gitlab-debian.conf var/lib/gitlab
|
||||
debian/conf/gitlab-debian.conf.example usr/share/doc/gitlab
|
||||
debian/conf/*.target lib/systemd/system
|
||||
debian/conf/*.service lib/systemd/system
|
||||
debian/conf/smtp_settings.rb etc/gitlab/initializers
|
||||
|
|
26
debian/postinst
vendored
26
debian/postinst
vendored
|
@ -33,7 +33,12 @@ case "$1" in
|
|||
|
||||
# Read and export debian specific configuration
|
||||
# Only exported variables will be passed on to gitlab app
|
||||
gitlab_debian_conf_private=/var/lib/gitlab/gitlab-debian.conf
|
||||
# Bootstrap config file - first try
|
||||
gitlab_debian_conf_example=/usr/share/doc/gitlab/gitlab-debian.conf.example
|
||||
export $(cat ${gitlab_debian_conf_example})
|
||||
# second try
|
||||
test -f ${gitlab_debian_conf_private} || \
|
||||
cp ${gitlab_debian_conf_example} ${gitlab_debian_conf_private}
|
||||
export $(cat ${gitlab_debian_conf_private})
|
||||
|
||||
# If /etc/gitlab/gitlab-debian.conf is already present, use it
|
||||
|
@ -90,6 +95,13 @@ EOF
|
|||
# Check if ssl option is selected
|
||||
db_get gitlab/ssl
|
||||
gl_proto="http"
|
||||
|
||||
# Copy example configurations
|
||||
test -f ${gitlab_yml_private} || \
|
||||
zcat ${gitlab_yml_example} > ${gitlab_yml_private}
|
||||
test -f ${gitlab_shell_config_private} || \
|
||||
cp ${gitlab_shell_config_example} ${gitlab_shell_config_private}
|
||||
|
||||
if [ "${RET}" = "true" ]; then
|
||||
echo "Configuring nginx with HTTPS..."
|
||||
if ! grep GITLAB_HTTPS ${gitlab_debian_conf_private}; then
|
||||
|
@ -104,12 +116,8 @@ EOF
|
|||
"s/gitlab_url: http*:\/\/.*/gitlab_url: ${gl_proto}:\/\/${GITLAB_HOST}/"\
|
||||
${gitlab_shell_config_private}
|
||||
|
||||
# Manage gitlab-shell's config.yml via ucf
|
||||
mkdir -p /etc/gitlab-shell
|
||||
echo "Registering ${gitlab_shell_config} via ucf"
|
||||
ucf --debconf-ok --three-way ${gitlab_shell_config_private} ${gitlab_shell_config}
|
||||
ucfr gitlab ${gitlab_shell_config}
|
||||
fi
|
||||
|
||||
mkdir -p /etc/gitlab/ssl
|
||||
if [ -f "${nginx_ssl_conf_example_gz}" ]; then
|
||||
# undo dh_installdocs auto compress
|
||||
|
@ -146,6 +154,12 @@ EOF
|
|||
fi
|
||||
fi
|
||||
|
||||
# Manage gitlab-shell's config.yml via ucf
|
||||
mkdir -p /etc/gitlab-shell
|
||||
echo "Registering ${gitlab_shell_config} via ucf"
|
||||
ucf --debconf-ok --three-way ${gitlab_shell_config_private} ${gitlab_shell_config}
|
||||
ucfr gitlab ${gitlab_shell_config}
|
||||
|
||||
# Manage gitlab.yml via ucf
|
||||
echo "Registering ${gitlab_yml} via ucf"
|
||||
ucf --debconf-ok --three-way ${gitlab_yml_private} ${gitlab_yml}
|
||||
|
|
Loading…
Reference in a new issue