1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/spftoolbox_ynh.git synced 2024-09-03 20:26:21 +02:00
This commit is contained in:
ericgaspar 2022-10-09 10:51:43 +02:00
parent 2b23f3a0e6
commit d773b9563b
6 changed files with 34 additions and 42 deletions

View file

@ -4,11 +4,6 @@ location __PATH__/ {
# Path to source # Path to source
alias __FINALPATH__/; alias __FINALPATH__/;
# Force usage of https
if ($scheme = http) {
rewrite ^ https://$server_name$request_uri? permanent;
}
index index.php index.html; index index.php index.html;
# Common parameter to increase upload size limit in conjunction with dedicated php-fpm file # Common parameter to increase upload size limit in conjunction with dedicated php-fpm file

View file

@ -3,10 +3,10 @@
"id": "spftoolbox", "id": "spftoolbox",
"packaging_format": 1, "packaging_format": 1,
"description": { "description": {
"en": "Look up DNS records such as SPF, MX, Whois, and more", "en": "Look up DNS records such as SPF, MX, Whois",
"fr": "Recherchez des enregistrements DNS tels que SPF, MX, Whois, etc." "fr": "Recherchez des enregistrements DNS tels que SPF, MX, Whois"
}, },
"version": "2.1.1~ynh1", "version": "2.1.1~ynh2",
"url": "http://spftoolbox.com/", "url": "http://spftoolbox.com/",
"upstream": { "upstream": {
"license": "MIT", "license": "MIT",
@ -21,19 +21,18 @@
"url": "https://www.abld.info" "url": "https://www.abld.info"
}, },
"requirements": { "requirements": {
"yunohost": ">= 4.2.4" "yunohost": ">= 11.0.9"
}, },
"multi_instance": true, "multi_instance": true,
"services": [ "services": [
"nginx", "nginx",
"php7.3-fpm" "php7.4-fpm"
], ],
"arguments": { "arguments": {
"install" : [ "install" : [
{ {
"name": "domain", "name": "domain",
"type": "domain", "type": "domain"
"example": "example.com"
}, },
{ {
"name": "path", "name": "path",

View file

@ -4,7 +4,7 @@
# COMMON VARIABLES # COMMON VARIABLES
#================================================= #=================================================
YNH_PHP_VERSION="7.3" YNH_PHP_VERSION="7.4"
# dependencies used by the app # dependencies used by the app
pkg_dependencies="whois" pkg_dependencies="whois"

View file

@ -75,14 +75,6 @@ chmod 750 "$final_path"
chmod -R o-rwx "$final_path" chmod -R o-rwx "$final_path"
chown -R $app:www-data "$final_path" chown -R $app:www-data "$final_path"
#=================================================
# NGINX CONFIGURATION
#=================================================
ynh_script_progression --message="Configuring NGINX web server..."
# Create a dedicated nginx config
ynh_add_nginx_config
#================================================= #=================================================
# PHP-FPM CONFIGURATION # PHP-FPM CONFIGURATION
#================================================= #=================================================
@ -92,6 +84,14 @@ ynh_script_progression --message="Configuring PHP-FPM..."
ynh_add_fpm_config ynh_add_fpm_config
phpversion=$(ynh_app_setting_get --app=$app --key=phpversion) phpversion=$(ynh_app_setting_get --app=$app --key=phpversion)
#=================================================
# NGINX CONFIGURATION
#=================================================
ynh_script_progression --message="Configuring NGINX web server..."
# Create a dedicated nginx config
ynh_add_nginx_config
#================================================= #=================================================
# SETUP LOGROTATE # SETUP LOGROTATE
#================================================= #=================================================

View file

@ -39,13 +39,6 @@ test ! -d $final_path \
#================================================= #=================================================
# STANDARD RESTORATION STEPS # STANDARD RESTORATION STEPS
#=================================================
# RESTORE THE NGINX CONFIGURATION
#=================================================
ynh_script_progression --message="Restoring the NGINX configuration..."
ynh_restore_file --origin_path="/etc/nginx/conf.d/$domain.d/$app.conf"
#================================================= #=================================================
# RECREATE THE DEDICATED USER # RECREATE THE DEDICATED USER
#================================================= #=================================================
@ -65,6 +58,14 @@ chmod 750 "$final_path"
chmod -R o-rwx "$final_path" chmod -R o-rwx "$final_path"
chown -R $app:www-data "$final_path" chown -R $app:www-data "$final_path"
#=================================================
# REINSTALL DEPENDENCIES
#=================================================
ynh_script_progression --message="Reinstalling dependencies..."
# Define and install dependencies
ynh_install_app_dependencies $pkg_dependencies
#================================================= #=================================================
# RESTORE THE PHP-FPM CONFIGURATION # RESTORE THE PHP-FPM CONFIGURATION
#================================================= #=================================================
@ -74,14 +75,11 @@ ynh_restore_file --origin_path="/etc/php/$phpversion/fpm/pool.d/$app.conf"
ynh_add_fpm_config ynh_add_fpm_config
#================================================= #=================================================
# SPECIFIC RESTORATION # RESTORE THE NGINX CONFIGURATION
#================================================= #=================================================
# REINSTALL DEPENDENCIES ynh_script_progression --message="Restoring the NGINX configuration..."
#=================================================
ynh_script_progression --message="Reinstalling dependencies..."
# Define and install dependencies ynh_restore_file --origin_path="/etc/nginx/conf.d/$domain.d/$app.conf"
ynh_install_app_dependencies $pkg_dependencies
#================================================= #=================================================
# RESTORE THE LOGROTATE CONFIGURATION # RESTORE THE LOGROTATE CONFIGURATION

View file

@ -84,14 +84,6 @@ chmod 750 "$final_path"
chmod -R o-rwx "$final_path" chmod -R o-rwx "$final_path"
chown -R $app:www-data "$final_path" chown -R $app:www-data "$final_path"
#=================================================
# NGINX CONFIGURATION
#=================================================
ynh_script_progression --message="Upgrading NGINX web server configuration..."
# Create a dedicated nginx config
ynh_add_nginx_config
#================================================= #=================================================
# UPGRADE DEPENDENCIES # UPGRADE DEPENDENCIES
#================================================= #=================================================
@ -107,6 +99,14 @@ ynh_script_progression --message="Upgrading PHP-FPM configuration..."
# Create a dedicated php-fpm config # Create a dedicated php-fpm config
ynh_add_fpm_config ynh_add_fpm_config
#=================================================
# NGINX CONFIGURATION
#=================================================
ynh_script_progression --message="Upgrading NGINX web server configuration..."
# Create a dedicated nginx config
ynh_add_nginx_config
#================================================= #=================================================
# SPECIFIC UPGRADE # SPECIFIC UPGRADE
#================================================= #=================================================