Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update to Go 1.15 #8

Merged
merged 3 commits into from
Aug 12, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 16 additions & 5 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,8 +1,19 @@
FROM golang:1.11
FROM golang:1.15-alpine as builder

WORKDIR /go/src/github.com/adrienkohlbecker/traefik-auth-cloudflare
WORKDIR /traefik-auth-cloudflare
COPY . .
# Static build required so that we can safely copy the binary over.
RUN go install github.com/adrienkohlbecker/traefik-auth-cloudflare

ENTRYPOINT ["traefik-auth-cloudflare"]
RUN go build

###

FROM alpine

# Switch to non-root user
RUN adduser -D myapp
USER myapp
WORKDIR /home/myapp

COPY --from=builder --chown=myapp:myapp /traefik-auth-cloudflare/traefik-auth-cloudflare ./

ENTRYPOINT ["./traefik-auth-cloudflare"]
127 changes: 0 additions & 127 deletions Gopkg.lock

This file was deleted.

34 changes: 0 additions & 34 deletions Gopkg.toml

This file was deleted.

4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ Look into the [example](example/) directory to find example `docker-compose.yml`

$ docker network create traefik-auth

# start traefik-auth-cloudflare
# start traefik-auth-cloudflare (default port is 8080)
# you need to set the auth domain you configured on cloudflare

$ docker run -d --network traefik-auth --name traefik-auth-cloudflare akohlbecker/traefik-auth-cloudflare --auth-domain https://foo.cloudflareaccess.com
Expand All @@ -42,7 +42,7 @@ $ docker network connect traefik-auth TRAEFIK_CONTAINER
# the Application Audience (aud) tag needs to be set as an URL parameter: `/auth/{audience}`

$ docker run \
--label "traefik.frontend.auth.forward.address=http://traefik-auth-cloudflare/auth/a83fd537ee93f21e86e51ab3c88f84ef07fd388865c7d0c3236947a8cf79daf5" \
--label "traefik.frontend.auth.forward.address=http://traefik-auth-cloudflare:8080/auth/a83fd537ee93f21e86e51ab3c88f84ef07fd388865c7d0c3236947a8cf79daf5" \
....
```

Expand Down
4 changes: 3 additions & 1 deletion example/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ services:
traefik-auth-cloudflare:
image: akohlbecker/traefik-auth-cloudflare
restart: always
expose:
- 8080
networks:
- traefik-auth
container_name: traefik-auth-cloudflare
Expand All @@ -38,7 +40,7 @@ services:
- "traefik.basic.protocol=http"
# Each request is first forwared to traefik-auth-cloudflare to check the JWT token
# the Application Audience (aud) tag is given as an URL parameter: `/auth/{audience}`
- "traefik.frontend.auth.forward.address=http://traefik-auth-cloudflare/auth/62d4c34bece5735ba2b94a865de5cc6312dc4f6192a946005e2ac59a3f4522d2"
- "traefik.frontend.auth.forward.address=http://traefik-auth-cloudflare:8080/auth/62d4c34bece5735ba2b94a865de5cc6312dc4f6192a946005e2ac59a3f4522d2"
# Optional: Forward the X-Auth-User header to the backend, which is set by traefik-auth-cloudflare to contain the user email
- "traefik.frontend.auth.forward.authResponseHeaders=X-Auth-User"

Expand Down
13 changes: 13 additions & 0 deletions go.mod
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
module github.com/ciffelia/traefik-auth-cloudflare

go 1.15

require (
github.com/coreos/go-oidc v2.2.1+incompatible
github.com/gorilla/handlers v1.5.1
github.com/julienschmidt/httprouter v1.3.0
github.com/pquerna/cachecontrol v0.0.0-20200921180117-858c6e7e6b7e // indirect
github.com/spf13/pflag v1.0.5
golang.org/x/oauth2 v0.0.0-20200902213428-5d25da1a8d43 // indirect
gopkg.in/square/go-jose.v2 v2.5.1 // indirect
)
Loading