diff --git a/.gitignore b/.gitignore index 9e232d380..4ee250e08 100644 --- a/.gitignore +++ b/.gitignore @@ -1,10 +1,12 @@ .DS_Store .python-version +.mise.toml venv/ *.swp docker/cache/ ansible/image-manifest*.json +testinfra-aio-container-logs.log # Byte-compiled / optimized / DLL files __pycache__/ diff --git a/ansible/vars.yml b/ansible/vars.yml index adfc2351b..986ae2ac8 100644 --- a/ansible/vars.yml +++ b/ansible/vars.yml @@ -46,7 +46,7 @@ postgres_exporter_release_checksum: arm64: sha256:29ba62d538b92d39952afe12ee2e1f4401250d678ff4b354ff2752f4321c87a0 amd64: sha256:cb89fc5bf4485fb554e0d640d9684fae143a4b2d5fa443009bd29c59f9129e84 -adminapi_release: 0.63.5 +adminapi_release: 0.64.0 adminmgr_release: 0.19.0 # Postgres Extensions diff --git a/common.vars.pkr.hcl b/common.vars.pkr.hcl index 3f868970b..2e4bc0ced 100644 --- a/common.vars.pkr.hcl +++ b/common.vars.pkr.hcl @@ -1 +1 @@ -postgres-version = "15.1.1.49" +postgres-version = "15.1.1.50" diff --git a/docker/all-in-one/Dockerfile b/docker/all-in-one/Dockerfile index 360a5fbf7..c28bf1e15 100644 --- a/docker/all-in-one/Dockerfile +++ b/docker/all-in-one/Dockerfile @@ -1,9 +1,9 @@ -ARG postgres_version=15.1.1.24 +ARG postgres_version=15.1.1.49 ARG pgbouncer_release=1.18.0 ARG postgrest_release=10.1.2 ARG gotrue_release=2.130.0 -ARG adminapi_release=0.63.5 +ARG adminapi_release=0.64.0 ARG adminmgr_release=0.19.0 ARG vector_release=0.22.3 ARG postgres_exporter_release=0.15.0 diff --git a/docker/all-in-one/entrypoint.sh b/docker/all-in-one/entrypoint.sh index 56b58cc39..48311a413 100755 --- a/docker/all-in-one/entrypoint.sh +++ b/docker/all-in-one/entrypoint.sh @@ -80,10 +80,23 @@ function enable_lsn_checkpoint_push { } function disable_fail2ban { + sed -i "s/command=.*/command=sleep 5/" /etc/supervisor/services/fail2ban.conf sed -i "s/autostart=.*/autostart=false/" /etc/supervisor/services/fail2ban.conf sed -i "s/autorestart=.*/autorestart=false/" /etc/supervisor/services/fail2ban.conf } +function disable_gotrue { + sed -i "s/command=.*/command=sleep 5/" /etc/supervisor/services/gotrue.conf + sed -i "s/autostart=.*/autostart=false/" /etc/supervisor/services/gotrue.conf + sed -i "s/autorestart=.*/autorestart=false/" /etc/supervisor/services/gotrue.conf +} + +function disable_pgbouncer { + sed -i "s/command=.*/command=sleep 5/" /etc/supervisor/services/pgbouncer.conf + sed -i "s/autostart=.*/autostart=false/" /etc/supervisor/services/pgbouncer.conf + sed -i "s/autorestart=.*/autorestart=false/" /etc/supervisor/services/pgbouncer.conf +} + function setup_postgres { tar -xzvf "$INIT_PAYLOAD_PATH" -C / ./etc/postgresql.schema.sql mv /etc/postgresql.schema.sql /docker-entrypoint-initdb.d/migrations/99-schema.sql @@ -285,8 +298,11 @@ if [ "${FAIL2BAN_DISABLED:-}" == "true" ]; then fi if [ "${GOTRUE_DISABLED:-}" == "true" ]; then - sed -i "s/autostart=.*/autostart=false/" /etc/supervisor/services/gotrue.conf - sed -i "s/autorestart=.*/autorestart=false/" /etc/supervisor/services/gotrue.conf + disable_gotrue +fi + +if [ "${PGBOUNCER_DISABLED:-}" == "true" ]; then + disable_pgbouncer fi if [ "${PLATFORM_DEPLOYMENT:-}" == "true" ]; then diff --git a/docker/all-in-one/etc/supervisor/services/pgbouncer.conf b/docker/all-in-one/etc/supervisor/services/pgbouncer.conf index 44fe93b5f..6926c34bc 100644 --- a/docker/all-in-one/etc/supervisor/services/pgbouncer.conf +++ b/docker/all-in-one/etc/supervisor/services/pgbouncer.conf @@ -2,8 +2,8 @@ command=/usr/sbin/pgbouncer /etc/pgbouncer/pgbouncer.ini user=pgbouncer stopsignal=INT -autorestart=true -autostart=true +autorestart=false +autostart=false stdout_logfile=/var/log/services/pgbouncer.log redirect_stderr=true stdout_logfile_maxbytes=10MB diff --git a/docker/all-in-one/healthcheck.sh b/docker/all-in-one/healthcheck.sh index 039b461f1..0b5c9607d 100755 --- a/docker/all-in-one/healthcheck.sh +++ b/docker/all-in-one/healthcheck.sh @@ -33,9 +33,6 @@ else kong health fi -# pgbouncer up -printf \\0 > "/dev/tcp/localhost/$PGBOUNCER_PORT" - # fail2ban up fail2ban-client status diff --git a/docker/all-in-one/init/configure-gotrue.sh b/docker/all-in-one/init/configure-gotrue.sh index e3d99f0e6..5fe4ad25e 100755 --- a/docker/all-in-one/init/configure-gotrue.sh +++ b/docker/all-in-one/init/configure-gotrue.sh @@ -27,9 +27,11 @@ if [ "${DATA_VOLUME_MOUNTPOINT}" ]; then fi if [ -f "${INIT_PAYLOAD_PATH:-}" ]; then - echo "init gotrue payload" - tar -h --overwrite -xzvf "$INIT_PAYLOAD_PATH" -C / ./etc/gotrue.env - chown -R adminapi:adminapi /etc/gotrue.env + if [ ! -f "${CONFIGURED_FLAG_PATH}" ]; then + echo "init gotrue payload" + tar -h --overwrite -xzvf "$INIT_PAYLOAD_PATH" -C / ./etc/gotrue.env + chown -R adminapi:adminapi /etc/gotrue.env + fi else sed -i "s|api_external_url|${API_EXTERNAL_URL:-http://localhost}|g" /etc/gotrue.env sed -i "s|gotrue_api_host|${GOTRUE_API_HOST:-0.0.0.0}|g" /etc/gotrue.env diff --git a/docker/all-in-one/opt/postgres_exporter/queries.yml b/docker/all-in-one/opt/postgres_exporter/queries.yml index 83cfeed44..fe065247a 100644 --- a/docker/all-in-one/opt/postgres_exporter/queries.yml +++ b/docker/all-in-one/opt/postgres_exporter/queries.yml @@ -170,6 +170,15 @@ pg_stat_statements: usage: "COUNTER" description: "Total time spent, in seconds" +pg_ls_archive_statusdir: + master: true + cache_seconds: 60 + query: "select count(*) as wal_pending_count from pg_ls_archive_statusdir() where name like '%.ready'" + metrics: + - wal_pending_count: + usage: "COUNTER" + description: "Number of not yet archived WAL files" + auth_users: master: true cache_seconds: 60