2017-06-10 10:10:31 +02:00
|
|
|
#!/bin/bash
|
|
|
|
|
2018-12-19 00:02:20 +01:00
|
|
|
#=================================================
|
|
|
|
# GENERIC START
|
|
|
|
#=================================================
|
|
|
|
# IMPORT GENERIC HELPERS
|
|
|
|
#=================================================
|
2017-06-10 10:10:31 +02:00
|
|
|
|
|
|
|
# Source YunoHost helpers
|
|
|
|
source /usr/share/yunohost/helpers
|
|
|
|
|
2018-12-16 23:05:12 +01:00
|
|
|
# Load common variables and helpers
|
|
|
|
source ./_common.sh
|
2017-06-10 10:10:31 +02:00
|
|
|
|
2018-12-19 00:02:20 +01:00
|
|
|
#=================================================
|
|
|
|
# LOAD SETTINGS
|
|
|
|
#=================================================
|
|
|
|
|
|
|
|
# See comments in install script
|
|
|
|
app=$YNH_APP_INSTANCE_NAME
|
2018-12-19 00:48:27 +01:00
|
|
|
domain=$(ynh_app_setting_get "$app" domain)
|
2018-12-19 00:02:20 +01:00
|
|
|
port=$(ynh_app_setting_get "$app" web_port)
|
|
|
|
portUnicorn=$(ynh_app_setting_get "$app" unicorn_port)
|
|
|
|
|
|
|
|
#=================================================
|
|
|
|
# STANDARD REMOVE
|
|
|
|
#=================================================
|
|
|
|
# REMOVE GITLAB
|
|
|
|
#=================================================
|
|
|
|
|
2019-01-26 14:30:58 +01:00
|
|
|
ynh_print_info "Removing Gitlab..."
|
|
|
|
|
2019-02-01 23:24:57 +01:00
|
|
|
gitlab-ctl stop
|
|
|
|
|
2018-12-16 23:05:12 +01:00
|
|
|
# Remove gitlab
|
2019-01-26 14:46:52 +01:00
|
|
|
dpkg --remove gitlab-ce
|
2017-06-29 21:39:47 +02:00
|
|
|
|
2018-12-19 00:02:20 +01:00
|
|
|
#=================================================
|
|
|
|
# REMOVE CONF GILE
|
|
|
|
#=================================================
|
|
|
|
|
2018-12-16 23:05:12 +01:00
|
|
|
# Remove Config
|
|
|
|
remove_config_gitlab
|
2017-06-29 21:39:47 +02:00
|
|
|
|
2018-12-19 00:02:20 +01:00
|
|
|
#=================================================
|
|
|
|
# REMOVE DEPENDENCIES
|
|
|
|
#=================================================
|
|
|
|
|
2018-12-16 23:05:12 +01:00
|
|
|
ynh_remove_app_dependencies
|
2017-06-10 10:10:31 +02:00
|
|
|
|
2018-12-19 00:02:20 +01:00
|
|
|
#=================================================
|
|
|
|
# REMOVE APP MAIN DIR
|
|
|
|
#=================================================
|
|
|
|
|
|
|
|
ynh_secure_remove "$final_path"
|
|
|
|
ynh_secure_remove "$config_path"
|
2018-12-16 23:05:12 +01:00
|
|
|
ynh_secure_remove "/var/opt/$app"
|
2017-06-10 10:10:31 +02:00
|
|
|
|
2018-12-16 23:05:12 +01:00
|
|
|
# Remove the log files
|
|
|
|
ynh_secure_remove "/var/log/$app"
|
2017-06-10 10:10:31 +02:00
|
|
|
|
2018-12-19 00:02:20 +01:00
|
|
|
#=================================================
|
|
|
|
# CLOSE PORTS
|
|
|
|
#=================================================
|
|
|
|
|
2019-01-26 14:46:52 +01:00
|
|
|
if yunohost firewall list | grep -q "\- $port$"; then
|
2018-12-19 00:02:20 +01:00
|
|
|
echo "Close port $port" >&2
|
|
|
|
yunohost firewall disallow TCP $port 2>&1
|
|
|
|
fi
|
|
|
|
|
2019-01-26 14:46:52 +01:00
|
|
|
if yunohost firewall list | grep -q "\- $portUnicorn$"; then
|
2018-12-19 00:02:20 +01:00
|
|
|
echo "Close port $portUnicorn" >&2
|
|
|
|
yunohost firewall disallow TCP $portUnicorn 2>&1
|
|
|
|
fi
|
|
|
|
|
|
|
|
#=================================================
|
|
|
|
# REMOVE NGINX CONFIGURATION
|
|
|
|
#=================================================
|
|
|
|
|
2018-12-16 23:05:12 +01:00
|
|
|
ynh_remove_nginx_config
|
2018-12-19 00:02:20 +01:00
|
|
|
|
|
|
|
#=================================================
|
|
|
|
# REMOVE LOGROTATE CONFIGURATION
|
|
|
|
#=================================================
|
|
|
|
|
2019-01-26 14:46:52 +01:00
|
|
|
#ynh_remove_logrotate
|