diff --git a/docs/_static/fly.toml b/docs/_static/fly.toml index 2b8f9083..f4af2158 100644 --- a/docs/_static/fly.toml +++ b/docs/_static/fly.toml @@ -3,7 +3,7 @@ # #--------------------------------------------------------------------------------- -# CHange the app value to your site name. (i.e. sitename to have sitename.fly.io +# Change the app value to your site name. (i.e. sitename to have sitename.fly.io #--------------------------------------------------------------------------------- app = "CHANGE ME TO YOUR SITE NAME!" kill_signal = "SIGINT" diff --git a/docs/_static/flyboot.sh b/docs/_static/flyboot.sh new file mode 100644 index 00000000..6604ce55 --- /dev/null +++ b/docs/_static/flyboot.sh @@ -0,0 +1,37 @@ +#!/bin/bash +###################################################################################################### +# +# Nightscout in Fly.io Scripted Deployment +# +###################################################################################################### +git clone https://github.com/nightscout/cgm-remote-monitor;cd cgm-remote-monitor;cat > fly.toml << "EOF" +app = "nightscout" +kill_signal = "SIGINT" +kill_timeout = 5 +processes = [] +[experimental] + allowed_public_ports = [] + auto_rollback = true +[[services]] + http_checks = [] + internal_port = 1337 + processes = ["app"] + protocol = "tcp" + script_checks = [] + [services.concurrency] + hard_limit = 25 + soft_limit = 20 + type = "connections" + [[services.ports]] + force_https = true + handlers = ["http"] + port = 80 + [[services.ports]] + handlers = ["tls", "http"] + port = 443 + [[services.tcp_checks]] + grace_period = "1s" + interval = "15s" + restart_limit = 0 + timeout = "2s" +EOF diff --git a/docs/_static/sitemap.xml b/docs/_static/sitemap.xml new file mode 100644 index 00000000..ce84d004 --- /dev/null +++ b/docs/_static/sitemap.xml @@ -0,0 +1,166 @@ + + + + + https://nightscout.github.io/ + + + https://nightscout.github.io/uploader/uploaders/ + + + https://nightscout.github.io/nightscout/new_user/ + + + https://nightscout.github.io/nightscout/wizard/ + + + https://nightscout.github.io/nightscout/database/ + + + https://nightscout.github.io/vendors/mongodb/atlas/ + + + https://nightscout.github.io/vendors/railway/database/ + + + https://nightscout.github.io/nightscout/platform/ + + + https://nightscout.github.io/vendors/northflank/database/ + + + https://nightscout.github.io/vendors/azure/new_user/ + + + https://nightscout.github.io/vendors/northflank/new_user/ + + + https://nightscout.github.io/vendors/render/new_user/ + + + https://nightscout.github.io/vendors/railway/new_user/ + + + https://nightscout.github.io/vendors/fly.io/new_user/ + + + https://nightscout.github.io/vendors/heroku/new_user/ + + + https://nightscout.github.io/nightscout/profile_editor/ + + + https://nightscout.github.io/uploader/setup/ + + + https://nightscout.github.io/nightscout/wearable/ + + + https://nightscout.github.io/nightscout/downloaders/ + + + https://nightscout.github.io/uploader/xdripcarelink/ + + + https://nightscout.github.io/nightscout/setup_variables/ + + + https://nightscout.github.io/troubleshoot/dexcom_bridge/ + + + https://nightscout.github.io/nightscout/discover/ + + + https://nightscout.github.io/nightscout/reports/ + + + https://nightscout.github.io/nightscout/security/ + + + https://nightscout.github.io/nightscout/admin_tools/ + + + https://nightscout.github.io/nightscout/close_loop/ + + + https://nightscout.github.io/nightscout/ifttt/ + + + https://nightscout.github.io/nightscout/pushover/ + + + https://nightscout.github.io/update/update/ + + + https://nightscout.github.io/troubleshoot/troubleshoot/ + + + https://nightscout.github.io/update/downgrade/ + + + https://nightscout.github.io/update/dev_branch/ + + + https://nightscout.github.io/nightscout/advanced/ + + + https://nightscout.github.io/vendors/VPS/ubuntu/ + + + https://nightscout.github.io/vendors/VPS/docker/ + + + https://nightscout.github.io/vendors/NAS/synology/ + + + https://nightscout.github.io/vendors/github/update/ + + + https://nightscout.github.io/nightscout/multiadmin/ + + + https://nightscout.github.io/troubleshoot/github/ + + + https://nightscout.github.io/update/redeploy/ + + + https://nightscout.github.io/troubleshoot/azure/ + + + https://nightscout.github.io/troubleshoot/atlas/ + + + https://nightscout.github.io/vendors/heroku/migrate/ + + + https://nightscout.github.io/troubleshoot/heroku/ + + + https://nightscout.github.io/vendors/heroku/ecoplan/ + + + https://nightscout.github.io/vendors/heroku/hobbyplan/ + + + https://nightscout.github.io/update/upd_stack/ + + + https://nightscout.github.io/vendors/heroku/mfa/ + + + https://nightscout.github.io/troubleshoot/fly.io/ + + + https://nightscout.github.io/troubleshoot/railway/ + + + https://nightscout.github.io/troubleshoot/render/ + + + https://nightscout.github.io/translate/ + + + https://nightscout.github.io/nightscout/dns/ + + \ No newline at end of file diff --git a/docs/troubleshoot/fly.io.md b/docs/troubleshoot/fly.io.md index e854fc5c..247f4cc7 100644 --- a/docs/troubleshoot/fly.io.md +++ b/docs/troubleshoot/fly.io.md @@ -2,208 +2,96 @@
-## Cleanup - -After several failed attempts to deploy or migrate, you might need to delete some apps. - -Log into Fly.io [https://fly.io/app/sign-in](https://fly.io/app/sign-in) (GitHub recommended) - - - -In normal running condition you will see only two apps on your dashboard: -The first one is your Nightscout site and the second one the builder (necessary). -If you used the migration wizard you will see another builder (three apps). - - - -
- -Clicking on your site you will see if it's healthy and running. This is where you go to open your site. - - - -
- -### Delete an app - -Select an app from the dashboard. Then click `Settings`. -Click `Delete app`. +If you've got IT knowledge you can install the [`flyctl`](https://fly.io/docs/hands-on/install-flyctl/) utility on your computer. - +If it's too complex for you the web terminal is an easy alternative. -Confirm copying the app name below, then click `Yes, delete it`. +## Use a web terminal - +a) In a new browser tab, [sign-in](https://fly.io/app/sign-in) with your fly.io account,then open a web [terminal](https://fly.io/terminal). +If you just closed the terminal, you might need to wait some time (20 minutes) before you can open a new session (the message below appears). -You have deleted your app. - -If you delete the builder (like in the picture above) you won't be able to deploy anymore. +
-### Delete your local repository - -You can delete the `cgm-remote-monitor` folder on your computer and fork it again. -Just make sure you backup the `fly.toml` file if you had a functional Nightscout site!!! +b) Click on the image with code (`Launch Web CLI`). -If you run PowerShell in Windows, exit the folder before deleting it, in task manager end the `flyctl.exe` task. +
-## Make your migrated app maintainable - -Follow these instructions to make your site maintainable and upgradable. - -### Step 1: Create a GitHub account and fork the Nightscout project +c) Wait until the web terminal is ready. -```{tab-set} - -:::{tab-item} I don't have a GitHub Account -### Create a GitHub account -::: {include} /vendors/github/create.md -### Fork the Nightscout project -:::{include} /vendors/github/fork.md -::: - -:::{tab-item} I already have a GitHub Account -### Update your Nightscout fork -:::{include} /vendors/github/update_b.md -::: - -``` - -
- -### Step 2: Download fly.io Command Line Interface (CLI) - -Fly.io is mainly managed through a command line interface (CLI). The first step will be installing the CLI [as documented here](https://fly.io/docs/flyctl/installing/). You need a computer for this. - -`flyctl is a command line interface to the Fly.io platform.` - -`It allows users to manage authentication, application launch, -deployment, network configuration, logging and more with just the -one command.` +
-### Step 3: Locally fork and deploy cgm-remote-monitor - -a) Clone the `cgm-remote-monitor` repository locally: - -If necessary install [Git](https://git-scm.com/downloads) on your computer (pick your own OS in Downloads). +d) A command prompt will open. -Open a PowerShell (Windows) or a terminal (OSX/Linux), and type (replace `yourGitHubNameHere` by your own GitHub account name): - -`git clone https://github.com/yourGitHubNameHere/cgm-remote-monitor` - - +
-b) Navigate to the directory where you code has been cloned locally - -`cd cgm-remote-monitor` - -
+## Cleanup -c) Recover the `fly.toml` deployment file from your migrated app. In the command line below replace `yourAppName` by the app name (usually your Nightscout site name: **`yourAppName`**`.fly.dev`). +After several failed attempts to deploy or migrate, you might need to delete some apps. -`flyctl config save -a yourAppName` +Log into Fly.io [https://fly.io/app/sign-in](https://fly.io/app/sign-in) (GitHub recommended) -
+ -d) Change the internal port number. +In normal running condition you will see only two apps on your dashboard: +The first one is your Nightscout site and the second one the builder (necessary). +If you used the migration wizard you will see another builder (three apps). -Edit the `fly.toml` file and replace `internal_port = 8080` by `internal_port = 1337`. -Save the file. +
-e) Recreate the environment variables. - -### If you migrated from and still have access to Heroku - -Backup your Heroku environment variables as explained [here](/troubleshoot/heroku.md#method-2-export). - -Edit the `fly.toml` file and paste all variables after `[env]`. Save the file. - -*Note: if you don't see `MONGODB_URI` but see `MONGO_CONNECTION` (NOT `MONGO_COLLECTION`) use its value.* - -**If you lost access to Heroku or you don't want to transform them in environment variables** - -You can leave the variables as secrets and use [this method](/vendors/fly.io/new_user.md#secrets) when you need to modify them. - -### If you lost access to Heroku but you want the variables to be easily maintainable - -Download the default [`fly.toml`](/_static/fly.toml) and correct all the variables values. +Clicking on your site you will see if it's healthy and running. This is where you go to open your site. -Make sure the app name `app =` is matching your site name. +
-f) Deploy the changes. - -Type the command: - -`flyctl deploy` - -Deploy will take some time and should complete with the message `1 desired, 1 placed, 1 healthy, 0 unhealthy [health checks: 1 total, 1 passing]`. +### Delete an app -
+Select an app from the dashboard. Then click `Settings`. +Click `Delete app`. -[Check your app is running on only one machine.](https://fly.io/dashboard/personal/machines) -If you only deployed one app and you see two machine like this: + - +Confirm copying the app name below, then click `Yes, delete it`. -Then [downscale your app](#downscale-your-app) and come back. + -
+You have deleted your app. -If you decided to keep the variables secret you have completed recovery. +If you delete the builder (like in the picture above) you won't be able to deploy anymore.
-g) Verify your environment variables: - -Type the command: - -`flyctl config env` +### Delete your local repository -You will see two lists of variables. -The first one will be your secrets. +#### If you deployed with your own computer (old method). - +You can delete the `cgm-remote-monitor` folder on your computer and fork it again. -Followed by the environment variables. +If you run PowerShell in Windows, exit the folder before deleting it, in task manager end the `flyctl.exe` task. - +#### If you deployed from the web terminal. -Make sure the environment variables match. +You don't have a local repository.
-h) Delete all secrets. - -You will need to delete the secrets. - -Copy paste this command line for the most usual ones. Wait until redeploy completes. - -`flyctl secrets unset ALARM_HIGH ALARM_LOW ALARM_TIMEAGO_URGENT ALARM_TIMEAGO_URGENT_MINS ALARM_TIMEAGO_WARN ALARM_TIMEAGO_WARN_MINS ALARM_TYPES ALARM_URGENT_HIGH ALARM_URGENT_LOW API_SECRET BG_HIGH BG_LOW BG_TARGET_BOTTOM BG_TARGET_TOP BRIDGE_PASSWORD BRIDGE_SERVER BRIDGE_USER_NAME CUSTOM_TITLE DISPLAY_UNITS ENABLE MMCONNECT_PASSWORD MMCONNECT_SERVER MMCONNECT_USER_NAME MONGODB_URI NIGHT_MODE PAPERTRAIL_API_TOKEN SHOW_PLUGINS SHOW_RAWBG THEME TIME_FORMAT AUTH_DEFAULT_ROLES BASAL_RENDER BOLUS_RENDER_FORMAT_SMALL BOLUS_RENDER_OVER DEVICESTATUS_ADVANCED IAGE_INFO IAGE_URGENT IAGE_WARN OPENAPS_COLOR_PREDICTION_LINES OPENAPS_FIELDS PUMP_FIELDS PUMP_URGENT_BATT PUMP_WARN_BATT SAGE_INFO SAGE_URGENT SAGE_WARN SCALE_Y SHOW_FORECAST` - -Continue to use `flyctl secrets unset` until all secrets have been removed. - -Verify your site is still functional. - -
+## Make your migrated app maintainable -```{danger} -Do NOT update your online fork of `cgm-remote-monitor` from your local version! -Your `fly.toml` contains confidential information that might be visible to anybody if you do so. +```{deprecated} July 2023 +Use the web terminal to modify your Fly.io deployment. ``` -Congratulations. You can now easily [modify your Nightscout Fly.io variables](/vendors/fly.io/new_user.md#env-variables) and [update](/update/update) your site. -
## Downscale your app diff --git a/docs/troubleshoot/northflank.md b/docs/troubleshoot/northflank.md index afc6c7ed..839761b0 100644 --- a/docs/troubleshoot/northflank.md +++ b/docs/troubleshoot/northflank.md @@ -1,3 +1,7 @@ +--- +orphan: true +--- + # Troubleshoot Northflank
diff --git a/docs/vendors/fly.io/img/FlyIO01.png b/docs/vendors/fly.io/img/FlyIO01.png index 4a2a7437..2a530444 100644 Binary files a/docs/vendors/fly.io/img/FlyIO01.png and b/docs/vendors/fly.io/img/FlyIO01.png differ diff --git a/docs/vendors/fly.io/img/FlyIO02.png b/docs/vendors/fly.io/img/FlyIO02.png index 3891e0bb..6a6cbbcc 100644 Binary files a/docs/vendors/fly.io/img/FlyIO02.png and b/docs/vendors/fly.io/img/FlyIO02.png differ diff --git a/docs/vendors/fly.io/img/FlyIO03.png b/docs/vendors/fly.io/img/FlyIO03.png deleted file mode 100644 index 97cfdf79..00000000 Binary files a/docs/vendors/fly.io/img/FlyIO03.png and /dev/null differ diff --git a/docs/vendors/fly.io/img/FlyIO04.png b/docs/vendors/fly.io/img/FlyIO04.png deleted file mode 100644 index e32fb096..00000000 Binary files a/docs/vendors/fly.io/img/FlyIO04.png and /dev/null differ diff --git a/docs/vendors/fly.io/img/FlyIO06.png b/docs/vendors/fly.io/img/FlyIO06.png new file mode 100644 index 00000000..02265dbe Binary files /dev/null and b/docs/vendors/fly.io/img/FlyIO06.png differ diff --git a/docs/vendors/fly.io/img/FlyIO07.png b/docs/vendors/fly.io/img/FlyIO07.png new file mode 100644 index 00000000..334e428f Binary files /dev/null and b/docs/vendors/fly.io/img/FlyIO07.png differ diff --git a/docs/vendors/fly.io/img/FlyIO08.png b/docs/vendors/fly.io/img/FlyIO08.png new file mode 100644 index 00000000..e9ab59f0 Binary files /dev/null and b/docs/vendors/fly.io/img/FlyIO08.png differ diff --git a/docs/vendors/fly.io/img/FlyIO09.png b/docs/vendors/fly.io/img/FlyIO09.png new file mode 100644 index 00000000..a57f07f6 Binary files /dev/null and b/docs/vendors/fly.io/img/FlyIO09.png differ diff --git a/docs/vendors/fly.io/img/FlyIO13.png b/docs/vendors/fly.io/img/FlyIO13.png new file mode 100644 index 00000000..993b4b8d Binary files /dev/null and b/docs/vendors/fly.io/img/FlyIO13.png differ diff --git a/docs/vendors/fly.io/img/FlyIO14.png b/docs/vendors/fly.io/img/FlyIO14.png new file mode 100644 index 00000000..655f22bb Binary files /dev/null and b/docs/vendors/fly.io/img/FlyIO14.png differ diff --git a/docs/vendors/fly.io/img/FlyIO15.png b/docs/vendors/fly.io/img/FlyIO15.png new file mode 100644 index 00000000..d11900a6 Binary files /dev/null and b/docs/vendors/fly.io/img/FlyIO15.png differ diff --git a/docs/vendors/fly.io/img/FlyIO16.png b/docs/vendors/fly.io/img/FlyIO16.png new file mode 100644 index 00000000..c2208e21 Binary files /dev/null and b/docs/vendors/fly.io/img/FlyIO16.png differ diff --git a/docs/vendors/fly.io/img/FlyIO17.png b/docs/vendors/fly.io/img/FlyIO17.png new file mode 100644 index 00000000..6755430c Binary files /dev/null and b/docs/vendors/fly.io/img/FlyIO17.png differ diff --git a/docs/vendors/fly.io/img/FlyIO18.png b/docs/vendors/fly.io/img/FlyIO18.png new file mode 100644 index 00000000..1568de4d Binary files /dev/null and b/docs/vendors/fly.io/img/FlyIO18.png differ diff --git a/docs/vendors/fly.io/img/FlyIO19.png b/docs/vendors/fly.io/img/FlyIO19.png new file mode 100644 index 00000000..be4a3a2a Binary files /dev/null and b/docs/vendors/fly.io/img/FlyIO19.png differ diff --git a/docs/vendors/fly.io/img/FlyIO20.png b/docs/vendors/fly.io/img/FlyIO20.png new file mode 100644 index 00000000..d649aa9f Binary files /dev/null and b/docs/vendors/fly.io/img/FlyIO20.png differ diff --git a/docs/vendors/fly.io/img/FlyIO21.png b/docs/vendors/fly.io/img/FlyIO21.png new file mode 100644 index 00000000..4ef0d1cc Binary files /dev/null and b/docs/vendors/fly.io/img/FlyIO21.png differ diff --git a/docs/vendors/fly.io/img/FlyIO22.png b/docs/vendors/fly.io/img/FlyIO22.png new file mode 100644 index 00000000..d1204ae8 Binary files /dev/null and b/docs/vendors/fly.io/img/FlyIO22.png differ diff --git a/docs/vendors/fly.io/img/FlyIOA3.png b/docs/vendors/fly.io/img/FlyIOA3.png deleted file mode 100644 index 53505db0..00000000 Binary files a/docs/vendors/fly.io/img/FlyIOA3.png and /dev/null differ diff --git a/docs/vendors/fly.io/img/FlyM16.png b/docs/vendors/fly.io/img/FlyM16.png deleted file mode 100644 index 89dde3ff..00000000 Binary files a/docs/vendors/fly.io/img/FlyM16.png and /dev/null differ diff --git a/docs/vendors/fly.io/img/FlyT05.png b/docs/vendors/fly.io/img/FlyT05.png deleted file mode 100644 index 5e154ebd..00000000 Binary files a/docs/vendors/fly.io/img/FlyT05.png and /dev/null differ diff --git a/docs/vendors/fly.io/img/FlyT06.png b/docs/vendors/fly.io/img/FlyT06.png deleted file mode 100644 index 67f2f175..00000000 Binary files a/docs/vendors/fly.io/img/FlyT06.png and /dev/null differ diff --git a/docs/vendors/fly.io/migrate.md b/docs/vendors/fly.io/migrate.md index feef2847..ea67f7e3 100644 --- a/docs/vendors/fly.io/migrate.md +++ b/docs/vendors/fly.io/migrate.md @@ -179,19 +179,7 @@ Save this information in a safe place!
-## Step 4 - Install Fly.io command line interface - -```{admonition} Fly.io flyctl -:class: warning -You MUST be able to use this program in order to maintain your Fly.io Nightscout app. -``` - -Follow the example [here](/vendors/fly.io/new_user.md#editing-config-vars-in-flyio) and confirm you can get it to behave as expected. -Your Fly.io app name is the one you defined above in step 1.f. - -
- -## Step 5 - Update your uploaders and downloaders +## Step 4 - Update your uploaders and downloaders Now you will need to update all the devices connected to Nightscout with the new web address. diff --git a/docs/vendors/fly.io/new_user.md b/docs/vendors/fly.io/new_user.md index 270b1800..50961235 100644 --- a/docs/vendors/fly.io/new_user.md +++ b/docs/vendors/fly.io/new_user.md @@ -14,324 +14,612 @@ Consider a hosted Nightscout service! Check for easier solutions [here](/index.m ## Fly.io ![Fly.io](/vendors/img/Fly.io.png) ^^^ -Fly.io proposes a [simple migration wizard from Heroku](/vendors/fly.io/migrate.md) and you can create your new Nightscout site in Fly.io. Using a computer is mandatory with Fly.io as managing your site will require the use of a command line utility. **Not recommended for beginners.** +Fly.io proposes a [simple migration wizard from Heroku](/vendors/fly.io/migrate.md) and you can create your new Nightscout site in Fly.io. **Pros**: * Nightscout fits in the free tier * Easy to migrate an existing site from Heroku **Cons**: -* **Maintaining your site requires the use of a computer with command line instructions, not very intuitive** -* Migrated Heroku sites store variables as secrets +* **Maintaining your site requires the use of command line instructions, not very intuitive** +* Fly.io stores variables as secrets: you cannot read them * Relying on the MongoDB Atlas database ``` -
+

## Step 0: Create a database -```{admonition} Fly.io doesn't include a database -:class: note -Make sure you [created one](/nightscout/database) before starting your Nightscout web app creation with Fly.io. -Come back here when you have a `MONGODB_URI` connection string. -``` +```{tab-set} +:::{tab-item} I don't have a database yet +
Make sure you [create one](/nightscout/database) before starting your Nightscout web app creation with Fly.io.

+Come back here when you have a `MONGODB_URI` connection string.

+::: +:::{tab-item} I already have a database +
Copy the connection string from your previous platform: [edit the variables](/nightscout/setup_variables.md#nightscout-configuration) and look for `MONGODB_URI`.

+If you don't see `MONGODB_URI` but see `MONGO_CONNECTION` (**NOT** `MONGO_COLLECTION`): use its value.

+::: -```{admonition} Migrating? -:class: tip -Copy the connection string from your previous platform: [edit the variables](/nightscout/setup_variables.md#nightscout-configuration) and look for `MONGODB_URI`. -If you don't see `MONGODB_URI` but see `MONGO_CONNECTION` (**NOT** `MONGO_COLLECTION`): use its value. ``` -
+

-## Step 1: Create a GitHub account and fork the Nightscout project +## Step 1: Create a fly.io account -```{tab-set} +[Sign up](https://fly.io/app/sign-up) to Fly.io. -:::{tab-item} I don't have a GitHub Account -### Create a GitHub account -::: {include} /vendors/github/create.md -### Fork the Nightscout project -:::{include} /vendors/github/fork.md -::: +
-:::{tab-item} I already have a GitHub Account -### Update your Nightscout fork -:::{include} /vendors/github/update_b.md -::: +You don't need to input card information to get Nightscout running. +Click the `Try fly.io for free` button: -``` + -
+

-## Step 2: Download fly.io Command Line Interface (CLI) +## Step 2: Open the web terminal -Fly.io is mainly managed through a command line interface (CLI). The first step will be installing the CLI [which is documented here](https://fly.io/docs/flyctl/installing/). +a) In a new browser tab, open the [terminal](https://fly.io/terminal). Sign-in with the account you created above, if requested.
+If you just closed the terminal, you might need to wait some time (20 minutes) before you can open a new session (the message below appears). -
+ -## Step 3: Create a fly.io account +
+ +b) Click on the image with code (`Launch Web CLI`). -a) `flyctl auth signup` will begin the signup process, alternatively go to [https://fly.io/app/sign-up](https://fly.io/app/sign-up) to login. -Sign up with Github. +
-b) `Authorize Fly.io` for GitHub: +c) Wait until the web terminal is ready. - +
-c) You don't need to input card information to get Nightscout running so click the `Try fly.io for free` button: +d) A command prompt will open. You will either type the few required commands there or copy/paste them from the documentation. - +

-## Step 4: Locally fork and deploy cgm-remote-monitor - -a) Clone the `cgm-remote-monitor` repository locally: - -If necessary install [Git](https://git-scm.com/downloads) on your computer (pick your own OS in Downloads). +## Step 3: Prepare the Nightscout project -Open a PowerShell (Windows) or a terminal (OSX/Linux), and type (replace `yourGitHubNameHere` by your own GitHub account name): +Type (or copy and paste) the following command in the terminal:
-`git clone https://github.com/yourGitHubNameHere/cgm-remote-monitor` +`curl https://nightscout.github.io/_static/flyboot.sh | bash`

-b) Navigate to the directory where you code has been cloned locally +b) Navigate to the Nightscout code directory copied locally by typing: `cd cgm-remote-monitor` + +
-c) Download this [**fly.toml template**](/_static/fly.toml) deployment file and save it/copy it into your `cgm-remote-monitor` folder. +c) Deploy your site with Fly.io. +Type the following command: -
+`flyctl launch` -```{warning} -Do NOT sync your local fly,toml with GitHub to avoid exposing all your passwords on GitHub!!! -``` +
-## Step 5: Setting Variables - -Open the `fly.toml` configuration file in your `cgm-remote-monitor` folder and customize it. +To the question `Would you like to copy its configuration to the new app?` answer `Y` (yes). -a) `API_SECRET` will be your Nightscout site password, it needs to be at least 12 characters long and you should **NOT use spaces** if you use @ or ! symbols remember you will probably need to express them using [Percent encoding](https://en.wikipedia.org/wiki/Percent-encoding#Percent-encoding_reserved_characters) in your uploader and downloader apps. If you're not sure on how to do this, it is recommended to use only letters (uppercase + lowercase) and digits. +To the question: `App Name (leave blank to use an auto-generated name):` answer with the name you want for your new Nightscout site (lowercase letters, numbers, `-` but **no space or special characters**. -```{warning} -The API_SECRET is the **main password allowing full access to your Nightscout site**. Make sure it's reasonably secure (mix uppercase and lowercase letters, plus digits) and **do no not share it publicly**. If you think you exposed it by mistake, it is recommended that you **change it**. -``` +
-b) Set the units to use for Nightscout where acceptable choices are `mg/dl` or `mmol/L` (or just `mmol`). +If you see an `Error` message, the name is either unauthorized or already taken. + +Go back to **c)** and try another one. + +
-c) Now you need the connection string you defined during the Atlas cluster creation (as the example below, but not the string below). +If you see `Configuration is valid`, you can continue. -Make sure it looks like this one below and NOTE: THERE ARE NO < AND > CHARACTERS: +The name you chose will be your Nightscout site name (followed by `fly.dev`). -Example for MongoDB Atlas: + -`mongodb+srv://nightscout:soo5ecret@cluster0.xxxxx.mongodb.net/?retryWrites=true&w=majority` +

-Example for a MongoDB database: +## Step 5: Set your Nightscout secrets -`mongodb://nightscout:soo5ecret@mydbhosting.fqd/mydatabase` +a) Compile the information below. -```{hint} -Ensure you have `" "` surrounding your URI to make sure all of it is captured within the variable. -``` +File all necessary fields, click on the Validate button at the bottom of the form, if no error is seen you will have all variables displayed in the text box at the bottom, click on the Copy All button.
-d) If you want to link your Dexcom Share account as a data source, complete the following lines: `BRIDGE_USER_NAME`, `BRIDGE_PASSWORD` and `BRIDGE_SERVER`. +### **Mandatory variables** -```{note} -If you use a DIY closed loop system it is recommended that you let it upload to Nightscout instead of importing using Dexcom Share and the `bridge` plugin. -``` +These three variables below must have a value. + +**MONGODB_URI** + +The MongoDB Connection String to connect to your MongoDB cluster. If you don't have this from your Mongo database, please re-read installation instructions at [Nightscout database](https://nightscout.github.io/nightscout/database) before continuing + +
+ +**API_SECRET** + +
+ +A passphrase that must be at least 12 characters long. Avoid special characters, which can cause problems in some cases + +**DISPLAY_UNITS** + +
+ + +
Preferred BG units for the site: `mg/dl` or `mmol/l` (or just `mmol`)
-```{admonition} MOST COMMON ERRORS -:class: hint -The most common error on initial Nightscout setups is that people incorrectly use an old account or an old password. To test your username and password, go to Dexcom's Clarity page (check [here for USA accounts](https://clarity.dexcom.com) and [here for the others](https://clarity.dexcom.eu)) and try logging in to your Dexcom account. If your account info isn't valid, or you don't see any data in your Clarity account... you need to figure out your actual credentials before moving ahead. See [here](/troubleshoot/dexcom_bridge/) for troubleshooting tips and information on your Dexcom account. -``` +### **Customizations** -```{admonition} Password -:class: note -*Some people have had problems with their bridge connecting when their Dexcom passwords are entirely numeric. If you have connection issues in that case, try changing your password to something with a mix of numbers and letters.* -``` +Leave default values if you don't want to change them -```{hint} -You need to have at least one follower to use Dexcom Share. See [here](/uploader/setup.md#dexcom). -``` +**CUSTOM_TITLE** -
+
-e) In [`ENABLE`](/nightscout/setup_variables.md#enable), copy and paste the following words (separated by a space) so that won't have to think about which you want now: +The display name for the Nightscout site. Appears in the upper left of the main view. Often set to the name of the CGM wearer -`careportal basal dbsize rawbg iob maker cob bwp cage iage sage boluscalc pushover treatmentnotify loop pump profile food openaps bage alexa override speech cors` +**THEME** -**If you are using your Dexcom share account as a data source** also add `bridge` at the end, after a space like this: +
-`careportal basal dbsize rawbg iob maker cob bwp cage iage sage boluscalc pushover treatmentnotify loop pump profile food openaps bage alexa override speech cors bridge` +
Default setting for new browser views for the color theme of the CGM graph. (`default` `colors` or `colorblindfriendly`) -```{hint} -Ensure you have `" "` surrounding your words to make sure all of them are captured within the variable. -``` +**ENABLE** -
+
-f) You can customize other variables or leave default values. +Plugins to enable for your site. Must be a space-delimited lower-case list. Include the word `bridge` here if you are receiving data from the Dexcom Share service -
+**SHOW_PLUGINS** -g) You can now deploy your site with Fly.io. -Type the following command: +
-`flyctl launch` +Default setting for whether or not these plugins are checked (active) by default not merely enabled. Include plugins here as in the ENABLE line; space-separated and lower-case -
+**TIME_FORMAT** -To the question `Would you like to copy its configuration to the new app?` answer `Y` (yes). +
-To the question: `App Name (leave blank to use an auto-generated name):` answer with the same same you've put in the `fly.toml` file in the top line `app = ""`. -To the question `Select region: ` select the region closer to where you live (using the up and down arrows). +
Default setting for new browser views for the time mode. (`12` or `24`) - +**NIGHT_MODE** -To the question `Would you like to set up an Postgresql database now?` answer `N` (no). +
-To the question `Would you like to set up an Upstash Redis database now?` answer `N` (no). -To the question `Would you like to deploy now?` answer `Y` (yes). +
Default setting for new browser views for whether Night Mode should be enabled. (`on` or `off`) - +**BOLUS_RENDER_OVER** + +
+ +U value over which the bolus values are rendered on the chart if the `x U and Over` option is selected
-Deploy will take some time. Do not interrupt the process. +### **Dexcom Share** - +If you want Nightscout to import directly from Dexcom Share -
+**BRIDGE_USER_NAME** + +
-If you see the following text: +Your Dexcom account username to receive CGM data from the Dexcom Share service. Also make sure to include `bridge` in your ENABLE line. -`1 desired, 1 placed, 1 healthy, 0 unhealthy [health checks: 1 total, 1 passing]` +**BRIDGE_PASSWORD** -You have successfully deployed Nightscout in Fly.io. Congratulations. +
-If you see an unhealthy condition, check your `fly.toml` configuration (for missing " " for example) and type: +Your Dexcom account password to receive CGM data from the Dexcom Share service. Also make sure to include `bridge` in your ENABLE line -`flyctl deploy` +**BRIDGE_SERVER** + +
+ + +
If you are bridging from the Dexcom Share service and are anywhere *outside* the US change this to EU. (`US` or `EU`)
-h) Once your site has processed the variables and redeployed itself it will be ready to use. In your fly.io dashboard at [https://fly.io/dashboard](https://fly.io/dashboard) click on the application (not the builder): +### **Alarms** - +You can customize alarms or leave them to default values + +**ALARM_TYPES** + +
+ + +
`simple` and/or `predict`v. Simple alarms trigger when BG crosses the various thresholds set below. Predict alarms use a formula that forecasts where the BG is going based on its trend. You will *not* get warnings when crossing the BG thresholds set below when using the predict type + +**ALARM_URGENT_HIGH** + +
+ +Urgent High BG threshold triggers the `ALARM_URGENT_HIGH` alarm. Set in mg/dL or mmol/L as set in `DISPLAY_UNITS` variable + +**ALARM_URGENT_LOW** + +
+ +Urgent Low BG threshold triggers the `ALARM_URGENT_LOW` alarm. Set in mg/dL or mmol/L as set in `DISPLAY_UNITS` variable + +**ALARM_HIGH** + +
+ +High BG threshold triggers the `ALARM_HIGH` alarm. Set in mg/dL or mmol/L as set in `DISPLAY_UNITS` variable + +**ALARM_LOW** + +
+ +Low BG threshold triggers the `ALARM_LOW` alarm. Set in mg/dL or mmol/L as set in `DISPLAY_UNITS` variable + +**ALARM_TIMEAGO_URGENT** + +
+ +Default setting for new browser views for the number of minutes since the last CGM reading to trigger an `ALARM_TIMEAGO_URGENT` alarm + +**ALARM_TIMEAGO_WARN** + +
+ +Default setting for new browser views for the number of minutes since the last CGM reading to trigger an `ALARM_TIMEAGO_WARN` alarm + + + + + + +Now click on the Validate button below + + + +If errors show up below, please correct them and click Validate again. + +

Click the button Validate above.

+

+

+ +
+

+ +

+ +```{admonition} Save this! +:class: warning +What you just copied is the secrets configuration used to build your site.
+This is important information to maintain your Nightscout.
+**Make sure you keep a copy of it somewhere safe.** +```
-i) Inside your app you should see that it is running and has a clickable hostname. +b) Click on the `Copy all` button above. - +```{tip} +Now do not copy anything else!
+If you do another copy/paste after you clicked the `Copy All` button, click again **now** before pasting the configuration! +```
-j) Recent versions of flyctl will make the app high availability (2 machines) by default, and this might generate problems for Nightscout. -Make sure to downscale your app with the following command (replace ***`app_name`*** with your own app name): +c) Then, in the terminal, paste what you copied above, hit `Enter` -`flyctl scale --app `***`app_name`***` count 1` +
-```{include} /nightscout/first_setup.md +Wait until setting secrets complete. -``` + + +

+ +## Step 6: Deploy Nightscout + +a) In the terminal type: + +`fly deploy` + +You app will deploy. It will take time (about 10 minutes). + +
- +Do not interrupt the process. -## Editing Config Vars in Fly.io +
+ +When deploy completes you should see your new Nightscout site name. + +
-You will find your Nightscout variables under different forms depending on your deployment method. +b) Last but not least: make sure to downscale your app with the following command: + +`flyctl scale count 1` + + -If you migrated using the wizard, they will be secrets. +Enter `y` to confirm. -If you deployed a new site as explained in this documentation they will be environment variables. +
-### Env variables +c) Exit the terminal typing `exit` or pressing `Ctrl D` (`⌘ D` with a Mac). -Environment variables can be viewed with [flyctl](https://fly.io/docs/hands-on/install-flyctl) using the following command: +Keep in mind you'll need some time to reopen it if you need to (as explained in step 2 above). +Close the browser tab. -`flyctl config env` +
-If you want to modify a configuration variable you need to edit the `fly.toml` file in your local `cgm-remote-monitor` copy (the one you created at [step 5](#step-5-setting-variables) above). +d) You can now see your site in the fly.io dashboard at [https://fly.io/dashboard](https://fly.io/dashboard) click on the application (not the builder): -Once variable(s) modified, save the file and run the following command (from inside your `cgm-remote-monitor`). + -`flyctl deploy` +
+ +e) Inside your app you should see that it is running and has a clickable hostname. + +
-### Secrets +
-Your variables are stored as secrets if you used the migration wizard. +```{include} /nightscout/first_setup.md -```{admonition} Secrets -:class: warning -You **cannot see the values of your secret variables as they are secret**. -You can only delete them and set them: you **cannot edit them**. -Please make sure you write them down somewhere! ```
-**Once Nightscout deployed, you need to install [flyctl](https://fly.io/docs/hands-on/install-flyctl/) to access your variables in order to change or customize your site.** -Variables are described [here](/nightscout/setup_variables.md#nightscout-config-vars). + -[Sign in with GitHub](https://fly.io/docs/hands-on/sign-in/) in your CLI interface (Powershell/Terminal). -A new browser will open. Select the entry with your email address. -If required, authenticate through GitHub. +## Editing Config Vars in Fly.io - +### Open a web terminal + +In a new browser tab, [sign-in](https://fly.io/app/sign-in) with your fly.io account, then open a web [terminal](https://fly.io/terminal).
+(See [here](/troubleshoot/fly.io.md#use-a-web-terminal) the detailed sequence).
-Fly.io variables are named `Secrets` and you cannot visualize them. -Look [here](https://fly.io/docs/getting-started/working-with-fly-apps/#working-with-secrets) for more details. +```{admonition} Secrets +:class: warning +Fly.io variables are `Secrets`, you **cannot see the values of your secret variables**.
+You can only delete them and set them: you **cannot edit them**.
+Please make sure you write them down somewhere! +```
-If you want to create a new variable or modify an existing one you need to use the `flyctl secrets set` command. +If you want to create a new secret or modify an existing one you need to use the `flyctl secrets set` command. + +In the command line below replace `yourappname` by the app name (usually your Nightscout site name: **`yourappname`**`.fly.dev`). For example if you want to set your Nightscout site vertical scale to linear: `flyctl secrets set SCALE_Y="linear" -a yourappname` -If your `SCALE_Y` variable was already set to `linear` you will see the following message: -`Error No change detected to secrets. Skipping release.` +If your `SCALE_Y` secret was already set to `linear` you will see the following message: -When changing a variable, the app will automatically redeploy. You will see this sequence (it will take a few minutes): +``` +Error No change detected to secrets. Skipping release. +``` + +When changing a secret, the app will automatically redeploy. You will see this sequence (it will take a few minutes): ``` Release v1 created @@ -342,3 +630,19 @@ Release v1 created ```
+ +```{hint} +If you know you will change several secrets, add `--stage` to all the lines except the last one. +

+`flyctl secrets set SCALE_Y="linear" -a yourappname --stage` +
+`flyctl secrets set SCALE_Y="linear" -a yourappname --stage` +
+... +
+`flyctl secrets set SCALE_Y="linear" -a yourappname` +

+This will avoid your app to redeploy every time. +``` + +