mirror of
https://github.com/taigrr/godns
synced 2025-01-18 04:03:25 -08:00
Compare commits
14 Commits
Author | SHA1 | Date | |
---|---|---|---|
|
5ad83edfe8 | ||
|
069fd1dcb5 | ||
|
fa03a1b959 | ||
|
17c9b6fa17 | ||
|
6dfbb60dfd | ||
|
07e5d7f99e | ||
|
10c67fa23a | ||
|
afc6ba8241 | ||
|
7ac3eed730 | ||
|
ac7dc021eb | ||
|
2154fcc762 | ||
|
99af25e496 | ||
|
dd4805df92 | ||
|
cdf32c509d |
4
.github/workflows/go.yml
vendored
4
.github/workflows/go.yml
vendored
@ -7,10 +7,10 @@ jobs:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
|
||||
- name: Set up Go 1.13.6
|
||||
- name: Set up Go 1.15.7
|
||||
uses: actions/setup-go@v1
|
||||
with:
|
||||
go-version: 1.13.6
|
||||
go-version: 1.15.7
|
||||
id: go
|
||||
|
||||
- name: Check out code into the Go module directory
|
||||
|
13
Dockerfile
13
Dockerfile
@ -2,13 +2,8 @@ FROM golang:alpine AS builder
|
||||
RUN mkdir /godns
|
||||
ADD . /godns/
|
||||
WORKDIR /godns
|
||||
RUN go build -o godns cmd/godns/godns.go
|
||||
RUN CGO_ENABLED=0 go build -o godns cmd/godns/godns.go
|
||||
|
||||
FROM alpine
|
||||
RUN apk add --no-cache ca-certificates tzdata
|
||||
RUN mkdir /usr/local/godns
|
||||
COPY --from=builder /godns/godns /usr/local/godns
|
||||
RUN chmod +x /usr/local/godns/godns
|
||||
RUN rm -rf /var/cache/apk/*
|
||||
WORKDIR /usr/local/godns
|
||||
ENTRYPOINT ["./godns", "-c", "/usr/local/godns/config.json"]
|
||||
FROM gcr.io/distroless/base
|
||||
COPY --from=builder /godns/godns /godns
|
||||
ENTRYPOINT ["/godns"]
|
6
Makefile
6
Makefile
@ -2,15 +2,15 @@
|
||||
BINARY=godns
|
||||
# Builds the project
|
||||
build:
|
||||
GO111MODULE=on go build cmd/godns/godns.go -o ${BINARY} -ldflags "-X main.Version=${VERSION}"
|
||||
GO111MODULE=on go build -ldflags "-X main.Version=${VERSION}" -o ${BINARY} cmd/godns/godns.go
|
||||
# Installs our project: copies binaries
|
||||
install:
|
||||
GO111MODULE=on go install
|
||||
image:
|
||||
# Build docker image
|
||||
go clean
|
||||
docker buildx build --platform linux/amd64,linux/386,linux/arm64,linux/arm/v7 -t timothyye/godns:${VERSION} . --push
|
||||
docker buildx build --platform linux/amd64,linux/386,linux/arm64,linux/arm/v7 -t timothyye/godns:latest . --push
|
||||
docker buildx build --platform linux/amd64,linux/arm64,linux/arm/v7 -t timothyye/godns:${VERSION} . --push
|
||||
docker buildx build --platform linux/amd64,linux/arm64,linux/arm/v7 -t timothyye/godns:latest . --push
|
||||
release:
|
||||
# Clean
|
||||
go clean
|
||||
|
26
README.md
26
README.md
@ -22,6 +22,8 @@
|
||||
|
||||
[GoDNS](https://github.com/TimothyYe/godns) is a dynamic DNS (DDNS) client tool. It is a rewrite in [Go](https://golang.org) of my early [DynDNS](https://github.com/TimothyYe/DynDNS) open source project.
|
||||
|
||||
Currently supports updating A records for subdomains. Doesn't support updating of root domains.
|
||||
|
||||
---
|
||||
- [Supported DNS Providers](#supported-dns-providers)
|
||||
- [Supported Platforms](#supported-platforms)
|
||||
@ -59,16 +61,16 @@
|
||||
---
|
||||
## Supported DNS Providers
|
||||
|
||||
| Provider | IPv4 support | IPv6 support |
|
||||
| ------------------------------------- | :----------------: | :----------------: |
|
||||
| [Cloudflare][cloudflare] | :white_check_mark: | :white_check_mark: |
|
||||
| [Google Domains][google.domains] | :white_check_mark: | :white_check_mark: |
|
||||
| [DNSPod][dnspod] | :white_check_mark: | :white_check_mark: |
|
||||
| [HE.net (Hurricane Electric)][he.net] | :white_check_mark: | :white_check_mark: |
|
||||
| [AliDNS][alidns] | :white_check_mark: | :x: |
|
||||
| [DuckDNS][duckdns] | :white_check_mark: | :white_check_mark: |
|
||||
| [Dreamhost][dreamhost] | :white_check_mark: | :white_check_mark: |
|
||||
| [No-IP][no-ip] | :white_check_mark: | :white_check_mark: |
|
||||
| Provider | IPv4 support | IPv6 support | Root Domain | Subdomains |
|
||||
| ------------------------------------- | :----------------: | :----------------: | :----------------: | :----------------: |
|
||||
| [Cloudflare][cloudflare] | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: |
|
||||
| [Google Domains][google.domains] | :white_check_mark: | :white_check_mark: | :x: | :white_check_mark: |
|
||||
| [DNSPod][dnspod] | :white_check_mark: | :white_check_mark: | :x: | :white_check_mark: |
|
||||
| [HE.net (Hurricane Electric)][he.net] | :white_check_mark: | :white_check_mark: | :x: | :white_check_mark: |
|
||||
| [AliDNS][alidns] | :white_check_mark: | :x: | :x: | :white_check_mark: |
|
||||
| [DuckDNS][duckdns] | :white_check_mark: | :white_check_mark: | :x: | :white_check_mark: |
|
||||
| [Dreamhost][dreamhost] | :white_check_mark: | :white_check_mark: | :x: | :white_check_mark: |
|
||||
| [No-IP][no-ip] | :white_check_mark: | :white_check_mark: | :x: | :white_check_mark: |
|
||||
|
||||
[cloudflare]: https://cloudflare.com
|
||||
[google.domains]: https://domains.google
|
||||
@ -79,6 +81,8 @@
|
||||
[dreamhost]: https://www.dreamhost.com
|
||||
[no-ip]: https://www.noip.com
|
||||
|
||||
Tip: You can follow this [issue](https://github.com/TimothyYe/godns/issues/76) to view the current status of DDNS for root domains.
|
||||
|
||||
## Supported Platforms
|
||||
|
||||
* Linux
|
||||
@ -582,7 +586,7 @@ With `/path/to/config.json` your local configuration file, run:
|
||||
```bash
|
||||
docker run \
|
||||
-d --name godns --restart=always \
|
||||
-v /path/to/config.json:/usr/local/godns/config.json \
|
||||
-v /path/to/config.json:/config.json \
|
||||
timothyye/godns:latest
|
||||
```
|
||||
|
||||
|
@ -128,6 +128,9 @@ func (handler *Handler) DomainLoop(domain *godns.Domain, panicChan chan<- godns.
|
||||
|
||||
// Check if record is present in domain conf
|
||||
func recordTracked(domain *godns.Domain, record *DNSRecord) bool {
|
||||
if record.Name == domain.DomainName {
|
||||
return true
|
||||
}
|
||||
for _, subDomain := range domain.SubDomains {
|
||||
sd := fmt.Sprintf("%s.%s", subDomain, domain.DomainName)
|
||||
if record.Name == sd {
|
||||
|
Loading…
x
Reference in New Issue
Block a user