Skip to content

michaelochs/SynologyCloudFlareDDNS

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

34 Commits
 
 
 
 
 
 

Repository files navigation

SynologyCloudFlareDDNS

Purpose & Pros

  • A script for Cloudflare DDNS on Synology DSM.
  • A Minimum Settings required.
  • Uses Cloudflare API v4.

Changelog

2022.02.14. Supports both "API Tokens" and "Global API Key"

Prerequisites

  • Have a active Zone in Cloudflare. (Your own domain, too)
  • Have a A Record.

Installation - Simple way (requires DSM 7.0+ or Python3 installed)

  1. Open Task Scheduler (Control Panel - [Services] Task Scheduler)

  2. Create a user-defined script item. Create - Triggered Task - User-defined script

[General Tab]
Task: Cloudflare DDNS (not important)
User: root
Event: Boot-up
Pre-task: none
Enabled: Checked
[Task Settings Tab]
[Run Command] User-defined script
    curl https://raw.githubusercontent.com/michaelochs/SynologyCloudflareDDNS/master/setddns.py | python3 -
  1. Press OK

  2. Right-Click on the task you've just created.

  3. Click Run

  4. You can see Cloudflare DDNS has been added to your DDNS list.

  5. Setup DDNS in Synology DSM (You can use "API Tokens" or "Global API Key")

a. Using API Tokens (Recommended)

(1) Single Domain and single permission can granted with a Token -> more secure
(2) How to create: Cloudflare - My Profile - API Tokens - Create Token (Use "Edit zone DNS" template, required permission: Zone - DNS - Edit)
(3) Synology DDNS Settings

Username: Anything you want(not using when authorize the token)
Password: API Token (40 byte)

Use "Edit zone DNS" Template Check the Permission and Domain name

b. Using Global API Key

(1) All permission with a single API Key - less secure
(2) How to view: Cloudflare - My Profile - API Tokens - Global API Key - Click "View"
(3) Synology DDNS Settings

Username: Cloudflare Username
Password: Global API Key (37 byte)

Installation - Another way (DSM 7.0- or Python3 NOT installed)

  1. Connect via SSH. (can be activated in DSM)
  2. Execute
sudo curl https://raw.githubusercontent.com/michaelochs/SynologyCloudflareDDNS/master/cloudflare.php -o /usr/syno/bin/ddns/cloudflare.php && sudo chmod 755 /usr/syno/bin/ddns/cloudflare.php
  1. Add some notes to end of DDNS config file. You can use your preferred text-editor. (sudo vi /etc.defaults/ddns_provider.conf)
[Cloudflare]
  modulepath=/usr/syno/bin/ddns/cloudflare.php
  queryurl=https://www.cloudflare.com/
  1. Set up DDNS in DSM (Use your Cloudflare Global API Key(can be found in My Profile) as a password)

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • PHP 82.2%
  • Python 17.8%