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..c628691 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 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. - 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..13e9dc4 --- /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 add your server's information to your project's 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 +```