mirror of
https://github.com/YunoHost-Apps/gitlab_ynh.git
synced 2024-09-03 18:36:35 +02:00
Remove overwrite_gitlab_config, replaced by gitlab-persistent.rb
This commit is contained in:
parent
97bb194209
commit
6378526fe9
4 changed files with 13 additions and 40 deletions
|
@ -28,13 +28,6 @@
|
|||
"id": "overwrite_nginx",
|
||||
"type": "bool",
|
||||
"default": true
|
||||
},
|
||||
{
|
||||
"name": "Overwrite the gitlab.rb config file ?",
|
||||
"help": "If the file is overwritten, a backup will be created.",
|
||||
"id": "overwrite_gitlab_config",
|
||||
"type": "bool",
|
||||
"default": true
|
||||
}
|
||||
]
|
||||
},
|
||||
|
|
|
@ -35,11 +35,6 @@ old_overwrite_nginx="$(ynh_app_setting_get $app overwrite_nginx)"
|
|||
old_overwrite_nginx=$(bool_to_true_false $old_overwrite_nginx)
|
||||
overwrite_nginx="${YNH_CONFIG_MAIN_OVERWRITE_FILES_OVERWRITE_NGINX:-$old_overwrite_nginx}"
|
||||
|
||||
# Overwrite gitlab.rb configuration
|
||||
old_overwrite_gitlab_config="$(ynh_app_setting_get $app overwrite_gitlab_config)"
|
||||
old_overwrite_gitlab_config=$(bool_to_true_false $old_overwrite_gitlab_config)
|
||||
overwrite_gitlab_config="${YNH_CONFIG_MAIN_OVERWRITE_FILES_OVERWRITE_GITLAB_CONFIG:-$old_overwrite_gitlab_config}"
|
||||
|
||||
# use_web_account
|
||||
old_use_web_account="$(ynh_app_setting_get $app use_web_account)"
|
||||
old_use_web_account=$(bool_to_true_false $old_use_web_account)
|
||||
|
@ -56,7 +51,6 @@ show_config() {
|
|||
echo "YNH_CONFIG_MAIN_IS_PUBLIC_IS_PUBLIC=$is_public"
|
||||
|
||||
echo "YNH_CONFIG_MAIN_OVERWRITE_FILES_OVERWRITE_NGINX=$overwrite_nginx"
|
||||
echo "YNH_CONFIG_MAIN_OVERWRITE_FILES_OVERWRITE_GITLAB_CONFIG=$overwrite_gitlab_config"
|
||||
|
||||
echo "YNH_CONFIG_MAIN_USERS_USE_WEB_ACCOUNT=$use_web_account"
|
||||
}
|
||||
|
@ -84,8 +78,6 @@ apply_config() {
|
|||
|
||||
# Set overwrite_nginx
|
||||
ynh_app_setting_set $app overwrite_nginx "$overwrite_nginx"
|
||||
# Set overwrite_gitlab_config
|
||||
ynh_app_setting_set $app overwrite_gitlab_config "$overwrite_gitlab_config"
|
||||
}
|
||||
|
||||
#=================================================
|
||||
|
|
|
@ -90,7 +90,6 @@ ynh_app_setting_set $app unicorn_worker_processes $unicorn_worker_processes
|
|||
ynh_app_setting_set $app client_max_body_size $client_max_body_size
|
||||
|
||||
ynh_app_setting_set $app overwrite_nginx "1"
|
||||
ynh_app_setting_set $app overwrite_gitlab_config "1"
|
||||
|
||||
#=================================================
|
||||
# STANDARD MODIFICATIONS
|
||||
|
|
|
@ -32,7 +32,6 @@ architecture=$(ynh_app_setting_get "$app" architecture)
|
|||
unicorn_worker_processes=$(ynh_app_setting_get "$app" unicorn_worker_processes)
|
||||
client_max_body_size=$(ynh_app_setting_get "$app" client_max_body_size)
|
||||
overwrite_nginx=$(ynh_app_setting_get "$app" overwrite_nginx)
|
||||
overwrite_gitlab_config=$(ynh_app_setting_get "$app" overwrite_gitlab_config)
|
||||
|
||||
#=================================================
|
||||
# ENSURE DOWNWARD COMPATIBILITY
|
||||
|
@ -107,12 +106,6 @@ if [ -z "$overwrite_nginx" ]; then
|
|||
ynh_app_setting_set $app overwrite_nginx $overwrite_nginx
|
||||
fi
|
||||
|
||||
# If overwrite_gitlab_config doesn't exist, create it
|
||||
if [ -z "$overwrite_gitlab_config" ]; then
|
||||
overwrite_gitlab_config=1
|
||||
ynh_app_setting_set $app overwrite_gitlab_config $overwrite_gitlab_config
|
||||
fi
|
||||
|
||||
# If domain doesn't exist, retrieve it
|
||||
if [ -z "$domain" ]; then
|
||||
domain=$(grep "external_url" "/etc/gitlab/gitlab.rb" | cut -d'/' -f3) # retrieve $domain from conf file
|
||||
|
@ -184,28 +177,24 @@ ynh_install_app_dependencies $pkg_dependencies
|
|||
# PRECONFIGURE GITLAB
|
||||
#=================================================
|
||||
|
||||
# Overwrite the gitlab.rb configuration only if it's allowed
|
||||
if [ $overwrite_gitlab_config -eq 1 ]
|
||||
then
|
||||
ynh_print_info "Preconfigure gitlab..."
|
||||
ynh_print_info "Preconfigure gitlab..."
|
||||
|
||||
ynh_backup_if_checksum_is_different "$config_path/gitlab.rb"
|
||||
ynh_backup_if_checksum_is_different "$config_path/gitlab.rb"
|
||||
|
||||
mkdir -p $config_path
|
||||
mkdir -p $config_path
|
||||
|
||||
cp -f ../conf/gitlab.rb "$config_path/gitlab.rb"
|
||||
ssh_port=$(grep -P "Port\s+\d+" /etc/ssh/sshd_config | grep -P -o "\d+")
|
||||
cp -f ../conf/gitlab.rb "$config_path/gitlab.rb"
|
||||
ssh_port=$(grep -P "Port\s+\d+" /etc/ssh/sshd_config | grep -P -o "\d+")
|
||||
|
||||
ynh_replace_string "__GENERATED_EXTERNAL_URL__" "https://$domain${path_url%/}" "$config_path/gitlab.rb"
|
||||
ynh_replace_string "__PORT__" "$port" "$config_path/gitlab.rb"
|
||||
ynh_replace_string "__UNICORN_PORT__" "$portUnicorn" "$config_path/gitlab.rb"
|
||||
ynh_replace_string "__UNICORN_WORKER_PROCESSES__" "$unicorn_worker_processes" "$config_path/gitlab.rb"
|
||||
ynh_replace_string "__CLIENT_MAX_BODY_SIZE__" "$client_max_body_size" "$config_path/gitlab.rb"
|
||||
ynh_replace_string "__SSH_PORT__" "$ssh_port" "$config_path/gitlab.rb"
|
||||
ynh_replace_string "__SIDEKIQ_PORT__" "$portSidekiq" "$config_path/gitlab.rb"
|
||||
ynh_replace_string "__GENERATED_EXTERNAL_URL__" "https://$domain${path_url%/}" "$config_path/gitlab.rb"
|
||||
ynh_replace_string "__PORT__" "$port" "$config_path/gitlab.rb"
|
||||
ynh_replace_string "__UNICORN_PORT__" "$portUnicorn" "$config_path/gitlab.rb"
|
||||
ynh_replace_string "__UNICORN_WORKER_PROCESSES__" "$unicorn_worker_processes" "$config_path/gitlab.rb"
|
||||
ynh_replace_string "__CLIENT_MAX_BODY_SIZE__" "$client_max_body_size" "$config_path/gitlab.rb"
|
||||
ynh_replace_string "__SSH_PORT__" "$ssh_port" "$config_path/gitlab.rb"
|
||||
ynh_replace_string "__SIDEKIQ_PORT__" "$portSidekiq" "$config_path/gitlab.rb"
|
||||
|
||||
ynh_store_file_checksum "$config_path/gitlab.rb"
|
||||
fi
|
||||
ynh_store_file_checksum "$config_path/gitlab.rb"
|
||||
|
||||
touch "$config_path/gitlab-persistent.rb"
|
||||
chown admin: "$config_path/gitlab-persistent.rb"
|
||||
|
|
Loading…
Reference in a new issue