Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Removes username and password for dev db #50

Merged
merged 1 commit into from
Jan 11, 2024

Conversation

robacarp
Copy link
Contributor

This is a bit chaotic of a change, but I think it's worth it. Let me know what you think.

On a mac when you install postgres (brew install postgres) it creates a user login for the current user and a database for that user. It configures the system to trust the current user to login to postgres without a password because the user has already logged into the system.

On linux this configuration is almost exactly the same. The database will already trust pg users logging in with system users which name matches, but by default there is no user created. (At least this is true for the debian/ubuntu postgres install.) This is easily remidied by running: createuser --createdb $(whoami).

Before this change, the configuration requires that everyone create a login to their local postgres with a password that matches this project password.

After this change, anyone with a properly set up local database can connect without any manual setup.

After this is merged, local development servers will need to be rebooted and bin/rails db:reset will need to be run again.

This is a bit chaotic of a change, but I think it's worth it.

On a mac when you install postgres (`brew install postgres`) it creates
a user login for the current user and a database for that user. It
configures the system to trust the current user to login to postgres
without a password _because the user has already logged into the
system_.

On linux this configuration is almost exactly the same. The database
will already trust pg users logging in with system users which name
matches, but by default there is no user created. (At least this is true
for the debian/ubuntu postgres install.) This is easily remidied by
running: `createuser --createdb $(whoami)`.

Before this change, the configuration requires that everyone create a
login to their local postgres with a password that matches this project
password.

After this change, anyone with a properly set up local database can
connect without any manual setup.

After this is merged, local development servers will need to be rebooted
and `bin/rails db:reset` will need to be run again.
@al3rez al3rez merged commit 5cdb319 into main Jan 11, 2024
2 checks passed
@al3rez al3rez deleted the development_database_defaults branch January 11, 2024 00:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants