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

passwordless mastodon user in combination with default DB_HOST causes postgreSQL and websockets errors #873

Open
hughrun opened this issue Apr 28, 2021 · 1 comment

Comments

@hughrun
Copy link

hughrun commented Apr 28, 2021

Caveat: this error occurs on Ubuntu 20.04, it may be ok on 18.04 which is currently specified.

The Running Mastodon - Installing from source instructions specify to create a mastodon user without a password:

adduser --disabled-login mastodon

And the default database configuration defaults DB_HOST to "localhost".

PostreSQL doesn't like this, and throws PG::ConnectionBad fe_sendauth: no password supplied.

This can be resolved by setting a DB_HOST value of "" (i.e. an empty string). See this Digital Ocean forum explanation - apologies that I can't find a more "official" explanation. It seems however that an empty string uses a unix socket rather than an HTTP connection. I haven't tried it but possibly another fix might be to default to http:https://localhost.

I'm logging this as an issue rather than a pull request because it's possible the best fix for this is to change the default value – which obviously is not simply a documentation update – rather than updating the documentation to suggest overriding the default.

@hughrun
Copy link
Author

hughrun commented May 16, 2021

Additionally, it appears that the way the streaming API is configured, it expects the database user to have a password. I couldn't find any way around this, but using the current documentation for server setup results in a broken install with websockets not working.

This is fixable by simply giving the database user a password and restarting services, but it seems that whilst a passwordless server user is probably sensible for security reasons, that user still should have a postresql password to avoid broken installations.

@hughrun hughrun changed the title passwordless mastodon user in combination with default DB_HOST causes postgreSQL error passwordless mastodon user in combination with default DB_HOST causes postgreSQL and websockets errors May 16, 2021
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

No branches or pull requests

1 participant