1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/kanboard_ynh.git synced 2024-09-03 19:36:17 +02:00
kanboard_ynh/scripts/upgrade

66 lines
3 KiB
Text
Raw Normal View History

2014-07-20 18:10:20 +02:00
#!/bin/bash
2015-10-23 16:24:30 +02:00
source _common.sh
2017-10-19 12:13:47 +02:00
source /usr/share/yunohost/helpers
ynh_app_setting_set_default --key=php_upload_max_filesize --value=100M
#=================================================
# DOWNLOAD, CHECK AND UNPACK SOURCE
#=================================================
ynh_script_progression "Upgrading source files..."
2014-11-23 20:45:36 +01:00
2024-06-07 11:05:45 +02:00
# Download, check integrity, uncompress and patch the source from app.src
ynh_setup_source --dest_dir="$install_dir" --keep="config.php"
2023-03-06 13:24:53 +01:00
mkdir -p $install_dir/sessions/
2023-10-24 09:40:03 +02:00
chown -R $app $install_dir/{plugins,sessions}
2023-03-06 13:24:53 +01:00
chmod -R 700 $install_dir/sessions
#REMOVEME? Assuming the install dir is setup using ynh_setup_source, the proper chmod/chowns are now already applied and it shouldn't be necessary to tweak perms | chmod -R o-rwx "$install_dir"
#REMOVEME? Assuming the install dir is setup using ynh_setup_source, the proper chmod/chowns are now already applied and it shouldn't be necessary to tweak perms | chown -R $app:www-data "$install_dir"
#=================================================
# PHP-FPM CONFIGURATION
#=================================================
ynh_script_progression "Upgrading PHP-FPM configuration..."
2020-10-30 15:08:59 +01:00
# Create a dedicated PHP-FPM config
ynh_config_add_phpfpm
2018-03-08 18:33:25 +01:00
2020-10-30 15:08:59 +01:00
# Create a dedicated NGINX config
ynh_config_add_nginx
2023-10-24 09:41:12 +02:00
# Create a dedicated Fail2Ban config
ynh_config_add_fail2ban --logpath="/var/log/nginx/${domain}-error.log" --failregex="^.*authentication failure\" while reading response header from upstream, client: <HOST>,.*$"
2023-10-24 09:41:12 +02:00
ynh_config_add --template="cron" --destination="/etc/cron.d/$app"
#REMOVEME? Assuming the file is setup using ynh_config_add, the proper chmod/chowns are now already applied and it shouldn't be necessary to tweak perms | chown root: "/etc/cron.d/$app"
#REMOVEME? Assuming the file is setup using ynh_config_add, the proper chmod/chowns are now already applied and it shouldn't be necessary to tweak perms | chmod 644 "/etc/cron.d/$app"
2023-10-24 09:41:12 +02:00
#=================================================
# ADD A CONFIGURATION
#=================================================
ynh_script_progression "Adding $app's configuration..."
2023-10-24 09:41:12 +02:00
2024-06-07 11:05:45 +02:00
#dir="__DIR__"
#ynh_config_add --template="config.php" --destination="$install_dir/config.php"
2023-10-24 09:41:12 +02:00
##REMOVEME? Assuming the file is setup using ynh_config_add, the proper chmod/chowns are now already applied and it shouldn't be necessary to tweak perms | chmod 400 "$install_dir/config.php"
##REMOVEME? Assuming the file is setup using ynh_config_add, the proper chmod/chowns are now already applied and it shouldn't be necessary to tweak perms | chown $app "$install_dir/config.php"
2023-10-24 09:41:12 +02:00
#=================================================
2019-02-15 19:49:22 +01:00
# UPGRADE KANBOARD
#=================================================
ynh_script_progression "Upgrading the app..."
2014-07-20 18:10:20 +02:00
2023-03-06 13:24:53 +01:00
pushd $install_dir
2019-02-15 19:49:22 +01:00
# Launch database migration
php$php_version cli db:migrate --no-interaction --verbose
2021-02-26 12:26:48 +01:00
popd
#=================================================
2019-02-17 20:55:37 +01:00
# END OF SCRIPT
#=================================================
ynh_script_progression "Upgrade of $app completed"