From 46cd4ad77b367775013a1579d8e1a11b17ed0fc2 Mon Sep 17 00:00:00 2001 From: Gnieark Date: Wed, 31 Jul 2019 11:24:03 +0200 Subject: [PATCH] loolwsd --- README.md | 66 +++++++++++++++++++++ defaults/main.yml | 2 + handlers/main.yml | 4 ++ tasks/main.yml | 34 +++++++++++ templates/loolwsd.xml | 134 ++++++++++++++++++++++++++++++++++++++++++ 5 files changed, 240 insertions(+) create mode 100644 README.md create mode 100644 defaults/main.yml create mode 100644 handlers/main.yml create mode 100644 tasks/main.yml create mode 100644 templates/loolwsd.xml diff --git a/README.md b/README.md new file mode 100644 index 0000000..b816961 --- /dev/null +++ b/README.md @@ -0,0 +1,66 @@ +# Collabora online ansible role + +For integration on Nextcloud + +Works on debian 9 + +WARNING, I don't use SSL, because in my case, loolswd is on a private LAN, behind a reverse proxy (an other VM) witch uses HTTPS. + +On defaults/mail.yml change the value by your own Nextcloud TLD. + + +Here the a sample of the reverse proxy configuration for the vhost collabora.domaine.com. +With +* 192.168.100.16 collabora server local IP +* collabora.domaine.com the subdomain pointing on the reverse proxy + + server { + + server_name collabora.domaine.com; + + location / { + include proxy_params; + proxy_pass http://192.168.100.16:9980; + } + + listen [::]:443 ssl; + listen 443 ssl; + ssl_certificate /etc/letsencrypt/live/collabora.domaine.com/fullchain.pem; + ssl_certificate_key /etc/letsencrypt/live/collabora.domaine.com/privkey.pem; + include /etc/letsencrypt/options-ssl-nginx.conf; + ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem; + + # static files + location ^~ /loleaflet { + proxy_pass http://192.168.100.16:9980; + proxy_set_header Host $http_host; + } + # WOPI discovery URL + location ^~ /hosting/discovery { + proxy_pass http://192.168.100.16:9980; + proxy_set_header Host $http_host; + } + # main websocket + location ~ ^/lool/(.*)/ws$ { + proxy_pass http://192.168.100.16:9980; + proxy_set_header Upgrade $http_upgrade; + proxy_set_header Connection "Upgrade"; + proxy_set_header Host $http_host; + proxy_read_timeout 36000s; + } + # download, presentation and image upload + location ~ ^/lool { + proxy_pass http://192.168.100.16:9980; + proxy_set_header Host $http_host; + } + # Admin Console websocket + location ^~ /lool/adminws { + proxy_pass http://192.168.100.16:9980; + proxy_set_header Upgrade $http_upgrade; + proxy_set_header Connection "Upgrade"; + proxy_set_header Host $http_host; + proxy_read_timeout 36000s; + } + + + } diff --git a/defaults/main.yml b/defaults/main.yml new file mode 100644 index 0000000..56d8319 --- /dev/null +++ b/defaults/main.yml @@ -0,0 +1,2 @@ +--- +backend_storage_allowed: cloud\.tinad\.fr diff --git a/handlers/main.yml b/handlers/main.yml new file mode 100644 index 0000000..3300b2b --- /dev/null +++ b/handlers/main.yml @@ -0,0 +1,4 @@ +--- +- name: reload apt cache + apt: + update_cache: yes \ No newline at end of file diff --git a/tasks/main.yml b/tasks/main.yml new file mode 100644 index 0000000..04b363d --- /dev/null +++ b/tasks/main.yml @@ -0,0 +1,34 @@ +--- +- name: install needed packages + apt: + name: ['apt-transport-https','dirmngr','python-openssl','openssl'] + state: latest + +- name: Add apt key for collabora online repos + apt_key: + keyserver: keyserver.ubuntu.com + id: 0C54D189F4BA284D + +- name: "add collabora repo" + apt_repository: + repo: deb https://www.collaboraoffice.com/repos/CollaboraOnline/CODE-debian9 ./ + state: present + notify: reload apt cache + +- name: install Collabora Online Packages + apt: + name: ['loolwsd','code-brand'] + state: latest + + +- name: Set loolwsd config + template: + src: templates/loolwsd.xml + dest: /etc/loolwsd/loolwsd.xml + register: configloolwsd + +- name: Restart loolwsd + service: + name: loolwsd + state: restarted + when: configloolwsd.changed \ No newline at end of file diff --git a/templates/loolwsd.xml b/templates/loolwsd.xml new file mode 100644 index 0000000..b258633 --- /dev/null +++ b/templates/loolwsd.xml @@ -0,0 +1,134 @@ + + + + + + de_DE en_GB en_US es_ES fr_FR it nl pt_BR pt_PT ru + + + + + + + + + + + 1 + + 4 + true + 3600 + + 30 + 300 + 0 + 0 + 8000 + 0 + 0 + 100 + + + + 60 + 900 + + + loleaflet.html + + + true + warning + + /var/log/loolwsd.log + never + timestamp + true + 10 days + 10 + true + false + + + false + false + + + + false + + + + + + + + false + + + + + all + any + + + 192\.168\.[0-9]{1,3}\.[0-9]{1,3} + ::ffff:192\.168\.[0-9]{1,3}\.[0-9]{1,3} + 127\.0\.0\.1 + ::ffff:127\.0\.0\.1 + ::1 + + + + + false + true + /etc/loolwsd/cert.pem + /etc/loolwsd/key.pem + /etc/loolwsd/ca-chain.cert.pem + + + 1000 + + + + + + + + + true + true + + + + + + {{ backend_storage_allowed }} + 10\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3} + 172\.1[6789]\.[0-9]{1,3}\.[0-9]{1,3} + 172\.2[0-9]\.[0-9]{1,3}\.[0-9]{1,3} + 172\.3[01]\.[0-9]{1,3}\.[0-9]{1,3} + 192\.168\.[0-9]{1,3}\.[0-9]{1,3} + 192\.168\.1\.1 + 0 + + + {{ backend_storage_allowed }} + + + + true + + + true + false + + + + + + + +