Skip to content

Commit db3d553

Browse files
committed
1.2.6
1 parent c8c0a3c commit db3d553

6 files changed

Lines changed: 33 additions & 4 deletions

File tree

app.js

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ const {
6161
} = require('express');
6262

6363
// Kubek version
64-
const version = "v1.2.5";
64+
const version = "v1.2.6";
6565

6666
const rateLimit = require('express-rate-limit');
6767
const authLimiter = rateLimit({
@@ -1074,6 +1074,20 @@ app.get('/kubek/usage', (request, response) => {
10741074
}
10751075
});
10761076

1077+
app.get("/kubek/support-uid", (request, response) => {
1078+
ip = request.headers['x-forwarded-for'] || request.socket.remoteAddress;
1079+
ip = ip.replace("::ffff:", "").replace("::1", "127.0.0.1");
1080+
if (cfg['internet-access'] == false && ip != "127.0.0.1") {
1081+
response.send("Cannot be accessed from the internet");
1082+
} else {
1083+
if (typeof request.cookies !== "undefined" && typeof request.cookies["__auth__"] !== "undefined" && !isAuth(request.cookies["__auth__"])) {
1084+
response.redirect("/login.html");
1085+
} else {
1086+
response.send(statsCollector.supportUID());
1087+
}
1088+
}
1089+
});
1090+
10771091
app.get("/kubek/config", (request, response) => {
10781092
ip = request.headers['x-forwarded-for'] || request.socket.remoteAddress;
10791093
ip = ip.replace("::ffff:", "").replace("::1", "127.0.0.1");

my_modules/statistics.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,13 @@ const url = "http://m91237kd.beget.tech/savestats_kubek.php?savedata=";
33
var os = require('os');
44
var MD5 = require("crypto-js/md5");
55

6+
exports.supportUID = () => {
7+
cp_unq = os.cpus();
8+
uniqueid_unq = os.version + "850_" + cp_unq[0].model + cp_unq[1].speed + Math.round(os.totalmem() / 1024 / 1024);
9+
uniqueid_unq = MD5(uniqueid_unq).toString();
10+
return uniqueid_unq;
11+
}
12+
613
exports.collectStats = (cfg, version, cb) => {
714
cp_unq = os.cpus();
815
uniqueid_unq = os.version + "850_" + cp_unq[0].model + cp_unq[1].speed + Math.round(os.totalmem() / 1024 / 1024);

translations/en.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,5 +67,6 @@
6767
"{{autherror}}": "Authorization error",
6868
"{{savelogs}}": "Save logs",
6969
"{{allowintacc}}": "Allow access from other IPs (needs restart to work properly)",
70-
"{{hardware-info}}": "System information"
70+
"{{hardware-info}}": "System information",
71+
"{{sup-uid}}": "Support-ID"
7172
}

translations/nl.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,5 +67,6 @@
6767
"{{autherror}}": "Authenticatie fout",
6868
"{{savelogs}}": "Logs opslaan",
6969
"{{allowintacc}}": "Toegang vanaf andere IP's toestaan (opnieuw opstarten is vereist om correct te werken)",
70-
"{{hardware-info}}": "Systeem informatie"
70+
"{{hardware-info}}": "Systeem informatie",
71+
"{{sup-uid}}": "Support-ID"
7172
}

translations/ru.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,5 +67,6 @@
6767
"{{autherror}}": "Ошибка авторизации",
6868
"{{savelogs}}": "Сохранять логи",
6969
"{{allowintacc}}": "Разрешить доступ с других IP (нужен перезапуск для правильной работы)",
70-
"{{hardware-info}}": "О системе"
70+
"{{hardware-info}}": "О системе",
71+
"{{sup-uid}}": "ID для тех. поддержки"
7172
}

www/hosting-settings.html

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -142,6 +142,8 @@
142142
</div>
143143
</div>
144144
<button style="margin-top: 48px;" class="btn btn-primary saveBtn">{{ok}}</button>
145+
<br><br>
146+
<span style="font-size: 11pt; color: rgb(170,170,170);">{{sup-uid}}: </span><span style="font-size: 11pt; color: black;" id="support-uid"></span>
145147
</div>
146148
</body>
147149

@@ -190,6 +192,9 @@
190192
socket.emit("update", {
191193
type: "servers"
192194
});
195+
$.get("/kubek/support-uid", function(uid){
196+
$("#support-uid").text(uid);
197+
});
193198
$.get("/kubek/config", function (data) {
194199
kubekCfg = data;
195200
if (kubekCfg['lang'] == "en") {

0 commit comments

Comments
 (0)