From 00577386d28faa21667bd45d072cd1bfa898359d Mon Sep 17 00:00:00 2001 From: Claude Date: Thu, 4 Jun 2026 14:19:36 +0000 Subject: [PATCH] ente: disable per-account storage limit by default (NO_STORAGE_LIMIT) Ente's --no-limit is only available per-user via the interactive admin CLI, so to make unlimited storage the default for all current and future accounts the add-on now reconciles the museum subscriptions table directly (the method documented by the Ente maintainers): every account is granted 100 TB of storage and ~100 years of validity, matching what `ente admin update-subscription --no-limit` writes. - New NO_STORAGE_LIMIT option (default true); set false to keep Ente's limits - Background reconcile re-applies every 60s so newly registered users are covered; storage and expiry are updated independently and tolerate errors so a transient DB hiccup or schema change can't break startup - Document the option and the full port list in the README https://claude.ai/code/session_01MaLKhb2CJiF9Fb3Dyr585r --- ente/CHANGELOG.md | 5 +++ ente/README.md | 5 +++ ente/config.yaml | 4 ++- ente/rootfs/etc/cont-init.d/99-run.sh | 46 +++++++++++++++++++++++++++ 4 files changed, 59 insertions(+), 1 deletion(-) diff --git a/ente/CHANGELOG.md b/ente/CHANGELOG.md index b952435ba9..1804315daa 100644 --- a/ente/CHANGELOG.md +++ b/ente/CHANGELOG.md @@ -1,3 +1,8 @@ +## 4.4.22-7 (04-06-2026) +- Disable the per-account storage limit by default via the new NO_STORAGE_LIMIT + option (default true). Grants every account 100 TB and ~100 years validity, + equivalent to `ente admin update-subscription --no-limit`. Set to false to + keep Ente's default storage limits. ## 4.4.22-6 (04-06-2026) - Fix SIGPIPE (exit 141) on startup: tr piped to head -c against /dev/urandom now suppresses the expected SIGPIPE under set -o pipefail diff --git a/ente/README.md b/ente/README.md index 002eadca90..17a8db1c1d 100644 --- a/ente/README.md +++ b/ente/README.md @@ -55,6 +55,7 @@ Webui can be found at . |--------|------|---------|-------------| | `ENTE_ENDPOINT_URL` | str | `http://homeassistant.local:8280` | The URL where Ente API will be accessible (used by web UI) | | `DB_PASSWORD` | str | `ente` | Database password for internal PostgreSQL | +| `NO_STORAGE_LIMIT` | bool | `true` | Remove the per-account storage limit (grants every account 100 TB and ~100 years validity, equivalent to `ente admin update-subscription --no-limit`). Set to `false` to keep the default Ente storage limits. | | `USE_EXTERNAL_DB` | bool | `false` | Use external PostgreSQL database | | `TZ` | str | `Europe/Paris` | Timezone setting | @@ -132,6 +133,10 @@ After starting the addon for the first time: The addon exposes the following ports: - **8300** (3000/tcp): Ente web UI +- **8301** (3001/tcp): Ente Accounts +- **8302** (3002/tcp): Ente Albums +- **8303** (3003/tcp): Ente Auth +- **8304** (3004/tcp): Ente Cast - **8305** (3005/tcp): Ente Share - **8306** (3006/tcp): Ente Embed - **8307** (3007/tcp): Ente Paste diff --git a/ente/config.yaml b/ente/config.yaml index 1bb6595d88..bcd330cc3e 100644 --- a/ente/config.yaml +++ b/ente/config.yaml @@ -82,6 +82,7 @@ options: env_vars: [] DB_PASSWORD: ente ENTE_ENDPOINT_URL: http://homeassistant.local:8280 + NO_STORAGE_LIMIT: true TZ: Europe/Paris USE_EXTERNAL_DB: false ports: @@ -121,6 +122,7 @@ schema: DB_PORT: int? DB_USERNAME: str? ENTE_ENDPOINT_URL: str + NO_STORAGE_LIMIT: bool? TZ: str? USE_EXTERNAL_DB: bool? cifsdomain: str? @@ -131,6 +133,6 @@ schema: slug: ente udev: true url: https://github.com/alexbelgium/hassio-addons -version: "4.4.22-6" +version: "4.4.22-7" video: true webui: http://[HOST]:[PORT:3000] diff --git a/ente/rootfs/etc/cont-init.d/99-run.sh b/ente/rootfs/etc/cont-init.d/99-run.sh index c402b3f77d..6b8b0423d3 100755 --- a/ente/rootfs/etc/cont-init.d/99-run.sh +++ b/ente/rootfs/etc/cont-init.d/99-run.sh @@ -62,6 +62,13 @@ else bashio::log.info "Using internal Postgres." fi +# Disable per-account storage limits by default (mirrors `ente admin +# update-subscription --no-limit`). Set NO_STORAGE_LIMIT=false to keep limits. +NO_STORAGE_LIMIT=true +if bashio::config.false 'NO_STORAGE_LIMIT'; then + NO_STORAGE_LIMIT=false +fi + # Active DB connection target (may be overridden below) if $USE_EXTERNAL_DB; then DB_HOST="$DB_HOST_EXT" @@ -246,6 +253,43 @@ start_web() { WEB_PID=$! } +############################################ +# Storage limit (no-limit) reconcile +############################################ +# Equivalent of `ente admin update-subscription --no-limit`: grant every +# account 100 TB of storage and ~100 years of validity. The Ente CLI only +# supports this per-user and interactively, so to make it the default for all +# current and future accounts we reconcile the museum `subscriptions` table +# directly (the method documented by the Ente maintainers). Runs in the +# background and re-applies periodically so newly registered users are covered. +NO_LIMIT_STORAGE_BYTES=109951162777600 # 100 * 1024^4 (100 TiB) +NO_LIMIT_EXPIRY_SQL="(extract(epoch from now() + interval '100 years') * 1000000)::bigint" + +reconcile_no_limit() { + export PGPASSWORD="$DB_PASS" + while true; do + # Storage is the limit that actually enforces quota; apply it first and + # independently so a schema change to other columns can't block it. + psql -h "$DB_HOST" -p "$DB_PORT" -U "$DB_USER" -d "$DB_NAME" \ + -c "UPDATE subscriptions SET storage = ${NO_LIMIT_STORAGE_BYTES} WHERE storage < ${NO_LIMIT_STORAGE_BYTES};" \ + > /dev/null 2>&1 || true + psql -h "$DB_HOST" -p "$DB_PORT" -U "$DB_USER" -d "$DB_NAME" \ + -c "UPDATE subscriptions SET expiry_time = ${NO_LIMIT_EXPIRY_SQL} WHERE expiry_time < ${NO_LIMIT_EXPIRY_SQL};" \ + > /dev/null 2>&1 || true + sleep 60 + done +} + +start_no_limit_reconcile() { + if ! $NO_STORAGE_LIMIT; then + bashio::log.info "NO_STORAGE_LIMIT disabled; per-account storage limits stay in effect." + return 0 + fi + bashio::log.info "NO_STORAGE_LIMIT enabled; granting unlimited storage to all accounts." + reconcile_no_limit & + NO_LIMIT_PID=$! +} + ############################################ # Museum (API) ############################################ @@ -296,5 +340,7 @@ wait_minio_ready_and_bucket start_web +start_no_limit_reconcile + # Foreground — keeps container alive start_museum_foreground