Metadata-Version: 2.4
Name: synology-cloudflare-ddns
Version: 0.2.0
Summary: A simple script to update CloudFlare DDNS for Synology NAS.
Author-email: Cian Butler <butlerx@notthe.cloud>
License: MIT License
        
        Copyright (c) 2019 Cian Butler
        
        Permission is hereby granted, free of charge, to any person obtaining a copy
        of this software and associated documentation files (the "Software"), to deal
        in the Software without restriction, including without limitation the rights
        to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
        copies of the Software, and to permit persons to whom the Software is
        furnished to do so, subject to the following conditions:
        
        The above copyright notice and this permission notice shall be included in all
        copies or substantial portions of the Software.
        
        THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
        IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
        FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
        AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
        LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
        OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
        SOFTWARE.
        
Project-URL: Homepage, https://github.com/butlerx/SynologyCloudflareDDNS
Project-URL: Issues, https://github.com/butlerx/SynologyCloudflareDDNS/issues
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Programming Language :: Python :: 3.14
Requires-Python: >=3.11
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: cloudflare==2.19.*
Requires-Dist: orjson
Requires-Dist: python-json-logger>=4.0.0
Dynamic: license-file

A simple script to update CloudFlare DDNS for Synology NAS. This script can be
integrated into Synology NAS UI. It largely refers to
[official CloudFlare's API example for Python](https://raw.githubusercontent.com/cloudflare/python-cloudflare/master/examples/example_update_dynamic_dns.py)

# Installation

1.  Install Python 3.11 or newer from the Synology Package Center using the NAS
    web interface.
2.  Enable the SSH connection and ssh into your NAS
3.  Install pip for python3, then get python-cloudflare

```
sudo python3 -m ensurepip
sudo python3 -m pip install --upgrade pip setuptools
sudo python3 -m pip install "git+https://github.com/butlerx/SynologyCloudflareDDNS.git"
```

# Usage

```
synology_cloudflare_ddns <email> <api_key> <hostname> <ip_address> [--log-level LEVEL] [--log-format kv|json]
```

- **email**: (Required for Synology UI compatibility, but not used by this
  script)
- **api_key**: Your Cloudflare API key. Find it in your Cloudflare dashboard
  under 'My Profile' > 'API Tokens'.
  [Where do I find my Cloudflare API key?](https://support.cloudflare.com/hc/en-us/articles/200167836-Where-do-I-find-my-Cloudflare-API-key-)
- **hostname**: The domain name to update (e.g., `example.com`).
- **ip_address**: The IP address to set for the DNS record.
- **--log-level**: Logging level (default: ERROR).
- **--log-format**: Log output format: `kv` (key-value, default) or `json`.

# Synology Integration

Integrate the script into Synology DDNS management interface by adding the
following text into `/etc.defaults/ddns_provider.conf`:

```
[Cloudflare]
        modulepath=/bin/synology_cloudflare_ddns
        queryurl=https://www.cloudflare.com/
```

Go to DDNS management page in your NAS web UI (control->external access->DDNS).
Click Add. And select Cloudflare from the drop-down menu. Fill the three
necessary fields which are hostname, username, and password (CloudFlare API
Key).

That's it. See if the DDNS' IP has been updated in your Cloudflare page.
