Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

document connecting to other instances #12

Merged
merged 3 commits into from
Jan 1, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion SUMMARY.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -49,4 +50,3 @@
* [Overview](device-api/overview.md)
* [Phoenix Channel](device-api/phoenix-channel.md)
* [HTTP Endpoint](device-api/http-endpoint.md)

3 changes: 1 addition & 2 deletions nerves-hub/setup/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.

2 changes: 1 addition & 1 deletion nerves-hub/setup/adding-nerveshub-to-your-project.md
Original file line number Diff line number Diff line change
@@ -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:

Expand Down
23 changes: 23 additions & 0 deletions nerves-hub/setup/connecting-other-envs.md
Original file line number Diff line number Diff line change
@@ -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
```