From 01c2929a8a3242ecd729d02b12cce279a90107f1 Mon Sep 17 00:00:00 2001 From: Jon Carstens Date: Tue, 22 Dec 2020 17:20:13 -0700 Subject: [PATCH 1/3] document connecting to other instances --- SUMMARY.md | 2 +- nerves-hub/setup/README.md | 3 +-- .../setup/adding-nerveshub-to-your-project.md | 2 +- nerves-hub/setup/connecting-other-envs.md | 23 +++++++++++++++++++ 4 files changed, 26 insertions(+), 4 deletions(-) create mode 100644 nerves-hub/setup/connecting-other-envs.md diff --git a/SUMMARY.md b/SUMMARY.md index 55620b0..d494406 100644 --- a/SUMMARY.md +++ b/SUMMARY.md @@ -15,6 +15,7 @@ * [Devices](nerves-hub/setup/devices.md) * [Firmware](nerves-hub/setup/firmware.md) * [Deployments](nerves-hub/setup/deployments.md) + * [Connecting to other environments](nerves-hub/setup/connecting-other-envs.md) * [Managing organizations and products](nerves-hub/managing-organizations-and-products.md) * [Device management](nerves-hub/device-management.md) * [Custom Deployment](nerves-hub/custom-deployment/README.md) @@ -49,4 +50,3 @@ * [Overview](device-api/overview.md) * [Phoenix Channel](device-api/phoenix-channel.md) * [HTTP Endpoint](device-api/http-endpoint.md) - diff --git a/nerves-hub/setup/README.md b/nerves-hub/setup/README.md index 8287bd4..80cc335 100644 --- a/nerves-hub/setup/README.md +++ b/nerves-hub/setup/README.md @@ -2,7 +2,6 @@ ## Getting Started -The following sections will walk you through updating your Nerves project to work with the [nerves-hub.org](https://nerves-hub.org) NervesHub server. Using your own NervesHub server will require setting URLs to point elsewhere and is not covered below to simplify first usage. +The following sections will walk you through updating your Nerves project to work with the [nerves-hub.org](https://nerves-hub.org) NervesHub server. For connecting to your own NervesHub or another location, look at [`Setup: Connecting to other environemnts`](connecting-other-envs.md) first, then continue from here. Many of the following steps may feel manual, but they can and are automated by NervesHub users to set up automatic firmware updates from CI and to manufacture large numbers of devices. - diff --git a/nerves-hub/setup/adding-nerveshub-to-your-project.md b/nerves-hub/setup/adding-nerveshub-to-your-project.md index a405e3b..a99389e 100644 --- a/nerves-hub/setup/adding-nerveshub-to-your-project.md +++ b/nerves-hub/setup/adding-nerveshub-to-your-project.md @@ -1,4 +1,4 @@ -# Add NervesHub to your project +# Add NervesHubLink to your project The first step is to add [`nerves_hub_link`](https://github.com/nerves-hub/nerves_hub_link) to your target dependencies in your project's `mix.exs`. Since NervesHub uses SSL certificates, the time must be set on the device or certificate validity checks will fail. If you're not already setting the time, add [`nerves_time`](https://hex.pm/packages/nerves_time) to your dependencies. For example: diff --git a/nerves-hub/setup/connecting-other-envs.md b/nerves-hub/setup/connecting-other-envs.md new file mode 100644 index 0000000..a747a6d --- /dev/null +++ b/nerves-hub/setup/connecting-other-envs.md @@ -0,0 +1,23 @@ +# Connecting to other environments + +Some cases may require you to target other instances of NervesHub, such as testing a staging environment or directing devices to a self-hosted NervesHub. In these cases, you'll need to specify a few additional details in your application config: + +```elixir +host = "my-nerves-hub.org" +port = 443 +# With a separate instance, the Server CA Certificates will be different +# and need to be provided. +ca_certs = "/path/to/my-nerves-hub.org/ca_certs" + +config :nerves_hub_link, + device_api_host: "device.#{host}", + device_api_sni: 'device.#{host}', + device_api_port: port, + ca_certs: ca_certs + +config :nerves_hub_user_api, + host: "api.#{host}", + port: port, + server_name_indication: "api.#{host}", + ca_certs: ca_certs +``` From 3013bbbd31c7bbec77640dfb59153a74268c0d9d Mon Sep 17 00:00:00 2001 From: Jon Carstens Date: Wed, 23 Dec 2020 11:16:36 -0700 Subject: [PATCH 2/3] Update nerves-hub/setup/connecting-other-envs.md Co-authored-by: Frank Hunleth --- nerves-hub/setup/connecting-other-envs.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nerves-hub/setup/connecting-other-envs.md b/nerves-hub/setup/connecting-other-envs.md index a747a6d..13e9dc4 100644 --- a/nerves-hub/setup/connecting-other-envs.md +++ b/nerves-hub/setup/connecting-other-envs.md @@ -1,6 +1,6 @@ # Connecting to other environments -Some cases may require you to target other instances of NervesHub, such as testing a staging environment or directing devices to a self-hosted NervesHub. In these cases, you'll need to specify a few additional details in your application config: +Some cases may require you to target other instances of NervesHub, such as testing a staging environment or directing devices to a self-hosted NervesHub. In these cases, you'll need to add your server's information to your project's application config: ```elixir host = "my-nerves-hub.org" From 4d7ee9632a140906d8aacae0cb00b9700bf15cb9 Mon Sep 17 00:00:00 2001 From: Jon Carstens Date: Wed, 23 Dec 2020 13:50:58 -0700 Subject: [PATCH 3/3] Update nerves-hub/setup/README.md Co-authored-by: Frank Hunleth --- nerves-hub/setup/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nerves-hub/setup/README.md b/nerves-hub/setup/README.md index 80cc335..c628691 100644 --- a/nerves-hub/setup/README.md +++ b/nerves-hub/setup/README.md @@ -2,6 +2,6 @@ ## Getting Started -The following sections will walk you through updating your Nerves project to work with the [nerves-hub.org](https://nerves-hub.org) NervesHub server. For connecting to your own NervesHub or another location, look at [`Setup: Connecting to other environemnts`](connecting-other-envs.md) first, then continue from here. +The following sections will walk you through updating your Nerves project to work with the [nerves-hub.org](https://nerves-hub.org) NervesHub server. For connecting to your own NervesHub or another location, look at [`Setup: Connecting to other environments`](connecting-other-envs.md) first, then continue from here. Many of the following steps may feel manual, but they can and are automated by NervesHub users to set up automatic firmware updates from CI and to manufacture large numbers of devices.