Sign inSign up

lombardi/ip-checker

By lombardi

•Updated about 2 years ago

notifies on ip change

Image
0

996

lombardi/ip-checker repository overview


⁠Home IP Checker

A simple script to notify you when your home ip changes.
Explore the docs »⁠

Report Bug⁠ · Request Feature⁠

⁠Table of Contents

⁠About the Project

The idea behind this repo is a simple way to guarantee that you'll always able to connect to you PiVPN⁠ even if your internet provider changes you public IP. By sending a notification via e-mail and/or Telegram whenever the IP of you Raspberry Pi changes, you'll never be left out of your home internet!

The system is a very simple python script that uses amazon AWS⁠ to get the current IPv4 Address of the device (must be running in the same machine as the VPN) it's running in.

⁠Getting Started
⁠Prerequisites

To maximize compatbility, you will only need docker⁠ and docker-compose to be installed on your computer. But if you wish to not run it as a container, feel free to check the code and run it simply on the CLI.

For the notifications, you will need an e-mail to be used as the "notificator" as well as a configured Telegram Bot. Remember to allow less secure apps on the e-mail end. For the Telegram Bot, you'll need 2 things: the Chat ID of the people that will receive the notification, as well as the bot ID. You can learn about them here⁠.

⁠Instalation

Since the script is containerized, just run git pull https://github.com/LombardiDaniel/ip-checker, cd ip-checker. Create a .env file with the variables described below.

You can also just check out the docker image at docker-hub⁠.

⁠Usage

The only configuration needed is to set the environment variables in the .env file. Configure your email and/or Telegram key in the .env file (separate multiple addresses by using ,) and run docker-compose up -d. It logs to stdout, so you can easily check the logs via portainer⁠.

Variable NameMeaningSeparator
MAIL_LISTList of emails to send notifications to,
TELEGRAM_CHAT_LISTList of chat keys to send notifications to,
TELEGRAM_BOT_KEYBot API Keys to send notifications to-
EMAIL_HOST_USERE-mail that will be used to send out emails-
EMAIL_HOST_PASSWORDPassword of Host e-mail-
⁠License

This project is licensed under the MIT License - see the LICENSE⁠ file for details.

Tag summary

Content type

Image

Digest

sha256:d1e1c5527…

Size

8.4 MB

Last updated

about 2 years ago

docker pull lombardi/ip-checker