From c49f109c015d3244171cf5347c3e2efc0fdc0e1c Mon Sep 17 00:00:00 2001 From: Adam Veldhousen Date: Fri, 12 Jun 2020 21:48:55 -0500 Subject: [PATCH] add flags for bind addresses --- Dockerfile | 5 ++++- blocklists.go | 8 +++++--- deployment/deployment.yml | 3 +++ 3 files changed, 12 insertions(+), 4 deletions(-) diff --git a/Dockerfile b/Dockerfile index 2eeecb4..c5363ad 100644 --- a/Dockerfile +++ b/Dockerfile @@ -14,8 +14,11 @@ COPY ./config.json /opt/gopherhole/config.json ENV GOPHERHOLE_BIND_ADDRESS 127.0.0.1 +RUN apt-get update && apt-get install -y ca-certificates && apt-get clean + WORKDIR /opt/gopherhole EXPOSE 53/udp 53/tcp 80/tcp -ENTRYPOINT /opt/gopherhole/gopherhole \ No newline at end of file +ENTRYPOINT ["/opt/gopherhole/gopherhole"] +CMD ["-bind-http=0.0.0.0", "-bind-dns=0.0.0.0"] \ No newline at end of file diff --git a/blocklists.go b/blocklists.go index 87828fb..4d3bbfa 100644 --- a/blocklists.go +++ b/blocklists.go @@ -22,9 +22,11 @@ type BlocklistManager interface { func NewDomainBlacklist(blocklistURLs []string) (BlocklistManager, error) { l := log.New(os.Stdout, "[Blocklist Manager] ", log.LUTC|log.Lshortfile) bm := &memoryBlocklistManager{blocklistURLs: blocklistURLs, Logger: l} - if err := bm.Reload(context.Background()); err != nil { - return nil, err - } + go bm.Reload(context.Background()) + + // if err := bm.Reload(context.Background()); err != nil { + // return nil, err + // } return bm, nil } diff --git a/deployment/deployment.yml b/deployment/deployment.yml index a3a2135..9788756 100644 --- a/deployment/deployment.yml +++ b/deployment/deployment.yml @@ -28,6 +28,9 @@ spec: value: 0.0.0.0 stdin: true tty: true + args: + - -bind-dns=0.0.0.0 + - -bind-http=0.0.0.0 resources: limits: cpu: "512m"