Merge pull request #2510 from alexbelgium/copilot/fix-readme-postgresql-config

joplin: Fix PostgreSQL-only support — remove MariaDB misleading config, add DB_CLIENT guard
This commit is contained in:
Alexandre
2026-02-21 11:21:09 +01:00
committed by GitHub
2 changed files with 13 additions and 7 deletions

View File

@@ -46,7 +46,7 @@ Webui can be found at `<your-ip>:22300`.
|--------|------|---------|-------------| |--------|------|---------|-------------|
| `APP_BASE_URL` | str | `http://your_domain:port` | Base public URL where the service will be running | | `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 | | `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_HOST` | str | | PostgreSQL server hostname |
| `POSTGRES_PORT` | int | | PostgreSQL server port | | `POSTGRES_PORT` | int | | PostgreSQL server port |
| `POSTGRES_DATABASE` | str | | PostgreSQL database name | | `POSTGRES_DATABASE` | str | | PostgreSQL database name |
@@ -67,8 +67,8 @@ Webui can be found at `<your-ip>:22300`.
APP_BASE_URL: "http://192.168.1.100:22300" APP_BASE_URL: "http://192.168.1.100:22300"
data_location: "/config/addons_config/joplin" data_location: "/config/addons_config/joplin"
DB_CLIENT: "pg" DB_CLIENT: "pg"
POSTGRES_HOST: "core-mariadb" POSTGRES_HOST: "your-postgres-host"
POSTGRES_PORT: 3306 POSTGRES_PORT: 5432
POSTGRES_DATABASE: "joplin" POSTGRES_DATABASE: "joplin"
POSTGRES_USER: "joplin" POSTGRES_USER: "joplin"
POSTGRES_PASSWORD: "secure_password" POSTGRES_PASSWORD: "secure_password"
@@ -84,11 +84,13 @@ MAILER_NOREPLY_EMAIL: "noreply@yourdomain.com"
### Database Setup ### 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) > **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`.
2. Create a database and user for Joplin
3. Configure the PostgreSQL options in the Joplin addon 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 4. Restart the addon
Make sure the provided database and user exist as the server will not create them automatically. Make sure the provided database and user exist as the server will not create them automatically.

View File

@@ -110,6 +110,10 @@ if bashio::config.has_value 'POSTGRES_DATABASE'; then
bashio::log.info "Using postgres" bashio::log.info "Using postgres"
bashio::config.has_value 'DB_CLIENT' && export DB_CLIENT="$(bashio::config 'DB_CLIENT')" 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_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_DATABASE' && export POSTGRES_DATABASE="$(bashio::config 'POSTGRES_DATABASE')"
bashio::config.has_value 'POSTGRES_USER' && export POSTGRES_USER="$(bashio::config 'POSTGRES_USER')" bashio::config.has_value 'POSTGRES_USER' && export POSTGRES_USER="$(bashio::config 'POSTGRES_USER')"