No description
Find a file
2024-07-02 15:47:28 +02:00
config change default port, add readme 2024-05-31 16:53:39 +02:00
libs add linting, update python version 2024-07-02 15:40:58 +02:00
logs update config and new lib 2024-05-31 16:29:34 +02:00
src/saunacancelwatchdog lint 2024-07-02 15:41:39 +02:00
tests switch to pdm 2024-02-20 17:18:09 +01:00
.gitignore add docker 2024-05-31 16:42:11 +02:00
.gitmodules switch to pdm 2024-02-20 17:18:09 +01:00
.pre-commit-config.yaml add linting, update python version 2024-07-02 15:40:58 +02:00
docker-compose.yml change default port, add readme 2024-05-31 16:53:39 +02:00
Dockerfile add docker 2024-05-31 16:42:11 +02:00
pdm.lock add linting, update python version 2024-07-02 15:40:58 +02:00
pyproject.toml add linting, update python version 2024-07-02 15:40:58 +02:00
README.md add linting, update python version 2024-07-02 15:40:58 +02:00
SaunaCancelWatchdog.service.example update example service unit 2024-02-20 22:05:59 +01:00

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