-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #16 from nlnwa/log-service
Refactor and utilize forward plugin to enable multiple upstream servers
- Loading branch information
Showing
1,225 changed files
with
3,495 additions
and
504,601 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,21 +1,19 @@ | ||
.:53 { | ||
resolve 8053 | ||
archivingcache { | ||
eviction 1h | ||
maxSizeMb 2048 | ||
contentWriterHost {$CONTENT_WRITER_HOST} | ||
contentWriterPort {$CONTENT_WRITER_PORT} | ||
dbHost {$DB_HOST} | ||
dbPort {$DB_PORT} | ||
dbUser {$DB_USER} | ||
dbPassword {$DB_PASSWORD} | ||
dbName {$DB_NAME} | ||
upstreamDNS {$DNS_SERVER} | ||
.:1053 { | ||
resolve :8443 | ||
prometheus :9153 | ||
debug | ||
errors | ||
log | ||
forward . 8.8.8.8 1.1.1.1 9.9.9.9 { | ||
# except IGNORED_NAMES... | ||
# force_tcp | ||
# prefer_udp | ||
# expire DURATION | ||
# max_fails INTEGER | ||
# tls CERT KEY CA | ||
# tls_servername NAME | ||
# policy random|round_robin|sequential | ||
# health_check DURATION [no_rec] | ||
# max_concurrent MAX | ||
} | ||
# log . { | ||
# class denial error | ||
# } | ||
prometheus 0.0.0.0:9153 | ||
health :8080 | ||
#debug | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
.:53 { | ||
ready :8181 | ||
resolve :8053 | ||
prometheus :9153 | ||
single | ||
archivingcache { | ||
eviction 1h | ||
maxSizeMb 2048 | ||
contentWriterHost {$CONTENT_WRITER_HOST} | ||
contentWriterPort {$CONTENT_WRITER_PORT} | ||
dbHost {$DB_HOST} | ||
dbPort {$DB_PORT} | ||
dbUser {$DB_USER} | ||
dbPassword {$DB_PASSWORD} | ||
dbName {$DB_NAME} | ||
} | ||
forward . {$DNS_SERVER} { | ||
# except IGNORED_NAMES... | ||
# force_tcp | ||
# prefer_udp | ||
# expire DURATION | ||
# max_fails INTEGER | ||
# tls CERT KEY CA | ||
# tls_servername NAME | ||
# policy random|round_robin|sequential | ||
# health_check DURATION [no_rec] | ||
# max_concurrent MAX | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,33 +1,38 @@ | ||
FROM golang:1.11 | ||
FROM golang:1.15 as build | ||
|
||
RUN apt-get update -qqy \ | ||
&& apt-get -qqy install unzip \ | ||
&& rm -rf /var/lib/apt/lists/* /var/cache/apt/* | ||
WORKDIR /build | ||
|
||
COPY plugin /go/src/github.com/nlnwa/veidemann-dns-resolver/plugin | ||
COPY iputil /go/src/github.com/nlnwa/veidemann-dns-resolver/iputil | ||
COPY vendor /go/src/github.com/nlnwa/veidemann-dns-resolver/vendor | ||
COPY main.go /go/src/github.com/nlnwa/veidemann-dns-resolver/main.go | ||
COPY go.mod go.sum ./ | ||
RUN go mod download | ||
|
||
RUN cd /go/src/github.com/nlnwa/veidemann-dns-resolver \ | ||
&& go test -race ./... \ | ||
&& CGO_ENABLED=0 go build -tags netgo -o /coredns | ||
COPY . . | ||
|
||
RUN go test ./... | ||
RUN CGO_ENABLED=0 go build -tags netgo | ||
|
||
FROM alpine:latest | ||
|
||
FROM gcr.io/distroless/base | ||
LABEL maintainer="Norsk nettarkiv" | ||
|
||
EXPOSE 53 53/udp 9153 8053 8080 | ||
# dns port | ||
EXPOSE 53 53/udp | ||
# veidemann.api.dnsresolver.Resolve | ||
EXPOSE 8053 | ||
# prometheus metrics | ||
EXPOSE 9153 | ||
# readiness | ||
EXPOSE 8181 | ||
|
||
ENV DNS_SERVER=8.8.8.8 \ | ||
CONTENT_WRITER_HOST=contentwriter \ | ||
CONTENT_WRITER_HOST=veidemann-contentwriter \ | ||
CONTENT_WRITER_PORT=8080 \ | ||
DB_HOST=localhost \ | ||
DB_PORT=28015 \ | ||
DB_USER=admin \ | ||
DB_PASSWORD=admin \ | ||
DB_NAME=veidemann | ||
|
||
COPY --from=0 /coredns /coredns | ||
COPY Corefile /Corefile | ||
COPY --from=0 /build/veidemann-dns-resolver /veidemann-dns-resolver | ||
COPY Corefile.docker /Corefile | ||
|
||
ENTRYPOINT ["/coredns"] | ||
ENTRYPOINT ["/veidemann-dns-resolver"] |
Oops, something went wrong.