diff --git a/conf/nginx.conf b/conf/nginx.conf index efeb0e3..3cf8b72 100644 --- a/conf/nginx.conf +++ b/conf/nginx.conf @@ -1,4 +1,4 @@ -location @__NAME__--proxy { +location @__APP__--proxy { proxy_pass __PROXY_PATH__; proxy_redirect off; proxy_set_header Host $host; diff --git a/manifest.toml b/manifest.toml index 740c996..93f7c64 100644 --- a/manifest.toml +++ b/manifest.toml @@ -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 diff --git a/scripts/backup b/scripts/backup index 3e94ec0..7cf9958 100644 --- a/scripts/backup +++ b/scripts/backup @@ -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)." diff --git a/scripts/change_url b/scripts/change_url index bc546d8..4583d02 100644 --- a/scripts/change_url +++ b/scripts/change_url @@ -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" diff --git a/scripts/install b/scripts/install index 6b28dd2..e0ee081 100644 --- a/scripts/install +++ b/scripts/install @@ -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" diff --git a/scripts/remove b/scripts/remove index 46c23e1..1e2854c 100644 --- a/scripts/remove +++ b/scripts/remove @@ -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" diff --git a/scripts/restore b/scripts/restore index 47cf284..075ce80 100644 --- a/scripts/restore +++ b/scripts/restore @@ -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" diff --git a/scripts/upgrade b/scripts/upgrade index 1ed1493..b59c907 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -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"