Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enables Nextcloud data to be stored in S3 #2259

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
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
24 changes: 24 additions & 0 deletions setup/nextcloud.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down