Skip to content

Commit 928302a

Browse files
committed
add proxied option for Cloudflare provider
1 parent f2c6906 commit 928302a

File tree

4 files changed

+10
-1
lines changed

4 files changed

+10
-1
lines changed

README.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -198,6 +198,8 @@ By simply putting `@` into `sub_domains`, for example:
198198

199199
For Cloudflare, you need to provide the email & Global API Key as password (or to use the API token) and config all the domains & subdomains.
200200

201+
By setting the option `proxied = true`, the record is receiving the performance and security benefits of Cloudflare. This option is only available for Cloudflare.
202+
201203
<details>
202204
<summary>Using email & Global API Key</summary>
203205

@@ -218,7 +220,8 @@ For Cloudflare, you need to provide the email & Global API Key as password (or t
218220
"ip_url": "https://api.ip.sb/ip",
219221
"ip_type": "IPv4",
220222
"interval": 300,
221-
"socks5_proxy": ""
223+
"socks5_proxy": "",
224+
"proxied": false
222225
}
223226
```
224227
</details>

configs/config_sample.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@
2828
"socks5_proxy": "",
2929
"use_proxy": false,
3030
"debug_info": false,
31+
"proxied": false,
3132
"notify": {
3233
"telegram": {
3334
"enabled": false,

internal/provider/cloudflare/cloudflare_handler.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -233,6 +233,10 @@ func (provider *DNSProvider) createRecord(zoneID, domain, subDomain, ip string)
233233
TTL: 1,
234234
}
235235

236+
if provider.configuration.Proxied {
237+
newRecord.Proxied = true
238+
}
239+
236240
if subDomain == utils.RootDomain {
237241
newRecord.Name = utils.RootDomain
238242
} else {

internal/settings/settings.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,7 @@ type Settings struct {
114114
UseProxy bool `json:"use_proxy" yaml:"use_proxy"`
115115
DebugInfo bool `json:"debug_info" yaml:"debug_info"`
116116
RunOnce bool `json:"run_once" yaml:"run_once"`
117+
Proxied bool `json:"proxied" yaml:"proxied"`
117118
}
118119

119120
// LoadSettings -- Load settings from config file.

0 commit comments

Comments
 (0)