Miniflux: use config environment for container, hide pg pass

This commit is contained in:
Benoit 2025-02-14 20:58:06 +09:00
parent 11bad22083
commit e8669a692e
Signed by: Benoit
SSH key fingerprint: SHA256:kFsX94Kq6z/6CY0dX+7/FpAeJC0QlMhJVY+B7NYrOmA

View file

@ -10,7 +10,7 @@ VER="${VER//./-}"
UPSTREAM_VER="2.2.5"
UPSTREAM_VER_DASH="${UPSTREAM_VER//[.+]/-}"
UPSTREAM_NAME="miniflux"
SERIAL="2benoitjpnet"
SERIAL="3benoitjpnet"
CNAME="$UPSTREAM_NAME-$UPSTREAM_VER_DASH-$SERIAL-$DIST-$VER"
ALIAS="$UPSTREAM_NAME-$UPSTREAM_VER-$SERIAL"
@ -19,11 +19,9 @@ incus launch images:$IMAGE "$CNAME" --quiet
wait_network "$CNAME"
incus exec "$CNAME" -- bash -c 'cat >> /etc/environment << EOL
DEBIAN_FRONTEND=noninteractive
DEBCONF_NONINTERACTIVE_SEEN=true
LC_ALL=C
EOL'
incus config set "$CNAME" environment.DEBIAN_FRONTEND=noninteractive
incus config set "$CNAME" environment.DEBCONF_NONINTERACTIVE_SEEN=true
incus config set "$CNAME" environment.LC_ALL=C
incus exec "$CNAME" -- bash -c 'echo "deb [trusted=yes] https://repo.miniflux.app/apt/ * *" > /etc/apt/sources.list.d/miniflux.list'
incus exec "$CNAME" -- apt update
incus exec "$CNAME" -- apt upgrade -y
@ -35,8 +33,8 @@ set +x
PG_PASS=$(openssl rand -hex 32)
incus file push <(sed "s/SED_PG_PASS/$PG_PASS/" "$WORKSPACE"/miniflux.conf) \
"$CNAME"/etc/miniflux.conf
set -x
incus exec "$CNAME" -- bash -c "sudo -u postgres psql -c \"CREATE USER miniflux WITH PASSWORD '${PG_PASS}';\""
set -x
incus exec "$CNAME" -- bash -c 'sudo -u postgres psql -c "CREATE DATABASE miniflux OWNER miniflux;"'
incus exec "$CNAME" -- systemctl enable miniflux