How to Integrate FileCloud with Digital Ocean Spaces

Administrators can change the FileCloud storage type after FileCloud has been installed but BEFORE any data has been stored. 

  • When changing the storage type from local to Digital Ocean S3, files and folders that have been already stored in the local storage will not be automatically moved to S3 storage.
  • In this case, the administrator must manually export files and folders from local storage before changing the storage type, and then manually import them after changing the storage type.


  • Only change the FileCloud storage type for new installations.
  • Do not change the FileCloud storage type if FileCloud has been in use and data is already stored.
  • Be careful when changing the storage path; if done improperly it could lead to data loss. 
  • The Digital Ocean S3 Bucket should never be modified outside of FileCloud.
  • Do not add/edit/modify files directly using Digital Ocean tools. Doing so will destabilize your FileCloud installation.

To change the FileCloud storage path from LOCAL to DIGITAL OCEAN S3:


Notes:

Although FileCloud does not have an explicit connector for Digital Ocean, the Amazon S3 connector can be used.

In this step you will need to access WWWROOT. It is typically located at: 

Windows

Linux

c:\xampp\htdocs/var/www/html

To enable Digital Ocean s3 storage as the backend:

  1.  To make sure that your server does not have any time variations, set up the time on your server to be synchronized.
    1. Configure an authoritative time server in Windows Server
    2. Synchronize Time with NTP in Linux
  2. Open the following file for editing:

    WWWROOT/config/cloudconfig.php
  3. Find the following line:

    define("TONIDOCLOUD_STORAGE_IMPLEMENTATION", "local");
  4. Change it to:

    define("TONIDOCLOUD_STORAGE_IMPLEMENTATION", "amazons3");
  5. Save and close the file.
  6. Find the following file: 

    WWWROOT/config/amazons3storageconfig-sample.php
  7. Rename it to:

    WWWROOT/config/amazons3storageconfig.php

(lightbulb) Nothing needs to be added or edited in amazons3storageconfig.php

To configure Digital Ocean S3 Credentials

  1. Log into the admin portal.
  2. Go to Settings > Storage > My Files.
  3. Enter the settings for your environment.
  4. Click Save S3 Settings.
    FieldDescription
    S3 KeyYour Digital Ocean authentication key.
    S3 SecretYour Digital Ocean authentication secret.
    Use IAM RoleWhen checked, the S3 Key and S3 Secret fields disappear and the IAM role is used to connect to the S3 bucket.
    S3 Bucket Name

    Provide a bucket name. The bucket should be new (in some circumstance, a previously used bucket in FileCloud may be used).

    It is important that the S3 bucket is never modified outside of FileCloud.

    The bucket name is case sensitive; confirm that you are using the exact name of the bucket.

    S3 Storage FolderOptional: All files are stored inside this root storage folder (it is created automatically).
    S3 RegionOptional: Provide the region string.
    S3 End Point URLThe S3 endpoint. Note that for each region there is a specific Endpoint URL.
  5. To fill in the remainder of the settings, see Setting up FileCloud Managed S3 Storage.


Troubleshooting:


If you are having problems previewing images, add a line to the .htaccess file.

To add a line to the .htaccess file:

  1. Open the following file:
    1. Windows:  C:\xampp\htdocs\.htaccess
    2. Linux: /var/www/html/.htaccess
  2. Add the following line:

    Header set Content-Security-Policy: "default-src 'self' *.live.com; style-src 'unsafe-inline' 'self';script-src 'unsafe-inline' 'unsafe-eval' 'self';font-src 'self' data:;img-src 'self' *.live.com  data: *.duosecurity.com *.digitaloceanspaces.com"

If you are having problems playing mp4 videos, add a line to the .htaccess file.

To add a line to the .htaccess file:

  1. Open the following file:
    1. Windows:  C:\xampp\htdocs\.htaccess
    2. Linux: /var/www/html/.htaccess
  2. Add the following line:

    Header set Content-Security-Policy: "default-src 'self' *.live.com *.digitaloceanspaces.com; style-src 'unsafe-inline' 'self';script-src 'unsafe-inline' 'unsafe-eval' 'self';font-src 'self' data:;img-src 'self' *.live.com  data: *.duosecurity.com *.digitaloceanspaces.com"