PostgreSQL backup tool with Point-In-Time-Recovery and restore verification
TypeScript backupbackupsdatabasedatabase-backupdevopsdockergolangkubernetesmariadbmongodbmysqlpgpostgrespostgresqls3self-hostedsystem-administrationtoolsweb-ui
FIX (docker): Start without the CHOWN capability and ship the OpenSSL the MySQL 26 client needs
Rostislav Dugin2f69fc3a64e4
diff --git a/.github/workflows/ci-release.yml b/.github/workflows/ci-release.ymlindex 9aeb3617..7d0b078c 100644--- a/.github/workflows/ci-release.yml+++ b/.github/workflows/ci-release.yml@@ -478,6 +478,16 @@ jobs:rm -f "$console_output"echo "console command OK"+ # A broken non-PostgreSQL bundle only logs a warning and disables that engine,+ # so the container stays healthy. The image ships every bundle, so any such+ # warning here means one of them cannot run in the image.+ echo "Checking that every bundled client tool runs in the image..."+ if docker logs databasus-dev-smoke 2>&1 | grep -F "client tools check failed"; then+ echo "a bundled client tool cannot run in the image"+ exit 1+ fi+ echo "client tools OK"+- name: Install Trivyrun: |sudo apt-get update@@ -695,6 +705,16 @@ jobs:rm -f "$console_output"echo "console command OK"+ # A broken non-PostgreSQL bundle only logs a warning and disables that engine,+ # so the container stays healthy. The image ships every bundle, so any such+ # warning here means one of them cannot run in the image.+ echo "Checking that every bundled client tool runs in the image..."+ if docker logs databasus-smoke 2>&1 | grep -F "client tools check failed"; then+ echo "a bundled client tool cannot run in the image"+ exit 1+ fi+ echo "client tools OK"+- name: Install Trivyrun: |sudo apt-get updatediff --git a/assets/tools/AGENTS.md b/assets/tools/AGENTS.mdindex 16065728..b37386ed 100644--- a/assets/tools/AGENTS.md+++ b/assets/tools/AGENTS.md@@ -45,7 +45,11 @@ first two items often end the job early.`objdump -T <binary> | grep -oE 'GLIBC_2\.[0-9]+' | sort -uV | tail -1`and list the shared libraries with `objdump -p <binary> | grep NEEDED`.Every library must already be in the image; see the table in- `README.md` in this directory.+ `README.md` in this directory. A matching soname is not enough: check+ the OpenSSL symbol versions the same way with `OPENSSL_3\.[0-9]+`,+ because bookworm ships OpenSSL 3.0 and a newer requirement fails only at+ run time. A development host with a newer OpenSSL hides the problem, so+ run the binary in the runtime image as the refresh checklist shows.- [ ] **Know which of the two identity shapes the engine uses.** MySQL'sidentity doubles as the name of its bundle directory, because each MySQLline gets a client of its own. MariaDB keeps two values, a serverdiff --git a/assets/tools/README.md b/assets/tools/README.mdindex 9e28a4b4..8f342160 100644--- a/assets/tools/README.md+++ b/assets/tools/README.md@@ -14,6 +14,8 @@ assets/tools/<arch>/pg_dump, pg_restore, psqlmysql/mysql-{5.7,8.0,8.4,9,26}/bin/mysql, mysqldump+ mysql/mysql-26/lib/private/+ libssl.so.3, libcrypto.so.3mariadb/mariadb-{10.6,12.3,13.0}/bin/mariadb, mariadb-dumpmongodb/bin/@@ -51,7 +53,9 @@ a `pg_dump` older than its sibling `pg_basebackup` is how issue #725 (pg_dump18.1 silently emitting wrong sequence values) survived unnoticed.Bundled MySQL patches (identical on both arches, upstream glibc2.28 tarballs-from `https://cdn.mysql.com/Downloads/MySQL-<line>/mysql-<patch>-linux-glibc2.28-{x86_64,aarch64}.tar.xz`):+from `https://cdn.mysql.com/Downloads/MySQL-<dir>/mysql-<patch>-linux-glibc2.28-{x86_64,aarch64}.tar.xz`,+where `<dir>` is the line for 5.7 through 9 and `<major>.<minor>` from 26 on,+for example `MySQL-26.7`):| bundle | patch | notes ||------------|--------|-------------------------------------------|@@ -59,7 +63,7 @@ from `https://cdn.mysql.com/Downloads/MySQL-<line>/mysql-<patch>-linux-glibc2.28| `mysql-8.0` | 8.0.46 | || `mysql-8.4` | 8.4.11 | long-term support line || `mysql-9` | 9.7.2 | serves every 9.x server |-| `mysql-26` | 26.7.0 | calendar scheme; serves every 26.x server |+| `mysql-26` | 26.7.0 | calendar scheme; serves every 26.x server; ships its own OpenSSL |Bundled MariaDB patches, unpacked from the vendor's own package repositoriesby `tools/refresh-mariadb-bundle.sh`:@@ -96,7 +100,7 @@ or lower):| library | needed by ||-------------------------------------|----------------------------------------------|| `libc`, `libm`, `libgcc_s`, `libstdc++` | everything |-| `libssl.so.3`, `libcrypto.so.3` | MySQL and MariaDB clients, `libpq` |+| `libssl.so.3`, `libcrypto.so.3` | MySQL 8.0 to 9 and MariaDB clients, `libpq` || `libz.so.1`, `libzstd.so.1`, `liblz4.so.1` | MariaDB clients, `libpq` || `libncurses.so.6`, `libtinfo.so.6` | MySQL 8.0+ and MariaDB interactive clients || `libncurses.so.5`, `libtinfo.so.5` | the MySQL 5.7 interactive client only |@@ -105,6 +109,12 @@ or lower):| `libpq.so.5` | the PostgreSQL clients || `libgssapi_krb5.so.2` | the MongoDB tools |+The MySQL 26 clients are the exception for OpenSSL: they call symbols from+OpenSSL 3.2, while bookworm ships 3.0. Their `RUNPATH` is+`$ORIGIN/../lib/private`, so `mysql-26/lib/private/` holds the `libssl.so.3`+and `libcrypto.so.3` (OpenSSL 3.5.7) from the same upstream tarball as the+binaries, and the loader picks them before the image's copies.+`libedit.so.2` is not installed explicitly in the `Dockerfile`: it reaches theimage as a dependency of `postgresql-common`. A change that drops that packagetakes the MariaDB interactive client with it. It is also the one soname adiff --git a/assets/tools/arm/mysql/mysql-26/lib/private/libcrypto.so.3 b/assets/tools/arm/mysql/mysql-26/lib/private/libcrypto.so.3new file mode 100644index 00000000..e3a13170Binary files /dev/null and b/assets/tools/arm/mysql/mysql-26/lib/private/libcrypto.so.3 differdiff --git a/assets/tools/arm/mysql/mysql-26/lib/private/libssl.so.3 b/assets/tools/arm/mysql/mysql-26/lib/private/libssl.so.3new file mode 100644index 00000000..ab43e104Binary files /dev/null and b/assets/tools/arm/mysql/mysql-26/lib/private/libssl.so.3 differdiff --git a/assets/tools/x64/mysql/mysql-26/lib/private/libcrypto.so.3 b/assets/tools/x64/mysql/mysql-26/lib/private/libcrypto.so.3new file mode 100644index 00000000..a152aff1Binary files /dev/null and b/assets/tools/x64/mysql/mysql-26/lib/private/libcrypto.so.3 differdiff --git a/assets/tools/x64/mysql/mysql-26/lib/private/libssl.so.3 b/assets/tools/x64/mysql/mysql-26/lib/private/libssl.so.3new file mode 100644index 00000000..6c1bfd03Binary files /dev/null and b/assets/tools/x64/mysql/mysql-26/lib/private/libssl.so.3 differdiff --git a/docker/start.sh b/docker/start.shindex f8cd9468..e25e05f3 100755--- a/docker/start.sh+++ b/docker/start.sh@@ -538,9 +538,9 @@ configure_application_database_dsn() {export DATABASE_DSN="host=localhost user=postgres password=${internal_postgres_password} dbname=databasus port=5437 sslmode=disable"- install -m 0600 -o databasus -g databasus /dev/null "${published_database_dsn_path}"+ # The runtime user creates the file itself, so startup needs no CHOWN capability.printf '%s\n' "${DATABASE_DSN}" \- | gosu databasus tee "${published_database_dsn_path}" >/dev/null+ | gosu databasus /bin/sh -c 'umask 077 && cat > "$1"' sh "${published_database_dsn_path}"}bootstrap_postgresql() {