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

Commit 16649ed

Browse files
author
Pete Brown
committed
Add support to nextcloud image to use an S3 bucket as primary storage
1 parent f33846f commit 16649ed

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

nextcloud/rootfs/usr/local/bin/setup.sh

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,26 @@ if [[ ! -z "$ADMIN_USER" ]]; then
5858
'adminpass' => '${ADMIN_PASSWORD}',
5959
EOF
6060
fi
61+
if [[ ! -z "$DATASTORE_BUCKET" ]]; then
62+
cat >> /nextcloud/config/autoconfig.php <<EOF;
63+
# Setup S3 as a backend for primary storage
64+
'objectstore' => array (
65+
'class' => 'OC\\Files\\ObjectStore\\S3',
66+
'arguments' => array (
67+
'bucket' => '${DATASTORE_BUCKET}',
68+
'autocreate' => false,
69+
'key' => '${DATASTORE_KEY}',
70+
'secret' => '${DATASTORE_SECRET}',
71+
'hostname' => '${DATASTORE_URL}',
72+
'use_ssl' => true,
73+
'port' => '${DATASTORE_PORT:443}',
74+
'use_ssl' => true,
75+
// required for some non amazon s3 implementations
76+
'use_path_style' => true,
77+
),
78+
),
79+
EOF
80+
fi
6181
cat >> /nextcloud/config/autoconfig.php <<EOF;
6282
);
6383
?>

0 commit comments

Comments
 (0)