Files
docker-compose/asciinema/compose.yaml
Sebastian Krüger c0611cb04f feat: add Asciinema terminal recording server stack
Added new asciinema stack for self-hosted terminal recording and sharing
platform with custom "Pivoine" theme inspired by pivoine.art aesthetic.

New Services:
- **asciinema**: Terminal recording server at asciinema.pivoine.art
  - PostgreSQL backend for recording persistence
  - Email authentication via IONOS SMTP magic links
  - Public/private recording visibility controls
  - Embed recordings on any website
  - Custom rose/magenta themed UI

Custom Theme (asciinema/theme/custom.css):
- Primary color: RGB(206, 39, 91) - Deep rose/magenta
- Dark charcoal backgrounds: HSL(0, 0%, 17.5%)
- High contrast design with bold color accents
- Styled components: navigation, cards, forms, buttons, terminal player
- Smooth animations and hover effects
- Responsive design with mobile breakpoints
- Custom scrollbars, selection colors, loading states

Infrastructure Updates:
- PostgreSQL: Added `asciinema` database to init script
- arty.yml: Added ASCIINEMA_* environment variables
- compose.yaml: Included asciinema stack in root composition
- CLAUDE.md: Comprehensive documentation with CLI setup guide
- Backup: Added asciinema-backup plan (11 AM daily, 7d/4w/6m/2y retention)

Configuration:
- URL: https://asciinema.pivoine.art
- Database: PostgreSQL `asciinema` database
- SMTP: Email auth via IONOS SMTP
- Unclaimed TTL: 30 days (auto-cleanup)
- Secret: Generated 64-char hex key in .env

Features:
- Record terminal sessions with asciinema CLI
- Web player with play/pause controls and speed adjustment
- User profiles with personal recording collections
- Embed recordings via iframe or direct links
- Privacy controls (public/private recordings)
- Automatic cleanup of unclaimed recordings

Integration Points:
- Documentation: Embed terminal demos
- Blog posts: Share command-line tutorials
- GitHub: Link recordings in README files
- Tutorials: Interactive terminal walkthroughs

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-09 02:00:20 +01:00

51 lines
1.8 KiB
YAML

services:
asciinema:
image: ${ASCIINEMA_IMAGE:-ghcr.io/asciinema/asciinema-server:latest}
container_name: ${ASCIINEMA_COMPOSE_PROJECT_NAME}_app
restart: unless-stopped
networks:
- ${NETWORK_NAME}
volumes:
- asciinema_data:/var/opt/asciinema
- ./theme/custom.css:/app/assets/css/custom.css:ro
environment:
SECRET_KEY_BASE: ${ASCIINEMA_SECRET_KEY}
URL_HOST: ${ASCIINEMA_TRAEFIK_HOST}
URL_PORT: 443
URL_SCHEME: https
DATABASE_URL: postgresql://${DB_USER}:${DB_PASSWORD}@${CORE_DB_HOST}/${ASCIINEMA_DB_NAME}?pool_size=10
SMTP_HOST: ${EMAIL_SMTP_HOST}
SMTP_PORT: ${EMAIL_SMTP_PORT}
SMTP_USERNAME: ${EMAIL_SMTP_USER}
SMTP_PASSWORD: ${EMAIL_SMTP_PASSWORD}
SMTP_SSL: ${SMTP_SSL:-true}
MAIL_FROM_ADDRESS: ${ASCIINEMA_MAIL_FROM}
MAIL_REPLY_TO_ADDRESS: ${ASCIINEMA_MAIL_REPLY_TO}
UNCLAIMED_RECORDING_TTL: ${ASCIINEMA_UNCLAIMED_TTL:-30}
labels:
- traefik.enable=${ASCIINEMA_TRAEFIK_ENABLED:-true}
- traefik.docker.network=${NETWORK_NAME}
- traefik.http.routers.asciinema.rule=Host(`${ASCIINEMA_TRAEFIK_HOST}`)
- traefik.http.routers.asciinema.entrypoints=web-secure
- traefik.http.routers.asciinema.tls=true
- traefik.http.routers.asciinema.tls.certresolver=letsencrypt
- traefik.http.services.asciinema.loadbalancer.server.port=4000
- traefik.http.routers.asciinema.middlewares=compress@file
- com.centurylinklabs.watchtower.enable=true
depends_on:
- postgres
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:4000/health"]
interval: 30s
timeout: 10s
retries: 3
start_period: 40s
volumes:
asciinema_data:
name: ${ASCIINEMA_COMPOSE_PROJECT_NAME}_data
networks:
${NETWORK_NAME}:
external: true