Skip to content

Commit

Permalink
Add documentation for ddns settings
Browse files Browse the repository at this point in the history
  • Loading branch information
okraits committed Jul 12, 2018
1 parent 31fbb31 commit 4093bea
Showing 1 changed file with 157 additions and 2 deletions.
159 changes: 157 additions & 2 deletions docs/source/backends/openwrt.rst
Original file line number Diff line number Diff line change
Expand Up @@ -376,7 +376,12 @@ Will be rendered as follows::

package network

config interface 'eth0' option ifname 'eth0' option ip6addr 'fdb4:5f35:e8fd::1/48' option ipaddr '10.27.251.1' option netmask '255.255.255.0' option proto 'static'
config interface 'eth0'
option ifname 'eth0'
option ip6addr 'fdb4:5f35:e8fd::1/48'
option ipaddr '10.27.251.1'
option netmask '255.255.255.0'
option proto 'static'

DNS servers and search domains
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Expand Down Expand Up @@ -431,7 +436,22 @@ Will return the following UCI output::

package network

config interface 'eth0' option dns '10.11.12.13 8.8.8.8' option dns_search 'openwisp.org netjson.org' option ifname 'eth0' option ipaddr '192.168.1.1' option netmask '255.255.255.0' option proto 'static' config interface 'eth1' option dns_search 'openwisp.org netjson.org' option ifname 'eth1' option proto 'dhcp' config interface 'eth1_31' option ifname 'eth1.31' option proto 'none'
config interface 'eth0'
option dns '10.11.12.13 8.8.8.8'
option dns_search 'openwisp.org netjson.org'
option ifname 'eth0'
option ipaddr '192.168.1.1'
option netmask '255.255.255.0'
option proto 'static'

config interface 'eth1'
option dns_search 'openwisp.org netjson.org'
option ifname 'eth1'
option proto 'dhcp'

config interface 'eth1_31'
option ifname 'eth1.31'
option proto 'none'

DHCP ipv6 ethernet interface
~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Expand Down Expand Up @@ -1815,6 +1835,141 @@ Will be rendered as follows::
option sysfs 'tp-link:blue:wlan2g'
option trigger 'phy0tpt'
DDNS settings
-------------
The ddns settings reside in the ``ddns`` key of the *configuration dictionary*,
which is a custom NetJSON extension not present in the original NetJSON RFC.
The ``ddns`` key must contain a dictionary, the allowed keys are:
+---------------------+---------+
| key name | type |
+=====================+=========+
| ``upd_privateip`` | boolean |
+---------------------+---------+
| ``ddns_dateformat`` | string |
+---------------------+---------+
| ``ddns_rundir`` | string |
+---------------------+---------+
| ``ddns_logdir`` | string |
+---------------------+---------+
| ``ddns_loglines`` | integer |
+---------------------+---------+
| ``use_curl`` | boolean |
+---------------------+---------+
| ``providers`` | list |
+---------------------+---------+
The ``providers`` key itself contains a list of dictionaries, the allowed keys are:
+---------------------+---------+
| key name | type |
+=====================+=========+
| ``enabled`` | boolean |
+---------------------+---------+
| ``interface`` | string |
+---------------------+---------+
| ``ip_source`` | string |
+---------------------+---------+
| ``lookup_host`` | string |
+---------------------+---------+
| ``domain`` | string |
+---------------------+---------+
| ``username`` | string |
+---------------------+---------+
| ``password`` | string |
+---------------------+---------+
| ``service_name`` | string |
+---------------------+---------+
| ``update_url`` | string |
+---------------------+---------+
| ``update_script`` | string |
+---------------------+---------+
| ``ip_network`` | string |
+---------------------+---------+
| ``ip_url`` | string |
+---------------------+---------+
| ``ip_interface`` | string |
+---------------------+---------+
| ``ip_script`` | string |
+---------------------+---------+
| ``use_syslog`` | integer |
+---------------------+---------+
| ``use_logfile`` | boolean |
+---------------------+---------+
The required keys are:
* ``enabled``
* ``interface``
* ``ip_source``
* ``lookup_host``
* ``domain``
* ``username``
* ``password``
For the function and meaning of each key consult the relevant
`OpenWrt documentation about ddns directives <https://openwrt.org/docs/guide-user/base-system/ddns>`_.
DDNS settings example
~~~~~~~~~~~~~~~~~~~~~
The following *configuration dictionary*:
.. code-block:: python
{
"ddns": {
"ddns_logdir": "/var/log/ddns",
"ddns_rundir": "/var/run/ddns",
"use_curl": false,
"upd_privateip": false,
"ddns_dateformat": "%F %R",
"ddns_loglines": 250,
"providers": [
{
"enabled": true,
"lookup_host": "myhost.dyndns.org",
"service_name": "dyndns.org",
"domain": "myhost.dyndns.org",
"username": "myuser",
"password": "mypassword",
"use_logfile": true,
"ip_source": "interface",
"ip_interface": "pppoe-xdsl",
"use_syslog": 2,
"interface": "xdsl"
}
],
}
}
Will be rendered as follows::
package ddns
config ddns 'global'
option ddns_logdir '/var/log/ddns'
option ddns_rundir '/var/run/ddns'
option use_curl '0'
option upd_privateip '0'
option ddns_dateformat '%F %R'
option ddns_loglines '250'
config service 'myhost_dyndns_org'
option enabled '1'
option lookup_host 'myhost.dyndns.org'
option service_name 'dyndns.org'
option domain 'myhost.dyndns.org'
option username 'myuser'
option password 'mypassword'
option use_logfile '1'
option ip_source 'interface'
option ip_interface 'pppoe-xdsl'
option use_syslog '2'
option interface 'xdsl'
Including custom options
------------------------
Expand Down

0 comments on commit 4093bea

Please sign in to comment.