Skip to content

Collabora Online Drupal module

License

MPL-2.0, Unknown licenses found

Licenses found

MPL-2.0
LICENSE
Unknown
COPYING
Notifications You must be signed in to change notification settings

CollaboraOnline/collabora-drupal

Repository files navigation

Collabora Online connector for Drupal

This module integrate Collabora Online to Drupal. You can use it to view and edit documents from within Drupal.

Requirements:

  • Collabora Online server installed and running.
  • Drupal 10 (tested on 10.1), maybe compatible with 9.
  • JWT and Media are set as dependencies for the module and are necessary.

Copy the content of this directory into modules/custom/collabora_online like a Drupal module.

Installation

See the Drupal guide to install modules.

In you Drupal setup, in the directory modules/custom extract the module into a directory collabora_online.

You can get it directly with git:

git clone https://github.com/CollaboraOnline/collabora-drupal.git collabora_online

Then you can go into Drupal logged as an admin and go to Extend. In the list you should be able to find Collabora Online and enable it.

From there you can access the module specific configuration.

Configuration

There are few step necessary in Drupal to configure the integration.

Log into Drupal as an admin.

JWT key

Go to Configuration > System > Keys

  • Create a JWT HMAC key, with the HS256 algorithm.
  • Set it to be provided by the configuration.

Collabora Online

Go to Configuration > Media > Collabora Online Settings

  • Collabora Online server URL: the URL of the collabora online server. Note that you have to take into considerartion containers. If you run Drupal in one container and Collabora Online in another, you can not use localhost.
  • WOPI host base URL: how the Collabora Online server can reach the Drupal server. Usually it is the public URL of this Drupal server.
  • JWT Private Key ID: the id of the key created above.

Optional

  • Disable TLS certificate check for COOL: If you configure a development server you might have self-signed certificate. Checking this is INSECURE but allow the drupal server to contact the collabora online server is the certificate doesn't check.
  • Access Token Expiration: In second the expiration of the token to access the document. Default to 86400 seconds (24 hours).

COOL

Some configuration changes might be necessary on the Collabora Online side.

CSP for embedding must set properly to embed the Collabora Online frame.

Fields

To be able to attach document to Drupal content nodes, you need to create a field.

Login as an admin, and got to the admnistration section.

  • Go to Structure > Content types
  • Find the appropriate content and click Manage fields.
  • Click + Create a new field (or if you alread have created one you can re-use one)
  • Enter a label, select Media, click Continue
  • At the bottom for Media type, select Document. Click Save Settings. Type of item to reference should have been set to the default value of Media.

You also must set the viewer for this kind of media.

  • Go to Structure > Media Types
  • Select Manage Display for Document
  • In the Field section, select in the Format column, choose Collabora Online Preview.
  • Click Save.

Other configuration

If you need to change the accepted extensions to upload, go to Administration > Structure > Media Type, for the line Documents, click Edit, then click Manage Fields, and for the right field, Edit:

  • You can change the allowed file extensions.

To increase the maximum upload size (it is indicated on that page), you need to increase the value in the PHP configuration.

Usually you can add a file max_file_size.ini (the name isn't much important except its extension should be .ini) into /etc/php/conf.d/ (the path may be different) and put the following:

post_max_size = 30M
upload_max_filesize = 30M

These set the limits to a maximum of 30M. You can change as appropriate.

License

This module is published under the MPL-2.0 license.

About

Collabora Online Drupal module

Resources

License

MPL-2.0, Unknown licenses found

Licenses found

MPL-2.0
LICENSE
Unknown
COPYING

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published