Commit Graph

3 Commits

Author SHA1 Message Date
Damien
671dd91530 refactor(ferretdb): keep the install agnostic, drop LibreChat-specific wiring
The script installs and exposes the database only; it now prints a generic
MongoDB connection string (mongodb://user:pass@ip:27017/) instead of a
LibreChat MONGO_URI with a hardcoded /LibreChat database. README 'Wiring
LibreChat' section replaced with a generic 'Connecting a client' section.
Application wiring is left to that app's own config or a separate script.
2026-05-29 11:49:56 +02:00
Damien
d10efadaba fix(ferretdb): create the Mongo user via DocumentDB to fix SCRAM salt length
A plain CREATE ROLE ... PASSWORD stores PostgreSQL's native 16-byte SCRAM salt.
DocumentDB has no check_password_hook, so that salt is served verbatim to Mongo
clients, which reject it at SASL step2 with 'invalid salt length of 16'.

Provision the user through documentdb_api.create_user / update_user instead:
DocumentDB builds the SCRAM-SHA-256 verifier with documentdb.scramDefaultSaltLen
(28 bytes) via its own scram_build_secret. create_user only accepts a read-only
role or the clusterAdmin + readWriteAnyDatabase pair, so use the latter for R/W.

- CREATE EXTENSION documentdb now runs before user provisioning so the API
  functions exist.
- Spec built with jq (password JSON-escaped) and passed in a $DDB$ dollar-quoted
  SQL literal; idempotent via update_user when the role already exists.
- Set password_encryption = 'scram-sha-256' explicitly in postgresql.conf.
2026-05-29 11:18:28 +02:00
Damien
e120d179e3 Update README with FerretDB installation script and requirements
Add FerretDB script to available scripts table
Update requirements to include FerretDB
2026-05-29 09:26:15 +02:00