Skip to content

Commit 1cf8404

Browse files
MatthewA1willswire
authored andcommitted
📝 (README.md): Update Worker setup instructions to clarify deployment process with Click To Deploy and Wrangler CLI
📝 (README.md): Add detailed steps for creating API tokens for UniFi client DDNS updates 📝 (README.md): Update UniFi OS configuration section to provide clearer instructions for setting up Dynamic DNS 📝 (README.md): Update section headers for consistency and clarity in the README file
1 parent ea251c4 commit 1cf8404

1 file changed

Lines changed: 36 additions & 15 deletions

File tree

‎README.md‎

Lines changed: 36 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -6,32 +6,53 @@ A Cloudflare Worker script that provides a UniFi-compatible DDNS API to dynamica
66

77
UniFi Dream Machine Pro (UDM-Pro) or UniFi Security Gateway (USG) users may need to update Cloudflare domain name DNS records when their public IP address changes. UniFi does not natively support Cloudflare as a DDNS provider.
88

9-
### Configuring Cloudflare
9+
## Configuring Cloudflare
1010

1111
Ensure you have a Cloudflare account and your domain is configured to point to Cloudflare nameservers.
1212

13-
#### Install With Click To Deploy
13+
### Worker Setup
14+
15+
#### Deploy With Click To Deploy
1416

1517
1. Deploy the Worker: [![Deploy to Cloudflare Workers](https://deploy.workers.cloudflare.com/button)](https://deploy.workers.cloudflare.com/?url=https://github.com/workerforce/unifi-ddns)
1618
2. Navigate to the Cloudflare Workers dashboard.
1719
3. After deployment, note the `\*.workers.dev` route.
18-
4. Create an API token to update DNS records:
19-
- Go to https://dash.cloudflare.com/profile/api-tokens.
20-
- Click "Create token", select "Create Custom Token".
21-
- Choose "Edit Cloudflare Workers" Template
22-
- Select "+Add More"
23-
- Choose **Zone:DNS:Edit** for permissions, and include your zone under "Zone Resources".
24-
- Copy your API Key for later use in UniFi OS Controller configuration.
2520

26-
#### Install With Wrangler CLI
21+
#### Deploy With Wrangler CLI
2722

2823
1. Clone or download this project.
2924
2. Ensure you have [Wrangler CLI](https://developers.cloudflare.com/workers/wrangler/install-and-update/) installed.
3025
3. Log in with Wrangler and run `wrangler deploy`.
3126
4. Note the `\*.workers.dev` route after creation.
32-
5. Create an API token as described above.
3327

34-
### Configuring UniFi OS
28+
### API Token for DNS Record Updates
29+
An API Token will be needed for each UniFi client performing DDNS updates.
30+
To create the token(s):
31+
1. Tokens can now be created at the user level or account level
32+
33+
User token:
34+
- Go to https://dash.cloudflare.com/profile/api-tokens
35+
- Key differences:
36+
- Access to all accounts for which the user is a member and has permissions (unless explicitly limited in token settings)
37+
- Actions performed by this token are associated with the user
38+
- Viewable/Editable only by the creating user
39+
40+
Account token: (Recommended)
41+
- On the [CloudFlare Dashboard](https://dash.cloudflare.com/), open the account which manages the target zone(s)
42+
- Select Manage Account > Account API Tokens
43+
- Key differences:
44+
- Access limited to only the account for which it is created
45+
- Actions performed by this token are not attributed to a user
46+
- Viewable/Editable by all account members (with the appropriate permissions)
47+
2. Click "Create Token"
48+
3. Click "Use Template" for "Edit zone DNS"
49+
4. Under "Zone Resources," include the target zone or select "All zones from an account."
50+
(If using a user token, "All zones" is also an option.)
51+
Set a token name and/or additional restrictions as desired.
52+
5. Click "Continue to summary" then "Create Token."
53+
Copy and save the generated token for later use configuring the UniFi OS Controller.
54+
55+
## Configuring UniFi OS
3556

3657
1. Log in to your [UniFi OS Controller](https://unifi.ui.com/).
3758
2. Navigate to Settings > Internet > WAN and scroll down to **Dynamic DNS**.
@@ -44,7 +65,7 @@ Ensure you have a Cloudflare account and your domain is configured to point to C
4465
- For older UniFi devices, omit the URL path.
4566
- Remove `https://` from the URL.
4667

47-
#### Testing Changes - UDM-Pro
68+
### Testing Changes - UDM-Pro
4869
To test the configuration and force an update on a UDM-Pro:
4970

5071
1. SSH into your UniFi device.
@@ -53,7 +74,7 @@ To test the configuration and force an update on a UDM-Pro:
5374
4. Run `inadyn -n -1 --force -f <config-path>` (e.g., `inadyn -n -1 --force -f /run/ddns-eth4-inadyn.conf`).
5475
5. Check `/var/log/messages` for related error messages.
5576

56-
#### Testing Changes - USG
77+
### Testing Changes - USG
5778
To test the configuration and force an update on a USG:
5879

5980
1. SSH into your USG device.
@@ -62,7 +83,7 @@ To test the configuration and force an update on a USG:
6283
4. Run `sudo ddclient -daemon=0 -verbose -noquiet -debug -file /etc/ddclient/<config>.conf` (e.g., `sudo ddclient -daemon=0 -verbose -noquiet -debug -file /etc/ddclient/ddclient_eth0.conf`).
6384
5. This should output `SUCCESS` when the DNS record is set.
6485

65-
#### Important Notes!
86+
### Important Notes!
6687

6788
- For subdomains (`sub.example.com`), create an A record manually in Cloudflare dashboard first.
6889
- If you encounter a hostname resolution error (`inadyn[2173778]: Failed resolving hostname https: Name or service not known`), remove `https://` from the `Server` field.

0 commit comments

Comments
 (0)