0
0
Fork 0
mirror of https://github.com/nextcloud/docker.git synced 2025-04-19 18:36:09 +02:00

feat(s3_config): add support for S3 session token configuration

- Introduced logic to handle S3 session token using environment variables.
- Supports session token from both a file and direct environment variable.
- Defaults to an empty token if no value is provided.

Signed-off-by: Hector Valcarcel <hmvalcarcel@gmail.com>
This commit is contained in:
Hector Valcarcel 2025-02-06 12:04:30 +01:00 committed by Hector Manuel
parent 69c1e4a000
commit dc7b7af9eb

View file

@ -40,6 +40,14 @@ if (getenv('OBJECTSTORE_S3_BUCKET')) {
$CONFIG['objectstore']['arguments']['secret'] = ''; $CONFIG['objectstore']['arguments']['secret'] = '';
} }
if (getenv('OBJECTSTORE_S3_SESSION_TOKEN_FILE')) {
$CONFIG['objectstore']['arguments']['session_token'] = trim(file_get_contents(getenv('OBJECTSTORE_S3_SESSION_TOKEN_FILE')));
} elseif (getenv('OBJECTSTORE_S3_SESSION_TOKEN')) {
$CONFIG['objectstore']['arguments']['session_token'] = getenv('OBJECTSTORE_S3_SESSION_TOKEN');
} else {
$CONFIG['objectstore']['arguments']['session_token'] = '';
}
if (getenv('OBJECTSTORE_S3_SSE_C_KEY_FILE')) { if (getenv('OBJECTSTORE_S3_SSE_C_KEY_FILE')) {
$CONFIG['objectstore']['arguments']['sse_c_key'] = trim(file_get_contents(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')) { } elseif (getenv('OBJECTSTORE_S3_SSE_C_KEY')) {