main.ymlΒΆ

---
application_id: "web-app-peertube"
entity_name: "{{ application_id | entity_name }}"

PEERTUBE_CONTAINER: "{{ lookup('config', application_id, 'services.peertube.name') }}"
PEERTUBE_HOSTNAME: "{{ lookup('domain', application_id) }}"
PEERTUBE_INTERNAL_URL: "http://{{ DOCKER_REACH_HOST }}:{{ lookup('config', application_id, 'services.peertube.ports.local.http') }}"
PEERTUBE_ROOT_USERNAME: "root"
PEERTUBE_ROOT_PASSWORD: "{{ (lookup('users', IAM_PLATFORM_ADMIN_USER_KEY).password | string)[:50] }}"

PEERTUBE_DESIGN_ENABLED: "{{ lookup('config', application_id, 'services.design.enabled') | bool }}"
PEERTUBE_DESIGN: "{{ lookup('design', application_id) }}"
PEERTUBE_DESIGN_DIR: "{{ [lookup('container', application_id, 'directories.instance'), 'design'] | path_join }}"
PEERTUBE_DESIGN_LOGOS:
  - type: header-wide
    file: header-wide.png
  - type: header-square
    file: header-square.png
  - type: favicon
    file: favicon.png
PEERTUBE_DESIGN_THEME:
  PRIMARY_COLOR: "--design-primary"
  ON_PRIMARY_COLOR: "--design-on-primary"
  FOREGROUND_COLOR: "--design-text"
  BACKGROUND_COLOR: "--design-surface-1"
  BACKGROUND_SECONDARY_COLOR: "--design-surface-3"
  MENU_FOREGROUND_COLOR: "--design-text"
  MENU_BACKGROUND_COLOR: "--design-surface-2"
  HEADER_FOREGROUND_COLOR: "--design-text"
  HEADER_BACKGROUND_COLOR: "--design-surface-1"

PEERTUBE_RELEASE: "{{ lookup('config', application_id, 'services.peertube.version') | peertube_release }}"
PEERTUBE_RELEASE_MARKER: "{{ [lookup('container', application_id, 'directories.instance'), 'peertube.release'] | path_join }}"
PEERTUBE_ASSETS_DIR: "{{ lookup('volume', application_id, 'assets').target }}"
PEERTUBE_MIGRATION_SCRIPTS_DIR: "dist/scripts/migrations"
# Health polls of 5 s while the server migrates existing data.
PEERTUBE_MIGRATION_HEALTH_RETRIES: 360

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('cpus', application_id, 'peertube') | 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) }}"