Skip to content
This repository has been archived by the owner on Feb 4, 2021. It is now read-only.

Add support to nextcloud image to use an S3 bucket as primary storage #223

Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 20 additions & 0 deletions nextcloud/rootfs/usr/local/bin/setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,26 @@ if [[ ! -z "$ADMIN_USER" ]]; then
'adminpass' => '${ADMIN_PASSWORD}',
EOF
fi
if [[ ! -z "$DATASTORE_BUCKET" ]]; then
cat >> /nextcloud/config/autoconfig.php <<EOF;
# Setup S3 as a backend for primary storage
'objectstore' => array (
'class' => 'OC\\Files\\ObjectStore\\S3',
'arguments' => array (
'bucket' => '${DATASTORE_BUCKET}',
'autocreate' => false,
'key' => '${DATASTORE_KEY}',
'secret' => '${DATASTORE_SECRET}',
'hostname' => '${DATASTORE_URL}',
'use_ssl' => true,
'port' => '${DATASTORE_PORT:443}',
'use_ssl' => true,
// required for some non amazon s3 implementations
'use_path_style' => true,
),
),
EOF
fi
cat >> /nextcloud/config/autoconfig.php <<EOF;
);
?>
Expand Down