# Media Server Configuration # Copy this file to config.yaml and customize as needed. # # Secure-by-default: the server binds to loopback (127.0.0.1) only and refuses # to bind a non-loopback address with no tokens configured. # # To expose on the LAN you must do ONE of: # 1. Configure api_tokens below AND change host to "0.0.0.0", OR # 2. Set `allow_lan_without_auth: true` (LAN-open, no auth — insecure on # hostile networks, only acceptable on a trusted home LAN). # API Tokens - Multiple tokens with friendly labels # This allows you to identify which client is making requests in the logs # api_tokens: # home_assistant: "your-home-assistant-token-here" # mobile: "your-mobile-app-token-here" # web_ui: "your-web-ui-token-here" # Server settings host: "127.0.0.1" port: 8765 # allow_lan_without_auth: true # uncomment + change host to 0.0.0.0 for LAN-open mode # ─── Custom scripts ───────────────────────────────────────────────────── # # Examples below are platform-specific. Uncomment the block that matches # your OS — YAML keys must be unique, so don't ship multiple # `lock_screen:` entries. scripts: # ── Windows ───────────────────────────────────────────────────────── # lock_screen: # command: "rundll32.exe user32.dll,LockWorkStation" # label: "Lock Screen" # description: "Lock the workstation" # icon: "mdi:lock" # timeout: 5 # shell: true # sleep: # command: "rundll32.exe powrprof.dll,SetSuspendState 0,1,0" # label: "Sleep" # icon: "mdi:sleep" # timeout: 10 # shell: true # shutdown: # command: "shutdown /s /t 0" # label: "Shutdown" # icon: "mdi:power" # timeout: 10 # shell: true # ── Linux (systemd / xdg) ─────────────────────────────────────────── # lock_screen: # command: "loginctl lock-session" # or: xdg-screensaver lock # label: "Lock Screen" # icon: "mdi:lock" # timeout: 5 # shell: true # sleep: # command: "systemctl suspend" # label: "Sleep" # icon: "mdi:sleep" # timeout: 10 # shell: true # shutdown: # command: "systemctl poweroff" # label: "Shutdown" # icon: "mdi:power" # timeout: 10 # shell: true # ── macOS ─────────────────────────────────────────────────────────── # lock_screen: # command: "pmset displaysleepnow" # label: "Lock Screen" # icon: "mdi:lock" # timeout: 5 # shell: true # sleep: # command: "pmset sleepnow" # label: "Sleep" # icon: "mdi:sleep" # timeout: 5 # shell: true # shutdown: # command: "osascript -e 'tell application \"System Events\" to shut down'" # label: "Shutdown" # icon: "mdi:power" # timeout: 10 # shell: true # Cross-platform smoke test (always defined so first-run users see the UI populate). example_script: command: "echo Hello from Media Server!" description: "Example script - echoes a message" timeout: 10 shell: true # Media folder management from Web UI (default: false) # When enabled, media folders can be added, edited, and deleted from the Settings tab. # media_folders_management: true # ─── Callback scripts (executed by integration events) ────────────────── # # Callbacks are OS-agnostic — if you want side effects, fill in commands # below. The defaults are no-op echos so first-run logs don't error out. callbacks: on_play: command: "echo Play triggered" timeout: 10 shell: true on_pause: command: "echo Pause triggered" timeout: 10 shell: true on_stop: command: "echo Stop triggered" timeout: 10 shell: true on_next: command: "echo Next track" timeout: 10 shell: true on_previous: command: "echo Previous track" timeout: 10 shell: true on_volume: command: "echo Volume changed" timeout: 10 shell: true on_mute: command: "echo Mute toggled" timeout: 10 shell: true on_seek: command: "echo Seek triggered" timeout: 10 shell: true # Turn on/off/toggle (callback-only actions, no default behavior). # The Windows-only example used to ship as the default for `on_turn_off`, # which silently failed on Linux/macOS. Defaults are now no-ops — pick a # platform-appropriate command below. on_turn_on: command: "echo Turn on callback" timeout: 10 shell: true on_turn_off: # Windows: "rundll32.exe user32.dll,LockWorkStation" # Linux: "loginctl lock-session" # macOS: "pmset displaysleepnow" command: "echo Turn off callback" timeout: 5 shell: true on_toggle: command: "echo Toggle callback" timeout: 10 shell: true