1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/kanboard_ynh.git synced 2024-09-03 19:36:17 +02:00
This commit is contained in:
Éric Gaspar 2023-10-24 09:41:12 +02:00
parent 94439a9336
commit 02f0454b3b
2 changed files with 19 additions and 22 deletions

View file

@ -36,7 +36,7 @@ ynh_setup_source --dest_dir="$install_dir"
mkdir -p $install_dir/sessions/
chown -R $app $install_dir/{data,plugins,sessions}
chown -R $app $install_dir/{plugins,sessions}
chmod -R 700 $install_dir/sessions
chmod -R o-rwx "$install_dir"
chown -R $app:www-data "$install_dir"
@ -59,7 +59,6 @@ ynh_add_nginx_config
#=================================================
ynh_script_progression --message="Adding a configuration file..." --weight=1
dir="__DIR__"
ynh_add_config --template="../conf/config.php" --destination="$install_dir/config.php"
chmod 400 "$install_dir/config.php"

View file

@ -49,7 +49,7 @@ then
ynh_script_progression --message="Upgrading source files..." --weight=3
# Download, check integrity, uncompress and patch the source from app.src
ynh_setup_source --dest_dir="$install_dir" --keep="data/ config.php"
ynh_setup_source --dest_dir="$install_dir" --keep="config.php"
fi
mkdir -p $install_dir/sessions/
@ -70,6 +70,23 @@ ynh_add_fpm_config --usage=$fpm_usage --footprint=$fpm_footprint
# Create a dedicated NGINX config
ynh_add_nginx_config
# Create a dedicated Fail2Ban config
ynh_add_fail2ban_config --logpath="/var/log/nginx/${domain}-error.log" --failregex="^.*authentication failure\" while reading response header from upstream, client: <HOST>,.*$" --max_retry=5
ynh_add_config --template="../conf/cron" --destination="/etc/cron.d/$app"
chown root: "/etc/cron.d/$app"
chmod 644 "/etc/cron.d/$app"
#=================================================
# ADD A CONFIGURATION
#=================================================
ynh_script_progression --message="Adding a configuration file..." --weight=1
ynh_add_config --template="../conf/config.php" --destination="$install_dir/config.php"
chmod 400 "$install_dir/config.php"
chown $app "$install_dir/config.php"
#=================================================
# SPECIFIC UPGRADE
#=================================================
@ -84,25 +101,6 @@ pushd $install_dir
php$phpversion cli plugin:upgrade --no-interaction --verbose
popd
#=================================================
# SETUP CRON
#=================================================
ynh_script_progression --message="Setuping a cron..." --weight=2
ynh_add_config --template="../conf/cron" --destination="/etc/cron.d/$app"
chown root: "/etc/cron.d/$app"
chmod 644 "/etc/cron.d/$app"
#=================================================
# GENERIC FINALIZATION
#=================================================
# UPGRADE FAIL2BAN
#=================================================
ynh_script_progression --message="Reconfiguring Fail2Ban..." --weight=7
# Create a dedicated Fail2Ban config
ynh_add_fail2ban_config --logpath="/var/log/nginx/${domain}-error.log" --failregex="^.*authentication failure\" while reading response header from upstream, client: <HOST>,.*$" --max_retry=5
#=================================================
# END OF SCRIPT
#=================================================