diff --git a/.github/workflows/tag.yaml b/.github/workflows/tag.yaml index a4388a6..f08827e 100644 --- a/.github/workflows/tag.yaml +++ b/.github/workflows/tag.yaml @@ -22,8 +22,6 @@ jobs: files: | go.* main.go - *goreleaser* - *Dockerfile - name: Bump version and push tag if: steps.changed_files.outputs.any_changed == 'true' diff --git a/README.md b/README.md index fe3c12c..48c6b8d 100644 --- a/README.md +++ b/README.md @@ -25,7 +25,7 @@ the required values. Now you can run the cfaccess-proxy container with the follo ``` cp .env.template .env -docker run --rm -d --env-file $(pwd)/.env --name cfaccess-proxy -p 3001:3001 j0sh3rs/cfaccess-proxy +docker run --rm -d --env-file $(pwd)/.env --name cfaccess-proxy -p 3001:3001 ghcr.io/j0sh3rs/cfaccess-proxy ``` This will start the proxy on the specified address and it will start to listen for incoming requests. diff --git a/deploy/kubernetes/deployment.yml b/deploy/kubernetes/deployment.yml index 1ded02f..8061cf4 100644 --- a/deploy/kubernetes/deployment.yml +++ b/deploy/kubernetes/deployment.yml @@ -18,10 +18,10 @@ spec: app: cfaccess-proxy spec: containers: - - image: j0sh3rs/cfaccess-proxy + - image: ghcr.io/j0sh3rs/cfaccess-proxy name: cfaccess-proxy ports: - - containerPort: 3001 + - containerPort: 80 env: - name: AUTHDOMAIN value: https://.cloudflareaccess.com @@ -32,9 +32,9 @@ spec: - name: FORWARDEMAILHEADER value: X-WEBAUTH-EMAIL - name: FORWARDHOST - value: :3000 + value: : - name: ADDR - value: :3001 + value: :80 restartPolicy: Always --- apiVersion: v1 @@ -46,8 +46,8 @@ metadata: namespace: monitoring spec: ports: - - name: "3001" - port: 3001 - targetPort: 3001 + - name: http + port: 80 + targetPort: 80 selector: app: cfaccess-proxy diff --git a/go.mod b/go.mod index 8ec0f66..3f35198 100644 --- a/go.mod +++ b/go.mod @@ -13,7 +13,7 @@ require ( github.com/golang/protobuf v1.5.2 // indirect github.com/stretchr/testify v1.6.1 // indirect golang.org/x/crypto v0.0.0-20220622213112-05595931fe9d // indirect - golang.org/x/net v0.0.0-20220630215102-69896b714898 // indirect + golang.org/x/net v0.0.0-20220708220712-1185a9018129 // indirect golang.org/x/oauth2 v0.0.0-20220630143837-2104d58473e0 // indirect google.golang.org/appengine v1.6.7 // indirect google.golang.org/protobuf v1.28.0 // indirect diff --git a/go.sum b/go.sum index 6dba6f2..2b34bb5 100644 --- a/go.sum +++ b/go.sum @@ -29,6 +29,8 @@ golang.org/x/net v0.0.0-20190603091049-60506f45cf65/go.mod h1:HSz+uSET+XFnRR8LxR golang.org/x/net v0.0.0-20200505041828-1ed23360d12c/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= golang.org/x/net v0.0.0-20220630215102-69896b714898 h1:K7wO6V1IrczY9QOQ2WkVpw4JQSwCd52UsxVEirZUfiw= golang.org/x/net v0.0.0-20220630215102-69896b714898/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= +golang.org/x/net v0.0.0-20220708220712-1185a9018129 h1:vucSRfWwTsoXro7P+3Cjlr6flUMtzCwzlvkxEQtHHB0= +golang.org/x/net v0.0.0-20220708220712-1185a9018129/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= golang.org/x/oauth2 v0.0.0-20200107190931-bf48bf16ab8d/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/oauth2 v0.0.0-20220630143837-2104d58473e0 h1:VnGaRqoLmqZH/3TMLJwYCEWkR4j1nuIU1U9TvbqsDUw= golang.org/x/oauth2 v0.0.0-20220630143837-2104d58473e0/go.mod h1:h4gKUeWbJ4rQPri7E0u6Gs4e9Ri2zaLxzw5DI5XGrYg= diff --git a/main.go b/main.go index f1aef71..ba5dedb 100644 --- a/main.go +++ b/main.go @@ -1,5 +1,3 @@ -// Copyright 2020 Jorge Luis Betancourt -// // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at @@ -87,7 +85,7 @@ func VerifyToken(next http.Handler, tokenVerifier *oidc.IDTokenVerifier, cfg *Co r.Header.Add(cfg.ForwardEmailHeader, claims.Email) r.Header.Add(cfg.ForwardUserHeader, u) log.Printf("Authenticated as: %s", claims.Email) - log.Printf("Username extracted as: %s", u) + // log.Printf("Username extracted as: %s", u) next.ServeHTTP(w, r) } @@ -114,7 +112,7 @@ func main() { director := func(req *http.Request) { req.Header.Add("X-Forwarded-Host", req.Host) - req.Header.Add("X-Origin-Host", "cloudflare-access-proxy") + req.Header.Add("X-Origin-Host", "cfaccess-proxy") // TODO: should we trust on the Schema of the original request? req.URL.Scheme = "http" diff --git a/renovate.json b/renovate.json index 826315b..355c79a 100644 --- a/renovate.json +++ b/renovate.json @@ -4,11 +4,13 @@ ":enableRenovate", "config:base", ":disableRateLimiting", - ":dependencyDashboard", ":separatePatchReleases", "docker:enableMajor", ":enablePreCommit", - "github>j0sh3rs/cfaccess-proxy//.github/renovate/autoMerge", + ":rebaseStalePrs", + ":automergeMinor", + ":gomod", + ":docker", "github>j0sh3rs/cfaccess-proxy//.github/renovate/labels" ], "platform": "github",