1
0
mirror of https://github.com/mail-in-a-box/mailinabox.git synced 2024-11-23 02:27:05 +00:00

If configured via environment variables, setup an S3 bucket as storage backend for nextcloud

This commit is contained in:
Michael Meidlinger 2023-05-19 13:28:42 +02:00
parent 93380b243f
commit da66ef4a81

View File

@ -313,6 +313,30 @@ echo ";";
EOF
chown www-data:www-data $STORAGE_ROOT/owncloud/config.php
# Update config.php in case S3 object storage backend if configured
if [[ -n "${NEXTCLOUD_S3_BUCKET:-}" && -n "${NEXTCLOUD_S3_REGION:-}" ]]; then
php$PHP_VER <<EOF > $CONFIG_TEMP && mv $CONFIG_TEMP $STORAGE_ROOT/owncloud/config.php;
<?php
include("$STORAGE_ROOT/owncloud/config.php");
\$CONFIG['objectstore'] = array(
'class' => '\\OC\\Files\\ObjectStore\\S3',
'arguments' => array(
'bucket' => '$NEXTCLOUD_S3_BUCKET',
'autocreate' => false,
'use_ssl' => true,
'region' => '$NEXTCLOUD_S3_REGION'
),
);
echo "<?php\n\\\$CONFIG = ";
var_export(\$CONFIG);
echo ";";
?>
EOF
chown www-data.www-data $STORAGE_ROOT/owncloud/config.php
fi
# Enable/disable apps. Note that this must be done after the Nextcloud setup.
# The firstrunwizard gave Josh all sorts of problems, so disabling that.
# user_external is what allows Nextcloud to use IMAP for login. The contacts