From c3b9d024f5a23ec09c5a3a0a01a16c040c688e94 Mon Sep 17 00:00:00 2001 From: Neale Pickett Date: Sat, 10 Sep 2022 17:32:15 -0600 Subject: [PATCH] SimpleAuth + octoprint webcam --- homelab/Caddyfile | 11 ++++++++--- homelab/docker-compose.yaml | 19 ++++++++----------- 2 files changed, 16 insertions(+), 14 deletions(-) diff --git a/homelab/Caddyfile b/homelab/Caddyfile index 49730a2..4959d5c 100644 --- a/homelab/Caddyfile +++ b/homelab/Caddyfile @@ -5,12 +5,10 @@ #acme_ca https://acme-staging-v02.api.letsencrypt.org/directory } -import /run/secrets/caddy-users - (restricted-access) { forward_auth simpleauth:8080 { uri / - copy_headers Set-Cookie + copy_headers X-Simpleauth-Token } } @@ -60,6 +58,13 @@ deergrove.woozle.org, sweetums.woozle.org { header_up X-Script-Name "/octoprint" } } + handle /webcam/* { + # Octoprint doesn't properly prefix webcam URLs + import restricted-access + reverse_proxy { + to 192.168.86.36:80 + } + } handle { import restricted-access file_server { diff --git a/homelab/docker-compose.yaml b/homelab/docker-compose.yaml index ff9b016..99effc0 100644 --- a/homelab/docker-compose.yaml +++ b/homelab/docker-compose.yaml @@ -22,20 +22,17 @@ services: target: /etc/caddy/Caddyfile - source: index.html target: /www/index.html - secrets: - - caddy-users extra_hosts: - host.docker.internal:host-gateway simpleauth: image: ghcr.io/nealey/simpleauth - volumes: - - type: bind - source: /home/neale/src/simpleauth/static - target: /static - read_only: true + command: + - -secret + - /run/secrets/simpleauth.key secrets: - passwd + - simpleauth.key plex: image: ghcr.io/linuxserver/plex @@ -151,18 +148,18 @@ configs: name: dave.yaml-v3 Caddyfile: file: Caddyfile - name: Caddyfile-v27 + name: Caddyfile-v35 index.html: file: index.html name: index.html-v12 secrets: - caddy-users: - file: secrets/caddy-users - name: caddy-users-v2 passwd: file: secrets/passwd name: passwd-v1 + simpleauth.key: + file: secrets/simpleauth.key + name: simpleauth.key-v1 networks: hostnet: