Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Release v2.0.0 #29

Merged
merged 7 commits into from
Apr 23, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"name": "unifi-cloudflare-ddns",
"image": "mcr.microsoft.com/devcontainers/javascript-node",
"postCreateCommand": "yarn global add wrangler"
}
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ You must have a Cloudflare account and your domain must be configured to point t
2. 'Quick Edit' the worker within your browser.
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.
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).
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.
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.

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

#### Important Note!
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`
#### Important Notes!
- 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.
- 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`
238 changes: 0 additions & 238 deletions index.js

This file was deleted.

Loading