Skip to content

Commit 30af8e4

Browse files
committed
Updates after ChirpStack rename.
1 parent ccaf5a7 commit 30af8e4

File tree

31 files changed

+208
-292
lines changed

31 files changed

+208
-292
lines changed

LICENSE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
The MIT License (MIT)
22

3-
Copyright (c) 2018 Orne Brocaar (www.brocaar.com)
3+
Copyright (c) 2019 Orne Brocaar (www.brocaar.com)
44

55
Permission is hereby granted, free of charge, to any person obtaining a copy
66
of this software and associated documentation files (the "Software"), to deal

README.md

Lines changed: 20 additions & 98 deletions
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,29 @@
1-
# LoRa Server setup
1+
# ChirpStack stack setup (Ansible & Vagrant)
22

33
This repository provides an [Ansible](https://www.ansible.com) playbook to
4-
setup the [LoRa Server](https://www.loraserver.io/).
5-
project (including dependencies). With the included
6-
[Vagrant](https://www.vagrant.com) file, the LoRa Server can also be setup
7-
locally (e.g. on [VirtualBox](https://www.virtualbox.org)).
4+
setup the [ChirpStack](https://www.chirpstack.io/) open-source LoRaWAN Network Server stack.
5+
With the included [Vagrant](https://www.vagrant.com) file, the ChirpStack stack can also be setup
6+
locally inside a VM (e.g. using [VirtualBox](https://www.virtualbox.org)).
87

98
It will:
109

1110
* Setup firewall rules (iptables)
1211
* Setup Mosquitto (MQTT broker) + connection credentials
1312
* Setup Redis
1413
* Setup PostgreSQL + creation of roles and databases
15-
* Setup [LoRa Gateway Bridge](https://www.loraserver.io/lora-gateway-bridge/)
16-
* Setup [LoRa Server](https://www.loraserver.io/loraserver/)
17-
* Setup [LoRa App Server](https://www.loraserver.io/lora-app-server/)
18-
* Setup [LoRa Geo Server](https://www.loraserver.io/lora-geo-server/)
14+
* Setup [ChirpStack Gateway Bridge](https://www.chirpstack.io/gateway-bridge/)
15+
* Setup [ChirpStack Network Server](https://www.chirpstack.io/network-server/)
16+
* Setup [ChirpStack Application Server](https://www.chirpstack.io/application-server/)
17+
* Setup [ChirpStack Geolocation Server](https://www.chirpstack.io/geolocation-server/)
1918
* Request a HTTPS certificate from [Let's Encrypt](https://letsencrypt.org)
2019

2120
## Vagrant (local environment using VirtualBox)
2221

2322
The included `Vagrantfile` will setup a Debian Stretch (9.x) virtual
24-
machine with the latest LoRa Server components installed. It will also forward
23+
machine with the latest ChirpStack stack components installed. It will also forward
2524
the following ports to your host system:
2625

27-
* `8080`: LoRa App Server UI and API
26+
* `8080`: ChirpStack Application Server UI and API
2827
* `1700`: UDP listener for the packet-forwarder data
2928
* `1883`: Mosquitto MQTT
3029
* `1884`: Mosquitto Websockets
@@ -34,15 +33,15 @@ automatically installed inside the Vagrant machine).
3433

3534
### Requirements
3635

37-
When setting up the LoRa Server environment, make sure you have a recent
36+
When setting up the ChirpStack stack, make sure you have a recent
3837
version of [Vagrant](https://www.vagrantup.com) installed.
3938

4039
Also make sure you have a recent version of [VirtualBox](https://www.virtualbox.org)
4140
installed, including the [VirtualBox Extension Pack](https://www.virtualbox.org/wiki/Downloads).
4241

4342
### Getting started
4443

45-
1. Update `roles/loraserver/templates/loraserver.toml` so that the
44+
1. Update `roles/chirpstack-network-server/templates/chirpstack-network-server.toml` so that the
4645
`network_server.band.name` matches the LoRaWAN band to use. Depending the
4746
chosen band, you might also be interested in updating other network-server
4847
settings listed under the `network_server.network_settings` section.
@@ -130,22 +129,22 @@ The Ansible playbook has been tested on the following images:
130129
4. Copy the `group_vars/single_server.example.yml` inside this repository to
131130
`group_vars/single_server.yml` and change the settings where needed.
132131

133-
5. Update the LoRa Gateway Bridge, LoRa App Server and LoRa Server configuration
132+
5. Update the ChirpStack Gateway Bridge, ChirpStack Application Server and ChirpStack Network Server configuration
134133
files under:
135134

136-
* `roles/lora-gateway-bridge/templates/lora-gateway-bridge.toml`
137-
* `roles/lora-app-server/templates/lora-app-server.toml`
138-
* `roles/loraserver/templates/loraserver.toml`
135+
* `roles/chirpstack-gateway-bridge/templates/chirpstack-gateway-bridge.toml`
136+
* `roles/chirpstack-application-server/templates/chirpstack-application-server.toml`
137+
* `roles/chirpstack-network-server/templates/chirpstack-network-server.toml`
139138

140139
See also the following links for more documentation:
141140

142-
* https://www.loraserver.io/lora-gateway-bridge/
143-
* https://www.loraserver.io/loraserver/
144-
* https://www.loraserver.io/lora-app-server/
141+
* https://www.chirpstack.io/gateway-bridge/
142+
* https://www.chirpstack.io/network-server/
143+
* https://www.chirpstack.io/application-server/
145144

146145
### Provisioning
147146

148-
Run the following command from your machine to deploy LoRa Server to your
147+
Run the following command from your machine to deploy the ChirpStack stack to your
149148
target instance, to upgrade to the latest versions or to update the
150149
configuration:
151150

@@ -156,80 +155,3 @@ ansible-playbook -i inventory full_deploy.yml
156155
After the playbook has been completed, the dashboard should be accessible from
157156
http://yourdomain.com/. When you have enabled the LetsEncrypt TLS certificate
158157
setup, this will automatically redirect to https://yourdomain.com/.
159-
160-
161-
## Changelog (playbook changes)
162-
163-
### 2019-08-23
164-
165-
* Cleanup of tasks.
166-
* Configuration updates.
167-
168-
### 2019-05-20
169-
170-
* Updated to LoRa Server v3.
171-
* Updated configuration files + added examples for US915 band.
172-
173-
### 2019-03-07
174-
175-
* Added NGINX proxy in front of LoRa App Server.
176-
* Updated LetsEncrypt TLS request command to use NGINX plugin.
177-
* Added TLS configuration for Mosquitto.
178-
179-
### 2018-10-30
180-
181-
* LoRa App Server default configuration now uses http (no TLS certificate).
182-
183-
### 2018-09-17
184-
185-
* Updated playbook to support Ubuntu 18.04.x, 16.04.x and Debian Stretch (9.x).
186-
* `postgresql` package is always installed from distribution repository.
187-
* `mosquitto` package is always installed from distribution repository.
188-
* Added installation of LoRa Geo Server service.
189-
190-
### 2018-07-30
191-
192-
* Change to LoRa Server v2 apt repository.
193-
194-
### 2018-04-22
195-
196-
* Remove `mosquitto-auth-plug` setup (which was causing a lot of issues)
197-
* Update configuration `.yml` files under `group_vars` and `host_vars` (for Vagrant)
198-
199-
### 2018-02-22
200-
201-
* Include LoRa Gateway Bridge, LoRa App Server and LoRa Server configuration
202-
files as templates. See **Configuration**.
203-
204-
### 2017-12-16
205-
206-
* `auth_opt_aclquery` query of the mosquitto-auth-plug has been updated
207-
as application users have been deprecated.
208-
209-
### 2017-07-26
210-
211-
* `GW_SERVER_JWT_SECRET` configuration option has been added to the example
212-
configuration file, which will be mandatory for
213-
[LoRa Server](https://docs.loraserver.io/) 0.20.0.
214-
215-
* Port `8002` (used by [LoRa Gateway Config](https://docs.loraserver.io/lora-gateway-config/))
216-
has been added as public accessible port in the example configuration.
217-
218-
* `letsencrypt` cli has been changed to `certbot` cli (as per installation
219-
instructions documented at https://certbot.eff.org).
220-
221-
### 2017-06-20
222-
223-
* Mosquitto authentication / authorization has been added (using
224-
[mosquitto-auth-plug](https://github.com/jpmens/mosquitto-auth-plug)).
225-
The `loraserver_hosts.example.yml` has been updated with example
226-
configuration. Note that anonymous connections will be rejected. This allows
227-
users to connect to the MQTT broker using their LoRa App Server credentials.
228-
229-
### 2017-03-28
230-
231-
* PostgreSQL 9.6 will now be installed from the [PostgreSQL deb repository](https://www.postgresql.org/download/).
232-
In case you're upgrading, make sure to migrate your data.
233-
234-
* Mosquitto will be now be installed from either the Mosquitto PPA or
235-
the [Mosquitto deb repository](https://mosquitto.org/download/).

full_deploy.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
- name: install python-minimal
1010
raw: apt-get install -y python-minimal
1111

12-
- name: single-server loraserver setup
12+
- name: single-server ChirpStack setup
1313
hosts:
1414
- single_server
1515
- vagrant
@@ -22,9 +22,9 @@
2222
- redis
2323
- mosquitto
2424
- mosquitto-auth
25-
- lora-gateway-bridge
26-
- loraserver
27-
- lora-app-server
28-
- lora-geo-server
25+
- chirpstack-gateway-bridge
26+
- chirpstack-network-server
27+
- chirpstack-application-server
28+
- chirpstack-geolocation-server
2929
become: yes
3030

group_vars/single_server.example.yml

Lines changed: 17 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -50,20 +50,20 @@ mosquitto:
5050
request: False
5151
users:
5252
-
53-
user: loraserver_gw
54-
password: loraserver_gw
53+
user: chirpstack_gw
54+
password: chirpstack_gw
5555
topics:
5656
- write gateway/+/event/+
5757
- read gateway/+/command/+
5858
-
59-
user: loraserver_ns
60-
password: loraserver_ns
59+
user: chirpstack_ns
60+
password: chirpstack_ns
6161
topics:
6262
- read gateway/+/event/+
6363
- write gateway/+/command/+
6464
-
65-
user: loraserver_as
66-
password: loraserver_as
65+
user: chirpstack_as
66+
password: chirpstack_as
6767
topics:
6868
- write application/+/device/+/rx
6969
- write application/+/device/+/join
@@ -73,8 +73,8 @@ mosquitto:
7373
- write application/+/device/+/location
7474
- read application/+/device/+/tx
7575
-
76-
user: loraserver_app
77-
password: loraserver_app
76+
user: chirpstack_app
77+
password: chirpstack_app
7878
topics:
7979
- write application/+/device/+/tx
8080
- read application/+/device/+/rx
@@ -91,20 +91,19 @@ mosquitto:
9191
postgresql:
9292
databases:
9393
-
94-
name: loraserver_as
95-
user: loraserver_as
96-
password: loraserver_as
94+
name: chirpstack_as
95+
user: chirpstack_as
96+
password: chirpstack_as
9797
-
98-
name: loraserver_ns
99-
user: loraserver_ns
100-
password: loraserver_ns
98+
name: chirpstack_ns
99+
user: chirpstack_ns
100+
password: chirpstack_ns
101101

102-
# lora-app-server configuration
103-
lora_app_server:
104-
# the full domain by which LoRa App Server is reachable
102+
# ChirpStack Application Server configuration.
103+
chirpstack_application_server:
104+
# the full domain by which ChirpStack Application Server is reachable
105105
# e.g. subdomain.example.com
106106
fqdn: localhost
107107
letsencrypt:
108108
109109
request: False
110-

host_vars/vagrant.yml

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -45,20 +45,20 @@ mosquitto:
4545
protocol: websockets
4646
users:
4747
-
48-
user: loraserver_gw
49-
password: loraserver_gw
48+
user: chirpstack_gw
49+
password: chirpstack_gw
5050
topics:
5151
- write gateway/+/event/+
5252
- read gateway/+/command/+
5353
-
54-
user: loraserver_ns
55-
password: loraserver_ns
54+
user: chirpstack_ns
55+
password: chirpstack_ns
5656
topics:
5757
- read gateway/+/event/+
5858
- write gateway/+/command/+
5959
-
60-
user: loraserver_as
61-
password: loraserver_as
60+
user: chirpstack_as
61+
password: chirpstack_as
6262
topics:
6363
- write application/+/device/+/rx
6464
- write application/+/device/+/join
@@ -68,8 +68,8 @@ mosquitto:
6868
- write application/+/device/+/location
6969
- read application/+/device/+/tx
7070
-
71-
user: loraserver_app
72-
password: loraserver_app
71+
user: chirpstack_app
72+
password: chirpstack_app
7373
topics:
7474
- write application/+/device/+/tx
7575
- read application/+/device/+/rx
@@ -83,16 +83,16 @@ mosquitto:
8383
postgresql:
8484
databases:
8585
-
86-
name: loraserver_as
87-
user: loraserver_as
88-
password: loraserver_as
86+
name: chirpstack_as
87+
user: chirpstack_as
88+
password: chirpstack_as
8989
-
90-
name: loraserver_ns
91-
user: loraserver_ns
92-
password: loraserver_ns
90+
name: chirpstack_ns
91+
user: chirpstack_ns
92+
password: chirpstack_ns
9393

94-
# lora-app-server configuration
95-
lora_app_server:
94+
# ChirpStack Application Server configuration.
95+
chirpstack_application_server:
9696
fqdn: localhost
9797
letsencrypt:
9898

roles/base/tasks/main.yml

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,11 @@
1111
- sudo
1212
- libcap2-bin
1313

14-
- name: import LoRa Server gpg key
14+
- name: import ChirpStack gpg key
1515
apt_key:
1616
keyserver: keyserver.ubuntu.com
1717
id: 1CE2AFD36DBCCA00
1818

19-
- name: add LoRa Server deb repository
19+
- name: add ChirpStack deb repository
2020
apt_repository:
21-
repo: deb https://artifacts.loraserver.io/packages/3.x/deb stable main
22-
21+
repo: deb https://artifacts.chirpstack.io/packages/3.x/deb stable main
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
- name: restart chirpstack-application-server
2+
service:
3+
name: chirpstack-application-server
4+
state: restarted
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
- name: install chirpstack-application-server
2+
package:
3+
name: chirpstack-application-server
4+
state: latest
5+
6+
- name: copy configuration
7+
template:
8+
src: chirpstack-application-server.toml
9+
dest: /etc/chirpstack-application-server/chirpstack-application-server.toml
10+
owner: appserver
11+
group: appserver
12+
mode: 0640
13+
notify:
14+
- restart chirpstack-application-server
15+
16+
- name: request letsencrypt certificate
17+
command: certbot --nginx certonly --non-interactive --agree-tos -m {{ chirpstack_application_server.letsencrypt.email }} -d {{ chirpstack_application_server.fqdn }}
18+
when: chirpstack_application_server.letsencrypt.request
19+
20+
- name: add nginx proxy
21+
template:
22+
src: chirpstack-application-server.nginx
23+
dest: /etc/nginx/sites-enabled/chirpstack-application-server
24+
notify:
25+
- reload nginx
26+
27+
- name: start chirpstack-application-server on boot
28+
service:
29+
name: chirpstack-application-server
30+
state: started
31+
enabled: yes

0 commit comments

Comments
 (0)