Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/zachstence/cloudflare-ddns

Automatically update Cloudflare DNS when your public IP changes
https://github.com/zachstence/cloudflare-ddns

cloudflare ddns docker ipify typescript

Last synced: about 2 months ago
JSON representation

Automatically update Cloudflare DNS when your public IP changes

Awesome Lists containing this project

README

        

# cloudflare-ddns
Automatically update your Cloudflare DNS when your public IP changes



license mit




docker pulls
docker size




wakatime

## Table of Contents
- [Usage](#usage)
- [Run using Docker](#run-using-docker)
- [Run using `docker-compose`](#run-using-docker-compose)
- [Future Features](#future-features)

## Usage
1. [Create a Cloudflare API token](https://developers.cloudflare.com/api/tokens/create/) with the following configuration

![docs/permissions.png](docs/permissions.png)

Permissions
- Zone - Zone - Read
- Zone - DNS - Edit

Zone Resources
- Include - All zones

2. [Identify your Cloudflare Zone ID](https://developers.cloudflare.com/fundamentals/get-started/basic-tasks/find-account-and-zone-ids/)

![docs/zone-id.png](docs/zone-id.png)

3. Copy [`config.json.template`](config.json.template) to a new file named `config.json`

| Config | Description | Example |
| ----------------------- | ------------------------------------------------------------ | ------------------------------------------ |
| `cloudflare.apiToken` | A Cloudflare API Token with the [proper permissions](#usage) | `XDX6YXn0MU2tpwJUa49UYLrtS5r4q-Ia9ng6H5Pu` |
| `zones.zoneId` | The Zone ID of the domain you want to update DNS for | `gq3pvvxfr6x4fpfdgz7w7n4d3ckfk9pk` |
| `zones.recordNames` | The name of each record you would like to update | `example.com` |
| `intervalSeconds` | How often to check your DNS records (in seconds)1 | `300` |

1 [Cloudflare's Rate Limits](https://support.cloudflare.com/hc/en-us/articles/200171456-How-many-API-calls-can-I-make) are pretty lenient, so feel free to set the interval as small as you want.

4. Run `cloudflare-ddns` using your `config.json`

#### Run using Docker
```sh
docker run \
-v /path/to/config.json:/app/config.json \
zachstence/cloudflare-ddns
```

#### Run using `docker-compose`
```yaml
version: "3.8"

services:
cloudflare-ddns:
image: zachstence/cloudflare-ddns
volumes:
- /path/to/config.json:/app/config.json:ro
restart: unless-stopped
```

## Future Features
- Accept file for Cloudflare API token to enable better security (Docker secrets)