From 4c9b498e44e1c9d44b7f6b3da682efee464e0ce8 Mon Sep 17 00:00:00 2001 From: i-cz Date: Fri, 26 Jan 2024 06:59:57 +0100 Subject: [PATCH] add region --- nightscout/config.json | 2 ++ nightscout/rootfs/etc/cont-init.d/nightscout.sh | 2 ++ nightscout/rootfs/etc/services.d/nightscout/run | 7 +++++-- 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/nightscout/config.json b/nightscout/config.json index 0d57d6e..21dac4d 100644 --- a/nightscout/config.json +++ b/nightscout/config.json @@ -32,6 +32,7 @@ "connect_link_up_username": "", "connect_link_up_password": "", "connect_link_up_server": "api-eu.libreview.io", + "connect_link_up_region": "EU", "plugins": [ "careportal", "boluscalc", @@ -62,6 +63,7 @@ "connect_link_up_username": "str", "connect_link_up_password": "str", "connect_link_up_server": "str", + "connect_link_up_region": "str", "auth_default_roles": "list(admin|denied|status-only|readable|careportal|devicestatus-upload|activity)?", "theme": "list(default|colors|colorblindfriendly)", "import_config_url": "str?", diff --git a/nightscout/rootfs/etc/cont-init.d/nightscout.sh b/nightscout/rootfs/etc/cont-init.d/nightscout.sh index ff21373..3ae782c 100755 --- a/nightscout/rootfs/etc/cont-init.d/nightscout.sh +++ b/nightscout/rootfs/etc/cont-init.d/nightscout.sh @@ -10,6 +10,7 @@ readonly connect_source=$(bashio::config 'connect_source') readonly connect_link_up_username=$(bashio::config 'connect_link_up_username') readonly connect_link_up_password=$(bashio::config 'connect_link_up_password') readonly connect_link_up_server=$(bashio::config 'connect_link_up_server') +readonly connect_link_up_region=$(bashio::config 'connect_link_up_region') bashio::log.info "Setting up API KEY: ${api_key}" export API_SECRET="${api_key}" @@ -19,3 +20,4 @@ export CONNECT_SOURCE="${connect_source}" export CONNECT_LINK_UP_USERNAME="${connect_link_up_username}" export CONNECT_LINK_UP_PASSWORD="${connect_link_up_password}" export CONNECT_LINK_UP_SERVER="${connect_link_up_server}" +export CONNECT_LINK_UP_REGION="${connect_link_up_region}" diff --git a/nightscout/rootfs/etc/services.d/nightscout/run b/nightscout/rootfs/etc/services.d/nightscout/run index c839010..b2800c8 100755 --- a/nightscout/rootfs/etc/services.d/nightscout/run +++ b/nightscout/rootfs/etc/services.d/nightscout/run @@ -21,9 +21,11 @@ bashio::log.debug "Setting up CONNECT_SOURCE: ${connect_source}" readonly connect_link_up_username=$(bashio::config 'connect_link_up_username') bashio::log.debug "Setting up CONNECT_LINK_UP_USERNAME: ${connect_link_up_username}" readonly connect_link_up_password=$(bashio::config 'connect_link_up_password') -bashio::log.debug "Setting up CONNECT_LINK_UP_PASSWORD: 'connect_link_up_password'" +bashio::log.debug "Setting up CONNECT_LINK_UP_PASSWORD: ${connect_link_up_password}" readonly connect_link_up_server=$(bashio::config 'connect_link_up_server') -bashio::log.debug "Setting up CONNECT_LINK_UP_SERVER: 'connect_link_up_server'" +bashio::log.debug "Setting up CONNECT_LINK_UP_SERVER: ${connect_link_up_server}" +readonly connect_link_up_region=$(bashio::config 'connect_link_up_region') +bashio::log.debug "Setting up CONNECT_LINK_UP_REGION: ${connect_link_up_region}" export API_SECRET="${api_key}" export HOSTNAME="127.0.0.1" @@ -36,6 +38,7 @@ export CONNECT_SOURCE="${connect_source}" export CONNECT_LINK_UP_USERNAME="${connect_link_up_username}" export CONNECT_LINK_UP_PASSWORD="${connect_link_up_password}" export CONNECT_LINK_UP_SERVER="${connect_link_up_server}" +export CONNECT_LINK_UP_REGION="${connect_link_up_region}" if bashio::config.has_value 'auth_default_roles'; then readonly auth_default_roles=$(bashio::config 'auth_default_roles')