diff --git a/README.md b/README.md index 3db5f99..c158726 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@ -# LoRa Server Docker setup +# ChirpStack Docker example -This repository contains a skeleton to setup the [LoRa Server](https://www.loraserver.io) -project using [docker-compose](https://docs.docker.com/compose/). +This repository contains a skeleton to setup the [ChirpStack](https://www.chirpstack.io) +open-source LoRaWAN Network Server stack using [Docker Compose](https://docs.docker.com/compose/). **Note:** Please use this `docker-compose.yml` file as a starting point for testing but keep in mind that for production usage it might need modifications. @@ -10,18 +10,18 @@ but keep in mind that for production usage it might need modifications. * `docker-compose.yml`: the docker-compose file containing the services * `docker-compose-env.yml`: alternate docker-compose file using environment variables, can be run with the docker-compose `-f` flag -* `configuration/lora*`: directory containing the LoRa Server configuration files, see: - * https://www.loraserver.io/lora-gateway-bridge/install/config/ - * https://www.loraserver.io/loraserver/install/config/ - * https://www.loraserver.io/lora-app-server/install/config/ - * https://www.loraserver.io/lora-geo-server/install/config/ +* `configuration/chirpstack*`: directory containing the ChirpStack configuration files, see: + * https://www.chirpstack.io/gateway-bridge/install/config/ + * https://www.chirpstack.io/network-server/install/config/ + * https://www.chirpstack.io/application-server/install/config/ + * https://www.chirpstack.io/geolocation-server/install/config/ * `configuration/postgresql/initdb/`: directory containing PostgreSQL initialization scripts ## Configuration -The LoRa Server components are pre-configured to work with the provided +The ChirpStack stack components components are pre-configured to work with the provided `docker-compose.yml` file and defaults to the EU868 LoRaWAN band. Please refer -to the `configuration/loraserver/examples` directory for more configuration +to the `configuration/chirpstack-network-server/examples` directory for more configuration examples. # Data persistence @@ -36,7 +36,7 @@ installed. ## Usage -To start all the LoRa Server components, simply run: +To start the ChirpStack open-source LoRaWAN Network Server stack, simply run: ```bash $ docker-compose up @@ -51,8 +51,8 @@ $ docker-compose up After all the components have been initialized and started, you should be able to open http://localhost:8080/ in your browser. -### Add network-server +### Add Network Server -When adding the network-server in the LoRa App Server web-interface -(see [network-servers](https://www.loraserver.io/lora-app-server/use/network-servers/)), -you must enter `loraserver:8000` as the network-server `hostname:IP`. +When adding the Network Server in the ChirpStack Application Server web-interface +(see [Network Servers](https://www.chirpstack.io/application-server/use/network-servers/)), +you must enter `chirpstack-network-server:8000` as the Network Server `hostname:IP`. diff --git a/configuration/lora-app-server/lora-app-server.toml b/configuration/chirpstack-application-server/chirpstack-application-server.toml similarity index 55% rename from configuration/lora-app-server/lora-app-server.toml rename to configuration/chirpstack-application-server/chirpstack-application-server.toml index 7a18539..b019310 100644 --- a/configuration/lora-app-server/lora-app-server.toml +++ b/configuration/chirpstack-application-server/chirpstack-application-server.toml @@ -1,8 +1,8 @@ -# See https://www.loraserver.io/lora-app-server/install/config/ for a full +# See https://www.chirpstack.io/application-server/install/config/ for a full # configuration example and documentation. [postgresql] -dsn="postgres://loraserver_as:loraserver_as@postgresql/loraserver_as?sslmode=disable" +dsn="postgres://chirpstack_as:chirpstack_as@postgresql/chirpstack_as?sslmode=disable" [redis] url="redis://redis:6379" @@ -11,7 +11,7 @@ url="redis://redis:6379" server="tcp://mosquitto:1883" [application_server.api] -public_host="appserver:8001" +public_host="chirpstack-application-server:8001" [application_server.external_api] bind="0.0.0.0:8080" diff --git a/configuration/lora-gateway-bridge/lora-gateway-bridge.toml b/configuration/chirpstack-gateway-bridge/chirpstack-gateway-bridge.toml similarity index 62% rename from configuration/lora-gateway-bridge/lora-gateway-bridge.toml rename to configuration/chirpstack-gateway-bridge/chirpstack-gateway-bridge.toml index b94818e..702460d 100644 --- a/configuration/lora-gateway-bridge/lora-gateway-bridge.toml +++ b/configuration/chirpstack-gateway-bridge/chirpstack-gateway-bridge.toml @@ -1,4 +1,4 @@ -# See https://www.loraserver.io/lora-gateway-bridge/install/config/ for a full +# See https://www.chirpstack.io/gateway-bridge/install/config/ for a full # configuration example and documentation. [integration.mqtt.auth.generic] diff --git a/configuration/lora-geo-server/lora-geo-server.toml b/configuration/chirpstack-geolocation-server/chirpstack-geolocation-server.toml similarity index 76% rename from configuration/lora-geo-server/lora-geo-server.toml rename to configuration/chirpstack-geolocation-server/chirpstack-geolocation-server.toml index e8161e7..2389c83 100644 --- a/configuration/lora-geo-server/lora-geo-server.toml +++ b/configuration/chirpstack-geolocation-server/chirpstack-geolocation-server.toml @@ -1,4 +1,4 @@ -# See https://www.loraserver.io/lora-geo-server/install/config/ for a full +# See https://www.chirpstack.io/geolocation-server/install/config/ for a full # configuration example and documentation. [geo_server.backend] diff --git a/configuration/loraserver/loraserver.toml b/configuration/chirpstack-network-server/chirpstack-network-server.toml similarity index 77% rename from configuration/loraserver/loraserver.toml rename to configuration/chirpstack-network-server/chirpstack-network-server.toml index ea1bb37..8a3c2a9 100644 --- a/configuration/loraserver/loraserver.toml +++ b/configuration/chirpstack-network-server/chirpstack-network-server.toml @@ -1,11 +1,11 @@ -# See https://www.loraserver.io/loraserver/install/config/ for a full +# See https://www.chirpstack.io/network-server/install/config/ for a full # configuration example and documentation. # # This file is for the EU868 band. See the examples/ folder for more # configuration examples. [postgresql] -dsn="postgres://loraserver_ns:loraserver_ns@postgresql/loraserver_ns?sslmode=disable" +dsn="postgres://chirpstack_ns:chirpstack_ns@postgresql/chirpstack_ns?sslmode=disable" [redis] url="redis://redis:6379" @@ -47,7 +47,7 @@ name="EU_863_870" server="tcp://mosquitto:1883" [join_server.default] -server="http://appserver:8003" +server="http://chirpstack-application-server:8003" [geolocation_server] -server="geoserver:8005" +server="chirpstack-geolocation-server:8005" diff --git a/configuration/loraserver/examples/loraserver.eu868.toml b/configuration/chirpstack-network-server/examples/chirpstack-network-server.eu868.toml similarity index 77% rename from configuration/loraserver/examples/loraserver.eu868.toml rename to configuration/chirpstack-network-server/examples/chirpstack-network-server.eu868.toml index ea1bb37..8a3c2a9 100644 --- a/configuration/loraserver/examples/loraserver.eu868.toml +++ b/configuration/chirpstack-network-server/examples/chirpstack-network-server.eu868.toml @@ -1,11 +1,11 @@ -# See https://www.loraserver.io/loraserver/install/config/ for a full +# See https://www.chirpstack.io/network-server/install/config/ for a full # configuration example and documentation. # # This file is for the EU868 band. See the examples/ folder for more # configuration examples. [postgresql] -dsn="postgres://loraserver_ns:loraserver_ns@postgresql/loraserver_ns?sslmode=disable" +dsn="postgres://chirpstack_ns:chirpstack_ns@postgresql/chirpstack_ns?sslmode=disable" [redis] url="redis://redis:6379" @@ -47,7 +47,7 @@ name="EU_863_870" server="tcp://mosquitto:1883" [join_server.default] -server="http://appserver:8003" +server="http://chirpstack-application-server:8003" [geolocation_server] -server="geoserver:8005" +server="chirpstack-geolocation-server:8005" diff --git a/configuration/loraserver/examples/loraserver.us915.0.toml b/configuration/chirpstack-network-server/examples/chirpstack-network-server.us915.0.toml similarity index 65% rename from configuration/loraserver/examples/loraserver.us915.0.toml rename to configuration/chirpstack-network-server/examples/chirpstack-network-server.us915.0.toml index fea97c0..ef9308b 100644 --- a/configuration/loraserver/examples/loraserver.us915.0.toml +++ b/configuration/chirpstack-network-server/examples/chirpstack-network-server.us915.0.toml @@ -1,11 +1,11 @@ -# See https://www.loraserver.io/loraserver/install/config/ for a full +# See https://www.chirpstack.io/network-server/install/config/ for a full # configuration example and documentation. # # This file is for the US915 band (channels 0-7). See the examples/ folder for more # configuration examples. [postgresql] -dsn="postgres://loraserver_ns:loraserver_ns@postgresql/loraserver_ns?sslmode=disable" +dsn="postgres://chirpstack_ns:chirpstack_ns@postgresql/chirpstack_ns?sslmode=disable" [redis] url="redis://redis:6379" @@ -23,7 +23,7 @@ name="US_902_928" server="tcp://mosquitto:1883" [join_server.default] -server="http://appserver:8003" +server="http://chirpstack-application-server:8003" [geolocation_server] -server="geoserver:8005" +server="chirpstack-geolocation-server:8005" diff --git a/configuration/loraserver/examples/loraserver.us915.1.toml b/configuration/chirpstack-network-server/examples/chirpstack-network-server.us915.1.toml similarity index 67% rename from configuration/loraserver/examples/loraserver.us915.1.toml rename to configuration/chirpstack-network-server/examples/chirpstack-network-server.us915.1.toml index 338b213..f2b439b 100644 --- a/configuration/loraserver/examples/loraserver.us915.1.toml +++ b/configuration/chirpstack-network-server/examples/chirpstack-network-server.us915.1.toml @@ -1,4 +1,4 @@ -# See https://www.loraserver.io/loraserver/install/config/ for a full +# See https://www.chirpstack.io/network-server/install/config/ for a full # configuration example and documentation. # # This file is for the US915 band (channels 8-15). See the examples/ folder for more @@ -7,7 +7,7 @@ # Note: these channels are also used by TTN. [postgresql] -dsn="postgres://loraserver_ns:loraserver_ns@postgresql/loraserver_ns?sslmode=disable" +dsn="postgres://chirpstack_ns:chirpstack_ns@postgresql/chirpstack_ns?sslmode=disable" [redis] url="redis://redis:6379" @@ -25,8 +25,7 @@ name="US_902_928" server="tcp://mosquitto:1883" [join_server.default] -server="http://appserver:8003" +server="http://chirpstack-application-server:8003" [geolocation_server] -server="geoserver:8005" - +server="chirpstack-geolocation-server:8005" diff --git a/configuration/postgresql/initdb/001-init-chirpstack_ns.sh b/configuration/postgresql/initdb/001-init-chirpstack_ns.sh new file mode 100644 index 0000000..685e3f8 --- /dev/null +++ b/configuration/postgresql/initdb/001-init-chirpstack_ns.sh @@ -0,0 +1,7 @@ +#!/bin/bash +set -e + +psql -v ON_ERROR_STOP=1 --username "$POSTGRES_USER" <<-EOSQL + create role chirpstack_ns with login password 'chirpstack_ns'; + create database chirpstack_ns with owner chirpstack_ns; +EOSQL diff --git a/configuration/postgresql/initdb/001-init-loraserver_ns.sh b/configuration/postgresql/initdb/001-init-loraserver_ns.sh deleted file mode 100644 index a8f3ff9..0000000 --- a/configuration/postgresql/initdb/001-init-loraserver_ns.sh +++ /dev/null @@ -1,7 +0,0 @@ -#!/bin/bash -set -e - -psql -v ON_ERROR_STOP=1 --username "$POSTGRES_USER" <<-EOSQL - create role loraserver_ns with login password 'loraserver_ns'; - create database loraserver_ns with owner loraserver_ns; -EOSQL diff --git a/configuration/postgresql/initdb/002-init-chirpstack_as.sh b/configuration/postgresql/initdb/002-init-chirpstack_as.sh new file mode 100644 index 0000000..1dc2ed8 --- /dev/null +++ b/configuration/postgresql/initdb/002-init-chirpstack_as.sh @@ -0,0 +1,7 @@ +#!/bin/bash +set -e + +psql -v ON_ERROR_STOP=1 --username "$POSTGRES_USER" <<-EOSQL + create role chirpstack_as with login password 'chirpstack_as'; + create database chirpstack_as with owner chirpstack_as; +EOSQL diff --git a/configuration/postgresql/initdb/002-init-loraserver_as.sh b/configuration/postgresql/initdb/002-init-loraserver_as.sh deleted file mode 100644 index 3480ad6..0000000 --- a/configuration/postgresql/initdb/002-init-loraserver_as.sh +++ /dev/null @@ -1,7 +0,0 @@ -#!/bin/bash -set -e - -psql -v ON_ERROR_STOP=1 --username "$POSTGRES_USER" <<-EOSQL - create role loraserver_as with login password 'loraserver_as'; - create database loraserver_as with owner loraserver_as; -EOSQL diff --git a/configuration/postgresql/initdb/003-chirpstack_as_trgm.sh b/configuration/postgresql/initdb/003-chirpstack_as_trgm.sh new file mode 100644 index 0000000..b1e6c0c --- /dev/null +++ b/configuration/postgresql/initdb/003-chirpstack_as_trgm.sh @@ -0,0 +1,6 @@ +#!/bin/bash +set -e + +psql -v ON_ERROR_STOP=1 --username "$POSTGRES_USER" --dbname="chirpstack_as" <<-EOSQL + create extension pg_trgm; +EOSQL diff --git a/configuration/postgresql/initdb/003-loraserver_as_trgm.sh b/configuration/postgresql/initdb/003-loraserver_as_trgm.sh deleted file mode 100644 index ac2fa58..0000000 --- a/configuration/postgresql/initdb/003-loraserver_as_trgm.sh +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/bash -set -e - -psql -v ON_ERROR_STOP=1 --username "$POSTGRES_USER" --dbname="loraserver_as" <<-EOSQL - create extension pg_trgm; -EOSQL diff --git a/configuration/postgresql/initdb/004-chirpstack_as_hstore.sh b/configuration/postgresql/initdb/004-chirpstack_as_hstore.sh new file mode 100644 index 0000000..920de9c --- /dev/null +++ b/configuration/postgresql/initdb/004-chirpstack_as_hstore.sh @@ -0,0 +1,6 @@ +#!/bin/bash +set -e + +psql -v ON_ERROR_STOP=1 --username "$POSTGRES_USER" --dbname="chirpstack_as" <<-EOSQL + create extension hstore; +EOSQL diff --git a/configuration/postgresql/initdb/004-loraserver_as_hstore.sh b/configuration/postgresql/initdb/004-loraserver_as_hstore.sh deleted file mode 100644 index 810a1a4..0000000 --- a/configuration/postgresql/initdb/004-loraserver_as_hstore.sh +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/bash -set -e - -psql -v ON_ERROR_STOP=1 --username "$POSTGRES_USER" --dbname="loraserver_as" <<-EOSQL - create extension hstore; -EOSQL diff --git a/docker-compose-env.yml b/docker-compose-env.yml index 84ba6eb..badbf2a 100644 --- a/docker-compose-env.yml +++ b/docker-compose-env.yml @@ -1,36 +1,36 @@ version: "3" services: - loraserver: - image: loraserver/loraserver:3 + chirpstack-network-server: + image: chirpstack/chirpstack-network-server:3 environment: - - POSTGRESQL.DSN=postgres://loraserver_ns:loraserver_ns@postgresql/loraserver_ns?sslmode=disable + - POSTGRESQL.DSN=postgres://chirpstack_ns:chirpstack_ns@postgresql/chirpstack_ns?sslmode=disable - REDIS.URL=redis://redis:6379 - NETWORK_SERVER.BAND.NAME=EU_863_870 - NETWORK_SERVER.GATEWAY.BACKEND.MQTT.SERVER=tcp://mosquitto:1883 - - JOIN_SERVER.DEFAULT.SERVER=http://appserver:8003 - - GEOLOCATION_SERVER.SERVER=geoserver:8005 + - JOIN_SERVER.DEFAULT.SERVER=http://chirpstack-application-server:8003 + - GEOLOCATION_SERVER.SERVER=chirpstack-geolocation-server:8005 - appserver: - image: loraserver/lora-app-server:3 + chirpstack-application-server: + image: chirpstack/chirpstack-application-server:3 ports: - 8080:8080 environment: - - POSTGRESQL.DSN=postgres://loraserver_as:loraserver_as@postgresql/loraserver_as?sslmode=disable + - POSTGRESQL.DSN=postgres://chirpstack_as:chirpstack_as@postgresql/chirpstack_as?sslmode=disable - REDIS.URL=redis://redis:6379 - APPLICATION_SERVER.INTEGRATION.MQTT.SERVER=tcp://mosquitto:1883 - - APPLICATION_SERVER.API.PUBLIC_HOST=appserver:8001 + - APPLICATION_SERVER.API.PUBLIC_HOST=chirpstack-application-server:8001 - APPLICATION_SERVER.EXTERNAL_API.JWT_SECRET=verysecret - gatewaybridge: - image: loraserver/lora-gateway-bridge:3 + chirpstack-gateway-bridge: + image: chirpstack/chirpstack-gateway-bridge:3 ports: - 1700:1700/udp environment: - INTEGRATION.MQTT.AUTH.GENERIC.SERVER=tcp://mosquitto:1883 - geoserver: - image: loraserver/lora-geo-server:3 + chirpstack-geolocation-server: + image: chirpstack/chirpstack-geolocation-server:3 environment: - GEO_SERVER.BACKEND.NAME=collos diff --git a/docker-compose.yml b/docker-compose.yml index 825c475..bee2ca7 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -1,29 +1,29 @@ version: "3" services: - loraserver: - image: loraserver/loraserver:3 + chirpstack-network-server: + image: chirpstack/chirpstack-network-server:3 volumes: - - ./configuration/loraserver:/etc/loraserver + - ./configuration/chirpstack-network-server:/etc/chirpstack-network-server - appserver: - image: loraserver/lora-app-server:3 + chirpstack-application-server: + image: chirpstack/chirpstack-application-server:3 ports: - 8080:8080 volumes: - - ./configuration/lora-app-server:/etc/lora-app-server + - ./configuration/chirpstack-application-server:/etc/chirpstack-application-server - gatewaybridge: - image: loraserver/lora-gateway-bridge:3 + chirpstack-gateway-bridge: + image: chirpstack/chirpstack-gateway-bridge:3 ports: - 1700:1700/udp volumes: - - ./configuration/lora-gateway-bridge:/etc/lora-gateway-bridge + - ./configuration/chirpstack-gateway-bridge:/etc/chirpstack-gateway-bridge - geoserver: - image: loraserver/lora-geo-server:3 + chirpstack-geolocation-server: + image: chirpstack/chirpstack-geolocation-server:3 volumes: - - ./configuration/lora-geo-server:/etc/lora-geo-server + - ./configuration/chirpstack-geolocation-server:/etc/chirpstack-geolocation-server postgresql: image: postgres:9.6-alpine