AllYourBot / hostedgpt

An open version of ChatGPT you can host anywhere or run locally.
MIT License
362 stars 199 forks source link

Better support local dev - local DB documentation & env vars #456

Open draknor opened 3 months ago

draknor commented 3 months ago

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?

draknor commented 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.

krschacht commented 3 months ago

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

File Changes

(2 files https://github.com/AllYourBot/hostedgpt/pull/456/files)

Patch Links:

— 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: @.***>

krschacht commented 3 months ago

@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.

draknor commented 3 months ago

Yep - I revised my approach to just focus on DATABASE_URL -- how's the new commit look?

krschacht commented 3 months ago

@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.