Store Drupal's public and private files in an OCI Object Storage bucket
OCI Object Storage FS
OCI Object Storage Actions

This project is not covered by Drupal’s security advisory policy.

OCI Object Storage File System stores Drupal files in Oracle Cloud Infrastructure (OCI) Object Storage. It talks to OCI through the Amazon S3 Compatibility API using the AWS SDK for PHP.

Features

  • Stores public:// and private:// files in one OCI bucket, under separate prefixes, plus an oci:// scheme.
  • Public file delivery through Drupal (stable same-origin URLs, private bucket), 7-day presigned URLs, or permanent URLs for public buckets.
  • Private files served through Drupal with core access checks, or as short-lived signed URLs.
  • Disk-backed buffering and multipart upload for files over 16 MB.
  • Byte range requests on the public file proxy (1.2.3 and later), so browsers can seek in video served through Drupal.
  • Optional custom paths for the public file proxy and for oci:// image style URLs (1.3.0 and later), so URLs need not name the storage backend. The default paths keep working. This changes appearance only and is not a security control.
  • Image style support, metadata caching, a connection test, and a batch tool that copies existing local files to OCI.
  • Configuration from settings.php and environment variables, or from an admin form.

Requirements

  • Drupal 10.3 or later, 11 or 12. Tested on 10.3, 10.6, 11.4, 11.5.0-beta1 and 12.0.0-rc1.
  • aws/aws-sdk-php 3.371.4 or later (installed by Composer).
  • An OCI bucket and a Customer Secret Key. OCI API signing keys and Instance Principals are not supported.

Before you enable it

Enabling the module moves public:// and private:// to OCI straight away, and existing local files return 404 until they are copied. Copy them to the bucket beforehand, or run the module's copy action right after enabling, in a maintenance window. See the README for a recommended settings.php block and a least-privilege IAM policy.

Security

  • Keep credentials in environment variables or a secret store, not in the database.
  • Never allow anonymous reads on a bucket that also holds private files.
  • This project is not covered by the Drupal security advisory policy. Report vulnerabilities privately to the maintainer.

Known limitations

  • A failed upload raises FileWriteException (1.2.2 and later; update from earlier releases). After a failed browser upload, the user has to upload the file again.
  • Reads through the stream wrapper, including private file downloads, download the whole object to temporary storage. A full download through the public proxy does too; its HEAD and range requests do not. Rename is copy then delete.
  • Original oci:// files, and other files delivered by presigned or permanent URLs, use the OCI storage host.
  • Older Drupal core releases (before 10.6.13, 11.3.14 or 11.4.4, and the 11.0 to 11.2 branches) serve oci:// image styles to anyone with a valid image token. Update core.
  • The S3 Compatibility API endpoint uses the oraclecloud.com domain and is not configurable yet.
Supporting organizations: 
funded the development and ongoing maintenance, released as a community contribution

Project information

Releases