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

Merge branch 'testing' into ics

This commit is contained in:
Éric Gaspar 2022-06-10 19:32:07 +02:00 committed by GitHub
commit ad32894723
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
17 changed files with 146 additions and 100 deletions

View file

@ -15,7 +15,16 @@ If you don't have YunoHost, please consult [the guide](https://yunohost.org/#/in
## Overview ## Overview
Kanban project management software Kanboard is a free and open source Kanban project management software.
### Features
- Visualize your work
- Limit your work in progress to focus on your goal
- Drag and drop tasks to manage your project
- Self-hosted
- Super simple installation
**Shipped version:** 1.2.22~ynh1 **Shipped version:** 1.2.22~ynh1

View file

@ -15,7 +15,14 @@ Si vous n'avez pas YunoHost, regardez [ici](https://yunohost.org/#/install) pour
## Vue d'ensemble ## Vue d'ensemble
Logiciel de gestion de projet Kanban Kanboard est un logiciel de gestion de projet Kanban gratuit et open source.
### Fonctionnalités
- Visualisez votre travail
- Limitez votre travail en cours pour vous concentrer sur votre objectif
- Glisser et déposez des tâches pour gérer votre projet
- Auto-hébergé
**Version incluse :** 1.2.22~ynh1 **Version incluse :** 1.2.22~ynh1

View file

@ -12,11 +12,12 @@
setup_private=1 setup_private=1
setup_public=1 setup_public=1
upgrade=1 upgrade=1
upgrade=1 from_commit=c20bdd69644de72736cdc4438a36faab9ab24c72 #1.2.21~ynh3
upgrade=1 from_commit=b667e4d5fd9cc860f706ad7e4e41208cf1d04f2a
backup_restore=1 backup_restore=1
multi_instance=1 multi_instance=1
change_url=1 change_url=1
;;; Upgrade options ;;; Upgrade options
; commit=c20bdd69644de72736cdc4438a36faab9ab24c72 ; commit=b667e4d5fd9cc860f706ad7e4e41208cf1d04f2a
name=Merge pull request #114 from YunoHost-Apps/testing name=Merge pull request #133 from YunoHost-Apps/testing
manifest_arg=domain=DOMAIN&path=PATH&admin=USER&is_public=Yes& manifest_arg=domain=DOMAIN&path=PATH&admin=USER&is_public=Yes&

View file

@ -1,24 +1,32 @@
<?php <?php
/*******************************************************************/
/* Rename this file to config.php if you want to change the values */
/* */
/* Make sure all paths are absolute by using __DIR__ where needed */
/*******************************************************************/
// Data folder (must be writeable by the web server user and absolute) // Data folder (must be writeable by the web server user and absolute)
define('DATA_DIR', __DIR__.DIRECTORY_SEPARATOR.'data'); define('DATA_DIR', __DIR__.DIRECTORY_SEPARATOR.'data');
// Enable/Disable debug // Enable/Disable debug
define('DEBUG', false); define('DEBUG', false);
// Available log drivers: syslog, stderr, stdout or file // Available log drivers: syslog, stderr, stdout, system or file
define('LOG_DRIVER', ''); define('LOG_DRIVER', 'system');
// Log filename if the log driver is "file" // Log filename if the log driver is "file"
define('LOG_FILE', DATA_DIR.DIRECTORY_SEPARATOR.'debug.log'); define('LOG_FILE', DATA_DIR.DIRECTORY_SEPARATOR.'debug.log');
// Plugins directory // Plugins directory
define('PLUGINS_DIR', 'plugins'); define('PLUGINS_DIR', __DIR__.DIRECTORY_SEPARATOR.'plugins');
// Plugins directory URL // Plugins directory URL
define('PLUGIN_API_URL', 'https://kanboard.net/plugins.json'); define('PLUGIN_API_URL', 'https://kanboard.org/plugins.json');
// Enable/Disable plugin installer // Enable/Disable plugin installer (Disabled by default for security reasons)
// There is no code review or any approval process to submit a plugin.
// This is up to the Kanboard instance owner to validate if a plugin is legit.
define('PLUGIN_INSTALLER', true); define('PLUGIN_INSTALLER', true);
// Available cache drivers are "file" and "memory" // Available cache drivers are "file" and "memory"
@ -33,7 +41,7 @@ define('FILES_DIR', DATA_DIR.DIRECTORY_SEPARATOR.'files');
// Enable/disable email configuration from the user interface // Enable/disable email configuration from the user interface
define('MAIL_CONFIGURATION', true); define('MAIL_CONFIGURATION', true);
// E-mail address for the "From" header (notifications) // E-mail address used for the "From" header (notifications)
define('MAIL_FROM', '__EMAIL__'); define('MAIL_FROM', '__EMAIL__');
// E-mail address used for the "Bcc" header to send a copy of all notifications // E-mail address used for the "Bcc" header to send a copy of all notifications
@ -43,7 +51,7 @@ define('MAIL_BCC', '');
define('MAIL_TRANSPORT', 'mail'); define('MAIL_TRANSPORT', 'mail');
// SMTP configuration to use when the "smtp" transport is chosen // SMTP configuration to use when the "smtp" transport is chosen
define('MAIL_SMTP_HOSTNAME', ''); define('MAIL_SMTP_HOSTNAME', 'localhost');
define('MAIL_SMTP_PORT', 25); define('MAIL_SMTP_PORT', 25);
define('MAIL_SMTP_USERNAME', ''); define('MAIL_SMTP_USERNAME', '');
define('MAIL_SMTP_PASSWORD', ''); define('MAIL_SMTP_PASSWORD', '');
@ -61,7 +69,7 @@ define('DB_RUN_MIGRATIONS', false);
define('DB_DRIVER', 'mysql'); define('DB_DRIVER', 'mysql');
// Mysql/Postgres username // Mysql/Postgres username
define('DB_USERNAME', '__DB_NAME__'); define('DB_USERNAME', '__DB_USER__');
// Mysql/Postgres password // Mysql/Postgres password
define('DB_PASSWORD', '__DB_PWD__'); define('DB_PASSWORD', '__DB_PWD__');
@ -84,14 +92,17 @@ define('DB_SSL_CERT', null);
// Mysql SSL CA // Mysql SSL CA
define('DB_SSL_CA', null); define('DB_SSL_CA', null);
// Mysql SSL server verification, set to false if you don't want the Mysql driver to validate the certificate CN
define('DB_VERIFY_SERVER_CERT', null);
// Timeout value for PDO attribute
define('DB_TIMEOUT', null);
// Enable LDAP authentication (false by default) // Enable LDAP authentication (false by default)
define('LDAP_AUTH', false); define('LDAP_AUTH', false);
// LDAP server hostname // LDAP server protocol, hostname and port URL (ldap[s]://hostname:port)
define('LDAP_SERVER', 'localhost'); define('LDAP_SERVER', 'ldap://127.0.0.1:389');
// LDAP server port (389 by default)
define('LDAP_PORT', 389);
// By default, require certificate to be verified for ldaps:// style URL. Set to false to skip the verification // By default, require certificate to be verified for ldaps:// style URL. Set to false to skip the verification
define('LDAP_SSL_VERIFY', true); define('LDAP_SSL_VERIFY', true);
@ -146,9 +157,13 @@ define('LDAP_USER_ATTRIBUTE_PHOTO', '');
// Put an empty string to disable language sync // Put an empty string to disable language sync
define('LDAP_USER_ATTRIBUTE_LANGUAGE', ''); define('LDAP_USER_ATTRIBUTE_LANGUAGE', '');
// Allow automatic LDAP user creation // Automatically create a user profile when a user authenticates via LDAP.
// If set to false, only LDAP users can log in for whom a Kanboard profile already exists.
define('LDAP_USER_CREATION', true); define('LDAP_USER_CREATION', true);
// Set new user as Manager
define('LDAP_USER_DEFAULT_ROLE_MANAGER', false);
// LDAP DN for administrators // LDAP DN for administrators
// Example: CN=Kanboard-Admins,CN=Users,DC=kanboard,DC=local // Example: CN=Kanboard-Admins,CN=Users,DC=kanboard,DC=local
define('LDAP_GROUP_ADMIN_DN', ''); define('LDAP_GROUP_ADMIN_DN', '');
@ -173,9 +188,16 @@ define('LDAP_GROUP_FILTER', '');
// Example for OpenLDAP: (&(objectClass=posixGroup)(memberUid=%s)) // Example for OpenLDAP: (&(objectClass=posixGroup)(memberUid=%s))
define('LDAP_GROUP_USER_FILTER', ''); define('LDAP_GROUP_USER_FILTER', '');
// LDAP attribute for the user in the group filter
// 'username' or 'dn'
define('LDAP_GROUP_USER_ATTRIBUTE', 'username');
// LDAP attribute for the group name // LDAP attribute for the group name
define('LDAP_GROUP_ATTRIBUTE_NAME', 'cn'); define('LDAP_GROUP_ATTRIBUTE_NAME', 'cn');
// Enable/Disable groups synchronization when external authentication is used.
define('LDAP_GROUP_SYNC', true);
// Enable/disable the reverse proxy authentication // Enable/disable the reverse proxy authentication
define('REVERSE_PROXY_AUTH', true); define('REVERSE_PROXY_AUTH', true);
@ -185,6 +207,9 @@ define('REVERSE_PROXY_USER_HEADER', 'REMOTE_USER');
// Username of the admin, by default blank // Username of the admin, by default blank
define('REVERSE_PROXY_DEFAULT_ADMIN', '__ADMIN__'); define('REVERSE_PROXY_DEFAULT_ADMIN', '__ADMIN__');
// Header name to use for the username
define('REVERSE_PROXY_EMAIL_HEADER', 'REMOTE_EMAIL');
// Default domain to use for setting the email address // Default domain to use for setting the email address
define('REVERSE_PROXY_DEFAULT_DOMAIN', '__DOMAIN__'); define('REVERSE_PROXY_DEFAULT_DOMAIN', '__DOMAIN__');
@ -204,7 +229,7 @@ define('MARKDOWN_ESCAPE_HTML', true);
define('API_AUTHENTICATION_HEADER', ''); define('API_AUTHENTICATION_HEADER', '');
// Enable/disable url rewrite // Enable/disable url rewrite
define('ENABLE_URL_REWRITE', false); define('ENABLE_URL_REWRITE', true);
// Hide login form, useful if all your users use Google/Github/ReverseProxy authentication // Hide login form, useful if all your users use Google/Github/ReverseProxy authentication
define('HIDE_LOGIN_FORM', true); define('HIDE_LOGIN_FORM', true);
@ -225,6 +250,9 @@ define('BRUTEFORCE_LOCKDOWN_DURATION', 15);
// See http://php.net/manual/en/session.configuration.php#ini.session.cookie-lifetime // See http://php.net/manual/en/session.configuration.php#ini.session.cookie-lifetime
define('SESSION_DURATION', 0); define('SESSION_DURATION', 0);
// Session handler: db or php
define('SESSION_HANDLER', 'db');
// HTTP client proxy // HTTP client proxy
define('HTTP_PROXY_HOSTNAME', ''); define('HTTP_PROXY_HOSTNAME', '');
define('HTTP_PROXY_PORT', '3128'); define('HTTP_PROXY_PORT', '3128');

2
conf/cron Normal file
View file

@ -0,0 +1,2 @@
# Execute the daily cronjob at 8am
0 8 * * * __APP__ /usr/bin/php__PHPVERSION__ __FINALPATH__/cli cronjob > /dev/null

View file

@ -1,2 +0,0 @@
# Execute the daily cronjob at 8am
0 8 * * * __APP__ cd "__FINALPATH__" && PHP__PHPVERSION__ ./cli cronjob >/dev/null 2>&1

View file

@ -6,7 +6,7 @@ location __PATH__/ {
index index.php; index index.php;
client_max_body_size 50M; client_max_body_size 50M;
try_files $uri $uri/ /index.php?$args; try_files $uri $uri/ __PATH__/index.php;
# Override CSP header to make SSOWAT user panel compatible with kanboard # Override CSP header to make SSOWAT user panel compatible with kanboard
more_set_headers "Content-Security-Policy: default-src 'self' 'unsafe-eval' data:; style-src 'self' 'unsafe-inline'"; more_set_headers "Content-Security-Policy: default-src 'self' 'unsafe-eval' data:; style-src 'self' 'unsafe-inline'";

9
doc/DESCRIPTION.md Normal file
View file

@ -0,0 +1,9 @@
Kanboard is a free and open source Kanban project management software.
### Features
- Visualize your work
- Limit your work in progress to focus on your goal
- Drag and drop tasks to manage your project
- Self-hosted
- Super simple installation

8
doc/DESCRIPTION_fr.md Normal file
View file

@ -0,0 +1,8 @@
Kanboard est un logiciel de gestion de projet Kanban gratuit et open source.
### Fonctionnalités
- Visualisez votre travail
- Limitez votre travail en cours pour vous concentrer sur votre objectif
- Glisser et déposez des tâches pour gérer votre projet
- Auto-hébergé

View file

@ -34,7 +34,7 @@
"multi_instance": true, "multi_instance": true,
"services": [ "services": [
"nginx", "nginx",
"php7.4-fpm", "php8.0-fpm",
"mysql" "mysql"
], ],
"arguments": { "arguments": {

View file

@ -4,9 +4,9 @@
# COMMON VARIABLES # COMMON VARIABLES
#================================================= #=================================================
YNH_PHP_VERSION="7.4" YNH_PHP_VERSION="8.0"
pkg_dependencies="php${YNH_PHP_VERSION}-cli php${YNH_PHP_VERSION}-opcache php${YNH_PHP_VERSION}-curl php${YNH_PHP_VERSION}-json php${YNH_PHP_VERSION}-gd php${YNH_PHP_VERSION}-zip php${YNH_PHP_VERSION}-xml php${YNH_PHP_VERSION}-mbstring php${YNH_PHP_VERSION}-mysql" pkg_dependencies="php${YNH_PHP_VERSION}-fpm php${YNH_PHP_VERSION}-opcache php${YNH_PHP_VERSION}-curl php${YNH_PHP_VERSION}-gd php${YNH_PHP_VERSION}-zip php${YNH_PHP_VERSION}-xml php${YNH_PHP_VERSION}-mbstring php${YNH_PHP_VERSION}-mysql php${YNH_PHP_VERSION}-ldap"
#================================================= #=================================================
# PERSONAL HELPERS # PERSONAL HELPERS

View file

@ -74,4 +74,4 @@ ynh_mysql_dump_db --database="$db_name" > db.sql
# END OF SCRIPT # END OF SCRIPT
#================================================= #=================================================
ynh_print_info --message="Backup script completed for Kanboard. (YunoHost will then actually copy those files to the archive)." ynh_print_info --message="Backup script completed for $app. (YunoHost will then actually copy those files to the archive)."

View file

@ -127,4 +127,4 @@ ynh_systemd_action --service_name=nginx --action=reload
# END OF SCRIPT # END OF SCRIPT
#================================================= #=================================================
ynh_script_progression --message="Change of URL completed for Kanboard" --last ynh_script_progression --message="Change of URL completed for $app" --last

View file

@ -13,6 +13,11 @@ source /usr/share/yunohost/helpers
# MANAGE SCRIPT FAILURE # MANAGE SCRIPT FAILURE
#================================================= #=================================================
ynh_clean_setup () {
### Remove this function if there's nothing to clean before calling the remove script.
true
}
# Exit if an error occurs during the execution of the script
ynh_abort_if_errors ynh_abort_if_errors
#================================================= #=================================================
@ -21,8 +26,8 @@ ynh_abort_if_errors
domain=$YNH_APP_ARG_DOMAIN domain=$YNH_APP_ARG_DOMAIN
path_url=$YNH_APP_ARG_PATH path_url=$YNH_APP_ARG_PATH
admin=$YNH_APP_ARG_ADMIN
is_public=$YNH_APP_ARG_IS_PUBLIC is_public=$YNH_APP_ARG_IS_PUBLIC
admin=$YNH_APP_ARG_ADMIN
email=$(ynh_user_get_info --username=$admin --key=mail) email=$(ynh_user_get_info --username=$admin --key=mail)
phpversion=$YNH_PHP_VERSION phpversion=$YNH_PHP_VERSION
@ -31,7 +36,7 @@ app=$YNH_APP_INSTANCE_NAME
#================================================= #=================================================
# CHECK IF THE APP CAN BE INSTALLED WITH THESE ARGS # CHECK IF THE APP CAN BE INSTALLED WITH THESE ARGS
#================================================= #=================================================
ynh_script_progression --message="Validating installation parameters..." ynh_script_progression --message="Validating installation parameters..." --weight=1
# Check destination directory # Check destination directory
final_path=/var/www/$app final_path=/var/www/$app
@ -43,10 +48,10 @@ ynh_webpath_register --app=$app --domain=$domain --path_url=$path_url
#================================================= #=================================================
# STORE SETTINGS FROM MANIFEST # STORE SETTINGS FROM MANIFEST
#================================================= #=================================================
ynh_script_progression --message="Storing installation settings..." ynh_script_progression --message="Storing installation settings..." --weight=1
ynh_app_setting_set --app=$app --key=domain --value=$domain ynh_app_setting_set --app=$app --key=domain --value=$domain
ynh_app_setting_set --app=$app --key=adminusername --value=$admin ynh_app_setting_set --app=$app --key=admin --value=$admin
#================================================= #=================================================
# INSTALL DEPENDENCIES # INSTALL DEPENDENCIES
@ -92,14 +97,6 @@ chmod -R 700 $final_path/sessions
chmod -R o-rwx "$final_path" chmod -R o-rwx "$final_path"
chown -R $app:www-data "$final_path" chown -R $app:www-data "$final_path"
#=================================================
# NGINX CONFIGURATION
#=================================================
ynh_script_progression --message="Configuring NGINX web server..." --weight=2
# Create a dedicated nginx config
ynh_add_nginx_config
#================================================= #=================================================
# PHP-FPM CONFIGURATION # PHP-FPM CONFIGURATION
#================================================= #=================================================
@ -109,12 +106,20 @@ ynh_script_progression --message="Configuring PHP-FPM..." --weight=16
ynh_add_fpm_config ynh_add_fpm_config
phpversion=$(ynh_app_setting_get --app=$app --key=phpversion) phpversion=$(ynh_app_setting_get --app=$app --key=phpversion)
#=================================================
# NGINX CONFIGURATION
#=================================================
ynh_script_progression --message="Configuring NGINX web server..." --weight=2
# Create a dedicated nginx config
ynh_add_nginx_config
#================================================= #=================================================
# SPECIFIC SETUP # SPECIFIC SETUP
#================================================= #=================================================
# CREATE CONFIG.PHP # CREATE CONFIG.PHP
#================================================= #=================================================
ynh_script_progression --message="Configuring Kanboard..." ynh_script_progression --message="Configuring the app..."
dir="__DIR__" dir="__DIR__"
ynh_add_config --template="../conf/config.php" --destination="$final_path/config.php" ynh_add_config --template="../conf/config.php" --destination="$final_path/config.php"
@ -127,7 +132,7 @@ chown $app "$final_path/config.php"
#================================================= #=================================================
ynh_script_progression --message="Initializing database..." --weight=7 ynh_script_progression --message="Initializing database..." --weight=7
ynh_mysql_connect_as --user="$db_name" --password="$db_pwd" --database="$db_name" < "${final_path}/app/Schema/Sql/mysql.sql" ynh_mysql_connect_as --user="$db_user" --password="$db_pwd" --database="$db_name" < "$final_path/app/Schema/Sql/mysql.sql"
pushd $final_path pushd $final_path
# Launch database migration # Launch database migration
@ -146,23 +151,23 @@ ynh_add_fail2ban_config --logpath="/var/log/nginx/$domain-error.log" --failregex
#================================================= #=================================================
ynh_script_progression --message="Setuping a cron..." --weight=1 ynh_script_progression --message="Setuping a cron..." --weight=1
ynh_add_config --template="../conf/cron_kanboard" --destination="/etc/cron.d/$app" ynh_add_config --template="../conf/cron" --destination="/etc/cron.d/$app"
chown root: "/etc/cron.d/$app"
chmod 644 "/etc/cron.d/$app" chmod 644 "/etc/cron.d/$app"
#================================================= #=================================================
# SETUP SSOWAT # SETUP SSOWAT
#================================================= #=================================================
ynh_script_progression --message="Configuring SSOwat..." --weight=2 ynh_script_progression --message="Configuring permissions..." --weight=2
# Make app public or private # Make app public or private
if [ $is_public -eq 1 ] if [ $is_public -eq 1 ]
then then
ynh_permission_update --permission="main" --add="visitors" ynh_permission_update --permission="main" --add="visitors"
ynh_replace_string --match_string="define('LDAP_AUTH'.*$" --replace_string="define('LDAP_AUTH', true);" --target_file="$final_path/config.php" ynh_replace_string --match_string="define('LDAP_AUTH'.*$" --replace_string="define('LDAP_AUTH', true);" --target_file="$final_path/config.php"
ynh_replace_string --match_string="define('HIDE_LOGIN_FORM'.*$" --replace_string="define('HIDE_LOGIN_FORM', false);" --target_file="$final_path/config.php" ynh_replace_string --match_string="define('HIDE_LOGIN_FORM'.*$" --replace_string="define('HIDE_LOGIN_FORM', false);" --target_file="$final_path/config.php"
ynh_replace_string --match_string="define('REMEMBER_ME_AUTH'.*$" --replace_string="define('REMEMBER_ME_AUTH', true);" --target_file="$final_path/config.php" ynh_replace_string --match_string="define('REMEMBER_ME_AUTH'.*$" --replace_string="define('REMEMBER_ME_AUTH', true);" --target_file="$final_path/config.php"
ynh_replace_string --match_string="define('DISABLE_LOGOUT'.*$" --replace_string="define('DISABLE_LOGOUT', false);" --target_file="$final_path/config.php" ynh_replace_string --match_string="define('DISABLE_LOGOUT'.*$" --replace_string="define('DISABLE_LOGOUT', false);" --target_file="$final_path/config.php"
else else
ynh_app_setting_set --app=$app --key=unprotected_uris --value="/jsonrpc.php" ynh_app_setting_set --app=$app --key=unprotected_uris --value="/jsonrpc.php"
fi fi
@ -183,4 +188,4 @@ ynh_systemd_action --service_name=nginx --action=reload
# END OF SCRIPT # END OF SCRIPT
#================================================= #=================================================
ynh_script_progression --message="Installation of Kanboard completed" --last ynh_script_progression --message="Installation of $app completed" --last

View file

@ -42,7 +42,7 @@ ynh_mysql_remove_db --db_user=$db_user --db_name=$db_name
#================================================= #=================================================
# REMOVE APP MAIN DIR # REMOVE APP MAIN DIR
#================================================= #=================================================
ynh_script_progression --message="Removing Kanboard main directory..." ynh_script_progression --message="Removing the app main directory..."
# Remove the app directory securely # Remove the app directory securely
ynh_secure_remove --file="$final_path" ynh_secure_remove --file="$final_path"
@ -100,4 +100,4 @@ ynh_system_user_delete --username=$app
# END OF SCRIPT # END OF SCRIPT
#================================================= #=================================================
ynh_script_progression --message="Removal of Kanboard completed" --last ynh_script_progression --message="Removal of $app completed" --last

View file

@ -34,16 +34,11 @@ phpversion=$(ynh_app_setting_get --app=$app --key=phpversion)
#================================================= #=================================================
ynh_script_progression --message="Validating restoration parameters..." --weight=2 ynh_script_progression --message="Validating restoration parameters..." --weight=2
test ! -d $final_path || ynh_die --message="There is already a directory: $final_path " test ! -d $final_path \
|| ynh_die --message="There is already a directory: $final_path "
#================================================= #=================================================
# STANDARD RESTORATION STEPS # STANDARD RESTORATION STEPS
#=================================================
# RESTORE THE NGINX CONFIGURATION
#=================================================
ynh_restore_file --origin_path="/etc/nginx/conf.d/$domain.d/$app.conf"
#================================================= #=================================================
# RECREATE THE DEDICATED USER # RECREATE THE DEDICATED USER
#================================================= #=================================================
@ -55,7 +50,7 @@ ynh_system_user_create --username=$app --home_dir="$final_path"
#================================================= #=================================================
# RESTORE THE APP MAIN DIR # RESTORE THE APP MAIN DIR
#================================================= #=================================================
ynh_script_progression --message="Restoring Kanboard main directory..." --weight=5 ynh_script_progression --message="Restoring the app main directory..." --weight=5
ynh_restore_file --origin_path="$final_path" ynh_restore_file --origin_path="$final_path"
@ -67,13 +62,16 @@ chown -R $app $final_path/{data,plugins,sessions}
#================================================= #=================================================
# RESTORE THE PHP-FPM CONFIGURATION # RESTORE THE PHP-FPM CONFIGURATION
#================================================= #=================================================
ynh_script_progression --message="Reconfiguring PHP-FPM..." --weight=6 ynh_script_progression --message="Restoring the PHP-FPM configuration..." --weight=5
# Restore the file first, so it can have a backup if different
ynh_restore_file --origin_path="/etc/php/$phpversion/fpm/pool.d/$app.conf" ynh_restore_file --origin_path="/etc/php/$phpversion/fpm/pool.d/$app.conf"
# Recreate a dedicated PHP-FPM config #=================================================
ynh_add_fpm_config # RESTORE THE NGINX CONFIGURATION
#=================================================
ynh_script_progression --message="Restoring the NGINX web server configuration..." --weight=1
ynh_restore_file --origin_path="/etc/nginx/conf.d/$domain.d/$app.conf"
#================================================= #=================================================
# SPECIFIC RESTORATION # SPECIFIC RESTORATION
@ -109,6 +107,7 @@ ynh_install_app_dependencies $pkg_dependencies
ynh_script_progression --message="Restoring the cron file..." --weight=2 ynh_script_progression --message="Restoring the cron file..." --weight=2
ynh_restore_file --origin_path="/etc/cron.d/$app" ynh_restore_file --origin_path="/etc/cron.d/$app"
chown root: "/etc/cron.d/$app"
chmod 644 "/etc/cron.d/$app" chmod 644 "/etc/cron.d/$app"
#================================================= #=================================================
@ -125,4 +124,4 @@ ynh_systemd_action --service_name=nginx --action=reload
# END OF SCRIPT # END OF SCRIPT
#================================================= #=================================================
ynh_script_progression --message="Restoration completed for Kanboard" --last ynh_script_progression --message="Restoration completed for $app" --last

View file

@ -18,14 +18,10 @@ app=$YNH_APP_INSTANCE_NAME
domain=$(ynh_app_setting_get --app=$app --key=domain) domain=$(ynh_app_setting_get --app=$app --key=domain)
path_url=$(ynh_app_setting_get --app=$app --key=path) path_url=$(ynh_app_setting_get --app=$app --key=path)
admin=$(ynh_app_setting_get --app=$app --key=adminusername) admin=$(ynh_app_setting_get --app=$app --key=admin)
is_public=$(ynh_app_setting_get --app=$app --key=is_public)
final_path=$(ynh_app_setting_get --app=$app --key=final_path) final_path=$(ynh_app_setting_get --app=$app --key=final_path)
db_name=$(ynh_app_setting_get --app=$app --key=db_name) db_name=$(ynh_app_setting_get --app=$app --key=db_name)
db_user=$db_name
db_pwd=$(ynh_app_setting_get --app=$app --key=mysqlpwd)
phpversion=$YNH_PHP_VERSION phpversion=$YNH_PHP_VERSION
email=$(ynh_user_get_info --username=$admin --key=mail)
#================================================= #=================================================
# CHECK VERSION # CHECK VERSION
@ -36,7 +32,7 @@ upgrade_type=$(ynh_check_app_version_changed)
#================================================= #=================================================
# BACKUP BEFORE UPGRADE THEN ACTIVE TRAP # BACKUP BEFORE UPGRADE THEN ACTIVE TRAP
#================================================= #=================================================
ynh_script_progression --message="Backing up Kanboard before upgrading (may take a while)..." --weight=5 ynh_script_progression --message="Backing up the app before upgrading (may take a while)..." --weight=5
# Backup the current version of the app # Backup the current version of the app
ynh_backup_before_upgrade ynh_backup_before_upgrade
@ -95,7 +91,7 @@ then
ynh_script_progression --message="Upgrading source files..." --weight=3 ynh_script_progression --message="Upgrading source files..." --weight=3
# Download, check integrity, uncompress and patch the source from app.src # Download, check integrity, uncompress and patch the source from app.src
ynh_setup_source --dest_dir="$final_path" --keep="$final_path/config.php" ynh_setup_source --dest_dir="$final_path" --keep="$final_path/data $final_path/config.php"
fi fi
mkdir -p $final_path/sessions/ mkdir -p $final_path/sessions/
@ -106,13 +102,6 @@ chmod -R 700 $final_path/sessions
chmod -R o-rwx "$final_path" chmod -R o-rwx "$final_path"
chown -R $app:www-data "$final_path" chown -R $app:www-data "$final_path"
#=================================================
# NGINX CONFIGURATION
#=================================================
ynh_script_progression --message="Upgrading NGINX web server configuration..." --weight=2
# Create a dedicated NGINX config
ynh_add_nginx_config
#================================================= #=================================================
# UPGRADE DEPENDENCIES # UPGRADE DEPENDENCIES
@ -129,10 +118,18 @@ ynh_script_progression --message="Upgrading PHP-FPM configuration..." --weight=5
# Create a dedicated PHP-FPM config # Create a dedicated PHP-FPM config
ynh_add_fpm_config ynh_add_fpm_config
#=================================================
# NGINX CONFIGURATION
#=================================================
ynh_script_progression --message="Upgrading NGINX web server configuration..." --weight=2
# Create a dedicated NGINX config
ynh_add_nginx_config
#================================================= #=================================================
# UPGRADE KANBOARD # UPGRADE KANBOARD
#================================================= #=================================================
ynh_script_progression --message="Upgrading Kanboard..." --weight=2 ynh_script_progression --message="Upgrading the app..." --weight=2
pushd $final_path pushd $final_path
# Launch database migration # Launch database migration
@ -151,29 +148,12 @@ ynh_add_fail2ban_config --logpath="/var/log/nginx/$domain-error.log" --failregex
#================================================= #=================================================
# SETUP CRON # SETUP CRON
#================================================= #=================================================
ynh_script_progression --message="Setuping a cron..." ynh_script_progression --message="Setuping a cron..." --weight=2
ynh_add_config --template="../conf/cron_kanboard" --destination="/etc/cron.d/$app"
ynh_add_config --template="../conf/cron" --destination="/etc/cron.d/$app"
chown root: "/etc/cron.d/$app"
chmod 644 "/etc/cron.d/$app" chmod 644 "/etc/cron.d/$app"
#=================================================
# SETUP SSOWAT
#=================================================
ynh_script_progression --message="Upgrading SSOwat configuration..." --weight=2
# Make app public or private
if [ $is_public -eq 1 ]
then
ynh_permission_update --permission="main" --add="visitors"
ynh_replace_string --match_string="define('LDAP_AUTH'.*$" --replace_string="define('LDAP_AUTH', true);" --target_file="$final_path/config.php"
ynh_replace_string --match_string="define('HIDE_LOGIN_FORM'.*$" --replace_string="define('HIDE_LOGIN_FORM', false);" --target_file="$final_path/config.php"
ynh_replace_string --match_string="define('REMEMBER_ME_AUTH'.*$" --replace_string="define('REMEMBER_ME_AUTH', true);" --target_file="$final_path/config.php"
ynh_replace_string --match_string="define('DISABLE_LOGOUT'.*$" --replace_string="define('DISABLE_LOGOUT', false);" --target_file="$final_path/config.php"
else
ynh_app_setting_set --app=$app --key=unprotected_uris --value="/jsonrpc.php"
fi
#================================================= #=================================================
# RELOAD NGINX # RELOAD NGINX
#================================================= #=================================================
@ -185,4 +165,4 @@ ynh_systemd_action --service_name=nginx --action=reload
# END OF SCRIPT # END OF SCRIPT
#================================================= #=================================================
ynh_script_progression --message="Installation of Kanboard completed" --last ynh_script_progression --message="Installation of $app completed" --last