-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This is a daemon that allows to automatically sync live set of maps to a directory. Target usage is on autohosts.
- Loading branch information
Showing
8 changed files
with
888 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
if [ -f .pyenv/bin/activate ]; then | ||
source .pyenv/bin/activate | ||
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
.pyenv/ | ||
__pycache__/ | ||
.mypy_cache/ | ||
.pytest_cache/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
Map Syncer | ||
========== | ||
|
||
A daemon for keeping a directory with maps in sync with the maps-metadata repo. | ||
|
||
It supports: | ||
|
||
- Delayed deletion of maps that are no longer listed as live | ||
- Periodic time based sync | ||
- Sync on demand triggered by MQTT message | ||
- Monitoring via reporting to https://healthchecks.io/ compatible endpoint | ||
|
||
Production | ||
---------- | ||
|
||
Copy `map_syncer.py` to target and run `./map_syncer.py --help` to see | ||
available options. | ||
|
||
The only runtime dependency on top of Python >= 3.8 is `paho-mqtt`. On Debian | ||
based systems it's `python3-paho-mqtt` package. | ||
|
||
Development | ||
----------- | ||
|
||
### Setup | ||
|
||
```sh | ||
python3 -m venv .pyenv | ||
source .pyenv/bin/activate | ||
pip install -r requirements.txt | ||
``` | ||
|
||
### Lint | ||
|
||
```sh | ||
black . | ||
isort . | ||
ruff . | ||
mypy | ||
``` | ||
|
||
### Test | ||
|
||
```sh | ||
pytest | ||
``` |
Oops, something went wrong.