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

Using MySQL driver without a password fails. #568

Closed
jakehamilton opened this issue Jun 24, 2022 · 1 comment · Fixed by #770
Closed

Using MySQL driver without a password fails. #568

jakehamilton opened this issue Jun 24, 2022 · 1 comment · Fixed by #770

Comments

@jakehamilton
Copy link

Describe the bug

Attempting to use the MySQL database driver without a password set causes
the program to throw an error and exit, printing the following.

Database user or password not set.
View config.ini file.
[app]
host = http://local.test
site_name = WriteFreely
theme = write

[database]
database = writefreely
host = localhost
password = ""
port = 3306
tls = 
type = mysql
username = writefreely

[server]
autocert = 
bind = localhost
gopher_port = 0
keys_parent_dir = /var/lib/writefreely
pages_parent_dir = /nix/store/0sd080c203cc8nrgkmbjd8i5ydl4d2r5-source
port = 80
static_parent_dir = /nix/store/07va1db963wnsbm84lpxz3jcdjyxkkir-writefreely-assets-0.13.1
templates_parent_dir = /nix/store/0sd080c203cc8nrgkmbjd8i5ydl4d2r5-source

I'm currently trying to wire up a NixOS module for WriteFreely. NixOS's MySQL module
configures database users for auth with either unix_socket or auth_socket and does not initialize users with a password.

Steps to reproduce (if necessary)

  1. Start MySQL.
  2. Create a user with either unix_socket or auth_socket auth as described above.
  3. Configure WriteFreely to use MySQL with an empty password entry.
  4. Start WriteFreely.

Expected behavior

WriteFreely should be able to connect to the database without a password, though I'm not familiar enough with Go or the libraries underlying the database system to know if that's possible here (though my gut says it should be).

Application configuration

  • Single mode or Multi-user mode? both
  • Database? [mysql/sqlite] mysql
  • Open registration? [yes/no] both
  • Federation enabled? [yes/no] both

Version or last commit: 0.13.1

@thebaer
Copy link
Member

thebaer commented Sep 21, 2023

Thanks for reporting this! Fixed and will be in the next release.

lpar pushed a commit to postfreely/postfreely that referenced this issue Sep 23, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
2 participants