Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/ihciah/ddns-worker
https://github.com/ihciah/ddns-worker
Last synced: 13 days ago
JSON representation
- Host: GitHub
- URL: https://github.com/ihciah/ddns-worker
- Owner: ihciah
- License: mit
- Created: 2021-12-16T07:11:29.000Z (almost 3 years ago)
- Default Branch: master
- Last Pushed: 2024-07-29T15:26:59.000Z (4 months ago)
- Last Synced: 2024-07-29T20:57:01.881Z (3 months ago)
- Language: Rust
- Size: 29.3 KB
- Stars: 31
- Watchers: 3
- Forks: 4
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE-MIT
Awesome Lists containing this project
- awesome - ihciah/ddns-worker - (Rust)
README
# DDNS based on Cloudflare Worker
## Usage
1. Copy `wrangler_example.toml` as `wrangler.toml`, and set:
- `ZONE_ID`: You can find it in your [domain homepage](https://dash.cloudflare.com/).
- `EMAIL`: Your Cloudflare account email.
- `KEY`: Your Cloudflare API key, generate it [here](https://dash.cloudflare.com/profile/api-tokens) and allow it modify dns record.
- `TOKEN_ddns.example.com`: The key format is `"TOKEN_" + your_sub_domain`. The value is the token for your sub-domain, you can set it as a long random string.2. Run `npx wrangler deploy`.
3. You can `curl -X POST https://ddns.YOUR_WORKER_DOMAIN.workers.dev/update/ddns.example.com/EXAMPLE_TOKEN` to update the record to the client ip address. If you want to update different subdomains, you may add multiple key-values like `TOKEN_ddns2.example.com`.
4. If you want to specify ip address by your own, add the header `force-ip`. Note this can skip country checking.
## Note
You can also set `COUNTRY` variable in `wrangler.toml` to only allow requests from that country(for example, when you misused a VPN, the DNS record will be your VPN outbound IP, which maybe not what you want). If you don't want it, just leave the key blank. Country code format is as `ISO 3166-1 Alpha 2`, for example, `CN`, `US`, `SG`.[The doc](https://developers.cloudflare.com/workers/languages/rust/) helps you prepare the environment.
Wow so wasm!