Skip to content

Commit 2cbb448

Browse files
committed
Merge pull request #29 from willswire/dev
Release v2.0.0
2 parents 2acb32d + a0ba763 commit 2cbb448

7 files changed

Lines changed: 4531 additions & 524 deletions

File tree

.devcontainer/devcontainer.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"name": "unifi-cloudflare-ddns",
3+
"image": "mcr.microsoft.com/devcontainers/javascript-node",
4+
"postCreateCommand": "yarn global add wrangler"
5+
}

README.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,11 @@ I have a UniFi Dream Machine Pro (UDM-Pro), and I want to update my Cloudflare d
99
### Configuring Cloudflare
1010
You must have a Cloudflare account and your domain must be configured to point to the Cloudflare nameservers before you continue.
1111

12-
1. Create a new [Cloudflare Worker](https://workers.cloudflare.com)
13-
2. 'Quick Edit' the worker within your browser.
14-
3. Copy and paste the contents of [index.js](https://github.com/willswire/unifi-cloudflare-ddns/blob/main/index.js) into the code editor for your worker. Ensure that you are replacing any boilerplate/code that is currently there.
12+
1. Clone or download this project
13+
2. Ensure you have the [Wrangler CLI](https://developers.cloudflare.com/workers/wrangler/install-and-update/) installed on your system
14+
3. Log in with wrangler, and run `wrangler publish`.
1515
4. Once you have created the worker, take note of it's \*.workers.dev route. More on routes for Cloudflare Workers [here](https://developers.cloudflare.com/workers/platform/routes#routes-with-workersdev).
16-
5. Create an API token so the Worker can update your DNS records. Go to https://dash.cloudflare.com/profile/api-tokens and select "Create custom token". Enable permissions for both **Zone:Read** and **DNS:Edit**. Copy your API Key - you will need it later when configuring your UniFi OS Controller.
16+
5. Create an API token so the Worker can update your DNS records. Go to https://dash.cloudflare.com/profile/api-tokens and select "Create token". On the next page, scroll down and click the "Get Started" button next to the "Create Custom Token" label. Select **Zone:DNS:Edit** for the "Permissions" drop-down, and include your target zone under the "Zone Resources" drop-down. Copy your API Key - you will need it later when configuring your UniFi OS Controller.
1717

1818
### Configuring UniFi OS
1919
1. Log on to your [UniFi OS Controller](https://unifi.ui.com/)
@@ -25,6 +25,6 @@ You must have a Cloudflare account and your domain must be configured to point t
2525
- `Password`: the Cloudflare API Token you created earlier
2626
- `Server`: the Cloudflare Worker route `<worker-name>.<worker-subdomain>.workers.dev/update?ip=%i&hostname=%h`.
2727

28-
#### Important Note!
29-
On UniFi devices older than the UDM, the `Server` value should be configured as seen below, with no path suffix:
30-
- `<worker-name>.<worker-subdomain>.workers.dev`
28+
#### Important Notes!
29+
- If you are attempting to update a subdomain (`sub.example.com`), you must manually create an A record for it **first** in your Cloudflare dashboard.
30+
- On UniFi devices older than the UDM, the `Server` value should be configured as seen below, with no path suffix: `<worker-name>.<worker-subdomain>.workers.dev`

index.js

Lines changed: 0 additions & 238 deletions
This file was deleted.

0 commit comments

Comments
 (0)