From fcf3aa2ff5d26d501b5a9b948b1ea4c1d1f4aab2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20Kr=C3=BCger?= Date: Sun, 9 Nov 2025 04:24:17 +0100 Subject: [PATCH] feat: inject custom CSS theme into asciinema MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Added entrypoint wrapper script that injects custom.css into the main app.css file at container startup. This allows the custom Pivoine theme to be applied without building a custom image. Changes: - Mount custom.css to static assets directory - Add entrypoint-wrapper.sh to inject CSS on startup - Append custom CSS to both app.css and hashed app-*.css 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude --- asciinema/compose.yaml | 5 ++++- asciinema/entrypoint-wrapper.sh | 17 +++++++++++++++++ 2 files changed, 21 insertions(+), 1 deletion(-) create mode 100755 asciinema/entrypoint-wrapper.sh diff --git a/asciinema/compose.yaml b/asciinema/compose.yaml index 7cef1fb..f2a5b23 100644 --- a/asciinema/compose.yaml +++ b/asciinema/compose.yaml @@ -3,13 +3,16 @@ services: image: ${ASCIINEMA_IMAGE:-ghcr.io/asciinema/asciinema-server:latest} container_name: ${ASCIINEMA_COMPOSE_PROJECT_NAME}_app restart: unless-stopped + entrypoint: ["/entrypoint-wrapper.sh"] + command: ["start"] networks: - compose_network extra_hosts: - "smtp.ionos.de:213.165.67.97" volumes: - asciinema_data:/var/opt/asciinema - - ./theme/custom.css:/app/assets/css/custom.css:ro + - ./theme/custom.css:/opt/app/lib/asciinema-1.0.0/priv/static/assets/custom.css:ro + - ./entrypoint-wrapper.sh:/entrypoint-wrapper.sh:ro environment: SECRET_KEY_BASE: ${ASCIINEMA_SECRET_KEY} URL_HOST: ${ASCIINEMA_TRAEFIK_HOST} diff --git a/asciinema/entrypoint-wrapper.sh b/asciinema/entrypoint-wrapper.sh new file mode 100755 index 0000000..fb4b930 --- /dev/null +++ b/asciinema/entrypoint-wrapper.sh @@ -0,0 +1,17 @@ +#!/bin/sh +set -e + +# Inject custom CSS into app.css if it exists +if [ -f /opt/app/lib/asciinema-1.0.0/priv/static/assets/custom.css ]; then + echo "Injecting custom CSS into app.css..." + cat /opt/app/lib/asciinema-1.0.0/priv/static/assets/custom.css >> /opt/app/lib/asciinema-1.0.0/priv/static/assets/app.css + # Also append to the hashed version + CSS_FILE=$(ls /opt/app/lib/asciinema-1.0.0/priv/static/assets/app-*.css 2>/dev/null | head -1) + if [ -n "$CSS_FILE" ]; then + cat /opt/app/lib/asciinema-1.0.0/priv/static/assets/custom.css >> "$CSS_FILE" + echo "Custom CSS injected successfully" + fi +fi + +# Execute the original entrypoint +exec /opt/app/bin/asciinema "$@"