mirror of
https://github.com/YunoHost-Apps/gogs_ynh.git
synced 2024-09-03 20:36:23 +02:00
cleaning
This commit is contained in:
parent
3b133bbf2a
commit
eef5df5c1f
4 changed files with 5 additions and 59 deletions
|
@ -17,7 +17,7 @@ admindoc = "https://gogs.io/docs"
|
||||||
code = "https://github.com/gogs/gogs"
|
code = "https://github.com/gogs/gogs"
|
||||||
|
|
||||||
[integration]
|
[integration]
|
||||||
yunohost = ">= 11.1.19"
|
yunohost = ">= 11.2"
|
||||||
architectures = "all"
|
architectures = "all"
|
||||||
multi_instance = true
|
multi_instance = true
|
||||||
ldap = true
|
ldap = true
|
||||||
|
|
|
@ -30,14 +30,6 @@ mkdir -p "$install_dir/custom/conf/auth.d"
|
||||||
chmod -R o-rwx "$install_dir"
|
chmod -R o-rwx "$install_dir"
|
||||||
chown -R $app:www-data "$install_dir"
|
chown -R $app:www-data "$install_dir"
|
||||||
|
|
||||||
#=================================================
|
|
||||||
# NGINX CONFIGURATION
|
|
||||||
#=================================================
|
|
||||||
ynh_script_progression --message="Configuring NGINX web server..." --weight=2
|
|
||||||
|
|
||||||
# Create a dedicated NGINX config
|
|
||||||
ynh_add_nginx_config
|
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# ADD A CONFIGURATION
|
# ADD A CONFIGURATION
|
||||||
#=================================================
|
#=================================================
|
||||||
|
@ -65,12 +57,8 @@ ynh_script_progression --message="Configuring a systemd service..." --weight=1
|
||||||
# Configure init script
|
# Configure init script
|
||||||
ynh_add_systemd_config
|
ynh_add_systemd_config
|
||||||
|
|
||||||
#=================================================
|
# Create a dedicated NGINX config
|
||||||
# GENERIC FINALIZATION
|
ynh_add_nginx_config
|
||||||
#=================================================
|
|
||||||
# SETUP LOGROTATE
|
|
||||||
#=================================================
|
|
||||||
ynh_script_progression --message="Configuring log rotation..." --weight=1
|
|
||||||
|
|
||||||
# Use logrotate to manage application logfile(s)
|
# Use logrotate to manage application logfile(s)
|
||||||
ynh_use_logrotate
|
ynh_use_logrotate
|
||||||
|
@ -78,11 +66,6 @@ ynh_use_logrotate
|
||||||
chown -R $app:$app "/var/log/$app"
|
chown -R $app:$app "/var/log/$app"
|
||||||
chmod u=rwX,g=rX,o= "/var/log/$app"
|
chmod u=rwX,g=rX,o= "/var/log/$app"
|
||||||
|
|
||||||
#=================================================
|
|
||||||
# INTEGRATE SERVICE IN YUNOHOST
|
|
||||||
#=================================================
|
|
||||||
ynh_script_progression --message="Integrating service in YunoHost..." --weight=1
|
|
||||||
|
|
||||||
yunohost service add $app --description="Lightweight Git forge" --log="/var/log/$app/$app.log"
|
yunohost service add $app --description="Lightweight Git forge" --log="/var/log/$app/$app.log"
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
|
|
|
@ -22,35 +22,15 @@ then
|
||||||
yunohost service remove $app
|
yunohost service remove $app
|
||||||
fi
|
fi
|
||||||
|
|
||||||
#=================================================
|
|
||||||
# STOP AND REMOVE SERVICE
|
|
||||||
#=================================================
|
|
||||||
ynh_script_progression --message="Stopping and removing the systemd service..." --weight=1
|
|
||||||
|
|
||||||
# Remove the dedicated systemd config
|
# Remove the dedicated systemd config
|
||||||
ynh_remove_systemd_config
|
ynh_remove_systemd_config
|
||||||
|
|
||||||
#=================================================
|
|
||||||
# REMOVE LOGROTATE CONFIGURATION
|
|
||||||
#=================================================
|
|
||||||
ynh_script_progression --message="Removing logrotate configuration..." --weight=1
|
|
||||||
|
|
||||||
# Remove the app-specific logrotate config
|
# Remove the app-specific logrotate config
|
||||||
ynh_remove_logrotate
|
ynh_remove_logrotate
|
||||||
|
|
||||||
#=================================================
|
|
||||||
# REMOVE NGINX CONFIGURATION
|
|
||||||
#=================================================
|
|
||||||
ynh_script_progression --message="Removing NGINX web server configuration..." --weight=1
|
|
||||||
|
|
||||||
# Remove the dedicated NGINX config
|
# Remove the dedicated NGINX config
|
||||||
ynh_remove_nginx_config
|
ynh_remove_nginx_config
|
||||||
|
|
||||||
#=================================================
|
|
||||||
# REMOVE VARIOUS FILES
|
|
||||||
#=================================================
|
|
||||||
ynh_script_progression --message="Removing various files..." --weight=1
|
|
||||||
|
|
||||||
ynh_secure_remove --file="/var/log/$app"
|
ynh_secure_remove --file="/var/log/$app"
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
|
|
|
@ -9,15 +9,6 @@
|
||||||
source ../settings/scripts/_common.sh
|
source ../settings/scripts/_common.sh
|
||||||
source /usr/share/yunohost/helpers
|
source /usr/share/yunohost/helpers
|
||||||
|
|
||||||
#=================================================
|
|
||||||
# STANDARD RESTORATION STEPS
|
|
||||||
#=================================================
|
|
||||||
# RESTORE THE NGINX CONFIGURATION
|
|
||||||
#=================================================
|
|
||||||
ynh_script_progression --message="Restoring the NGINX configuration..." --weight=1
|
|
||||||
|
|
||||||
ynh_restore_file --origin_path="/etc/nginx/conf.d/$domain.d/$app.conf"
|
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# RESTORE THE APP MAIN DIR
|
# RESTORE THE APP MAIN DIR
|
||||||
#=================================================
|
#=================================================
|
||||||
|
@ -49,25 +40,17 @@ ynh_mysql_connect_as --user=$db_user --password=$db_pwd --database=$db_name < ./
|
||||||
#=================================================
|
#=================================================
|
||||||
ynh_script_progression --message="Restoring the systemd configuration..." --weight=5
|
ynh_script_progression --message="Restoring the systemd configuration..." --weight=5
|
||||||
|
|
||||||
|
ynh_restore_file --origin_path="/etc/nginx/conf.d/$domain.d/$app.conf"
|
||||||
|
|
||||||
ynh_restore_file --origin_path="/etc/systemd/system/$app.service"
|
ynh_restore_file --origin_path="/etc/systemd/system/$app.service"
|
||||||
systemctl enable $app.service --quiet
|
systemctl enable $app.service --quiet
|
||||||
|
|
||||||
#=================================================
|
|
||||||
# RESTORE THE LOGROTATE CONFIGURATION
|
|
||||||
#=================================================
|
|
||||||
ynh_script_progression --message="Restoring the logrotate configuration..." --weight=1
|
|
||||||
|
|
||||||
ynh_restore_file --origin_path="/etc/logrotate.d/$app"
|
ynh_restore_file --origin_path="/etc/logrotate.d/$app"
|
||||||
|
|
||||||
ynh_restore_file --origin_path="/var/log/$app"
|
ynh_restore_file --origin_path="/var/log/$app"
|
||||||
chown -R $app:$app "/var/log/$app"
|
chown -R $app:$app "/var/log/$app"
|
||||||
chmod u=rwX,g=rX,o= "/var/log/$app"
|
chmod u=rwX,g=rX,o= "/var/log/$app"
|
||||||
|
|
||||||
#=================================================
|
|
||||||
# INTEGRATE SERVICE IN YUNOHOST
|
|
||||||
#=================================================
|
|
||||||
ynh_script_progression --message="Integrating service in YunoHost..." --weight=1
|
|
||||||
|
|
||||||
yunohost service add $app --description="Lightweight Git forge" --log="/var/log/$app/$app.log"
|
yunohost service add $app --description="Lightweight Git forge" --log="/var/log/$app/$app.log"
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
|
|
Loading…
Reference in a new issue