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

Update troubleshooting.md #38

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 19 additions & 3 deletions troubleshooting.md
Original file line number Diff line number Diff line change
Expand Up @@ -114,14 +114,30 @@ Edit the password column and insert a new **bcrypt**-formatted value. You can us

When running PostgreSQL inside a docker container (e.g. DigitalOcean / AWS official image), follow these steps:

1. Use a tool like https://bcrypt-generator.com/ to generate a bcrypt hash of the password you want. The number of rounds must be **12**.
1. Use a tool like https://bcrypt-generator.com/ to generate a bcrypt hash of the password you want. The number of rounds must be **12**. Note that, in the command below, every dollar sign ($) in your hashed password has to be *escaped* by a single backslash (\\), otherwise your password won't get recognized properly.
2. Connect to your machine / droplet via SSH.
3. Run the following command, replacing `HASH-PASSWORD` with the hash generated in step 1 and `YOUR-EMAIL` with the email address of the account you want to reset:
3. Run the following command, replacing `CONTAINER` with the name of the docker container running your database, `USERNAME` with the username used for your database, `DATABASE` with the name of your database, `HASH-PASSWORD` with the hash generated in step 1 and `YOUR-EMAIL` with the email address of the account you want to reset:

```bash
docker exec db psql -U wiki -d wiki -c "UPDATE users SET password = 'HASH-PASSWORD' WHERE email = 'YOUR-EMAIL';"
docker exec CONTAINER psql -U USERNAME -d DATABASE -c "UPDATE users SET password = 'HASH-PASSWORD' WHERE email = 'YOUR-EMAIL';"
```

#### Forgot user email
If you forgot which email you used for logging in, run the following command to list all users' emails and passwords:

```bash
docker exec CONTAINER psql -U USERNAME -d DATABASE -c "SELECT email, password FROM users;"
```

#### Username and password of the database
If you forgot your username/password for your database, try looking at the environment variables of your docker container by running

```bash
docker exec CONTAINER printenv
```

You're looking for the variables called `POSTGRES_PASSWORD`, `POSTGRES_USER` and `POSTGRES_DB`. Use them in their respective places in the command above.

# Links inside emails are incorrect

**Cause**: You did not set the `Site URL` in the **Administration Area**.
Expand Down