From 37e8e2b82eb72a8bd36be7971199e56c4e5d7349 Mon Sep 17 00:00:00 2001 From: ljf Date: Sun, 10 Dec 2023 02:02:09 +0100 Subject: [PATCH 01/15] [wip] Best nextcloud configuration parameters --- config_panel.toml | 92 +++++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 89 insertions(+), 3 deletions(-) diff --git a/config_panel.toml b/config_panel.toml index 7598044..8f72fec 100644 --- a/config_panel.toml +++ b/config_panel.toml @@ -3,13 +3,99 @@ version = "1.0" [main] name = "Nextcloud configuration" - [main.maintenance_mode] - name = "Maintenance mode" + [main.mode] + name = "Modes" - [main.maintenance_mode.maintenance_mode] + [main.mode.maintenance_mode] ask = "Enable maintenance mode" type = "boolean" default = "0" + + [main.mode.closed_network_mode] + ask = "Enable closed network mode" + type = "boolean" + default = "0" + help = "Is Nextcloud connected to the Internet or running in a closed network?" + + [main.localization] + name = "Localization" + + [main.localization.default_phone_region] + ask = "Default phone region" + type = "select" + default = "0" + help = "It is required to allow inserting phone numbers in the user profiles starting without the country code (e.g. +49 for Germany)." + + [main.localization.default_timezone] + ask = "Default timezone" + type = "select" + bind = ":__INSTALL_DIR__/config/config.php" + default = "Europe/Paris" + help = "The default timezone parameter is only used when the timezone of the user can’t be determined." + + [main.account] + name = "Account" + + [main.account.lost_password_link] + ask = "Lost password link" + type = "url" + bind = ":__INSTALL_DIR__/config/config.php" + default = "0" + help = "Allow to redirect on a custom form to require a password reset (for example to ask you to reset it from this yunohost webadmin)" + + [main.account.logout_url] + ask = "Logout URL" + type = "url" + bind = ":__INSTALL_DIR__/config/config.php" + help = "Redirect on this URL when a user click on 'Logout' action" + + [main.files] + name = "Files" + + [main.account.trashbin_retention_obligation] + ask = "Trashbin retention" + type = "string" + bind = ":__INSTALL_DIR__/config/config.php" + default = "auto" + help = "If the trash bin app is enabled (default), this setting defines the policy for when files and folders in the trash bin will be permanently deleted." + + [main.account.version_retention_obligation] + ask = "Version retention" + type = "string" + bind = ":__INSTALL_DIR__/config/config.php" + default = "auto" + help = "If the versions app is enabled (default), this setting defines the policy for when versions will be permanently deleted." + + [main.account.enable_previews] + ask = "Enable previews" + type = "boolean" + bind = ":__INSTALL_DIR__/config/config.php" + default = "1" + help = "Info: Previews of photos and text documents could consume a lot of resources." + + [main.apps] + name = "Apps" + + [main.account.auto_update] + ask = "Auto update apps" + type = "boolean" + default = "1" + help = "Automatically update apps each night" + + [main.apps.defaultapp] + ask = "Default app to display" + type = "tags" + bind = ":__INSTALL_DIR__/config/config.php" + default = "dashboard,files" + help = "Set the default app to open on login." + + [main.apps.appsallowlist] + ask = "List of apps installable" + type = "tags" + bind = ":__INSTALL_DIR__/config/config.php" + default = "all" + help = "Filters allowed installable apps from the appstore." + [main.php_fpm_config] name = "PHP-FPM configuration" From 40355e522b0c1729214fd9fabf54fadd08515e1a Mon Sep 17 00:00:00 2001 From: ljf Date: Sun, 10 Dec 2023 23:10:07 +0100 Subject: [PATCH 02/15] [enh] Config panel with useful parameters --- conf/config.json | 9 +++++++++ config_panel.toml | 33 ++++++++++----------------------- scripts/config | 43 ++++++++++++++----------------------------- scripts/install | 13 ++++++++++++- 4 files changed, 45 insertions(+), 53 deletions(-) diff --git a/conf/config.json b/conf/config.json index 1cd7f95..297d3d0 100644 --- a/conf/config.json +++ b/conf/config.json @@ -1,5 +1,6 @@ { "system": { + "maintenance": false, "updatechecker": false, "memcache.local": "\\OC\\Memcache\\APCu", "integrity.check.disabled": true, @@ -12,6 +13,14 @@ "password": "" }, "hashing_default_password": true, + "has_internet_connection": true, + "default_phone_region": "", + "default_timezone": "Europe/Paris", + "trashbin_retention_obligation": "auto", + "version_retention_obligation": "auto", + "enable_previews": true, + "defaultapp": "dashboard,files", + "lost_password_link": "", "localstorage.allowsymlinks": true, "simpleSignUpLink.shown": false, "mail_smtpmode": "smtp", diff --git a/config_panel.toml b/config_panel.toml index 8f72fec..5e3ade8 100644 --- a/config_panel.toml +++ b/config_panel.toml @@ -2,19 +2,20 @@ version = "1.0" [main] name = "Nextcloud configuration" +services = ["php8.2-fpm"] [main.mode] name = "Modes" - [main.mode.maintenance_mode] + [main.mode.maintenance] ask = "Enable maintenance mode" type = "boolean" - default = "0" + bind = ":__INSTALL_DIR__/config/config.php" - [main.mode.closed_network_mode] + [main.mode.has_internet_connection] ask = "Enable closed network mode" type = "boolean" - default = "0" + bind = ":__INSTALL_DIR__/config/config.php" help = "Is Nextcloud connected to the Internet or running in a closed network?" [main.localization] @@ -23,14 +24,13 @@ name = "Nextcloud configuration" [main.localization.default_phone_region] ask = "Default phone region" type = "select" - default = "0" + bind = ":__INSTALL_DIR__/config/config.php" help = "It is required to allow inserting phone numbers in the user profiles starting without the country code (e.g. +49 for Germany)." [main.localization.default_timezone] ask = "Default timezone" type = "select" bind = ":__INSTALL_DIR__/config/config.php" - default = "Europe/Paris" help = "The default timezone parameter is only used when the timezone of the user can’t be determined." [main.account] @@ -40,7 +40,6 @@ name = "Nextcloud configuration" ask = "Lost password link" type = "url" bind = ":__INSTALL_DIR__/config/config.php" - default = "0" help = "Allow to redirect on a custom form to require a password reset (for example to ask you to reset it from this yunohost webadmin)" [main.account.logout_url] @@ -52,50 +51,38 @@ name = "Nextcloud configuration" [main.files] name = "Files" - [main.account.trashbin_retention_obligation] + [main.files.trashbin_retention_obligation] ask = "Trashbin retention" type = "string" bind = ":__INSTALL_DIR__/config/config.php" - default = "auto" help = "If the trash bin app is enabled (default), this setting defines the policy for when files and folders in the trash bin will be permanently deleted." - [main.account.version_retention_obligation] + [main.files.version_retention_obligation] ask = "Version retention" type = "string" bind = ":__INSTALL_DIR__/config/config.php" - default = "auto" help = "If the versions app is enabled (default), this setting defines the policy for when versions will be permanently deleted." - [main.account.enable_previews] + [main.files.enable_previews] ask = "Enable previews" type = "boolean" bind = ":__INSTALL_DIR__/config/config.php" - default = "1" help = "Info: Previews of photos and text documents could consume a lot of resources." [main.apps] name = "Apps" - [main.account.auto_update] + [main.apps.auto_update] ask = "Auto update apps" type = "boolean" - default = "1" help = "Automatically update apps each night" [main.apps.defaultapp] ask = "Default app to display" type = "tags" bind = ":__INSTALL_DIR__/config/config.php" - default = "dashboard,files" help = "Set the default app to open on login." - [main.apps.appsallowlist] - ask = "List of apps installable" - type = "tags" - bind = ":__INSTALL_DIR__/config/config.php" - default = "all" - help = "Filters allowed installable apps from the appstore." - [main.php_fpm_config] name = "PHP-FPM configuration" diff --git a/scripts/config b/scripts/config index 5a7a2ac..f7a56c4 100644 --- a/scripts/config +++ b/scripts/config @@ -21,21 +21,21 @@ current_fpm_footprint=$(ynh_app_setting_get --app=$app --key=fpm_footprint) #================================================= # SPECIFIC GETTERS FOR TOML SHORT KEY #================================================= +get__default_phone_region() { + cat << EOF +value: "$(ynh_read_var_in_file --file="$install_dir/config/config.php" --key="default_phone_region")" +choices: +EOF + jq '.[][] | " \"\(.alpha_2)\": \"\(.name)\""' -r /usr/share/iso-codes/json/iso_3166-1.json -get__maintenance_mode() { - # Maintenance mode status - maintenance_mode_status="$(cd "$install_dir" && ynh_exec_as "$app" \ - php${phpversion} --define apc.enable_cli=1 occ --no-interaction --no-ansi maintenance:mode)" 2> /dev/null - if echo $maintenance_mode_status | grep -q "disabled" - then - echo "0" - elif echo $maintenance_mode_status | grep -q "enabled" - then - echo "1" - else - ynh_print_err --message="Unexpected output from maintenance status check command." - exit 0 - fi +} + +get__default_timezone() { + cat << EOF +value: "$(ynh_read_var_in_file --file="$install_dir/config/config.php" --key="default_timezone")" +choices: +EOF + timedatectl list-timezones --no-pager | sed 's/^/ - /g' } get__fpm_footprint() { @@ -65,21 +65,6 @@ get__free_footprint() { # SPECIFIC SETTERS FOR TOML SHORT KEYS #================================================= -set__maintenance_mode() { - if [ "$maintenance_mode" -eq "0" ]; then - # If maintenance_mode was set to 0, disable maintenance mode - (cd "$install_dir" && ynh_exec_as "$app" \ - php${phpversion} --define apc.enable_cli=1 occ --no-interaction --no-ansi maintenance:mode --off) - ynh_print_info "Maintenance mode disabled" - elif [ "$maintenance_mode" -eq "1" ]; then - # If maintenance_mode was set to 1, enable maintenance mode - (cd "$install_dir" && ynh_exec_as "$app" \ - php${phpversion} --define apc.enable_cli=1 occ --no-interaction --no-ansi maintenance:mode --on) - ynh_print_info "Maintenance mode enabled" - fi - ynh_app_setting_set --app=$app --key=maintenance_mode --value="$maintenance_mode" -} - set__fpm_footprint() { if [ "$fpm_footprint" != "specific" ] then diff --git a/scripts/install b/scripts/install index a169962..e8c8831 100755 --- a/scripts/install +++ b/scripts/install @@ -24,12 +24,23 @@ phpflags="--define apc.enable_cli=1" # STORE SETTINGS FROM MANIFEST #================================================= -ynh_app_setting_set --app=$app --key=maintenance_mode --value=$maintenance_mode +ynh_app_setting_set --app=$app --key=maintenance --value=$maintenance_mode ynh_app_setting_set --app=$app --key=fpm_footprint --value=$fpm_footprint ynh_app_setting_set --app=$app --key=fpm_free_footprint --value=$fpm_free_footprint ynh_app_setting_set --app=$app --key=fpm_usage --value=$fpm_usage ynh_app_setting_set --app=$app --key=phpflags --value=$phpflags +ynh_app_setting_set --app=$app --key=has_internet_connection --value=1 +ynh_app_setting_set --app=$app --key=default_phone_region --value="" +ynh_app_setting_set --app=$app --key=default_timezone --value="Europe/Paris" +ynh_app_setting_set --app=$app --key=lost_password_link --value="" +ynh_app_setting_set --app=$app --key=logout_url --value="" +ynh_app_setting_set --app=$app --key=trashbin_retention_obligation --value="auto" +ynh_app_setting_set --app=$app --key=version_retention_obligation --value="auto" +ynh_app_setting_set --app=$app --key=enable_previews --value=1 +ynh_app_setting_set --app=$app --key=auto_update --value=1 +ynh_app_setting_set --app=$app --key=defaultapp --value="dashboard,files" + #================================================= # CREATE A MYSQL DATABASE #================================================= From 2ea70c58506e69787a31e90dcc7cb6ce0ed677f0 Mon Sep 17 00:00:00 2001 From: ljf Date: Mon, 11 Dec 2023 00:48:23 +0100 Subject: [PATCH 03/15] [wip] Auto upgrade apps --- config_panel.toml | 12 ++++++++---- scripts/config | 13 +++++++++++++ scripts/install | 2 +- 3 files changed, 22 insertions(+), 5 deletions(-) diff --git a/config_panel.toml b/config_panel.toml index 5e3ade8..85513de 100644 --- a/config_panel.toml +++ b/config_panel.toml @@ -72,10 +72,14 @@ services = ["php8.2-fpm"] [main.apps] name = "Apps" - [main.apps.auto_update] - ask = "Auto update apps" - type = "boolean" - help = "Automatically update apps each night" + [main.apps.auto_upgrade_apps] + ask = "Upgrade apps" + type = "select" + choices.manual = "Manually" + choices.daily = "Daily at 00:10" + choices.weekly = "Weekly at 00:10 on Sunday" + choices.monthly = "Monthly at 00:10 on the 1st" + help = "Keep in mind that upgrade apps could break things in your instance, so you need to strike the right balance between reliability and safety." [main.apps.defaultapp] ask = "Default app to display" diff --git a/scripts/config b/scripts/config index f7a56c4..da44282 100644 --- a/scripts/config +++ b/scripts/config @@ -65,6 +65,19 @@ get__free_footprint() { # SPECIFIC SETTERS FOR TOML SHORT KEYS #================================================= +set__auto_upgrade_apps() { + declare -A frequencies=( [daily]="10 00 * * *" [weekly]="10 00 * * 0" [monthly]="10 00 1 * *" ) + if [ "$frequencies[$auto_upgrade_apps]" ] + then + echo "${frequencies[$auto_upgrade_apps]} $app /usr/bin/php$phpversion --define apc.enable_cli=1 -f $install_dir/occ app:update --all" > /etc/cron.d/nextcloud_upgrade_apps + else + ynh_secure_remove --file=/etc/cron.d/nextcloud_upgrade_apps + fi + + ynh_app_setting_set --app=$app --key=auto_upgrade_apps --value="$auto_upgrade_apps" + +} + set__fpm_footprint() { if [ "$fpm_footprint" != "specific" ] then diff --git a/scripts/install b/scripts/install index e8c8831..d99a123 100755 --- a/scripts/install +++ b/scripts/install @@ -38,7 +38,7 @@ ynh_app_setting_set --app=$app --key=logout_url --value="" ynh_app_setting_set --app=$app --key=trashbin_retention_obligation --value="auto" ynh_app_setting_set --app=$app --key=version_retention_obligation --value="auto" ynh_app_setting_set --app=$app --key=enable_previews --value=1 -ynh_app_setting_set --app=$app --key=auto_update --value=1 +ynh_app_setting_set --app=$app --key=auto_upgrade_apps --value="manual" ynh_app_setting_set --app=$app --key=defaultapp --value="dashboard,files" #================================================= From 2e99f5f77d8bcf9fb15dfa7a38521bdc0b2fbf7e Mon Sep 17 00:00:00 2001 From: ljf Date: Mon, 11 Dec 2023 01:10:05 +0100 Subject: [PATCH 04/15] [enh] Better interoperabillity between windows, mac and linux nextcloud client --- conf/config.json | 1 + 1 file changed, 1 insertion(+) diff --git a/conf/config.json b/conf/config.json index 297d3d0..422aa90 100644 --- a/conf/config.json +++ b/conf/config.json @@ -23,6 +23,7 @@ "lost_password_link": "", "localstorage.allowsymlinks": true, "simpleSignUpLink.shown": false, + "forbidden_chars": ["?", "<", ">", ":", "*", "|", "\"", "\0", "\n", "\r"], "mail_smtpmode": "smtp", "mail_smtpport": "25", "mail_smtpauth": 1, From 20b5c886b1092e4c03595805b160db04b6beedbe Mon Sep 17 00:00:00 2001 From: ljf Date: Mon, 11 Dec 2023 03:44:46 +0100 Subject: [PATCH 05/15] [fix] config during install + skeleton dir --- conf/config.json | 2 +- config_panel.toml | 7 ++++++- manifest.toml | 4 ++-- scripts/backup | 1 + scripts/config | 2 +- scripts/install | 32 +++++++++++++++++++++++++------- scripts/remove | 1 + scripts/restore | 1 + 8 files changed, 38 insertions(+), 12 deletions(-) diff --git a/conf/config.json b/conf/config.json index 422aa90..1686aeb 100644 --- a/conf/config.json +++ b/conf/config.json @@ -23,7 +23,7 @@ "lost_password_link": "", "localstorage.allowsymlinks": true, "simpleSignUpLink.shown": false, - "forbidden_chars": ["?", "<", ">", ":", "*", "|", "\"", "\0", "\n", "\r"], + "skeletondirectory": "/home/yunohost.app/__APP__/skeleton/{lang}", "mail_smtpmode": "smtp", "mail_smtpport": "25", "mail_smtpauth": 1, diff --git a/config_panel.toml b/config_panel.toml index 85513de..bc433ee 100644 --- a/config_panel.toml +++ b/config_panel.toml @@ -13,7 +13,7 @@ services = ["php8.2-fpm"] bind = ":__INSTALL_DIR__/config/config.php" [main.mode.has_internet_connection] - ask = "Enable closed network mode" + ask = "Internet connection available" type = "boolean" bind = ":__INSTALL_DIR__/config/config.php" help = "Is Nextcloud connected to the Internet or running in a closed network?" @@ -51,6 +51,11 @@ services = ["php8.2-fpm"] [main.files] name = "Files" + [main.files.skeleton] + ask = "To configure the default files created for new users, you can do it by logging on nextcloud with an admins account and edit files under `New user default files/default` or if you want to target a specific language `New user default files/FR`." + type = "alert" + style = "info" + [main.files.trashbin_retention_obligation] ask = "Trashbin retention" type = "string" diff --git a/manifest.toml b/manifest.toml index a8200f6..081adb4 100644 --- a/manifest.toml +++ b/manifest.toml @@ -61,7 +61,7 @@ ram.runtime = "512M" [resources.install_dir] [resources.data_dir] - subdirs = ["data"] + subdirs = ["data", "skeleton"] [resources.permissions] main.url = "/" @@ -77,4 +77,4 @@ ram.runtime = "512M" [resources.database] type = "mysql" - \ No newline at end of file + diff --git a/scripts/backup b/scripts/backup index 924f0bd..b7ea68c 100755 --- a/scripts/backup +++ b/scripts/backup @@ -59,6 +59,7 @@ ynh_backup --src_path="/etc/fail2ban/filter.d/$app.conf" #================================================= ynh_backup --src_path="/etc/cron.d/$app" +ynh_backup --src_path="/etc/cron.d/${app}_upgrade_apps" --not_mandatory #================================================= # BACKUP THE MYSQL DATABASE diff --git a/scripts/config b/scripts/config index da44282..bad56e1 100644 --- a/scripts/config +++ b/scripts/config @@ -69,7 +69,7 @@ set__auto_upgrade_apps() { declare -A frequencies=( [daily]="10 00 * * *" [weekly]="10 00 * * 0" [monthly]="10 00 1 * *" ) if [ "$frequencies[$auto_upgrade_apps]" ] then - echo "${frequencies[$auto_upgrade_apps]} $app /usr/bin/php$phpversion --define apc.enable_cli=1 -f $install_dir/occ app:update --all" > /etc/cron.d/nextcloud_upgrade_apps + echo "${frequencies[$auto_upgrade_apps]} $app /usr/bin/php$phpversion --define apc.enable_cli=1 -f $install_dir/occ app:update --all" > /etc/cron.d/${app}_upgrade_apps else ynh_secure_remove --file=/etc/cron.d/nextcloud_upgrade_apps fi diff --git a/scripts/install b/scripts/install index d99a123..da8c244 100755 --- a/scripts/install +++ b/scripts/install @@ -151,6 +151,7 @@ ynh_secure_remove --file="$nc_conf" nc_conf="$install_dir/config.json" ynh_add_config --template="../conf/config.json" --destination="$nc_conf" +cat $nc_conf exec_occ config:import "$nc_conf" # Then remove the config file @@ -171,13 +172,22 @@ exec_occ ldap:test-config '' \ # Define a function to add an external storage # Create the external storage for the given folders and enable sharing create_external_storage() { - local datadir="$1" + local mount_dir="$1" local mount_name="$2" + local group="${3:-}" local mount_id=`exec_occ files_external:create --output=json \ - "$mount_name" 'local' 'null::null' -c "datadir=$data_dir/data" || true` - ! [[ $mount_id =~ ^[0-9]+$ ]] \ - && ynh_print_warn --message="Unable to create external storage" \ - || exec_occ files_external:option "$mount_id" enable_sharing true + "$mount_name" 'local' 'null::null' -c "datadir=$mount_dir" || true` + if ! [[ $mount_id =~ ^[0-9]+$ ]] + then + ynh_print_warn --message="Unable to create external storage" + else + exec_occ files_external:option "$mount_id" enable_sharing true + if [ "$group" != "" ] + then + exec_occ group:list + exec_occ files_external:applicable "$mount_id" --add-group="$group" + fi + fi } # Enable External Storage and create local mount to home folder @@ -261,6 +271,14 @@ create_external_storage "/home/yunohost.multimedia/share" "Shared multimedia" # Allow nextcloud to write into these directories ynh_multimedia_addaccess $app +#================================================= +# EASY SKELETON CONFIGURATION +#================================================ +ynh_script_progression --message="Easying skeleton configuration..." --weight=1 + +cp -a --no-target-directory $install_dir/core/skeleton "/home/yunohost.app/$app/skeleton/default" +create_external_storage "/home/yunohost.app/$app/skeleton" "New users default files" "admins" + #================================================= # GENERIC FINALIZATION #================================================= @@ -272,8 +290,8 @@ chown -R $app:www-data "$install_dir" chown -R $app: "$data_dir" find $install_dir/ -type f -print0 | xargs -r0 chmod 0644 find $install_dir/ -type d -print0 | xargs -r0 chmod 0755 -find $data_dir/data/ -type f -print0 | xargs -r0 chmod 0640 -find $data_dir/data/ -type d -print0 | xargs -r0 chmod 0750 +find $data_dir/ -type f -print0 | xargs -r0 chmod 0640 +find $data_dir/ -type d -print0 | xargs -r0 chmod 0750 chmod 640 "$install_dir/config/config.php" chmod 755 /home/yunohost.app chmod 750 $install_dir diff --git a/scripts/remove b/scripts/remove index d09cafe..331ac86 100755 --- a/scripts/remove +++ b/scripts/remove @@ -31,6 +31,7 @@ ynh_remove_fail2ban_config # Remove a cron file # TODO: Ensure that cron job is not running (How !?) ynh_secure_remove --file="/etc/cron.d/$app" +ynh_secure_remove --file="/etc/cron.d/${app}_upgrade_apps" # Cleaning ACL in home directories for i in $(ls /home); do diff --git a/scripts/restore b/scripts/restore index 90d8fba..db8c157 100755 --- a/scripts/restore +++ b/scripts/restore @@ -58,6 +58,7 @@ fi ynh_script_progression --message="Restoring cron job..." --weight=1 ynh_restore_file --origin_path="/etc/cron.d/$app" +ynh_restore_file --origin_path="/etc/cron.d/${app}_upgrade_apps" --not_mandatory #================================================= # BACKUP THE LOGROTATE CONFIGURATION From eb749246eb7c32dd4e2c3f6a80f87003a93d0393 Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Fri, 12 Jan 2024 07:37:10 +0100 Subject: [PATCH 06/15] Update install --- scripts/install | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/install b/scripts/install index 053a926..b6a7a22 100755 --- a/scripts/install +++ b/scripts/install @@ -10,7 +10,7 @@ phpflags="--define apc.enable_cli=1" # STORE SETTINGS FROM MANIFEST #================================================= -ynh_app_setting_set --app=$app --key=maintenance --value=$maintenance_mode +ynh_app_setting_set --app=$app --key=maintenance --value=$maintenance ynh_app_setting_set --app=$app --key=fpm_footprint --value=$fpm_footprint ynh_app_setting_set --app=$app --key=fpm_free_footprint --value=$fpm_free_footprint ynh_app_setting_set --app=$app --key=fpm_usage --value=$fpm_usage From ca908766c0b8834a18a30aa0498017176f5f3c49 Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Fri, 12 Jan 2024 07:45:14 +0100 Subject: [PATCH 07/15] Revert "Update install" This reverts commit eb749246eb7c32dd4e2c3f6a80f87003a93d0393. --- scripts/install | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/install b/scripts/install index b6a7a22..053a926 100755 --- a/scripts/install +++ b/scripts/install @@ -10,7 +10,7 @@ phpflags="--define apc.enable_cli=1" # STORE SETTINGS FROM MANIFEST #================================================= -ynh_app_setting_set --app=$app --key=maintenance --value=$maintenance +ynh_app_setting_set --app=$app --key=maintenance --value=$maintenance_mode ynh_app_setting_set --app=$app --key=fpm_footprint --value=$fpm_footprint ynh_app_setting_set --app=$app --key=fpm_free_footprint --value=$fpm_free_footprint ynh_app_setting_set --app=$app --key=fpm_usage --value=$fpm_usage From 8dbc2e98dc69ba46e8844ebf222bceaae6839341 Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Fri, 12 Jan 2024 07:55:05 +0100 Subject: [PATCH 08/15] Fix merge from testing :/ --- scripts/install | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/scripts/install b/scripts/install index 053a926..b8a0607 100755 --- a/scripts/install +++ b/scripts/install @@ -1,16 +1,30 @@ #!/bin/bash +#================================================= +# GENERIC START +#================================================= +# IMPORT GENERIC HELPERS +#================================================= + source _common.sh source /usr/share/yunohost/helpers source _ynh_mysql_connect_as.sh +#================================================= +# STORE SETTINGS FROM MANIFEST +#================================================= + +maintenance=0 +fpm_footprint="high" +fpm_free_footprint=0 +fpm_usage="medium" phpflags="--define apc.enable_cli=1" #================================================= # STORE SETTINGS FROM MANIFEST #================================================= -ynh_app_setting_set --app=$app --key=maintenance --value=$maintenance_mode +ynh_app_setting_set --app=$app --key=maintenance --value=$maintenance ynh_app_setting_set --app=$app --key=fpm_footprint --value=$fpm_footprint ynh_app_setting_set --app=$app --key=fpm_free_footprint --value=$fpm_free_footprint ynh_app_setting_set --app=$app --key=fpm_usage --value=$fpm_usage From 4c7cbe12c618c67fa96298c4f4022fabebdd2855 Mon Sep 17 00:00:00 2001 From: Alexandre Aubin <4533074+alexAubin@users.noreply.github.com> Date: Sun, 21 Jan 2024 16:42:33 +0100 Subject: [PATCH 09/15] Update install: php-related setting are set later, and free_fpm_footprint is a dynamic thing, doesn't make sense to define a setting for it --- scripts/install | 22 ++-------------------- 1 file changed, 2 insertions(+), 20 deletions(-) diff --git a/scripts/install b/scripts/install index b8a0607..d8439dd 100755 --- a/scripts/install +++ b/scripts/install @@ -1,35 +1,17 @@ #!/bin/bash -#================================================= -# GENERIC START -#================================================= -# IMPORT GENERIC HELPERS -#================================================= - source _common.sh source /usr/share/yunohost/helpers source _ynh_mysql_connect_as.sh #================================================= -# STORE SETTINGS FROM MANIFEST +# INIT STUFF FOR CONFIG PANEL, ETC #================================================= -maintenance=0 -fpm_footprint="high" -fpm_free_footprint=0 -fpm_usage="medium" phpflags="--define apc.enable_cli=1" -#================================================= -# STORE SETTINGS FROM MANIFEST -#================================================= - -ynh_app_setting_set --app=$app --key=maintenance --value=$maintenance -ynh_app_setting_set --app=$app --key=fpm_footprint --value=$fpm_footprint -ynh_app_setting_set --app=$app --key=fpm_free_footprint --value=$fpm_free_footprint -ynh_app_setting_set --app=$app --key=fpm_usage --value=$fpm_usage +ynh_app_setting_set --app=$app --key=maintenance --value=0 ynh_app_setting_set --app=$app --key=phpflags --value=$phpflags - ynh_app_setting_set --app=$app --key=has_internet_connection --value=1 ynh_app_setting_set --app=$app --key=default_phone_region --value="" ynh_app_setting_set --app=$app --key=default_timezone --value="Europe/Paris" From 7e681d3bc8e2e5af6210cc1fd537f5b16b9814a5 Mon Sep 17 00:00:00 2001 From: Alexandre Aubin <4533074+alexAubin@users.noreply.github.com> Date: Sun, 21 Jan 2024 16:57:16 +0100 Subject: [PATCH 10/15] Update upgrade: auto_upgrade_apps setting not initialized during upgrade if it doesnt exist, making config panel crash when upgrading from old versions ... --- scripts/upgrade | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/scripts/upgrade b/scripts/upgrade index 280eb7d..618cbea 100755 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -19,6 +19,10 @@ if [ -z "${phpflags:-}" ]; then ynh_app_setting_set --app=$app --key=phpflags --value=$phpflags fi +if [ -z "${auto_upgrade_apps:-}" ]; then + ynh_app_setting_set --app=$app --key=auto_upgrade_apps --value="manual" +fi + # Delete existing ini configuration file (backward compatibility) if [ -f /etc/php/$YNH_PHP_VERSION/fpm/conf.d/20-$app.ini ]; then ynh_secure_remove --file=/etc/php/$YNH_PHP_VERSION/fpm/conf.d/20-$app.ini From 3092bb461572b12693790e89dc062f573db30b56 Mon Sep 17 00:00:00 2001 From: "ljf (zamentur)" Date: Sun, 21 Jan 2024 23:36:21 +0100 Subject: [PATCH 11/15] Maj in brand name Co-authored-by: eric_G <46165813+ericgaspar@users.noreply.github.com> --- config_panel.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config_panel.toml b/config_panel.toml index bc433ee..3a65e61 100644 --- a/config_panel.toml +++ b/config_panel.toml @@ -52,7 +52,7 @@ services = ["php8.2-fpm"] name = "Files" [main.files.skeleton] - ask = "To configure the default files created for new users, you can do it by logging on nextcloud with an admins account and edit files under `New user default files/default` or if you want to target a specific language `New user default files/FR`." + ask = "To configure the default files created for new users, you can do it by logging on Nextcloud with an admins account and edit files under `New user default files/default` or if you want to target a specific language `New user default files/FR`." type = "alert" style = "info" From d0fcac2802b45a2f26bd490c2449f72cab0ea93e Mon Sep 17 00:00:00 2001 From: "ljf (zamentur)" Date: Sun, 21 Jan 2024 23:36:52 +0100 Subject: [PATCH 12/15] Maj in product name Co-authored-by: eric_G <46165813+ericgaspar@users.noreply.github.com> --- config_panel.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config_panel.toml b/config_panel.toml index 3a65e61..38decad 100644 --- a/config_panel.toml +++ b/config_panel.toml @@ -40,7 +40,7 @@ services = ["php8.2-fpm"] ask = "Lost password link" type = "url" bind = ":__INSTALL_DIR__/config/config.php" - help = "Allow to redirect on a custom form to require a password reset (for example to ask you to reset it from this yunohost webadmin)" + help = "Allow to redirect on a custom form to require a password reset (for example to ask you to reset it from this YunoHost webadmin)" [main.account.logout_url] ask = "Logout URL" From cfeddfa329326b6dd35f60877bb9372980b674a7 Mon Sep 17 00:00:00 2001 From: "ljf (zamentur)" Date: Sun, 21 Jan 2024 23:37:35 +0100 Subject: [PATCH 13/15] __DATA_DIR__ instead of longer path Co-authored-by: eric_G <46165813+ericgaspar@users.noreply.github.com> --- conf/config.json | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/conf/config.json b/conf/config.json index 1686aeb..021042f 100644 --- a/conf/config.json +++ b/conf/config.json @@ -23,7 +23,8 @@ "lost_password_link": "", "localstorage.allowsymlinks": true, "simpleSignUpLink.shown": false, - "skeletondirectory": "/home/yunohost.app/__APP__/skeleton/{lang}", + "skeletondirectory": "__DATA_DIR__/skeleton/{lang}", + "mail_smtpmode": "smtp", "mail_smtpport": "25", "mail_smtpauth": 1, From 66ec3e8ee0cdfa178faf7c89db30024f51be1b9a Mon Sep 17 00:00:00 2001 From: "ljf (zamentur)" Date: Sun, 21 Jan 2024 23:38:05 +0100 Subject: [PATCH 14/15] $data_dir instead of longer path Co-authored-by: eric_G <46165813+ericgaspar@users.noreply.github.com> --- scripts/install | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/install b/scripts/install index d8439dd..3a0d6d6 100755 --- a/scripts/install +++ b/scripts/install @@ -259,7 +259,7 @@ ynh_multimedia_addaccess $app #================================================ ynh_script_progression --message="Easying skeleton configuration..." --weight=1 -cp -a --no-target-directory $install_dir/core/skeleton "/home/yunohost.app/$app/skeleton/default" +cp -a --no-target-directory $install_dir/core/skeleton "$data_dir/skeleton/default" create_external_storage "/home/yunohost.app/$app/skeleton" "New users default files" "admins" #================================================= From b289065015dd8924c79e5c3896c75855c2ccdf9f Mon Sep 17 00:00:00 2001 From: "ljf (zamentur)" Date: Sun, 21 Jan 2024 23:38:26 +0100 Subject: [PATCH 15/15] $data_dir instead of longer path Co-authored-by: eric_G <46165813+ericgaspar@users.noreply.github.com> --- scripts/install | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/install b/scripts/install index 3a0d6d6..f426e6e 100755 --- a/scripts/install +++ b/scripts/install @@ -260,7 +260,7 @@ ynh_multimedia_addaccess $app ynh_script_progression --message="Easying skeleton configuration..." --weight=1 cp -a --no-target-directory $install_dir/core/skeleton "$data_dir/skeleton/default" -create_external_storage "/home/yunohost.app/$app/skeleton" "New users default files" "admins" +create_external_storage "$data_dir/skeleton" "New users default files" "admins" #================================================= # GENERIC FINALIZATION