diff --git a/install/css/styles.scss b/install/css/styles.scss index fc7786034..b3aa982ed 100644 --- a/install/css/styles.scss +++ b/install/css/styles.scss @@ -258,18 +258,12 @@ form { display: flex; flex-direction: row; justify-content: end; + padding: 0 0 6px; } .db-basic-config-notice { - display: flex; - margin-top: 10px; - font-size: 12px; - font-weight: bold; - color: $cRed; - - span { - padding: 10px; - } + margin-bottom: 0; + background: none; } } @@ -330,6 +324,27 @@ form { } + .db-basic-config-notice { + display: flex; + background: $boxBackground; + margin-bottom: 10px; + font-size: 12px; + font-weight: normal; + + ul { + margin-bottom: 0; + } + + span { + color: $cBlack; + padding: 10px; + &.danger { + font-weight: bold; + color: $cRed; + } + } + } + } .installation-successful { diff --git a/install/index.html b/install/index.html index 5f8f9c5aa..199447ef3 100644 --- a/install/index.html +++ b/install/index.html @@ -34,11 +34,11 @@

- App -

- +
- +
@@ -91,6 +91,15 @@

- App -

- Storage -

+
+ + Default samples: +
    +
  • Client: mysql - Port: 3306
  • +
  • Client: mongodb - Port: 27017
  • +
+
+
- +
@@ -129,16 +138,19 @@

- Storage -

There was an error during the installation process.

+
+ + DANGER: +
    +
  • The automatic installation for the basic configuration and the sample data are only available for the mysql client.
  • +
  • Uncheck this is only if you know what you are doing.
    Without this you will get all the tables empty, even the ones with default required values.
  • +
+
+
-
- - DANGER: uncheck this is only if you know what you are doing. - Without this you will get all the tables empty, even the ones with default required values. - -
diff --git a/lib/game/server/installer.js b/lib/game/server/installer.js index df61ff77c..a505fb98c 100644 --- a/lib/game/server/installer.js +++ b/lib/game/server/installer.js @@ -149,7 +149,7 @@ class Installer this.themeManager.installerPathIndex, {encoding: this.encoding()} ); - let templateVariables = req?.session?.templateVariables || {}; + let templateVariables = req?.session?.templateVariables || this.fetchDefaults(); return res.send(TemplateEngine.render(installerIndexTemplate, templateVariables)); } if(!req.url.endsWith('.html')){ @@ -158,6 +158,32 @@ class Installer next(); } + fetchDefaults() + { + let host = (process.env.RELDENS_HOST || '').toString(); + let port = (process.env.RELDENS_PORT || '').toString(); + let adminPath = (process.env.RELDENS_ADMIN_ROUTE_PATH || '').toString(); + let secureAdmin = Number(process.env.RELDENS_ADMIN_SECURE_LOGIN || 1); + let hotPlug = Number(process.env.RELDENS_HOT_PLUG || 1); + let dbClient = (process.env.RELDENS_DB_CLIENT || '').toString(); + let dbHost = (process.env.RELDENS_DB_HOST || '').toString(); + let dbPort = (process.env.RELDENS_DB_PORT || '').toString(); + let dbName = (process.env.RELDENS_DB_NAME || '').toString(); + return { + 'app-host': '' !== host ? host : 'http://localhost', + 'app-port':'' !== port ? port : '8080', + 'app-admin-path': '' !== adminPath ? adminPath : '/reldens-admin', + 'app-secure-admin-checked': 1 === secureAdmin ? ' checked="checked"' : '', + 'app-admin-hot-plug-checked': 1 === hotPlug ? ' checked="checked"' : '', + 'db-client': '' !== dbClient ? dbClient : 'mysql', + 'db-host': '' !== dbHost ? dbHost : 'localhost', + 'db-port': '' !== dbPort ? dbPort : '3306', + 'db-name': '' !== dbName ? dbName : 'reldens', + 'db-basic-config-checked': ' checked="checked"', + 'db-sample-data-checked': ' checked="checked"' + }; + } + async executeQueryFile(migrationsPath, dbDriver, fileName) { await dbDriver.rawQuery(