Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
<help>DynDNS Server hostname or uri to use (depending on the protocol).
When a URI is provided, the tag __MYIP__ will be replaced with the current detected address for this service
and __HOSTNAME__ will contain the (comma separated) list of hostnames provided.
If the current address is an IPv6 the tag __IPV6PREFIX__ will be replaced with the /64 prefix of the current address.
</help>
<style>optional_setting service_custom</style>
</field>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
POSSIBILITY OF SUCH DAMAGE.
"""
import ipaddress
import syslog
import requests
from requests.auth import HTTPBasicAuth
Expand Down Expand Up @@ -71,6 +72,8 @@ def execute(self):
url = self.settings.get('server')
url = url.replace('__MYIP__', self.current_address)
url = url.replace('__HOSTNAME__', self.settings.get('hostnames'))
if self.current_address.find(':') > 0:
url = url.replace('__IPV6PREFIX__', str(ipaddress.ip_network("%s/64" % self.current_address, strict=False)))
req = requests.request(
method=protocol,
url=url,
Expand Down