From 56b6dcd045e1489ad8381f5db583e15bf0f8ddaa Mon Sep 17 00:00:00 2001 From: Francesco Vattiato Date: Sun, 18 Jan 2026 04:38:43 +0100 Subject: [PATCH 01/17] feat: Add Nightscout Proxmox CT template, installation scripts, and application metadata. --- ct/nightscout.sh | 50 +++++++++++++++++++ frontend/public/json/nightscout.json | 48 ++++++++++++++++++ install/nightscout-install.sh | 75 ++++++++++++++++++++++++++++ 3 files changed, 173 insertions(+) create mode 100644 ct/nightscout.sh create mode 100644 frontend/public/json/nightscout.json create mode 100644 install/nightscout-install.sh diff --git a/ct/nightscout.sh b/ct/nightscout.sh new file mode 100644 index 000000000..c88f61861 --- /dev/null +++ b/ct/nightscout.sh @@ -0,0 +1,50 @@ +#!/usr/bin/env bash +source <(curl -s https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main/misc/build.func) +# Copyright (c) 2021-2026 community-scripts ORG +# Author: aendel +# License: MIT | https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE +# Source: https://github.com/nightscout/cgm-remote-monitor + +APP="Nightscout" +var_tags="${var_tags:-arr;health}" +var_cpu="${var_cpu:-2}" +var_ram="${var_ram:-2048}" +var_disk="${var_disk:-10}" +var_os="${var_os:-debian}" +var_version="${var_version:-12}" +var_unprivileged="${var_unprivileged:-1}" + +header_info "$APP" +variables +color +catch_errors + +function update_script() { + header_info + check_container_storage + check_container_resources + if [[ ! -d /opt/nightscout ]]; then + msg_error "No ${APP} Installation Found!" + exit + fi + msg_info "Updating ${APP}" + systemctl stop nightscout + cd /opt/nightscout || exit + git pull + npm install + systemctl start nightscout + msg_ok "Updated ${APP}" + exit +} + +start +build_container +description + +msg_ok "Completed Successfully!\n" +echo -e "${CREATING}${GN}${APP} setup has been successfully initialized!${CL}" +echo -e "${INFO}${YW} Access it using the following URL:${CL}" +echo -e "${TAB}${GATEWAY}${BGN}http://${IP}:1337${CL}" +echo -e "${INFO}${YW} Configuration:${CL}" +echo -e "${TAB} Edit /opt/nightscout/my.env to configure your CGM source (Dexcom/CareLink)" +echo -e "${TAB} Then run: ${BGN}systemctl restart nightscout${CL}" diff --git a/frontend/public/json/nightscout.json b/frontend/public/json/nightscout.json new file mode 100644 index 000000000..a2c820352 --- /dev/null +++ b/frontend/public/json/nightscout.json @@ -0,0 +1,48 @@ +{ + "name": "Nightscout", + "slug": "nightscout", + "categories": [ + 0 + ], + "date_created": "2025-01-17", + "type": "ct", + "updateable": true, + "privileged": false, + "interface_port": 1337, + "documentation": "https://nightscout.github.io/", + "website": "http://www.nightscout.info/", + "logo": "https://raw.githubusercontent.com/nightscout/cgm-remote-monitor/master/static/images/large.png", + "config_path": "/opt/nightscout/my.env", + "description": "Nightscout is an open source, DIY project that allows real time access to a CGM data via personal website, smartwatch watchers, or apps and widgets available for smartphones.", + "install_methods": [ + { + "type": "default", + "script": "ct/nightscout.sh", + "resources": { + "cpu": 2, + "ram": 2048, + "hdd": 10, + "os": "debian", + "version": "12" + } + } + ], + "default_credentials": { + "username": null, + "password": null + }, + "notes": [ + { + "text": "Nightscout requires configuring `my.env` with your Mongo connection string and API_SECRET. Default API_SECRET is `yoursecret123`.", + "type": "info" + }, + { + "text": "Official Configuration Guide: [Nightscout Documentation](https://nightscout.github.io/nightscout/setup_variables/)", + "type": "link" + }, + { + "text": "Nightscout requires HTTPS for many features (security, tokens, PWA). Usage of a reverse proxy (e.g. Nginx Proxy Manager) is highly recommended.", + "type": "warning" + } + ] +} diff --git a/install/nightscout-install.sh b/install/nightscout-install.sh new file mode 100644 index 000000000..4d64de7b2 --- /dev/null +++ b/install/nightscout-install.sh @@ -0,0 +1,75 @@ +#!/usr/bin/env bash +# Copyright (c) 2021-2026 community-scripts ORG +# Author: aendel +# License: MIT | https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE +# Source: https://github.com/nightscout/cgm-remote-monitor + +source /dev/stdin <<<"$FUNCTIONS_FILE_PATH" +color +verb_ip6 +catch_errors +setting_up_container +network_check +update_os + +msg_info "Installing Dependencies" +$STD apt-get install -y git curl build-essential libssl-dev +msg_ok "Installed Dependencies" + +MONGO_VERSION="8.0" setup_mongodb +NODE_VERSION="22" setup_nodejs + +msg_info "Installing Nightscout (Patience)" +cd /opt || exit +git clone https://github.com/nightscout/cgm-remote-monitor.git nightscout +cd nightscout || exit +$STD npm install +msg_ok "Installed Nightscout" + +msg_info "Creating Service" +useradd -s /bin/bash -m nightscout +chown -R nightscout:nightscout /opt/nightscout + +# Create a default my.env file if it doesn't exist, to prevent crash on start if user doesn't configure it immediately? +# Nightscout needs env vars to run. We will create a template. +cat < /opt/nightscout/my.env +# DB connection string. +# MongoDB is installed locally on port 27017. +# You should create a DB and user in Mongo, or trust localhost auth. +# For simplicity in this script we assume localhost with no auth for local binding or the user must configure it. +# However, the installation guide recommends creating a user. +# For now, we point to localhost test DB. +MONGO_CONNECTION=mongodb://127.0.0.1:27017/nightscout +BASE_URL=http://localhost:1337 +API_SECRET=yoursecret123 +DISPLAY_UNITS=mg/dl +ENABLE=careportal boluscalc food bwp cage sage iage iob cob basal ar2 rawbg pushover bgi pump openaps pvb linear custom +# Allow HTTP (avoids redirect loops with reverse proxies) +INSECURE_USE_HTTP=true +EOF +chown nightscout:nightscout /opt/nightscout/my.env + +cat </etc/systemd/system/nightscout.service +[Unit] +Description=Nightscout CGM Service +After=network.target mongodb.service + +[Service] +Type=simple +User=nightscout +WorkingDirectory=/opt/nightscout +EnvironmentFile=/opt/nightscout/my.env +# Some deployments use 'npm start', others 'node server.js'. npm start is safer. +ExecStart=/usr/bin/npm start +Restart=always + +[Install] +WantedBy=multi-user.target +EOF + +systemctl enable -q --now nightscout +msg_ok "Created Service" + +motd_ssh +customize +cleanup_lxc From f23c0b72fcd4181d9fc8cb5fcc7ca5748fd787e8 Mon Sep 17 00:00:00 2001 From: Francesco Vattiato Date: Sun, 18 Jan 2026 06:18:02 +0100 Subject: [PATCH 02/17] fix: Update repository name in URLs from ProxmoxVE to ProxmoxVED. --- ct/nightscout.sh | 4 ++-- install/nightscout-install.sh | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/ct/nightscout.sh b/ct/nightscout.sh index c88f61861..0109fc600 100644 --- a/ct/nightscout.sh +++ b/ct/nightscout.sh @@ -1,8 +1,8 @@ #!/usr/bin/env bash -source <(curl -s https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main/misc/build.func) +source <(curl -s https://raw.githubusercontent.com/community-scripts/ProxmoxVED/main/misc/build.func) # Copyright (c) 2021-2026 community-scripts ORG # Author: aendel -# License: MIT | https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE +# License: MIT | https://github.com/community-scripts/ProxmoxVED/raw/main/LICENSE # Source: https://github.com/nightscout/cgm-remote-monitor APP="Nightscout" diff --git a/install/nightscout-install.sh b/install/nightscout-install.sh index 4d64de7b2..bf204307e 100644 --- a/install/nightscout-install.sh +++ b/install/nightscout-install.sh @@ -1,7 +1,7 @@ #!/usr/bin/env bash # Copyright (c) 2021-2026 community-scripts ORG # Author: aendel -# License: MIT | https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE +# License: MIT | https://github.com/community-scripts/ProxmoxVED/raw/main/LICENSE # Source: https://github.com/nightscout/cgm-remote-monitor source /dev/stdin <<<"$FUNCTIONS_FILE_PATH" From e072924062ce8a7551c4416254433905f0c2bd3d Mon Sep 17 00:00:00 2001 From: Francesco Vattiato Date: Sun, 18 Jan 2026 06:21:08 +0100 Subject: [PATCH 03/17] Update install/nightscout-install.sh Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com> --- install/nightscout-install.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/install/nightscout-install.sh b/install/nightscout-install.sh index bf204307e..e46f2eb16 100644 --- a/install/nightscout-install.sh +++ b/install/nightscout-install.sh @@ -59,7 +59,7 @@ Type=simple User=nightscout WorkingDirectory=/opt/nightscout EnvironmentFile=/opt/nightscout/my.env -# Some deployments use 'npm start', others 'node server.js'. npm start is safer. +ExecStart=/usr/bin/npm start ExecStart=/usr/bin/npm start Restart=always From c7d2c8fed0f07475ddf6cc46f11a85c5049c0297 Mon Sep 17 00:00:00 2001 From: Francesco Vattiato Date: Sun, 18 Jan 2026 06:21:32 +0100 Subject: [PATCH 04/17] Update install/nightscout-install.sh Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com> --- install/nightscout-install.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/install/nightscout-install.sh b/install/nightscout-install.sh index e46f2eb16..30559445f 100644 --- a/install/nightscout-install.sh +++ b/install/nightscout-install.sh @@ -22,7 +22,7 @@ NODE_VERSION="22" setup_nodejs msg_info "Installing Nightscout (Patience)" cd /opt || exit git clone https://github.com/nightscout/cgm-remote-monitor.git nightscout -cd nightscout || exit +cd nightscout $STD npm install msg_ok "Installed Nightscout" From fb1fbf0a6e19d2f31d96e99a19f02db1bbc23140 Mon Sep 17 00:00:00 2001 From: Francesco Vattiato Date: Sun, 18 Jan 2026 06:21:48 +0100 Subject: [PATCH 05/17] Update ct/nightscout.sh Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com> --- ct/nightscout.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ct/nightscout.sh b/ct/nightscout.sh index 0109fc600..105a9fbd8 100644 --- a/ct/nightscout.sh +++ b/ct/nightscout.sh @@ -29,7 +29,7 @@ function update_script() { fi msg_info "Updating ${APP}" systemctl stop nightscout - cd /opt/nightscout || exit + cd /opt/nightscout git pull npm install systemctl start nightscout From f66487cbb818aa57f634bd37d5efe9f9eba05d85 Mon Sep 17 00:00:00 2001 From: Francesco Vattiato Date: Sun, 18 Jan 2026 06:23:09 +0100 Subject: [PATCH 06/17] Update install/nightscout-install.sh Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com> --- install/nightscout-install.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/install/nightscout-install.sh b/install/nightscout-install.sh index 30559445f..c231219e5 100644 --- a/install/nightscout-install.sh +++ b/install/nightscout-install.sh @@ -13,7 +13,7 @@ network_check update_os msg_info "Installing Dependencies" -$STD apt-get install -y git curl build-essential libssl-dev +$STD apt install -y git build-essential libssl-dev msg_ok "Installed Dependencies" MONGO_VERSION="8.0" setup_mongodb From 61400266fca2211450a75f4628a0eb260611e23a Mon Sep 17 00:00:00 2001 From: Francesco Vattiato Date: Sun, 18 Jan 2026 06:23:24 +0100 Subject: [PATCH 07/17] Update install/nightscout-install.sh Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com> --- install/nightscout-install.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/install/nightscout-install.sh b/install/nightscout-install.sh index c231219e5..59a7ec211 100644 --- a/install/nightscout-install.sh +++ b/install/nightscout-install.sh @@ -20,7 +20,7 @@ MONGO_VERSION="8.0" setup_mongodb NODE_VERSION="22" setup_nodejs msg_info "Installing Nightscout (Patience)" -cd /opt || exit +cd /opt git clone https://github.com/nightscout/cgm-remote-monitor.git nightscout cd nightscout $STD npm install From ba78a10250d92a0888cae94e6cc88dfc93139ebd Mon Sep 17 00:00:00 2001 From: Francesco Vattiato Date: Sun, 18 Jan 2026 06:34:50 +0100 Subject: [PATCH 08/17] refactor: streamline Nightscout installation using a release helper, simplify the default environment file --- install/nightscout-install.sh | 20 ++++---------------- 1 file changed, 4 insertions(+), 16 deletions(-) diff --git a/install/nightscout-install.sh b/install/nightscout-install.sh index 59a7ec211..0267fcdc4 100644 --- a/install/nightscout-install.sh +++ b/install/nightscout-install.sh @@ -20,36 +20,25 @@ MONGO_VERSION="8.0" setup_mongodb NODE_VERSION="22" setup_nodejs msg_info "Installing Nightscout (Patience)" -cd /opt -git clone https://github.com/nightscout/cgm-remote-monitor.git nightscout -cd nightscout -$STD npm install +fetch_and_deploy_gh_release "nightscout" "nightscout/cgm-remote-monitor" "source" +$STD npm install --prefix /opt/nightscout msg_ok "Installed Nightscout" msg_info "Creating Service" useradd -s /bin/bash -m nightscout chown -R nightscout:nightscout /opt/nightscout -# Create a default my.env file if it doesn't exist, to prevent crash on start if user doesn't configure it immediately? -# Nightscout needs env vars to run. We will create a template. -cat < /opt/nightscout/my.env -# DB connection string. -# MongoDB is installed locally on port 27017. -# You should create a DB and user in Mongo, or trust localhost auth. -# For simplicity in this script we assume localhost with no auth for local binding or the user must configure it. -# However, the installation guide recommends creating a user. -# For now, we point to localhost test DB. +cat > /opt/nightscout/my.env </etc/systemd/system/nightscout.service +cat > /etc/systemd/system/nightscout.service < Date: Sun, 18 Jan 2026 13:28:14 +0100 Subject: [PATCH 09/17] Update install/nightscout-install.sh Co-authored-by: Tobias <96661824+CrazyWolf13@users.noreply.github.com> --- install/nightscout-install.sh | 1 - 1 file changed, 1 deletion(-) diff --git a/install/nightscout-install.sh b/install/nightscout-install.sh index 0267fcdc4..111fcb62c 100644 --- a/install/nightscout-install.sh +++ b/install/nightscout-install.sh @@ -54,7 +54,6 @@ Restart=always [Install] WantedBy=multi-user.target EOF - systemctl enable -q --now nightscout msg_ok "Created Service" From f9d3ecec6acd6bf869ad6c68d02b26f7d939f754 Mon Sep 17 00:00:00 2001 From: Francesco Vattiato Date: Sun, 18 Jan 2026 14:43:15 +0100 Subject: [PATCH 10/17] feat: Refactor Nightscout update logic to use `fetch_and_deploy_gh_release`, streamline dependency installation, and update post-install messages and CT tags. --- ct/nightscout.sh | 46 ++++++++++++++++------------ frontend/public/json/nightscout.json | 8 +++-- install/nightscout-install.sh | 12 +++++--- 3 files changed, 41 insertions(+), 25 deletions(-) diff --git a/ct/nightscout.sh b/ct/nightscout.sh index 105a9fbd8..d2a934f02 100644 --- a/ct/nightscout.sh +++ b/ct/nightscout.sh @@ -6,7 +6,7 @@ source <(curl -s https://raw.githubusercontent.com/community-scripts/ProxmoxVED/ # Source: https://github.com/nightscout/cgm-remote-monitor APP="Nightscout" -var_tags="${var_tags:-arr;health}" +var_tags="${var_tags:-health}" var_cpu="${var_cpu:-2}" var_ram="${var_ram:-2048}" var_disk="${var_disk:-10}" @@ -20,31 +20,39 @@ color catch_errors function update_script() { - header_info - check_container_storage - check_container_resources - if [[ ! -d /opt/nightscout ]]; then - msg_error "No ${APP} Installation Found!" - exit - fi - msg_info "Updating ${APP}" - systemctl stop nightscout - cd /opt/nightscout - git pull - npm install - systemctl start nightscout - msg_ok "Updated ${APP}" + header_info + check_container_storage + check_container_resources + if [[ ! -d /opt/nightscout ]]; then + msg_error "No ${APP} Installation Found!" exit + fi + + if check_for_gh_release "nightscout" "nightscout/cgm-remote-monitor"; then + msg_info "Stopping Service" + systemctl stop nightscout + msg_ok "Stopped Service" + + fetch_and_deploy_gh_release "nightscout" "nightscout/cgm-remote-monitor" "source" + + msg_info "Updating ${APP}" + cd /opt/nightscout + $STD npm install + msg_ok "Updated ${APP}" + + msg_info "Starting Service" + systemctl start nightscout + msg_ok "Started Service" + msg_ok "Updated successfully!" + fi + exit } start build_container description -msg_ok "Completed Successfully!\n" +msg_ok "Completed successfully!\n" echo -e "${CREATING}${GN}${APP} setup has been successfully initialized!${CL}" echo -e "${INFO}${YW} Access it using the following URL:${CL}" echo -e "${TAB}${GATEWAY}${BGN}http://${IP}:1337${CL}" -echo -e "${INFO}${YW} Configuration:${CL}" -echo -e "${TAB} Edit /opt/nightscout/my.env to configure your CGM source (Dexcom/CareLink)" -echo -e "${TAB} Then run: ${BGN}systemctl restart nightscout${CL}" diff --git a/frontend/public/json/nightscout.json b/frontend/public/json/nightscout.json index a2c820352..a6f72d28e 100644 --- a/frontend/public/json/nightscout.json +++ b/frontend/public/json/nightscout.json @@ -36,13 +36,17 @@ "text": "Nightscout requires configuring `my.env` with your Mongo connection string and API_SECRET. Default API_SECRET is `yoursecret123`.", "type": "info" }, + { + "text": "Edit `/opt/nightscout/my.env` to configure your CGM source (Dexcom/CareLink). Then run: `systemctl restart nightscout`", + "type": "info" + }, { "text": "Official Configuration Guide: [Nightscout Documentation](https://nightscout.github.io/nightscout/setup_variables/)", - "type": "link" + "type": "info" }, { "text": "Nightscout requires HTTPS for many features (security, tokens, PWA). Usage of a reverse proxy (e.g. Nginx Proxy Manager) is highly recommended.", "type": "warning" } ] -} +} \ No newline at end of file diff --git a/install/nightscout-install.sh b/install/nightscout-install.sh index 111fcb62c..f04dc7593 100644 --- a/install/nightscout-install.sh +++ b/install/nightscout-install.sh @@ -13,14 +13,18 @@ network_check update_os msg_info "Installing Dependencies" -$STD apt install -y git build-essential libssl-dev +$STD apt install -y \ + git \ + build-essential \ + libssl-dev msg_ok "Installed Dependencies" MONGO_VERSION="8.0" setup_mongodb NODE_VERSION="22" setup_nodejs -msg_info "Installing Nightscout (Patience)" fetch_and_deploy_gh_release "nightscout" "nightscout/cgm-remote-monitor" "source" + +msg_info "Installing Nightscout" $STD npm install --prefix /opt/nightscout msg_ok "Installed Nightscout" @@ -28,7 +32,7 @@ msg_info "Creating Service" useradd -s /bin/bash -m nightscout chown -R nightscout:nightscout /opt/nightscout -cat > /opt/nightscout/my.env </opt/nightscout/my.env MONGO_CONNECTION=mongodb://127.0.0.1:27017/nightscout BASE_URL=http://localhost:1337 API_SECRET=yoursecret123 @@ -38,7 +42,7 @@ INSECURE_USE_HTTP=true EOF chown nightscout:nightscout /opt/nightscout/my.env -cat > /etc/systemd/system/nightscout.service </etc/systemd/system/nightscout.service [Unit] Description=Nightscout CGM Service After=network.target mongodb.service From cd06afd1d015a8af9202746db2dd1aa170edade4 Mon Sep 17 00:00:00 2001 From: Francesco Vattiato Date: Sun, 18 Jan 2026 15:44:05 +0100 Subject: [PATCH 11/17] docs: update Nightscout reverse proxy recommendations to include Traefik and Caddy. --- frontend/public/json/nightscout.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/frontend/public/json/nightscout.json b/frontend/public/json/nightscout.json index a6f72d28e..f4030da4a 100644 --- a/frontend/public/json/nightscout.json +++ b/frontend/public/json/nightscout.json @@ -45,7 +45,7 @@ "type": "info" }, { - "text": "Nightscout requires HTTPS for many features (security, tokens, PWA). Usage of a reverse proxy (e.g. Nginx Proxy Manager) is highly recommended.", + "text": "Nightscout requires HTTPS for many features (security, tokens, PWA). Usage of a reverse proxy (e.g. Nginx Proxy Manager, Traefik, Caddy) is highly recommended.", "type": "warning" } ] From f56fefc0a6756c17eb0dd615f1b7e70de679ea16 Mon Sep 17 00:00:00 2001 From: Francesco Vattiato Date: Mon, 19 Jan 2026 23:10:42 +0100 Subject: [PATCH 12/17] Update install/nightscout-install.sh Co-authored-by: Tobias <96661824+CrazyWolf13@users.noreply.github.com> --- install/nightscout-install.sh | 1 - 1 file changed, 1 deletion(-) diff --git a/install/nightscout-install.sh b/install/nightscout-install.sh index f04dc7593..250672220 100644 --- a/install/nightscout-install.sh +++ b/install/nightscout-install.sh @@ -21,7 +21,6 @@ msg_ok "Installed Dependencies" MONGO_VERSION="8.0" setup_mongodb NODE_VERSION="22" setup_nodejs - fetch_and_deploy_gh_release "nightscout" "nightscout/cgm-remote-monitor" "source" msg_info "Installing Nightscout" From 3a6790f7c0a179912eb6194d9d249b7d93140349 Mon Sep 17 00:00:00 2001 From: Francesco Vattiato Date: Mon, 19 Jan 2026 23:11:53 +0100 Subject: [PATCH 13/17] chore: Update default OS version to 13. --- ct/nightscout.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ct/nightscout.sh b/ct/nightscout.sh index d2a934f02..96a148118 100644 --- a/ct/nightscout.sh +++ b/ct/nightscout.sh @@ -11,7 +11,7 @@ var_cpu="${var_cpu:-2}" var_ram="${var_ram:-2048}" var_disk="${var_disk:-10}" var_os="${var_os:-debian}" -var_version="${var_version:-12}" +var_version="${var_version:-13}" var_unprivileged="${var_unprivileged:-1}" header_info "$APP" From 4051c50e92361ca07f54284e8fbce6b7cda5b064 Mon Sep 17 00:00:00 2001 From: Francesco Vattiato Date: Mon, 19 Jan 2026 23:24:51 +0100 Subject: [PATCH 14/17] Update install/nightscout-install.sh Co-authored-by: Tobias <96661824+CrazyWolf13@users.noreply.github.com> --- install/nightscout-install.sh | 1 - 1 file changed, 1 deletion(-) diff --git a/install/nightscout-install.sh b/install/nightscout-install.sh index 250672220..8242f9efc 100644 --- a/install/nightscout-install.sh +++ b/install/nightscout-install.sh @@ -30,7 +30,6 @@ msg_ok "Installed Nightscout" msg_info "Creating Service" useradd -s /bin/bash -m nightscout chown -R nightscout:nightscout /opt/nightscout - cat </opt/nightscout/my.env MONGO_CONNECTION=mongodb://127.0.0.1:27017/nightscout BASE_URL=http://localhost:1337 From 24c2fb2613c21f25b8309d896fc9f09453b87ad2 Mon Sep 17 00:00:00 2001 From: Francesco Vattiato Date: Mon, 19 Jan 2026 23:24:59 +0100 Subject: [PATCH 15/17] Update install/nightscout-install.sh Co-authored-by: Tobias <96661824+CrazyWolf13@users.noreply.github.com> --- install/nightscout-install.sh | 1 - 1 file changed, 1 deletion(-) diff --git a/install/nightscout-install.sh b/install/nightscout-install.sh index 8242f9efc..98ea6c857 100644 --- a/install/nightscout-install.sh +++ b/install/nightscout-install.sh @@ -39,7 +39,6 @@ ENABLE=careportal boluscalc food bwp cage sage iage iob cob basal ar2 rawbg push INSECURE_USE_HTTP=true EOF chown nightscout:nightscout /opt/nightscout/my.env - cat </etc/systemd/system/nightscout.service [Unit] Description=Nightscout CGM Service From 8d9ef8b17dae6db5e30dfed5620d52ccc9a192f9 Mon Sep 17 00:00:00 2001 From: Francesco Vattiato Date: Mon, 19 Jan 2026 23:29:45 +0100 Subject: [PATCH 16/17] feat: Generate a random Nightscout API_SECRET during installation, save it to `~/nightscout.creds`, and update related documentation. --- frontend/public/json/nightscout.json | 4 ++-- install/nightscout-install.sh | 12 +++++++++--- 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/frontend/public/json/nightscout.json b/frontend/public/json/nightscout.json index f4030da4a..05116582e 100644 --- a/frontend/public/json/nightscout.json +++ b/frontend/public/json/nightscout.json @@ -33,7 +33,7 @@ }, "notes": [ { - "text": "Nightscout requires configuring `my.env` with your Mongo connection string and API_SECRET. Default API_SECRET is `yoursecret123`.", + "text": "Nightscout requires configuring `my.env` with your Mongo connection string. API_SECRET has been generated and saved to `~/nightscout.creds`.", "type": "info" }, { @@ -41,7 +41,7 @@ "type": "info" }, { - "text": "Official Configuration Guide: [Nightscout Documentation](https://nightscout.github.io/nightscout/setup_variables/)", + "text": "Official Configuration Guide: https://nightscout.github.io/nightscout/setup_variables/", "type": "info" }, { diff --git a/install/nightscout-install.sh b/install/nightscout-install.sh index 98ea6c857..b8a1baa1c 100644 --- a/install/nightscout-install.sh +++ b/install/nightscout-install.sh @@ -14,9 +14,9 @@ update_os msg_info "Installing Dependencies" $STD apt install -y \ - git \ build-essential \ - libssl-dev + libssl-dev \ + openssl msg_ok "Installed Dependencies" MONGO_VERSION="8.0" setup_mongodb @@ -30,10 +30,11 @@ msg_ok "Installed Nightscout" msg_info "Creating Service" useradd -s /bin/bash -m nightscout chown -R nightscout:nightscout /opt/nightscout +API_SECRET=$(openssl rand -hex 16) cat </opt/nightscout/my.env MONGO_CONNECTION=mongodb://127.0.0.1:27017/nightscout BASE_URL=http://localhost:1337 -API_SECRET=yoursecret123 +API_SECRET=${API_SECRET} DISPLAY_UNITS=mg/dl ENABLE=careportal boluscalc food bwp cage sage iage iob cob basal ar2 rawbg pushover bgi pump openaps pvb linear custom INSECURE_USE_HTTP=true @@ -58,6 +59,11 @@ EOF systemctl enable -q --now nightscout msg_ok "Created Service" +{ + echo "Nightscout Credentials" + echo "API_SECRET: ${API_SECRET}" +} >> ~/nightscout.creds + motd_ssh customize cleanup_lxc From 5ef45368c48ac57cc21251acb1a0e9095898824e Mon Sep 17 00:00:00 2001 From: Francesco Vattiato Date: Tue, 20 Jan 2026 14:16:09 +0100 Subject: [PATCH 17/17] Update ct/nightscout.sh Co-authored-by: Tobias <96661824+CrazyWolf13@users.noreply.github.com> --- ct/nightscout.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ct/nightscout.sh b/ct/nightscout.sh index 96a148118..227342f2c 100644 --- a/ct/nightscout.sh +++ b/ct/nightscout.sh @@ -35,10 +35,10 @@ function update_script() { fetch_and_deploy_gh_release "nightscout" "nightscout/cgm-remote-monitor" "source" - msg_info "Updating ${APP}" + msg_info "Updating Nightscout" cd /opt/nightscout $STD npm install - msg_ok "Updated ${APP}" + msg_ok "Updated Nightscout" msg_info "Starting Service" systemctl start nightscout