Block2Block / HubParkour

A fun Hub Parkour plugin with checkpoints, rewards and more!
Apache License 2.0
9 stars 10 forks source link

Add config option for JDBC parameters #23

Closed Hegezcc closed 1 year ago

Hegezcc commented 2 years ago

After 2.6, some preset JDBC connection parameters were added to the connection string: https://github.com/Block2Block/HubParkour/blob/07ea5bda99e7c48e0c61488d05db7ef02eea8be6/plugin/src/main/java/me/block2block/hubparkour/utils/database/MySQLConnectionPool.java#L48

On my network, I have a MySQL 8.0 server running on different host than the game server, which imposes a security hygiene problem: MySQL server wants to load a server public key, but that isn't allowed by default and no keystore is loaded by plugin. If I tried to add the specific connection parameter after database name (parkour?allowPublicKeyRetrieval=true), but it would fail, as other connection parameters get lumped to the end of JDBC connection string as it is now in invalid format, normally that parameter would allow retrieval of server public key and thus continuation of auth flow.

That is preventing me from transitioning from SQLite to MySQL. I suggest refactoring the connection parameter string to the configuration file, and getting it from there as a string (like db, username and others). That would also allow for other users to add more conf options if they need.

Block2Block commented 1 year ago

Released in v2.7.