Skip to content

Commit

Permalink
Allow setting AWS S3 SSE-C key (#2151)
Browse files Browse the repository at this point in the history
The AWS S3 SSE-C key for server side encryption can now be set using
the environment variable `OBJECTSTORE_S3_SSE_C_KEY`.

Signed-off-by: Patrick Hobusch <[email protected]>
  • Loading branch information
pathob authored Jan 26, 2024
1 parent c88d31e commit 2e9139b
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
6 changes: 6 additions & 0 deletions .config/s3.config.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,4 +39,10 @@
} else {
$CONFIG['objectstore']['arguments']['secret'] = '';
}

if (getenv('OBJECTSTORE_S3_SSE_C_KEY_FILE') && file_exists(getenv('OBJECTSTORE_S3_SSE_C_KEY_FILE'))) {
$CONFIG['objectstore']['arguments']['sse_c_key'] = trim(file_get_contents(getenv('OBJECTSTORE_S3_SSE_C_KEY_FILE')));
} elseif (getenv('OBJECTSTORE_S3_SSE_C_KEY')) {
$CONFIG['objectstore']['arguments']['sse_c_key'] = getenv('OBJECTSTORE_S3_SSE_C_KEY');
}
}
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -191,6 +191,7 @@ To use an external S3 compatible object store as primary storage, set the follow
- `OBJECTSTORE_S3_LEGACYAUTH` (default: `false`): Not required for AWS S3
- `OBJECTSTORE_S3_OBJECT_PREFIX` (default: `urn:oid:`): Prefix to prepend to the fileid
- `OBJECTSTORE_S3_AUTOCREATE` (default: `true`): Create the container if it does not exist
- `OBJECTSTORE_S3_SSE_C_KEY` (not set by default): Base64 encoded key with a maximum length of 32 bytes for server side encryption (SSE-C)

Check the [Nextcloud documentation](https://docs.nextcloud.com/server/latest/admin_manual/configuration_files/primary_storage.html#simple-storage-service-s3) for more information.

Expand Down

0 comments on commit 2e9139b

Please sign in to comment.