From 74f930b69a5df8983bc25a61ceac8de0f376cbdd Mon Sep 17 00:00:00 2001 From: Gitead Date: Sat, 18 Apr 2026 19:57:17 -0400 Subject: [PATCH] docs: update Step 5 PostgreSQL setup for Debian (md5 auth, dentalapp db) --- README.md | 30 +++++++++++++++++++++++------- 1 file changed, 23 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index 1bfabc5..4e8436b 100644 --- a/README.md +++ b/README.md @@ -62,17 +62,33 @@ sudo apt-get install -y postgresql postgresql-contrib sudo systemctl enable postgresql sudo systemctl start postgresql -# Create a database and user (replace values as needed) -sudo -u postgres psql -c "CREATE USER dental_user WITH PASSWORD 'yourpassword';" -sudo -u postgres psql -c "CREATE DATABASE dental_db OWNER dental_user;" +# Create the database the app uses +sudo -u postgres psql -c "CREATE DATABASE dentalapp OWNER postgres;" -# Verify -psql -U dental_user -d dental_db -c "\conninfo" +# Set the postgres user password to match packages/db/.env +sudo -u postgres psql -c "ALTER USER postgres WITH PASSWORD 'mypassword';" ``` -> Then update `DATABASE_URL` in your `.env` file: +#### Enable password authentication over TCP + +By default Debian uses `scram-sha-256` or `peer` auth for local connections, which blocks password login. Switch to `md5`: + +```sh +sudo sed -i 's/scram-sha-256/md5/g' /etc/postgresql/*/main/pg_hba.conf +sudo systemctl restart postgresql +``` + +#### Verify + +```sh +psql -U postgres -d dentalapp -h 127.0.0.1 -W +# Enter: mypassword +# You should see: dentalapp=# +``` + +> The `DATABASE_URL` in `packages/db/.env` is already set to: > ``` -> DATABASE_URL="postgresql://dental_user:yourpassword@localhost:5432/dental_db" +> DATABASE_URL="postgresql://postgres:mypassword@localhost:5432/dentalapp" > ``` ### Step 6 — Install Redis