Git Product home page Git Product logo

gandi-ddns's Issues

Script not working as cron job

Hi @rmarchant. First, thanks a lot for creating this script, it's really useful. I'm just finding an issue when using it via cron.

Once the config file is setup, I can execute the command with
python /home/user/Software/gandi-ddns/gandi_ddns.py
and everything works perfectly. I can see the IP is being updated in the Gandi admin panel.

Then I add it as a cron job, with this format:
*/15 * * * * python /home/user/Software/gandi-ddns/gandi_ddns.py

I can tell it's being run by looking into /var/log/syslog and seeing lines like this one:
Sep 25 20:44:01 devicename CRON[5733]: (root) CMD (python /home/user/Software/gandi-ddns/gandi_ddns.py)

But the DNS records are not being updated in the Gandi admin panel anymore. Is there something else I should take into account when configuring crontab?

Q: update several a records at the same time

I'm looking for a way to update several DNS records that differ from the type at the same time.
I have two questions about this:

1.) Is it possible to update several A-Records (Domain & Subdomains) at the same time by storing several, separated entries at "a_name" in the config.txt? If that works, which separator should be used?

2.) In order to properly configure my mail server I also need to update a TXT-Record ("v=spf1 a mx ip4: -all") regularly and plan to extend the script for this task. Do I have to pay special attention or can I simply extend the script with a suitable method?

Thank you for your time and work!

Issue with requests and ssl

Hello,
I've got an error with, I think, requests, throwing me OpenSSL error:

2020-11-25 17:50:34.646715 - section local
https://dns.api.gandi.net/api/v5/domains/easter.fr/records/beta/A
Traceback (most recent call last):
  File "./gandi_ddns.py", line 131, in <module>
    main()
  File "./gandi_ddns.py", line 110, in main
    external_ip = get_ip(ipify_api, retries)
  File "./gandi_ddns.py", line 48, in get_ip
    return get_ip_inner(ipify_api)
  File "./gandi_ddns.py", line 25, in get_ip_inner
    r = requests.get(ipify_api, timeout=3)
  File "/usr/lib/python2.7/dist-packages/requests/api.py", line 75, in get
    return request('get', url, params=params, **kwargs)
  File "/usr/lib/python2.7/dist-packages/requests/api.py", line 60, in request
    return session.request(method=method, url=url, **kwargs)
  File "/usr/lib/python2.7/dist-packages/requests/sessions.py", line 533, in request
    resp = self.send(prep, **send_kwargs)
  File "/usr/lib/python2.7/dist-packages/requests/sessions.py", line 646, in send
    r = adapter.send(request, **kwargs)
  File "/usr/lib/python2.7/dist-packages/requests/adapters.py", line 449, in send
    timeout=timeout
  File "/usr/lib/python2.7/dist-packages/urllib3/connectionpool.py", line 600, in urlopen
    chunked=chunked)
  File "/usr/lib/python2.7/dist-packages/urllib3/connectionpool.py", line 343, in _make_request
    self._validate_conn(conn)
  File "/usr/lib/python2.7/dist-packages/urllib3/connectionpool.py", line 841, in _validate_conn
    conn.connect()
  File "/usr/lib/python2.7/dist-packages/urllib3/connection.py", line 344, in connect
    ssl_context=context)
  File "/usr/lib/python2.7/dist-packages/urllib3/util/ssl_.py", line 321, in ssl_wrap_socket
    context.load_verify_locations(ca_certs, ca_cert_dir)
  File "/usr/lib/python2.7/dist-packages/urllib3/contrib/pyopenssl.py", line 428, in load_verify_locations
    self._ctx.load_verify_locations(cafile, capath)
  File "/usr/lib/python2.7/dist-packages/OpenSSL/SSL.py", line 776, in load_verify_locations
    _raise_current_error()
  File "/usr/lib/python2.7/dist-packages/OpenSSL/_util.py", line 54, in exception_from_error_queue
    raise exception_type(errors)
OpenSSL.SSL.Error: [('PEM routines', 'get_header_and_data', 'short header'), ('x509 certificate routines', 'X509_load_cert_crl_file', 'PEM lib')]

I had to add verify=False in every requests.get call.
Do you know how can I solve this ?

Thank you.

2 sub domains to update

Hi,
The script works fine, thanx.
What if I want to update 2 subdomains ? Do I have to copy the script and the config file in 2 directories? I tried a comma and a space separator but got error messages.

Thanx in advance

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.