Install NightScout inside a VM

This page summarizes the projects mentioned and recommended in the original post on /r/diabetes

SurveyJS - Open-Source JSON Form Builder to Create Dynamic Forms Right in Your App
With SurveyJS form UI libraries, you can build and style forms in a fully-integrated drag & drop form builder, render them in your JS app, and store form submission data in any backend, inc. PHP, ASP.NET Core, and Node.js.
surveyjs.io
featured
InfluxDB - Power Real-Time Data Analytics at Scale
Get real-time insights from all types of time series data with InfluxDB. Ingest, query, and analyze billions of data points in real-time with unbounded cardinality.
www.influxdata.com
featured
  • cgm-remote-monitor

    nightscout web monitor

  • Install NightScout on VM: Ubuntu server 20.04 LTS NOTICE: If you do not have your own web page or static IP, you can user no-ip.com to register a web address. PLEASE READ THE INSTRUCTIONS WITH CARE. THERE ARE PLACES IN CONFIGURATION THAT NEED TO BE REPLACED WITH SPECIFIC VALUE. ------------------------------- ------- PREPARING ENV --------- ------------------------------- 1. Download and install mongoDB: sudo apt install mongodb 2. Install Node.js & GIT sudo apt-get install nodejs npm git 3. install nginx sudo apt-get install nginx 4. Install LetsEncrypt sudo apt-get install letsencrypt python3-certbot-nginx ------------------------------- ---- SETUP MONGO DB------------ ------------------------------- 1. enter mongodb: mongo 2. run following commands to create admin user > use admin > db.createUser( { user: "myUserAdmin", pwd: passwordPrompt(), // or cleartext password roles: [ { role: "userAdminAnyDatabase", db: "admin" }, "readWriteAnyDatabase" ] } ) > exit 3. edit mongodb config to enable authentication: sudo nano /etc/mongodb.conf 4. find the auth=true and uncomment it (delete '#'). Save the document 5. restart mongodb service: sudo systemctl restart mongodb ------------------------------- ---- SETUP NIGHTSCOUT --------- ------------------------------- 1. Go to home folder and clone NightScout repository: git clone https://github.com/nightscout/cgm-remote-monitor.git 2. Enter that directory and create a new file. that file will be used as a startup script: cd cgm-remote-monitor vi start.sh 3. Put the following: #!/usr/bin/bash # environment variables export DISPLAY_UNITS="mg/dl" export MONGO_CONNECTION="mongodb://username:password@localhost:27017/Nightscout?authSource=admin" export BASE_URL="https://YOUR.WEBPAGE.URL" export PORT=1234 export API_SECRET="PUT SOME PASSWORD HERE" export PUMP_FIELDS="reservoir battery status" export DEVICESTATUS_ADVANCED=true export ENABLE="careportal iob cob openaps pump bwg rawbg basal" export TIME_FORMAT=24 # start server node server.js 4. Save file. 5. make file executable: chmod a+x start.sh 6. check if it's working: sudo ./start.sh 7. if everything is ok, let's create a service. Create a new file: sudo vi /etc/systemd/system/nightscout.service 8. Paste the following: [Unit] Description=Nightscout Service After=network.target [Service] Type=simple WorkingDirectory=/your/nightscout/path/cgm-remote-monitor ExecStart=/your/nightscout/path/cgm-remote-monitor/start.sh [Install] WantedBy=multi-user.target 9. Save file and reload daemon: sudo systemctl daemon-reload 10. Start the service and enable it sudo systemctl enable nightscout.service sudo systemctl start nightscout.service ------------------------------- ------- SETUP NGINX ----------- ------------------------------- NGINX will be used as a reverse proxy. 1. stop the nginx service: sudo systemctl stop nginx 2. open /etc/nginx/sites-enabled/default file, delete everything in it and paste the following: sudo vi /etc/nginx/sites-enabled/default server { listen 80; server_name YOUR_WEB_ADDRESS_LIKE_cgm.ddns.net; location / { proxy_pass http://127.0.0.1:1234; proxy_http_version 1.1; proxy_set_header Upgrade $http_upgrade; proxy_set_header Connection 'upgrade'; proxy_set_header Host $host; proxy_cache_bypass $http_upgrade; } } 3. save file and start nginx: sudo systemctl start nginx 4. open the following ports on your router: 80 443 ------------------------------- ----- SETUP CERTIFICATES ------ ------------------------------- 1. run certbot to install certificates on your nginx sudo certbot --nginx -d YOUR_WEB_ADDRESS_LIKE_cgm.ddns.net 2. Enter you email address, Agree to Terms and It will ask you if you want to redirect all traffic from HTTP to HTTPS. Select yes (2). This automatically makes some changes to our NGINX default configuration. you can check new configuration by running: cat /etc/nginx/sites-enabled/default 3. it will also automatically install renewal of certificates. ------------------------- --- setup XDRIP------- ------------------------- In your xDrip+ go to Settings --> Cloud Upload-> NightScout Rest API Set following URL: https://API_SECRET_CODE@YOUR_WEB_PAGE/api/v1 enable synchronization. AND THAT'S IT.

  • SurveyJS

    Open-Source JSON Form Builder to Create Dynamic Forms Right in Your App. With SurveyJS form UI libraries, you can build and style forms in a fully-integrated drag & drop form builder, render them in your JS app, and store form submission data in any backend, inc. PHP, ASP.NET Core, and Node.js.

    SurveyJS logo
NOTE: The number of mentions on this list indicates mentions on common posts plus user suggested alternatives. Hence, a higher number means a more popular project.

Suggest a related project

Related posts

  • Svelte Series-1: An awesome framework

    6 projects | dev.to | 15 May 2024
  • Create a super fast AI assistant with Groq (Without a database)

    1 project | dev.to | 15 May 2024
  • React Compiler is now open source

    3 projects | news.ycombinator.com | 15 May 2024
  • Show HN: Open-Source BI as Code

    1 project | news.ycombinator.com | 15 May 2024
  • Deep Dive: Google Apps Script - Testing APIs and Automating Sheets

    1 project | dev.to | 15 May 2024