Rename ssl config key to flags
build / build (push) Failing after 13s

This commit is contained in:
Michael Burgess
2026-08-06 20:08:35 -04:00
parent 6f74026514
commit f8ba0e4efc
6 changed files with 70 additions and 9 deletions
+61
View File
@@ -0,0 +1,61 @@
#----------------------------------------------------------------------
# The store is where all the collected data is kept. Different store
# types are supported:
#
# - sqlite: stores stats in an SQLite database
# - mysql: stores stats in a MySQL/MariaDB database
# - csv: stores stats in local CSV files
#
# Stores may require configuration of additional properties, such as
# file paths or database credentials.
#----------------------------------------------------------------------
store:
#--------------------------------------------------------------------
# Which type of store to use.
#
# Changing this value will _not_ result in an automatic conversion
# of existing store data. To transfer data to a different store,
# make an export of the current store first, then change type and
# import the exported data.
#
type: mysql
#--------------------------------------------------------------------
#--------------------------------------------------------------------
# SQLite store properties
#
# - filename: name of the database file, relative to plugin folder
#
#filename: stats.db
#--------------------------------------------------------------------
#--------------------------------------------------------------------
# MySQL/MariaDB store properties
#
# - host: where the database instance is hosted
# - port: database port number
# - database: name of the database (must exist!)
# - username: username of a valid database user
# - password: password of a valid database user
# - flags: extra JDBC connection parameters, appended to the URL as-is
# (e.g. 'verifyServerCertificate=false&sslmode=required').
# Leave blank/omit to append no extra parameters.
#
host: localhost
port: 3306
database: mobarena_stats
username: mobarena
password: 'change-me'
flags: 'verifyServerCertificate=false&sslmode=required'
#--------------------------------------------------------------------
#--------------------------------------------------------------------
# CSV store properties
#
# - folder: where to store data files, relative to plugin folder
# - separator: symbol to separate fields and values with
#
#folder: data
#separator: ';'
#--------------------------------------------------------------------
@@ -29,11 +29,11 @@ public class MariadbStatsStore {
String host = config.getString("host", "localhost");
int port = config.getInt("port", 3306);
String database = config.getString("database", "mobarena_stats");
String ssl = config.getString("ssl", "");
String flags = config.getString("flags", "");
String url = "jdbc:mariadb://" + host + ":" + port + "/" + database;
return ssl.isEmpty() ? url : url + "?" + ssl;
return flags.isEmpty() ? url : url + "?" + flags;
}
}
@@ -27,11 +27,11 @@ public class MysqlStatsStore {
String host = config.getString("host", "localhost");
int port = config.getInt("port", 3306);
String database = config.getString("database", "mobarena_stats");
String ssl = config.getString("ssl", "");
String flags = config.getString("flags", "");
String url = "jdbc:mysql://" + host + ":" + port + "/" + database;
return ssl.isEmpty() ? url : url + "?" + ssl;
return flags.isEmpty() ? url : url + "?" + flags;
}
}
+3 -3
View File
@@ -38,15 +38,15 @@ store:
# - database: name of the database (must exist!)
# - username: username of a valid database user
# - password: password of a valid database user
# - ssl: extra JDBC connection parameters, appended to the URL as-is
# (e.g. 'verifyServerCertificate=false&sslmode=required')
# - flags: extra JDBC connection parameters, appended to the URL as-is
# (e.g. 'verifyServerCertificate=false&sslmode=required')
#
#host: localhost
#port: 3306
#database: ''
#username: ''
#password: ''
#ssl: ''
#flags: ''
#--------------------------------------------------------------------
#--------------------------------------------------------------------
@@ -26,7 +26,7 @@ class MariadbStatsStoreTest {
config.set("host", "stats.example.com");
config.set("port", 1337);
config.set("database", "mastats");
config.set("ssl", "verifyServerCertificate=false&sslmode=required");
config.set("flags", "verifyServerCertificate=false&sslmode=required");
String result = MariadbStatsStore.getUrl(config);
@@ -26,7 +26,7 @@ class MysqlStatsStoreTest {
config.set("host", "stats.example.com");
config.set("port", 1337);
config.set("database", "mastats");
config.set("ssl", "verifyServerCertificate=false&sslmode=required");
config.set("flags", "verifyServerCertificate=false&sslmode=required");
String result = MysqlStatsStore.getUrl(config);