diff --git a/db/knex_migrations/2026-05-25-0000-add-gamedig-token.js b/db/knex_migrations/2026-05-25-0000-add-gamedig-token.js new file mode 100644 index 000000000..7717250b7 --- /dev/null +++ b/db/knex_migrations/2026-05-25-0000-add-gamedig-token.js @@ -0,0 +1,11 @@ +exports.up = function (knex) { + return knex.schema.alterTable("monitor", function (table) { + table.text("gamedig_token").defaultTo(null); + }); +}; + +exports.down = function (knex) { + return knex.schema.alterTable("monitor", function (table) { + table.dropColumn("gamedig_token"); + }); +}; diff --git a/server/model/monitor.js b/server/model/monitor.js index e8f28c9dc..4df6d0e9e 100644 --- a/server/model/monitor.js +++ b/server/model/monitor.js @@ -231,6 +231,7 @@ class Monitor extends BeanModel { oauth_audience: this.oauth_audience, oauth_auth_method: this.oauth_auth_method, bearer_token: this.bearer_token, + gamedigToken: this.gamedigToken, pushToken: this.pushToken, databaseConnectionString: this.databaseConnectionString, radiusUsername: this.radiusUsername, diff --git a/server/monitor-types/gamedig.js b/server/monitor-types/gamedig.js index 5d47f7d96..993dd96a5 100644 --- a/server/monitor-types/gamedig.js +++ b/server/monitor-types/gamedig.js @@ -15,6 +15,7 @@ class GameDigMonitorType extends MonitorType { host: monitor.hostname, port: monitor.port, givenPortOnly: Boolean(monitor.gamedigGivenPortOnly), + ...(monitor.gamedigToken ? { token: monitor.gamedigToken } : {}), }); heartbeat.msg = state.name; diff --git a/server/server.js b/server/server.js index c71d748a0..141f564a1 100644 --- a/server/server.js +++ b/server/server.js @@ -918,6 +918,7 @@ let needSetup = false; bean.kafkaProducerSsl = monitor.kafkaProducerSsl; bean.kafkaProducerAllowAutoTopicCreation = monitor.kafkaProducerAllowAutoTopicCreation; bean.gamedigGivenPortOnly = monitor.gamedigGivenPortOnly; + bean.gamedigToken = monitor.gamedigToken; bean.remote_browser = monitor.remote_browser; bean.smtpSecurity = monitor.smtpSecurity; bean.snmpVersion = monitor.snmpVersion; diff --git a/src/lang/en.json b/src/lang/en.json index 8e8b9d203..a7dbc97c7 100644 --- a/src/lang/en.json +++ b/src/lang/en.json @@ -1110,6 +1110,8 @@ "noOrBadCertificate": "No/Bad Certificate", "cacheBusterParam": "Add the {0} parameter", "cacheBusterParamDescription": "Randomly generated parameter to skip caches.", + "gamedigToken": "Token", + "gamedigTokenDescription": "Optional. Some game servers require an authentication token.", "gamedigGuessPort": "Gamedig: Guess Port", "gamedigGuessPortDescription": "The port used by Valve Server Query Protocol may be different from the client port. Try this if the monitor cannot connect to your server.", "Message format": "Message format", diff --git a/src/pages/EditMonitor.vue b/src/pages/EditMonitor.vue index 52088635b..48117c8f6 100644 --- a/src/pages/EditMonitor.vue +++ b/src/pages/EditMonitor.vue @@ -716,6 +716,21 @@ /> + +
+ + +
+ {{ $t("gamedigTokenDescription") }} +
+
+