No description
|
|
||
|---|---|---|
| config | ||
| libs | ||
| logs | ||
| src/saunacancelwatchdog | ||
| tests | ||
| .gitignore | ||
| .gitmodules | ||
| .pre-commit-config.yaml | ||
| docker-compose.yml | ||
| Dockerfile | ||
| pdm.lock | ||
| pyproject.toml | ||
| README.md | ||
| SaunaCancelWatchdog.service.example | ||
HaDiKo SaunaCancelWatchdog
A small fastapi based tool act as a pretix webhook to check canceled orders for the HaDiKo Sauna.
IMPORTANT NOTE: This repo uses submodules, so make sure to keep them to the current master branch
Link to a brief submodule tutorial here.
Local (Virtual Environment) Installation
If necessary get python:
# install python3 and python3-pip
apt install python3 python3-pip virtualenv
Get script running:
# copy this repo
## use --recursive to get the submodules
git clone --recursive https://git.univ-exp.com/HDK/SaunaCancelWatchdog.git
cd SaunaCancelWatchdog
# install pdm
pip3 install -U pdm
# copy sample config
cp ./config/config.toml.example ./config/config.toml
# edit config
nano ./config/config.cfg
# run program
pdm run SaunaCancelWatchdog
Setup
Change the default values in the file ./config/config.toml.
Docker Installation
Make sure to have completed the setup before running the docker container. The
folders ./config and ./logs are mounted to the container.
# builds the docker image and starts the container
docker compose up -d
Optional parameters
Use pdm run SaunaCancelWatchdog --help to get the following help:
Usage: SaunaCancelWatchdog [OPTIONS]
╭─ Options ───────────────────────────────────────────────────────────────────────╮
│ --config PATH path to the config.toml file │
│ --help Show this message and exit. │
╰─────────────────────────────────────────────────────────────────────────────────╯
Update Submodules
# from inside repo run the following to pull submodules
git submodule update --init --recursive
# to pull submodules to the latest commit
git submodule update --remote --merge
# after submodule update you might want to commit the change
git commit -am "updated submodules"
git push
Linting
Use ruff and pre-commit to lint the code.
# install pre-commit, and ruff
pip3 install -U pre-commit ruff
# install pre-commit hooks
pre-commit install
License
Author Stefan Maier Licence GNU GPLv3
Contributing
Bug reports and pull requests are welcome on my website or mail to git@univ-exp.com