mirror of
https://github.com/AuthMe/AuthMeReloaded.git
synced 2025-02-27 09:12:00 +01:00
Update MySQL driver class name
+ implement fallback to the legacy driver
This commit is contained in:
parent
d969d314b3
commit
18c31e3a42
@ -1,5 +1,5 @@
|
|||||||
<!-- AUTO-GENERATED FILE! Do not edit this directly -->
|
<!-- AUTO-GENERATED FILE! Do not edit this directly -->
|
||||||
<!-- File auto-generated on Sun Apr 04 21:31:43 CEST 2021. See docs/config/config.tpl.md -->
|
<!-- File auto-generated on Sat Aug 21 22:53:23 CEST 2021. See docs/config/config.tpl.md -->
|
||||||
|
|
||||||
## AuthMe Configuration
|
## AuthMe Configuration
|
||||||
The first time you run AuthMe it will create a config.yml file in the plugins/AuthMe folder,
|
The first time you run AuthMe it will create a config.yml file in the plugins/AuthMe folder,
|
||||||
@ -29,7 +29,7 @@ DataSource:
|
|||||||
# Password to connect to the MySQL database
|
# Password to connect to the MySQL database
|
||||||
mySQLPassword: '12345'
|
mySQLPassword: '12345'
|
||||||
# Driver Name of the MySQL database
|
# Driver Name of the MySQL database
|
||||||
mySQLDriverClassName: com.mysql.jdbc.Driver
|
mySQLDriverClassName: com.mysql.cj.jdbc.Driver
|
||||||
# Database Name, use with converters or as SQLITE database name
|
# Database Name, use with converters or as SQLITE database name
|
||||||
mySQLDatabase: authme
|
mySQLDatabase: authme
|
||||||
# Table of the database
|
# Table of the database
|
||||||
@ -89,7 +89,7 @@ ExternalBoardOptions:
|
|||||||
# Other MySQL columns where we need to put the username (case-sensitive)
|
# Other MySQL columns where we need to put the username (case-sensitive)
|
||||||
mySQLOtherUsernameColumns: []
|
mySQLOtherUsernameColumns: []
|
||||||
# How much log2 rounds needed in BCrypt (do not change if you do not know what it does)
|
# How much log2 rounds needed in BCrypt (do not change if you do not know what it does)
|
||||||
bCryptLog2Round: 10
|
bCryptLog2Round: 12
|
||||||
# phpBB table prefix defined during the phpBB installation process
|
# phpBB table prefix defined during the phpBB installation process
|
||||||
phpbbTablePrefix: phpbb_
|
phpbbTablePrefix: phpbb_
|
||||||
# phpBB activated group ID; 2 is the default registered group defined by phpBB
|
# phpBB activated group ID; 2 is the default registered group defined by phpBB
|
||||||
@ -587,4 +587,4 @@ To change settings on a running server, save your changes to config.yml and use
|
|||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
This page was automatically generated on the [AuthMe/AuthMeReloaded repository](https://github.com/AuthMe/AuthMeReloaded/tree/master/docs/) on Sun Apr 04 21:31:43 CEST 2021
|
This page was automatically generated on the [AuthMe/AuthMeReloaded repository](https://github.com/AuthMe/AuthMeReloaded/tree/master/docs/) on Sat Aug 21 22:53:23 CEST 2021
|
||||||
|
@ -101,6 +101,12 @@ public class MySQL extends AbstractSqlDataSource {
|
|||||||
this.username = settings.getProperty(DatabaseSettings.MYSQL_USERNAME);
|
this.username = settings.getProperty(DatabaseSettings.MYSQL_USERNAME);
|
||||||
this.password = settings.getProperty(DatabaseSettings.MYSQL_PASSWORD);
|
this.password = settings.getProperty(DatabaseSettings.MYSQL_PASSWORD);
|
||||||
this.className = settings.getProperty(DatabaseSettings.MYSQL_DRIVER_CLASS_NAME);
|
this.className = settings.getProperty(DatabaseSettings.MYSQL_DRIVER_CLASS_NAME);
|
||||||
|
try {
|
||||||
|
Class.forName(this.className);
|
||||||
|
} catch (ClassNotFoundException e) {
|
||||||
|
logger.info("Driver class '" + this.className + "' not found! Falling back to legacy MySQL driver (com.mysql.jdbc.Driver)");
|
||||||
|
this.className = "com.mysql.jdbc.Driver";
|
||||||
|
}
|
||||||
this.database = settings.getProperty(DatabaseSettings.MYSQL_DATABASE);
|
this.database = settings.getProperty(DatabaseSettings.MYSQL_DATABASE);
|
||||||
this.tableName = settings.getProperty(DatabaseSettings.MYSQL_TABLE);
|
this.tableName = settings.getProperty(DatabaseSettings.MYSQL_TABLE);
|
||||||
this.columnOthers = settings.getProperty(HooksSettings.MYSQL_OTHER_USERNAME_COLS);
|
this.columnOthers = settings.getProperty(HooksSettings.MYSQL_OTHER_USERNAME_COLS);
|
||||||
@ -122,7 +128,7 @@ public class MySQL extends AbstractSqlDataSource {
|
|||||||
|
|
||||||
// Pool Settings
|
// Pool Settings
|
||||||
ds.setMaximumPoolSize(poolSize);
|
ds.setMaximumPoolSize(poolSize);
|
||||||
ds.setMaxLifetime(maxLifetime * 1000);
|
ds.setMaxLifetime(maxLifetime * 1000L);
|
||||||
|
|
||||||
// Database URL
|
// Database URL
|
||||||
ds.setJdbcUrl("jdbc:mysql://" + this.host + ":" + this.port + "/" + this.database);
|
ds.setJdbcUrl("jdbc:mysql://" + this.host + ":" + this.port + "/" + this.database);
|
||||||
|
@ -60,10 +60,15 @@ public class SettingsMigrationService extends PlainMigrationService {
|
|||||||
@SuppressWarnings("checkstyle:BooleanExpressionComplexity")
|
@SuppressWarnings("checkstyle:BooleanExpressionComplexity")
|
||||||
protected boolean performMigrations(PropertyReader reader, ConfigurationData configurationData) {
|
protected boolean performMigrations(PropertyReader reader, ConfigurationData configurationData) {
|
||||||
boolean changes = false;
|
boolean changes = false;
|
||||||
|
|
||||||
if ("[a-zA-Z0-9_?]*".equals(reader.getString(ALLOWED_NICKNAME_CHARACTERS.getPath()))) {
|
if ("[a-zA-Z0-9_?]*".equals(reader.getString(ALLOWED_NICKNAME_CHARACTERS.getPath()))) {
|
||||||
configurationData.setValue(ALLOWED_NICKNAME_CHARACTERS, "[a-zA-Z0-9_]*");
|
configurationData.setValue(ALLOWED_NICKNAME_CHARACTERS, "[a-zA-Z0-9_]*");
|
||||||
changes = true;
|
changes = true;
|
||||||
}
|
}
|
||||||
|
if ("com.mysql.jdbc.Driver".equals(reader.getString(DatabaseSettings.MYSQL_DRIVER_CLASS_NAME.getPath()))) {
|
||||||
|
configurationData.setValue(DatabaseSettings.MYSQL_DRIVER_CLASS_NAME, "com.mysql.cj.jdbc.Driver");
|
||||||
|
changes = true;
|
||||||
|
}
|
||||||
|
|
||||||
setOldOtherAccountsCommandFieldsIfSet(reader);
|
setOldOtherAccountsCommandFieldsIfSet(reader);
|
||||||
|
|
||||||
|
@ -47,7 +47,7 @@ public final class DatabaseSettings implements SettingsHolder {
|
|||||||
|
|
||||||
@Comment("Driver Name of the MySQL database")
|
@Comment("Driver Name of the MySQL database")
|
||||||
public static final Property<String> MYSQL_DRIVER_CLASS_NAME =
|
public static final Property<String> MYSQL_DRIVER_CLASS_NAME =
|
||||||
newProperty("DataSource.mySQLDriverClassName", "com.mysql.jdbc.Driver");
|
newProperty("DataSource.mySQLDriverClassName", "com.mysql.cj.jdbc.Driver");
|
||||||
|
|
||||||
@Comment("Database Name, use with converters or as SQLITE database name")
|
@Comment("Database Name, use with converters or as SQLITE database name")
|
||||||
public static final Property<String> MYSQL_DATABASE =
|
public static final Property<String> MYSQL_DATABASE =
|
||||||
|
Loading…
Reference in New Issue
Block a user