cloudflare-dyndns


Namecloudflare-dyndns JSON
Version 4.1 PyPI version JSON
download
home_pagehttps://github.com/kissgyorgy/cloudflare-dyndns
SummaryCloudFlare Dynamic DNS client
upload_time2022-05-01 09:38:28
maintainer
docs_urlNone
authorKiss György
requires_python>=3.9.2,<4.0.0
licenseMIT
keywords
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # CloudFlare Dynamic DNS client

This is a simple Dynamic DNS script written in Python for updating CloudFlare DNS A records,  
similar to the classic [ddclient perl script](https://sourceforge.net/p/ddclient/wiki/Home/).

- You can run it as a cron job or a systemd timer.
- It only updates the records if the IP address actually changed by storing a
  cache of the current IP address.
- It checks multiple IP services. If one of them doesn't respond, it skips it and check the next.
- It has an easy to use command line interface.

## Install

You can simply install it with pip [from PyPI](https://pypi.org/project/cloudflare-dyndns/):

```bash
$ pip install cloudflare-dyndns
```

Or you can [download a standalone binary from the releases page.](https://github.com/kissgyorgy/cloudflare-dyndns/releases/)

Or you can use [the Docker image](https://hub.docker.com/r/kissgyorgy/cloudflare-dyndns):

```bash
$ docker run --rm -it kissgyorgy/cloudflare-dyndns --help
```

Please note that before you can use the `-6` IPv6 option in Docker, you need to [enable IPv6 support in the Docker daemon](https://docs.docker.com/config/daemon/ipv6/).
Afterward, you can choose to use either IPv4 or IPv6 (or both) with any container, service, or network.

# Note

If you use this script, it "takes over" the handling of the record of those
domains you specified, which means it will update existing records and create
missing ones.

You should not change A or AAAA records manually or with other scripts, because
the changes will be overwritten.

I decided to make it work this way, because I think most users expect this
behavior, but if you have a different use case,
[let me know!](https://github.com/kissgyorgy/cloudflare-dyndns/issues/new)

## Command line interface

```
$ cloudflare-dyndns --help
Usage: cloudflare-dyndns [OPTIONS] [DOMAINS]...

  A command line script to update CloudFlare DNS A and/or AAAA records based
  on the current IP address(es) of the machine running the script.

  For the main domain (the "@" record), simply put "example.com"
  Subdomains can also be specified, eg. "*.example.com" or "sub.example.com"

  You can set the list of domains to update in the CLOUDFLARE_DOMAINS
  environment variable, in which the domains has to be separated by
  whitespace, so don't forget to quote the value!

  The script supports both IPv4 and IPv6 addresses. The default is to set
  only A records for IPv4, which you can change with the relevant options.

Options:
  --api-token TEXT   CloudFlare API Token (You can create one at My Profile
                     page / API Tokens tab). Can be set with
                     CLOUDFLARE_API_TOKEN environment variable.  [required]

  --proxied          Whether the records are receiving the performance and
                     security benefits of Cloudflare.

  -4 / -no-4         Turn on/off IPv4 detection and set A records.
                     [default: on]

  -6 / -no-6         Turn on/off IPv6 detection and set AAAA records.
                     [default: off]

  --delete-missing   Delete DNS record when no IP address found. Delete A
                     record when IPv4 is missing, AAAA record when IPv6 is
                     missing.

  --cache-file FILE  Cache file  [default: /home/walkman/.cache/cloudflare-
                     dyndns/ip.cache]

  --force            Delete cache and update every domain
  --debug            More verbose messages and Exception tracebacks
  --help             Show this message and exit.
```

## Shell exit codes

- `1`: Unknown error happened
- `2`: IP cannot be determined (IP service error)
- `3`: CloudFlare related error (cannot call API, cannot get records, etc...)

# Changelog

- **v4.0** IPv6 support

  Now you can specify `-6` command line option to update AAAA records too.  
  You can delete records for missing IP addresses with the `--delete-missing`
  option. See [issue #6](https://github.com/kissgyorgy/cloudflare-dyndns/issues/6) for details.  
  There is a new `--proxied` flag for setting Cloudflare DNS services.

- **v3.0** breaks backward compatibility using the global API Key

  You can only use API Tokens now, which you can create under `My Profile / API Tokens`: https://dash.cloudflare.com/profile/api-tokens.
  The problem with the previously used API Key is that it has global access to
  your Cloudflare account. With the new API Tokens, you can make the script
  permissions as narrow as needed.

  **Upgrading from 2.0 and using API Tokens is highly recommended!**

  The `--domains` option is now gone, because it made no sense (it only existed
  for reading from the envvar), but you can use the `CLOUDFLARE_DOMAINS` envvar
  the same as before.

- **v2.0** breaks backward compatibility for a PyPI release.

  The script you need to run is now called `cloudflare-dyndns` and the cache file
  also changed. You can delete the old cache manually, or you can leave it, it
  won't cause a problem.

  The Docker file entry point is changed, so if you pull the new image, everything
  will work as before.

## Development

You can install dependencies with poetry (preferable in a virtualenv).  
After [installing poetry](https://poetry.eustace.io/docs/#installation), simply run:

```bash
$ poetry install
```

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/kissgyorgy/cloudflare-dyndns",
    "name": "cloudflare-dyndns",
    "maintainer": "",
    "docs_url": null,
    "requires_python": ">=3.9.2,<4.0.0",
    "maintainer_email": "",
    "keywords": "",
    "author": "Kiss Gy\u00f6rgy",
    "author_email": "kissgyorgy@me.com",
    "download_url": "https://files.pythonhosted.org/packages/6e/9f/8a508294bd420ca6f8b4c9ee27b4af5bb3ceda0f0ed85972c5aad9be040a/cloudflare-dyndns-4.1.tar.gz",
    "platform": null,
    "description": "# CloudFlare Dynamic DNS client\n\nThis is a simple Dynamic DNS script written in Python for updating CloudFlare DNS A records,  \nsimilar to the classic [ddclient perl script](https://sourceforge.net/p/ddclient/wiki/Home/).\n\n- You can run it as a cron job or a systemd timer.\n- It only updates the records if the IP address actually changed by storing a\n  cache of the current IP address.\n- It checks multiple IP services. If one of them doesn't respond, it skips it and check the next.\n- It has an easy to use command line interface.\n\n## Install\n\nYou can simply install it with pip [from PyPI](https://pypi.org/project/cloudflare-dyndns/):\n\n```bash\n$ pip install cloudflare-dyndns\n```\n\nOr you can [download a standalone binary from the releases page.](https://github.com/kissgyorgy/cloudflare-dyndns/releases/)\n\nOr you can use [the Docker image](https://hub.docker.com/r/kissgyorgy/cloudflare-dyndns):\n\n```bash\n$ docker run --rm -it kissgyorgy/cloudflare-dyndns --help\n```\n\nPlease note that before you can use the `-6` IPv6 option in Docker, you need to [enable IPv6 support in the Docker daemon](https://docs.docker.com/config/daemon/ipv6/).\nAfterward, you can choose to use either IPv4 or IPv6 (or both) with any container, service, or network.\n\n# Note\n\nIf you use this script, it \"takes over\" the handling of the record of those\ndomains you specified, which means it will update existing records and create\nmissing ones.\n\nYou should not change A or AAAA records manually or with other scripts, because\nthe changes will be overwritten.\n\nI decided to make it work this way, because I think most users expect this\nbehavior, but if you have a different use case,\n[let me know!](https://github.com/kissgyorgy/cloudflare-dyndns/issues/new)\n\n## Command line interface\n\n```\n$ cloudflare-dyndns --help\nUsage: cloudflare-dyndns [OPTIONS] [DOMAINS]...\n\n  A command line script to update CloudFlare DNS A and/or AAAA records based\n  on the current IP address(es) of the machine running the script.\n\n  For the main domain (the \"@\" record), simply put \"example.com\"\n  Subdomains can also be specified, eg. \"*.example.com\" or \"sub.example.com\"\n\n  You can set the list of domains to update in the CLOUDFLARE_DOMAINS\n  environment variable, in which the domains has to be separated by\n  whitespace, so don't forget to quote the value!\n\n  The script supports both IPv4 and IPv6 addresses. The default is to set\n  only A records for IPv4, which you can change with the relevant options.\n\nOptions:\n  --api-token TEXT   CloudFlare API Token (You can create one at My Profile\n                     page / API Tokens tab). Can be set with\n                     CLOUDFLARE_API_TOKEN environment variable.  [required]\n\n  --proxied          Whether the records are receiving the performance and\n                     security benefits of Cloudflare.\n\n  -4 / -no-4         Turn on/off IPv4 detection and set A records.\n                     [default: on]\n\n  -6 / -no-6         Turn on/off IPv6 detection and set AAAA records.\n                     [default: off]\n\n  --delete-missing   Delete DNS record when no IP address found. Delete A\n                     record when IPv4 is missing, AAAA record when IPv6 is\n                     missing.\n\n  --cache-file FILE  Cache file  [default: /home/walkman/.cache/cloudflare-\n                     dyndns/ip.cache]\n\n  --force            Delete cache and update every domain\n  --debug            More verbose messages and Exception tracebacks\n  --help             Show this message and exit.\n```\n\n## Shell exit codes\n\n- `1`: Unknown error happened\n- `2`: IP cannot be determined (IP service error)\n- `3`: CloudFlare related error (cannot call API, cannot get records, etc...)\n\n# Changelog\n\n- **v4.0** IPv6 support\n\n  Now you can specify `-6` command line option to update AAAA records too.  \n  You can delete records for missing IP addresses with the `--delete-missing`\n  option. See [issue #6](https://github.com/kissgyorgy/cloudflare-dyndns/issues/6) for details.  \n  There is a new `--proxied` flag for setting Cloudflare DNS services.\n\n- **v3.0** breaks backward compatibility using the global API Key\n\n  You can only use API Tokens now, which you can create under `My Profile / API Tokens`: https://dash.cloudflare.com/profile/api-tokens.\n  The problem with the previously used API Key is that it has global access to\n  your Cloudflare account. With the new API Tokens, you can make the script\n  permissions as narrow as needed.\n\n  **Upgrading from 2.0 and using API Tokens is highly recommended!**\n\n  The `--domains` option is now gone, because it made no sense (it only existed\n  for reading from the envvar), but you can use the `CLOUDFLARE_DOMAINS` envvar\n  the same as before.\n\n- **v2.0** breaks backward compatibility for a PyPI release.\n\n  The script you need to run is now called `cloudflare-dyndns` and the cache file\n  also changed. You can delete the old cache manually, or you can leave it, it\n  won't cause a problem.\n\n  The Docker file entry point is changed, so if you pull the new image, everything\n  will work as before.\n\n## Development\n\nYou can install dependencies with poetry (preferable in a virtualenv).  \nAfter [installing poetry](https://poetry.eustace.io/docs/#installation), simply run:\n\n```bash\n$ poetry install\n```\n",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "CloudFlare Dynamic DNS client",
    "version": "4.1",
    "project_urls": {
        "Homepage": "https://github.com/kissgyorgy/cloudflare-dyndns",
        "Repository": "https://github.com/kissgyorgy/cloudflare-dyndns"
    },
    "split_keywords": [],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "7b7bf49df49ff3c513774c1520c15b5314fc51f337164f5858eb8643875d80d8",
                "md5": "c40cdafb4cb38a9f21033a1d6529fb8c",
                "sha256": "9621349a2fe41d768da9476e5c259a8239dfa3d312f8ef4d89f255308a6f1a6a"
            },
            "downloads": -1,
            "filename": "cloudflare_dyndns-4.1-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "c40cdafb4cb38a9f21033a1d6529fb8c",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.9.2,<4.0.0",
            "size": 12006,
            "upload_time": "2022-05-01T09:38:30",
            "upload_time_iso_8601": "2022-05-01T09:38:30.826401Z",
            "url": "https://files.pythonhosted.org/packages/7b/7b/f49df49ff3c513774c1520c15b5314fc51f337164f5858eb8643875d80d8/cloudflare_dyndns-4.1-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "6e9f8a508294bd420ca6f8b4c9ee27b4af5bb3ceda0f0ed85972c5aad9be040a",
                "md5": "c6212792693a50ed3a9f1014dbc5ed77",
                "sha256": "a400c4ac6b5dba7d4e141c3c76352c5335f465d6616262a1334b6f02f6ac815b"
            },
            "downloads": -1,
            "filename": "cloudflare-dyndns-4.1.tar.gz",
            "has_sig": false,
            "md5_digest": "c6212792693a50ed3a9f1014dbc5ed77",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.9.2,<4.0.0",
            "size": 11696,
            "upload_time": "2022-05-01T09:38:28",
            "upload_time_iso_8601": "2022-05-01T09:38:28.568815Z",
            "url": "https://files.pythonhosted.org/packages/6e/9f/8a508294bd420ca6f8b4c9ee27b4af5bb3ceda0f0ed85972c5aad9be040a/cloudflare-dyndns-4.1.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2022-05-01 09:38:28",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "kissgyorgy",
    "github_project": "cloudflare-dyndns",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": false,
    "requirements": [],
    "lcname": "cloudflare-dyndns"
}
        
Elapsed time: 0.21099s