mirror of
https://github.com/YunoHost-Apps/streams_ynh.git
synced 2024-09-03 20:26:20 +02:00
Merge branch '21.02.11' of github.com:YunoHost-Apps/zap_ynh into 21.02.11
This commit is contained in:
commit
4f2dd7fe6b
12 changed files with 64 additions and 112 deletions
35
README.md
35
README.md
|
@ -1,8 +1,8 @@
|
||||||
# ZAP for YunoHost
|
# ZAP for YunoHost
|
||||||
|
|
||||||
[](https://dash.yunohost.org/appci/app/zap)  
|
|
||||||
|
|
||||||
[](https://install-app.yunohost.org/?app=zap)
|
[](https://dash.yunohost.org/appci/app/zap)  
|
||||||
|
[](https://install-app.yunohost.org/?app=zap)
|
||||||
|
|
||||||
> *This package allow you to install ZAP quickly and simply on a YunoHost server.
|
> *This package allow you to install ZAP quickly and simply on a YunoHost server.
|
||||||
If you don't have YunoHost, please see [here](https://yunohost.org/#/install) to know how to install and enjoy it.*
|
If you don't have YunoHost, please see [here](https://yunohost.org/#/install) to know how to install and enjoy it.*
|
||||||
|
@ -17,11 +17,15 @@ Version: 21.02.11
|
||||||
- [Zap code on codeberg](https://codeberg.org/zot/zap)
|
- [Zap code on codeberg](https://codeberg.org/zot/zap)
|
||||||
- [Zap addons on codeberg](https://codeberg.org/zot/zap-addons)
|
- [Zap addons on codeberg](https://codeberg.org/zot/zap-addons)
|
||||||
|
|
||||||
## ZAP
|
|
||||||
|
## Overview
|
||||||
|
|
||||||
[Zap](https://zotlabs.com/zap/) is an an ethical alternative to Fediverse that provides powerful features for creating interconnected websites featuring a decentralized identity, communications, and permissions framework built using common webserver technology.
|
[Zap](https://zotlabs.com/zap/) is an an ethical alternative to Fediverse that provides powerful features for creating interconnected websites featuring a decentralized identity, communications, and permissions framework built using common webserver technology.
|
||||||
|
|
||||||
Compatible with **Mastodon**, **Pleroma**, **Pixelfed**, **Friendica**, **Hubzilla**, **Funkwhale**, **Peertube**, **Plume**, **WriteFreely** and many, many more.
|
Compatible with **Mastodon**, **Pleroma**, **Pixelfed**, **Friendica**, **Hubzilla**, **Funkwhale**, **Peertube**, **Plume**, **WriteFreely** and many, many more.
|
||||||
|
|
||||||
|
**Shipped version:** 21.02.05
|
||||||
|
|
||||||
## Unique Features of ZAP
|
## Unique Features of ZAP
|
||||||
|
|
||||||
- **Groups** : public, private, and moderated.
|
- **Groups** : public, private, and moderated.
|
||||||
|
@ -32,8 +36,6 @@ Compatible with **Mastodon**, **Pleroma**, **Pixelfed**, **Friendica**, **Hubzil
|
||||||
- **Lists**: Sometimes referred to as circles or aspects, this lets you define your own groups of related friends and- communicate with them as a private group.
|
- **Lists**: Sometimes referred to as circles or aspects, this lets you define your own groups of related friends and- communicate with them as a private group.
|
||||||
- **Extend** : Change or upgrade your software functionality as desired by installing additional features from addons and- the free app collection.
|
- **Extend** : Change or upgrade your software functionality as desired by installing additional features from addons and- the free app collection.
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
## This app claims following features:
|
## This app claims following features:
|
||||||
- [X] Ldap integration
|
- [X] Ldap integration
|
||||||
- [X] Multi-instance
|
- [X] Multi-instance
|
||||||
|
@ -41,7 +43,6 @@ Compatible with **Mastodon**, **Pleroma**, **Pixelfed**, **Friendica**, **Hubzil
|
||||||
- [X] Fail2ban
|
- [X] Fail2ban
|
||||||
- [X] Option to choose between **Mysql** and **PostgreSQL**.
|
- [X] Option to choose between **Mysql** and **PostgreSQL**.
|
||||||
|
|
||||||
|
|
||||||
## Installation
|
## Installation
|
||||||
Before installing, read the [Zap installation instructions](https://codeberg.org/zot/zap/src/branch/release/install/INSTALL.txt) for important information about:
|
Before installing, read the [Zap installation instructions](https://codeberg.org/zot/zap/src/branch/release/install/INSTALL.txt) for important information about:
|
||||||
|
|
||||||
|
@ -64,5 +65,25 @@ Before installing, read the [Zap installation instructions](https://codeberg.org
|
||||||
|
|
||||||
#### Supported architectures
|
#### Supported architectures
|
||||||
|
|
||||||
* x86-64b - [](https://ci-apps.yunohost.org/ci/apps/zap/)
|
* x86-64 - [](https://ci-apps.yunohost.org/ci/apps/zap/)
|
||||||
* ARMv8-A - [](https://ci-apps-arm.yunohost.org/ci/apps/zap/)
|
* ARMv8-A - [](https://ci-apps-arm.yunohost.org/ci/apps/zap/)
|
||||||
|
|
||||||
|
## Links
|
||||||
|
|
||||||
|
* YunoHost project: https://yunohost.org
|
||||||
|
* Zap website: https://zotlabs.com/zap/
|
||||||
|
* Zap code on codeberg: https://codeberg.org/zot/zap
|
||||||
|
* Zap addons on codeberg: https://codeberg.org/zot/zap-addons
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## Developer info
|
||||||
|
|
||||||
|
Please send your pull request to the [testing branch](https://github.com/YunoHost-Apps/zap_ynh/tree/testing).
|
||||||
|
|
||||||
|
To try the testing branch, please proceed like that.
|
||||||
|
```
|
||||||
|
sudo yunohost app install https://github.com/YunoHost-Apps/zap_ynh/tree/testing --debug
|
||||||
|
or
|
||||||
|
sudo yunohost app upgrade zap -u https://github.com/YunoHost-Apps/zap_ynh/tree/testing --debug
|
||||||
|
```
|
||||||
|
|
|
@ -17,14 +17,11 @@
|
||||||
setup_private=0
|
setup_private=0
|
||||||
setup_public=1
|
setup_public=1
|
||||||
upgrade=1
|
upgrade=1
|
||||||
#upgrade=1 from_commit=a2a416d743aaab3c01f36baec81b36b21720235f
|
#upgrade=1 from_commit=ef4779f60af6bb83a521eeb93c47de61dc6d758a
|
||||||
backup_restore=1
|
backup_restore=1
|
||||||
multi_instance=1
|
multi_instance=1
|
||||||
incorrect_path=1
|
|
||||||
port_already_use=0
|
port_already_use=0
|
||||||
change_url=0
|
change_url=0
|
||||||
;;; Levels
|
|
||||||
Level 5=auto
|
|
||||||
;;; Options
|
;;; Options
|
||||||
Email=anmol@datamol.org
|
Email=anmol@datamol.org
|
||||||
Notification=change
|
Notification=change
|
||||||
|
|
|
@ -1,40 +0,0 @@
|
||||||
# See here for more information
|
|
||||||
# https://github.com/YunoHost/package_check#syntax-check_process-file
|
|
||||||
|
|
||||||
# Move this file from check_process.default to check_process when you have filled it.
|
|
||||||
|
|
||||||
;; Test complet
|
|
||||||
; Manifest
|
|
||||||
domain="domain.tld" (DOMAIN)
|
|
||||||
path="/path" (PATH)
|
|
||||||
admin="john" (USER)
|
|
||||||
language="fr"
|
|
||||||
is_public=1 (PUBLIC|public=1|private=0)
|
|
||||||
password="pass"
|
|
||||||
port="666" (PORT)
|
|
||||||
; Checks
|
|
||||||
pkg_linter=1
|
|
||||||
setup_sub_dir=1
|
|
||||||
setup_root=1
|
|
||||||
setup_nourl=0
|
|
||||||
setup_private=1
|
|
||||||
setup_public=1
|
|
||||||
upgrade=1
|
|
||||||
upgrade=1 from_commit=CommitHash
|
|
||||||
backup_restore=1
|
|
||||||
multi_instance=1
|
|
||||||
# This test is no longer necessary since the version 2.7 (PR: https://github.com/YunoHost/yunohost/pull/304), you can still do it if your app could be installed with this version.
|
|
||||||
# incorrect_path=1
|
|
||||||
port_already_use=0
|
|
||||||
change_url=1
|
|
||||||
;;; Levels
|
|
||||||
# If the level 5 (Package linter) is forced to 1. Please add justifications here.
|
|
||||||
Level 5=auto
|
|
||||||
;;; Options
|
|
||||||
Email=
|
|
||||||
Notification=none
|
|
||||||
;;; Upgrade options
|
|
||||||
; commit=CommitHash
|
|
||||||
name=Name and date of the commit.
|
|
||||||
manifest_arg=domain=DOMAIN&path=PATH&admin=USER&language=fr&is_public=1&password=pass&port=666&
|
|
||||||
|
|
|
@ -33,7 +33,7 @@ group = __USER__
|
||||||
; (IPv6 and IPv4-mapped) on a specific port;
|
; (IPv6 and IPv4-mapped) on a specific port;
|
||||||
; '/path/to/unix/socket' - to listen on a unix socket.
|
; '/path/to/unix/socket' - to listen on a unix socket.
|
||||||
; Note: This value is mandatory.
|
; Note: This value is mandatory.
|
||||||
listen = /var/run/php/php7.0-fpm-__NAMETOCHANGE__.sock
|
listen = /var/run/php/php__PHPVERSION__-fpm-__NAMETOCHANGE__.sock
|
||||||
|
|
||||||
; Set listen(2) backlog.
|
; Set listen(2) backlog.
|
||||||
; Default Value: 511 (-1 on FreeBSD and OpenBSD)
|
; Default Value: 511 (-1 on FreeBSD and OpenBSD)
|
||||||
|
|
|
@ -12,7 +12,7 @@
|
||||||
"name": "Anmol Sharma"
|
"name": "Anmol Sharma"
|
||||||
},
|
},
|
||||||
"requirements": {
|
"requirements": {
|
||||||
"yunohost": ">= 3.8.1"
|
"yunohost": ">= 4.0.0"
|
||||||
},
|
},
|
||||||
"multi_instance": true,
|
"multi_instance": true,
|
||||||
"services": [
|
"services": [
|
||||||
|
@ -49,9 +49,6 @@
|
||||||
"choices": ["1", "2"],
|
"choices": ["1", "2"],
|
||||||
"default": "1"
|
"default": "1"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -16,4 +16,4 @@
|
||||||
---
|
---
|
||||||
*If you have access to [App Continuous Integration for packagers](https://yunohost.org/#/packaging_apps_ci) you can provide a link to the package_check results like below, replacing '-NUM-' in this link by the PR number and USERNAME by your username on the ci-apps-dev. Or you provide a screenshot or a pastebin of the results*
|
*If you have access to [App Continuous Integration for packagers](https://yunohost.org/#/packaging_apps_ci) you can provide a link to the package_check results like below, replacing '-NUM-' in this link by the PR number and USERNAME by your username on the ci-apps-dev. Or you provide a screenshot or a pastebin of the results*
|
||||||
|
|
||||||
[/badge/icon)](https://ci-apps-dev.yunohost.org/jenkins/job/REPLACEBYYOURAPP_ynh%20PR-NUM-%20(USERNAME)/)
|
[/badge/icon)](https://ci-apps-dev.yunohost.org/jenkins/job/zap_ynh%20PR-NUM-%20(USERNAME)/)
|
||||||
|
|
|
@ -7,7 +7,7 @@
|
||||||
# dependencies used by the app
|
# dependencies used by the app
|
||||||
YNH_PHP_VERSION="7.3"
|
YNH_PHP_VERSION="7.3"
|
||||||
|
|
||||||
extra_php_dependencies="php${YNH_PHP_VERSION}-mbstring php${YNH_PHP_VERSION}-cli php${YNH_PHP_VERSION}-imagick php${YNH_PHP_VERSION}-xml php${YNH_PHP_VERSION}-zip php${YNH_PHP_VERSION}-pgsql php${YNH_PHP_VERSION}-json php${YNH_PHP_VERSION}-gd"
|
extra_php_dependencies="php${YNH_PHP_VERSION}-mbstring php${YNH_PHP_VERSION}-cli php${YNH_PHP_VERSION}-imagick php${YNH_PHP_VERSION}-xml php${YNH_PHP_VERSION}-zip php${YNH_PHP_VERSION}-pgsql php${YNH_PHP_VERSION}-mysql php${YNH_PHP_VERSION}-json php${YNH_PHP_VERSION}-gd"
|
||||||
# dependencies used by the app
|
# dependencies used by the app
|
||||||
pkg_dependencies="postgresql postgresql-contrib"
|
pkg_dependencies="postgresql postgresql-contrib"
|
||||||
|
|
||||||
|
|
|
@ -6,7 +6,6 @@
|
||||||
# IMPORT GENERIC HELPERS
|
# IMPORT GENERIC HELPERS
|
||||||
#=================================================
|
#=================================================
|
||||||
|
|
||||||
#Keep this path for calling _common.sh inside the execution's context of backup and restore scripts
|
|
||||||
source ../settings/scripts/_common.sh
|
source ../settings/scripts/_common.sh
|
||||||
source /usr/share/yunohost/helpers
|
source /usr/share/yunohost/helpers
|
||||||
|
|
||||||
|
@ -15,7 +14,6 @@ source /usr/share/yunohost/helpers
|
||||||
#=================================================
|
#=================================================
|
||||||
|
|
||||||
ynh_clean_setup () {
|
ynh_clean_setup () {
|
||||||
### Remove this function if there's nothing to clean before calling the remove script.
|
|
||||||
true
|
true
|
||||||
}
|
}
|
||||||
# Exit if an error occurs during the execution of the script
|
# Exit if an error occurs during the execution of the script
|
||||||
|
@ -24,7 +22,7 @@ ynh_abort_if_errors
|
||||||
#=================================================
|
#=================================================
|
||||||
# LOAD SETTINGS
|
# LOAD SETTINGS
|
||||||
#=================================================
|
#=================================================
|
||||||
ynh_script_progression --message="Loading installation settings..."
|
ynh_print_info --message="Loading installation settings..."
|
||||||
app=$YNH_APP_INSTANCE_NAME
|
app=$YNH_APP_INSTANCE_NAME
|
||||||
|
|
||||||
final_path=$(ynh_app_setting_get --app=$app --key=final_path)
|
final_path=$(ynh_app_setting_get --app=$app --key=final_path)
|
||||||
|
@ -34,49 +32,46 @@ phpversion=$(ynh_app_setting_get --app=$app --key=phpversion)
|
||||||
database=$(ynh_app_setting_get --app=$app --key=database)
|
database=$(ynh_app_setting_get --app=$app --key=database)
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# STANDARD BACKUP STEPS
|
# DECLARE DATA AND CONF FILES TO BACKUP
|
||||||
|
#=================================================
|
||||||
|
ynh_print_info --message="Declaring files to be backed up..."
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# BACKUP THE APP MAIN DIR
|
# BACKUP THE APP MAIN DIR
|
||||||
#=================================================
|
#=================================================
|
||||||
ynh_script_progression --message="Backing up the main app directory..."
|
|
||||||
|
|
||||||
ynh_backup --src_path="$final_path"
|
ynh_backup --src_path="$final_path"
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# BACKUP THE NGINX CONFIGURATION
|
# BACKUP THE NGINX CONFIGURATION
|
||||||
#=================================================
|
#=================================================
|
||||||
ynh_script_progression --message="Backing up nginx web server configuration..."
|
|
||||||
|
|
||||||
ynh_backup --src_path="/etc/nginx/conf.d/$domain.d/$app.conf"
|
ynh_backup --src_path="/etc/nginx/conf.d/$domain.d/$app.conf"
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# BACKUP THE PHP-FPM CONFIGURATION
|
# BACKUP THE PHP-FPM CONFIGURATION
|
||||||
#=================================================
|
#=================================================
|
||||||
ynh_script_progression --message="Backing up php-fpm configuration..."
|
|
||||||
|
|
||||||
ynh_backup --src_path="/etc/php/$phpversion/fpm/pool.d/$app.conf"
|
ynh_backup --src_path="/etc/php/$phpversion/fpm/pool.d/$app.conf"
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# BACKUP OF THE DATABASE
|
# BACKUP OF THE DATABASE
|
||||||
#=================================================
|
#=================================================
|
||||||
ynh_script_progression --message="Backing up the MySQL database..."
|
|
||||||
|
|
||||||
if [ $database -eq 1 ]; then
|
if [ $database -eq 1 ]; then
|
||||||
ynh_script_progression --message="Backup of the MySQL database..."
|
ynh_print_info --message="Backup of the MySQL database..."
|
||||||
ynh_mysql_dump_db --database="$db_name" > db.sql
|
ynh_mysql_dump_db --database="$db_name" > db.sql
|
||||||
elif [ $database -eq 2 ]; then
|
elif [ $database -eq 2 ]; then
|
||||||
# Removing postgresql database
|
# Removing postgresSQL database
|
||||||
ynh_script_progression --message="Backup of the postgresql database..."
|
ynh_print_info --message="Backup of the postgreSQL database..."
|
||||||
ynh_psql_dump_db --database="$db_name" > db.sql
|
ynh_psql_dump_db --database="$db_name" > db.sql
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# SPECIFIC BACKUP
|
# SPECIFIC BACKUP
|
||||||
#=================================================
|
#=================================================
|
||||||
# BACKUP LOGROTATE
|
# BACKUP LOGROTATE
|
||||||
#=================================================
|
#=================================================
|
||||||
ynh_script_progression --message="Backing up logrotate configuration..."
|
|
||||||
|
|
||||||
ynh_backup --src_path="/etc/logrotate.d/$app"
|
ynh_backup --src_path="/etc/logrotate.d/$app"
|
||||||
|
|
||||||
|
@ -89,7 +84,6 @@ ynh_backup --src_path="/etc/cron.d/$app"
|
||||||
#=================================================
|
#=================================================
|
||||||
# BACKUP FAIL2BAN CONFIGURATION
|
# BACKUP FAIL2BAN CONFIGURATION
|
||||||
#=================================================
|
#=================================================
|
||||||
ynh_script_progression --message="Backing up fail2ban configuration..."
|
|
||||||
|
|
||||||
ynh_backup --src_path="/etc/fail2ban/jail.d/$app.conf"
|
ynh_backup --src_path="/etc/fail2ban/jail.d/$app.conf"
|
||||||
ynh_backup --src_path="/etc/fail2ban/filter.d/$app.conf"
|
ynh_backup --src_path="/etc/fail2ban/filter.d/$app.conf"
|
||||||
|
@ -98,4 +92,4 @@ ynh_backup --src_path="/etc/fail2ban/filter.d/$app.conf"
|
||||||
# END OF SCRIPT
|
# END OF SCRIPT
|
||||||
#=================================================
|
#=================================================
|
||||||
|
|
||||||
ynh_script_progression --message="Backup script completed for $app. (YunoHost will then actually copy those files to the archive)."
|
ynh_print_info --message="Backup script completed for $app. (YunoHost will then actually copy those files to the archive)."
|
||||||
|
|
|
@ -27,7 +27,7 @@ ynh_abort_if_errors
|
||||||
domain=$YNH_APP_ARG_DOMAIN
|
domain=$YNH_APP_ARG_DOMAIN
|
||||||
path_url="/"
|
path_url="/"
|
||||||
admin=$YNH_APP_ARG_ADMIN
|
admin=$YNH_APP_ARG_ADMIN
|
||||||
email=$(sudo yunohost user info $admin | grep "mail:" | cut -d' ' -f2)
|
email=$(yunohost user info $admin | grep "mail:" | cut -d' ' -f2)
|
||||||
upload="256M"
|
upload="256M"
|
||||||
database="1"
|
database="1"
|
||||||
random_string="$(ynh_string_random)$(ynh_string_random)$(ynh_string_random)"
|
random_string="$(ynh_string_random)$(ynh_string_random)$(ynh_string_random)"
|
||||||
|
@ -159,11 +159,8 @@ elif [ $database -eq 2 ]; then
|
||||||
ynh_psql_connect_as --user="$db_name" --password="$db_pwd" --database="$db_name" < $final_path/install/schema_postgres.sql
|
ynh_psql_connect_as --user="$db_name" --password="$db_pwd" --database="$db_name" < $final_path/install/schema_postgres.sql
|
||||||
else
|
else
|
||||||
ynh_die --message="Some problem occured in creating the database, contact maintainer"
|
ynh_die --message="Some problem occured in creating the database, contact maintainer"
|
||||||
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# MODIFY A CONFIG FILE
|
# MODIFY A CONFIG FILE
|
||||||
#=================================================
|
#=================================================
|
||||||
|
@ -190,7 +187,7 @@ cat ../conf/ldap_conf.php >> $final_path/.htconfig.php
|
||||||
#=================================================
|
#=================================================
|
||||||
# NGINX CONFIGURATION
|
# NGINX CONFIGURATION
|
||||||
#=================================================
|
#=================================================
|
||||||
ynh_script_progression --message="Configuring nginx web server..."
|
ynh_script_progression --message="Configuring NGINX web server..."
|
||||||
|
|
||||||
# Create a dedicated nginx config
|
# Create a dedicated nginx config
|
||||||
ynh_add_nginx_config
|
ynh_add_nginx_config
|
||||||
|
@ -206,7 +203,7 @@ ynh_system_user_create --username=$app
|
||||||
#=================================================
|
#=================================================
|
||||||
# PHP-FPM CONFIGURATION
|
# PHP-FPM CONFIGURATION
|
||||||
#=================================================
|
#=================================================
|
||||||
ynh_script_progression --message="Configuring php-fpm..."
|
ynh_script_progression --message="Configuring PHP-FPM..."
|
||||||
|
|
||||||
# Create a dedicated php-fpm config
|
# Create a dedicated php-fpm config
|
||||||
ynh_add_fpm_config --package="$extra_php_dependencies"
|
ynh_add_fpm_config --package="$extra_php_dependencies"
|
||||||
|
@ -241,19 +238,20 @@ ynh_use_logrotate "$final_path/php.log"
|
||||||
# SETUP FAIL2BAN
|
# SETUP FAIL2BAN
|
||||||
#=================================================
|
#=================================================
|
||||||
ynh_script_progression --message="Add Fail2Ban..."
|
ynh_script_progression --message="Add Fail2Ban..."
|
||||||
|
|
||||||
ynh_add_fail2ban_config --logpath="$final_path/php.log" --failregex="^.*auth\.php.*failed login attempt.*from IP <HOST>.*$" --max_retry="5"
|
ynh_add_fail2ban_config --logpath="$final_path/php.log" --failregex="^.*auth\.php.*failed login attempt.*from IP <HOST>.*$" --max_retry="5"
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# SETUP SSOWAT
|
# SETUP SSOWAT
|
||||||
#=================================================
|
#=================================================
|
||||||
# As Zap is social network and have its own permission there is no need to keep Zap behind SSO
|
|
||||||
ynh_script_progression --message="Configuring SSOwat..."
|
ynh_script_progression --message="Configuring SSOwat..."
|
||||||
|
# As Zap is social network and have its own permission there is no need to keep Zap behind SSO
|
||||||
ynh_app_setting_set --app=$app --key=unprotected_uris --value="/"
|
ynh_app_setting_set --app=$app --key=unprotected_uris --value="/"
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# RELOAD NGINX
|
# RELOAD NGINX
|
||||||
#=================================================
|
#=================================================
|
||||||
ynh_script_progression --message="Reloading nginx web server..."
|
ynh_script_progression --message="Reloading NGINX web server..."
|
||||||
|
|
||||||
ynh_systemd_action --service_name=nginx --action=reload
|
ynh_systemd_action --service_name=nginx --action=reload
|
||||||
|
|
||||||
|
|
|
@ -22,37 +22,23 @@ db_user="$db_name"
|
||||||
final_path=$(ynh_app_setting_get --app=$app --key=final_path)
|
final_path=$(ynh_app_setting_get --app=$app --key=final_path)
|
||||||
database=$(ynh_app_setting_get --app=$app --key=database)
|
database=$(ynh_app_setting_get --app=$app --key=database)
|
||||||
|
|
||||||
#=================================================
|
|
||||||
# STANDARD REMOVE
|
|
||||||
#=================================================
|
|
||||||
|
|
||||||
#=================================================
|
|
||||||
# STANDARD REMOVE
|
|
||||||
#=================================================
|
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# REMOVE THE DATABASE
|
# REMOVE THE DATABASE
|
||||||
#=================================================
|
#=================================================
|
||||||
|
|
||||||
if [ $database -eq 1 ]; then
|
if [ $database -eq 1 ]; then
|
||||||
ynh_script_progression --message="Removing MySQL database..."
|
ynh_script_progression --message="Removing MySQL database..."
|
||||||
ynh_mysql_remove_db --db_user=$db_user --db_name=$db_name
|
ynh_mysql_remove_db --db_user=$db_user --db_name=$db_name
|
||||||
elif [ $database -eq 2 ]; then
|
elif [ $database -eq 2 ]; then
|
||||||
# Removing postgresql database
|
# Removing postgresql database
|
||||||
ynh_script_progression --message="Removing postgresql database..."
|
ynh_script_progression --message="Removing postgreSQL database..."
|
||||||
ynh_psql_remove_db --db_user=$db_user --db_name=$db_name
|
ynh_psql_remove_db --db_user=$db_user --db_name=$db_name
|
||||||
fi
|
fi
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# REMOVE DEPENDENCIES
|
# REMOVE DEPENDENCIES
|
||||||
#=================================================
|
#=================================================
|
||||||
ynh_print_info "Removing dependencies"
|
ynh_script_progression --message="Removing dependencies"
|
||||||
|
|
||||||
# Remove metapackage and its dependencies
|
|
||||||
ynh_remove_app_dependencies
|
|
||||||
#=================================================
|
|
||||||
# REMOVE DEPENDENCIES
|
|
||||||
#=================================================
|
|
||||||
ynh_script_progression --message="Removing dependencies..."
|
|
||||||
|
|
||||||
# Remove metapackage and its dependencies
|
# Remove metapackage and its dependencies
|
||||||
ynh_remove_app_dependencies
|
ynh_remove_app_dependencies
|
||||||
|
@ -68,15 +54,15 @@ ynh_secure_remove --file="$final_path"
|
||||||
#=================================================
|
#=================================================
|
||||||
# REMOVE NGINX CONFIGURATION
|
# REMOVE NGINX CONFIGURATION
|
||||||
#=================================================
|
#=================================================
|
||||||
ynh_script_progression --message="Removing nginx web server configuration..."
|
ynh_script_progression --message="Removing NGINX web server configuration..."
|
||||||
|
|
||||||
# Remove the dedicated nginx config
|
# Remove the dedicated NGINX config
|
||||||
ynh_remove_nginx_config
|
ynh_remove_nginx_config
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# REMOVE PHP-FPM CONFIGURATION
|
# REMOVE PHP-FPM CONFIGURATION
|
||||||
#=================================================
|
#=================================================
|
||||||
ynh_script_progression --message="Removing php-fpm configuration..."
|
ynh_script_progression --message="Removing PHP-FPM configuration..."
|
||||||
|
|
||||||
# Remove the dedicated php-fpm config
|
# Remove the dedicated php-fpm config
|
||||||
ynh_remove_fpm_config
|
ynh_remove_fpm_config
|
||||||
|
@ -96,11 +82,10 @@ ynh_remove_logrotate
|
||||||
# Remove a cron file
|
# Remove a cron file
|
||||||
ynh_secure_remove --file="/etc/cron.d/$app"
|
ynh_secure_remove --file="/etc/cron.d/$app"
|
||||||
|
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# REMOVE FAIL2BAN CONFIGURATION
|
# REMOVE FAIL2BAN CONFIGURATION
|
||||||
#=================================================
|
#=================================================
|
||||||
ynh_script_progression --message="Removing fail2ban configuration..."
|
ynh_script_progression --message="Removing Fail2Ban configuration..."
|
||||||
|
|
||||||
ynh_remove_fail2ban_config
|
ynh_remove_fail2ban_config
|
||||||
|
|
||||||
|
@ -118,4 +103,4 @@ ynh_system_user_delete --username=$app
|
||||||
# END OF SCRIPT
|
# END OF SCRIPT
|
||||||
#=================================================
|
#=================================================
|
||||||
|
|
||||||
ynh_script_progression --message="Removal of $app completed"
|
ynh_script_progression --message="Removal of $app completed"
|
||||||
|
|
|
@ -105,7 +105,6 @@ ynh_add_fpm_config --package="$extra_php_dependencies"
|
||||||
#=================================================
|
#=================================================
|
||||||
# SPECIFIC RESTORATION
|
# SPECIFIC RESTORATION
|
||||||
#=================================================
|
#=================================================
|
||||||
#=================================================
|
|
||||||
# RESTORE THE CRON FILE
|
# RESTORE THE CRON FILE
|
||||||
#=================================================
|
#=================================================
|
||||||
|
|
||||||
|
@ -120,7 +119,7 @@ ynh_restore_file --origin_path="/etc/logrotate.d/$app"
|
||||||
#=================================================
|
#=================================================
|
||||||
# RESTORE FAIL2BAN CONFIGURATION
|
# RESTORE FAIL2BAN CONFIGURATION
|
||||||
#=================================================
|
#=================================================
|
||||||
ynh_script_progression --message="Restoring the fail2ban configuration..."
|
ynh_script_progression --message="Restoring the Fail2Ban configuration..."
|
||||||
|
|
||||||
ynh_restore_file "/etc/fail2ban/jail.d/$app.conf"
|
ynh_restore_file "/etc/fail2ban/jail.d/$app.conf"
|
||||||
ynh_restore_file "/etc/fail2ban/filter.d/$app.conf"
|
ynh_restore_file "/etc/fail2ban/filter.d/$app.conf"
|
||||||
|
@ -134,7 +133,7 @@ ynh_app_setting_set $app skipped_uris "/"
|
||||||
#=================================================
|
#=================================================
|
||||||
# RELOAD NGINX AND PHP-FPM
|
# RELOAD NGINX AND PHP-FPM
|
||||||
#=================================================
|
#=================================================
|
||||||
ynh_script_progression --message="Reloading nginx web server and php-fpm..."
|
ynh_script_progression --message="Reloading NGINX web server and PHP-FPM..."
|
||||||
|
|
||||||
ynh_systemd_action --service_name=php$phpversion-fpm --action=reload
|
ynh_systemd_action --service_name=php$phpversion-fpm --action=reload
|
||||||
ynh_systemd_action --service_name=nginx --action=reload
|
ynh_systemd_action --service_name=nginx --action=reload
|
||||||
|
|
|
@ -35,7 +35,6 @@ if [ -z "$db_name" ]; then
|
||||||
ynh_app_setting_set --app=$app --key=db_name --value=$db_name
|
ynh_app_setting_set --app=$app --key=db_name --value=$db_name
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# BACKUP BEFORE UPGRADE THEN ACTIVE TRAP
|
# BACKUP BEFORE UPGRADE THEN ACTIVE TRAP
|
||||||
#=================================================
|
#=================================================
|
||||||
|
@ -56,7 +55,8 @@ ynh_abort_if_errors
|
||||||
#=================================================
|
#=================================================
|
||||||
# REMOVE APP MAIN DIR
|
# REMOVE APP MAIN DIR
|
||||||
#=================================================
|
#=================================================
|
||||||
ynh_print_info "Upgrading source files..."
|
ynh_script_progression --message="Upgrading source files..."
|
||||||
|
|
||||||
# Create a temporary directory
|
# Create a temporary directory
|
||||||
|
|
||||||
|
|
||||||
|
@ -71,6 +71,8 @@ if [ -z "$final_path" ]; then
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# STANDARD UPGRADE STEPS
|
# STANDARD UPGRADE STEPS
|
||||||
#=================================================
|
#=================================================
|
||||||
|
@ -143,11 +145,10 @@ else
|
||||||
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# NGINX CONFIGURATION
|
# NGINX CONFIGURATION
|
||||||
#=================================================
|
#=================================================
|
||||||
ynh_script_progression --message="Upgrading nginx web server configuration..."
|
ynh_script_progression --message="Upgrading NGINX web server configuration..."
|
||||||
|
|
||||||
# Create a dedicated nginx config
|
# Create a dedicated nginx config
|
||||||
ynh_add_nginx_config
|
ynh_add_nginx_config
|
||||||
|
@ -166,7 +167,7 @@ chown -R $app: $final_path
|
||||||
#=================================================
|
#=================================================
|
||||||
# PHP-FPM CONFIGURATION
|
# PHP-FPM CONFIGURATION
|
||||||
#=================================================
|
#=================================================
|
||||||
ynh_print_info "Upgrading php-fpm configuration..."
|
ynh_script_progression --message="Upgrading PHP-FPM configuration..."
|
||||||
|
|
||||||
# Create a dedicated php-fpm config
|
# Create a dedicated php-fpm config
|
||||||
ynh_add_fpm_config --package="$extra_php_dependencies"
|
ynh_add_fpm_config --package="$extra_php_dependencies"
|
||||||
|
|
Loading…
Add table
Reference in a new issue