IP detection only relies on duckduck.go
This commit is contained in:
@@ -20,11 +20,10 @@ RUN apk add -q --progress --no-cache --update openvpn unbound ca-certificates &&
|
|||||||
apk del -q --progress --purge build-dependencies && \
|
apk del -q --progress --purge build-dependencies && \
|
||||||
rm -rf /*.zip /etc/unbound/unbound.conf /var/cache/apk/*
|
rm -rf /*.zip /etc/unbound/unbound.conf /var/cache/apk/*
|
||||||
COPY unbound.conf /etc/unbound/unbound.conf
|
COPY unbound.conf /etc/unbound/unbound.conf
|
||||||
HEALTHCHECK --interval=10m --timeout=10s --start-period=10s --retries=2 \
|
HEALTHCHECK --interval=10m --timeout=10s --start-period=10s --retries=1 \
|
||||||
CMD VPNCITY=$(wget -qO- -T 2 https://ipinfo.io/city) && \
|
CMD export OLD_VPN_IP="$NEW_VPN_IP" && \
|
||||||
VPNORGANIZATION=$(wget -qO- -T 2 https://ipinfo.io/org) && \
|
export NEW_VPN_IP=$(wget -qqO- 'https://duckduckgo.com/?q=what+is+my+ip' | grep -ow 'Your IP address is [0-9.]*[0-9]' | grep -ow '[0-9][0-9.]*') && \
|
||||||
echo "City: $VPNCITY | Organization: $VPNORGANIZATION" && \
|
[ "$NEW_VPN_IP" != "$INITIAL_IP" ] && [ "$NEW_VPN_IP" != "$OLD_VPN_IP" ] || exit 1
|
||||||
[ "$VPNCITY" != "$CITY" ] && [ "$VPNORGANIZATION" != "$ORGANIZATION" ] || exit 1
|
|
||||||
ENV ENCRYPTION=strong \
|
ENV ENCRYPTION=strong \
|
||||||
PROTOCOL=tcp \
|
PROTOCOL=tcp \
|
||||||
REGION=Germany
|
REGION=Germany
|
||||||
|
|||||||
@@ -1,9 +1,8 @@
|
|||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
|
|
||||||
printf "\nDetecting details from public IP address..."
|
printf "\nGetting public IP address..."
|
||||||
export CITY=$(wget -qO- -T 2 https://ipinfo.io/city)
|
export INITIAL_IP=$(wget -qqO- 'https://duckduckgo.com/?q=what+is+my+ip' | grep -ow 'Your IP address is [0-9.]*[0-9]' | grep -ow '[0-9][0-9.]*')
|
||||||
export ORG=$(wget -qO- -T 2 https://ipinfo.io/org)
|
printf "DONE\nChanging DNS to localhost..."
|
||||||
printf "DONE\nOrganization: $ORG\nCity: $CITY\nChanging DNS to localhost..."
|
|
||||||
echo "nameserver 127.0.0.1" > /etc/resolv.conf
|
echo "nameserver 127.0.0.1" > /etc/resolv.conf
|
||||||
echo "options ndots:0" >> /etc/resolv.conf
|
echo "options ndots:0" >> /etc/resolv.conf
|
||||||
printf "DONE\nStarting Unbound to connect to Cloudflare DNS 1.1.1.1 at its TLS endpoint..."
|
printf "DONE\nStarting Unbound to connect to Cloudflare DNS 1.1.1.1 at its TLS endpoint..."
|
||||||
|
|||||||
Reference in New Issue
Block a user