Runway 1.2.0

This commit is contained in:
Runway committed 2026-10-30 11:24:46 -06:00
1 parent 5fa0c1ef9f
commit 9144c206be
90 files changed
+2737 -554

No files matched your search

+16
View File
@@ -2,6 +2,22 @@
All notable changes are recorded here. Versions follow [Semantic Versioning](https://semver.org/).
## [2.0.0] — 2026-10-30
### Upgrade note
- Install it together with `database` 2.0.0, on Runway 1.2.0 or later, and move the MariaDB server's
settings into this plugin as the `database` 2.0.0 *Upgrade note* says. On Runway 1.1.x, keep 1.0.0 of both.
### Changed
- **This plugin holds the MariaDB server's settings**: host, port, database, username, password, TLS and CA
certificate and the collation, on its own settings page (**Plugins → Database — MariaDB → Settings**; file
`external/plugin-settings/database-mariadb.yml`, under `runway.plugin.database-mariadb`). Until 2.0.0 they were the `database` plugin's;
move them as its 2.0.0 *Upgrade note* says.
- Requires `database >= 2.0.0` and Runway SPI 1.2.0 (Runway 1.2.0), whose `PluginSettings.savedApp` hands the saved
settings to the database plugin's connection test.
## [1.0.0] — 2026-10-29
First public release of `database-mariadb`: the MariaDB 10.11+ provider for the `database` plugin, with MariaDB
+8 -4
View File
@@ -2,13 +2,17 @@
Lets the [`database`](../database) plugin use **MariaDB 10.11 or later** (MySQL is not supported). It bundles MariaDB
Connector/J and builds a configured, unpooled `DataSource`; every statement Runway runs is written in the database
plugin. Choose it with the database plugin's `provider: mariadb` setting.
plugin. Since 2.0.0 it also holds the server's settings, collation included: host, port, database, account, password and TLS,
on its own settings page (**Plugins → Database — MariaDB → Settings**, file `external/plugin-settings/database-mariadb.yml`).
With both providers installed, choose this one with the database plugin's `provider: mariadb` setting; with one
installed, it is used.
- **Plugin id:** `database-mariadb` (v`1.0.0`) — install folder `external/plugins/database-mariadb/`
- **Requires:** `database >= 1.0.0`, Runway SPI `1.1.0` or later
- **Plugin id:** `database-mariadb` (v`2.0.0`) — install folder `external/plugins/database-mariadb/`
- **Requires:** `database >= 2.0.0`, Runway SPI `1.2.0` or later (Runway 1.2.0)
- **Bundles:** MariaDB Connector/J `3.5.8` (LGPL-2.1), unmodified, in `lib/`. Its sources are published next to this
plugin's zip in each release (`mariadb-java-client-3.5.8-sources.jar`); the license and how to replace the jar are
in `THIRD-PARTY-NOTICES`.
Setup, grants and settings: the kernel's ADMINISTRATION §11.1. Details: [`docs/DATABASE-MARIADB-PLUGIN.md`](docs/DATABASE-MARIADB-PLUGIN.md),
Setup, grants and settings: the kernel's ADMINISTRATION §11.1 — step by step, the settings file for a setup
without the console, upgrading from 1.x, and a table for when it does not connect. Details: [`docs/DATABASE-MARIADB-PLUGIN.md`](docs/DATABASE-MARIADB-PLUGIN.md),
[`CHANGELOG.md`](CHANGELOG.md).
@@ -32,3 +32,15 @@ The provider is one bean, `databaseMariadbProvider`, collected by type. Tests: `
each TLS policy and that it never carries the account, a real connection when `-Ddb.it.mariadb=host:port` and
`-Ddb.it.password-file=…` are set, the bean name, and the linkage scan). End to end:
`../database/scripts/verify-against-host.sh` with `PROVIDER=mariadb`.
## Its settings (since 2.0.0)
The server's settings are this plugin's own app-level settings (`runway.plugin.database-mariadb.*`, the console's **Plugins →
Database — MariaDB → Settings**): `host`, `port`, `database`, `username`, `password` (a `secret`, bound to the
others), `tls`, `caCertificate`, and `collation`. The provider hands them to the database plugin raw; the database
plugin checks every one before use, as before:
- **running** (`runningSettings()`): bound at startup into a `ProviderSettingsProps` bean
(`databaseMariadbSettings`), the password read in clear with `PluginSettings.appSecret("password")`;
- **saved** (`savedSettings()`): read with `PluginSettings.savedApp(key)` (SPI 1.2.0) from the settings file as it is
now, for the database plugin's connection test before a restart applies them.
@@ -0,0 +1,17 @@
# Runway Database — MariaDB provider — English
database-mariadb.group.connection=Server
database-mariadb.group.connection.help=The MariaDB server Runway keeps plugins' data on. Changes apply after a restart; test them first with the connection tests on the Database plugin's settings page. In a cluster every node needs the same values.
database-mariadb.set.host=Host
database-mariadb.set.host.help=A host name or an IP address. One server only.
database-mariadb.set.port=Port
database-mariadb.set.port.help=Leave blank for MariaDB's default, 3306.
database-mariadb.set.database=Database
database-mariadb.set.database.help=An existing database on the server. Runway creates its own databases next to it: one per site and one for the whole installation.
database-mariadb.set.username=Username
database-mariadb.set.password=Password
database-mariadb.set.tls=TLS
database-mariadb.set.tls.help=verify-full checks the server's certificate and name. require encrypts without checking who the server is. Use disable only for a database on the same host or a private network you trust.
database-mariadb.set.caCertificate=CA certificate (PEM)
database-mariadb.set.caCertificate.help=The certificate authority that signed the server's certificate, when the Java trust store does not know it.
database-mariadb.set.collation=Collation
database-mariadb.set.collation.help=For plugins' tables. Blank uses utf8mb4_uca1400_ai_ci (utf8mb4_unicode_ci before MariaDB 10.10).
@@ -0,0 +1,17 @@
# Runway Database — MariaDB provider — español
database-mariadb.group.connection=Servidor
database-mariadb.group.connection.help=El servidor MariaDB donde Runway guarda los datos de los plugins. Los cambios se aplican al reiniciar; pruébelos antes con las pruebas de conexión de la página de ajustes del plugin Base de datos. En un clúster, todos los nodos necesitan los mismos valores.
database-mariadb.set.host=Servidor
database-mariadb.set.host.help=Un nombre de host o una dirección IP. Un solo servidor.
database-mariadb.set.port=Puerto
database-mariadb.set.port.help=Déjelo en blanco para usar el predeterminado de MariaDB, 3306.
database-mariadb.set.database=Base de datos
database-mariadb.set.database.help=Una base de datos existente en el servidor. Runway crea sus propias bases de datos junto a ella: una por sitio y una para toda la instalación.
database-mariadb.set.username=Usuario
database-mariadb.set.password=Contraseña
database-mariadb.set.tls=TLS
database-mariadb.set.tls.help=verify-full comprueba el certificado y el nombre del servidor. require cifra sin comprobar quién es el servidor. Use disable solo para una base de datos en el mismo equipo o en una red privada de confianza.
database-mariadb.set.caCertificate=Certificado de la CA (PEM)
database-mariadb.set.caCertificate.help=La autoridad que firmó el certificado del servidor, cuando el almacén de confianza de Java no la conoce.
database-mariadb.set.collation=Intercalación
database-mariadb.set.collation.help=Para las tablas de los plugins. En blanco se usa utf8mb4_uca1400_ai_ci (utf8mb4_unicode_ci antes de MariaDB 10.10).
+34 -4
View File
@@ -5,16 +5,46 @@
# published next to this plugin's release) and builds a configured
# DataSource; every statement Runway runs is written in the database plugin.
#
# Choose it with the database plugin's `provider: mariadb` setting.
# The server, the account and TLS are set on THIS plugin's settings page
# (since 2.0.0); the database plugin keeps the provider choice and the
# limits. With both providers installed, choose this one with the database
# plugin's `provider: mariadb` setting.
#
# The install folder name MUST equal this `id`: external/plugins/database-mariadb/.
# =============================================================================
id: database-mariadb
name: Database — MariaDB
version: 1.0.0
version: 2.0.0
mainClass: mx.quest.database.mariadb.MariaDbProviderConfig
# The database plugin publishes the DatabaseProvider interface this plugin implements.
requires: [ "database >= 1.0.0" ]
requires: [ "database >= 2.0.0" ]
requiresSpi: ">=1.1.0"
# SPI 1.2.0: PluginSettings.savedApp, which hands the saved settings to the connection test.
requiresSpi: ">=1.2.0"
settingGroups:
- { id: connection, label: database-mariadb.group.connection, help: database-mariadb.group.connection.help }
# Runway-wide settings, applied on RESTART. In a cluster every node needs the same values and the same platform
# secret key. Test them before restarting: Plugins -> Database -> Settings, "Connection tests".
settings:
- { key: host, type: string, group: connection, label: database-mariadb.set.host, help: database-mariadb.set.host.help }
- { key: port, type: int, range: "1..65535", group: connection, label: database-mariadb.set.port,
help: database-mariadb.set.port.help }
- { key: database, type: string, group: connection, label: database-mariadb.set.database,
help: database-mariadb.set.database.help }
- { key: username, type: string, group: connection, label: database-mariadb.set.username }
# Bound to where it goes: changing any of these without typing the password again removes the stored one.
- key: password
type: secret
group: connection
label: database-mariadb.set.password
secretBoundTo: [host, port, database, username, tls, caCertificate]
- { key: tls, type: enum, range: "verify-full,require,disable", default: verify-full, group: connection,
label: database-mariadb.set.tls, help: database-mariadb.set.tls.help }
- { key: caCertificate, type: text, group: connection, advanced: true, label: database-mariadb.set.caCertificate,
help: database-mariadb.set.caCertificate.help }
- { key: collation, type: string, group: connection, advanced: true, label: database-mariadb.set.collation,
help: database-mariadb.set.collation.help }
+7 -4
View File
@@ -17,7 +17,7 @@
<groupId>mx.quest</groupId>
<artifactId>runway-plugin-database-mariadb</artifactId>
<version>1.0.0</version>
<version>2.0.0</version>
<packaging>jar</packaging>
<name>Runway Database — MariaDB</name>
<licenses>
@@ -38,11 +38,11 @@
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<!-- Reproducible builds: pins every archive entry's timestamp. Bump at each release. -->
<project.build.outputTimestamp>2026-10-29T00:00:00Z</project.build.outputTimestamp>
<!-- The runway-spi this plugin compiles against: SPI 1.1.0 adds PluginSettings.appSecret. -->
<runway.version>1.1.0</runway.version>
<!-- The runway-spi this plugin compiles against: SPI 1.2.0 adds PluginSettings.savedApp. -->
<runway.version>1.2.0</runway.version>
<!-- The database plugin whose SPI this provider implements (provided: the shared plugin class loader
supplies it; install ../database first). -->
<database.version>1.0.0</database.version>
<database.version>2.0.0</database.version>
<!-- The driver bundled in lib/. Pinned so the bundle never drifts from what the notices name. -->
<mariadb.version>3.5.8</mariadb.version>
</properties>
@@ -160,6 +160,9 @@
<copy todir="${stage}/lib">
<fileset dir="${project.build.directory}/staged-lib"/>
</copy>
<copy todir="${stage}/i18n">
<fileset dir="${project.basedir}/i18n"/>
</copy>
<!-- Never a plugin zip without its libraries (it would load and fail at its first use). -->
<fail message="no library in ${stage}/lib">
<condition><resourcecount when="equal" count="0">
@@ -4,9 +4,12 @@ import java.sql.SQLException;
import java.util.LinkedHashMap;
import java.util.Map;
import java.util.Objects;
import java.util.Optional;
import java.util.function.Supplier;
import javax.sql.DataSource;
import mx.quest.database.spi.ConnectionSettings;
import mx.quest.database.spi.DatabaseProvider;
import mx.quest.database.spi.ProviderSettings;
import org.mariadb.jdbc.MariaDbDataSource;
/**
@@ -27,6 +30,25 @@ public final class MariaDbProvider implements DatabaseProvider {
static final int DEFAULT_PORT = 3306;
private final Supplier<ProviderSettings> running;
private final Supplier<ProviderSettings> saved;
/**
* Without settings, as before database 2.0.0: for building data sources only (tests).
*/
public MariaDbProvider() {
this(() -> null, () -> null);
}
/**
* @param running the server settings the application started with, from this plugin's own settings page
* @param saved the server settings saved on that page now, which the next restart applies
*/
public MariaDbProvider(Supplier<ProviderSettings> running, Supplier<ProviderSettings> saved) {
this.running = Objects.requireNonNull(running, "running");
this.saved = Objects.requireNonNull(saved, "saved");
}
@Override
public String id() {
return "mariadb";
@@ -95,4 +117,14 @@ public final class MariaDbProvider implements DatabaseProvider {
}
return value;
}
@Override
public Optional<ProviderSettings> runningSettings() {
return Optional.ofNullable(running.get());
}
@Override
public Optional<ProviderSettings> savedSettings() {
return Optional.ofNullable(saved.get());
}
}
@@ -1,14 +1,33 @@
package mx.quest.database.mariadb;
import mx.quest.database.spi.ProviderSettings;
import mx.quest.database.spi.ProviderSettingsProps;
import mx.quest.runway.spi.service.PluginSettings;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
/** Registers the MariaDB provider; the database plugin collects it by type. */
/**
* Registers the MariaDB provider; the database plugin collects it by type. The server's settings are this plugin's
* own app-level settings ({@code runway.plugin.database-mariadb.*}, since database 2.0.0): the running ones as
* bound at startup, the password through {@link PluginSettings#appSecret}, and the saved ones through
* {@link PluginSettings#savedApp} for the connection test. With both providers installed the context holds two
* {@link ProviderSettingsProps} beans, hence the qualifier.
*/
@Configuration(proxyBeanMethods = false)
public class MariaDbProviderConfig {
@Bean
public MariaDbProvider databaseMariadbProvider() {
return new MariaDbProvider();
@ConfigurationProperties("runway.plugin.database-mariadb")
public ProviderSettingsProps databaseMariadbSettings() {
return new ProviderSettingsProps();
}
@Bean
public MariaDbProvider databaseMariadbProvider(
@Qualifier("databaseMariadbSettings") ProviderSettingsProps server, PluginSettings settings) {
return new MariaDbProvider(() -> server.toSettings(settings.appSecret(ProviderSettings.PASSWORD)),
() -> ProviderSettings.read(settings::savedApp));
}
}
@@ -20,14 +20,21 @@ import java.time.temporal.ChronoUnit;
import java.util.ArrayList;
import java.util.Calendar;
import java.util.List;
import java.util.Map;
import java.util.TimeZone;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
import java.util.stream.Stream;
import mx.quest.database.spi.ConnectionSettings;
import mx.quest.database.spi.ConnectionSettings.Tls;
import mx.quest.database.spi.ConnectionSettings;
import mx.quest.database.spi.ProviderSettings;
import mx.quest.runway.spi.service.PluginSettings;
import mx.quest.runway.spi.testkit.FakePluginSettings;
import org.junit.jupiter.api.Test;
import org.springframework.boot.context.properties.EnableConfigurationProperties;
import org.springframework.context.annotation.AnnotationConfigApplicationContext;
import org.springframework.context.annotation.Configuration;
import org.springframework.core.env.MapPropertySource;
class MariaDbProviderTest {
@@ -114,15 +121,66 @@ class MariaDbProviderTest {
assertThat(new MariaDbProvider().driverVersion()).startsWith("MariaDB Connector/J");
}
/** Turns on @ConfigurationProperties binding, as the kernel's context does. */
@Configuration(proxyBeanMethods = false)
@EnableConfigurationProperties
static class Binding {
}
@Test
void theConfigurationRegistersOneProviderNamedForThePlugin() {
try (AnnotationConfigApplicationContext ctx = new AnnotationConfigApplicationContext(
MariaDbProviderConfig.class)) {
try (AnnotationConfigApplicationContext ctx = new AnnotationConfigApplicationContext()) {
ctx.registerBean(PluginSettings.class, FakePluginSettings::new);
ctx.register(Binding.class, MariaDbProviderConfig.class);
ctx.refresh();
assertThat(ctx.getBeanNamesForType(mx.quest.database.spi.DatabaseProvider.class))
.containsExactly("databaseMariadbProvider");
for (String name : ctx.getBeanDefinitionNames()) {
if ("mariaDbProviderConfig".equals(ctx.getBeanDefinition(name).getFactoryBeanName())) {
assertThat(name).as("bean names carry the plugin id").startsWith("databaseMariadb");
}
}
}
}
@Test
void theServerSettingsAreThisPluginsOwnRunningAndSaved() {
try (AnnotationConfigApplicationContext ctx = new AnnotationConfigApplicationContext()) {
String prefix = "runway.plugin.database-mariadb.";
ctx.getEnvironment().getPropertySources().addFirst(new MapPropertySource("test", Map.of(
prefix + "host", "db.running", prefix + "port", "6000", prefix + "database", "runway",
prefix + "username", "rw", prefix + "password", "ENC(only-the-stored-form)",
prefix + "tls", "require", prefix + "collation", "utf8mb4_uca1400_ai_ci",
"runway.plugin.database.host", "not-this-plugins")));
ctx.registerBean(PluginSettings.class, () -> new FakePluginSettings().appSecret("password", "running-pw")
.savedApp("host", "db.saved").savedApp("database", "runway").savedApp("username", "rw2")
.savedApp("password", "saved-pw"));
ctx.register(Binding.class, MariaDbProviderConfig.class);
ctx.refresh();
MariaDbProvider provider = ctx.getBean(MariaDbProvider.class);
ProviderSettings running = provider.runningSettings().orElseThrow();
assertThat(running.host()).isEqualTo("db.running");
assertThat(running.port()).isEqualTo("6000");
assertThat(running.username()).isEqualTo("rw");
assertThat(running.tls()).isEqualTo("require");
assertThat(running.password()).as("in clear, from appSecret").isEqualTo("running-pw");
assertThat(running.collation()).isEqualTo("utf8mb4_uca1400_ai_ci");
ProviderSettings saved = provider.savedSettings().orElseThrow();
assertThat(saved.host()).isEqualTo("db.saved");
assertThat(saved.username()).isEqualTo("rw2");
assertThat(saved.password()).isEqualTo("saved-pw");
assertThat(saved.port()).as("unsaved: blank, the product's default").isNull();
}
}
@Test
void withoutSettingsTheProviderSaysNothingAsBeforeTwo() {
assertThat(new MariaDbProvider().runningSettings()).isEmpty();
assertThat(new MariaDbProvider().savedSettings()).isEmpty();
}
@Test
void theCompiledClassesLinkNoHostInternals() throws Exception {
Path classes = Path.of("target", "classes");