Skip to content

Commit

Permalink
Update dependencies and GitHub actions
Browse files Browse the repository at this point in the history
  • Loading branch information
lachlan-smith committed Dec 7, 2023
1 parent c4317b7 commit 81da891
Show file tree
Hide file tree
Showing 1,256 changed files with 448,329 additions and 770 deletions.
2 changes: 1 addition & 1 deletion .dockerignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
example
.travis.yml
.git
.github
2 changes: 0 additions & 2 deletions .github/FUNDING.yml

This file was deleted.

32 changes: 8 additions & 24 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,35 +2,19 @@ name: CI

on:
push:
branches: [ master ]
pull_request:
branches: [ master ]

jobs:

test:
name: Test
ci:
runs-on: ubuntu-latest
steps:

- name: Set up Go 1.x
uses: actions/setup-go@v2
- name: Checkout
uses: actions/checkout@v4
- name: Setup Go
uses: actions/setup-go@v4
with:
go-version: ^1.13

- name: Check out code into the Go module directory
uses: actions/checkout@v2

- name: Get dependencies
run: |
go get -v -t -d ./...
if [ -f Gopkg.toml ]; then
curl https://raw.githubusercontent.com/golang/dep/master/install.sh | sh
dep ensure
fi
- name: Build
run: go build -v ./...

go-version: '1.21.5'
- name: Vet
run: go vet -v ./...
- name: Test
run: go test -v ./...
71 changes: 0 additions & 71 deletions .github/workflows/codeql-analysis.yml

This file was deleted.

81 changes: 33 additions & 48 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,54 +4,39 @@ on:
release:
types: [published]

jobs:
env:
REGISTRY: ghcr.io
IMAGE_NAME: ${{ github.repository }}

build:
name: Build release binaries
jobs:
release:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
steps:
- name: Check out code into the Go module directory
uses: actions/checkout@v2

- name: Set up Go 1.x
uses: actions/setup-go@v2
with:
go-version: ^1.13
id: go

- name: Build AMD64
run: CGO_ENABLED=0 GOOS=linux GOARCH=amd64 GO111MODULE=on go build -a -installsuffix nocgo -v -o traefik-forward-auth_amd64 ./cmd

- name: Build ARM
run: CGO_ENABLED=0 GOOS=linux GOARCH=arm GO111MODULE=on go build -a -installsuffix nocgo -v -o traefik-forward-auth_arm ./cmd

- name: Get tag name
run: echo "TAG=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV

- name: Get artifact details
uses: octokit/[email protected]
id: get_release_details
with:
route: get /repos/${{ github.repository }}/releases/tags/${{ env.TAG }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Upload AMD64 release asset
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ fromJson(steps.get_release_details.outputs.data).upload_url }}
asset_path: traefik-forward-auth_amd64
asset_name: traefik-forward-auth_amd64
asset_content_type: application/octet-stream

- name: Upload ARM release asset
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ fromJson(steps.get_release_details.outputs.data).upload_url }}
asset_path: traefik-forward-auth_arm
asset_name: traefik-forward-auth_arm
asset_content_type: application/octet-stream
- name: Checkout
uses: actions/checkout@v4
- name: Setup QEMU
uses: docker/setup-qemu-action@v3
- name: Setup Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Log in to the Container registry
uses: docker/login-action@v3
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@v5
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
- name: Build and Push Image
uses: docker/build-push-action@v5
with:
context: .
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
platforms: linux/amd64,linux/arm64
17 changes: 4 additions & 13 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,17 +1,8 @@
FROM golang:1.13-alpine as builder
FROM golang:1.21.5-alpine as builder
WORKDIR /build
COPY . .
RUN CGO_ENABLED=0 GOOS=linux go build -o traefik-forward-auth ./cmd

# Setup
RUN mkdir -p /go/src/github.com/thomseddon/traefik-forward-auth
WORKDIR /go/src/github.com/thomseddon/traefik-forward-auth

# Add libraries
RUN apk add --no-cache git

# Copy & build
ADD . /go/src/github.com/thomseddon/traefik-forward-auth/
RUN CGO_ENABLED=0 GOOS=linux GOARCH=amd64 GO111MODULE=on go build -a -installsuffix nocgo -o /traefik-forward-auth github.com/thomseddon/traefik-forward-auth/cmd

# Copy into scratch container
FROM scratch
COPY --from=builder /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/
COPY --from=builder /traefik-forward-auth ./
Expand Down
18 changes: 0 additions & 18 deletions Dockerfile.arm

This file was deleted.

18 changes: 0 additions & 18 deletions Dockerfile.arm64

This file was deleted.

8 changes: 0 additions & 8 deletions Makefile

This file was deleted.

26 changes: 13 additions & 13 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@

# Traefik Forward Auth ![Build Status](https://img.shields.io/github/workflow/status/thomseddon/traefik-forward-auth/CI) [![Go Report Card](https://goreportcard.com/badge/github.com/thomseddon/traefik-forward-auth)](https://goreportcard.com/report/github.com/thomseddon/traefik-forward-auth) ![Docker Pulls](https://img.shields.io/docker/pulls/thomseddon/traefik-forward-auth.svg) [![GitHub release](https://img.shields.io/github/release/thomseddon/traefik-forward-auth.svg)](https://GitHub.com/thomseddon/traefik-forward-auth/releases/)
# Traefik Forward Auth ![Build Status](https://img.shields.io/github/workflow/status/zeroflucs-given/traefik-forward-auth/CI) [![Go Report Card](https://goreportcard.com/badge/github.com/zeroflucs-given/traefik-forward-auth)](https://goreportcard.com/report/github.com/zeroflucs-given/traefik-forward-auth) ![Docker Pulls](https://img.shields.io/docker/pulls/zeroflucs-given/traefik-forward-auth.svg) [![GitHub release](https://img.shields.io/github/release/zeroflucs-given/traefik-forward-auth.svg)](https://GitHub.com/zeroflucs-given/traefik-forward-auth/releases/)


A minimal forward authentication service that provides OAuth/SSO login and authentication for the [traefik](https://github.com/containous/traefik) reverse proxy/load balancer.
Expand Down Expand Up @@ -41,17 +41,17 @@ A minimal forward authentication service that provides OAuth/SSO login and authe

## Releases

We recommend using the `2` tag on docker hub (`thomseddon/traefik-forward-auth:2`).
We recommend using the `2` tag on docker hub (`zeroflucs-given/traefik-forward-auth:2`).

You can also use the latest incremental releases found on [docker hub](https://hub.docker.com/r/thomseddon/traefik-forward-auth/tags) and [github](https://github.com/thomseddon/traefik-forward-auth/releases).
You can also use the latest incremental releases found on [docker hub](https://hub.docker.com/r/zeroflucs-given/traefik-forward-auth/tags) and [github](https://github.com/zeroflucs-given/traefik-forward-auth/releases).

ARM releases are also available on docker hub, just append `-arm` or `-arm64` to your desired released (e.g. `2-arm` or `2.1-arm64`).

We also build binary files for usage without docker starting with releases after 2.2.0 You can find these as assets of the specific GitHub release.

#### Upgrade Guide

v2 was released in June 2019, whilst this is fully backwards compatible, a number of configuration options were modified, please see the [upgrade guide](https://github.com/thomseddon/traefik-forward-auth/wiki/v2-Upgrade-Guide) to prevent warnings on startup and ensure you are using the current configuration.
v2 was released in June 2019, whilst this is fully backwards compatible, a number of configuration options were modified, please see the [upgrade guide](https://github.com/zeroflucs-given/traefik-forward-auth/wiki/v2-Upgrade-Guide) to prevent warnings on startup and ensure you are using the current configuration.

## Usage

Expand All @@ -74,7 +74,7 @@ services:
- /var/run/docker.sock:/var/run/docker.sock

traefik-forward-auth:
image: thomseddon/traefik-forward-auth:2
image: zeroflucs-given/traefik-forward-auth:2
environment:
- PROVIDERS_GOOGLE_CLIENT_ID=your-client-id
- PROVIDERS_GOOGLE_CLIENT_SECRET=your-client-secret
Expand All @@ -94,13 +94,13 @@ services:
#### Advanced:
Please see the examples directory for a more complete [docker-compose.yml](https://github.com/thomseddon/traefik-forward-auth/blob/master/examples/traefik-v2/swarm/docker-compose.yml) or [kubernetes/simple-separate-pod](https://github.com/thomseddon/traefik-forward-auth/blob/master/examples/traefik-v2/kubernetes/simple-separate-pod/).
Please see the examples directory for a more complete [docker-compose.yml](https://github.com/zeroflucs-given/traefik-forward-auth/blob/master/examples/traefik-v2/swarm/docker-compose.yml) or [kubernetes/simple-separate-pod](https://github.com/zeroflucs-given/traefik-forward-auth/blob/master/examples/traefik-v2/kubernetes/simple-separate-pod/).
Also in the examples directory is [docker-compose-auth-host.yml](https://github.com/thomseddon/traefik-forward-auth/blob/master/examples/traefik-v2/swarm/docker-compose-auth-host.yml) and [kubernetes/advanced-separate-pod](https://github.com/thomseddon/traefik-forward-auth/blob/master/examples/traefik-v2/kubernetes/advanced-separate-pod/) which shows how to configure a central auth host, along with some other options.
Also in the examples directory is [docker-compose-auth-host.yml](https://github.com/zeroflucs-given/traefik-forward-auth/blob/master/examples/traefik-v2/swarm/docker-compose-auth-host.yml) and [kubernetes/advanced-separate-pod](https://github.com/zeroflucs-given/traefik-forward-auth/blob/master/examples/traefik-v2/kubernetes/advanced-separate-pod/) which shows how to configure a central auth host, along with some other options.
#### Provider Setup
Below are some general notes on provider setup, specific instructions and examples for a number of providers can be found on the [Provider Setup](https://github.com/thomseddon/traefik-forward-auth/wiki/Provider-Setup) wiki page.
Below are some general notes on provider setup, specific instructions and examples for a number of providers can be found on the [Provider Setup](https://github.com/zeroflucs-given/traefik-forward-auth/wiki/Provider-Setup) wiki page.
##### Google
Expand All @@ -118,7 +118,7 @@ Any provider that supports OpenID Connect 1.0 can be configured via the OIDC con

You must set the `providers.oidc.issuer-url`, `providers.oidc.client-id` and `providers.oidc.client-secret` config options.

Please see the [Provider Setup](https://github.com/thomseddon/traefik-forward-auth/wiki/Provider-Setup) wiki page for examples.
Please see the [Provider Setup](https://github.com/zeroflucs-given/traefik-forward-auth/wiki/Provider-Setup) wiki page for examples.

##### Generic OAuth2

Expand All @@ -135,7 +135,7 @@ You can also set:
- `providers.generic-oauth.scope`- Any scopes that should be included in the request (default: profile, email)
- `providers.generic-oauth.token-style` - How token is presented when querying the User URL. Can be `header` or `query`, defaults to `header`. With `header` the token is provided in an Authorization header, with query the token is provided in the `access_token` query string value.

Please see the [Provider Setup](https://github.com/thomseddon/traefik-forward-auth/wiki/Provider-Setup) wiki page for examples.
Please see the [Provider Setup](https://github.com/zeroflucs-given/traefik-forward-auth/wiki/Provider-Setup) wiki page for examples.

## Configuration

Expand Down Expand Up @@ -475,7 +475,7 @@ As the hostname in the `redirect_uri` is dynamically generated based on the orig

#### Auth Host Mode

This is an optional mode of operation that is useful when dealing with a large number of subdomains, it is activated by using the `auth-host` config option (see [this example docker-compose.yml](https://github.com/thomseddon/traefik-forward-auth/blob/master/examples/traefik-v2/swarm/docker-compose-auth-host.yml) or [this kubernetes example](https://github.com/thomseddon/traefik-forward-auth/tree/master/examples/traefik-v2/kubernetes/advanced-separate-pod)).
This is an optional mode of operation that is useful when dealing with a large number of subdomains, it is activated by using the `auth-host` config option (see [this example docker-compose.yml](https://github.com/zeroflucs-given/traefik-forward-auth/blob/master/examples/traefik-v2/swarm/docker-compose-auth-host.yml) or [this kubernetes example](https://github.com/zeroflucs-given/traefik-forward-auth/tree/master/examples/traefik-v2/kubernetes/advanced-separate-pod)).

For example, if you have a few applications: `app1.test.com`, `app2.test.com`, `appN.test.com`, adding every domain to Google's console can become laborious.
To utilise an auth host, permit domain level cookies by setting the cookie domain to `test.com` then set the `auth-host` to: `auth.test.com`.
Expand All @@ -496,7 +496,7 @@ Two criteria must be met for an `auth-host` to be used:
1. Request matches given `cookie-domain`
2. `auth-host` is also subdomain of same `cookie-domain`

Please note: For Auth Host mode to work, you must ensure that requests to your auth-host are routed to the traefik-forward-auth container, as demonstrated with the service labels in the [docker-compose-auth.yml](https://github.com/thomseddon/traefik-forward-auth/blob/master/examples/traefik-v2/swarm/docker-compose-auth-host.yml) example and the [ingressroute resource](https://github.com/thomseddon/traefik-forward-auth/blob/master/examples/traefik-v2/kubernetes/advanced-separate-pod/traefik-forward-auth/ingress.yaml) in a kubernetes example.
Please note: For Auth Host mode to work, you must ensure that requests to your auth-host are routed to the traefik-forward-auth container, as demonstrated with the service labels in the [docker-compose-auth.yml](https://github.com/zeroflucs-given/traefik-forward-auth/blob/master/examples/traefik-v2/swarm/docker-compose-auth-host.yml) example and the [ingressroute resource](https://github.com/zeroflucs-given/traefik-forward-auth/blob/master/examples/traefik-v2/kubernetes/advanced-separate-pod/traefik-forward-auth/ingress.yaml) in a kubernetes example.

### Logging Out

Expand All @@ -512,4 +512,4 @@ Note: This only clears the auth cookie from the users browser and as this servic

## License

[MIT](https://github.com/thomseddon/traefik-forward-auth/blob/master/LICENSE.md)
[MIT](https://github.com/zeroflucs-given/traefik-forward-auth/blob/master/LICENSE.md)
2 changes: 1 addition & 1 deletion cmd/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import (
"fmt"
"net/http"

internal "github.com/thomseddon/traefik-forward-auth/internal"
internal "github.com/zeroflucs-given/traefik-forward-auth/internal"
)

// Main
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

This is an advanced example of how to deploy traefik-forward-auth in it's own pod. This example is a good starting point for those who already have traefik deployed (e.g. using helm).

This example uses [Selective Authentication](https://github.com/thomseddon/traefik-forward-auth/blob/master/README.md#selective-ingress-authentication-in-kubernetes) to selectively apply forward authentication to each selective ingress, a simple example "whoami" application (deployment, service and ingress) is included for completeness.
This example uses [Selective Authentication](https://github.com/zeroflucs-given/traefik-forward-auth/blob/master/README.md#selective-ingress-authentication-in-kubernetes) to selectively apply forward authentication to each selective ingress, a simple example "whoami" application (deployment, service and ingress) is included for completeness.

This example leverages kustomise to define Secrets and ConfigMaps, example deployment:

Expand Down
Loading

0 comments on commit 81da891

Please sign in to comment.