mirror of
https://github.com/YunoHost-Apps/petitesannonces_ynh.git
synced 2024-09-03 19:56:31 +02:00
tout ok sauf upgrade
This commit is contained in:
parent
27dd1b50fe
commit
518e30e44b
8 changed files with 16 additions and 14 deletions
|
@ -20,7 +20,7 @@
|
||||||
setup_private=1
|
setup_private=1
|
||||||
setup_public=1
|
setup_public=1
|
||||||
upgrade=1
|
upgrade=1
|
||||||
upgrade=1 from_commit=CommitHash
|
#upgrade=1 from_commit=CommitHash
|
||||||
backup_restore=1
|
backup_restore=1
|
||||||
multi_instance=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.
|
# 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.
|
|
@ -1,5 +1,5 @@
|
||||||
SOURCE_URL=https://framagit.org/toitoinebzh/petitesannonces/-/archive/master/petitesannonces-master.tar.gz
|
SOURCE_URL=https://framagit.org/toitoinebzh/petitesannonces/-/archive/master/petitesannonces-master.tar.gz
|
||||||
SOURCE_SUM=247895eb74422f36e6b42640d51a6654ddaf57ffa0ea94841e86b717ef337f79
|
SOURCE_SUM=1f623272e14011145590111890a8729ff89b5475a4cb5e1a1fabce7ba193bc88
|
||||||
SOURCE_SUM_PRG=sha256sum
|
SOURCE_SUM_PRG=sha256sum
|
||||||
SOURCE_FORMAT=tar.gz
|
SOURCE_FORMAT=tar.gz
|
||||||
SOURCE_IN_SUBDIR=true
|
SOURCE_IN_SUBDIR=true
|
||||||
|
|
|
@ -8,7 +8,7 @@
|
||||||
},
|
},
|
||||||
"version": "0.1.0~ynh1",
|
"version": "0.1.0~ynh1",
|
||||||
"url": "https://framagit.org/toitoinebzh/petitesannonces",
|
"url": "https://framagit.org/toitoinebzh/petitesannonces",
|
||||||
"license": "AGPLv3",
|
"license": "AGPL-3.0-or-later",
|
||||||
"maintainer": {
|
"maintainer": {
|
||||||
"name": "Antoine",
|
"name": "Antoine",
|
||||||
"email": "antoine@miaou.org"
|
"email": "antoine@miaou.org"
|
||||||
|
|
|
@ -74,8 +74,8 @@ ynh_mysql_dump_db --database="$db_name" > db.sql
|
||||||
#=================================================
|
#=================================================
|
||||||
ynh_script_progression --message="Backing up fail2ban configuration..." --time --weight=1
|
ynh_script_progression --message="Backing up fail2ban configuration..." --time --weight=1
|
||||||
|
|
||||||
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"
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# SPECIFIC BACKUP
|
# SPECIFIC BACKUP
|
||||||
|
|
|
@ -342,7 +342,7 @@ ynh_script_progression --message="Starting a systemd service..." --time --weight
|
||||||
ynh_script_progression --message="Configuring fail2ban..." --time --weight=1
|
ynh_script_progression --message="Configuring fail2ban..." --time --weight=1
|
||||||
|
|
||||||
# Create a dedicated fail2ban config
|
# Create a dedicated fail2ban config
|
||||||
ynh_add_fail2ban_config --logpath="/var/log/nginx/${domain}-error.log" --failregex="Regex to match into the log for a failed login"
|
#ynh_add_fail2ban_config --logpath="/var/log/nginx/${domain}-error.log" --failregex="Regex to match into the log for a failed login"
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# SETUP SSOWAT
|
# SETUP SSOWAT
|
||||||
|
|
|
@ -32,7 +32,7 @@ final_path=$(ynh_app_setting_get --app=$app --key=final_path)
|
||||||
if ynh_exec_warn_less yunohost service status $app >/dev/null
|
if ynh_exec_warn_less yunohost service status $app >/dev/null
|
||||||
then
|
then
|
||||||
ynh_script_progression --message="Removing $app service..." --time --weight=1
|
ynh_script_progression --message="Removing $app service..." --time --weight=1
|
||||||
yunohost service remove $app
|
#yunohost service remove $app
|
||||||
fi
|
fi
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
|
@ -107,7 +107,7 @@ fi
|
||||||
ynh_script_progression --message="Removing fail2ban configuration..." --time --weight=1
|
ynh_script_progression --message="Removing fail2ban configuration..." --time --weight=1
|
||||||
|
|
||||||
# Remove the dedicated fail2ban config
|
# Remove the dedicated fail2ban config
|
||||||
ynh_remove_fail2ban_config
|
#ynh_remove_fail2ban_config
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# SPECIFIC REMOVE
|
# SPECIFIC REMOVE
|
||||||
|
|
|
@ -85,9 +85,9 @@ ynh_restore_file --origin_path="/etc/php/7.0/fpm/pool.d/$app.conf"
|
||||||
#=================================================
|
#=================================================
|
||||||
ynh_script_progression --message="Restoring the fail2ban configuration..." --time --weight=1
|
ynh_script_progression --message="Restoring the fail2ban configuration..." --time --weight=1
|
||||||
|
|
||||||
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"
|
||||||
ynh_systemd_action --action=restart --service_name=fail2ban
|
#ynh_systemd_action --action=restart --service_name=fail2ban
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# SPECIFIC RESTORATION
|
# SPECIFIC RESTORATION
|
||||||
|
|
|
@ -148,6 +148,8 @@ ynh_add_fpm_config
|
||||||
|
|
||||||
# Supprimer install.php
|
# Supprimer install.php
|
||||||
rm $final_path/install.php
|
rm $final_path/install.php
|
||||||
|
# Restaurer config.php
|
||||||
|
ynh_restore_file $final_path/conf/config.php
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# STORE THE CONFIG FILE CHECKSUM
|
# STORE THE CONFIG FILE CHECKSUM
|
||||||
|
@ -155,7 +157,7 @@ rm $final_path/install.php
|
||||||
|
|
||||||
### Verify the checksum of a file, stored by `ynh_store_file_checksum` in the install script.
|
### Verify the checksum of a file, stored by `ynh_store_file_checksum` in the install script.
|
||||||
### And create a backup of this file if the checksum is different. So the file will be backed up if the admin had modified it.
|
### And create a backup of this file if the checksum is different. So the file will be backed up if the admin had modified it.
|
||||||
ynh_backup_if_checksum_is_different --file="$final_path/CONFIG_FILE"
|
#ynh_backup_if_checksum_is_different --file="$final_path/CONFIG_FILE"
|
||||||
# Recalculate and store the checksum of the file for the next upgrade.
|
# Recalculate and store the checksum of the file for the next upgrade.
|
||||||
#ynh_store_file_checksum --file="$final_path/CONFIG_FILE"
|
#ynh_store_file_checksum --file="$final_path/CONFIG_FILE"
|
||||||
|
|
||||||
|
@ -183,7 +185,7 @@ ynh_script_progression --message="Upgrading systemd configuration..." --time --w
|
||||||
ynh_script_progression --message="Reconfiguring fail2ban..." --time --weight=1
|
ynh_script_progression --message="Reconfiguring fail2ban..." --time --weight=1
|
||||||
|
|
||||||
# Create a dedicated fail2ban config
|
# Create a dedicated fail2ban config
|
||||||
ynh_add_fail2ban_config --logpath="/var/log/nginx/${domain}-error.log" --failregex="Regex to match into the log for a failed login"
|
#ynh_add_fail2ban_config --logpath="/var/log/nginx/${domain}-error.log" --failregex="Regex to match into the log for a failed login"
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# SECURE FILES AND DIRECTORIES
|
# SECURE FILES AND DIRECTORIES
|
||||||
|
@ -209,7 +211,7 @@ fi
|
||||||
#=================================================
|
#=================================================
|
||||||
ynh_script_progression --message="Starting a systemd service..." --time --weight=1
|
ynh_script_progression --message="Starting a systemd service..." --time --weight=1
|
||||||
|
|
||||||
ynh_systemd_action --service_name=$app --action="start" --log_path="/var/log/$app/$app.log"
|
#ynh_systemd_action --service_name=$app --action="start" --log_path="/var/log/$app/$app.log"
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# RELOAD NGINX
|
# RELOAD NGINX
|
||||||
|
|
Loading…
Reference in a new issue