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

Self hosting: invalid command to manually verify all users #245

Closed
kyrofa opened this issue Jul 9, 2022 · 0 comments · Fixed by #246
Closed

Self hosting: invalid command to manually verify all users #245

kyrofa opened this issue Jul 9, 2022 · 0 comments · Fixed by #246

Comments

@kyrofa
Copy link
Contributor

kyrofa commented Jul 9, 2022

First of all, your self-hosting docs are excellent. That said, there's a small bug in the command provided to verify accounts:

$ docker exec hosting_plausible_db_1 psql -U postgres -d plausible_db -c "UPDATE users SET email_verified = true;"
Error: No such container: hosting_plausible_db_1

Now, I'm using docker-compose v2.5.0. Here, the container names look like this:

$ docker-compose ps
NAME                            COMMAND                  SERVICE               STATUS              PORTS
hosting-mail-1                  "docker-entrypoint.s…"   mail                  running             25/tcp
hosting-plausible-1             "/entrypoint.sh sh -…"   plausible             running             0.0.0.0:8000->8000/tcp, :::8000->8000/tcp
hosting-plausible_db-1          "docker-entrypoint.s…"   plausible_db          running             5432/tcp
hosting-plausible_events_db-1   "/entrypoint.sh"         plausible_events_db   running             9009/tcp

Notice the hyphens versus underscores, there. A simple fix would be to simply change the docker command to use the proper container name:

$ docker exec hosting-plausible_db-1 psql -U postgres -d plausible_db -c "UPDATE users SET email_verified = true;"

That feels fragile, though. Are container name formats stable in docker-compose? I don't know, but it feels a little internal-API-ish. It seems like it would be better to use docker-compose itself for this:

$ docker-compose exec plausible_db psql -U postgres -d plausible_db -c "UPDATE users SET email_verified = true;"
kyrofa added a commit to kyrofa/plausible-docs that referenced this issue Jul 9, 2022
Today, this command uses docker to exec into the compose-created
container, with an invalidly-formatted name. Instead of relying on that
format being stable (and valid), use docker-compose for it. This only
relies on the service name, which is completely under our control.

Fix plausible#245.

Signed-off-by: Kyle Fazzari <kyrofa@ubuntu.com>
@cnkk cnkk closed this as completed in #246 Jul 10, 2022
cnkk pushed a commit that referenced this issue Jul 10, 2022
Today, this command uses docker to exec into the compose-created
container, with an invalidly-formatted name. Instead of relying on that
format being stable (and valid), use docker-compose for it. This only
relies on the service name, which is completely under our control.

Fix #245.

Signed-off-by: Kyle Fazzari <kyrofa@ubuntu.com>
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 a pull request may close this issue.

1 participant