Different optimations for collabora

This commit is contained in:
Kevin Veen-Birkenbach 2025-08-20 08:34:12 +02:00
parent 3e5344a46c
commit 9cfb8f3a60
No known key found for this signature in database
GPG Key ID: 44D8F11FD62F878E
8 changed files with 42 additions and 12 deletions

View File

@ -10,6 +10,7 @@ server:
font-src: font-src:
- "data:" - "data:"
connect-src: connect-src:
- "wss://collabora.{{ PRIMARY_DOMAIN }}"
- "{{ WEB_PROTOCOL }}://collabora.{{ PRIMARY_DOMAIN }}" - "{{ WEB_PROTOCOL }}://collabora.{{ PRIMARY_DOMAIN }}"
frame-src: frame-src:
- "{{ WEB_PROTOCOL }}://collabora.{{ PRIMARY_DOMAIN }}" - "{{ WEB_PROTOCOL }}://collabora.{{ PRIMARY_DOMAIN }}"

View File

@ -5,8 +5,9 @@
vars: vars:
flush_handlers: true flush_handlers: true
when: when:
- run_once_web_svc_collabora is not defined - run_once_web_svc_collabora is not defined
- NEXTCLOUD_COLLABORA_ENABLED - NEXTCLOUD_COLLABORA_ENABLED | bool
- name: "include role for {{ application_id }} to receive certs & do modification routines" - name: "include role for {{ application_id }} to receive certs & do modification routines"
include_role: include_role:
@ -59,7 +60,6 @@
- name: Load system configuration steps - name: Load system configuration steps
include_tasks: "{{ item }}" include_tasks: "{{ item }}"
loop: loop:
- 02_upgrade.yml
- 03_admin.yml - 03_admin.yml
- 04_system_config.yml - 04_system_config.yml

View File

@ -3,4 +3,7 @@
- name: Set Nextcloud LDAP bind password - name: Set Nextcloud LDAP bind password
command: > command: >
{{ NEXTCLOUD_DOCKER_EXEC_OCC }} ldap:set-config s01 ldapAgentPassword "{{ ldap.bind_credential }}" {{ NEXTCLOUD_DOCKER_EXEC_OCC }} ldap:set-config s01 ldapAgentPassword "{{ ldap.bind_credential }}"
async: "{{ ASYNC_TIME if ASYNC_ENABLED | bool else omit }}"
poll: "{{ ASYNC_POLL if ASYNC_ENABLED | bool else omit }}"
no_log: "{{ MASK_CREDENTIALS_IN_LOGS | bool }}"

View File

@ -68,4 +68,5 @@ nextcloud_docker_include_instructions_file: "/tmp/includes.php"
## Execution ## Execution
NEXTCLOUD_DOCKER_EXEC: "docker exec -u {{ NEXTCLOUD_DOCKER_USER }} {{ NEXTCLOUD_CONTAINER }}" # General execute composition NEXTCLOUD_DOCKER_EXEC: "docker exec -u {{ NEXTCLOUD_DOCKER_USER }} {{ NEXTCLOUD_CONTAINER }}" # General execute composition
NEXTCLOUD_DOCKER_EXEC_OCC: "{{NEXTCLOUD_DOCKER_EXEC}} {{ NEXTCLOUD_DOCKER_WORK_DIRECTORY }}occ" # Execute docker occ command NEXTCLOUD_DOCKER_EXEC_OCC: "{{NEXTCLOUD_DOCKER_EXEC}} {{ NEXTCLOUD_DOCKER_WORK_DIRECTORY }}occ" # Execute docker occ command
# NEXTCLOUD_COLLOBORA_CONF_EXEC: "docker exec {{ applications | get_app_conf('web-svc-collabora', 'docker.services.collabora.name') }} coolconfig"

View File

@ -0,0 +1,20 @@
- name: Update Collabora systemplate to include new fonts
command: "{{ COLLABORA_DOCKER_CONF_EXEC }} update-system-template"
register: collabora_fonts
changed_when: >
(not ASYNC_ENABLED | bool )
and
('updated' in (collabora_fonts.stdout | default('')))
async: "{{ ASYNC_TIME if (ASYNC_ENABLED | default(false) | bool) else omit }}"
poll: "{{ ASYNC_POLL if (ASYNC_ENABLED | default(false) | bool) else omit }}"
when: MODE_UPDATE | bool
- name: Allow Nextcloud host IP for Collabora preview conversion
command: "{{ COLLABORA_DOCKER_CONF_EXEC }} set net.post_allow.host {{ networks.internet.ip4 }}"
register: collabora_preview
changed_when: >
(not ASYNC_ENABLED | bool )
and
('already present' not in (collabora_preview.stdout | default('')))
async: "{{ ASYNC_TIME if ASYNC_ENABLED | bool else omit }}"
poll: "{{ ASYNC_POLL if ASYNC_ENABLED | bool else omit }}"

View File

@ -2,5 +2,9 @@
- name: "load docker, proxy for '{{ application_id }}'" - name: "load docker, proxy for '{{ application_id }}'"
include_role: include_role:
name: cmp-docker-proxy name: cmp-docker-proxy
vars:
docker_compose_flush_handlers: true
- name: "Load core functions for '{{ application_id }}'"
include_tasks: 01_core.yml
- include_tasks: utils/run_once.yml - include_tasks: utils/run_once.yml
when: run_once_web_svc_collabora is not defined when: run_once_web_svc_collabora is not defined

View File

@ -1,4 +1,2 @@
domain={{ (domains | get_domain('web-app-nextcloud')) | regex_replace('\\.', '\\\\.') }} domain={{ COLLABORA_ALLOWED_DOMAINS }}
{# username=admin #} extra_params=--o:ssl.enable=false --o:ssl.termination=true --o:net.service_root=/ --o:net.wopi_allowed_hosts={{ COLLABORA_ALLOWED_HOSTS }}
{# password={{ applications | get_app_conf('web-svc-collabora', 'credentials.admin_password', False, 'ChangeMe!') }}" #}
extra_params=--o:ssl.enable=false --o:ssl.termination=true

View File

@ -6,6 +6,9 @@ container_port: 9980
container_healthcheck: "/hosting/discovery" container_healthcheck: "/hosting/discovery"
# Collabora # Collabora
COLLABORA_CONTAINER: "{{ applications | get_app_conf(application_id, 'docker.services.collabora.name') }}" COLLABORA_CONTAINER: "{{ applications | get_app_conf(application_id, 'docker.services.collabora.name') }}"
COLLABORA_IMAGE: "{{ applications | get_app_conf(application_id, 'docker.services.collabora.image') }}" COLLABORA_IMAGE: "{{ applications | get_app_conf(application_id, 'docker.services.collabora.image') }}"
COLLABORA_VERSION: "{{ applications | get_app_conf(application_id, 'docker.services.collabora.version') }}" COLLABORA_VERSION: "{{ applications | get_app_conf(application_id, 'docker.services.collabora.version') }}"
COLLABORA_DOCKER_CONF_EXEC: "docker exec {{ COLLABORA_CONTAINER }} coolconfig"
COLLABORA_ALLOWED_DOMAINS: "(.*\\.|){{ PRIMARY_DOMAIN | regex_replace('\\.', '\\\\.') }}"
COLLABORA_ALLOWED_HOSTS: "{{ domains | get_domain('web-app-nextcloud') }}"