Merge pull request 'Custom CSS in volume' (#9) from custom-css-volume into main

Reviewed-on: coop-cloud/authentik#9
This commit is contained in:
3wordchant 2025-01-07 15:16:21 +00:00
commit 344db235b0
4 changed files with 27 additions and 0 deletions

View File

@ -49,10 +49,15 @@ SECRET_EMAIL_PASS_VERSION=v1
# EMAIL_SUBJECT="Account Recovery" # EMAIL_SUBJECT="Account Recovery"
# EMAIL_TOKEN_EXPIRY_MINUTES=30 # EMAIL_TOKEN_EXPIRY_MINUTES=30
## assets
COPY_ASSETS="flow_background.jpg|app:/web/dist/assets/images/" COPY_ASSETS="flow_background.jpg|app:/web/dist/assets/images/"
COPY_ASSETS="$COPY_ASSETS icon_left_brand.svg|app:/web/dist/assets/icons/" COPY_ASSETS="$COPY_ASSETS icon_left_brand.svg|app:/web/dist/assets/icons/"
COPY_ASSETS="$COPY_ASSETS icon.png|app:/web/dist/assets/icons/" COPY_ASSETS="$COPY_ASSETS icon.png|app:/web/dist/assets/icons/"
# store custom CSS in a css-volume
#COMPOSE_FILE="$COMPOSE_FILE:compose.css-volume.yml"
# NOTE: this causes the authentik container to run as `root` initially; it uses `su` to drop privileges but technically could introduce a security risk. proceed with caution!
# Default CSS customisation # Default CSS customisation
# COMPOSE_FILE="$COMPOSE_FILE:compose.css.yml" # COMPOSE_FILE="$COMPOSE_FILE:compose.css.yml"
# BACKGROUND_FONT_COLOR=white # BACKGROUND_FONT_COLOR=white

View File

@ -18,6 +18,7 @@ export HEDGEDOC_CONFIG_VERSION=v2
export MONITORING_CONFIG_VERSION=v3 export MONITORING_CONFIG_VERSION=v3
export DB_ENTRYPOINT_VERSION=v1 export DB_ENTRYPOINT_VERSION=v1
export PG_BACKUP_VERSION=v2 export PG_BACKUP_VERSION=v2
export ENTRYPOINT_CSS_VERSION=v1
customize() { customize() {
if [ -z "$1" ] if [ -z "$1" ]

16
compose.css-volume.yml Normal file
View File

@ -0,0 +1,16 @@
---
version: "3.8"
services:
app:
user: root
entrypoint: /docker-entrypoint.sh
configs:
- source: entrypoint_css
target: /docker-entrypoint.sh
mode: 0555
configs:
entrypoint_css:
name: ${STACK_NAME}_entrypoint_css_${ENTRYPOINT_CSS_VERSION}
file: entrypoint-css-volume.sh

5
entrypoint-css-volume.sh Normal file
View File

@ -0,0 +1,5 @@
#!/bin/sh
cp -f /web/dist/assets/custom.css /web/dist/custom.css
su $(id -un 1000) -s /bin/bash -c 'dumb-init -- ak server'