From b65bcc9cbefe551de44c010169c969f03caefac4 Mon Sep 17 00:00:00 2001 From: Alexandre <44178713+alexbelgium@users.noreply.github.com> Date: Wed, 16 Jul 2025 15:50:00 +0200 Subject: [PATCH] update --- ente/config.json | 2 +- ente/rootfs/etc/config/museum.yaml | 15 ------- .../cont-init.d/20-internal-db-bootstrap.sh | 3 -- ente/rootfs/etc/services.d/00-postgres/run | 39 ------------------- .../etc/services.d/01-postgres-init/run | 35 ----------------- ente/rootfs/etc/services.d/02-minio/run | 10 ----- ente/rootfs/etc/services.d/03-minio-init/run | 18 --------- ente/rootfs/etc/services.d/04-museum/run | 29 -------------- ente/rootfs/etc/services.d/05-web/run | 11 ------ 9 files changed, 1 insertion(+), 161 deletions(-) delete mode 100644 ente/rootfs/etc/config/museum.yaml delete mode 100755 ente/rootfs/etc/cont-init.d/20-internal-db-bootstrap.sh delete mode 100644 ente/rootfs/etc/services.d/00-postgres/run delete mode 100755 ente/rootfs/etc/services.d/01-postgres-init/run delete mode 100644 ente/rootfs/etc/services.d/02-minio/run delete mode 100755 ente/rootfs/etc/services.d/03-minio-init/run delete mode 100644 ente/rootfs/etc/services.d/04-museum/run delete mode 100644 ente/rootfs/etc/services.d/05-web/run diff --git a/ente/config.json b/ente/config.json index f818acf45..bb6b0600a 100644 --- a/ente/config.json +++ b/ente/config.json @@ -78,7 +78,7 @@ "startup": "services", "udev": true, "url": "https://github.com/alexbelgium/hassio-addons", - "version": "1.0.0test11", + "version": "1.0.0test12", "video": true, "webui": "http://[HOST]:[PORT:3000]" } diff --git a/ente/rootfs/etc/config/museum.yaml b/ente/rootfs/etc/config/museum.yaml deleted file mode 100644 index c98672577..000000000 --- a/ente/rootfs/etc/config/museum.yaml +++ /dev/null @@ -1,15 +0,0 @@ -db: - host: "${DB_HOSTNAME}" - port: ${DB_PORT} - name: "${DB_DATABASE_NAME}" - user: "${DB_USERNAME}" - password: "${DB_PASSWORD}" - -s3: - are_local_buckets: true - b2-eu-cen: - key: "${MINIO_ROOT_USER}" - secret: "${MINIO_ROOT_PASSWORD}" - endpoint: "http://localhost:3200" - region: "eu-central-2" - bucket: "${S3_BUCKET}" diff --git a/ente/rootfs/etc/cont-init.d/20-internal-db-bootstrap.sh b/ente/rootfs/etc/cont-init.d/20-internal-db-bootstrap.sh deleted file mode 100755 index 9d06e9a97..000000000 --- a/ente/rootfs/etc/cont-init.d/20-internal-db-bootstrap.sh +++ /dev/null @@ -1,3 +0,0 @@ -#!/usr/bin/with-contenv bashio -set -euo pipefail -exit 0 diff --git a/ente/rootfs/etc/services.d/00-postgres/run b/ente/rootfs/etc/services.d/00-postgres/run deleted file mode 100644 index 6b3eee9b7..000000000 --- a/ente/rootfs/etc/services.d/00-postgres/run +++ /dev/null @@ -1,39 +0,0 @@ -#!/usr/bin/with-contenv bashio -# shellcheck shell=bash -set -euo pipefail - -if bashio::config.true 'USE_EXTERNAL_DB'; then - bashio::log.info "External DB requested; skipping internal Postgres service." - exit 0 -fi - -# Create folder structure -mkdir -p /run/postgresql -chown postgres:postgres /run/postgresql -chmod 775 /run/postgresql - -# Persistent location -PGDATA="${PGDATA:-/config/postgres-data}" -export PGDATA - -# Create and secure PGDATA -mkdir -p "$PGDATA" -chown -R postgres:postgres "$PGDATA" -chmod 0700 "$PGDATA" - -INITDB="$(command -v initdb || echo /usr/bin/initdb)" -POSTGRES="$(command -v postgres || echo /usr/bin/postgres)" - -if [[ ! -x "$INITDB" || ! -x "$POSTGRES" ]]; then - bashio::log.error "PostgreSQL binaries not found." - exit 1 -fi - -if [[ ! -s "${PGDATA}/PG_VERSION" ]]; then - bashio::log.info "Initializing Postgres data directory..." - # Alpine’s initdb runs as the postgres user - su - postgres -c "$INITDB -D $PGDATA" -fi - -exec su - postgres -c "$POSTGRES -D $PGDATA -c listen_addresses='127.0.0.1'" & \ -bashio::log.info "Starting Postgres (127.0.0.1:5432)..." diff --git a/ente/rootfs/etc/services.d/01-postgres-init/run b/ente/rootfs/etc/services.d/01-postgres-init/run deleted file mode 100755 index 2c46f076f..000000000 --- a/ente/rootfs/etc/services.d/01-postgres-init/run +++ /dev/null @@ -1,35 +0,0 @@ -#!/usr/bin/with-contenv bashio -# shellcheck shell=bash -set -euo pipefail - -if bashio::config.true 'USE_EXTERNAL_DB'; then - # External DB; nothing to create here. - exit 0 -fi - -DB_USER="$(bashio::config 'DB_USERNAME')" -DB_PASS="$(bashio::config 'DB_PASSWORD')" -DB_NAME="$(bashio::config 'DB_DATABASE_NAME')" - -bashio::log.info "Postgres-init: waiting for local Postgres..." -until pg_isready -q -h 127.0.0.1 -p 5432 -U postgres; do - sleep 1 -done - -bashio::log.info "Postgres-init: creating role/database if missing..." -# psql search_path safe quoting using dollar-quoted strings for password -psql -v ON_ERROR_STOP=1 -h 127.0.0.1 -p 5432 -U postgres </dev/null; do - sleep 1 -done - -bashio::log.info "MinIO-init: ensuring bucket ${S3_BUCKET}..." -/usr/local/bin/mc mb -p "h0/${S3_BUCKET}" || true - -bashio::log.info "MinIO-init: done." -exit 0 diff --git a/ente/rootfs/etc/services.d/04-museum/run b/ente/rootfs/etc/services.d/04-museum/run deleted file mode 100644 index f7ef1ed55..000000000 --- a/ente/rootfs/etc/services.d/04-museum/run +++ /dev/null @@ -1,29 +0,0 @@ -#!/usr/bin/with-contenv bashio -# shellcheck shell=bash -set -euo pipefail - -CFG=/config/museum.yaml -if ! bashio::fs.file_exists "$CFG"; then - bashio::log.error "$CFG not found; aborting museum start." - exit 1 -fi - -if bashio::config.true 'USE_EXTERNAL_DB'; then - DB_HOST="$(bashio::config 'DB_HOSTNAME')" - DB_PORT="$(bashio::config 'DB_PORT')" - DB_USER="$(bashio::config 'DB_USERNAME')" - bashio::log.info "Museum: waiting for external Postgres at ${DB_HOST}:${DB_PORT}..." - until pg_isready -q -h "${DB_HOST}" -p "${DB_PORT}" -U "${DB_USER}"; do - sleep 2 - done -else - # We'll connect as DB_USER (the one we created), not postgres superuser - DB_USER="$(bashio::config 'DB_USERNAME')" - bashio::log.info "Museum: waiting for internal Postgres..." - until pg_isready -q -h 127.0.0.1 -p 5432 -U "${DB_USER}"; do - sleep 2 - done -fi - -exec /usr/bin/museum --config "$CFG" & \ -bashio::log.info "Starting museum." diff --git a/ente/rootfs/etc/services.d/05-web/run b/ente/rootfs/etc/services.d/05-web/run deleted file mode 100644 index 520c32a4f..000000000 --- a/ente/rootfs/etc/services.d/05-web/run +++ /dev/null @@ -1,11 +0,0 @@ -#!/usr/bin/with-contenv bashio -# shellcheck shell=bash -set -euo pipefail - -if bashio::config.true 'DISABLE_WEB_UI'; then - bashio::log.info "Web UI disabled." - exit 0 -fi - -exec /usr/bin/ente-web & \ -bashio::log.info "Starting Ente web."