diff --git a/deployments/examples/ocis_wopiserver/.env b/deployments/examples/ocis_wopi/.env similarity index 98% rename from deployments/examples/ocis_wopiserver/.env rename to deployments/examples/ocis_wopi/.env index 17c3e3ba9..0bc2f4acd 100644 --- a/deployments/examples/ocis_wopiserver/.env +++ b/deployments/examples/ocis_wopi/.env @@ -28,7 +28,7 @@ OCIS_JWT_SECRET= # oCIS Wopi server version. Defaults to "latest" OCIS_WOPISERVER_DOCKER_TAG=custom # cs3org wopi server version. Defaults to "latest" -WOPISERVER_DOCKER_TAG= +CS3ORG_WOPISERVER_DOCKER_TAG= # cs3org wopi server domain. Defaults to "wopiserver.owncloud.test" WOPISERVER_DOMAIN= # JWT secret which is used for the documents to be request by the Wopi client from the cs3org Wopi server. Must be change in order to have a secure Wopi server. Defaults to "Pive-Fumkiu4" diff --git a/deployments/examples/ocis_wopiserver/README.md b/deployments/examples/ocis_wopi/README.md similarity index 55% rename from deployments/examples/ocis_wopiserver/README.md rename to deployments/examples/ocis_wopi/README.md index ba85d13df..adfbf2a75 100644 --- a/deployments/examples/ocis_wopiserver/README.md +++ b/deployments/examples/ocis_wopi/README.md @@ -1,6 +1,6 @@ --- -document this deployment example in: docs/ocis/deployment/ocis_traefik.md +document this deployment example in: docs/ocis/deployment/ocis_wopi.md --- -Please refer to [our documentation](https://owncloud.dev/ocis/deployment/ocis_traefik/) +Please refer to [our documentation](https://owncloud.dev/ocis/deployment/ocis_wopi/) for instructions on how to deploy this scenario. diff --git a/deployments/examples/ocis_wopiserver/config/ocis/config.dist.json b/deployments/examples/ocis_wopi/config/ocis/config.dist.json similarity index 95% rename from deployments/examples/ocis_wopiserver/config/ocis/config.dist.json rename to deployments/examples/ocis_wopi/config/ocis/config.dist.json index c6db833fe..6a1a58d82 100644 --- a/deployments/examples/ocis_wopiserver/config/ocis/config.dist.json +++ b/deployments/examples/ocis_wopi/config/ocis/config.dist.json @@ -22,7 +22,7 @@ "path": "/accounts.js" }, { - "id": "wopiserver", + "id": "wopi", "path": "/wopi.js" } ], diff --git a/deployments/examples/ocis_wopiserver/config/ocis/entrypoint-override.sh b/deployments/examples/ocis_wopi/config/ocis/entrypoint-override.sh similarity index 100% rename from deployments/examples/ocis_wopiserver/config/ocis/entrypoint-override.sh rename to deployments/examples/ocis_wopi/config/ocis/entrypoint-override.sh diff --git a/deployments/examples/ocis_wopiserver/config/ocis/proxy-config.json b/deployments/examples/ocis_wopi/config/ocis/proxy-config.json similarity index 100% rename from deployments/examples/ocis_wopiserver/config/ocis/proxy-config.json rename to deployments/examples/ocis_wopi/config/ocis/proxy-config.json diff --git a/deployments/examples/ocis_wopiserver/config/wopiserver/entrypoint-override.sh b/deployments/examples/ocis_wopi/config/wopiserver/entrypoint-override.sh similarity index 100% rename from deployments/examples/ocis_wopiserver/config/wopiserver/entrypoint-override.sh rename to deployments/examples/ocis_wopi/config/wopiserver/entrypoint-override.sh diff --git a/deployments/examples/ocis_wopiserver/config/wopiserver/wopiserver.conf.dist b/deployments/examples/ocis_wopi/config/wopiserver/wopiserver.conf.dist similarity index 100% rename from deployments/examples/ocis_wopiserver/config/wopiserver/wopiserver.conf.dist rename to deployments/examples/ocis_wopi/config/wopiserver/wopiserver.conf.dist diff --git a/deployments/examples/ocis_wopiserver/docker-compose.yml b/deployments/examples/ocis_wopi/docker-compose.yml similarity index 99% rename from deployments/examples/ocis_wopiserver/docker-compose.yml rename to deployments/examples/ocis_wopi/docker-compose.yml index b8ee174dc..9d381ca30 100644 --- a/deployments/examples/ocis_wopiserver/docker-compose.yml +++ b/deployments/examples/ocis_wopi/docker-compose.yml @@ -100,7 +100,7 @@ services: restart: always wopiserver: - image: cs3org/wopiserver:${WOPISERVER_DOCKER_TAG:-latest} + image: cs3org/wopiserver:${CS3ORG_WOPISERVER_DOCKER_TAG:-latest} networks: ocis-net: entrypoint: diff --git a/deployments/examples/ocis_wopiserver/monitoring_tracing/docker-compose-additions.yml b/deployments/examples/ocis_wopi/monitoring_tracing/docker-compose-additions.yml similarity index 100% rename from deployments/examples/ocis_wopiserver/monitoring_tracing/docker-compose-additions.yml rename to deployments/examples/ocis_wopi/monitoring_tracing/docker-compose-additions.yml diff --git a/docs/ocis/deployment/_index.md b/docs/ocis/deployment/_index.md index 3383c8a77..8ba2edfb3 100644 --- a/docs/ocis/deployment/_index.md +++ b/docs/ocis/deployment/_index.md @@ -19,6 +19,7 @@ oCIS deployments are super simple, yet there are many configurations possible fo - [Basic oCIS setup]({{< ref "basic-remote-setup" >}}) - configure domain, certificates and port - [oCIS setup with Traefik for SSL termination]({{< ref "ocis_traefik" >}}) - [oCIS setup with Keycloak as identity provider]({{< ref "ocis_keycloak" >}}) +- [oCIS setup with WOPI server to open office documents in your browser]({{< ref "ocis_wopi" >}}) ### Migrate an existing ownCloud 10 You can run ownCloud 10 and oCIS together. This allows you to use new parts of oCIS already with ownCloud 10 and also to have a smooth transition for users from ownCloud 10 to oCIS. diff --git a/docs/ocis/deployment/ocis_wopi.md b/docs/ocis/deployment/ocis_wopi.md new file mode 100644 index 000000000..678729f01 --- /dev/null +++ b/docs/ocis/deployment/ocis_wopi.md @@ -0,0 +1,157 @@ +--- +title: "oCIS with WOPI server" +date: 2020-10-12T14:04:00+01:00 +weight: 24 +geekdocRepo: https://github.com/owncloud/ocis +geekdocEditPath: edit/master/docs/ocis/deployment +geekdocFilePath: ocis_wopi.md +--- + +{{< toc >}} + +## Overview + +* oCIS, Wopi server and Collabora running behind Traefik as reverse proxy +* Collabora enables you to edit text documents in your browser +* Wopi server acts as a bridge to make the oCIS storage accessible to Collabora +* Traefik generating self signed certificates for local setup or obtaining valid SSL certificates for a server setup + +[Find this example on GitHub](https://github.com/owncloud/ocis/tree/master/deployments/examples/ocis_wopi) + +The docker stack consists 5 containers. One of them is Traefik, a proxy which is terminating SSL and forwards the requests to oCIS in the internal docker network. + +The next container is oCIS itself in a configuration like the [oCIS with Traefik example]({{< ref "ocis_traefik" >}}), except that for this example a custom proxy and web UI configuration is used to enable the oCIS Wopi extension. + +The oCIS WOPI server extension is running in another container and enables you to open files in Collabora from within ownCloud Web. + +The last two containers are the WOPI server and Collabora. + +## Server Deployment + +### Requirements + +* Linux server with docker and docker-compose installed +* Three domains set up and pointing to your server + - ocis.* for serving oCIS + - collabora.* for serving Collabora + - wopiserver.* for serving the WOPI server + - traefik.* for serving the Traefik dashboard + +See also [example server setup]({{< ref "preparing_server" >}}) + + +### Install oCIS and Traefik + +* Clone oCIS repository + + `git clone https://github.com/owncloud/ocis.git` + +* Go to the deployment example + + `cd ocis/deployment/examples/ocis_wopi + +* Open the `.env` file in a text editor + The file by default looks like this: + ```bash + # If you're on a internet facing server please comment out following line. + # It skips certificate validation for various parts of oCIS and is needed if you use self signed certificates. + INSECURE=true + + ### Traefik settings ### + # Serve Treafik dashboard. Defaults to "false". + TRAEFIK_DASHBOARD= + # Domain of Traefik, where you can find the dashboard. Defaults to "traefik.owncloud.test" + TRAEFIK_DOMAIN= + # Basic authentication for the dashboard. Defaults to user "admin" and password "admin" + TRAEFIK_BASIC_AUTH_USERS= + # Email address for obtaining LetsEncrypt certificates, needs only be changed if this is a public facing server + TRAEFIK_ACME_MAIL= + + ### oCIS settings ### + # oCIS version. Defaults to "latest" + OCIS_DOCKER_TAG= + # Domain of oCIS, where you can find the frontend. Defaults to "ocis.owncloud.test" + OCIS_DOMAIN= + # IDP LDAP bind password. Must be changed in order to have a secure oCIS. Defaults to "idp". + IDP_LDAP_BIND_PASSWORD= + # Storage LDAP bind password. Must be changed in order to have a secure oCIS. Defaults to "reva". + STORAGE_LDAP_BIND_PASSWORD= + # JWT secret which is used for the storage provider. Must be changed in order to have a secure oCIS. Defaults to "Pive-Fumkiu4" + OCIS_JWT_SECRET= + + ### Wopi server settings ### + # oCIS Wopi server version. Defaults to "latest" + OCIS_WOPISERVER_DOCKER_TAG=custom + # cs3org wopi server version. Defaults to "latest" + CS3ORG_WOPISERVER_DOCKER_TAG= + # cs3org wopi server domain. Defaults to "wopiserver.owncloud.test" + WOPISERVER_DOMAIN= + # JWT secret which is used for the documents to be request by the Wopi client from the cs3org Wopi server. Must be change in order to have a secure Wopi server. Defaults to "Pive-Fumkiu4" + WOPI_JWT_SECRET= + + ### Collabora settings ### + # Domain of Collabora, where you can find the frontend. Defaults to "collabora.owncloud.test" + COLLABORA_DOMAIN= + # Admin user for Collabora. Defaults to blank, provide one to enable access + COLLABORA_ADMIN_USER= + # Admin password for COllabora. Defaults to blank, provide one to enable access + COLLABORA_ADMIN_PASSWORD= + + ``` + + You are installing oCIS on a server and Traefik will obtain valid certificates for you so please remove `INSECURE=true` or set it to `false`. + + If you want to use the Traefik dashboard, set TRAEFIK_DASHBOARD to `true` (default is `false` and therefore not active). If you activate it, you must set a domain for the Traefik dashboard in `TRAEFIK_DOMAIN=` eg. `TRAEFIK_DOMAIN=traefik.owncloud.test`. + + The Traefik dashboard is secured by basic auth. Default credentials are the user `admin` with the password `admin`. To set your own credentials, generate a htpasswd (eg. by using [an online tool](https://htpasswdgenerator.de/) or a cli tool). + + Traefik will issue certificates with LetsEncrypt and therefore you must set an email address in `TRAEFIK_ACME_MAIL=`. + + By default oCIS will be started in the `latest` version. If you want to start a specific version of oCIS set the version to `OCIS_DOCKER_TAG=`. Available versions can be found on [Docker Hub](https://hub.docker.com/r/owncloud/ocis/tags?page=1&ordering=last_updated). + + Set your domain for the oCIS frontend in `OCIS_DOMAIN=`, eg. `OCIS_DOMAIN=ocis.owncloud.test`. + + If you want to change the OIDC client id of th ownCloud Web frontend, you can do this by setting the name to `OCIS_OIDC_CLIENT_ID=`. + + You also must override three default secrets in `IDP_LDAP_BIND_PASSWORD`, `STORAGE_LDAP_BIND_PASSWORD` and `OCIS_JWT_SECRET` in order to secure your oCIS instance. Choose some random strings eg. from the output of `openssl rand -base64 32`. For more information see [secure an oCIS instance]({{< ref "./#secure-an-ocis-instance" >}}). + + By default the oCIS WOPI server extension will be started in the `latest` version. If you want to start a specific version of oCIS WOPI server set the version to `OCIS_WOPISERVER_DOCKER_TAG=`. Available versions can be found on [Docker Hub](https://hub.docker.com/r/owncloud/ocis-wopiserver/tags?page=1&ordering=last_updated). + + By default the CS3Org WOPI server will also be started in the `latest` version. If you want to start a specific version of it, you can set the version to `CS3ORG_WOPISERVER_DOCKER_TAG=`. Available versions can be found on [Docker Hub](https://hub.docker.com/r/cs3org/wopiserver/tags?page=1&ordering=last_updated). + + Set your domain for the CS3Org WOPI server in `WOPISERVER_DOMAIN=`, where Collabora can download the files. + + You also must override the default WOPI JWT secret, in order to have a secure setup. Do this by setting `WOPI_JWT_SECRET` to a long and random string. + + Now it's time to set up Collabora and you need to configure the Domain of Collabora in `COLLABORA_DOMAIN=`. + + If you want to use the Collabora admin panel you need to set user name and passwort for in `COLLABORA_ADMIN_USER=` and `COLLABORA_ADMIN_PASSWORD=`. + + Now you have configured everything and can save the file. + +* Start the docker stack + + `docker-compose up -d` + +* You now can visit oCIS and are able to open an office document in your browser. + +## Local setup +For a more simple local ocis setup see [Getting started]({{< ref "../getting-started" >}}) + +This docker stack can also be run locally. One downside is that Traefik can not obtain valid SSL certificates and therefore will create self signed ones. This means that your browser will show scary warnings. Another downside is that you can not point DNS entries to your localhost. So you have to add static host entries to your computer. + +On Linux and macOS you can add them to your `/etc/hosts` files like this: +``` +127.0.0.1 ocis.owncloud.test +127.0.0.1 traefik.owncloud.test +127.0.0.1 collabora.owncloud.test +127.0.0.1 wopiserver.owncloud.test +``` + +After that you're ready to start the application stack: + +`docker-compose up -d` + +Open https://collabora.owncloud.test and https://wopisever.owncloud.test in your browser and accept the invalid certificate warning. + +Open https://ocis.owncloud.test in your browser and accept the invalid certificate warning. You are now able to open an office document in your browser. diff --git a/proxy/pkg/proxy/proxy.go b/proxy/pkg/proxy/proxy.go index f064cad88..fa5fe5ea2 100644 --- a/proxy/pkg/proxy/proxy.go +++ b/proxy/pkg/proxy/proxy.go @@ -352,22 +352,6 @@ func defaultPolicies() []config.Policy { Endpoint: "/onlyoffice.js", Backend: "http://localhost:9220", }, - { - Endpoint: "/api/v0/wopi/open", - Backend: "http://ocis-wopiserver:9105", - }, - { - Endpoint: "/wopiserver.js", - Backend: "http://ocis-wopiserver:9105", - }, - { - Endpoint: "/hello.js", - Backend: "http://localhost:9105", - }, - { - Endpoint: "/api/v0/greet", - Backend: "http://localhost:9105", - }, }, }, {