mirror of
https://github.com/pocket-id/pocket-id.git
synced 2025-12-09 14:42:59 +03:00
🚀 Feature: Add external postgres database support #452
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @edbourque0 on GitHub.
Feature description
Add the option to connect to an external Postgres database to store the data, replacing sqlite. The database information could be entered as environment variables (host, port, username, password). Could add these env var : DB_TYPE (sqlite or postgres), DB_HOST, DB_PORT, DB_USER, DB_PASS.
Pitch
I personally like to have control over my app's data. I have a postgres database that stores all of it and it's easier to update some data thru this. My usecase for now would be to update the approximate location which are all set to unknown before I entered my maxmind licence.
@stonith404 commented on GitHub:
Postgres support in now in
v0.20.0:)@edbourque0 commented on GitHub:
Here is my feedback after testing :
There seems to be an issue with the

TRUST_PROXYenvironment variable. The container is not running when it's set totrue. Got a caddy error in the logs (line 11) :Why is it mentioned that the database must be named
pocket-idin the environment variable description ? Everything seems to work with my database which was namedpocketid.Let me know if your want me to test anything else!
Cheers
@stonith404 commented on GitHub:
Thank you for testing!
Caddy was automatically updated and this broke something, this should be fixed now.
You're right, the database name hasn't to be "pocket-id", I'm not sure what I was thinking while writing that 😅.
@stonith404 commented on GitHub:
I've created a pull request #79. Would you mind to test the
stonith404/pocket-id:postgres-developmentDocker image and give me feedback if something doesn't work as expected or is confusing to setup?You have to set the
DB_PROVIDERandPOSTGRES_CONNECTION_STRINGenvironment variables. You can see the new documentation in the new README.@edbourque0 commented on GitHub:
Of course! I'll let you know when I'm done