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 <