Background service designed to detect public IP address changes and instantly notify by email.
39
A lightweight, zero-overhead background service built with .NET 10 and SQLite designed to detect public IP address changes and instantly notify a list of email recipients via SMTP.
Running a self-hosted OpenVPN server behind a residential or dynamic IP connection usually forces you to either:
nmap port scans, botnets, and continuous brute-force attacks.Instead of broadcasting your IP via DDNS or keeping a statically mapped entry active, this service monitors your public WAN IP at set intervals. When your ISP changes your IP address:
ipify, icanhazip, ipinfo) to eliminate false alerts caused by single-provider downtime.[Public IP APIs] <--- (Polls every X min)
|
[IP Monitor Service]
|
+---> [SQLite DB (/data/ip_history.db)] (Checks & Logs change)
|
+---> [SMTP Server] ---> [Email Alert Sent to Admins]
The easiest way to run the application is via docker-compose.
| Variable | Description | Default / Options |
|---|---|---|
CHECK_INTERVAL_MINUTES | Frequency (in minutes) to poll for IP changes. | 10 |
EMAIL_DELIVERY_MODE | Delivery strategy to use. | Smtp or DirectMx |
SMTP_HOST | Hostname of your SMTP provider (Required if mode is Smtp). | smtp.gmail.com |
SMTP_PORT | Port for your SMTP server. | 587 |
SMTP_USER | SMTP authentication username (Required if mode is Smtp). | Optional in DirectMx |
SMTP_PASS | SMTP authentication password (Required if mode is Smtp). | Optional in DirectMx |
EMAIL_FROM | Sender email address displayed in the alert. | Required |
EMAIL_TO | Comma-separated list of recipient email addresses. | Required |
docker-compose.yml
services:
ip-monitor:
build: .
container_name: ip_monitor
restart: unless-stopped
volumes:
- ip_data:/data
environment:
# Intervalo de checagem em minutos
- CHECK_INTERVAL_MINUTES=1440
# Modo de entrega: 'Smtp' (padrão) ou 'DirectMx'
- EMAIL_DELIVERY_MODE=Smtp
# Obrigatório se EMAIL_DELIVERY_MODE=Smtp
- SMTP_HOST=smtp.gmail.com
- SMTP_PORT=587
- [email protected]
- SMTP_PASS=sua-senha-de-app
# Obrigatório em todos os modos
- [email protected]
- [email protected],[email protected]
volumes:
ip_data:
docker compose up -d
This project is open-source and available under the MIT License.
Content type
Image
Digest
sha256:f6c4f0605…
Size
58.5 MB
Last updated
27 days ago
docker pull avmesquita/dynamic-ip-change-notifier