[autopatch] Automatic patch attempt for helpers 2.1

This commit is contained in:
Yunohost-Bot 2024-08-31 02:57:32 +02:00 committed by selfhoster1312
parent 3e1850d789
commit c24d157256
8 changed files with 24 additions and 60 deletions

View file

@ -1,4 +1,4 @@
location @__NAME__--proxy {
location @__APP__--proxy {
proxy_pass __PROXY_PATH__;
proxy_redirect off;
proxy_set_header Host $host;

View file

@ -14,7 +14,8 @@ license = "AGPL-3.0-or-later"
website = "https://en.wikipedia.org/wiki/Reverse_proxy"
[integration]
yunohost = ">= 11.2"
yunohost = ">= 11.2.18"
helpers_version = "2.1"
architectures = "all"
multi_instance = true

View file

@ -1,11 +1,5 @@
#!/bin/bash
#=================================================
# GENERIC START
#=================================================
# IMPORT GENERIC HELPERS
#=================================================
source ../settings/scripts/_common.sh
source /usr/share/yunohost/helpers
@ -14,10 +8,10 @@ source /usr/share/yunohost/helpers
#=================================================
# Copy the conf files
ynh_backup --src_path="/etc/nginx/conf.d/${domain}.d/${app}.conf"
ynh_backup "/etc/nginx/conf.d/${domain}.d/${app}.conf"
#=================================================
# END OF SCRIPT
#=================================================
ynh_print_info --message="Backup script completed for $app. (YunoHost will then actually copy those files to the archive)."
ynh_print_info "Backup script completed for $app. (YunoHost will then actually copy those files to the archive)."

View file

@ -1,11 +1,5 @@
#!/bin/bash
#=================================================
# GENERIC START
#=================================================
# IMPORT GENERIC HELPERS
#=================================================
source /usr/share/yunohost/helpers
source _common.sh
#=================================================
@ -13,7 +7,7 @@ source _common.sh
#=================================================
# Nginx configuration
ynh_script_progression --message="Configuring NGINX web server..." --weight=1
ynh_script_progression "Configuring NGINX web server..."
path="$new_path"
domain="$old_domain"
@ -29,20 +23,19 @@ rp_handle_webroot
nginx_conf_path=/etc/nginx/conf.d/$old_domain.d/$app.conf
ynh_backup_if_checksum_is_different --file="$nginx_conf_path"
ynh_add_nginx_config
ynh_backup_if_checksum_is_different "$nginx_conf_path"
ynh_config_add_nginx
# Move file to new domain if domain has changed
if [[ "$old_domain" != "$new_domain" ]]; then
new_nginx_conf_path=/etc/nginx/conf.d/$new_domain.d/$app.conf
ynh_delete_file_checksum --file="$nginx_conf_path"
mv "${nginx_conf_path}" "${new_nginx_conf_path}"
ynh_store_file_checksum --file="$new_nginx_conf_path"
ynh_delete_file_checksum "$nginx_conf_path"
mv $nginx_conf_path $new_nginx_conf_path
ynh_store_file_checksum "$new_nginx_conf_path"
fi
#=================================================
# END OF SCRIPT
#=================================================
ynh_script_progression --message="Changing URL of $app completed" --last
ynh_script_progression "Changing URL of $app completed"

View file

@ -1,11 +1,5 @@
#!/bin/bash
#=================================================
# GENERIC START
#=================================================
# IMPORT GENERIC HELPERS
#=================================================
source _common.sh
source /usr/share/yunohost/helpers
@ -23,12 +17,12 @@ rp_validate_assets_path
rp_handle_webroot
# Configure nginx
ynh_script_progression --message="Configuring NGINX web server..." --weight=1
ynh_script_progression "Configuring NGINX web server..."
ynh_add_nginx_config
ynh_config_add_nginx
#=================================================
# END OF SCRIPT
#=================================================
ynh_script_progression --message="Installation of $app completed" --last
ynh_script_progression "Installation of $app completed"

View file

@ -1,11 +1,5 @@
#!/bin/bash
#=================================================
# GENERIC START
#=================================================
# IMPORT GENERIC HELPERS
#=================================================
source _common.sh
source /usr/share/yunohost/helpers
@ -14,10 +8,10 @@ source /usr/share/yunohost/helpers
#=================================================
# Remove configuration files
ynh_secure_remove "/etc/nginx/conf.d/${domain}.d/${app}.conf"
ynh_safe_rm /etc/nginx/conf.d/$domain.d/$app.conf
#=================================================
# END OF SCRIPT
#=================================================
ynh_script_progression --message="Removal of $app completed" --last
ynh_script_progression "Removal of $app completed"

View file

@ -1,11 +1,5 @@
#!/bin/bash
#=================================================
# GENERIC START
#=================================================
# IMPORT GENERIC HELPERS
#=================================================
source ../settings/scripts/_common.sh
source /usr/share/yunohost/helpers
@ -21,14 +15,14 @@ NGINX_CONF="/etc/nginx/conf.d/${domain}.d/${app}.conf"
[[ -f $NGINX_CONF ]] && ynh_die "The NGINX configuration already exists at '${NGINX_CONF}'. You should safely delete it before restoring this app."
# Restore configuration files
ynh_restore_file "$NGINX_CONF"
ynh_restore "$NGINX_CONF"
# Reload nginx
ynh_script_progression --message="Reloading NGINX web server..." --weight=1
ynh_systemd_action --service_name=nginx --action=reload
ynh_script_progression "Reloading NGINX web server..."
ynh_systemctl --service=nginx --action=reload
#=================================================
# END OF SCRIPT
#=================================================
ynh_script_progression --message="Restoration completed for $app" --last
ynh_script_progression "Restoration completed for $app"

View file

@ -1,11 +1,5 @@
#!/bin/bash
#=================================================
# GENERIC START
#=================================================
# IMPORT GENERIC HELPERS
#=================================================
source _common.sh
source /usr/share/yunohost/helpers
@ -23,12 +17,12 @@ rp_validate_assets_path
rp_handle_webroot
# Configure nginx
ynh_script_progression --message="Configuring NGINX web server..." --weight=1
ynh_script_progression "Configuring NGINX web server..."
ynh_add_nginx_config
ynh_config_add_nginx
#=================================================
# END OF SCRIPT
#=================================================
ynh_script_progression --message="Upgrade of $app completed" --last
ynh_script_progression "Upgrade of $app completed"