From dd81fe999880aea542e8f6dfbd17d224eae3dbe3 Mon Sep 17 00:00:00 2001 From: Chris Date: Mon, 7 Dec 2020 21:55:23 +0000 Subject: [PATCH] Install Collabora --- Vagrantfile | 17 +++++++------- docker-compose.yml | 27 +++++++++++++++++++++ nextcloud/db.env | 3 --- nginx.conf | 58 ++++++++++++++++++++++++++++++++++++++++++++++ 4 files changed, 94 insertions(+), 11 deletions(-) delete mode 100644 nextcloud/db.env diff --git a/Vagrantfile b/Vagrantfile index bcbc93d..af1c163 100644 --- a/Vagrantfile +++ b/Vagrantfile @@ -50,14 +50,15 @@ Vagrant.configure("2") do |config| # backing providers for Vagrant. These expose provider-specific options. # Example for VirtualBox: # - # config.vm.provider "virtualbox" do |vb| - # # Display the VirtualBox GUI when booting the machine - # vb.gui = true - # - # # Customize the amount of memory on the VM: - # vb.memory = "1024" - # end - # + config.vm.provider "virtualbox" do |vb| + # Display the VirtualBox GUI when booting the machine + # vb.gui = true + + # Customize the amount of memory on the VM: + vb.memory = 4096 + vb.cpus = 2 + end + # View the documentation for the provider you are using for more # information on available options. diff --git a/docker-compose.yml b/docker-compose.yml index dc36058..7ebf80e 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -66,6 +66,32 @@ services: - db - redis - nginx + extra_hosts: + - "tower.scarif.local:${LOCAL_IP}" + - "office.scarif.local:${LOCAL_IP}" + + collabora: + image: collabora/code + restart: always + cap_add: + - MKNOD + volumes: + - /etc/timezone:/etc/timezone:ro + - /etc/localtime:/etc/localtime:ro + environment: + - DONT_GEN_SSL_CERT="True" + - domain=tower.${DOMAIN} + - cert_domain=office.${DOMAIN} + - server_name=office.${DOMAIN} + - username=${COLLABORA_USER} + - password=${COLLABORA_PASSWORD} + - "extra_params=-o:ssl.enable=false --o:ssl.termination=true" + - "dictionaries=de_DE en_GB en_US es_ES fr_FR it nl pt_BR pt_PT ru ro" + networks: + - nginx + extra_hosts: + - "tower.scarif.local:${LOCAL_IP}" + - "office.scarif.local:${LOCAL_IP}" gitea: image: gitea/gitea:1 @@ -130,6 +156,7 @@ services: - monica - nextcloud - gitea + - collabora - certs ports: - 80:80 diff --git a/nextcloud/db.env b/nextcloud/db.env deleted file mode 100644 index b99a181..0000000 --- a/nextcloud/db.env +++ /dev/null @@ -1,3 +0,0 @@ -MYSQL_PASSWORD=secret -MYSQL_DATABASE=nextcloud -MYSQL_USER=chris diff --git a/nginx.conf b/nginx.conf index c8a4b4a..4d8bb40 100644 --- a/nginx.conf +++ b/nginx.conf @@ -340,6 +340,64 @@ http { } } + upstream collabora-handler { + server collabora:9980; + } + + server { + listen 443 ssl; + server_name office.scarif.local; + + ssl_certificate /etc/nginx/certs/scarif.local.crt; + ssl_certificate_key /etc/nginx/certs/scarif.local.key; + + # static files + location ^~ /loleaflet { + proxy_pass http://collabora-handler; + proxy_set_header Host $http_host; + } + + # WOPI discovery URL + location ^~ /hosting/discovery { + proxy_pass http://collabora-handler; + proxy_set_header Host $http_host; + } + + # Capabilities + location ^~ /hosting/capabilities { + proxy_pass http://collabora-handler; + proxy_set_header Host $http_host; + } + + # main websocket + location ~ ^/lool/(.*)/ws$ { + proxy_pass http://collabora-handler; + 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://collabora-handler; + proxy_set_header Host $http_host; + } + + # Admin Console websocket + location ^~ /lool/adminws { + proxy_pass http://collabora-handler; + proxy_set_header Upgrade $http_upgrade; + proxy_set_header Connection "Upgrade"; + proxy_set_header Host $http_host; + proxy_read_timeout 36000s; + } + + location / { + proxy_pass http://collabora-handler; + } + } + upstream gitea-handler { server gitea:3000; }