diff --git a/404.html b/404.html index 2739fc7..c9aa607 100644 --- a/404.html +++ b/404.html @@ -214,7 +214,7 @@ - Synology Dynamic DNS Native Agent for Cloudflare (Multidomains & Subdomains) + Home diff --git a/index.html b/index.html index e0ba932..8637881 100644 --- a/index.html +++ b/index.html @@ -100,7 +100,7 @@
+This project is based on my PHP version of the agent: https://github.com/mrikirill/SynologyDDNSCloudflareMultidomain
-
Documentation website: https://mrikirill.github.io/KTSynologyDDNSCloudflareMultidomain/
+The idea of this project is to provide a native agent for Synology DSM and SRM devices ⚠️(read here) to update Cloudflare DNS records without requiring any dependencies.
-This project is based on the original PHP version of the agent but is written in Kotlin Native and does not require the JVM. The agent is a standalone executable file that doesn't rely on system dependencies, which is the main difference from the PHP version. Additionally, it includes unit tests covering the main logic of the agent.
+This project is based on the original PHP version of the agent but is written in Kotlin Native and does not require the JVM. The agent is a standalone executable file that doesn't rely on system dependencies, which is the main difference from the PHP version. Additionally, it includes unit tests covering the main logic of the agent.
Kotlin Native Documentation here
+Kotlin Native Documentation here
Clone the repository
@@ -671,7 +689,7 @@./gradlew build
-Note: cause the agent includes the Ktor Client Curl Engine it requires extra steps documented here
+Note: cause the agent includes the Ktor Client Curl Engine it requires extra steps documented here
Before starting the installation process, make sure you have (and know) the following information, or have completed these steps:
a. Know your Cloudflare account username (or register for an account if you're new to Cloudflare); and
b. Have your API key - no need to use your Global API key! (More info: API keys).
- + c. Create a API key with following (3) permissions:
**Zone** > **Zone.Settings** > **Read**
@@ -696,7 +714,7 @@ Before you start
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).
Your DNS records should appear (or already be setup as follows) in Cloudflare:
(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)
-
+
- SSH access to your Synology device:
@@ -710,7 +728,7 @@ How to install
Navigate to Control Panel > Terminal & SNMP > Enable SSH service
b. For SRM users:
Navigate to Control Panel > Services > System Services > Terminal > Enable SSH service
-
+
- Connect via SSH: Connect to your supported device via SSH and run this command:
@@ -721,17 +739,19 @@ How to install
a. For DSM Users: Navigate to Control Panel > External Access > DDNS then add new DDNS
b. For SRM users: Navigate to Network Centre > Internet > QuickConnect & DDNS > DDNS and press the Add button:
Add/Update the DDNS settings screen as follows:
-* Service provider: Select Cloudflare
-* Hostname: this field is not used anymore, you can put any value here
-* Username:
- For a single domain: __mydomain.com__
- For multiple domains: __subdomain.mydomain.com|vpn.mydomain.com__
- (ensure each domain is separated: `|`)
-
- __Note: there is 256 symbols limit on Hostname input__
-* Password: Your created Cloudflare API Key
-
-
+
+- Service provider: Select Cloudflare
+- Hostname: this field is not used anymore, you can put any value here
+-
+
Username:
+ For a single domain: mydomain.com
+ For multiple domains: subdomain.mydomain.com|vpn.mydomain.com
+ (ensure each domain is separated: |
)
+Note: there is 256 symbols limit on Hostname input
+ * Password: Your created Cloudflare API Key
+
+
+
Finally, press the test connection button to confirm all information is correctly entered, before pressing Ok to save and confirm your details.
- Enjoy 🍺 and don't forget to deactivate SSH (step 1) if you don't need it.
@@ -810,11 +830,27 @@ Debug
Run this command:
./KTSynologyDDNSCloudflareMultidomain.kexe "" "domain1.com|vpn.domain2.com" "your-Cloudflare-token" "" "1.2.3.4 - ipv4 adress"
+./KTSynologyDDNSCloudflareMultidomain.kexe "domain1.com|vpn.domain2.com" "your-Cloudflare-token" "any" "1.2.3.4 - ipv4 address"
- Check output logs
+Output messages
+From /etc.defaults/ddns_provider.conf
:
+
+When you write your own module, you can use the following words to tell user what happen by print it.
+You can use your own message, but there is no multiple-language support.
+good
- Update successfully.
+nochg
- Update successfully but the IP address have not changed.
+nohost
- The hostname specified does not exist in this user account.
+abuse
- The hostname specified is blocked for update abuse.
+notfqdn
- The hostname specified is not a fully-qualified domain name.
+badauth
- Authenticate failed.
+911
- There is a problem or scheduled maintenance on provider side
+badagent
- The user agent sent bad request(like HTTP method/parameters is not permitted)
+badresolv
- Failed to connect to because failed to resolve provider address.
+badconn
- Failed to connect to provider because connection timeout.
+
Credits
MKDoc - generate documentation
Support this project
diff --git a/search/search_index.json b/search/search_index.json
index 6b706e7..f1cd01b 100644
--- a/search/search_index.json
+++ b/search/search_index.json
@@ -1 +1 @@
-{"config":{"lang":["en"],"separator":"[\\s\\-]+","pipeline":["stopWordFilter"]},"docs":[{"location":"","title":"Synology Dynamic DNS Native Agent for Cloudflare (Multidomains & Subdomains)","text":"This project is based on my PHP version of the agent: https://github.com/mrikirill/SynologyDDNSCloudflareMultidomain
"},{"location":"#why-this-project","title":"Why this project?","text":"The idea of this project is to provide a native agent for Synology DSM and SRM devices \u26a0\ufe0f(read here) to update Cloudflare DNS records without requiring any dependencies.
This project is based on the original PHP version of the agent but is written in Kotlin Native and does not require the JVM. The agent is a standalone executable file that doesn't rely on system dependencies, which is the main difference from the PHP version. Additionally, it includes unit tests covering the main logic of the agent.
"},{"location":"#stack","title":"Stack","text":" - Kotlin Native with target linuxX64 and linuxArm64
- Ktor Client Curl Engine
"},{"location":"#table-of-contents","title":"Table of contents","text":" - What this native agent does
- SRM Support
- Build the agent locally
- Before you start
- How to install
- Troubleshooting and known issues
- CloudFlare API free domains limitation
- Connection test failed or error returned
- Cloudflare no longer listed as a DDNS provider after a DSM update
- Default Cloudflare ports
- Debug script
- Credits
- Support this project
"},{"location":"#what-this-native-agent-does","title":"What this native agent does","text":" - Works as a standalone executable file.
- Functionality remains consistent with the PHP version of the agent.
- Designed for Synology DSM and \u26a0\ufe0fSynology SRM devices to integrate Cloudflare support into
Network Centre > Dynamic DNS (DDNS)
. - Supports single domains, multidomains, subdomains, regional domains, or any combination etc (e.g., dev.my.domain.com.au, domain.com.uk, etc.).
- Simple installation process.
- Based on CloudFlare API v4
- Use ipify.org to detect IPv6
- Compatible with both IPv4 and IPv6 dual stack.
"},{"location":"#srm-support","title":"SRM Support","text":"SRM-based devices use the Linux Arm64 architecture. The agent has a build target for Linux Arm64 and should work on SRM devices. However, it needs to be built locally and tested on SRM devices. Currently, it has not been tested on SRM devices, and there is no established build process for Linux Arm64.
"},{"location":"#build-the-agent-locally","title":"Build the agent locally","text":" -
Kotlin Native Documentation here
-
Clone the repository
-
Run the following command to build the agent
./gradlew build\n
Note: cause the agent includes the Ktor Client Curl Engine it requires extra steps documented here
"},{"location":"#before-you-start","title":"Before you start","text":"Before starting the installation process, make sure you have (and know) the following information, or have completed these steps:
- Cloudflare credentials:
a. Know your Cloudflare account username (or register for an account if you're new to Cloudflare); and
b. Have your API key - no need to use your Global API key! (More info: API keys).
c. Create a API key with following (3) permissions:\n\n **Zone** > **Zone.Settings** > **Read** \n **Zone** > **Zone** > **Read** \n **Zone** > **DNS** > **Edit**\n\n The affected zone ressouces have to be (at least):\n\n**Include** > **All zones from an account** > `<domain>`\n
- DNS settings:
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).
Your DNS records should appear (or already be setup as follows) in Cloudflare:
(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)
- SSH access to your Synology device:
If you haven't setup this access, see the following Synology Knowledge Base article: [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)
"},{"location":"#how-to-install","title":"How to install","text":" - SSH with sudo on your supported device:
a. For DSM Users:
Navigate to Control Panel > Terminal & SNMP > Enable SSH service
b. For SRM users:
Navigate to Control Panel > Services > System Services > Terminal > Enable SSH service
- Connect via SSH: Connect to your supported device via SSH and run this command:
wget https://raw.githubusercontent.com/mrikirill/KTSynologyDDNSCloudflareMultidomain/master/install.sh -O install.sh && sudo bash install.sh
- Update your DDNS settings:
a. For DSM Users: Navigate to Control Panel > External Access > DDNS then add new DDNS
b. For SRM users: Navigate to Network Centre > Internet > QuickConnect & DDNS > DDNS and press the Add button:
Add/Update the DDNS settings screen as follows:
* Service provider: Select Cloudflare\n* Hostname: this field is not used anymore, you can put any value here\n* Username:\n For a single domain: __mydomain.com__\n For multiple domains: __subdomain.mydomain.com|vpn.mydomain.com__\n (ensure each domain is separated: `|`)\n\n __Note: there is 256 symbols limit on Hostname input__\n* Password: Your created Cloudflare API Key\n
Finally, press the test connection button to confirm all information is correctly entered, before pressing Ok to save and confirm your details.
- Enjoy \ud83c\udf7a and don't forget to deactivate SSH (step 1) if you don't need it.
"},{"location":"#troubleshooting-and-known-issues","title":"Troubleshooting and known issues","text":""},{"location":"#cloudflare-api-free-domains-limitation","title":"CloudFlare API free domains limitation","text":"CloudFlare API doesn't support domains with a .cf, .ga, .gq, .ml, or .tk TLD (top-level domain)
For more details read here: https://github.com/mrikirill/SynologyDDNSCloudflareMultidomain/issues/28 and https://community.cloudflare.com/t/unable-to-update-ddns-using-api-for-some-tlds/167228/61
Response example:
{\n \"result\": null,\n \"success\": false,\n \"errors\": [\n {\n \"code\": 1038,\n \"message\": \"You cannot use this API for domains with a .cf, .ga, .gq, .ml, or .tk TLD (top-level domain). To configure the DNS settings for this domain, use the Cloudflare Dashboard.\"\n }\n ],\n \"messages\": []\n}\n
"},{"location":"#connection-test-failed-or-error-returned","title":"Connection test failed or error returned","text":"This will manifest as either 1020 error; or the update attempt not showing in your Cloudflare Audit logs.
That generally means you may not have entered something correctly in the DDNS screen for your domain(s).
Revisit Before you begin to ensure you have all the right information, then go back to Step 4 in How to install to make sure everything is correctly entered.
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). Updates using the API will appear in the Audit logs as a Rec Set action.
"},{"location":"#cloudflare-no-longer-listed-as-a-ddns-provider-after-dsm-or-srm-updates","title":"Cloudflare no longer listed as a DDNS provider after DSM or SRM updates","text":"If this occurs, simply repeat the How to install steps shown above.
"},{"location":"#default-cloudflare-ports","title":"Default Cloudflare ports","text":"Source Identifying network ports compatible with Cloudflare's proxy
HTTP ports supported by Cloudflare HTTPS ports supported by Cloudflare 80 443 8080 2053 8880 2083 2052 2087 2082 2096 2086 8443 2095"},{"location":"#debug","title":"Debug","text":"You can run this script directly to see output logs
-
SSH into your Synology system
-
Run this command:
./KTSynologyDDNSCloudflareMultidomain.kexe \"\" \"domain1.com|vpn.domain2.com\" \"your-Cloudflare-token\" \"\" \"1.2.3.4 - ipv4 adress\"\n
- Check output logs
"},{"location":"#credits","title":"Credits","text":"MKDoc - generate documentation
"},{"location":"#support-this-project","title":"Support this project","text":"If you find this project helpful, please support it here
"}]}
\ No newline at end of file
+{"config":{"lang":["en"],"separator":"[\\s\\-]+","pipeline":["stopWordFilter"]},"docs":[{"location":"","title":"Home","text":""},{"location":"#synology-dynamic-dns-native-agent-for-cloudflare-multidomains-subdomains","title":"Synology Dynamic DNS Native Agent for Cloudflare (Multidomains & Subdomains)","text":"This project is based on my PHP version of the agent: https://github.com/mrikirill/SynologyDDNSCloudflareMultidomain
Documentation website: https://mrikirill.github.io/KTSynologyDDNSCloudflareMultidomain/
"},{"location":"#why-this-project","title":"Why this project?","text":"The idea of this project is to provide a native agent for Synology DSM and SRM devices \u26a0\ufe0f(read here) to update Cloudflare DNS records without requiring any dependencies.
This project is based on the original PHP version of the agent but is written in Kotlin Native and does not require the JVM. The agent is a standalone executable file that doesn't rely on system dependencies, which is the main difference from the PHP version. Additionally, it includes unit tests covering the main logic of the agent.
"},{"location":"#stack","title":"Stack","text":" - Kotlin Native with target linuxX64 and linuxArm64
- Ktor Client Curl Engine
"},{"location":"#table-of-contents","title":"Table of contents","text":" - What this native agent does
- SRM Support
- Build the agent locally
- Before you start
- How to install
- Troubleshooting and known issues
- CloudFlare API free domains limitation
- Connection test failed or error returned
- Cloudflare no longer listed as a DDNS provider after a DSM update
- Default Cloudflare ports
- Debug script
- Output messages
- Credits
- Support this project
"},{"location":"#what-this-native-agent-does","title":"What this native agent does","text":" - Works as a standalone executable file.
- Functionality remains consistent with the PHP version of the agent.
- Designed for Synology DSM and \u26a0\ufe0fSynology SRM devices to integrate Cloudflare support into
Network Centre > Dynamic DNS (DDNS)
. - Supports single domains, multidomains, subdomains, regional domains, or any combination etc (e.g., dev.my.domain.com.au, domain.com.uk, etc.).
- Simple installation process.
- Based on CloudFlare API v4
- Use ipify.org to detect IPv6
- Compatible with both IPv4 and IPv6 dual stack.
"},{"location":"#srm-support","title":"SRM Support","text":"SRM-based devices use the Linux Arm64 architecture. The agent has a build target for Linux Arm64 and should work on SRM devices. However, it needs to be built locally and tested on SRM devices. Currently, it has not been tested on SRM devices, and there is no established build process for Linux Arm64.
"},{"location":"#build-the-agent-locally","title":"Build the agent locally","text":" -
Kotlin Native Documentation here
-
Clone the repository
-
Run the following command to build the agent
./gradlew build\n
Note: cause the agent includes the Ktor Client Curl Engine it requires extra steps documented here
"},{"location":"#before-you-start","title":"Before you start","text":"Before starting the installation process, make sure you have (and know) the following information, or have completed these steps:
- Cloudflare credentials:
a. Know your Cloudflare account username (or register for an account if you're new to Cloudflare); and
b. Have your API key - no need to use your Global API key! (More info: API keys).
c. Create a API key with following (3) permissions:\n\n **Zone** > **Zone.Settings** > **Read** \n **Zone** > **Zone** > **Read** \n **Zone** > **DNS** > **Edit**\n\n The affected zone ressouces have to be (at least):\n\n**Include** > **All zones from an account** > `<domain>`\n
- DNS settings:
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).
Your DNS records should appear (or already be setup as follows) in Cloudflare:
(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)
- SSH access to your Synology device:
If you haven't setup this access, see the following Synology Knowledge Base article: [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)
"},{"location":"#how-to-install","title":"How to install","text":" - SSH with sudo on your supported device:
a. For DSM Users:
Navigate to Control Panel > Terminal & SNMP > Enable SSH service
b. For SRM users:
Navigate to Control Panel > Services > System Services > Terminal > Enable SSH service
- Connect via SSH: Connect to your supported device via SSH and run this command:
wget https://raw.githubusercontent.com/mrikirill/KTSynologyDDNSCloudflareMultidomain/master/install.sh -O install.sh && sudo bash install.sh
- Update your DDNS settings:
a. For DSM Users: Navigate to Control Panel > External Access > DDNS then add new DDNS
b. For SRM users: Navigate to Network Centre > Internet > QuickConnect & DDNS > DDNS and press the Add button:
Add/Update the DDNS settings screen as follows:
- Service provider: Select Cloudflare
- Hostname: this field is not used anymore, you can put any value here
-
Username: For a single domain: mydomain.com For multiple domains: subdomain.mydomain.com|vpn.mydomain.com (ensure each domain is separated: |
)
Note: there is 256 symbols limit on Hostname input * Password: Your created Cloudflare API Key
Finally, press the test connection button to confirm all information is correctly entered, before pressing Ok to save and confirm your details.
- Enjoy \ud83c\udf7a and don't forget to deactivate SSH (step 1) if you don't need it.
"},{"location":"#troubleshooting-and-known-issues","title":"Troubleshooting and known issues","text":""},{"location":"#cloudflare-api-free-domains-limitation","title":"CloudFlare API free domains limitation","text":"CloudFlare API doesn't support domains with a .cf, .ga, .gq, .ml, or .tk TLD (top-level domain)
For more details read here: https://github.com/mrikirill/SynologyDDNSCloudflareMultidomain/issues/28 and https://community.cloudflare.com/t/unable-to-update-ddns-using-api-for-some-tlds/167228/61
Response example:
{\n \"result\": null,\n \"success\": false,\n \"errors\": [\n {\n \"code\": 1038,\n \"message\": \"You cannot use this API for domains with a .cf, .ga, .gq, .ml, or .tk TLD (top-level domain). To configure the DNS settings for this domain, use the Cloudflare Dashboard.\"\n }\n ],\n \"messages\": []\n}\n
"},{"location":"#connection-test-failed-or-error-returned","title":"Connection test failed or error returned","text":"This will manifest as either 1020 error; or the update attempt not showing in your Cloudflare Audit logs.
That generally means you may not have entered something correctly in the DDNS screen for your domain(s).
Revisit Before you begin to ensure you have all the right information, then go back to Step 4 in How to install to make sure everything is correctly entered.
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). Updates using the API will appear in the Audit logs as a Rec Set action.
"},{"location":"#cloudflare-no-longer-listed-as-a-ddns-provider-after-dsm-or-srm-updates","title":"Cloudflare no longer listed as a DDNS provider after DSM or SRM updates","text":"If this occurs, simply repeat the How to install steps shown above.
"},{"location":"#default-cloudflare-ports","title":"Default Cloudflare ports","text":"Source Identifying network ports compatible with Cloudflare's proxy
HTTP ports supported by Cloudflare HTTPS ports supported by Cloudflare 80 443 8080 2053 8880 2083 2052 2087 2082 2096 2086 8443 2095"},{"location":"#debug","title":"Debug","text":"You can run this script directly to see output logs
-
SSH into your Synology system
-
Run this command:
./KTSynologyDDNSCloudflareMultidomain.kexe \"domain1.com|vpn.domain2.com\" \"your-Cloudflare-token\" \"any\" \"1.2.3.4 - ipv4 address\"\n
- Check output logs
"},{"location":"#output-messages","title":"Output messages","text":"From /etc.defaults/ddns_provider.conf
:
When you write your own module, you can use the following words to tell user what happen by print it. You can use your own message, but there is no multiple-language support.
good
- Update successfully.
nochg
- Update successfully but the IP address have not changed.
nohost
- The hostname specified does not exist in this user account.
abuse
- The hostname specified is blocked for update abuse.
notfqdn
- The hostname specified is not a fully-qualified domain name.
badauth
- Authenticate failed.
911
- There is a problem or scheduled maintenance on provider side
badagent
- The user agent sent bad request(like HTTP method/parameters is not permitted)
badresolv
- Failed to connect to because failed to resolve provider address.
badconn
- Failed to connect to provider because connection timeout.
"},{"location":"#credits","title":"Credits","text":"MKDoc - generate documentation
"},{"location":"#support-this-project","title":"Support this project","text":"If you find this project helpful, please support it here
"}]}
\ No newline at end of file