-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathexample_config.toml
198 lines (179 loc) · 9.04 KB
/
example_config.toml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
###########################################
### expemplary rddns configuration file ###
###########################################
# This file contains an exemplary configuration for rddns. Rddns configuration files are TOML files.
##
## ip addresses
##
# Each "ip" configuration entry describes the source for a dynamic IP address. Each entry is a table of the form
# "[ip.<identifier>]" where <identifier> must be replaced with a unique key that is later used to reference this entry.
# There are different types of sources for "ip" entries. The type is configured with the "type" option.
# IP address sources of type "parameter" take the current IP address from parameters passed when triggerering an update.
#
# In server mode these parameters must be passed as HTTP query parameter to the rddns HTTP server. They must be passed
# in the form "ip[<parameter>]=<address>" where <parameter> is the name of the parameter that is configured with the
# "parameter" option and <address> is the current address.
#
# In update mode these parameters musst be passed as command line arguments. They must have the form of
# "--ip <parameter>=<address>" whith <parameter> and <address> having the same semantics as in server mode.
#
# The following example configures an IP address source identified by "some_address" that takes IP addresses from the
# parameter "my_parameter".
# An appropriate HTTP request to the rddns server would be
# http://rddns-server:3092?ip[my_parameter]=203.0.113.19
# In update mode an appropriate command line would be
# rddns -c example_config.toml update --ip my_parameter=203.0.113.19
[ip.some_address]
type = "parameter"
# The for name of the parameter. This is optional. If it is missing the name of the parameter is the same as the
# identifier.
parameter = "my_parameter"
# Allows do transfer Base64 encoded values for parameters. This is false by default if unset.
base64_encoded = false
# Specifies the format of the parameter value. This is "IpAddress" by default meaning that the value is an IPv4 or
# IPv6 address. The other possibility for this configuration is "IpNetwork". In that case the values is expected to be
# an IPv4 or IPv6 network in CIDR notation.
format = "IpAddress"
# IP address sources of type "static" use a fixed IP address that is configured with the option "address".
[ip.otherAddress]
type = "static"
address = "2001:DB8:123:abcd::1"
# IP address sources of type "interface" provide the current IP address of an interface.
#
# Network interfaces usually have more than one IP address these days. With the network parameter it is possible to
# describe the IP address that should be selected. If multiple addresses match an abitrary one is choosen.
#
# E.g.
# "0.0.0.0/0": any IPv4 address
# "::/0" : any IPv6 address
# "2000::/3" : any Internet IPv6 address
[ip.interfaceAddress]
type = "interface"
interface = "eth0"
network = "0.0.0.0/32"
# Defines how the value in "interface" should be used to find the desired interface. "exact" finds the interaface with
# exactly the name specified in "interface". This is the default if match_mode is not specified. "regex" can be used to
# find interfaces that match the regex specified in interface.
match_mode = "exact"
# IP address sources of type "derived" combine the host part and the net part of two other "ip" entries to create a new
# IP address. The "subnet_entry" and the "host_entry" configuration options define which other IP addresses should be
# used for the host and for the net part.
#
# This is useful to update global IPv6 addresses where the host part is fixed as it is derived from the MAC address but
# the provider assigns a different IPv6 subnet on every reconect. The router could then pass its own IPv6 address to the
# HTTP server of rddns. With this entry the net part of the routers IPv6 address can than be combined with the host part
# of a device behind the router.
#
# E.g. given "some_address" would be resolved to fd84:d40e:6a1b:f004:4bcf:78ff:feac:8bd9 then this entry would resolve
# to 2001:DB8:123:abcd:4bcf:78ff:feac:8bd9.
[ip.calculated_address]
type = "derived"
subnet_bits = 64
subnet_entry = "otherAddress"
host_entry = "some_address"
# IP address sources of type "stun" resolves the outbound ip address. It connects to a STUN Server using udp and the STUN
# Server returns it's own ip address.
#
# This is useful if you need the ip address which is behind NAT.
[ip.resolved_address]
type = "stun"
stun_server = "stun.l.google.com:19302"
address_type = "IPV4"
##
## ddns_entry
##
# Each [[ddns_entry]] section configures a Dynamic DNS entry that should be updated. An [[ddns_entry]] is either a HTTP
# request that triggers the update or an file on the filesystem that should be rewritten.
# If type=http a HTTP request is executed to trigger the update. The URL that should be called is configured with the
# "url" option. The URL can contain placeholder in the form of "{<identifier>}" where <identifier> must be the identifier
# of one of the IP addresses sources configured in an "[ip.*]" section. These placeholders will be replaced with the
# current IP addresse of the source on update.
# The following entry is an example how to update an entry at the Hurrican Electric dynamic DNS service.
[[ddns_entry]]
type = "http"
url = "https://dyn.dns.he.net/nic/update?hostname=update.example.com?&myip={some_address}"
# Basic credentials that are passed to the server when updating.
#
# Default if missing: No authentication is done.
username = "update.example.com"
password = "secret"
# When executing updates rddns returns appropriate HTTP error codes or command exit code when updating an entry failed.
# Setting the following to true will ignore failures of this entry when calculating the code to return to the user.
#
# Default if missing: "false"
ignore_error = true
# In case of an HTTPS URL specifies how to validate the TLS certificate presented by the server. If not specified the
# default is "mozilla". Possible values are:
# "mozilla": Uses the Mozilla root certificates for validation. They are embedded in the rddns binary.
# "system": Uses the root certificates of the system that rddns is running on.
# "custom": Use a specified ca certificate for the validation of the server certificate.
# "disable": Trust all server certificates instead of checking its signature.
server_cert_validation = "mozilla"
# When using type "custom" an additional parameter is needed which points to the CA certificate that should be used to
# validate the certificate presented by the server. The certificate must be stored in the PEM format.
# server_cert_validation = { type = "custom", ca = "./some/path/myCa.pem" }
# The following example demonstrates how to define custom HTTP headers, body and method. The URL that is called
# would be resolved to "http://example.com/dynupdate/2001:DB8:123:abcd::1?doUpdate=true" as "otherAddress" is configured
# above to be a static IP address.
[[ddns_entry]]
type = "http"
url = "http://example.com/dynupdate/{otherAddress}?doUpdate=true"
method = "POST"
headers = { Content-Typ = "application/xml", X-My-Header = "ip={some_address}" }
body = """<Update>
<ip name="someIp">{otherAddress}</ip>
</Update>
"""
# The following example shows how to write IP addresses to a file. The file option specifies which file should be written.
# The template defines the content that should be written to that file. Placeholders in the form of "{<identifier>}" are
# replaced with IP addresses as described above.
[[ddns_entry]]
type = "file"
file = "/etc/someSoftware/conf.d/dynamicIP.conf"
replace = """{
"externalIP": "{some_address}",
"otherIP" : "{otherAddress}"
}"""
# The following example shows how to edit a cloudflare record without using the http type. More details what these fields
# are can you find here: https://developers.cloudflare.com/api/operations/dns-records-for-a-zone-update-dns-record
[[ddns_entry]]
type = "cloudflare"
zone_id = ""
record_id = ""
record_ttl = 1 # Auto
record_name = "@"
record_proxied = false
record_comment = ""
record_type = "AAAA"
record_content = "{calculated_address}"
api_token = ""
##
## triggers
##
# Specifies the events that will trigger DDNS update.
#
# Multiple triggers can be specified. Trigger configurations are only considdered when executing rddns in "trigger"
# mode. When running in "update" mode they are ignored.
# Actual updates are only carried out if the calculated URLs for updates differ from the last time an update was
# triggered.
# A trigger that fires automatically in fixed intervals.
[[trigger]]
type = "timed"
# Configures the interval in wich the timed trigger will trigger.
# This value is configured in seconds.
#
# Default if missing: 300
interval = 600
# Triggers DDNS update on HTTP requests to the embedded HTTP server.
[[trigger]]
type = "http"
# Configures username/password credentials that must be passed in HTTP requests to authorize update requests. BASIC auth
# must be used. When invalid credentials are supplied no DDNS updates are triggered.
#
# Default if missing: Anybody can trigger DDNS updates via HTTP without authorization.
username = "admin"
password = "S3cr3T"
# The TCP port the server should listen on.
#
# Default if missing: 3092
port = 3042