Releases: Musenkishi/bahnhof-watchdog
v1.1.0
Breaking changes
If you're using environment variables PUID
and PGID
, please update your docker compose according to the readme:
services:
bahnhof-watchdog:
container_name: bahnhof-watchdog
image: musenkishi/bahnhof-watchdog:latest
user: ${PUID}:${PGID} # this is needed to user/group permissions to work properly
volumes:
- data:/data
restart: unless-stopped
env_file:
- .env
volumes:
data:
What's Changed
- Improve api error handling by @Musenkishi in #10
- Migrate to Distroless Bun by @Musenkishi in #11
Full Changelog: https://github.com/Musenkishi/bahnhof-watchdog/commits/v1.1.0
v1.0.0
Bahnhof Watchdog v1.0.0
Features
- Outage Check: Monitors for current and planned outages in your area based on your postal code.
- Price Check: Compares your current subscription price with the listed price on Bahnhof's website.
- Notifications: Sends notifications about outages or price discrepancies through a Discord webhook or an email.
Environment Variables
Before running the service, you'll need to set up the following environment variables:
# Uncomment and set these variables if you are mounting a volume for the data directory.
# PUID=1000
# PGID=1000
# Runs every hour. crontab.cronhub.io can be used to generate another interval
CRON_SCHEDULE="0 * * * *"
SEND_STARTUP_MESSAGE=true # set to false to avoid getting notified when the service starts
# Outage check
POSTAL_CODE="12345"
# Price check
ADDRESS="ExampleStreet 1A, 12345 ExampleCity"
CURRENT_SPEED="250/250" # In Mbit down/up e.g. 100/10, 250/250, 1000/1000...
CURRENT_PRICE="500"
LOG_PRICES=true # log price changes in a csv file
# Notifications
WEBHOOK_URL="https://your-webhook-url" # Only tested with Discord Webhook bot
# Mail uses nodemailer set to gmail.
# Optional to use but needs all 3 values to work.
MAIL_SENDER="example.sender@gmail.com"
MAIL_SENDER_PASS="examplepassword123"
MAIL_RECEIVER="example.receiver@gmail.com"
Setup
Running with Docker Compose
-
Create a
.env
file in a directory of your choice and add your environment variables as described above. -
Create a
docker-compose.yml
file in the same directory with the following content:services: bahnhof-watchdog: container_name: bahnhof-watchdog image: musenkishi/bahnhof-watchdog:latest volumes: - data:/data restart: unless-stopped env_file: - .env volumes: data:
-
Run the Docker Compose stack:
docker-compose up -d
Running with Docker
Using a Pre-built Image from Docker Hub
-
Create a
.env
file in a directory of your choice and add your environment variables as described above. -
Run the Docker container:
docker run --env-file .env musenkishi/bahnhof-watchdog:latest
Building the Image Locally
-
Clone the repository:
git clone https://github.com/musenkishi/bahnhof-watchdog.git cd bahnhof-watchdog
-
Create a
.env
file in the root directory and add your environment variables as described above. -
Build the Docker image:
docker build -t bahnhof-watchdog .
-
Run the Docker container:
docker run --env-file .env bahnhof-watchdog
Running Locally
-
Clone the repository:
git clone https://github.com/musenkishi/bahnhof-watchdog.git cd bahnhof-watchdog
-
Install dependencies:
npm install
-
Create a
.env
file in the root directory and add your environment variables as described above. -
Build the project
tsc
-
Run the service:
node dist/app.js
Usage
The service runs based on the interval set in the CRON_SCHEDULE
environment variable. It will check for outages and price discrepancies based on your provided postal code and address, and send notifications if any issues are found.
Notifications
Discord Webhook
Ensure WEBHOOK_URL
is set to your Discord webhook URL. Guide is available on Discord's support site:
WEBHOOK_URL=https://your-webhook-url
To use email notifications, all three of the following variables need to be set:
MAIL_SENDER="your.sender@gmail.com"
MAIL_SENDER_PASS="yourpassword"
MAIL_RECEIVER="your.receiver@gmail.com"
These values will configure the service to use Gmail through Nodemailer for sending email notifications. Guide is available here.