Skip to content

Commit 4361bac

Browse files
committed
- 🆕 New hostname input format: subdomain1.mydomain.com|subdomain2.mydomain.com (each domain is separated by three dashes: |) used to be with --- separator
- 🆕 Hostname input uses a new source of data (account) and support 256 symbols limit (DSM UI limit) - 🆕 Autodetect IPv4 and IPv6 addresses - 🆕 Optimised request to Cloudflare API - 🆕 Installer script
1 parent 900afd2 commit 4361bac

5 files changed

Lines changed: 539 additions & 338 deletions

File tree

README.md

Lines changed: 34 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -5,22 +5,30 @@
55
66
## Table of contents
77

8+
* 🆕 [What is new](#what-is-new)
89
* [What this script does](#what-this-script-does)
910
* [Before you begin](#before-you-begin)
10-
* [How to install](#how-to-install)
11+
* 🆕 [How to install](#how-to-install)
1112
* [Troubleshooting and known issues](#troubleshooting-and-known-issues)
1213
+ [CloudFlare API free domains limitation](#cloudflare-api-free-domains-limitation)
1314
+ [Connection test failed or error returned](#connection-test-failed-or-error-returned)
1415
+ [Cloudflare no longer listed as a DDNS provider after a DSM update](#cloudflare-no-longer-listed-as-a-ddns-provider-after-dsm-or-srm-updates)
1516
* [Default Cloudflare ports](#default-cloudflare-ports)
1617
* [Debug script](#debug)
1718

19+
## What is new
20+
21+
- 🆕 New hostname input format: `subdomain1.mydomain.com|subdomain2.mydomain.com` (each domain is separated by three dashes: `|`) used to be with `---` separator
22+
- 🆕 Hostname input uses a new source of data (account) and support 256 symbols limit (DSM UI limit)
23+
- 🆕 Autodetect IPv4 and IPv6 addresses
24+
- 🆕 Optimised request to Cloudflare API
25+
- 🆕 Installer script
1826

1927
## What this script does
2028

2129
* A PHP script for Synology DSM (and potentially Synology SRM devices) adding support for Cloudflare to Network Centre > Dynamic DNS (DDNS).
2230
* Supports single domains, multidomains, subdomains and regional domains, or any combination thereof (example: dev.my.domain.com.au, domain.com.uk etc)
23-
* Easy instalation process
31+
* 🆕 Easy installation process (added auto install script)
2432
* Based on CloudFlare API v4
2533
* [Supports dual stack IPv4 and IPv6](https://github.com/mrikirill/SynologyDDNSCloudflareMultidomain/pull/13)
2634

@@ -47,7 +55,7 @@ Before starting the installation process, make sure you have (and know) the foll
4755

4856
**Include** > **All zones from an account** > `<domain>`
4957

50-
3. *DNS settings:*
58+
2. *DNS settings:*
5159

5260
Ensure the DNS A record(s) for the domain/zone(s) you wish to update with this script have been created (More information: [Managing DNS records](https://support.cloudflare.com/hc/en-us/articles/360019093151-Managing-DNS-records-in-Cloudflare)).
5361

@@ -57,7 +65,7 @@ Before starting the installation process, make sure you have (and know) the foll
5765

5866
![image](https://github.com/mrikirill/SynologyDDNSCloudflareMultidomain/blob/master/docs/example1.png)
5967

60-
4. *SSH access to your Synology device:*
68+
3. *SSH access to your Synology device:*
6169

6270
If you haven't setup this access, see the following Synology Knowledge Base article:
6371
[How can I sign in to DSM/SRM with root privilege via SSH?[(https://kb.synology.com/en-id/DSM/tutorial/How_to_login_to_DSM_with_root_permission_via_SSH_Telnet)
@@ -86,30 +94,20 @@ For assistance with vi commands, see:
8694

8795
2. **Connect via SSH:** Connect to your supported device via SSH and execute command
8896

89-
* For DSM Users
97+
* 🆕 For DSM Users
9098
```
91-
wget https://raw.githubusercontent.com/mrikirill/SynologyDDNSCloudflareMultidomain/master/cloudflare.php -O /usr/syno/bin/ddns/cloudflare.php && sudo chmod 755 /usr/syno/bin/ddns/cloudflare.php
99+
wget https://raw.githubusercontent.com/mrikirill/SynologyDDNSCloudflareMultidomain/master/install.sh -O install.sh && sudo bash install.sh
92100
```
93101

94-
* For SRM Users
102+
* 🆕 For SRM Users
95103
Note: Ensure you are connected as root in your SSH session
96104
```
97-
wget https://raw.githubusercontent.com/mrikirill/SynologyDDNSCloudflareMultidomain/master/cloudflare.php -O /usr/syno/bin/ddns/cloudflare.php && chmod 755 /usr/syno/bin/ddns/cloudflare.php
105+
wget https://raw.githubusercontent.com/mrikirill/SynologyDDNSCloudflareMultidomain/master/install.sh -O install.sh && sudo bash install.sh
98106
```
99107

100108
**Note:** For SRM users, you must connect to your device as root. No other username will allow these commands to run.
101109

102-
3. **Update DDNS provider list:** Using a command line editor, insert the text below to your DMS file (Location : __/etc.defaults/ddns_provider.conf__), to add DDNS support via Cloudflare:
103-
104-
```
105-
[Cloudflare]
106-
modulepath=/usr/syno/bin/ddns/cloudflare.php
107-
queryurl=https://www.cloudflare.com/
108-
```
109-
110-
**Note:** For SRM users, break out this [Vim cheat sheet](https://coderwall.com/p/adv71w/basic-vim-commands-for-getting-started), as it's the only text editor available to you.
111-
112-
4. **Update your DDNS settings:**
110+
3. **Update your DDNS settings:**
113111

114112
a. *For DSM Users:* Navigate to __Control Panel > External Access > DDNS__ then add new DDNS
115113
@@ -118,20 +116,20 @@ For assistance with vi commands, see:
118116
Add/Update the DDNS settings screen as follows:
119117

120118
* Service provider: Select Cloudflare
121-
* Hostname:
122-
For a single domain: __mydomain.com__
123-
For multiple domains: __subdomain.mydomain.com---vpn.mydomain.com__
124-
(ensure each domain is seperated by three dashes: ---)
119+
* 🆕Hostname: this field is not used anymore, you can put any value here
120+
* Username:
121+
For a single domain: __mydomain.com__
122+
For multiple domains: __subdomain.mydomain.com|vpn.mydomain.com__
123+
🆕(ensure each domain is separated: `|`)🆕
125124

126-
__Note: there is 128 symbols limit on Hostname input__
127-
* Username: The email address you use for logging in to Cloudflare (optional since the API key is sufficient)
125+
__Note: there is 256 symbols limit on Hostname input__
128126
* Password: Your created Cloudflare API Key
129127

130128
![image](https://github.com/mrikirill/SynologyDDNSCloudflareMultidomain/blob/master/docs/example3.png)
131129

132130
Finally, press the test connection button to confirm all information is correctly entered, before pressing Ok to save and confirm your details.
133131

134-
5. Enjoy 🍺 and __don't forget to deactivate SSH (step 1) if you don't need it__.
132+
4. Enjoy 🍺 and __don't forget to deactivate SSH (step 1) if you don't need it__.
135133

136134
## Troubleshooting and known issues
137135

@@ -179,15 +177,15 @@ If this occurs, simply [repeat the How to install steps](#how-to-install) shown
179177
## Default Cloudflare ports
180178
Source [Identifying network ports compatible with Cloudflare's proxy](https://support.cloudflare.com/hc/en-us/articles/200169156-Identifying-network-ports-compatible-with-Cloudflare-s-proxy)
181179

182-
|HTTP ports supported by Cloudflare | HTTPS ports supported by Cloudflare |
183-
|--|--|
184-
| 80 | 443 |
185-
| 8080 | 2053 |
186-
| 8880 | 2083 |
187-
| 2052 | 2087 |
188-
| 2082 | 2096 |
189-
| 2086 | 8443 |
190-
| 2095 | |
180+
| HTTP ports supported by Cloudflare | HTTPS ports supported by Cloudflare |
181+
|------------------------------------|-------------------------------------|
182+
| 80 | 443 |
183+
| 8080 | 2053 |
184+
| 8880 | 2083 |
185+
| 2052 | 2087 |
186+
| 2082 | 2096 |
187+
| 2086 | 8443 |
188+
| 2095 | |
191189

192190
## Debug
193191

@@ -198,12 +196,7 @@ You can run this script directly to see output logs
198196
* Run this command:
199197

200198
```
201-
/usr/bin/php -d open_basedir=/usr/syno/bin/ddns -f /usr/syno/bin/ddns/cloudflare.php "" "your-CloudFlare-token" "your---domains---divided---by---dashes" "ip-address"
199+
/usr/bin/php -d open_basedir=/usr/syno/bin/ddns -f /usr/syno/bin/ddns/cloudflare.php "" "domain1.com|vpn.domain2.com" "your-CloudFlare-token" "" ""
202200
```
203201

204202
* Check output logs
205-
206-
## Credits
207-
208-
<small><i><a href='http://ecotrust-canada.github.io/markdown-toc/'>Table of contents generated with markdown-toc</a></i></small>
209-
<small><i><a href='https://www.youtube.com/watch?v=Nf7m3h11y-s'>DB Tech - creating API keys and using Cloudflare CNAME for single updates</a></i></small>

0 commit comments

Comments
 (0)