Skip to content

Commit 8a51d18

Browse files
authored
Merge pull request #5 from twcau/master
Further updates to README.md
2 parents d12007a + 9ddd2a0 commit 8a51d18

1 file changed

Lines changed: 109 additions & 56 deletions

File tree

README.md

Lines changed: 109 additions & 56 deletions
Original file line numberDiff line numberDiff line change
@@ -1,83 +1,136 @@
1-
Synology DDNS Cloudflare with multidomains and subdomains
2-
========================
31

4-
Update note
5-
---------------
6-
I've mentioned that after Synology DSM update, the file __/usr/syno/bin/ddns/cloudflare.php__ has been deleted and __/etc.defaults/ddns_provider.conf__ reset to default settings.
2+
# Synology Dynamic DNS with Cloudflare for both multidomains and subdomains
73

8-
For that case you need just repeat all installations steps.
4+
## Table of contents
95

10-
The list of default Cloudflare ports
11-
---------------
6+
* [What this script does](#what-this-script-does)
7+
* [Before you begin](#before-you-begin)
8+
* [How to install](#how-to-install)
9+
* [Troubleshooting and known issues](#troubleshooting-and-known-issues)
10+
+ [Connection test failed or error returned](#connection-test-failed-or-error-returned)
11+
+ [Cloudflare no longer listed as a DDNS provider after a DSM update](#cloudflare-no-longer-listed-as-a-ddns-provider-after-a-dsm-update)
12+
* [Default Cloudflare ports](#default-cloudflare-ports)
1213

13-
HTTP ports supported by Cloudflare:
1414

15-
80
16-
8080
17-
8880
18-
2052
19-
2082
20-
2086
21-
2095
15+
## What this script does
2216

23-
HTTPS ports supported by Cloudflare:
24-
25-
443
26-
2053
27-
2083
28-
2087
29-
2096
30-
8443
31-
32-
Description
33-
---------------
34-
* A PHP script for Synology DSM (and potentially Synology SRM devices) which adds Cloudflare DDNS support in your DMS
35-
* Supports multidomains, subdomains and also regional domains (example: dev.my.domain.com.au, domain.com.uk etc)
17+
* A PHP script for Synology DSM (and potentially Synology SRM devices) adding support for Cloudflare to Network Centre > Dynamic DNS (DDNS).
18+
* Supports single domains, multidomains, subdomains and regional domains, or any combination thereof (example: dev.my.domain.com.au, domain.com.uk etc)
3619
* Easy instalation process
3720
* Based on CloudFlare API v4
3821

39-
Before start to use this script
40-
---------------
41-
* Have a Cloudflare account with active domains
42-
* Have A Records
22+
## Before you begin
23+
24+
Before starting the installation process, make sure you have (and know) the following information, or have completed these steps:
25+
26+
1. *Cloudflare credentials*
27+
28+
a. Know your Cloudflare account username (or [register for an account if you're new to Cloudflare](https://dash.cloudflare.com/sign-up)); and
29+
30+
b. Have your [Global API key](https://dash.cloudflare.com/profile/api-tokens) (More info: [Global API keys](https://support.cloudflare.com/hc/en-us/articles/200167836-Managing-API-Tokens-and-Keys)).
31+
32+
2. *DNS settings:*
33+
34+
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)).
35+
36+
Your DNS records should appear (or already be setup as follows) in Cloudflare:
37+
38+
(Note: Having Proxied turned on for your A records isn't necessary, but it will prevent those snooping around from easily finding out your current IP address)
39+
40+
![image](example1.png)
4341

44-
Example
45-
---------------
46-
![image](example1.png)
42+
## How to install
4743

48-
Installation
49-
----------------
50-
1. Activate SSH in DMS (__Control Panel -> Terminal & SNMP -> Enable SSH service__)
51-
![image](example2.png)
44+
1. **Activate SSH on your supported device:**
5245

53-
2. Connect via SSH and execute command
46+
a. For DSM Users:
47+
48+
Navigate to __Control Panel > Terminal & SNMP > Enable SSH service__
49+
50+
b. For SRM users:
51+
52+
Navigate to __Control Panel > Services > System Services > Terminal > Enable SSH service__
53+
54+
![image](example2.png)
5455

55-
* DSM Users
56+
2. **Connect via SSH:** Connect to your supported device via SSH and execute command
57+
58+
* For DSM Users
5659
```
5760
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
5861
```
5962

60-
* SRM Users
63+
* For SRM Users
6164
Note: Ensure you are connected as root in your SSH session
6265
```
6366
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
6467
```
6568

66-
3. Add Cloudflare to the list of DDNS providers DMS file(Location : __/etc.defaults/ddns_provider.conf__)
69+
**Note:** For SRM users, you must connect to your device as root. No other username will allow these commands to run.
70+
71+
3. **Update DDNS provider list:** Using your preferred/available command line editor, insert the text below to your DMS file (Location : __/etc.defaults/ddns_provider.conf__), to add DDNS support via Cloudflare:
72+
73+
```
74+
[Cloudflare]
75+
modulepath=/usr/syno/bin/ddns/cloudflare.php
76+
queryurl=https://www.cloudflare.com/
77+
```
78+
79+
**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.
80+
81+
4. **Update your DDNS settings:**
82+
83+
a. *For DSM Users:* Navigate to __Control Panel > External Access > DDNS__ then add new DDNS
84+
85+
b. *For SRM users:* Navigate to __Network Centre > Internet > QuickConnect & DDNS > DDNS__ and press the Add button:
86+
87+
Add/Update the DDNS settings screen as follows:
88+
89+
* Service provider: Select Cloudflare
90+
* Hostname:
91+
For a single domain: __mydomain.com__
92+
For multiple domains: __subdomain.mydomain.com---vpn.mydomain.com__
93+
(ensure each domain is seperated by three dashes: ---)
94+
* Username: The email address you use for logging in to Cloudflare.
95+
* Password: Your Cloudflare Global API Key
96+
97+
![image](example3.png)
98+
99+
Finally, press the test connection button to confirm all information is correctly entered, before pressing Ok to save and confirm your details.
100+
101+
5. Enjoy 🍺 and __don't forget to deactivate SSH (step 1) if you don't need it__.
102+
103+
## Troubleshooting and known issues
104+
105+
### Connection test failed or error returned
106+
107+
This will manifest as either 1020 error; or the update attempt not showing in your Cloudflare Audit logs.
108+
109+
That generally means you may not have entered something correctly in the DDNS screen for your domain(s).
110+
111+
Revisit [Before you begin](#before-you-begin) to ensure you have all the right information, then go back to Step 4 in [How to install](#how-to-install) to make sure everything is correctly entered.
112+
113+
**Handy hint:** You can also check your Cloudflare Audit logs to see what - if anything - has made it there with your API key (More information: [Understanding Cloudflare Audit Logs](https://support.cloudflare.com/hc/en-us/articles/115002833612-Understanding-Cloudflare-Audit-Logs)). Updates using the API will appear in the Audit logs as a Rec Set action.
114+
115+
### Cloudflare no longer listed as a DDNS provider after a DSM update
116+
117+
After updates to Synology DSM, you may find the file __/usr/syno/bin/ddns/cloudflare.php__ has been deleted, and __/etc.defaults/ddns_provider.conf__ reset to default settings.
67118

68-
```
69-
[Cloudflare]
70-
modulepath=/usr/syno/bin/ddns/cloudflare.php
71-
queryurl=https://www.cloudflare.com/
72-
```
119+
If this occurs, simply [repeat the How to install steps](#how-to-install) shown above.
73120

74-
5. Than go to DMS settingS __Control Panel -> External Access -> DDNS__ and add new DDNS:
121+
## Default Cloudflare ports
122+
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)
75123

76-
* Select Cloudflare as a service provider
77-
* Set in __hostname__ field your list of domains divided by __---__ example: __mydoman.com---subdomain.mydomain.com---vpn.mydomain.com__ or simple: __mydomain.com__
78-
* Set your Cloudflare acoount email into __Username/Email__ field
79-
* Set Cloudflare Global API Key into __Password/Key__ field (See: [https://dash.cloudflare.com/profile/api-tokens](https://dash.cloudflare.com/profile/api-tokens))
124+
|HTTP ports supported by Cloudflare | HTTPS ports supported by Cloudflare |
125+
|--|--|
126+
| 80 | 443 |
127+
| 8080 | 2053 |
128+
| 8880 | 2083 |
129+
| 2052 | 2087 |
130+
| 2082 | 2096 |
131+
| 2086 | 8443 |
132+
| 2095 | |
80133

81-
![image](example3.png)
134+
## Credits
82135

83-
6. Enjoy 🍺 and __don't forget to deactivate SSH (step 1) if you don't need it__
136+
<small><i><a href='http://ecotrust-canada.github.io/markdown-toc/'>Table of contents generated with markdown-toc</a></i></small>

0 commit comments

Comments
 (0)