Just authenticates you, and sets a cookie. Useful for caddy/traefik forward-auth.
Go to file
Neale Pickett f025cd6761 Update the README 2021-12-05 17:18:57 -07:00
.github/workflows This package isn't called moth 2021-12-05 16:18:36 -07:00
build Working, trying to get CI going 2021-08-15 11:03:25 -06:00
cmd/simpleauth Remove some debugging 2021-08-15 20:37:30 -06:00
pkg/token I think it actually works now. 2021-12-05 16:16:52 -07:00
static Working, trying to get CI going 2021-08-15 11:03:25 -06:00
README.md Update the README 2021-12-05 17:18:57 -07:00
go.mod Working, trying to get CI going 2021-08-15 11:03:25 -06:00
secret Working, trying to get CI going 2021-08-15 11:03:25 -06:00

README.md

Simple Auth

All this does is present a login page. Upon successful login, the browser gets a cookie, and further attempts to access will get the success page.

I made this to use with the Traefik forward-auth middleware. All I need is a simple password, that's easy to fill with a password manager. This checks those boxes.

Installation with Traefik

I only use docker swarm. You'd do something like the following:

services:
  my-cool-service:
    # All your cool stuff here
    deploy:
      labels:
        # Keep all your existing traefik stuff
        traefik.http.routers.dashboard.middlewares: forward-auth
        traefik.http.middlewares.forward-auth.forwardauth.address: http://simpleauth:8080/
  simpleauth:
    image: ghcr.io/nealey/simpleauth
    secrets:
      - password
    deploy:
      labels:
        traefik.enable: "true"
        traefik.http.routers.simpleauth.rules: "PathPrefix(`/`)"
        traefik.http.services.simpleauth.loadbalancer.server.port: "8080"

secrets:
  password:
    file: password
    name: password-v1

Note

For some reason that I haven't bothered looking into, I have to first load / in the browser. I think it has something to do with cookies going through traefik simpleauth, and I could probably fix it with some JavaScript, but this is good enough for me.