From a100a34a049804f1e052e7f6d8d8fd08512c0ce7 Mon Sep 17 00:00:00 2001 From: Alexandre <44178713+alexbelgium@users.noreply.github.com> Date: Tue, 5 Sep 2023 16:42:35 +0200 Subject: [PATCH] Add default phone region https://github.com/alexbelgium/hassio-addons/issues/981 --- nextcloud/CHANGELOG.md | 2 ++ nextcloud/README.md | 1 + nextcloud/config.json | 5 +++-- nextcloud/rootfs/etc/cont-init.d/02-init_steps.sh | 8 ++++++++ 4 files changed, 14 insertions(+), 2 deletions(-) diff --git a/nextcloud/CHANGELOG.md b/nextcloud/CHANGELOG.md index 41d3ce492..651bcd45f 100644 --- a/nextcloud/CHANGELOG.md +++ b/nextcloud/CHANGELOG.md @@ -1,3 +1,5 @@ +- Fit : new variable "default_phone_region" https://github.com/alexbelgium/hassio-addons/issues/981 + ### 27.0.2-3 (24-08-2023) - Fix : healthcheck timeouts @https://github.com/alexbelgium/hassio-addons/issues/956 - Fix : nginx timeouts diff --git a/nextcloud/README.md b/nextcloud/README.md index 00a3db6a4..188bfdb89 100644 --- a/nextcloud/README.md +++ b/nextcloud/README.md @@ -35,6 +35,7 @@ Scripts with .sh ending located in /config/addons_config/nextcloud will be execu ### Addon options ```yaml +default_phone_region: EN # Define the default phone region according to https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2#Officially_assigned_code_elements disable_updates: prevent automatic apps updating along addon additional_apps: vim,nextcloud #specify additional apk files to install ; separated by commas PGID/PUID: 1000 #allows setting user. diff --git a/nextcloud/config.json b/nextcloud/config.json index c16984f7d..bd3a17673 100644 --- a/nextcloud/config.json +++ b/nextcloud/config.json @@ -99,6 +99,7 @@ "DAC_READ_SEARCH" ], "schema": { + "default_phone_region": "match(^[A-Z]{2}$)?", "Full_Text_Search": "bool?", "OCR": "bool?", "OCRLANG": "str?", @@ -124,6 +125,6 @@ "slug": "nextcloud_ocr", "uart": true, "url": "https://github.com/alexbelgium/hassio-addons/tree/master/nextcloud", - "version": "27.0.2-3", + "version": "27.0.2-4", "webui": "https://[HOST]:[PORT:443]" -} +} \ No newline at end of file diff --git a/nextcloud/rootfs/etc/cont-init.d/02-init_steps.sh b/nextcloud/rootfs/etc/cont-init.d/02-init_steps.sh index d12a37e79..d961e6fbb 100755 --- a/nextcloud/rootfs/etc/cont-init.d/02-init_steps.sh +++ b/nextcloud/rootfs/etc/cont-init.d/02-init_steps.sh @@ -87,3 +87,11 @@ sudo -u abc -s /bin/bash -c "php /data/app/www/public/occ maintenance:mode --off sudo -u abc php /data/app/www/public/occ app:remove --no-interaction "richdocumentscode" &>/dev/null || true sudo -u abc php /data/app/www/public/occ app:remove --no-interaction "richdocumentscode_arm64" &>/dev/null || true sudo -u abc php /data/app/www/public/occ app:remove --no-interaction "richdocumentscode_amd64" &>/dev/null || true + +################ +# DEFINE PHONE # +################ + +if bashio::config.has_value "default_phone_region"; then + sudo -u abc php /data/app/www/public/occ config:system:set default_phone_region --value="$(bashio::config "default_phone_region")" +fi