This commit is contained in:
billy harvey
2025-01-01 00:06:47 +00:00
commit 484426a1cd
7 changed files with 38 additions and 0 deletions
+4
View File
@@ -0,0 +1,4 @@
FROM golang:latest
WORKDIR /root
ADD ddns.bash .
CMD [ "/root/ddns.bash" ]
View File
+2
View File
@@ -0,0 +1,2 @@
PROJECT=apps
SERVICE=ddns
Executable
+2
View File
@@ -0,0 +1,2 @@
docker pull golang:latest
docker build -t primal/ddns .
+12
View File
@@ -0,0 +1,12 @@
networks:
ddns:
services:
ddns:
build: .
env_file:
- env
hostname: apps_ddns
image: ${IMAGE}:${VERSION}
networks:
- ddns
Executable
+16
View File
@@ -0,0 +1,16 @@
#!/bin/bash
DOMN=primal.host
PASS=35f5fa4e1fc04d539260a4afaeb42371 \
IP0=''
while true ; do
IP1=$(curl --no-progress-meter 'https://api.ipify.org?format=text')
if [[ "${IP1}" != "${IP0}" && "${IP1}" != '' ]] ; then
OP0=$(curl --no-progress-meter -X GET -d 'host=@' -d "domain=${DOMN}" -d "password=${PASS}" -d "ip=${IP1}" -G 'https://dynamicdns.park-your-domain.com/update')
OP1=$(curl --no-progress-meter -X GET -d 'host=*' -d "domain=${DOMN}" -d "password=${PASS}" -d "ip=${IP1}" -G 'https://dynamicdns.park-your-domain.com/update')
echo $(date) ${IP0} ${IP1}
IP0=${IP1}
else
echo $(date) ${IP0} ${IP1} .
fi
sleep 3661
done
+2
View File
@@ -0,0 +1,2 @@
VERSION=v1.0.0
IMAGE=gitea.primal.host/wehrv/ddns