diff --git a/setup/nextcloud.sh b/setup/nextcloud.sh index b79de327..8552a8cd 100755 --- a/setup/nextcloud.sh +++ b/setup/nextcloud.sh @@ -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 < $CONFIG_TEMP && mv $CONFIG_TEMP $STORAGE_ROOT/owncloud/config.php; + '\\OC\\Files\\ObjectStore\\S3', + 'arguments' => array( + 'bucket' => '$NEXTCLOUD_S3_BUCKET', + 'autocreate' => false, + 'use_ssl' => true, + 'region' => '$NEXTCLOUD_S3_REGION' + ), +); + +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