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

ddns with cloudflare #463

Open
W-i-n-7 opened this issue Jan 29, 2024 · 7 comments
Open

ddns with cloudflare #463

W-i-n-7 opened this issue Jan 29, 2024 · 7 comments
Labels
plugin things that won't be covered by HFS directly

Comments

@W-i-n-7
Copy link
Contributor

W-i-n-7 commented Jan 29, 2024

**Is your feature request related to a problem? Please describe.**when ip changes i have to manually update domain

Describe the solution you'd like
A clear and concise description of what you want to happen.
hfs to automatically update my domain and subdomains to new ip when it changes

@rejetto rejetto added the enhancement New feature or request label Jan 29, 2024
@rejetto rejetto added the plugin things that won't be covered by HFS directly label May 30, 2024
@rejetto
Copy link
Owner

rejetto commented May 30, 2024

cloudflare has a peculiar api
https://developers.cloudflare.com/api/operations/dns-records-for-a-zone-update-dns-record
i decided to leave this to a plugin/script.
i'm adding an api to make it easier

@rejetto rejetto removed the enhancement New feature or request label May 30, 2024
@rejetto
Copy link
Owner

rejetto commented May 30, 2024

do you know your "zone_id" and "dns_record_id" ?

@rejetto
Copy link
Owner

rejetto commented May 31, 2024

i expect the plugin to be something like this

exports.apiRequired = 8.83 // publicIpsChanged
exports.config = {
   zone_id: {},
   dns_record_id: {},
}
exports.init = api => {
   const { httpWithBody } = api.require('./misc')
   const cfg = api.getConfig
   return {
       unload: api.events.on('publicIpsChanged', par =>
           httpWithBody(`https://api.cloudflare.com/client/v4/zones/${cfg('zone_id')}/dns_records/${cfg('dns_record_id')}`, {
               method: 'PUT',
               body: { content: par.IP4, name: domain, type: 'A' },
           }) )
   }
}

@W-i-n-7
Copy link
Contributor Author

W-i-n-7 commented May 31, 2024

do you know your "zone_id" and "dns_record_id" ?

those you cobfigure when making api key

@W-i-n-7
Copy link
Contributor Author

W-i-n-7 commented May 31, 2024

it shows u them

@rec32
Copy link

rec32 commented Jan 17, 2025

Can't this be done by using cloudflare with other ddns, such as duckdns?
https://community.cloudflare.com/t/using-duckdns-with-cloudflare/609183

@W-i-n-7
Copy link
Contributor Author

W-i-n-7 commented Feb 10, 2025

Can't this be done by using cloudflare with other ddns, such as duckdns? https://community.cloudflare.com/t/using-duckdns-with-cloudflare/609183

technically, but not the same thing

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
plugin things that won't be covered by HFS directly
Projects
None yet
Development

No branches or pull requests

3 participants