From 8d6fc6fde0009b1dc72978853510707579337e36 Mon Sep 17 00:00:00 2001 From: Your Name Date: Mon, 29 Sep 2025 21:18:19 -0600 Subject: [PATCH] Document S3 examples and refresh template --- CloudronManifest.json | 2 +- POSTINSTALL.md | 2 +- start.sh | 42 ++++++++++++++++++++++++++++++++---------- 3 files changed, 34 insertions(+), 12 deletions(-) diff --git a/CloudronManifest.json b/CloudronManifest.json index 10b59b7..134ebe7 100644 --- a/CloudronManifest.json +++ b/CloudronManifest.json @@ -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, diff --git a/POSTINSTALL.md b/POSTINSTALL.md index 54816b1..46a26bd 100644 --- a/POSTINSTALL.md +++ b/POSTINSTALL.md @@ -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 diff --git a/start.sh b/start.sh index 148283e..aa35343 100644 --- a/start.sh +++ b/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://.r2.cloudflarestorage.com +#S3_REGION=auto +#S3_BUCKET= +# #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}"