Document S3 examples and refresh template
This commit is contained in:
@@ -7,7 +7,7 @@
|
||||
"contactEmail": "contact@ente.io",
|
||||
"tagline": "Open Source End-to-End Encrypted Photos & Authentication",
|
||||
"upstreamVersion": "1.0.0",
|
||||
"version": "0.1.119",
|
||||
"version": "0.1.121",
|
||||
"healthCheckPath": "/ping",
|
||||
"httpPort": 3080,
|
||||
"memoryLimit": 1073741824,
|
||||
|
@@ -11,7 +11,7 @@ Before you can use Ente, you need to configure an S3-compatible storage service:
|
||||
```
|
||||
nano /app/data/config/s3.env
|
||||
```
|
||||
5. Uncomment the variables you need and fill in your S3 credentials (AWS S3, MinIO, DigitalOcean Spaces, etc.)
|
||||
5. Uncomment the variables you need and fill in your S3 credentials (AWS S3, Cloudflare R2, MinIO, etc.). The file includes commented examples for the previous Wasabi defaults and a generic Cloudflare R2 setup.
|
||||
6. Save the file and restart your Ente app from the Cloudron dashboard
|
||||
|
||||
## Next Steps
|
||||
|
42
start.sh
42
start.sh
@@ -94,21 +94,26 @@ DEFAULT_S3_BUCKET="ente-due-ren"
|
||||
S3_CONFIG_DIR="/app/data/config"
|
||||
S3_CONFIG_FILE="$S3_CONFIG_DIR/s3.env"
|
||||
|
||||
mkdir -p "$S3_CONFIG_DIR"
|
||||
|
||||
if [ -f "$S3_CONFIG_FILE" ]; then
|
||||
log "INFO" "Loading S3 configuration overrides from $S3_CONFIG_FILE"
|
||||
# shellcheck disable=SC1090
|
||||
set -a
|
||||
. "$S3_CONFIG_FILE"
|
||||
set +a
|
||||
else
|
||||
log "INFO" "S3 configuration file not found, writing template to $S3_CONFIG_FILE"
|
||||
write_default_s3_template() {
|
||||
cat > "$S3_CONFIG_FILE" << 'EOF'
|
||||
# S3 configuration overrides for Ente on Cloudron.
|
||||
# Uncomment and set any of the variables below to override the packaged defaults.
|
||||
# After editing this file, restart the Ente app from the Cloudron dashboard.
|
||||
#
|
||||
# Example (previous Wasabi defaults bundled with this package):
|
||||
#S3_ACCESS_KEY=QZ5M3VMBUHDTIFDFCD8E
|
||||
#S3_SECRET_KEY=pz1eHYjU1NwAbbruedc7swzCuszd57p1rGSFVzjv
|
||||
#S3_ENDPOINT=https://s3.eu-central-2.wasabisys.com
|
||||
#S3_REGION=eu-central-2
|
||||
#S3_BUCKET=ente-due-ren
|
||||
#
|
||||
# Example (Cloudflare R2 — replace placeholders):
|
||||
#S3_ACCESS_KEY=R2_ACCESS_KEY
|
||||
#S3_SECRET_KEY=R2_SECRET_KEY
|
||||
#S3_ENDPOINT=https://<ACCOUNT_ID>.r2.cloudflarestorage.com
|
||||
#S3_REGION=auto
|
||||
#S3_BUCKET=<bucket-name>
|
||||
#
|
||||
#S3_ACCESS_KEY=
|
||||
#S3_SECRET_KEY=
|
||||
#S3_ENDPOINT=
|
||||
@@ -116,6 +121,23 @@ else
|
||||
#S3_BUCKET=
|
||||
EOF
|
||||
chown cloudron:cloudron "$S3_CONFIG_FILE" || true
|
||||
}
|
||||
|
||||
mkdir -p "$S3_CONFIG_DIR"
|
||||
|
||||
if [ -f "$S3_CONFIG_FILE" ]; then
|
||||
if ! grep -q "previous Wasabi defaults" "$S3_CONFIG_FILE" && ! grep -Eq '^[[:space:]]*[^#[:space:]]' "$S3_CONFIG_FILE"; then
|
||||
log "INFO" "Refreshing S3 configuration template with example values"
|
||||
write_default_s3_template
|
||||
fi
|
||||
log "INFO" "Loading S3 configuration overrides from $S3_CONFIG_FILE"
|
||||
# shellcheck disable=SC1090
|
||||
set -a
|
||||
. "$S3_CONFIG_FILE"
|
||||
set +a
|
||||
else
|
||||
log "INFO" "S3 configuration file not found, writing template to $S3_CONFIG_FILE"
|
||||
write_default_s3_template
|
||||
fi
|
||||
|
||||
S3_ACCESS_KEY="${S3_ACCESS_KEY:-$DEFAULT_S3_ACCESS_KEY}"
|
||||
|
Reference in New Issue
Block a user