Climate Server is a server application that can be used to collect and aggregate information from temperature and humidity sensors and report on their current status and provide a graph of the last seven days of activity.
To install the Climate Server, either download a precompiled binary from the Releases page or follow these steps:
- Have rust installed
- Clone the repository from GitHub.
- Enter into the repository in a terminal
- Run the
cargo build --target [YOUR_TARGET] -r
command (the default target is set to "x86_64-unknown-linux-musl" for use with Alpine on x86_64 hardware)
To run the application, set the required environment variables and run the application.
To set the environment files, there are two options: The dotenv file and cli arguments.
Variable | Default | Required |
---|---|---|
SQL_HOST | mysql | No |
SQL_PORT | 3306 | No |
SQL_USER | None | yes |
SQL_PASS | None | yes |
SQL_DB | None | yes |
WEB_ADDRESS | 0.0.0.0 | no |
WEB_PORT | 3000 | no |
To use dotenv, simply create a file .env
and add the key=value pairs, ex:
SQL_USER=climate_user
SQL_PASS=plaintext_password
SQL_HOST=localhost
SQL_DB=climate
The other way to add environment variables is to specify them in the command line. This differs depending on your platform, but generally on linux it is specified like this:
SQL_USER="climate_user" SQL_PASS="plaintext_password" SQL_HOST="localhost" SQL_DB="climate" climate-server
and in PowerShell you specify it like this:
$Env:SQL_USER="climate_user"; $env:SQL_PASS="plaintext_password"; $Env:SQL_HOST="localhost"; $Env:SQL_DB="climate"; climate-server.exe
To contribute to Climate Server, follow these steps:
- Fork the repository from GitHub.
- Create a new branch.
- Make your changes and commit them to the new branch.
- Submit a pull request.
Climate Server is released under the Apache 2.0 License. See the LICENSE file for more details.