docker icon indicating copy to clipboard operation
docker copied to clipboard

`OBJECTSTORE_S3_SSL` does not work as documented

Open vbrandl opened this issue 1 year ago • 2 comments

The documentation for OBJECTSTORE_S3_SSL states that it defaults to true:

(default: true): Whether or not SSL/TLS should be used to communicate with object storage server

I would assume, not setting OBJECTSTORE_S3_SSL at all would cause Nextcloud to connect to my S3 bucket via HTTPS.

I use the following compose.yml for testing.

services:
  nextcloud:
    image: nextcloud
    volumes:
      - ./data/nextcloud:/var/www/html
    environment:
      - SQLITE_DATABASE=/tmp/nc.db
      - NEXTCLOUD_ADMIN_USER=admin
      - NEXTCLOUD_ADMIN_PASSWORD=this-is-not-a-password
      - NEXTCLOUD_TRUSTED_DOMAINS=example.com

      - OBJECTSTORE_S3_BUCKET=${OBJECTSTORE_S3_BUCKET}
      - OBJECTSTORE_S3_HOST=${OBJECTSTORE_S3_HOST}
      - OBJECTSTORE_S3_PORT=${OBJECTSTORE_S3_PORT}
      - OBJECTSTORE_S3_KEY=${OBJECTSTORE_S3_KEY}
      - OBJECTSTORE_S3_SECRET=${OBJECTSTORE_S3_SECRET}
        #- OBJECTSTORE_S3_SSL=true

If i start a new instance like this, I get the following config.php:

objectstore' =>
  array (
    'class' => '\\OC\\Files\\ObjectStore\\S3',
    'arguments' =>
    array (
      'bucket' => '<snip>',
      'region' => '',
      'hostname' => '<snip>',
      'port' => '443',
      'storageClass' => '',
      'objectPrefix' => 'urn:oid:',
      'autocreate' => false,
      'use_ssl' => false,
      'use_path_style' => false,
      'legacy_auth' => false,
      'key' => '<snip>',
      'secret' => '<snip>',
    ),
  ),

use_ssl is set to false but I would expect it to be true.

Now I delete ./data/nextcloud, uncomment - OBJECTSTORE_S3_SSL=true in compose.yml and start the compose project again and use_ssl in config.php will be set to true.

So the documentation does not match how the image actually behaves.

vbrandl avatar Oct 08 '24 20:10 vbrandl

i copied and pasted it like a good dev

Juoelenis avatar Oct 09 '24 10:10 Juoelenis

Hi @vbrandl - You're absolutely right. This intersects with #1948, an older report I was just recently reviewing (and that got overlooked).

Thanks for the PR as well!

joshtrichards avatar Oct 09 '24 13:10 joshtrichards