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

Commit dd45435

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

File tree

1 file changed

+26
-0
lines changed

1 file changed

+26
-0
lines changed

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

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,32 @@ cat >> /nextcloud/config/autoconfig.php <<EOF;
6363
?>
6464
EOF
6565

66+
# Put S3 config into it's own config file
67+
if [[ ! -z "$DATASTORE_BUCKET" ]]; then
68+
cat >> /nextcloud/config/s3.config.php <<EOF;
69+
<?php
70+
\$CONFIG = array (
71+
# Setup S3 as a backend for primary storage
72+
'objectstore' => array (
73+
'class' => 'OC\\Files\\ObjectStore\\S3',
74+
'arguments' => array (
75+
'bucket' => '${DATASTORE_BUCKET}',
76+
'autocreate' => false,
77+
'key' => '${DATASTORE_KEY}',
78+
'secret' => '${DATASTORE_SECRET}',
79+
'hostname' => '${DATASTORE_HOST}',
80+
'use_ssl' => true,
81+
'port' => '${DATASTORE_PORT:-443}',
82+
'use_ssl' => true,
83+
// required for some non amazon s3 implementations
84+
'use_path_style' => true,
85+
),
86+
),
87+
);
88+
?>
89+
EOF
90+
fi
91+
6692
echo "Starting automatic configuration..."
6793
# Execute ownCloud's setup step, which creates the ownCloud database.
6894
# It also wipes it if it exists. And it updates config.php with database

0 commit comments

Comments
 (0)