Open draknor opened 3 months ago
Ha, I guess I could just NOT set defaults for username + password - seems so obvious in hindsight! I'll have to test that - I haven't setup my local dev DB to allow anonymous access.
Even if you have a username and password you can provide that within the DATABASE_URL
On Wed, Jul 10, 2024 at 2:42 PM David Patnode @.***> wrote:
Update README to better document db setup for local dev, and update database.yml to support local username+password.
NOTE: This does change the default username + password for local (non-Docker) dev, so there's a potential compatibility issue there. Not sure if there's a good way around it?
You can view, comment on, or merge this pull request online at:
https://github.com/AllYourBot/hostedgpt/pull/456 Commit Summary
- 1889629 https://github.com/AllYourBot/hostedgpt/pull/456/commits/18896298e007b3e7ca7e165e4e9007faf87d0f25 Update README to better document db setup for local dev, and update database.yml to support local username+password
File Changes
(2 files https://github.com/AllYourBot/hostedgpt/pull/456/files)
- M README.md https://github.com/AllYourBot/hostedgpt/pull/456/files#diff-b335630551682c19a781afebcf4d07bf978fb1f8ac04c6bf87428ed5106870f5 (6)
- M config/database.yml https://github.com/AllYourBot/hostedgpt/pull/456/files#diff-5a674c769541a71f2471a45c0e9dde911b4455344e3131bddc5a363701ba6325 (3)
Patch Links:
- https://github.com/AllYourBot/hostedgpt/pull/456.patch
- https://github.com/AllYourBot/hostedgpt/pull/456.diff
— Reply to this email directly, view it on GitHub https://github.com/AllYourBot/hostedgpt/pull/456, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAAIR5OPSA2ORD2P4WX3BELZLU25DAVCNFSM6AAAAABKU6J6TWVHI2DSMVQWIX3LMV43ASLTON2WKOZSGQYDAOBQGU2DKOI . You are receiving this because you are subscribed to this thread.Message ID: @.***>
@draknor let me know what you think of just setting DATBASE_URL instead of this? The format is postgres://username:password@localhost/hostedgpt_development
(Password and/or username can be left off)
This is a rails convention and the production configs use this to set the database details.
Yep - I revised my approach to just focus on DATABASE_URL -- how's the new commit look?
@draknor Did you need to change anything in database.yml in order to get it to work? I could be wrong, but I thought that DATABASE_URL would just work as is. I think all we need to do is elaborate within the README
Oh, actually, I see a mistake in docker-compose.yml, on line 27 there is DATABASE_URL but I do not think we should be including a default value in there. If we just list DATABASE_URL with nothing afterwards then it will pass in whatever is set from the user's environment.
So, to summarize: (1) can you try reverting this docker-compose default, (2) confirm you can set DATABASE_URL locally and things work w/o any changes to database.yml, and (3) review my proposed edit of the README.
Update README to better document db setup for local dev, and update database.yml to support local username+password.
NOTE: This does change the default username + password for local (non-Docker) dev, so there's a potential compatibility issue there. Not sure if there's a good way around it?