From 5f80439cb02f43081a523fb8de54793287763f17 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Sat, 21 Feb 2026 10:18:57 +0000 Subject: [PATCH] Fix Joplin MariaDB misconfiguration: update README and add DB_CLIENT validation Co-authored-by: alexbelgium <44178713+alexbelgium@users.noreply.github.com> --- joplin/README.md | 16 +++++++++------- joplin/rootfs/etc/cont-init.d/99-run.sh | 4 ++++ 2 files changed, 13 insertions(+), 7 deletions(-) diff --git a/joplin/README.md b/joplin/README.md index 8bac53f2b..662012de3 100644 --- a/joplin/README.md +++ b/joplin/README.md @@ -46,7 +46,7 @@ Webui can be found at `:22300`. |--------|------|---------|-------------| | `APP_BASE_URL` | str | `http://your_domain:port` | Base public URL where the service will be running | | `data_location` | str | `/config/addons_config/joplin` | Path where Joplin data is stored | -| `DB_CLIENT` | str | | Database client type (e.g., `pg` for PostgreSQL) | +| `DB_CLIENT` | str | | Database client type. Only `pg` (PostgreSQL) is supported. MariaDB/MySQL is NOT supported. | | `POSTGRES_HOST` | str | | PostgreSQL server hostname | | `POSTGRES_PORT` | int | | PostgreSQL server port | | `POSTGRES_DATABASE` | str | | PostgreSQL database name | @@ -67,8 +67,8 @@ Webui can be found at `:22300`. APP_BASE_URL: "http://192.168.1.100:22300" data_location: "/config/addons_config/joplin" DB_CLIENT: "pg" -POSTGRES_HOST: "core-mariadb" -POSTGRES_PORT: 3306 +POSTGRES_HOST: "your-postgres-host" +POSTGRES_PORT: 5432 POSTGRES_DATABASE: "joplin" POSTGRES_USER: "joplin" POSTGRES_PASSWORD: "secure_password" @@ -84,11 +84,13 @@ MAILER_NOREPLY_EMAIL: "noreply@yourdomain.com" ### Database Setup -Joplin Server uses SQLite by default, but for production use, PostgreSQL is recommended: +Joplin Server uses SQLite by default, but for production use, PostgreSQL is recommended. -1. Install and configure a PostgreSQL addon (e.g., MariaDB addon) -2. Create a database and user for Joplin -3. Configure the PostgreSQL options in the Joplin addon +> **Important:** Joplin Server only supports **PostgreSQL** as an external database. MariaDB/MySQL is **not** supported. You must install a PostgreSQL addon (not the MariaDB addon) and set `DB_CLIENT` to `pg`. + +1. Install and configure a PostgreSQL addon +2. Create a database and user for Joplin in PostgreSQL +3. Configure the PostgreSQL options in the Joplin addon (use port `5432`, not `3306`) 4. Restart the addon Make sure the provided database and user exist as the server will not create them automatically. diff --git a/joplin/rootfs/etc/cont-init.d/99-run.sh b/joplin/rootfs/etc/cont-init.d/99-run.sh index ec26f19e5..b59858b91 100755 --- a/joplin/rootfs/etc/cont-init.d/99-run.sh +++ b/joplin/rootfs/etc/cont-init.d/99-run.sh @@ -110,6 +110,10 @@ if bashio::config.has_value 'POSTGRES_DATABASE'; then bashio::log.info "Using postgres" bashio::config.has_value 'DB_CLIENT' && export DB_CLIENT="$(bashio::config 'DB_CLIENT')" + if [[ "${DB_CLIENT:-}" != "pg" ]]; then + bashio::log.warning "DB_CLIENT is '${DB_CLIENT:-}' but only 'pg' (PostgreSQL) is supported. Overriding to 'pg'." + export DB_CLIENT="pg" + fi bashio::config.has_value 'POSTGRES_PASSWORD' && export POSTGRES_PASSWORD="$(bashio::config 'POSTGRES_PASSWORD')" bashio::config.has_value 'POSTGRES_DATABASE' && export POSTGRES_DATABASE="$(bashio::config 'POSTGRES_DATABASE')" bashio::config.has_value 'POSTGRES_USER' && export POSTGRES_USER="$(bashio::config 'POSTGRES_USER')"