项目作者: joshuaavalon

项目描述 :
Cloudflare DDNS is a Python program that provides DDNS for Cloudflare via Cloudflare API v4.
高级语言: Python
项目地址: git://github.com/joshuaavalon/cloudflare-ddns.git
创建时间: 2018-11-30T03:38:06Z
项目社区:https://github.com/joshuaavalon/cloudflare-ddns

开源协议:Apache License 2.0

下载


Cloudflare DDNS

License
Documentation Status
Test
Maintainability
Known Vulnerabilities

Cloudflare DDNS is a Python program that provides DDNS for Cloudflare via Cloudflare API v4.

Requirement

  • Python 3.7+ / Docker

Usage

Using Docker

  1. ```
  2. ### Run directly
  3. 1. Clone the git repository

git clone https://github.com/joshuaavalon/cloudflare-ddns.git

  1. 2. Setup up your [configuration](#configuration).
  2. 3. Run `run.py`

python run.py

  1. ## Configuration
  2. There are two ways to configure: environment variables and JSON.
  3. ### Using environment variables
  4. You use environment variables if you want a quick setup and run only 1 DDNS.
  5. * `EMAIL` - *require*: Email of your Cloudflare account (E.g. `foo@bar.com`)
  6. * `API_KEY` - *require*: API key of your Cloudflare account (E.g. `abcdefg123456`)
  7. * `ZONE` - *require*: Root domain of domain that you want to change (E.g. `bar.com`)
  8. * `DOMAIN` - *require*: Domain that you want to change (E.g. `foo.bar.com`)
  9. * `TTL`: TTL of the DNS record (default: `1` which is automatic)
  10. * `PROXIED`: Enable Cloudflare proxy for the DNS record (default: `true`)
  11. * `LOG_LEVEL`: Logging level to standard output (default: `INFO`)
  12. ### Using JSON configuration file
  13. You use JSON configuration for a more security or multiple DDNS.
  14. * `CONFIG_PATH` - *require*: Location of the configuration file.
  15. **Example configuration**
  16. ```json
  17. {
  18. "api_url": "https://api.cloudflare.com/client/v4/",
  19. "ip_echo": [
  20. "https://ipecho.net/plain",
  21. "https://icanhazip.com/",
  22. "https://tnx.nl/ip",
  23. "http://whatismyip.akamai.com/"
  24. ],
  25. "config": [
  26. {
  27. "email": null,
  28. "api_key": null,
  29. "zone": null,
  30. "domain": null,
  31. "ip": null,
  32. "proxied": true,
  33. "ttl": 1
  34. }
  35. ]
  36. }
  • api_url - API endpoint. (Default: See the example above)
  • ip_echo - Endpoint for ip address echoing if ip is not set. (Default: See the example above)
  • config - Configuration for each DDNS.
    • email - require: Email of your Cloudflare account (E.g. foo@bar.com)
    • api_key - require: API key of your Cloudflare account (E.g. abcdefg123456)
    • zone - require: Root domain of domain that you want to change (E.g. bar.com)
    • domain - require: Domain that you want to change (E.g. foo.bar.com)
    • ip - Hard code ip address instead of ip address echoing. (E.g. 127.0.0.1)
    • proxied - Enable Cloudflare proxy for the DNS record (default: true)
    • ttl - TTL of the DNS record (default: 1 which is automatic)