1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/planka_ynh.git synced 2024-09-03 20:06:00 +02:00
This commit is contained in:
Éric Gaspar 2023-12-14 11:50:23 +01:00
parent e86bfcddaa
commit 3b1ab28210
5 changed files with 6 additions and 14 deletions

View file

@ -6,7 +6,6 @@
# 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 /usr/share/yunohost/helpers

View file

@ -30,7 +30,6 @@ ynh_exec_warn_less ynh_install_nodejs --nodejs_version=$nodejs_version
#=================================================
ynh_script_progression --message="Setting up source files..." --weight=1
# Download, check integrity, uncompress and patch the source from manifest.toml
ynh_setup_source --dest_dir="$install_dir"
chmod -R o-rwx "$install_dir"
@ -41,18 +40,14 @@ chown -R $app:www-data "$install_dir"
#=================================================
ynh_script_progression --message="Adding system configurations related to $app..." --weight=1
# Create a dedicated NGINX config using the conf/nginx.conf template
ynh_add_nginx_config
# Create a dedicated systemd config
ynh_add_systemd_config
yunohost service add $app --description="Realtime kanban board for workgroups" --log="/var/log/$app/$app.log"
# Use logrotate to manage application logfile(s)
ynh_use_logrotate
# Create a dedicated Fail2Ban config
ynh_add_fail2ban_config --logpath="/var/log/nginx/${domain}-error.log" --failregex="^(.*) Invalid (email or username:|password!) (\"(.*)\"!)? ?\(IP: <ADDR>\)$"
#=================================================

View file

@ -16,9 +16,6 @@ source /usr/share/yunohost/helpers
#=================================================
ynh_script_progression --message="Removing system configurations related to $app..." --weight=1
# This should be a symetric version of what happens in the install script
# Remove the service from the list of services known by YunoHost (added from `yunohost service add`)
if ynh_exec_warn_less yunohost service status $app >/dev/null
then
ynh_script_progression --message="Removing $app service integration..." --weight=1

View file

@ -25,7 +25,6 @@ chown -R $app:www-data "$install_dir"
#=================================================
ynh_script_progression --message="Reinstalling dependencies..." --weight=6
# Install Nodejs
ynh_exec_warn_less ynh_install_nodejs --nodejs_version=$nodejs_version
#=================================================
@ -62,7 +61,6 @@ ynh_systemd_action --action=restart --service_name=fail2ban
#=================================================
ynh_script_progression --message="Reloading NGINX web server and $app's service..." --weight=1
# Typically you only have either $app or php-fpm but not both at the same time...
ynh_systemd_action --service_name=$app --action="start" --log_path="systemd"
ynh_systemd_action --service_name=nginx --action=reload

View file

@ -9,6 +9,12 @@
source _common.sh
source /usr/share/yunohost/helpers
secret=$(ynh_string_random --length=50)
email=$(ynh_user_get_info --username=$admin --key=mail)
timezone="$(cat /etc/timezone)"
firstname=$(yunohost user list --fields firstname --output-as json | jq -r .users.$admin.firstname)
lastname=$(yunohost user list --fields lastname --output-as json | jq -r .users.$admin.lastname)
upgrade_type=$(ynh_check_app_version_changed)
#=================================================
@ -28,7 +34,6 @@ if [ "$upgrade_type" == "UPGRADE_APP" ]
then
ynh_script_progression --message="Upgrading source files..." --weight=1
# Download, check integrity, uncompress and patch the source from manifest.toml
ynh_setup_source --dest_dir="$install_dir" --keep=".env"
fi
@ -48,10 +53,8 @@ ynh_add_systemd_config
yunohost service add $app --description="Realtime kanban board for workgroups" --log="/var/log/$app/$app.log"
# Use logrotate to manage application logfile(s)
ynh_use_logrotate --non-append
# Create a dedicated Fail2Ban config
ynh_add_fail2ban_config --logpath="/var/log/nginx/${domain}-error.log" --failregex="^(.*) Invalid (email or username:|password!) (\"(.*)\"!)? ?\(IP: <ADDR>\)$"
#=================================================