Bahnhof Watchdog is a Bun-based background service that periodically checks for current and planned outages in your area from the ISP named Bahnhof. It also checks if your current subscription is priced higher than what is listed on their website. Notifications are sent through a Discord webhook or by email (Gmail only) if any issues are found.
- 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.
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"
-
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 user: ${PUID}:${PGID} # optional volumes: - data:/data restart: unless-stopped env_file: - .env volumes: data:
-
Run the Docker Compose stack:
docker-compose up -d
-
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
-
Alternative: Run with specific user/group
docker run --user 1000:1000 --env-file .env musenkishi/bahnhof-watchdog:latest
-
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
-
Clone the repository:
git clone https://github.com/musenkishi/bahnhof-watchdog.git cd bahnhof-watchdog
-
Install dependencies:
bun install
-
Create a
.env
file in the root directory and add your environment variables as described above. -
Run the service:
bun start
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.
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.
Feel free to submit issues or pull requests if you have any improvements or suggestions.
This project is licensed under the MIT License - see the LICENSE file for details.