NewFuture / DDNS

:triangular_flag_on_post: 自动更新域名解析到本机IP(支持dnspod,阿里DNS,CloudFlare,华为云,DNSCOM...)
https://ddns.newfuture.cc/
MIT License
4.23k stars 651 forks source link

Script changes zone to DNS Only after running #311

Closed Townie-au closed 2 years ago

Townie-au commented 2 years ago

Hi Running the script changes zone to DNS Only after updating. config.json proxy is null

NewFuture commented 2 years ago

it does not keep the previous setting in DNS Server.

Related #115

NewFuture commented 2 years ago

you can help modified those lines https://github.com/NewFuture/DDNS/blob/9cfdc14fbb07aeb020a255c370b93e3e0a026c6e/dns/cloudflare.py#L139-L140

to (keep the proxied value))

                res = request('PUT', '/' + zoneid + '/dns_records/' + record['id'],
                              type=record_type, content=value, name=domain, proxied=record['proxied'] ,ttl=Config.TTL)
-type=record_type, content=value, name=domain, ttl=Config.TTL)
+type=record_type, content=value, name=domain, proxied=record['proxied'] ,ttl=Config.TTL)

My cloud flare account was lost. Please help me test it.

If it works, please create a pull request.

Townie-au commented 2 years ago

you can help modified those lines

https://github.com/NewFuture/DDNS/blob/9cfdc14fbb07aeb020a255c370b93e3e0a026c6e/dns/cloudflare.py#L139-L140

to (keep the proxied value))

                res = request('PUT', '/' + zoneid + '/dns_records/' + record['id'],
                              type=record_type, content=value, name=domain, proxied=record['proxied'] ,ttl=Config.TTL)
-type=record_type, content=value, name=domain, ttl=Config.TTL)
+type=record_type, content=value, name=domain, proxied=record['proxied'] ,ttl=Config.TTL)

My cloud flare account was lost. Please help me test it.

If it works, please create a pull request.

I'll give it a go

Townie-au commented 2 years ago

you can help modified those lines

https://github.com/NewFuture/DDNS/blob/9cfdc14fbb07aeb020a255c370b93e3e0a026c6e/dns/cloudflare.py#L139-L140

to (keep the proxied value))

                res = request('PUT', '/' + zoneid + '/dns_records/' + record['id'],
                              type=record_type, content=value, name=domain, proxied=record['proxied'] ,ttl=Config.TTL)
-type=record_type, content=value, name=domain, ttl=Config.TTL)
+type=record_type, content=value, name=domain, proxied=record['proxied'] ,ttl=Config.TTL)

My cloud flare account was lost. Please help me test it.

If it works, please create a pull request.

It works! I also had to run this command sudo ln -s /usr/bin/python3.7 /usr/bin/python for the script to successfully run. I dont know how to do a pull request but Im trying to learn now.

NewFuture commented 2 years ago

@Townie-au

  1. folk this repo
  2. edit this file in your repo and test again
  3. commit and push
  4. create a pull-request to this repo

https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/proposing-changes-to-your-work-with-pull-requests/creating-a-pull-request