davidjameshowell / vaultwarden_heroku

Vaultwarden (Bitwarden Rust implementation) self hosted in Heroku for Free!
95 stars 175 forks source link

Add USE_PSQL option #20

Closed AlecJY closed 3 years ago

AlecJY commented 3 years ago

Heroku Postgres addon doesn't need verified Heroku accounts, so I add an option to use Heroku Postgres as the database backend instead of JawsDB Maria.

davidjameshowell commented 3 years ago

LGTM. Thanks for the contribution!

Plixs commented 3 years ago

I was also trying to add PSQL a few days ago, it seems to be late :). I saw a notice in the Heroku PSQL document, -The value of your app’s DATABASE_URL config var might change at any time. You should not rely on this value either inside or outside your Heroku app. And there are hints in the database information, -Please note that these credentials are not permanent. -Heroku rotates credentials periodically and updates applications where this database is attached. Will the DATABASE_URL change at any time cause the App's database to become invalid? I don't know how to understand these notices. It seems that Heroku PSQL will update the database credentials regularly for security. I have no experience with Heroku.

davidjameshowell commented 3 years ago

@Plixs Conveniently (albeit I haven't examined the behavior specifically) any rotation or updates are fine since thr DATABASE_URL is equal to the Heroku Postgres data se credentials. Since Vaultwarden reads from DATABASE_URL, it will transparently be updated (unless done while the app is running which may be on next sleep cycle).

Plixs commented 3 years ago

@Plixs Conveniently (albeit I haven't examined the behavior specifically) any rotation or updates are fine since thr DATABASE_URL is equal to the Heroku Postgres data se credentials. Since Vaultwarden reads from DATABASE_URL, it will transparently be updated (unless done while the app is running which may be on next sleep cycle).

ty