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 2024-08-31 21:47:23 +02:00
parent 17adecd5e3
commit 5bbd5b3703
8 changed files with 3 additions and 41 deletions

View file

@ -18,7 +18,7 @@ code = "https://github.com/kanboard/kanboard"
fund = "https://kanboard.org/#donations"
[integration]
yunohost = ">= 11.2.18"
yunohost = ">= 11.2.29"
helpers_version = "2.1"
architectures = "all"
multi_instance = true

View file

@ -3,5 +3,3 @@
#=================================================
# COMMON VARIABLES AND CUSTOM HELPERS
#=================================================
# PHP APP SPECIFIC
#=================================================

View file

@ -1,6 +1,5 @@
#!/bin/bash
# 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
@ -16,7 +15,6 @@ ynh_backup "$install_dir"
# BACKUP THE DATA DIR
#=================================================
# Only relevant if there is a "data_dir" resource for this app
ynh_backup "$data_dir"
#=================================================

View file

@ -17,10 +17,8 @@ ynh_config_change_url_nginx
#=================================================
ynh_script_progression "Configuring Fail2Ban..."
# Remove the config file with $old_domain
ynh_config_remove_fail2ban
# Add config file with $new_domain
ynh_config_add_fail2ban --logpath="/var/log/nginx/${new_domain}-error.log" --failregex="^.*authentication failure\" while reading response header from upstream, client: <HOST>,.*$"
#=================================================
@ -30,7 +28,6 @@ ynh_script_progression "Updating configuration..."
if [ $change_domain -eq 1 ]
then
# Change domain in Kanboard configuration
ynh_replace --match="'${old_domain}'" --replace="'${new_domain}'" --file="${install_dir}/config.php"
fi

View file

@ -10,31 +10,24 @@ ynh_app_setting_set --key=php_upload_max_filesize --value=100M
#=================================================
ynh_script_progression "Setting up source files..."
# Download, check integrity, uncompress and patch the source from app.src
ynh_setup_source --dest_dir="$install_dir"
mkdir -p $install_dir/sessions/
chown -R $app $install_dir/{plugins,sessions}
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 "Configuring PHP-FPM..."
# Create a dedicated PHP-FPM config
ynh_config_add_phpfpm
# Create a dedicated NGINX config
ynh_config_add_nginx
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"
# 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>,.*$"
#=================================================
@ -47,9 +40,6 @@ ynh_script_progression "Adding $app's configuration..."
dir="__DIR__"
ynh_config_add --template="config.php" --destination="$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 | 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"
#=================================================
# DATABASE INITIALIZATION
#=================================================
@ -58,7 +48,6 @@ ynh_script_progression "Initializing database..."
ynh_mysql_db_shell < "$install_dir/app/Schema/Sql/mysql.sql"
pushd $install_dir
# Launch database migration
php$php_version cli db:migrate --no-interaction --verbose
popd

View file

@ -8,16 +8,12 @@ source /usr/share/yunohost/helpers
#=================================================
ynh_script_progression "Removing NGINX web server configuration..."
# Remove the dedicated NGINX config
ynh_config_remove_nginx
# Remove the dedicated PHP-FPM config
ynh_config_remove_phpfpm
# Remove the dedicated Fail2Ban config
ynh_config_remove_fail2ban
# Remove a cron file
ynh_safe_rm "/etc/cron.d/$app"
#=================================================

View file

@ -1,6 +1,5 @@
#!/bin/bash
# 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
@ -11,7 +10,6 @@ ynh_script_progression "Restoring the app main directory..."
ynh_restore "$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"
#=================================================
# RESTORE THE DATA DIRECTORY
#=================================================
@ -19,7 +17,6 @@ ynh_script_progression "Restoring the data directory..."
ynh_restore "$data_dir"
# (Same as for install dir)
chown -R $app:www-data "$data_dir"
#=================================================
@ -45,8 +42,6 @@ ynh_restore "/etc/fail2ban/filter.d/$app.conf"
ynh_systemctl --action=restart --service=fail2ban
ynh_restore "/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"
#=================================================
# RELOAD NGINX AND PHP-FPM

View file

@ -10,32 +10,25 @@ ynh_app_setting_set_default --key=php_upload_max_filesize --value=100M
#=================================================
ynh_script_progression "Upgrading source files..."
# Download, check integrity, uncompress and patch the source from app.src
ynh_setup_source --dest_dir="$install_dir" --keep="config.php"
mkdir -p $install_dir/sessions/
chown -R $app $install_dir/{plugins,sessions}
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..."
# Create a dedicated PHP-FPM config
ynh_config_add_phpfpm
# Create a dedicated NGINX config
ynh_config_add_nginx
# 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>,.*$"
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"
#=================================================
# ADD A CONFIGURATION
@ -45,16 +38,12 @@ ynh_script_progression "Adding $app's configuration..."
#dir="__DIR__"
#ynh_config_add --template="config.php" --destination="$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 | 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"
#=================================================
# UPGRADE KANBOARD
#=================================================
ynh_script_progression "Upgrading the app..."
pushd $install_dir
# Launch database migration
php$php_version cli db:migrate --no-interaction --verbose
popd