S3 Primary storage and installation check

Hi everyone, nice to be here :slight_smile:

So I have tried to come up with the best possible Solution for a secure, stable, cost effective Solution for a nextcloud deployment within a cloud.

What I have come up with.
-Docker. With Docker I can run several Instances on one Server. Addressed to certain ports, for each instance a different one. Security wise they are isolated from each other. (Main reason I don t just use several installations.)
-Reddis for caching.
-MariaDB, one Mariadb for several users. I probably cap it at 10, naturally no admins given, different databases, root from outside deactivated etc.
-S3 Amazon like storage meant for implementation.
-System. Ubuntu 16.04

My first primary problem is, I can add the S3 through external storage. But if I configurate the config.php file. The site doesn’t load anymore. I added the how my config file looks. My additions commented out, since it doesn’t load anymore unless I take them out.

Second what do you think about the deployment as it is?

I have spent several hours on the topic without further improvement, wouldn’t ask otherwise. Any additional Information you may need, just ask away.

Thanks in advance.

Nextcloud version (12):
Operating system and version (Ubuntu 16.04):
Apache or nginx version (Apache):
PHP version (7.0):

1 Like

Did you find an answer to this? I’m also blocked on how to get S3 as the primary.

If you just need the S3 as a Primary, the seemingly better approach seems to be (according to some deep research) to mount the S3 into the Ubuntu Filesystem. https://gridscale.io/community/tutorials/s3-fuse-ubuntu/ there you should find your answer.
It s a tutorial with an S3 compatible storage, whatever else you use, should be easy to adjust.

Good luck!

FUSE has its challenges, I would not advise it for production systems.

If you still are trying it via config.
I ve made it work that way also. The tip I can give, you don t need nearly as much as I thought.
SSL, secretkey, ID, host, are all that is needed. I don t get any error anymore and it works a LOT faster than if I add it via extra app.

Here’s the code that worked for me.

  //S3 as internal storage
  'objectstore' => array(
        'class' => 'OC\\Files\\ObjectStore\\S3',
        'arguments' => array(
                'bucket' => 'bucket-name',       //add your bucket name here
                'key'    => 'keygoeshere',       //add S3 bucket user/admin key here
                'secret' => 'secret-goes-here',  //add S3 bucket user/admin secret phrase here
                'use_ssl' => true,
                'use_path_style'=>true,          //Essential to get S3 working
        ),
    ),

Just add the above to your config/config.php file and fill in the appropriate info, and I’m sure you’ll be good to go. This was tested on NextCloud v12.0.0.29, Ubuntu server 16.04, nginx, php-7 with SSL certs from Let’s Encrypt.

I hope this helps some one. I spent several days to get this working. Some one should edit the official documentation. The optional fields should be removed from the sample code and people should me told to add them if required. Because they are there, I though the fields shouldn’t be removed just filled with empty string. This was a mistake, empty strings will cause the backend to fail.

Vikram

3 Likes

Post 12.0.3 the code that works is as follows:

  //S3 as internal storage
  'objectstore' => array(
        'class' => 'OC\\Files\\ObjectStore\\S3',
        'arguments' => array(
                'bucket' => 'bucket-name',       //add your bucket name here
                'key'    => 'keygoeshere',       //add S3 bucket user/admin key here
                'secret' => 'secret-goes-here',  //add S3 bucket user/admin secret phrase here
                'use_ssl' => true,
                'use_path_style'=> true,       
                'region' => 'us-east-1',  // Essential to get S3 workings
        ),
    ),