{"id":49539561,"url":"https://github.com/derhally/gcloud-dynamic-dns","last_synced_at":"2026-05-02T14:02:08.020Z","repository":{"id":215337182,"uuid":"350304860","full_name":"derhally/gcloud-dynamic-dns","owner":"derhally","description":"Google Cloud function for handling dynamic duns requests","archived":false,"fork":false,"pushed_at":"2021-03-22T13:10:13.000Z","size":21,"stargazers_count":3,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-10-10T18:05:07.047Z","etag":null,"topics":["dyndns","gcloud-functions","udmp","udmpro","unifi"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/derhally.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null}},"created_at":"2021-03-22T10:42:54.000Z","updated_at":"2025-09-20T18:36:40.000Z","dependencies_parsed_at":"2024-01-03T21:29:11.130Z","dependency_job_id":"6b71ada9-bceb-46d7-8208-a6d4bb71d9aa","html_url":"https://github.com/derhally/gcloud-dynamic-dns","commit_stats":null,"previous_names":["derhally/gcloud-dynamic-dns"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/derhally/gcloud-dynamic-dns","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/derhally%2Fgcloud-dynamic-dns","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/derhally%2Fgcloud-dynamic-dns/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/derhally%2Fgcloud-dynamic-dns/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/derhally%2Fgcloud-dynamic-dns/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/derhally","download_url":"https://codeload.github.com/derhally/gcloud-dynamic-dns/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/derhally%2Fgcloud-dynamic-dns/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32536582,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-02T12:25:33.646Z","status":"ssl_error","status_checked_at":"2026-05-02T12:24:51.733Z","response_time":132,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["dyndns","gcloud-functions","udmp","udmpro","unifi"],"created_at":"2026-05-02T14:02:07.376Z","updated_at":"2026-05-02T14:02:08.015Z","avatar_url":"https://github.com/derhally.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# GCloud Dynamic DNS\n\noriginally based on [dynamic-cloud-dns](https://github.com/srueg/dynamic-cloud-dns)\n\nUpdated and verified to work with Ubiquiti UDMP gateway\n\nThis is a Google Cloud function that will update the records hosted in Cloud DNS.\n\nIf neither an IPv4 nor an IPv6 address is provided, the source address of the request is used.\n\n## Configuration\n\n### Service Account\n\nIt is advisable to run the gcloud function under a service account with specific permissions.   Create a custom role\n\nwith the following permissions\n\n```\ndns.changes.create\ndns.changes.get\ndns.managedZones.list\ndns.resourceRecordSets.create\ndns.resourceRecordSets.delete\ndns.resourceRecordSets.list\ndns.resourceRecordSets.update\n```\n\n\nSettings are loaded from environment variables\n\n| Config     | Description\n|------------|---------------\n|`DNS_ZONE`     | The Google Cloud DNS Zone name/id in which the records reside.\n|`USE_TOKEN` | Set to the literal string `\"true\"` to read the secret from the `token` query/body parameter. Any other value (including unset) falls back to the password in the HTTP Basic `Authorization` header.\n|`SECRET_TOKEN` | A secret token, used to authenticate users.\n|`ALLOWED_HOSTS`| A list of hosts that callers are allowed to update. May include `\"*\"` to allow all hosts.\n|`TTL`         | Time to live for records in seconds.\n\nUnder the dynamic dns section of the UDMP controller settings\n\nAdd an entry with the following settings\n\n| Settings  | Value\n|-----------|----------\n|`Service`  | `dyndns`\n|`Hostname`  | `The hostname you want to update`\n|`Username`  | `Any value to satisfy the req`\n|`Password`  | `The password that matches what is set in the function SECRET_TOKEN env variable`\n|`Server`  | `{cloud-function-address}/updateHost?host=%h\u0026ipv4=%i\u0026extra=` \u003cBR\u003e Replace {cloud-function-address} with the cloud function address.  You can find that in the deploy output as part of the url setting. It usually follows the pattern `\u003cREGION\u003e-\u003cPROJECT ID\u003e.cloudfunctions.net` \u003cBR\u003e The \"extra=\" can be left blank because on some UniFi controllers the hostname gets appended\n\n\n## Deploy to Google Cloud Functions\n\n* Setup [Google Cloud Functions](https://cloud.google.com/functions/docs/quickstart)\n* [Install](https://cloud.google.com/sdk/install) the `gcloud` CLI tool\n* Authenticate: `gcloud auth login`\n* Create a `.env.yaml` file with the runtime environment variables:\n```yaml\nDNS_ZONE: \"zone id\"\nALLOWED_HOSTS: \"*\"\nTTL: \"60\"\n```\n* Store the secret token in [Secret Manager](https://cloud.google.com/secret-manager):\n```bash\necho -n \"your-secret\" | gcloud secrets create dynamic-dns-token \\\n    --replication-policy=\"automatic\" --data-file=-\n```\n* Grant the service account access to the secret:\n```bash\ngcloud secrets add-iam-policy-binding dynamic-dns-token \\\n    --role=\"roles/secretmanager.secretAccessor\" \\\n    --member=\"serviceAccount:\u003cservice-account\u003e\"\n```\n* Create a `.env` file with the deployment variables (not checked in):\n```\nGCP_PROJECT=\u003cyour-project-id\u003e\nDEPLOY_SERVICE_ACCOUNT=\u003cservice-account-email\u003e\n```\n* Run `npm run deploy` to deploy the function\n\n## Testing with UDMP\n\nYou can test it with the UDMP by ssh in and running the command\n\n```bash\n/usr/sbin/inadyn -n -s -C -f /run/inadyn.conf -1 -l debug --foreground\n```\n\nThis will show the HTTP requests and responses.\n\n## License\n\nSee [LICENSE](LICENSE) for more details.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fderhally%2Fgcloud-dynamic-dns","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fderhally%2Fgcloud-dynamic-dns","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fderhally%2Fgcloud-dynamic-dns/lists"}