Simple Go project to track current public IP and notify changes to a telegram bot
Find a file
Melora Hugues 2abc08d582
All checks were successful
continuous-integration/drone/push Build is passing
Allow asking for the current public IP
Ref #5

This commit adds the /getIP telegram command that allows asking for the
current public IP that the bot has stored.

As it is just a working version and the telegram API is not yet
complete, this command is not yet really tested. I need to provide a
more stable version of my Telegram API beforehand because as of now it's
just a mess really, but this will do for now.
2023-01-29 18:50:43 +01:00
tracker Allow asking for the current public IP 2023-01-29 18:50:43 +01:00
.drone.yml Add .drone-ci file 2023-01-05 19:04:58 +01:00
.gitignore Create initial Go module 2023-01-05 18:51:53 +01:00
Dockerfile Add multi-architecture support 2023-01-29 18:19:54 +01:00
LICENSE Initial commit 2023-01-05 09:49:25 +01:00
README.md Add Dockerfile 2023-01-28 15:11:36 +01:00

Public IP tracker

Build Status

Telegram bot that detects changes to the device's public IP. This is particularily useful when the device is handled by an ISP that does not provide a static public IP, such as a home device.

Features

Automatic public IP detection and monitoring

Upon startup, the current public IP is detected, and a status message is sent to a specific Telegram channel with the relevant information.

Insert example message here

When running as a daemon, the program automatically monitors the current public IP adress for changes. If the IP changes for some reason, then the new updated adress is sent to the specific Telegram channel.

Insert example message here

On-demand public IP

The relevant channel is monitored during the program execution. This allows the user to send a command to the bot in order to get the current public IP on-demand.

Insert example here

Deploy

Configuration file

For now, the program is configured through a JSON configuration file. Here is a sample :

{
    "telegram": {
        "token": "<your_bot_token>",
        "channel_id": 9999999
    },
    "polling_frequency": 5
}

Docker

You can use the provided Dockerfile to build your own image.

docker build -t public-ip-tracker .

You can then use the provided configuration file sample, and provide it to the program using the /config volume

I might add support for environment variables in the future.

docker run -it -v /path/to/your/dir/with/json/file:/config public-ip-tracker