From 92900176a6b302fe4d67de3ded40268325af4442 Mon Sep 17 00:00:00 2001 From: nat Date: Sun, 10 Mar 2024 11:55:03 -0700 Subject: [PATCH] Add details to postgres setup --- README.md | 24 +++++++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 93c5381..a32dc01 100644 --- a/README.md +++ b/README.md @@ -6,7 +6,29 @@ This project was created in under a day in 2022 as a part of an assessment. It's To run the server, you'll need: * Elixir, which depends on Erlang. Detailed instructions on how to install Elixir and Erlang can be found on [the Elixir website](https://elixir-lang.org/install.html). In most cases, installing Elixir will get you a copy of Erlang as well. * Node.js. If you've been blessed to have never needed to download Node on your device, you can end that streak now by visiting [the Node.js download page](https://nodejs.org/en/download) -* PostgreSQL, which you'll need running. You can find information on how to install it on [the PostgreSQL download page](https://www.postgresql.org/download/) as well. This project is set up to assume that the database username is "postgres" and the password is "postgres" +* PostgreSQL, which you'll need running. You can find information on how to install it on [the PostgreSQL download page](https://www.postgresql.org/download/) as well. + +## Aside: Setting up Postgres +By default this project assumes your PostgreSQL install has a user with the name "postgres" whose password is "postgres". Is that not the case? Either: + +* Change the configuration to use the right credentials. Open `./config/dev.exs` and find and edit: + ```elixir + config :bookmarker, Bookmarker.Repo, + username: "", + password: "", + ``` +* Change your password, say, to "postgres". If you're on Linux, this would look something like: + ```bash + # Run the postgresql console as the postgres user + $ sudo -u postgres psql + # reset the password + postgres=# \password + Enter new password for user "": + Enter it again: + postgres=# \q + ``` + +### Finally, set up and run the server ```bash $ cd bookmarker