/plugin-cloudview

A Roundcube plugin which lets you view documents with cloud viewers.

Primary LanguagePHPMIT LicenseMIT

Roundcube Plugin: Cloud View

GitHub Actions GitHub Actions Packagist Packagist Version Project license GitHub stars Donate to this project using Paypal

A Roundcube plugin which lets you directly view mail attachments in the browser with cloud viewers like Google Docs or Microsoft Office Web.

cover

Click me to see the user settings page

Viewers & Supported Formats

3rd-party Viewers

Viewer Supported Formats
Google Docs doc, docx, xls, xlsx, ppt, pptx, rtf
Microsoft Office Web doc, docx, xls, xlsx, ppt, pptx, odt, ott, ods, ots, odp, otp
StackEdit md

Self-hosting Viewers

Viewer Supported Formats
HTML JS htm, html
Markdown JS md
PDF JS pdf
PSD JS psd

Requirements

This plugin is tested in the following environment.

  • Roundcube: 1.4.0, 1.6.0
  • PHP: 7.1.3 (min requirement), 8.1
  • Skin: Classic, Larry, Elastic

Different environments may work as well without guarantee.

How to install this plugin in Roundcube

Install via Composer (Recommended)

This plugin has been published on Packagist by the name of jfcherng-roundcube/cloudview.

  1. Go to your ROUNDCUBE_HOME (i.e., the root directory of your Roundcube).
  2. Run composer require jfcherng-roundcube/cloudview.
  3. Copy config.inc.php.dist to config.inc.php and edit config.inc.php if you want.

Install manually

  1. Create folder cloudview in ROUNDCUBE_HOME/plugins if it does not exist.
  2. Copy all plugin files there.
  3. Copy config.inc.php.dist to config.inc.php and edit config.inc.php if you want.
  4. Edit ROUNDCUBE_HOME/conf/config.inc.php locate $config['plugins'] and add 'cloudview', there:
<?php

// some other codes...

$config['plugins'] = array(
    // some other plugins...
    'cloudview', // <-- add this
);

Prerequisites

This plugin will extract attachments from messages into plugins/cloudview/temp/ so that remote cloud viewers can publicly access them.

  • The temp/ directory under plugins/cloudview/temp/ should be public accessible.
  • Make sure the user running the RoundCube server has "write" permission to the temp/ directory.
  • Your RoundCube installation should be publicly accessible. I.e., not under an internal server.

Temporary Files

Those temporary files under plugins/cloudview/temp/ will not be deleted automatically. You will need to setup a cron job to periodically delete them.

For example, execute crontab -e and add the following job

# delete temporary files on 03:00 AM every day
0 3 * * * rm -rf PATH_TO_ROUNDCUBE/plugins/cloudview/temp/*/

For Developers

Compile Frontend Assets

  • You will need to have Node.js installed.
  • Install dependencies via npm install (or yarn if you prefer)
  • Compile assets with ./compile.sh

Acknowledgement