Skip to content

Latest commit

 

History

History
672 lines (506 loc) · 20.9 KB

zimbra-drive-open-guide.adoc

File metadata and controls

672 lines (506 loc) · 20.9 KB

Zimbra Open Drive

Warning
Zimbra Open Drive has been deprecated and replaced with Zimbra Drive V2. If attempting to use Zimbra Open Drive, there are known issues with connecting to the latest versions of Nextcloud and ownCloud which will not be addressed.

Zimbra Open Drive is a client that interfaces Zimbra to third party products and services.

Note
Prior to version 8.8.11, Zimbra Open Drive was known as Zimbra Drive.

Zimbra Open Drive currently works with:

  • Nextcloud

  • ownCloud

Warning
Data on Zimbra Open Drive is not hosted on the Zimbra server or on any other Zimbra product. Likewise, the data is not managed by Zimbra or any incorporated service. Therefore, Zimbra Support does not support issues related to Nextcloud and ownCloud servers.

About this Document

This document is written for system administrators, and it aims to provide an in-depth view of the product architecture and the knowledge necessary for solid customizations.

Zimbra Open Drive is included in Zimbra starting in version 8.7.6 as Beta software and version 8.8.0 as Stable. Zimbra Open Drive is provided as an included package of Zimbra Collaboration Suite, so Zimbra Open Drive can be installed during the Zimbra installation process.

The Installation and Configuration chapters cover the installation and the configuration of the product in the supported environments respectively.
The upgrade process and compatibility information is covered in the Upgrade chapter.
The Uninstallation chapter contains the procedure to uninstall Zimbra Open Drive. Advanced topics, such as how to build the software from the sources, are in the Advanced Topics chapter.

Warning
Backups, archiving, access security and user management is not done by or within Zimbra.
Malfunctions, data and access security as well as storage management and data archiving on any third party product is not managed by Zimbra or through Zimbra software nor falls under any Zimbra Support contract as stated in section 2.4(a) of Zimbra’s "Maintenance & Support Terms and Conditions".

Overview

General Architecture

The purpose of Zimbra Open Drive is to connect the Zimbra end user to a cloud service, external to Zimbra.

Zimbra Open Drive has three parts: Zimbra Extension, Zimlet and Cloud App. These parts integrate external storage services and an authentication mechanism into the Zimbra Web Interface. Each Zimbra account will be linked to the external storage service account.

Components

Zimbra Open Drive includes the following components:

  1. Zimbra Open Drive Extension

  2. Zimlet

  3. Cloud App

Each component is mandatory and requires careful configuration. However, errors in installation or configuration won’t affect Zimbra usability.

Extension

The Zimbra Open Drive extension is installed in the mailboxd component. The extension acts between the Zimbra Open Drive Zimlet and the Cloud App, providing services like authentication and item actions to the Zimlet.

Zimlet

The Zimbra Open Drive Zimlet adds a new Open Drive tab to the user Zimbra interface, before the Preferences tab. With the Zimlet, user can search in the linked cloud.
The Zimlet component is contained in the package com_zextras_drive_open.zip. The Zimlet name is com_zextras_drive_open.

Cloud App

The external services of cloud storage need a specific app with a dedicated API to communicate with the Zimbra Open Drive Extension. Zimbra Open Drive provides an app for each of the services supported.

Nextcloud/ownCloud

The Nextcloud/ownCloud app is a specific application for Nextcloud and ownCloud. It provides transparent authentication in ownCloud and Nextcloud using Zimbra credentials and a layer of compatibility that abstracts the version of ownCloud and Nextcloud for the extension.

Installation

This chapter guides the administrator through the manual installation of Zimbra Open Drive.

Requirements

  • Root-level access to the underlying operating system.

  • Administrative access to an external cloud supported service (see Cloud App).
    Supported versions:

    • Nextcloud 9, 10, 11

    • ownCloud 9.0, 9.1, 10

Zimbra Packages Installation

This section describes how to install the Zimbra Open Drive Extension and the Zimbra Open Drive Zimlet.

Both the Zimbra Open Drive Extension and the Zimlet are installed through the official Zimbra installer. The Zimbra installer prompts you as follows:

Use Zimbra's package repository [Y] Yes
...
Install zimbra-drive [Y] Yes
Zimbra Already Installed

The Zimbra installation adds the Zimbra repositories to apt sources list, so Zimbra Open Drive can be installed through the following command:

# As root, when apt-get is available
apt-get update
apt-get install zimbra-drive
# As root, when yum is available
yum update
yum install zimbra-drive

Hereafter, the Zimbra Open Drive Extension will be enabled with the zimlet deploy command and a mailbox restart:

# As zimbra
zmzimletctl deploy /opt/zimbra/zimlets/com_zextras_drive_open.zip
zmmailboxd  restart

Cloud App Installation

Here are the steps to install the Zimbra Open Drive Cloud App to the specific supported cloud.

The cloud services currently supported are Nextcloud and ownCloud with the archive zimbradrive.tar.gz.

Nextcloud/ownCloud

Nextcloud and ownCloud require the same following installation steps.
The placeholder PATHTOCLOUD is the path of the Nextcloud/ownCloud service in server:

  1. Copy zimbradrive.tar.gz in Nextcloud/ownCloud drive:
    scp zimbradrive.tar.gz root@cloud:/tmp

  2. In Nextcloud/ownCloud server, extract zimbradrive.tar.gz in PATHTOCLOUD/apps:
    tar -xvzf zimbradrive.tar.gz -C PATHTOCLOUD/apps

  3. Change permissions of the extracted folder PATHTOCLOUD/apps/zimbradrive with the user owner of Nextcloud/ownCloud (E.g.: www-data):
    chown -R www-data:www-data PATHTOCLOUD/apps/zimbradrive/

  4. Enable Zimbra Open Drive App from Nextcloud/ownCloud Admin Interface or with command:
    sudo -u www-data php PATHTOCLOUD/occ app:enable zimbradrive

At this point, the Nextcloud/ownCloud Zimbra Open Drive App is installed and requires configuration.

On Apache Web Server, Zimbra Open Drive doesn’t work if the server is not correctly configured. Refer to these instructions for Apache Web Server Configuration in the Nextcloud manual: Nextcloud installation or in the ownCloud manual: ownCloud installation.

Configuration

Zimbra Open Drive configuration is split into the Zimbra side and the Cloud side. The Zimbra Open Drive Zimlet doesn’t need more than standard Zimlet configuration, so the Zimbra side requires only Zimbra Open Drive Extension configuration. On the Cloud side, each supported cloud service configuration will be shown later. These are independent, and you need only configure for your desired cloud service.

Zimbra Extension Configuration

The Zimbra Extension setup requires the URL of the cloud service that will be paired. This URL has to be set in the domain attribute zimbraDriveOwnCloudURL, and it is common to all users belonging the same domain. Different domains may have different cloud service URLs.
The command to set the cloud service URL is:

# As zimbra
zmprov md domainExample.com zimbraDriveOwnCloudURL CLOUD_URL

The cloud service URL (CLOUD_URL) has to be in the form: protocol://cloudHost/path.

  • protocol: can be http or https

  • cloudHost: hostname of the server with the cloud service

  • path: path in server of the targeted cloud service

Each cloud service has its entry point.
In Nextcloud/ownCloud, the URL has to target index.php protocol://cloudHost/path/index.php

Cloud App Configuration

Nextcloud/ownCloud

When everything is correctly configured, the Zimbra end user creates a private account in the cloud service that will be paired with the Zimbra user account. This new cloud account inherits the Zimbra user credentials and appears in the user’s list of Nextcloud/ownCloud interface; however this account is not active until the Zimbra Open Drive app is enabled.

Nextcloud and ownCloud have the same following configuration entries. In the Nextcloud/ownCloud administration panel, it must appear as a new Zimbra Open Drive entry in the left sidebar that redirect to the configuration view. There are the following configurations:

  • (CheckBox) Enable Zimbra authentication back end
    (Mandatory checked) On check, adds a configuration in config.php that lets Nextcloud/ownCloud use Zimbra Open Drive App class. On uncheck, removes this configuration.

  • (CheckBox) Allow Zimbra’s users to log in
    (Mandatory checked) Allows Zimbra users to use Nextcloud/ownCloud with their Zimbra credentials.

  • (InputField) Zimbra Server
    (Mandatory) Zimbra webmail host or ip.

  • (InputField) Zimbra Port
    (Mandatory) Zimbra webmail port.

  • (CheckBox) Use SSL
    Check if the Zimbra webmail port uses SSL certification.

  • (CheckBox) Enable certification verification
    Disable only if Zimbra has an untrusted certificate.

  • (InputField) Domain Preauth Key
    After the Zimbra end user creates a private account with the first successful access in Zimbra Open Drive, he can log into the Nextcloud/ownCloud web interface using Zimbra credentials. In the Nextcloud/ownCloud web interface, he will find a Zimbra icon in the Apps menu that opens a new Zimbra webmail tab without a login step.
    This feature works only if the Zimbra Domain PreAuth Key is copied. In Zimbra, run the following command to show the desired Zimbra Domain PreAuth Key:
    # As zimbra
    zmprov getDomain example.com zimbraPreAuthKey
    # If response is empty, generate with
    zmprov generateDomainPreAuthKey domainExample.com

Upgrade

This chapter guides administrators through the manual upgrade of Zimbra Open Drive. It’s important to pay attention to the version of each component: the compatibility is granted only if each component has the same version.
The Zimbra Open Drive Zimlet and extension can be upgraded a with Zimbra upgrade, but the Zimbra Open Drive App must be manually updated.

Zimbra Extension and Zimlet Upgrade

When Zimbra is upgraded, Zimbra Open Drive can be installed directly from the installation. Zimbra Open Drive can be kept upgraded in the same Zimbra major.minor versions with apt-get or yum:

# As root, when apt-get is available
apt-get update; apt-get install zimbra-drive
# As root, when yum is available
yum update; yum install zimbra-drive

Cloud App Upgrade

Unlike the Zimbra Open Drive Zimlet and the Extension, the Zimbra Open Drive Cloud app has to be manually upgraded on every version change.

The upgrade of Zimbra Open Drive App in Nextcloud/ownCloud requires that files are replaced. Perform these steps at installation(Nextcloud/ownCloud):

  1. Copy zimbradrive.tar.gz in Nextcloud/ownCloud drive
    scp zimbradrive.tar.gz root@cloud:/tmp

  2. In the Nextcloud/ownCloud server, extract zimbradrive.tar.gz in PATHTOCLOUD/apps:
    tar -xvzf zimbradrive.tar.gz -C PATHTOCLOUD/apps/apps

  3. Change permissions of the extracted folder PATHTOCLOUD/apps/zimbradrive with the user owner of Nextcloud/ownCloud (E.g.: www-data):
    chown -R www-data:www-data PATHTOCLOUD/apps/zimbradrive/

On ugrade from version 0.0.1, remove the table oc_zimbradrive_users that are no longer used. In mysql, execute the following command:
DROP TABLE oc_zimbradrive_users;

Uninstallation

This chapter guides the administrator through the manual uninstallation of Zimbra Open Drive and cleanup of the system.

Disable Zimbra Open Drive Packages

Since the Zimbra Open Drive Extension and the Zimbra Open Drive Zimlet are installed as Zimbra packages, their uninstallation is unexpected. To disable Zimbra Open Drive, disable the Zimbra Open Drive Zimlet from the desired user, domain or class of service.

Remove Cloud App

Nextcloud/ownCloud

The removal of the Nextcloud/ownCloud App has two steps: clean up and app uninstall.

The clean up step deletes all Zimbra users' data from Nextcloud/ownCloud and is not reversible. It requires that Zimbra Open Drive is installed and enabled.
However, this clean up step can be skipped. The Zimbra Open Drive App can be uninstalled without removing the Zimbra users' data.

Clean Up

Before starting clean up, it’s recommended to disable Zimbra users' access: the configuration Allow Zimbra’s users to log in should be unchecked.

The following commands delete the users created by the Zimbra Open Drive App and clean up the table containing references to Zimbra users (replace correctly mysql_pwd and occ_db):

cd /var/www/cloud           # Go to the OCC path
mysql_pwd='password'        # database password
occ_db='cloud'              # database name for the Nextcloud / ownCloud

# In ownCloud
user_id_column='user_id'    # column name in table oc_accounts of ownCloud
# In Nextcloud
user_id_column='uid'        # column name in table oc_accounts of Nextcloud

mysql -u root --password="${mysql_pwd}" "${occ_db}" -N -s \
    -e 'SELECT uid FROM oc_group_user WHERE gid = "zimbra"' \
    | while read uid; do \
        sudo -u www-data php ./occ user:delete "${uid}"; \
        mysql -u root --password="${mysql_pwd}" "${occ_db}" \
            -e "DELETE FROM oc_accounts WHERE ${user_id_column} = '${uid}' LIMIT 1"; \
      done

App Uninstall

The Zimbra Open Drive App can be removed from the Nextcloud/ownCloud Admin Interface. The configuration should be restored by unchecking Enable Zimbra authentication back end, then the Zimbra Open Drive App must be disabled from the Enabled Apps'' tab and uninstalled from the Disabled Apps``.

With the previous steps, the Zimbra Open Drive App folder (PATHTOCLOUD/apps/zimbradrive) is deleted but all the users' files still remain in the cloud service drive: any configuration or file that was not previously cleaned up is retrieved on reinstallation of the Zimbra Open Drive App.

Advanced Topics

Build from Sources

This section describes the steps to build the Zimbra Open Drive components. The official Zimbra Open Drive source repository is hosted on GitHub.com/ZeXtras/zimbra-drive.

The build system uses a relative path. The following example assumes that the working path is /tmp/, but it can be changed at will.

# Clean the folder that will be used for the build
rm -rf /tmp/ZimbraDrive && cd /tmp/

# Clone the source repository
git clone --recursive [email protected]:ZeXtras/ZimbraDrive.git

# Jump into the source folder
cd ZimbraDrive

# Checkout the correct branch for the Zimbra release (assuming Zimbra 8.8.0 )
git checkout release/8.8.0

# Build the whole package, setting the target Zimbra (can take some minutes)
make clean && make ZAL_ZIMBRA_VERSION=8.8.0

The final artifact zimbra_drive.tgz will be placed in the folder /tmp/zimbradrive/dist.

The dist folder:

The archive zimbra_drive.tgz contains all components of Zimbra Open Drive:

Manual Installation

Manual installation is not supported.

The Zimbra Open Drive Zimlet and the Extension are installed during the Zimbra installation. Any modification to the installed Zimbra packages may lead to a fail during the Zimbra upgrade.

Extension

The files zimbradrive-extension.jar and zal.jar must be copied in the right place; then a mailbox restart is required to load the extension.

# As root
mkdir -p /opt/zimbra/lib/ext/zimbradrive
cp zimbradrive-extension.jar /opt/zimbra/lib/ext/zimbradrive/
cp zal.jar /opt/zimbra/lib/ext/zimbradrive/

# As zimbra
mailboxdctl restart

Everything is successfully done only if the extension starts correctly. The following string should be logged in ZIMBRA_HOME/log/mailbox.log at the moment of the last mailbox restart:

Initialized extension Zimbra Abstraction Layer for: zimbradrive
Zimlet

Deploy the Zimbra Open Drive Zimlet with the following command:

# As zimbra
zmzimletctl deploy com_zextras_drive_open.zip

By default, the Zimlet is enabled for the ‘default‘ COS. The Zimlet can be enabled on any required COS from the administration console.

Manual Upgrade

Manual upgrade is not supported.

The Zimbra Open Drive Zimlet and the Extension are upgraded during the the Zimbra upgrade. Any modification to the installed Zimbra packages may lead to a fail during the Zimbra upgrade.

Extension

The Zimbra Open Drive Extension can be upgraded replacing the zimbra-extension.jar and zal.jar files in /opt/zimbra/lib/ext/zimbradrive/ and performing a mailbox restart.

# As root
cp zimbradrive-extension.jar /opt/zimbra/lib/ext/zimbradrive/
cp zal.jar /opt/zimbra/lib/ext/zimbradrive/

# As zimbra
mailboxdctl restart

Zimlet

The Zimbra Open Drive Zimlet can be upgraded by deploying the newest version and flushing cache:

# As zimbra
zmzimletctl deploy com_zextras_drive_open.zip
zmprov fc zimlet

Manual Uninstall

Manual uninstallation is not supported.

Please consider disabling Zimbra Open Drive (see: Disable Zimbra Open Drive Packages) instead of uninstalling it. Any modification to the installed Zimbra packages may lead to a fail during the Zimbra upgrade.

The manual uninstallation process of the Zimbra Open Drive Zimlet and the Zimbra Open Drive extension requires you to undeploy the Zimlet and clean the extension folder from zimbra.

To remove the Zimbra Open Drive Zimlet:

# As zimbra
zmzimletctl undeploy com_zextras_drive_open

To remove the Zimbra Open Drive extension:

# As root
rm -rf /opt/zimbra/lib/ext/zimbradrive/

# As zimbra
zmmailboxdctl restart

The last, but not necessary, step is to clean the domain attribute with the command
`zmprov md domainExample.com zimbraDriveOwnCloudURL `

How to Report an Issue

If an issue is found, Zimbra Support requires the following information:

  • A detailed description of the issue: What you are expecting and what is really happening.

  • A detailed description of the steps to reproduce the issue.

  • A detailed description of the installation and the environment: (see "Gathering System Information" section of this guide)

    • Cloud information:

    • Server information: CPU, RAM, number of servers and for each server:

      • Zimbra version

      • Zimbra Open Drive version

      • List of the installed Zimlets

    • Client information:

      • Browser name and version

      • Connectivity used between the servers and the client

      • Client skin (theme)

      • Client language

      • List of the Zimlets enabled for the user

  • Any log involved in the issue:

    • mailbox.log

Any personal information can be removed to protect the privacy.

Gathering System Information

This section helps the administrator to collect useful system information that is required to escalate an issue to Zimbra Support.

Zimbra Version

To see the version of Zimbra, type this command:

# As zimbra
zmcontrol -v
List of Deployed Zimlets

To see the list of deployed Zimlets, type this command:

# As zimbra
zmzimletctl listZimlets
List of Zimlets Enabled for the User

To see the list of Zimlets enabled for a user, type this command:

# As zimbra
zmprov getAccount [email protected] zimbraZimletAvailableZimlets
List of Zimlet User Preferences

To see the list of preferences for the Zimlets enabled for a user, type this command:

# As zimbra
zmprov getAccount [email protected] zimbraZimletUserProperties
Extension and Zimlet Versions

To see the version of the extension and the Zimlet, type this command:

# As zimbra
java -cp /opt/zimbra/lib/ext/zimbradrive/zimbradrive-extension.jar \
    com.zextras.lib.ZimbraDrive