docker-ddns-cloudflare/README.md

67 lines
1.4 KiB
Markdown
Raw Normal View History

2019-01-22 13:03:30 +01:00
# Docker DDNS Cloudflare
2020-07-23 12:52:07 +02:00
Simple container for setting setting and updating to your local ip address.
Only makes requests if the IP has changed since last time.
By default it runs once every minute and the IP is resolved by https://canihazip.com.
2019-01-22 13:03:30 +01:00
## Quickstart 🚀
2019-01-22 13:12:50 +01:00
1. Get yout api token [here](https://dash.cloudflare.com/) (Top right -> My Profile -> Scroll Down -> Global Api Key)
2020-01-02 22:40:39 +01:00
2. Create the wanted DNS record (e.g. `some.example.com`). The script can only update it, not create it.
2019-01-24 21:41:53 +01:00
3. Create an `.env` file:
2019-01-22 13:03:30 +01:00
```bash
EMAIL=my@mail.com
KEY=my_api_key
ZONE=example.org
DNS_RECORD=some.example.org
```
2019-01-24 21:41:53 +01:00
4. Run the container
2019-01-22 13:03:30 +01:00
```bash
docker run -d --name ddns --restart always --env-file .env cupcakearmy/ddns-cloudflare
```
2020-07-23 12:52:07 +02:00
To check logs:
2019-01-22 13:03:30 +01:00
```bash
docker logs ddns
```
### Docker-Copmose
With docker-compose:
```bash
git clone https://github.com/CupCakeArmy/docker-ddns-cloudflare.git
cp .sample.env .env
# Edit the .env file with your data
docker-compose up -d
2019-01-22 13:12:50 +01:00
```
2020-07-23 12:52:07 +02:00
## Customize
### Custom CRON
By default the script runs every 5 minutes. You can customize this by simply setting the `CRON` value in the `.env` file.
```bash
# .env
# e.g. every minute
CRON=* * * * *
```
### Custom Resolver
By default the script checks the own ip by calling `https://api.ipify.org/`. This also can be configured. It has to be an endpoint that return a plain text containing the ip by get request.
```bash
# .env
RESOLVER=https://ipv4.icanhazip.com/
```