Files
computer-playbook/roles/web-app-peertube/vars/main.yml
kevinveenbirkenbachandClaude Opus 4.8 f881ed0239 fix(peertube): pin to one replica and serve a live RTMP listener
Two swarm defects in the same role. PeerTube has no upstream multi-instance support: the OIDC state cookie is encrypted with a per-process key and the RTMP live ingest binds a single instance with no VIP session affinity, so concurrent replicas broke the auth callback (AES-GCM 'Unsupported state') and would split live streams - pin replicas: 1 (jellyfin/xwiki precedent). Separately, port 1935 was published with no listener because live was off; enable live via a services.peertube.live.enabled config SPOT that gates both PEERTUBE_LIVE_* in the env and the rtmp port publish, so the published port and the RTMP listener can never diverge and the reachability probe passes.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-23 20:01:31 +02:00

23 lines
1.4 KiB
YAML

---
application_id: "web-app-peertube"
entity_name: "{{ application_id | get_entity_name }}"
PEERTUBE_CONTAINER: "{{ lookup('config', application_id, 'services.peertube.name') }}"
PEERTUBE_CONTAINER_ADDRESS: "{{ lookup('container_address', application_id, entity_name) }}"
PEERTUBE_OIDC_PLUGIN: "peertube-plugin-auth-openid-connect"
PEERTUBE_OIDC_ENABLED: "{{ lookup('config', application_id, 'services.sso.enabled') }}"
PEERTUBE_LIVE_ENABLED: "{{ lookup('config', application_id, 'services.peertube.live.enabled') | bool }}"
PEERTUBE_RTMP_PORT: "{{ lookup('config', application_id, 'services.peertube.ports.internal.rtmp') }}"
PEERTUBE_CPUS: "{{ lookup('config', application_id, 'services.peertube.cpus') | float }}"
PEERTUBE_MEM_LIMIT: "{{ lookup('config', application_id, 'services.peertube.mem_limit') }}"
PEERTUBE_MAX_OLD_SPACE_SIZE: "{{ lookup('node_max_old_space_size', application_id, entity_name) }}"
_peertube_concurrency_candidate: "{{ ((PEERTUBE_CPUS | float) * 0.5) | round(0, 'floor') | int }}"
PEERTUBE_TRANSCODING_CONCURRENCY: "{{ [ ( [ (_peertube_concurrency_candidate | int), 1 ] | max ), 8 ] | min }}"
PEERTUBE_OIDC_PLUGIN_INSTALL_MAX_OLD_SPACE_MB: "{{ lookup('node_max_old_space_size', application_id, entity_name, pct=0.125, min_mb=256, hardcap_mb=1024) }}"
PEERTUBE_OIDC_PLUGIN_INSTALL_MEM_LIMIT: "{{ PEERTUBE_MEM_LIMIT | install_mem_limit(PEERTUBE_OIDC_PLUGIN_INSTALL_MAX_OLD_SPACE_MB) }}"