| @@ -27,6 +27,9 @@ | |||||
| - src: git+https://github.com/mother-of-all-self-hosting/ansible-role-jitsi.git | - src: git+https://github.com/mother-of-all-self-hosting/ansible-role-jitsi.git | ||||
| version: v10078-1-0 | version: v10078-1-0 | ||||
| name: jitsi | name: jitsi | ||||
| - src: git+https://github.com/mother-of-all-self-hosting/ansible-role-livekit-server.git | |||||
| version: v1.8.4-0 | |||||
| name: livekit_server | |||||
| - src: git+https://github.com/mother-of-all-self-hosting/ansible-role-ntfy.git | - src: git+https://github.com/mother-of-all-self-hosting/ansible-role-ntfy.git | ||||
| version: v2.11.0-4 | version: v2.11.0-4 | ||||
| name: ntfy | name: ntfy | ||||
| @@ -1,216 +0,0 @@ | |||||
| # SPDX-FileCopyrightText: 2022 MDAD project contributors | |||||
| # SPDX-FileCopyrightText: 2024 wjbeckett | |||||
| # SPDX-FileCopyrightText: 2024 - 2025 Slavi Pantaleev | |||||
| # | |||||
| # SPDX-License-Identifier: AGPL-3.0-or-later | |||||
| --- | |||||
| # Project source code URL: https://github.com/livekit/livekit | |||||
| livekit_server_enabled: false | |||||
| livekit_server_identifier: livekit-server | |||||
| livekit_server_uid: '' | |||||
| livekit_server_gid: '' | |||||
| livekit_server_base_path: "/{{ livekit_server_identifier }}" | |||||
| livekit_server_config_path: "{{ livekit_server_base_path }}/config" | |||||
| # renovate: datasource=docker depName=docker.io/livekit/livekit-server | |||||
| livekit_server_version: v1.8.4 | |||||
| livekit_server_scheme: https | |||||
| livekit_server_hostname: "" | |||||
| livekit_server_path_prefix: / | |||||
| livekit_server_container_network: "{{ livekit_server_identifier }}" | |||||
| livekit_server_container_additional_networks: "{{ livekit_server_container_additional_networks_auto + livekit_server_container_additional_networks_custom }}" | |||||
| livekit_server_container_additional_networks_auto: [] | |||||
| livekit_server_container_additional_networks_custom: [] | |||||
| # Controls whether the LiveKit Server container exposes its RTC ports and which interface to do it on. | |||||
| # | |||||
| # Takes an interface "<ip address>" (e.g. "127.0.0.1"), or empty string to listen on all interfaces. | |||||
| # Takes a null/none value (`~`) or 'none' (as a string) to prevent listening. | |||||
| livekit_server_container_rtc_listen_interface: "{{ '' if livekit_server_container_network != 'host' else 'none' }}" | |||||
| # Controls whether the LiveKit Server container exposes its TURN ports and which interface to do it on. | |||||
| # | |||||
| # Takes an interface "<ip address>" (e.g. "127.0.0.1"), or empty string to listen on all interfaces. | |||||
| # Takes a null/none value (`~`) or 'none' (as a string) to prevent listening. | |||||
| livekit_server_container_turn_listen_interface: "{{ '' if livekit_server_container_network != 'host' else 'none' }}" | |||||
| livekit_server_container_image_self_build: false | |||||
| livekit_server_container_repo: "https://github.com/livekit/livekit.git" | |||||
| livekit_server_container_repo_version: "{{ 'main' if livekit_server_version == 'latest' else livekit_server_version }}" | |||||
| livekit_server_container_src_files_path: "{{ livekit_server_base_path }}/container-src" | |||||
| livekit_server_container_image: "{{ livekit_server_container_image_registry_prefix }}livekit/livekit-server:{{ livekit_server_version }}" | |||||
| livekit_server_container_image_registry_prefix: "{{ 'localhost/' if livekit_server_container_image_self_build else livekit_server_container_image_registry_prefix_upstream }}" | |||||
| livekit_server_container_image_registry_prefix_upstream: "{{ livekit_server_container_image_registry_prefix_upstream_default }}" | |||||
| livekit_server_container_image_registry_prefix_upstream_default: docker.io/ | |||||
| livekit_server_container_image_force_pull: "{{ livekit_server_container_image.endswith(':latest') }}" | |||||
| livekit_server_container_labels_traefik_enabled: true | |||||
| livekit_server_container_labels_traefik_docker_network: "{{ livekit_server_container_network }}" | |||||
| livekit_server_container_labels_traefik_hostname: "{{ livekit_server_hostname }}" | |||||
| # The path prefix must either be `/` or not end with a slash (e.g. `/element`). | |||||
| livekit_server_container_labels_traefik_path_prefix: "{{ livekit_server_path_prefix }}" | |||||
| livekit_server_container_labels_traefik_rule: "Host(`{{ livekit_server_container_labels_traefik_hostname }}`){% if livekit_server_container_labels_traefik_path_prefix != '/' %} && PathPrefix(`{{ livekit_server_container_labels_traefik_path_prefix }}`){% endif %}" | |||||
| livekit_server_container_labels_traefik_priority: 0 | |||||
| livekit_server_container_labels_traefik_entrypoints: web-secure | |||||
| livekit_server_container_labels_traefik_tls: "{{ livekit_server_container_labels_traefik_entrypoints != 'web' }}" | |||||
| livekit_server_container_labels_traefik_tls_certResolver: default # noqa var-naming | |||||
| # livekit_server_container_labels_additional_labels contains a multiline string with additional labels to add to the container label file. | |||||
| # See `../templates/labels.j2` for details. | |||||
| # | |||||
| # Example: | |||||
| # livekit_server_container_labels_additional_labels: | | |||||
| # my.label=1 | |||||
| # another.label="here" | |||||
| livekit_server_container_labels_additional_labels: '' | |||||
| # A list of extra arguments to pass to the container | |||||
| livekit_server_container_extra_arguments: [] | |||||
| # List of systemd services that LiveKit Server service depends on | |||||
| livekit_server_systemd_required_services_list: "{{ livekit_server_systemd_required_services_list_default + livekit_server_systemd_required_services_list_auto + livekit_server_systemd_required_services_list_custom }}" | |||||
| livekit_server_systemd_required_services_list_default: "{{ [devture_systemd_docker_base_docker_service_name] if devture_systemd_docker_base_docker_service_name else [] }}" | |||||
| livekit_server_systemd_required_services_list_auto: [] | |||||
| livekit_server_systemd_required_services_list_custom: [] | |||||
| # Holds the final LiveKit Server configuration (a combination of the default and its extension). | |||||
| # You most likely don't need to touch this variable. Instead, see `livekit_server_configuration_yaml` or `livekit_server_configuration_extension_yaml`. | |||||
| livekit_server_configuration: "{{ livekit_server_configuration_yaml | from_yaml | combine(livekit_server_configuration_extension, recursive=True) }}" | |||||
| # Default LiveKit Server configuration template which covers the generic use case. | |||||
| # You can customize it by controlling the various variables inside it. | |||||
| # | |||||
| # For a more advanced customization, you can extend the default (see `livekit_server_configuration_extension_yaml`) | |||||
| # or completely replace this variable with your own template. | |||||
| livekit_server_configuration_yaml: "{{ lookup('template', 'templates/config.yaml.j2') }}" | |||||
| livekit_server_configuration_extension_yaml: | | |||||
| # Your custom YAML configuration for LiveKit Server goes here. | |||||
| # This configuration extends the default starting configuration (`livekit_server_configuration_yaml`). | |||||
| # | |||||
| # You can override individual variables from the default configuration, or introduce new ones. | |||||
| # | |||||
| # If you need something more special, you can take full control by | |||||
| # completely redefining `livekit_server_configuration_yaml`. | |||||
| # | |||||
| # Example configuration extension follows: | |||||
| # | |||||
| # logging: | |||||
| # level: debug | |||||
| livekit_server_configuration_extension: "{{ livekit_server_configuration_extension_yaml | from_yaml if livekit_server_configuration_extension_yaml | from_yaml is mapping else {} }}" | |||||
| # Controls the `port` configuration property. | |||||
| # See: https://docs.livekit.io/home/self-hosting/ports-firewall/ | |||||
| livekit_server_config_port: 7880 | |||||
| ######################################################################################## | |||||
| # # | |||||
| # RTC # | |||||
| # # | |||||
| ######################################################################################## | |||||
| # Controls the `rtc.tcp_port` configuration property | |||||
| # See: https://docs.livekit.io/home/self-hosting/ports-firewall/ | |||||
| livekit_server_config_rtc_tcp_port: 7881 | |||||
| # Controls the `rtc.port_range_start` configuration property. | |||||
| # This must be defined together with `livekit_server_config_rtc_port_range_end`, | |||||
| # or alternatively `livekit_server_config_rtc_udp_port` can be defined as a single port that handles all traffic. | |||||
| # Example: 50100 | |||||
| # See: https://docs.livekit.io/home/self-hosting/ports-firewall/ | |||||
| livekit_server_config_rtc_port_range_start: '' | |||||
| # Controls the `rtc.port_range_end` configuration property. | |||||
| # This must be defined together with `livekit_server_config_rtc_port_range_start`, | |||||
| # or alternatively `livekit_server_config_rtc_udp_port` can be defined as a single port that handles all traffic. | |||||
| # Example: 50200 | |||||
| # See: https://docs.livekit.io/home/self-hosting/ports-firewall/ | |||||
| livekit_server_config_rtc_port_range_end: '' | |||||
| # Controls the `rtc.udp_port` configuration property. | |||||
| # As an alternative to this, one may define both `livekit_server_config_rtc_port_range_start` and `livekit_server_config_rtc_port_range_end`. | |||||
| # Example: 7882 | |||||
| # See: https://docs.livekit.io/home/self-hosting/ports-firewall/ | |||||
| livekit_server_config_rtc_udp_port: 7882 | |||||
| # Controls the `rtc.use_external_ip` configuration property. | |||||
| # When set to true, attempts to discover the host's public IP via STUN. | |||||
| # This is useful for cloud environments such as AWS & Google where hosts have an internal IP that maps to an external one. | |||||
| livekit_server_config_rtc_use_external_ip: true | |||||
| ######################################################################################## | |||||
| # # | |||||
| # /RTC # | |||||
| # # | |||||
| ######################################################################################## | |||||
| ######################################################################################## | |||||
| # # | |||||
| # TURN # | |||||
| # # | |||||
| ######################################################################################## | |||||
| # Controls the `turn.enabled` configuration property. | |||||
| # When set to true, enables TURN server. | |||||
| livekit_server_config_turn_enabled: false | |||||
| # Controls the `turn.domain` configuration property. | |||||
| # Example: livekit.example.com | |||||
| livekit_server_config_turn_domain: "{{ livekit_server_hostname }}" | |||||
| # Controls the `turn.cert_file` configuration property. | |||||
| # Path to the TLS certificate file. | |||||
| livekit_server_config_turn_cert_file: '' | |||||
| # Controls the `turn.key_file` configuration property. | |||||
| # Path to the TLS key file. | |||||
| livekit_server_config_turn_key_file: '' | |||||
| # Controls the `turn.external_tls` configuration property. | |||||
| livekit_server_config_turn_external_tls: false | |||||
| # Controls the `turn.tls_port` configuration property. | |||||
| # See: https://docs.livekit.io/home/self-hosting/ports-firewall/ | |||||
| livekit_server_config_turn_tls_port: 5349 | |||||
| # Controls the `turn.udp_port` configuration property. | |||||
| # See: https://docs.livekit.io/home/self-hosting/ports-firewall/ | |||||
| livekit_server_config_turn_udp_port: 3478 | |||||
| ######################################################################################## | |||||
| # # | |||||
| # /TURN # | |||||
| # # | |||||
| ######################################################################################## | |||||
| # Controls the `keys` configuration property. | |||||
| livekit_server_config_keys: "{{ livekit_server_config_keys_auto | combine(livekit_server_config_keys_custom, recursive=True) }}" | |||||
| livekit_server_config_keys_auto: {} | |||||
| livekit_server_config_keys_custom: {} | |||||
| # Controls the `logging.level` configuration property. | |||||
| # Known values: debug, info, warn, error | |||||
| livekit_server_config_logging_level: info | |||||
| # Controls the `logging.pion_level` configuration property | |||||
| livekit_server_config_logging_pion_level: error | |||||
| # Controls the `logging.json` configuration property. | |||||
| # When set to true, emits json fields. | |||||
| livekit_server_config_logging_json: false | |||||
| # Controls the `logging.sample` configuration property. | |||||
| # For production setups, enables sampling algorithm. | |||||
| # See: https://github.com/uber-go/zap/blob/master/FAQ.md#why-sample-application-logs | |||||
| livekit_server_config_logging_sample: false | |||||
| @@ -1,84 +0,0 @@ | |||||
| # SPDX-FileCopyrightText: 2022 MDAD project contributors | |||||
| # SPDX-FileCopyrightText: 2024 wjbeckett | |||||
| # SPDX-FileCopyrightText: 2024 - 2025 Slavi Pantaleev | |||||
| # | |||||
| # SPDX-License-Identifier: AGPL-3.0-or-later | |||||
| --- | |||||
| - name: Ensure LiveKit Server paths exist | |||||
| ansible.builtin.file: | |||||
| path: "{{ item.path }}" | |||||
| state: directory | |||||
| mode: 0750 | |||||
| owner: "{{ livekit_server_uid }}" | |||||
| group: "{{ livekit_server_gid }}" | |||||
| with_items: | |||||
| - {path: "{{ livekit_server_base_path }}", when: true} | |||||
| - {path: "{{ livekit_server_config_path }}", when: true} | |||||
| - {path: "{{ livekit_server_container_src_files_path }}", when: "{{ livekit_server_container_image_self_build }}"} | |||||
| when: "item.when | bool" | |||||
| - name: Ensure LiveKit Server configuration installed | |||||
| ansible.builtin.copy: | |||||
| content: "{{ livekit_server_configuration | to_nice_yaml(indent=2, width=999999) }}" | |||||
| dest: "{{ livekit_server_config_path }}/config.yaml" | |||||
| mode: 0640 | |||||
| owner: "{{ livekit_server_uid }}" | |||||
| group: "{{ livekit_server_gid }}" | |||||
| - name: Ensure LiveKit Server labels file installed | |||||
| ansible.builtin.template: | |||||
| src: "{{ role_path }}/templates/labels.j2" | |||||
| dest: "{{ livekit_server_base_path }}/labels" | |||||
| mode: 0640 | |||||
| owner: "{{ livekit_server_uid }}" | |||||
| group: "{{ livekit_server_gid }}" | |||||
| - name: Ensure LiveKit Server container image is pulled | |||||
| community.docker.docker_image: | |||||
| name: "{{ livekit_server_container_image }}" | |||||
| source: "{{ 'pull' if ansible_version.major > 2 or ansible_version.minor > 7 else omit }}" | |||||
| force_source: "{{ livekit_server_container_image_force_pull if ansible_version.major > 2 or ansible_version.minor >= 8 else omit }}" | |||||
| force: "{{ omit if ansible_version.major > 2 or ansible_version.minor >= 8 else livekit_server_container_image_force_pull }}" | |||||
| when: "not livekit_server_container_image_self_build | bool" | |||||
| register: result | |||||
| retries: "{{ devture_playbook_help_container_retries_count }}" | |||||
| delay: "{{ devture_playbook_help_container_retries_delay }}" | |||||
| until: result is not failed | |||||
| - when: "livekit_server_container_image_self_build | bool" | |||||
| block: | |||||
| - name: Ensure LiveKit Server repository is present on self-build | |||||
| ansible.builtin.git: | |||||
| repo: "{{ livekit_server_container_repo }}" | |||||
| version: "{{ livekit_server_container_repo_version }}" | |||||
| dest: "{{ livekit_server_container_src_files_path }}" | |||||
| force: "yes" | |||||
| become: true | |||||
| become_user: "{{ livekit_server_uid }}" | |||||
| register: livekit_server_git_pull_results | |||||
| - name: Ensure LiveKit Server container image is built | |||||
| community.docker.docker_image: | |||||
| name: "{{ livekit_server_container_image }}" | |||||
| source: build | |||||
| force_source: "{{ livekit_server_git_pull_results.changed if ansible_version.major > 2 or ansible_version.minor >= 8 else omit }}" | |||||
| force: "{{ omit if ansible_version.major > 2 or ansible_version.minor >= 8 else livekit_server_git_pull_results.changed }}" | |||||
| build: | |||||
| dockerfile: Dockerfile | |||||
| path: "{{ livekit_server_container_src_files_path }}" | |||||
| pull: true | |||||
| - name: Ensure LiveKit Server container network is created | |||||
| community.general.docker_network: | |||||
| enable_ipv6: "{{ devture_systemd_docker_base_ipv6_enabled }}" | |||||
| name: "{{ livekit_server_container_network }}" | |||||
| driver: bridge | |||||
| driver_options: "{{ devture_systemd_docker_base_container_networks_driver_options }}" | |||||
| - name: Ensure LiveKit Server systemd service is installed | |||||
| ansible.builtin.template: | |||||
| src: "{{ role_path }}/templates/systemd/livekit-server.service.j2" | |||||
| dest: "{{ devture_systemd_docker_base_systemd_path }}/{{ livekit_server_identifier }}.service" | |||||
| mode: 0644 | |||||
| @@ -1,26 +0,0 @@ | |||||
| # SPDX-FileCopyrightText: 2022 MDAD project contributors | |||||
| # SPDX-FileCopyrightText: 2024 wjbeckett | |||||
| # SPDX-FileCopyrightText: 2024 Slavi Pantaleev | |||||
| # | |||||
| # SPDX-License-Identifier: AGPL-3.0-or-later | |||||
| --- | |||||
| - tags: | |||||
| - setup-all | |||||
| - setup-livekit-server | |||||
| - install-all | |||||
| - install-livekit-server | |||||
| block: | |||||
| - when: livekit_server_enabled | bool | |||||
| ansible.builtin.include_tasks: "{{ role_path }}/tasks/validate_config.yml" | |||||
| - when: livekit_server_enabled | bool | |||||
| ansible.builtin.include_tasks: "{{ role_path }}/tasks/install.yml" | |||||
| - tags: | |||||
| - setup-all | |||||
| - setup-livekit-server | |||||
| block: | |||||
| - when: not livekit_server_enabled | bool | |||||
| ansible.builtin.include_tasks: "{{ role_path }}/tasks/uninstall.yml" | |||||
| @@ -1,31 +0,0 @@ | |||||
| # SPDX-FileCopyrightText: 2022 MDAD project contributors | |||||
| # SPDX-FileCopyrightText: 2024 wjbeckett | |||||
| # SPDX-FileCopyrightText: 2024 Slavi Pantaleev | |||||
| # | |||||
| # SPDX-License-Identifier: AGPL-3.0-or-later | |||||
| --- | |||||
| - name: Check existence of LiveKit Server service | |||||
| ansible.builtin.stat: | |||||
| path: "{{ devture_systemd_docker_base_systemd_path }}/{{ livekit_server_identifier }}.service" | |||||
| register: livekit_server_service_stat | |||||
| - when: livekit_server_service_stat.stat.exists | bool | |||||
| block: | |||||
| - name: Ensure LiveKit Server is stopped | |||||
| ansible.builtin.service: | |||||
| name: "{{ livekit_server_identifier }}" | |||||
| state: stopped | |||||
| enabled: false | |||||
| daemon_reload: true | |||||
| - name: Ensure LiveKit Server systemd service doesn't exist | |||||
| ansible.builtin.file: | |||||
| path: "{{ devture_systemd_docker_base_systemd_path }}/{{ livekit_server_identifier }}.service" | |||||
| state: absent | |||||
| - name: Ensure LiveKit Server paths don't exist | |||||
| ansible.builtin.file: | |||||
| path: "{{ livekit_server_base_path }}" | |||||
| state: absent | |||||
| @@ -1,31 +0,0 @@ | |||||
| # SPDX-FileCopyrightText: 2022 MDAD project contributors | |||||
| # SPDX-FileCopyrightText: 2024 wjbeckett | |||||
| # SPDX-FileCopyrightText: 2024 Slavi Pantaleev | |||||
| # | |||||
| # SPDX-License-Identifier: AGPL-3.0-or-later | |||||
| --- | |||||
| - name: Fail if required LiveKit Server settings are not defined | |||||
| ansible.builtin.fail: | |||||
| msg: > | |||||
| You need to define a required configuration setting (`{{ item.name }}`). | |||||
| when: "item.when | bool and vars[item.name] | length == 0" | |||||
| with_items: | |||||
| - {'name': 'livekit_server_hostname', when: true} | |||||
| - {'name': 'livekit_server_identifier', when: true} | |||||
| - {'name': 'livekit_server_uid', when: true} | |||||
| - {'name': 'livekit_server_gid', when: true} | |||||
| - {'name': 'livekit_server_config_turn_domain', when: "{{ livekit_server_config_turn_enabled | bool }}"} | |||||
| - {'name': 'livekit_server_config_turn_cert_file', when: "{{ livekit_server_config_turn_enabled | bool }}"} | |||||
| - {'name': 'livekit_server_config_turn_key_file', when: "{{ livekit_server_config_turn_enabled | bool }}"} | |||||
| - name: Fail if LiveKit Server port range configuration is invalid | |||||
| ansible.builtin.fail: | |||||
| msg: > | |||||
| You need to either define both port range settings (livekit_server_config_rtc_port_range_start and livekit_server_config_rtc_port_range_end) | |||||
| or define a single UDP port (livekit_server_config_rtc_udp_port). | |||||
| when: > | |||||
| (livekit_server_config_rtc_port_range_start | string | length > 0 and livekit_server_config_rtc_port_range_end | string | length == 0) or | |||||
| (livekit_server_config_rtc_port_range_start | string | length == 0 and livekit_server_config_rtc_port_range_end | string | length > 0) or | |||||
| (livekit_server_config_rtc_port_range_start | string | length == 0 and livekit_server_config_rtc_port_range_end | string | length == 0 and livekit_server_config_rtc_udp_port | string | length == 0) | |||||
| @@ -1,42 +0,0 @@ | |||||
| #jinja2: lstrip_blocks: "True" | |||||
| port: {{ livekit_server_config_port | int | to_json }} | |||||
| bind_addresses: | |||||
| - "0.0.0.0" | |||||
| rtc: | |||||
| tcp_port: {{ livekit_server_config_rtc_tcp_port | int | to_json }} | |||||
| {% if livekit_server_config_rtc_udp_port %} | |||||
| udp_port: {{ livekit_server_config_rtc_udp_port | int | to_json }} | |||||
| {% endif %} | |||||
| {% if livekit_server_config_rtc_port_range_start %} | |||||
| port_range_start: {{ livekit_server_config_rtc_port_range_start | int | to_json }} | |||||
| {% endif %} | |||||
| {% if livekit_server_config_rtc_port_range_end %} | |||||
| port_range_end: {{ livekit_server_config_rtc_port_range_end | int | to_json }} | |||||
| {% endif %} | |||||
| use_external_ip: {{ livekit_server_config_rtc_use_external_ip | to_json }} | |||||
| turn: | |||||
| enabled: {{ livekit_server_config_turn_enabled | to_json }} | |||||
| {% if livekit_server_config_turn_enabled %} | |||||
| domain: {{ livekit_server_config_turn_domain | to_json }} | |||||
| cert_file: {{ livekit_server_config_turn_cert_file | to_json }} | |||||
| key_file: {{ livekit_server_config_turn_key_file | to_json }} | |||||
| tls_port: {{ livekit_server_config_turn_tls_port | int | to_json }} | |||||
| udp_port: {{ livekit_server_config_turn_udp_port | int | to_json }} | |||||
| external_tls: {{ livekit_server_config_turn_external_tls | to_json }} | |||||
| {% endif %} | |||||
| keys: {{ livekit_server_config_keys | to_json }} | |||||
| logging: | |||||
| level: {{ livekit_server_config_logging_level | to_json }} | |||||
| pion_level: {{ livekit_server_config_logging_pion_level | to_json }} | |||||
| json: {{ livekit_server_config_logging_json | to_json }} | |||||
| sample: {{ livekit_server_config_logging_sample | to_json }} | |||||
| @@ -1,4 +0,0 @@ | |||||
| SPDX-FileCopyrightText: 2024 wjbeckett | |||||
| SPDX-FileCopyrightText: 2024 Slavi Pantaleev | |||||
| SPDX-License-Identifier: AGPL-3.0-or-later | |||||
| @@ -1,49 +0,0 @@ | |||||
| {# | |||||
| SPDX-FileCopyrightText: 2024 wjbeckett | |||||
| SPDX-FileCopyrightText: 2024 - 2025 Slavi Pantaleev | |||||
| SPDX-License-Identifier: AGPL-3.0-or-later | |||||
| #} | |||||
| {% if livekit_server_container_labels_traefik_enabled %} | |||||
| traefik.enable=true | |||||
| {% if livekit_server_container_labels_traefik_docker_network %} | |||||
| traefik.docker.network={{ livekit_server_container_labels_traefik_docker_network }} | |||||
| {% endif %} | |||||
| traefik.http.services.{{ livekit_server_identifier }}.loadbalancer.server.port={{ livekit_server_config_port }} | |||||
| {% set middlewares = [] %} | |||||
| {% if livekit_server_container_labels_traefik_path_prefix != '/' %} | |||||
| traefik.http.middlewares.{{ livekit_server_identifier }}-slashless-redirect.redirectregex.regex=({{ livekit_server_container_labels_traefik_path_prefix | quote }})$ | |||||
| traefik.http.middlewares.{{ livekit_server_identifier }}-slashless-redirect.redirectregex.replacement=${1}/ | |||||
| {% set middlewares = middlewares + [livekit_server_identifier + '-slashless-redirect'] %} | |||||
| traefik.http.middlewares.{{ livekit_server_identifier }}-strip-prefix.stripprefix.prefixes={{ livekit_server_container_labels_traefik_path_prefix }} | |||||
| {% set middlewares = middlewares + [livekit_server_identifier + '-strip-prefix'] %} | |||||
| {% endif %} | |||||
| traefik.http.routers.{{ livekit_server_identifier }}.rule={{ livekit_server_container_labels_traefik_rule }} | |||||
| {% if livekit_server_container_labels_traefik_priority | int > 0 %} | |||||
| traefik.http.routers.{{ livekit_server_identifier }}.priority={{ livekit_server_container_labels_traefik_priority }} | |||||
| {% endif %} | |||||
| traefik.http.routers.{{ livekit_server_identifier }}.service={{ livekit_server_identifier }} | |||||
| {% if middlewares | length > 0 %} | |||||
| traefik.http.routers.{{ livekit_server_identifier }}.middlewares={{ middlewares | join(',') }} | |||||
| {% endif %} | |||||
| traefik.http.routers.{{ livekit_server_identifier }}.entrypoints={{ livekit_server_container_labels_traefik_entrypoints }} | |||||
| traefik.http.routers.{{ livekit_server_identifier }}.tls={{ livekit_server_container_labels_traefik_tls | to_json }} | |||||
| {% if livekit_server_container_labels_traefik_tls %} | |||||
| traefik.http.routers.{{ livekit_server_identifier }}.tls.certResolver={{ livekit_server_container_labels_traefik_tls_certResolver }} | |||||
| {% endif %} | |||||
| {% endif %} | |||||
| {{ livekit_server_container_labels_additional_labels }} | |||||
| @@ -1,55 +0,0 @@ | |||||
| #jinja2: lstrip_blocks: "True" | |||||
| [Unit] | |||||
| Description=LiveKit Server | |||||
| {% for service in livekit_server_systemd_required_services_list %} | |||||
| After={{ service }} | |||||
| Requires={{ service }} | |||||
| {% endfor %} | |||||
| [Service] | |||||
| Type=simple | |||||
| Environment="HOME={{ devture_systemd_docker_base_systemd_unit_home_path }}" | |||||
| ExecStartPre=-{{ devture_systemd_docker_base_host_command_sh }} -c '{{ devture_systemd_docker_base_host_command_docker }} stop --time={{ devture_systemd_docker_base_container_stop_grace_time_seconds }} {{ livekit_server_identifier }} 2>/dev/null || true' | |||||
| ExecStartPre=-{{ devture_systemd_docker_base_host_command_sh }} -c '{{ devture_systemd_docker_base_host_command_docker }} rm {{ livekit_server_identifier }} 2>/dev/null || true' | |||||
| ExecStartPre={{ devture_systemd_docker_base_host_command_docker }} create \ | |||||
| --rm \ | |||||
| --name={{ livekit_server_identifier }} \ | |||||
| --log-driver=none \ | |||||
| --user={{ livekit_server_uid }}:{{ livekit_server_gid }} \ | |||||
| --cap-drop=ALL \ | |||||
| --network={{ livekit_server_container_network }} \ | |||||
| {% if livekit_server_container_rtc_listen_interface is not in [none, 'none'] %} | |||||
| -p {{ livekit_server_container_rtc_listen_interface }}{{ ':' if livekit_server_container_rtc_listen_interface else '' }}{{ livekit_server_config_rtc_tcp_port }}:{{ livekit_server_config_rtc_tcp_port }} \ | |||||
| {% endif %} | |||||
| {% if livekit_server_container_rtc_listen_interface is not in [none, 'none'] and livekit_server_config_rtc_port_range_start and livekit_server_config_rtc_port_range_end %} | |||||
| -p {{ livekit_server_container_rtc_listen_interface }}{{ ':' if livekit_server_container_rtc_listen_interface else '' }}{{ livekit_server_config_rtc_port_range_start }}-{{ livekit_server_config_rtc_port_range_end }}:{{ livekit_server_config_rtc_port_range_start }}-{{ livekit_server_config_rtc_port_range_end }}/udp \ | |||||
| {% endif %} | |||||
| {% if livekit_server_container_rtc_listen_interface is not in [none, 'none'] and livekit_server_config_rtc_udp_port %} | |||||
| -p {{ livekit_server_container_rtc_listen_interface }}{{ ':' if livekit_server_container_rtc_listen_interface else '' }}{{ livekit_server_config_rtc_udp_port }}:{{ livekit_server_config_rtc_udp_port }}/udp \ | |||||
| {% endif %} | |||||
| {% if livekit_server_container_turn_listen_interface is not in [none, 'none'] and livekit_server_config_turn_enabled %} | |||||
| -p {{ livekit_server_container_turn_listen_interface }}{{ ':' if livekit_server_container_turn_listen_interface else '' }}{{ livekit_server_config_turn_tls_port }}:{{ livekit_server_config_turn_tls_port }} \ | |||||
| {% endif %} | |||||
| {% if livekit_server_container_turn_listen_interface is not in [none, 'none'] and livekit_server_config_turn_enabled %} | |||||
| -p {{ livekit_server_container_turn_listen_interface }}{{ ':' if livekit_server_container_turn_listen_interface else '' }}{{ livekit_server_config_turn_udp_port }}:{{ livekit_server_config_turn_udp_port }} \ | |||||
| {% endif %} | |||||
| --mount type=bind,src={{ livekit_server_config_path }}/config.yaml,dst=/livekit-config.yaml,ro \ | |||||
| --label-file={{ livekit_server_base_path }}/labels \ | |||||
| {{ livekit_server_container_image }} \ | |||||
| --dev --config /livekit-config.yaml | |||||
| {% for network in livekit_server_container_additional_networks %} | |||||
| ExecStartPre={{ devture_systemd_docker_base_host_command_docker }} network connect {{ network }} {{ livekit_server_identifier }} | |||||
| {% endfor %} | |||||
| ExecStart={{ devture_systemd_docker_base_host_command_docker }} start --attach {{ livekit_server_identifier }} | |||||
| ExecStop=-{{ devture_systemd_docker_base_host_command_sh }} -c '{{ devture_systemd_docker_base_host_command_docker }} stop --time={{ devture_systemd_docker_base_container_stop_grace_time_seconds }} {{ livekit_server_identifier }} 2>/dev/null || true' | |||||
| ExecStop=-{{ devture_systemd_docker_base_host_command_sh }} -c '{{ devture_systemd_docker_base_host_command_docker }} rm {{ livekit_server_identifier }} 2>/dev/null || true' | |||||
| Restart=always | |||||
| RestartSec=30 | |||||
| SyslogIdentifier={{ livekit_server_identifier }} | |||||
| [Install] | |||||
| WantedBy=multi-user.target | |||||
| @@ -1,5 +0,0 @@ | |||||
| SPDX-FileCopyrightText: 2022 MDAD project contributors | |||||
| SPDX-FileCopyrightText: 2024 wjbeckett | |||||
| SPDX-FileCopyrightText: 2024 Slavi Pantaleev | |||||
| SPDX-License-Identifier: AGPL-3.0-or-later | |||||
| @@ -1,8 +0,0 @@ | |||||
| # SPDX-FileCopyrightText: 2024 Slavi Pantaleev | |||||
| # | |||||
| # SPDX-License-Identifier: AGPL-3.0-or-later | |||||
| --- | |||||
| livekit_server_public_url: "{{ livekit_server_scheme }}://{{ livekit_server_hostname }}{{ livekit_server_path_prefix }}" | |||||
| livekit_server_websocket_public_url: "{{ 'wss' if livekit_server_scheme == 'https' else 'ws' }}://{{ livekit_server_hostname }}{{ livekit_server_path_prefix }}" | |||||
| @@ -132,8 +132,9 @@ | |||||
| - custom/matrix-coturn | - custom/matrix-coturn | ||||
| - custom/matrix-media-repo | - custom/matrix-media-repo | ||||
| - custom/matrix-pantalaimon | - custom/matrix-pantalaimon | ||||
| - custom/matrix-element-call | - custom/matrix-element-call | ||||
| - custom/matrix-livekit-server | |||||
| - galaxy/livekit_server | |||||
| - custom/matrix-livekit-jwt-service | - custom/matrix-livekit-jwt-service | ||||
| - role: galaxy/postgres_backup | - role: galaxy/postgres_backup | ||||