Compare commits

..

13 Commits

Author SHA1 Message Date
opinux 87c648e7bd docker/powerdns/Dockerfile aktualisiert 2024-09-15 20:26:36 +02:00
opinux 8c086d3194 docker/docker-compose.override.yml aktualisiert 2024-09-15 20:25:42 +02:00
Philipp Böhm 82a5891ba3 add note regarding hosted service at ddns.pboehm.de 2021-11-27 16:47:55 +01:00
陈明 7ed078bb78
support powerdns v4.4 and later (#44) 2021-11-27 16:00:25 +01:00
Philipp Böhm e2b997707b add links for status badges 2021-02-20 19:58:49 +01:00
Philipp Böhm 204fbeba59 add some status badges 2021-02-20 19:50:20 +01:00
Philipp Böhm 8d176ee521 fix docker push with latest tag 2021-02-20 16:46:08 +01:00
Philipp Böhm bc8c5e2810
CircleCi project setup (#32)
Add .circleci/config.yml
2021-02-20 16:42:04 +01:00
Philipp Böhm 016eea259c
Merge pull request #30 from ssiuhk/fix_hostname
Update hostname regex to accept "-"
2021-02-20 13:12:39 +01:00
Sam SIU 3b4513eebd
Update hostname regex to accept "-"
Updated hostname regex to accept "-" according to RFC 1123
2021-02-18 22:54:27 +08:00
Philipp Böhm fdc1312c44
Merge pull request #26 from coldfix/expiration-days
Add DDNS_EXPIRATION_DAYS env variable
2020-10-02 20:14:54 +02:00
Thomas G 3e71d958bc Add DDNS_EXPIRATION_DAYS env variable 2020-10-02 12:10:35 +02:00
Philipp Böhm 3e9c5ef2c5
Merge pull request #22 from pboehm/fix_powerdns_build
Upgrade PowerDNS to 4.3 and use Debian Stretch as base image
2020-04-01 22:28:27 +02:00
8 changed files with 98 additions and 24 deletions

57
.circleci/config.yml Normal file
View File

@ -0,0 +1,57 @@
version: 2.1
orbs:
docker: circleci/docker@1.5.0
jobs:
test:
docker:
- image: circleci/golang:1.16
working_directory: /go/src/github.com/pboehm/ddns
steps:
- checkout
- run: go get -v -t -d ./...
- run: go test -v ./...
docker-build:
executor: docker/docker
steps:
- setup_remote_docker
- checkout
- docker/build:
image: pboehm/ddns
dockerfile: docker/ddns/Dockerfile
docker-build-and-push:
executor: docker/docker
steps:
- setup_remote_docker
- checkout
- docker/check
- docker/build:
image: pboehm/ddns
dockerfile: docker/ddns/Dockerfile
tag: $CIRCLE_SHA1,latest
- docker/push:
image: pboehm/ddns
tag: $CIRCLE_SHA1,latest
workflows:
commit:
jobs:
- test:
filters: # required since `docker-XXXX` have tag filters AND require `test`
tags:
only: /.*/
- docker-build:
requires:
- test
filters:
branches:
ignore: master
- docker-build-and-push:
requires:
- test
filters:
branches:
only: master

View File

@ -1,23 +1,28 @@
# `ddns` - Dynamic DNS
A self-hosted Dynamic DNS solution similar to DynDNS or NO-IP.
[![CircleCI](https://img.shields.io/circleci/build/github/pboehm/ddns?style=flat)](https://circleci.com/github/pboehm/ddns)
[![Docker Image Size (tag)](https://img.shields.io/docker/image-size/pboehm/ddns/latest?logo=Docker)](https://hub.docker.com/r/pboehm/ddns)
[![Docker Pulls](https://img.shields.io/docker/pulls/pboehm/ddns?logo=Docker)](https://hub.docker.com/r/pboehm/ddns)
[![GitHub](https://img.shields.io/github/license/pboehm/ddns?style=flat)](https://github.com/pboehm/ddns)
You can use a hosted version at [ddns.pboehm.de](https://ddns.pboehm.de/) where you can register a
host under the `d.pboehm.de` domain (e.g `test.d.pboehm.de`).
**Recent Changes**
A self-hosted Dynamic DNS solution similar to DynDNS or NO-IP based on the
[PowerDNS Remote Backend](https://doc.powerdns.com/md/authoritative/backend-remote/).
`ddns` has been fully restructured and now uses the PowerDNS
[Remote Backend](https://doc.powerdns.com/md/authoritative/backend-remote/) instead
of the [Pipe Backend](https://doc.powerdns.com/md/authoritative/backend-pipe/), which
is far easier to deploy. It now serves both the frontend and the backend over HTTP using different ports.
<img src="screenshot.png" alt="screenshot" width="500"/>
The old `ddns` source code can be found at the [legacy](https://github.com/pboehm/ddns/tree/legacy) tag.
**Security Notice**
## ⚠️⚠️⚠️ Note regarding hosted version at `ddns.pboehm.de`
Please make sure that you use the latest available version of `ddns`, as it contains an important security
fix for [an issue introduced in the rework](https://github.com/pboehm/ddns/issues/8).
The hosted `ddns` service with custom hosts under the `d.pboehm.de` domain (e.g `test.d.pboehm.de`) is not available
anymore! I did not use this service for quite some time and recently there were some issues which resulted in downtime
and expiration of all registered hosts.
### Alternatives
There is at least one other hosted version of `pboehm/ddns` that
[can be found via Google](https://www.google.com/search?q=pboehm%2Fddns+%22DDNS+is+a+project+that+lets+you+host+a+Dynamic+DNS+Service%2C+similar+to+DynDNS%2FNO-IP%2C+on+your+own+servers.%22)
or you can host it yourself as described below.
## How can I update my IP if it changes?

View File

@ -51,7 +51,13 @@ func (b *Backend) Run() error {
r.GET("/dnsapi/getDomainMetadata/:name/:kind", func(c *gin.Context) {
c.JSON(200, gin.H{
"result": false,
"result": []string{"0"},
})
})
r.GET("/dnsapi/getAllDomainMetadata/:name", func(c *gin.Context) {
c.JSON(200, gin.H{
"result": gin.H{"PRESIGNED": []string{"0"}},
})
})

View File

@ -9,5 +9,10 @@ RUN GO111MODULE=on go get -d -v ./...
RUN GO111MODULE=on go install -v ./...
ENV GIN_MODE release
ENV DDNS_EXPIRATION_DAYS 10
CMD /go/bin/ddns --domain=${DDNS_DOMAIN} --soa_fqdn=${DDNS_SOA_DOMAIN} --redis=${DDNS_REDIS_HOST}
CMD /go/bin/ddns \
--domain=${DDNS_DOMAIN} \
--soa_fqdn=${DDNS_SOA_DOMAIN} \
--redis=${DDNS_REDIS_HOST} \
--expiration-days=${DDNS_EXPIRATION_DAYS}

View File

@ -5,6 +5,7 @@ services:
environment:
DDNS_DOMAIN: d.example.net # <<< ADJUST DOMAIN
DDNS_SOA_DOMAIN: ddns.example.net # <<< ADJUST DOMAIN
DDNS_EXPIRATION_DAYS: 10
powerdns:
ports:

View File

@ -1,12 +1,12 @@
FROM buildpack-deps:stretch-scm
FROM buildpack-deps:bookworm-scm
# the setup procedure according to https://repo.powerdns.com/ (Debian 9 Stretch)
RUN echo "deb [arch=amd64] http://repo.powerdns.com/debian stretch-auth-43 main" > /etc/apt/sources.list.d/pdns.list \
&& echo "Package: pdns-*\nPin: origin repo.powerdns.com\nPin-Priority: 600\n" >> /etc/apt/preferences.d/pdns \
&& curl https://repo.powerdns.com/FD380FBB-pub.asc | apt-key add - \
&& apt-get -y update \
&& apt-get install -y pdns-server pdns-backend-remote \
&& rm -rf /var/lib/apt/lists/*
# the setup procedure according to https://repo.powerdns.com/ (Debian 12 Bookworm)
RUN echo "deb [arch=amd64] http://repo.powerdns.com/debian bookworm-auth-49 main" > /etc/apt/sources.list.d/pdns.list \
&& echo "Package: pdns-*\nPin: origin repo.powerdns.com\nPin-Priority: 600\n" >> /etc/apt/preferences.d/pdns \
&& curl https://repo.powerdns.com/FD380FBB-pub.asc | apt-key add - \
&& apt-get -y update \
&& apt-get install -y pdns-server pdns-backend-remote \
&& rm -rf /var/lib/apt/lists/*
COPY pdns.conf /etc/powerdns/pdns.conf

View File

@ -153,7 +153,7 @@ func buildTemplate() *template.Template {
}
func isValidHostname(host string) (string, bool) {
valid, _ := regexp.Match("^[a-z0-9]{1,32}$", []byte(host))
valid, _ := regexp.Match("^([a-zA-Z0-9]([a-zA-Z0-9\\-]{0,61}[a-zA-Z0-9])?)$", []byte(host))
return host, valid
}

BIN
screenshot.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 125 KiB