Skip to content

Conversation

@szaimen
Copy link
Contributor

@szaimen szaimen commented Jan 6, 2026

Consider an s3.config.php file for initial installation like this:

Expand
<?php
  $use_ssl = getenv('OBJECTSTORE_S3_SSL');
  $use_path = getenv('OBJECTSTORE_S3_USEPATH_STYLE');
  $use_legacyauth = getenv('OBJECTSTORE_S3_LEGACYAUTH');
  $autocreate = getenv('OBJECTSTORE_S3_AUTOCREATE');
  $multibucket = getenv('OBJECTSTORE_S3_MULTIBUCKET');
  $CONFIG = array(
    'objectstore' => array(
      'class' => '\OC\Files\ObjectStore\S3',
      'arguments' => array(
        'multibucket' => $multibucket === 'true',
        'bucket' => getenv('OBJECTSTORE_S3_BUCKET'),
        'key' => getenv('OBJECTSTORE_S3_KEY') ?: '',
        'secret' => getenv('OBJECTSTORE_S3_SECRET') ?: '',
        'region' => getenv('OBJECTSTORE_S3_REGION') ?: '',
        'hostname' => getenv('OBJECTSTORE_S3_HOST') ?: '',
        'port' => getenv('OBJECTSTORE_S3_PORT') ?: '',
        'storageClass' => getenv('OBJECTSTORE_S3_STORAGE_CLASS') ?: '',
        'objectPrefix' => getenv("OBJECTSTORE_S3_OBJECT_PREFIX") ? getenv("OBJECTSTORE_S3_OBJECT_PREFIX") : "urn:oid:",
        'autocreate' => strtolower($autocreate) !== 'false',
        'use_ssl' => strtolower($use_ssl) !== 'false',
        // required for some non Amazon S3 implementations
        'use_path_style' => strtolower($use_path) === 'true',
        // required for older protocol versions
        'legacy_auth' => strtolower($use_legacyauth) === 'true',
        'use_nextcloud_bundle' => 1,
      )
    )
  );

  $sse_c_key = getenv('OBJECTSTORE_S3_SSE_C_KEY');
  if ($sse_c_key) {
    $CONFIG['objectstore']['arguments']['sse_c_key'] = $sse_c_key;
  }


Now, you want to add additional perBucket settings using the occ command

php occ config:system:set --value=test objectstore arguments perBucket test1 secret
php occ config:system:set --value=test objectstore arguments perBucket test2 secret

It will not work without this PR.

@szaimen szaimen added this to the Nextcloud 33 milestone Jan 6, 2026
@szaimen szaimen added enhancement 3. to review Waiting for reviews labels Jan 6, 2026
@szaimen
Copy link
Contributor Author

szaimen commented Jan 6, 2026

/backport to stable32

@szaimen
Copy link
Contributor Author

szaimen commented Jan 6, 2026

/backport to stable31

@szaimen
Copy link
Contributor Author

szaimen commented Jan 6, 2026

/backport to stable30

@szaimen szaimen force-pushed the enh/noid/change-config-to-amr branch from 4e006c7 to 178fb77 Compare January 6, 2026 15:03
@szaimen szaimen changed the title feat(Config.php): change array_merge to array_merge_recursive when merging configs feat(Config.php): change array_merge to array_replace_recursive when merging configs Jan 6, 2026
@szaimen szaimen marked this pull request as ready for review January 6, 2026 15:27
@szaimen szaimen requested a review from a team as a code owner January 6, 2026 15:27
@szaimen szaimen requested review from leftybournes, salmart-dev and yemkareems and removed request for a team January 6, 2026 15:27
@szaimen szaimen mentioned this pull request Jan 6, 2026
@nextcloud-bot nextcloud-bot mentioned this pull request Jan 7, 2026
@Altahrim Altahrim merged commit 351351a into master Jan 7, 2026
229 of 244 checks passed
@Altahrim Altahrim deleted the enh/noid/change-config-to-amr branch January 7, 2026 11:04
@Altahrim Altahrim removed the 3. to review Waiting for reviews label Jan 7, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants