mirror of
https://github.com/YunoHost-Apps/reverseproxy_ynh.git
synced 2024-09-03 20:16:23 +02:00
[autopatch] Automatic patch attempt for helpers 2.1
This commit is contained in:
parent
3e1850d789
commit
c24d157256
8 changed files with 24 additions and 60 deletions
|
@ -1,4 +1,4 @@
|
||||||
location @__NAME__--proxy {
|
location @__APP__--proxy {
|
||||||
proxy_pass __PROXY_PATH__;
|
proxy_pass __PROXY_PATH__;
|
||||||
proxy_redirect off;
|
proxy_redirect off;
|
||||||
proxy_set_header Host $host;
|
proxy_set_header Host $host;
|
||||||
|
|
|
@ -14,7 +14,8 @@ license = "AGPL-3.0-or-later"
|
||||||
website = "https://en.wikipedia.org/wiki/Reverse_proxy"
|
website = "https://en.wikipedia.org/wiki/Reverse_proxy"
|
||||||
|
|
||||||
[integration]
|
[integration]
|
||||||
yunohost = ">= 11.2"
|
yunohost = ">= 11.2.18"
|
||||||
|
helpers_version = "2.1"
|
||||||
architectures = "all"
|
architectures = "all"
|
||||||
multi_instance = true
|
multi_instance = true
|
||||||
|
|
||||||
|
|
|
@ -1,11 +1,5 @@
|
||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
#=================================================
|
|
||||||
# GENERIC START
|
|
||||||
#=================================================
|
|
||||||
# IMPORT GENERIC HELPERS
|
|
||||||
#=================================================
|
|
||||||
|
|
||||||
source ../settings/scripts/_common.sh
|
source ../settings/scripts/_common.sh
|
||||||
source /usr/share/yunohost/helpers
|
source /usr/share/yunohost/helpers
|
||||||
|
|
||||||
|
@ -14,10 +8,10 @@ source /usr/share/yunohost/helpers
|
||||||
#=================================================
|
#=================================================
|
||||||
|
|
||||||
# Copy the conf files
|
# 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
|
# 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)."
|
||||||
|
|
|
@ -1,11 +1,5 @@
|
||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
#=================================================
|
|
||||||
# GENERIC START
|
|
||||||
#=================================================
|
|
||||||
# IMPORT GENERIC HELPERS
|
|
||||||
#=================================================
|
|
||||||
|
|
||||||
source /usr/share/yunohost/helpers
|
source /usr/share/yunohost/helpers
|
||||||
source _common.sh
|
source _common.sh
|
||||||
#=================================================
|
#=================================================
|
||||||
|
@ -13,7 +7,7 @@ source _common.sh
|
||||||
#=================================================
|
#=================================================
|
||||||
|
|
||||||
# Nginx configuration
|
# Nginx configuration
|
||||||
ynh_script_progression --message="Configuring NGINX web server..." --weight=1
|
ynh_script_progression "Configuring NGINX web server..."
|
||||||
|
|
||||||
path="$new_path"
|
path="$new_path"
|
||||||
domain="$old_domain"
|
domain="$old_domain"
|
||||||
|
@ -29,20 +23,19 @@ rp_handle_webroot
|
||||||
|
|
||||||
nginx_conf_path=/etc/nginx/conf.d/$old_domain.d/$app.conf
|
nginx_conf_path=/etc/nginx/conf.d/$old_domain.d/$app.conf
|
||||||
|
|
||||||
ynh_backup_if_checksum_is_different --file="$nginx_conf_path"
|
ynh_backup_if_checksum_is_different "$nginx_conf_path"
|
||||||
ynh_add_nginx_config
|
ynh_config_add_nginx
|
||||||
|
|
||||||
# Move file to new domain if domain has changed
|
# Move file to new domain if domain has changed
|
||||||
if [[ "$old_domain" != "$new_domain" ]]; then
|
if [[ "$old_domain" != "$new_domain" ]]; then
|
||||||
new_nginx_conf_path=/etc/nginx/conf.d/$new_domain.d/$app.conf
|
new_nginx_conf_path=/etc/nginx/conf.d/$new_domain.d/$app.conf
|
||||||
ynh_delete_file_checksum --file="$nginx_conf_path"
|
ynh_delete_file_checksum "$nginx_conf_path"
|
||||||
mv "${nginx_conf_path}" "${new_nginx_conf_path}"
|
mv $nginx_conf_path $new_nginx_conf_path
|
||||||
ynh_store_file_checksum --file="$new_nginx_conf_path"
|
ynh_store_file_checksum "$new_nginx_conf_path"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# END OF SCRIPT
|
# END OF SCRIPT
|
||||||
#=================================================
|
#=================================================
|
||||||
|
|
||||||
ynh_script_progression --message="Changing URL of $app completed" --last
|
ynh_script_progression "Changing URL of $app completed"
|
||||||
|
|
|
@ -1,11 +1,5 @@
|
||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
#=================================================
|
|
||||||
# GENERIC START
|
|
||||||
#=================================================
|
|
||||||
# IMPORT GENERIC HELPERS
|
|
||||||
#=================================================
|
|
||||||
|
|
||||||
source _common.sh
|
source _common.sh
|
||||||
source /usr/share/yunohost/helpers
|
source /usr/share/yunohost/helpers
|
||||||
|
|
||||||
|
@ -23,12 +17,12 @@ rp_validate_assets_path
|
||||||
rp_handle_webroot
|
rp_handle_webroot
|
||||||
|
|
||||||
# Configure nginx
|
# 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
|
# END OF SCRIPT
|
||||||
#=================================================
|
#=================================================
|
||||||
|
|
||||||
ynh_script_progression --message="Installation of $app completed" --last
|
ynh_script_progression "Installation of $app completed"
|
||||||
|
|
|
@ -1,11 +1,5 @@
|
||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
#=================================================
|
|
||||||
# GENERIC START
|
|
||||||
#=================================================
|
|
||||||
# IMPORT GENERIC HELPERS
|
|
||||||
#=================================================
|
|
||||||
|
|
||||||
source _common.sh
|
source _common.sh
|
||||||
source /usr/share/yunohost/helpers
|
source /usr/share/yunohost/helpers
|
||||||
|
|
||||||
|
@ -14,10 +8,10 @@ source /usr/share/yunohost/helpers
|
||||||
#=================================================
|
#=================================================
|
||||||
|
|
||||||
# Remove configuration files
|
# 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
|
# END OF SCRIPT
|
||||||
#=================================================
|
#=================================================
|
||||||
|
|
||||||
ynh_script_progression --message="Removal of $app completed" --last
|
ynh_script_progression "Removal of $app completed"
|
||||||
|
|
|
@ -1,11 +1,5 @@
|
||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
#=================================================
|
|
||||||
# GENERIC START
|
|
||||||
#=================================================
|
|
||||||
# IMPORT GENERIC HELPERS
|
|
||||||
#=================================================
|
|
||||||
|
|
||||||
source ../settings/scripts/_common.sh
|
source ../settings/scripts/_common.sh
|
||||||
source /usr/share/yunohost/helpers
|
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."
|
[[ -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
|
# Restore configuration files
|
||||||
ynh_restore_file "$NGINX_CONF"
|
ynh_restore "$NGINX_CONF"
|
||||||
|
|
||||||
# Reload nginx
|
# Reload nginx
|
||||||
ynh_script_progression --message="Reloading NGINX web server..." --weight=1
|
ynh_script_progression "Reloading NGINX web server..."
|
||||||
ynh_systemd_action --service_name=nginx --action=reload
|
ynh_systemctl --service=nginx --action=reload
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# END OF SCRIPT
|
# END OF SCRIPT
|
||||||
#=================================================
|
#=================================================
|
||||||
|
|
||||||
ynh_script_progression --message="Restoration completed for $app" --last
|
ynh_script_progression "Restoration completed for $app"
|
||||||
|
|
|
@ -1,11 +1,5 @@
|
||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
#=================================================
|
|
||||||
# GENERIC START
|
|
||||||
#=================================================
|
|
||||||
# IMPORT GENERIC HELPERS
|
|
||||||
#=================================================
|
|
||||||
|
|
||||||
source _common.sh
|
source _common.sh
|
||||||
source /usr/share/yunohost/helpers
|
source /usr/share/yunohost/helpers
|
||||||
|
|
||||||
|
@ -23,12 +17,12 @@ rp_validate_assets_path
|
||||||
rp_handle_webroot
|
rp_handle_webroot
|
||||||
|
|
||||||
# Configure nginx
|
# 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
|
# END OF SCRIPT
|
||||||
#=================================================
|
#=================================================
|
||||||
|
|
||||||
ynh_script_progression --message="Upgrade of $app completed" --last
|
ynh_script_progression "Upgrade of $app completed"
|
||||||
|
|
Loading…
Reference in a new issue