To build and install the project, run the following command:
sudo cargo install --path <root_of_project>
This will generate and populate the systemd unit file in /etc/systemd/system/
.
To start service, run:
sudo systemctl start air_alert.service
To ensure the service starts automatically after a reboot or if the application crashes, run:
sudo systemctl enable air_alert.service
All configurations located at samples/config.json
After any change, run:
sudo cargo install --path <root_of_project>
sudo systemctl reload-or-restart air_alert.service
You need to obtain an API key from the official air alert API developer: Ukraine Alarm API.
Once you have the API key, update the apiKey
field in samples/config.json
.
To set the region you want to monitor, update the regionId field in samples/config.json
with your actual region ID.
You can get all region IDs by running:
curl -X 'GET' \
'https://api.ukrainealarm.com/api/v3/regions' \
-H 'accept: application/json' \
-H 'Authorization: <your_api_key>'
Remember to replace <your_api_key>
with your actual API key.
If the command above does not work, you can find the command by visiting the Ukraine Alarm API Swagger documentation.
To change the audio that announces the start and end of an air alert, replace the start_air_alert.mp3
and end_air_alert.mp3
files in the rsc
directory.