mirror of
https://codeberg.org/privacy1st/netcup-dns
synced 2024-12-22 23:36:04 +01:00
feat: add IPv6 endpoint
This commit is contained in:
parent
0485c33ec1
commit
3ce2caede5
@ -5,7 +5,7 @@
|
|||||||
|
|
||||||
_name=netcup-dns
|
_name=netcup-dns
|
||||||
pkgname="python-$_name-git"
|
pkgname="python-$_name-git"
|
||||||
pkgver=r16.4b5193e
|
pkgver=r18.0485c33
|
||||||
pkgrel=1
|
pkgrel=1
|
||||||
pkgdesc='update DNS records with your current external IP address using the netcup DNS API'
|
pkgdesc='update DNS records with your current external IP address using the netcup DNS API'
|
||||||
arch=(any)
|
arch=(any)
|
||||||
|
@ -104,7 +104,11 @@ def ipv4_endpoints() -> list[str]:
|
|||||||
:return: List of services that return your external IPv4 address.
|
:return: List of services that return your external IPv4 address.
|
||||||
"""
|
"""
|
||||||
# IPv4 only.
|
# IPv4 only.
|
||||||
endpoints = ['https://checkipv4.dedyn.io', 'https://api.ipify.org', 'https://v4.ident.me/']
|
endpoints = [
|
||||||
|
'https://checkipv4.dedyn.io',
|
||||||
|
'https://api.ipify.org',
|
||||||
|
'https://v4.ident.me/',
|
||||||
|
]
|
||||||
# Not sure if they return IPv4 addresses only.
|
# Not sure if they return IPv4 addresses only.
|
||||||
endpoints += ['https://ipinfo.io/ip', 'https://ifconfig.me/ip']
|
endpoints += ['https://ipinfo.io/ip', 'https://ifconfig.me/ip']
|
||||||
return endpoints
|
return endpoints
|
||||||
@ -115,11 +119,24 @@ def ipv6_endpoints() -> list[str]:
|
|||||||
:return: List of services that return your external IPv6 address.
|
:return: List of services that return your external IPv6 address.
|
||||||
"""
|
"""
|
||||||
# IPv6 only.
|
# IPv6 only.
|
||||||
endpoints = ['https://checkipv6.dedyn.io', 'https://api6.ipify.org', 'https://v6.ident.me/']
|
endpoints = [
|
||||||
|
'https://checkipv6.dedyn.io',
|
||||||
|
'https://api6.ipify.org',
|
||||||
|
'https://v6.ident.me/',
|
||||||
|
'https://ipv6.icanhazip.com',
|
||||||
|
]
|
||||||
# Returns either IPv4 or IPv6.
|
# Returns either IPv4 or IPv6.
|
||||||
endpoints += []
|
endpoints += ['https://ifconfig.co/ip']
|
||||||
# Not sure if they return IPv6.
|
# Not sure if they return IPv6.
|
||||||
endpoints += ['https://ipinfo.io/ip']
|
endpoints += ['https://ipinfo.io/ip']
|
||||||
|
|
||||||
|
# https://ifconfig.co
|
||||||
|
# - if it detects `curl`, only the IP is returned
|
||||||
|
# - but on a normal request, a HTML website is given
|
||||||
|
# https://ifconfig.co/ip
|
||||||
|
# - returns only the ip
|
||||||
|
# - `curl -4/-6 https://ifconfig.co/ip` -> returns IPv4/IPv6
|
||||||
|
|
||||||
return endpoints
|
return endpoints
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user