@@ -1884,6 +1884,141 @@ Will be rendered as follows::
18841884 option sysfs ' tp-link:blue:wlan2g'
18851885 option trigger ' phy0tpt'
18861886
1887+ DDNS settings
1888+ ------------ -
1889+
1890+ The ddns settings reside in the `` ddns`` key of the * configuration dictionary* ,
1891+ which is a custom NetJSON extension not present in the original NetJSON RFC .
1892+
1893+ The `` ddns`` key must contain a dictionary, the allowed keys are:
1894+
1895+ + -------------------- -+ -------- -+
1896+ | key name | type |
1897+ + ==================== =+ ======== =+
1898+ | `` upd_privateip`` | boolean |
1899+ + -------------------- -+ -------- -+
1900+ | `` ddns_dateformat`` | string |
1901+ + -------------------- -+ -------- -+
1902+ | `` ddns_rundir`` | string |
1903+ + -------------------- -+ -------- -+
1904+ | `` ddns_logdir`` | string |
1905+ + -------------------- -+ -------- -+
1906+ | `` ddns_loglines`` | integer |
1907+ + -------------------- -+ -------- -+
1908+ | `` use_curl`` | boolean |
1909+ + -------------------- -+ -------- -+
1910+ | `` providers`` | list |
1911+ + -------------------- -+ -------- -+
1912+
1913+ The `` providers`` key itself contains a list of dictionaries, the allowed keys are:
1914+
1915+ + -------------------- -+ -------- -+
1916+ | key name | type |
1917+ + ==================== =+ ======== =+
1918+ | `` enabled`` | boolean |
1919+ + -------------------- -+ -------- -+
1920+ | `` interface`` | string |
1921+ + -------------------- -+ -------- -+
1922+ | `` ip_source`` | string |
1923+ + -------------------- -+ -------- -+
1924+ | `` lookup_host`` | string |
1925+ + -------------------- -+ -------- -+
1926+ | `` domain`` | string |
1927+ + -------------------- -+ -------- -+
1928+ | `` username`` | string |
1929+ + -------------------- -+ -------- -+
1930+ | `` password`` | string |
1931+ + -------------------- -+ -------- -+
1932+ | `` service_name`` | string |
1933+ + -------------------- -+ -------- -+
1934+ | `` update_url`` | string |
1935+ + -------------------- -+ -------- -+
1936+ | `` update_script`` | string |
1937+ + -------------------- -+ -------- -+
1938+ | `` ip_network`` | string |
1939+ + -------------------- -+ -------- -+
1940+ | `` ip_url`` | string |
1941+ + -------------------- -+ -------- -+
1942+ | `` ip_interface`` | string |
1943+ + -------------------- -+ -------- -+
1944+ | `` ip_script`` | string |
1945+ + -------------------- -+ -------- -+
1946+ | `` use_syslog`` | integer |
1947+ + -------------------- -+ -------- -+
1948+ | `` use_logfile`` | boolean |
1949+ + -------------------- -+ -------- -+
1950+
1951+ The required keys are:
1952+
1953+ * `` enabled``
1954+ * `` interface``
1955+ * `` ip_source``
1956+ * `` lookup_host``
1957+ * `` domain``
1958+ * `` username``
1959+ * `` password``
1960+
1961+ For the function and meaning of each key consult the relevant
1962+ `OpenWrt documentation about ddns directives < https:// openwrt.org/ docs/ guide- user/ base- system/ ddns> ` _.
1963+
1964+ DDNS settings example
1965+ ~~~~~~~~~~~~~~~~~~~~~
1966+
1967+ The following * configuration dictionary* :
1968+
1969+ .. code- block:: python
1970+
1971+ {
1972+ " ddns" : {
1973+ " ddns_logdir" : " /var/log/ddns" ,
1974+ " ddns_rundir" : " /var/run/ddns" ,
1975+ " use_curl" : false,
1976+ " upd_privateip" : false,
1977+ " ddns_dateformat" : " %F %R" ,
1978+ " ddns_loglines" : 250 ,
1979+ " providers" : [
1980+ {
1981+ " enabled" : true,
1982+ " lookup_host" : " myhost.dyndns.org" ,
1983+ " service_name" : " dyndns.org" ,
1984+ " domain" : " myhost.dyndns.org" ,
1985+ " username" : " myuser" ,
1986+ " password" : " mypassword" ,
1987+ " use_logfile" : true,
1988+ " ip_source" : " interface" ,
1989+ " ip_interface" : " pppoe-xdsl" ,
1990+ " use_syslog" : 2 ,
1991+ " interface" : " xdsl"
1992+ }
1993+ ],
1994+ }
1995+ }
1996+
1997+ Will be rendered as follows::
1998+
1999+ package ddns
2000+
2001+ config ddns ' global'
2002+ option ddns_logdir ' /var/log/ddns'
2003+ option ddns_rundir ' /var/run/ddns'
2004+ option use_curl ' 0'
2005+ option upd_privateip ' 0'
2006+ option ddns_dateformat ' %F %R'
2007+ option ddns_loglines ' 250'
2008+
2009+ config service ' myhost_dyndns_org'
2010+ option enabled ' 1'
2011+ option lookup_host ' myhost.dyndns.org'
2012+ option service_name ' dyndns.org'
2013+ option domain ' myhost.dyndns.org'
2014+ option username ' myuser'
2015+ option password ' mypassword'
2016+ option use_logfile ' 1'
2017+ option ip_source ' interface'
2018+ option ip_interface ' pppoe-xdsl'
2019+ option use_syslog ' 2'
2020+ option interface ' xdsl'
2021+
18872022Including custom options
18882023------------------------
18892024
0 commit comments