Compare commits

...
10 Commits
Author SHA1 Message Date
kuba df63969bc5 oh lord 2026-05-20 18:23:27 +02:00
kuba b8ae8956b2 ah fuck 2026-05-20 18:21:36 +02:00
kuba 24a76758c2 lol 2026-05-20 18:21:18 +02:00
kuba dfd5fdc27c there 2026-05-20 18:20:47 +02:00
kuba 42e3d55cf4 what the hell did i do? 2026-05-20 18:14:53 +02:00
kuba 59d7db73f1 redo thing 2026-05-20 18:13:41 +02:00
kuba f8e72ac5b3 undo bad thing 2026-05-20 18:01:56 +02:00
kuba 8e92fd63bd fix? - maybe 2026-05-20 17:56:38 +02:00
kuba 5e54483582 fix 2026-05-20 17:44:31 +02:00
kuba 1b99b2e5d8 some changes 2026-05-20 17:31:03 +02:00
10 changed files with 31 additions and 37 deletions
+1
View File
@@ -1 +1,2 @@
console.log("FM-DX Webserver by Noobish @ FMDX.org and KubaPro010 @ radio95")
require('./server/index.js');
-1
View File
@@ -18,7 +18,6 @@
"express": "5.2.1",
"express-session": "1.19.0",
"ffmpeg-static": "5.3.0",
"figlet": "^1.10.0",
"geoip-lite": "^1.4.10",
"http": "0.0.1-security",
"net": "1.0.2",
+1 -1
View File
@@ -150,7 +150,7 @@ function handleData(wss, receivedData, rdsWss) {
case receivedLine.startsWith('Ss'):
processSignal(receivedLine, true, false);
break;
case receivedLine.startsWith('SS'): // ss? oh no
case receivedLine.startsWith('SS'): // ss? germany mentioned?
processSignal(receivedLine, true, true);
break;
case receivedLine.startsWith('SM'):
+6 -11
View File
@@ -14,7 +14,7 @@ const storage = require('./storage');
const tunerProfiles = require('./tuner_profiles');
const { logInfo, logs } = require('./console');
const dataHandler = require('./datahandler');
const serverList = require('./server_list');
const serverListUpdate = require('./server_list');
// Endpoints
router.get('/', (req, res) => {
@@ -246,12 +246,7 @@ router.get('/addToBanlist', (req, res) => {
return;
}
const ipAddress = req.query.ip;
const location = 'Unknown';
const date = Date.now();
const reason = req.query.reason;
userBanData = [ipAddress, location, date, reason];
userBanData = [req.query.ip, 'Unknown', Date.now(), req.query.reason];
if (typeof serverConfig.webserver.banlist !== 'object') serverConfig.webserver.banlist = [];
@@ -286,7 +281,7 @@ router.post('/saveData', (req, res) => {
let firstSetup;
if(req.session.isAdminAuthenticated || !configExists()) {
configUpdate(data);
serverList.update();
serverListUpdate.update();
if(!configExists()) firstSetup = true;
logInfo('Server config changed successfully.');
@@ -327,7 +322,8 @@ router.get('/static_data', (req, res) => {
rdsTimeout: serverConfig.webserver.rdsTimeout || 0,
tunerName: serverConfig.identification.tunerName || '',
tunerDesc: serverConfig.identification.tunerDesc || '',
ant: serverConfig.antennas || {}
ant: serverConfig.antennas || {},
fork: "radio95"
});
});
@@ -441,8 +437,7 @@ router.get('/tunnelservers', async (req, res) => {
const servers = [
{ value: "eu", host: "eu.fmtuner.org", label: "Europe" },
{ value: "us", host: "us.fmtuner.org", label: "Americas" },
{ value: "sg", host: "sg.fmtuner.org", label: "Asia & Oceania" },
{ value: "pldx", host: "pldx.duckdns.org", label: "Poland (k201)" },
{ value: "sg", host: "sg.fmtuner.org", label: "Asia & Oceania" }
];
const results = await Promise.all(
+4 -12
View File
@@ -1,18 +1,10 @@
const terminalWidth = require('readline').createInterface({input: process.stdin, output: process.stdout}).output.columns;
console.log('\x1b[32m' + require('figlet').textSync("FM-DX Webserver"));
console.log('\x1b[2mby (Noobish @ \x1b[4mFMDX.org\x1b[0m\x1b[32m\x1b[2m) + KubaPro010\x1b[0m');
console.log("v" + require('../package.json').version)
console.log('\x1b[90m' + '─'.repeat(terminalWidth - 1) + '\x1b[0m');
const { serverConfig } = require('./server_config');
const tunnel = require('./tunnel');
tunnel.download();
require('./stream/index');
require("./device");
require('./stream/index');
const startServer = require("./web");
const { serverConfig } = require('./server_config');
{
const helpers = require('./helpers');
@@ -20,7 +12,7 @@ const startServer = require("./web");
if (plugins.length > 0) setTimeout(helpers.startPluginsWithDelay, 3000, plugins, 3000);
}
startServer(serverConfig.webserver.webserverIp === '0.0.0.0' ? 'localhost' : serverConfig.webserver.webserverIp);
require("./web")(serverConfig.webserver.webserverIp);
tunnel.connect();
require('./server_list').update();
require('./server_list')();
+13 -5
View File
@@ -23,8 +23,11 @@ function parsePluginConfig(filePath) {
if (pluginConfig.frontEndPath) {
const sourcePath = path.join(path.dirname(filePath), pluginConfig.frontEndPath);
const destinationDir = path.join(__dirname, '../web/js/plugins', path.dirname(pluginConfig.frontEndPath));
const destinationDir = path.join(
__dirname,
'../web/js/plugins',
path.relative(pluginsDir, path.dirname(sourcePath))
);
// Check if the source path exists
if (!fs.existsSync(sourcePath)) {
console.error(`Error: source path ${sourcePath} does not exist.`);
@@ -77,9 +80,14 @@ if (process.platform === 'win32') {
const pluginConfigs = [];
readJSFiles(pluginsDir).forEach(file => {
const filePath = path.join(pluginsDir, file);
const config = parsePluginConfig(filePath);
if (Object.keys(config).length > 0) pluginConfigs.push(config);
var filePath = path.join(pluginsDir, file);
const dir = fs.statSync(filePath).isDirectory();
if(dir) filePath = path.join(pluginsDir, file, file);
var config = parsePluginConfig(filePath);
if(dir) config = {...config, prefix: `${file}/`}
else config = {...config, prefix: ""}
pluginConfigs.push(config);
});
module.exports = pluginConfigs;
+1 -1
View File
@@ -94,7 +94,7 @@ let serverConfig = {
enabled: false,
username: "",
token: "",
region: "pldx",
region: "eu",
lowLatencyMode: false,
subdomain: "",
httpName: "",
+1 -1
View File
@@ -81,4 +81,4 @@ function update() {
timeoutID = setInterval(sendKeepalive, 5 * 60 * 1000);
}
module.exports.update = update;
module.exports = update;
+1 -1
View File
@@ -43,7 +43,7 @@ async function connect() {
const cfg = ejs.render(frpcConfigTemplate, {
cfg: serverConfig.tunnel,
host: serverConfig.tunnel.community.enabled ? serverConfig.tunnel.community.host : ((serverConfig.tunnel.region == "pldx") ? "pldx.duckdns.org" : (serverConfig.tunnel.region + ".fmtuner.org")),
host: serverConfig.tunnel.community.enabled ? serverConfig.tunnel.community.host : (serverConfig.tunnel.region + ".fmtuner.org"),
server: {
port: serverConfig.webserver.webserverPort
}
+3 -4
View File
@@ -420,12 +420,12 @@
<p>Any compatible <strong>.js</strong> plugin, which is in the "plugins" folder, will be listed here.<br>
Click on the individual plugins to enable/disable them.</p>
<select id="plugins" class="multiselect" multiple>
<% plugins.forEach(function(plugin) {
<% plugins.forEach(function(plugin) {
if (plugin.frontEndPath) { %>
<option data-name="<%= plugin.frontEndPath %>" title="<%= plugin.name %> by <%= plugin.author %> [v<%= plugin.version %>]">
<option data-name="<%= plugin.prefix %><%= plugin.frontEndPath %>" title="<%= plugin.name %> by <%= plugin.author %> [v<%= plugin.version %>]">
<%= plugin.name %> by <%= plugin.author %> [v<%= plugin.version %>]
</option>
<% }
<% }
}); %>
</select><br><br>
<a href="https://github.com/NoobishSVK/fm-dx-webserver/wiki/Plugin-List" target="_blank">Download new plugins here!</a>
@@ -685,7 +685,6 @@
{ value: 'eu', label: 'Europe' },
{ value: 'us', label: 'Americas' },
{ value: 'sg', label: 'Asia & Oceania' },
{ value: 'pldx', label: 'Poland (k201)' },
]
}) %>
<%- include('_components', {component: 'text', cssClass: 'w-150 br-15', placeholder: '', label: 'Username', id: 'tunnel-username'}) %>