Watch flights uploaded to World XContest paragliding league for purpose of checking whether the pilot paid a starting fee.
You can use .env
file.
APP_TELEGRAM_BOT_TOKEN
: A Telegram bot token generated using @BotFather.APP_TELEGRAM_CHAT_ID
: A group chat ID for bot to operate on (A guide to find it out).APP_FIO_API_TOKEN
: A Fio bank access token generated using their internet banking.APP_MONGO_CONNECTION_STRING
: A connection string to a Mongo instance.APP_XCONTEST_USERNAME
: XContest username used for fetching flights.APP_XCONTEST_PASSWORD
: XContest password.
In form KEY=default
:
APP_SENTRY_DSN
: Sentry error reporting access token. If empty, error reporting is turned off.APP_SENTRY_ENVIRONMENT=production
: For Sentry to distinguishdev
orproduction
, which may have impact on alerting etc.APP_TRANSACTION_WATCH_CRON=0 * * * *
: Cron pattern for running transaction watch task.APP_FLIGHT_WATCH_CRON=0 20 * * *
: Cron pattern for running flight watch task.APP_RUN_TASKS_AFTER_STARTUP=false
: Whether to run cron tasks immediately after startup or wait for a next cron trigger.APP_FLIGHT_WATCH_DAYS_BACK=30
: How many days to the past to look for uploaded flights (positive number!). Making this value higher gives more time to pilots to pay starting fee before marking the flight as offending.APP_USER_AGENT=...
: User agent to use for XContest HTTP calls.APP_LIVENESS=/tmp/liveness
: A path to liveness probe touch file.APP_LIVENESS_SLEEP=20
: How often to touch a liveness probe (in seconds).APP_MONGO_DATABASE=default
: A Mongo database name used for the app.
Create a .env
file according to this example:
# required
APP_TELEGRAM_BOT_TOKEN=...
APP_TELEGRAM_CHAT_ID=...
APP_FIO_API_TOKEN=...
APP_MONGO_CONNECTION_STRING=mongodb://root:root@mongo:27017
APP_XCONTEST_USERNAME=...
APP_XCONTEST_PASSWORD=...
# optional
APP_TRANSACTION_WATCH_CRON="* * * * *"
APP_FLIGHT_WATCH_CRON="*/10 * * * *"
APP_RUN_TASKS_AFTER_STARTUP=true
APP_FLIGHT_WATCH_DAYS_BACK=39 # adjusted for development purposes - to fit some day when people were flying
# mongo - see docker-compose.yaml
MONGO_INITDB_ROOT_USERNAME=root
MONGO_INITDB_ROOT_PASSWORD=root
ME_CONFIG_MONGODB_ADMINUSERNAME=root
ME_CONFIG_MONGODB_ADMINPASSWORD=root
Then run:
docker-compose build
docker-compose run cashier
See deploy.sh
.
BEWARE that the script is tailored for a custom server (chown
s a specific username), but it's easy to update it.
- SSH access to a Linux machine.
- Docker + docker-compose installed.
.env
set up.