Skip to content

Conversation

@St0nefish
Copy link

Add Enhanced Docker Logging and Optional Notifications

Overview

This PR adds two opt-in features to improve container monitoring and automation capabilities:

  1. Enhanced Docker Logging - Streams all MakeMKV output to Docker stdout
  2. Multi-Service Notifications - Optional notifications via Apprise (80+ services)

Key Features

  • Fully backward compatible - All features are opt-in with defaults that match current behavior
  • Enhanced Docker Logging - When enabled, streams all MakeMKV output to docker logs
  • Optional Notifications - Automatic notifications for rip start/complete/error via Apprise
  • Minimal runtime overhead - No CPU/memory impact when features are disabled (image size increased ~75MB for Python/Apprise)
  • No GUI changes - Works seamlessly with existing web interface

Implementation Details

Enhanced Logging (opt-in)

  • Set ENABLE_DOCKER_LOGGING=1 to stream MakeMKV output to Docker stdout
  • Useful for container orchestration platforms (Portainer, Kubernetes, etc.)
  • Automatically enabled if Apprise notifications are configured
  • Default: 0 (disabled)

Notifications (opt-in)

  • Place apprise.yml in /config directory to enable
  • Supports 80+ services (Discord, Slack, Telegram, Email, Pushover, etc.)
  • Notifications for:
    • Rip started (optional via NOTIFY_START=1, default: 1)
    • Rip completed (always sent when notifications enabled)
    • Rip failed (always sent when notifications enabled)
  • Requires debug logging (automatically enabled when apprise.yml exists)

New Environment Variables

Variable Description Default
ENABLE_DOCKER_LOGGING Stream MakeMKV output to Docker stdout 0
NOTIFY_START Send notification when rip starts 1

Files Added

  • rootfs/usr/bin/makemkv-log-watcher.sh - Monitors MakeMKV log file
  • rootfs/usr/bin/makemkv-monitor.sh - Parses log events and triggers notifications
  • rootfs/usr/bin/makemkv-notify.py - Apprise notification handler
  • rootfs/etc/cont-init.d/57-enhanced-logging.sh - Conditional initialization
  • apprise.yml.example - Example notification configuration

Testing

  • Tested with actual Blu-ray rips
  • Verified backward compatibility (no changes when features disabled)
  • Confirmed notifications work with Discord via Apprise
  • Validated Docker logging streams correctly

Why These Changes?

  • Many users run MakeMKV in headless/automated setups
  • Container orchestration platforms benefit from proper stdout logging
  • Notifications enable better automation workflows
  • Apprise provides universal notification support without vendor lock-in

Example Usage

Enable Docker Logging Only

environment:
  - ENABLE_DOCKER_LOGGING=1

Enable Notifications

  1. Copy apprise.yml.example to /config/apprise.yml
  2. Add your service URLs (see Apprise docs)
  3. Notifications will activate automatically

Sample Notifications

Rip Started

MakeMKV: Rip Started
🎬 Interstellar
📁 /output/Interstellar
📀 Saving 1 title(s)

Rip Complete

MakeMKV: Rip Complete
🎬 Interstellar
✅ Saved: 1 titles
⏱️ Duration: 24:35

Rip Failed (Complete Failure)

MakeMKV: Rip Failed
🎬 Interstellar
✅ Saved: 0 titles
❌ Failed: 1 titles
⚠️ 5 'SCSI error' errors
⏱️ Duration: 05:23

Rip Failed (Partial - TV Series)

MakeMKV: Rip Failed
🎬 Planet Earth
✅ Saved: 2 titles
❌ Failed: 1 titles
⚠️ 12 'Hash check failed' errors
⏱️ Duration: 18:42

Notes

  • Debug logging (app_ShowDebug) is only forced when features are enabled
  • Movie titles in notifications are extracted from output paths
  • All changes follow the existing codebase patterns and conventions

St0nefish and others added 2 commits August 19, 2025 15:39
- Stream all MakeMKV output to Docker stdout for better container monitoring
- Add optional multi-service notifications via Apprise (80+ services)
- Fully backward compatible - all features are opt-in
- ENABLE_DOCKER_LOGGING=0 by default, set to 1 to enable stdout logging
- Notifications only activate if /config/apprise.yml is configured
- Minimal overhead when features are disabled

🤖 Generated with Claude Code
Co-Authored-By: Claude <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant