diff --git a/.gitignore b/.gitignore index 83ef378..13cbf5c 100644 --- a/.gitignore +++ b/.gitignore @@ -32,6 +32,9 @@ Thumbs.db # Logs *.log +# Config files (actual configs with secrets) +config/ipwarn.conf + # Distribution / packaging .Python build/ diff --git a/README.md b/README.md index 652442e..be468b8 100644 --- a/README.md +++ b/README.md @@ -16,28 +16,35 @@ ipwarn is a simple Dynamic DNS Update Client. ### Docker ```bash -# Build the image -docker build -t ipwarn:2.0.0 . +# Get the example config from the repository or running container +docker run --rm ghcr.io/caldito/ipwarn:v2.0.0 cat /etc/ipwarn/ipwarn.conf > ipwarn.conf -# Run with your config file -docker run -d \ - --name ipwarn \ - --mount type=bind,source=$(pwd)/ipwarn.conf,target=/etc/ipwarn/ipwarn.conf \ - ipwarn:2.0.0 -``` +# Edit it with your settings +vim ipwarn.conf # or your preferred editor -Or pull from GitHub Container Registry: -```bash -docker pull ghcr.io/caldito/ipwarn:2.0.0 +# Run the container with your config docker run -d \ --name ipwarn \ --mount type=bind,source=$(pwd)/ipwarn.conf,target=/etc/ipwarn/ipwarn.conf \ - ghcr.io/caldito/ipwarn:2.0.0 + ghcr.io/caldito/ipwarn:v2.0.0 ``` +**Note**: An example config is available at `config/ipwarn.conf.example` in this repository and at `/etc/ipwarn/ipwarn.conf` inside the container. + ## Configuration -Create or edit `/etc/ipwarn/ipwarn.conf` with your settings: +The example config file is available at `config/ipwarn.conf.example` in this repository or at `/etc/ipwarn/ipwarn.conf` inside the container. + +To create your config: +```bash +# From the repository +cp config/ipwarn.conf.example ipwarn.conf + +# Or from a running container +docker run --rm ghcr.io/caldito/ipwarn:v2.0.0 cat /etc/ipwarn/ipwarn.conf > ipwarn.conf +``` + +Then edit `ipwarn.conf` with your settings: ```bash # Check interval in seconds (default: 30) @@ -75,8 +82,8 @@ LOG_LEVEL=INFO **Tip**: Test your configuration first with `--dry-run` flag: ```bash docker run --rm \ - --mount type=bind,source=ipwarn.conf,target=/etc/ipwarn/ipwarn.conf \ - ghcr.io/caldito/ipwarn:2.0.0 --dry-run --once + --mount type=bind,source=$(pwd)/ipwarn.conf,target=/etc/ipwarn/ipwarn.conf \ + ghcr.io/caldito/ipwarn:v2.0.0 ipwarn --dry-run --once ``` ## CLI Options diff --git a/config/ipwarn.conf b/config/ipwarn.conf deleted file mode 100644 index c830ee1..0000000 --- a/config/ipwarn.conf +++ /dev/null @@ -1,32 +0,0 @@ -# ipwarn config file - -# Interval (in seconds) to check for ip changes -INTERVAL=30 - -# IP Checkers (comma-separated, in order of preference) -IP_CHECKERS=icanhazip.com,ipify.org,ifconfig.me - -# Telegram -UPDATE_TELEGRAM=false -TEL_API_TOKEN= -TEL_API_ID= - -# GoDaddy -UPDATE_GODADDY=false -GD_DOMAIN= -GD_RECORD_NAME="@" -GD_RECORD_TYPE="A" -GD_API_KEY= -GD_API_SECRET= - -# Porkbun -UPDATE_PORKBUN=false -PB_DOMAIN= -PB_RECORD_NAME="@" -PB_RECORD_TYPE="A" -PB_API_KEY= -PB_SECRET_API_KEY= -PB_TTL=600 - -# Logging -LOG_LEVEL=INFO