Skip to content

Using MySQL driver without a password fails. #568

@jakehamilton

Description

@jakehamilton

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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions