nemanjaslijepcevic/public_ip_updater
Project works with public_ip_tracker to track changes in your public IP and update a YAML configs,
87
This program works in conjunction with public_ip_tracker, developed by me. It tracks the server's public IP address, compares it with the previously stored value, and updates a YAML configuration file if the IP changes. Additionally, it logs events and can integrate with an API for external access. By default, the app works with Traefik's white IP address rule file.
NODE_IP_DOMAIN
) secured with a Bearer token (API_IP_TOKEN
).current_ip.txt
. If the IP has changed, it updates the data list in the specified YAML file (configuration.yml
).To configure this program, the following environment variables are required:
INFO
.60
).http.middlewares.default-whitelist.ipAllowList.sourceRange
).sourceRange
list for updating the IP.You can run the application in a Docker container using the provided Dockerfile
. The latest Docker image for this application is available at nemanjaslijepcevic/public_ip_updater:latest
.
docker pull nemanjaslijepcevic/public_ip_updater:latest
docker run -d \
--name public_ip_updater \
-e NODE_IP_DOMAIN="https://your-api-domain.com/api/ip" \
-e FILE_DATA_PATH="file.path.to.the.variable" \
-e API_IP_TOKEN="api_token" \
-e TZ="Europe/Belgrade" \
-e LOG_LEVEL="DEBUG" \
-v /path/to/public_ip_updater/current_ip.txt:/app/current_ip.txt:rw \
-v /path/to/yaml/you/need/to/update.yml:/app/configuration.yml:rw \
--restart unless-stopped \
nemanja_slijepcevic/public_ip_updater
For easier management of Docker containers and environment configuration, you can use Docker Compose.
docker-compose.yml
file in the root of your project:version: '3'
services:
public_ip_updater:
image: nemanja_slijepcevic/public_ip_updater
container_name: public_ip_updater
environment:
NODE_IP_DOMAIN: "https://your-api-domain.com/api/ip"
FILE_DATA_PATH: "file.path.to.the.variable"
API_IP_TOKEN: "api_token"
TZ: "Europe/Belgrade"
LOG_LEVEL: "DEBUG"
volumes:
- /path/to/public_ip_updater/current_ip.txt:/app/current_ip.txt:rw
- /path/to/yaml/you/need/to/update.yml:/app/configuration.yml:rw
restart: unless-stopped
docker-compose up --build -d
docker-compose down
docker pull nemanjaslijepcevic/public_ip_updater