diff --git a/public/js/app.js b/public/js/app.js
index 2d9c053..ed3b33a 100644
--- a/public/js/app.js
+++ b/public/js/app.js
@@ -92,15 +92,16 @@ document.getElementById('serverForm').addEventListener('submit', async (e) => {
`).join('')}
`;
- // Determine port for widget: use SRV-resolved port if available, else user-provided or default
- let widgetPort = port;
- if (result.srvPort) {
- widgetPort = result.srvPort;
+ // Use SRV-resolved host and port if available, else user-provided or default
+ if (host.includes("my-mc.link")){
+ host = "my-mc.link"
}
+ let widgetHost = host;
+ let widgetPort = result.srvPort || port;
- // Show widget section and set widget code with static my-mc.link hostname
+ // Show widget section and set widget code
widgetSection.classList.remove('hidden');
- const widgetIframe = ``;
+ const widgetIframe = ``;
widgetCode.textContent = widgetIframe;
} else {
statusContent.innerHTML = `
diff --git a/status-site.js b/status-site.js
index f1cc347..ca8534b 100644
--- a/status-site.js
+++ b/status-site.js
@@ -1,7 +1,7 @@
const express = require('express');
const { promisify } = require('util');
const { exec } = require('child_process');
-const dns = require('dns').promises; // Add DNS module for SRV lookup
+const dns = require('dns').promises;
const rateLimit = require('express-rate-limit');
const path = require('path');
const fs = require('fs');
@@ -174,7 +174,7 @@ async function checkConnectionStatus(hostname, port) {
}
const data = JSON.parse(stdout);
if (isInfo) logger.info('Java server status check completed', { requestId, isOnline: true, resolvedHost: finalHost, resolvedPort: finalPort });
- return { isOnline: true, data };
+ return { isOnline: true, data, srvHost: finalHost, srvPort: finalPort };
} catch (error) {
logger.error('Java server status check failed', { requestId, error: error.message });
return { isOnline: false, error: error.message };
@@ -205,7 +205,7 @@ async function checkGeyserStatus(hostname, port) {
}
const data = JSON.parse(stdout);
if (isInfo) logger.info('Bedrock server status check completed', { requestId, isOnline: true, resolvedHost: finalHost, resolvedPort: finalPort });
- return { isOnline: true, data };
+ return { isOnline: true, data, srvHost: finalHost, srvPort: finalPort };
} catch (error) {
logger.error('Bedrock server status check failed', { requestId, error: error.message });
return { isOnline: false, error: error.message };
@@ -433,11 +433,6 @@ app.get('/widget/:edition/:host/:port', (req, res) => {
try {
validateEdition(edition);
validateHostname(host);
- // Uncomment this to only allow our system servers to have widgets.
- // if (host !== 'my-mc.link') {
- // logger.error('Unauthorized hostname', { host });
- // throw new Error('Hostname must be my-mc.link');
- // }
validatePort(port);
res.setHeader('Content-Type', 'text/html');
res.send(widgetTemplate(edition, host, port));