diff --git a/conf/config.php b/conf/config.php index 8884745..7ae3929 100644 --- a/conf/config.php +++ b/conf/config.php @@ -244,4 +244,4 @@ define('SHOW_GROUP_MEMBERSHIPS_IN_USERLIST', true); // Limit number of groups to display in userlist (The full list of group-memberships is always shown, ... // ... when hovering the mouse over the group-icon of a given user!) // If set to 0 ALL group-memberships will be listed (7 by default) -define('SHOW_GROUP_MEMBERSHIPS_IN_USERLIST_WITH_LIMIT', 7); \ No newline at end of file +define('SHOW_GROUP_MEMBERSHIPS_IN_USERLIST_WITH_LIMIT', 7); diff --git a/conf/cron_kanboard b/conf/cron_kanboard new file mode 100644 index 0000000..eb9679c --- /dev/null +++ b/conf/cron_kanboard @@ -0,0 +1,2 @@ +# Execute the daily cronjob at 8am +0 8 * * * __APP__ cd "__FINALPATH__" && PHP__PHPVERSION__ ./cli cronjob >/dev/null 2>&1 \ No newline at end of file diff --git a/conf/nginx.conf b/conf/nginx.conf index 3af1432..9caee66 100644 --- a/conf/nginx.conf +++ b/conf/nginx.conf @@ -16,6 +16,11 @@ location __PATH__/ { # Override CSP header to make SSOWAT user panel compatible with kanboard more_set_headers Content-Security-Policy "default-src 'self' 'unsafe-eval' data:;"; + # Deny access to the directory data + location __PATH__/data { + deny all; + } + location ~ [^/]\.php(/|$) { fastcgi_split_path_info ^(.+?\.php)(/.*)$; fastcgi_pass unix:/var/run/php/php__PHPVERSION__-fpm-__NAME__.sock; diff --git a/manifest.json b/manifest.json index c24b521..cd8d2c6 100644 --- a/manifest.json +++ b/manifest.json @@ -8,7 +8,7 @@ }, "version": "1.2.16~ynh1", "url": "https://kanboard.net/", - "license": "AGPL-3.0", + "license": "MIT", "maintainer": { "name": "YunoHost Contributors", "email": "apps@yunohost.org" diff --git a/scripts/backup b/scripts/backup index b346135..4ddf7a7 100644 --- a/scripts/backup +++ b/scripts/backup @@ -57,6 +57,12 @@ ynh_backup --src_path="/etc/php/$phpversion/fpm/pool.d/$app.conf" ynh_backup --src_path="/etc/fail2ban/jail.d/$app.conf" ynh_backup --src_path="/etc/fail2ban/filter.d/$app.conf" +#================================================= +# BACKUP A CRON FILE +#================================================= + +ynh_backup --src_path="/etc/cron.d/$app" + #================================================= # BACKUP THE MYSQL DATABASE #================================================= diff --git a/scripts/install b/scripts/install index 183b30f..682dd0c 100644 --- a/scripts/install +++ b/scripts/install @@ -49,8 +49,6 @@ ynh_app_setting_set --app=$app --key=is_public --value=$is_public #================================================= # STANDARD MODIFICATIONS -#================================================= - #================================================= # CREATE A MYSQL DATABASE #================================================ @@ -146,6 +144,16 @@ ynh_script_progression --message="Configuring Fail2Ban..." --weight=10 ynh_add_fail2ban_config --logpath="/var/log/nginx/$domain-error.log" --failregex="^.*authentication failure\" while reading response header from upstream, client: ,.*$" --max_retry=5 +#================================================= +# SETUP CRON +#================================================= +ynh_script_progression --message="Setuping a cron..." + +cp ../conf/cron_kanboard /etc/cron.d/$app +ynh_replace_string --match_string="__FINALPATH__" --replace_string="$final_path/" --target_file="/etc/cron.d/$app" +ynh_replace_string --match_string="__APP__" --replace_string="$app" --target_file="/etc/cron.d/$app" +ynh_replace_string --match_string="__PHPVERSION__" --replace_string="$phpversion" --target_file="/etc/cron.d/$app" + #================================================= # SETUP SSOWAT #================================================= diff --git a/scripts/remove b/scripts/remove index c631c86..80922e1 100644 --- a/scripts/remove +++ b/scripts/remove @@ -71,6 +71,14 @@ ynh_script_progression --message="Removing Fail2Ban configuration..." --weight=7 ynh_remove_fail2ban_config +#================================================= +# REMOVE THE CRON FILE +#================================================= +ynh_script_progression --message="Removing the cron file..." --weight=2 + +# Remove a cron file +ynh_secure_remove --file="/etc/cron.d/$app" + #================================================= # REMOVE DEDICATED USER #================================================= diff --git a/scripts/restore b/scripts/restore index d9bbc3c..56c4399 100644 --- a/scripts/restore +++ b/scripts/restore @@ -99,6 +99,13 @@ ynh_restore_file "/etc/fail2ban/jail.d/$app.conf" ynh_restore_file "/etc/fail2ban/filter.d/$app.conf" ynh_systemd_action --action=restart --service_name=fail2ban +#================================================= +# RESTORE THE CRON FILE +#================================================= +ynh_script_progression --message="Restoring the cron file..." --weight=2 + +ynh_restore_file --origin_path="/etc/cron.d/$app" + #================================================= # GENERIC FINALIZATION #================================================= diff --git a/scripts/upgrade b/scripts/upgrade index 5bc3e79..7fbf9e1 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -171,6 +171,16 @@ ynh_script_progression --message="Reconfiguring Fail2Ban..." --weight=7 ynh_add_fail2ban_config --logpath="/var/log/nginx/$domain-error.log" --failregex="^.*authentication failure\" while reading response header from upstream, client: ,.*$" --max_retry=5 +#================================================= +# SETUP CRON +#================================================= +ynh_script_progression --message="Setuping a cron..." + +cp ../conf/cron_kanboard /etc/cron.d/$app +ynh_replace_string --match_string="__FINALPATH__" --replace_string="$final_path/" --target_file="/etc/cron.d/$app" +ynh_replace_string --match_string="__APP__" --replace_string="$app" --target_file="/etc/cron.d/$app" +ynh_replace_string --match_string="__PHPVERSION__" --replace_string="$phpversion" --target_file="/etc/cron.d/$app" + #================================================= # SETUP SSOWAT #=================================================