mirror of
https://github.com/KubaPro010/fm-dx-webserver.git
synced 2026-07-30 16:59:15 +02:00
fix reason
This commit is contained in:
@@ -31,16 +31,16 @@ var dataToSend = {
|
|||||||
agc: 0,
|
agc: 0,
|
||||||
ant: 0,
|
ant: 0,
|
||||||
txInfo: {
|
txInfo: {
|
||||||
tx: '',
|
tx: '', // Name
|
||||||
pol: '',
|
pol: '', // Polarisation
|
||||||
erp: '',
|
erp: '', // Power
|
||||||
city: '',
|
city: '',
|
||||||
itu: '',
|
itu: '', // Country
|
||||||
dist: '',
|
dist: '', // Distance
|
||||||
azi: '',
|
azi: '', // Azimuth
|
||||||
id: '',
|
id: 0, // Some number
|
||||||
reg: false,
|
reg: false,
|
||||||
pi: '',
|
pi: '', // PI
|
||||||
},
|
},
|
||||||
country_name: '',
|
country_name: '',
|
||||||
country_iso: 'UN',
|
country_iso: 'UN',
|
||||||
|
|||||||
+4
-3
@@ -24,10 +24,11 @@ router.get('/', (req, res) => {
|
|||||||
const normalizedIp = requestIp?.replace(/^::ffff:/, '');
|
const normalizedIp = requestIp?.replace(/^::ffff:/, '');
|
||||||
const ipList = (normalizedIp || '').split(',').map(ip => ip.trim()).filter(Boolean); // in case there are multiple IPs (proxy), we need to check all of them
|
const ipList = (normalizedIp || '').split(',').map(ip => ip.trim()).filter(Boolean); // in case there are multiple IPs (proxy), we need to check all of them
|
||||||
|
|
||||||
const isBanned = ipList.some(ip => serverConfig.webserver.banlist.some(banEntry => banEntry[0] === ip));
|
const banEntry = serverConfig.webserver.banlist.find(banEntry => ipList.includes(banEntry[0]));
|
||||||
|
|
||||||
if (isBanned) {
|
if (banEntry) {
|
||||||
res.render('403');
|
const reason = banEntry[3];
|
||||||
|
res.render('403', { reason });
|
||||||
logInfo(`Web client (${normalizedIp}) is banned`);
|
logInfo(`Web client (${normalizedIp}) is banned`);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|||||||
+3
-3
@@ -24,9 +24,9 @@
|
|||||||
There's a possibility you were kicked by the system.<br>
|
There's a possibility you were kicked by the system.<br>
|
||||||
Please try again later.</p>
|
Please try again later.</p>
|
||||||
|
|
||||||
<% if (reason) { %>
|
<% if (reason) { %>
|
||||||
<p><strong>Reason:</strong> too dig of a bick</p>
|
<p><strong>Reason:</strong> <%= reason %></p>
|
||||||
<% } %>
|
<% } %>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
Reference in New Issue
Block a user