c0cd3a3361
Initially this was added to make development using Docker Compose easier. However, in my experience Docker Compose is not great for the reason that there might be environmental differences between Rust running in Compose and Rust running outside Compose (if using VSCode with Rust plugin, then rust-analyzer will perform checks in the background). This and 'cross' not working properly in Compose was the reason to migrate to nix, as it provides a reproducible environment for development that can also be used by VSCode (using the Nix environment selector extension) and GitHub Actions (for the CI pipeline). As the chirpstack-docker repository provides its own configuration files, these files are not included in the Dockerfile and because we are rewriting these env variables anyway to 'localhost' in the .deb and .rpm post-installation script, it is better to set these to localhost by default. The post-installation rewrite to 'localhost' is causing issues on upgrade (#295). If we only do the rewrite on initial installation, then we run in an other issue; the package-manager will prompt that the config file has changed (from 'localhost' to '$MQTT_BROKER_HOST' for example) and will ask if you would like to overwrite or not. If the end-user would accept the config changes without looking at the diff this would break the installation as most likely, these environment are not set (which is why we were rewriting these to 'localhost' in the first place). |
||
---|---|---|
.cargo | ||
.docker-compose/postgresql/initdb | ||
.github | ||
api | ||
backend | ||
chirpstack | ||
chirpstack-integration | ||
cross | ||
examples | ||
lrwn | ||
lrwn-filters | ||
ui | ||
.dockerignore | ||
.env | ||
.gitattributes | ||
.gitignore | ||
Cargo.lock | ||
Cargo.toml | ||
Cross.toml | ||
docker-compose.yml | ||
Dockerfile | ||
Dockerfile-devel | ||
LICENSE | ||
Makefile | ||
README.md | ||
rust-toolchain.toml | ||
shell.nix |
ChirpStack open-source LoRaWAN(R) Network Server
ChirpStack is an open-source LoRaWAN(R) Network Server which can be used to set up LoRaWAN networks. ChirpStack provides a web-interface for the management of gateways, devices and tenants as well to set up data integrations with the major cloud providers, databases and services commonly used for handling device data. ChirpStack provides a gRPC based API that can be used to integrate or extend ChirpStack.
Documentation and binaries
Please refer to the ChirpStack website for documentation and pre-compiled binaries.
Building from source
Requirements
Building ChirpStack requires:
Nix
Nix is used for setting up the development environment which is used for local development and for creating the binaries.
If you do not have Nix installed and do not wish to install it, then you can use the provided Docker Compose based Nix environment. To start this environment execute the following command:
make docker-devshell
Note: You will be able to run the test commands and run cargo build
, but
cross-compiling will not work within this environment (because it would try start
Docker within Docker).
Docker
Docker is used by cross-rs for cross-compiling,
as well as some of the make
commands.
Starting the development shell
Run the following command to start the development shell:
nix-shell
Or if you do not have Nix installed, execute the following command:
make docker-devshell
Building the UI
To build the ChirpStack UI, execute the following command:
make build-ui
Running ChirpStack tests
Start required services
ChirpStack requires several services like PostgresQL, Redis, Mosquitto, ...
to be running before you can run the tests. You need to start these services
manually if you started the development shell using nix-shell
:
docker-compose up -d
Run tests
Run the following command to run the ChirpStack tests:
make test
Building ChirpStack binaries
Before compiling the binaries, you need to install some additional development tools (for cross-compiling, packaging, e.d.). Execute the following command:
make dev-dependencies
Run the following command within the ./chirpstack
sub-folder:
# Build AMD64 debug build (optimized for build speed)
make debug-amd64
# Build AMD64 release build (optimized for performance and binary size)
make release-amd64
# Build all packages (all targets, .deb, .rpm and .tar.gz files)
make dist
License
ChirpStack Network Server is distributed under the MIT license. See also LICENSE.