Skip to content

Commit

Permalink
3.0.5
Browse files Browse the repository at this point in the history
- Исправлены некоторые проблемы
- Изменены ссылки в связи со сменой домена
  • Loading branch information
Seeroy committed Jun 9, 2024
1 parent c2d22fd commit 10276b4
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 29 deletions.
14 changes: 3 additions & 11 deletions app.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,26 +2,18 @@
const COMMONS = require("./modules/commons");
const CONFIGURATION = require("./modules/configuration");

// Создаём нужные папки (если их не существует)
COMMONS.makeBaseDirs();

// Загружаем файлы конфигурации в глобальные переменные
CONFIGURATION.reloadAllConfigurations();
CONFIGURATION.migrateOldMainConfig();
CONFIGURATION.migrateOldServersConfig();

// Создаём нужные папки (если их не существует)
COMMONS.makeBaseDirs();

const LOGGER = require("./modules/logger");
const MULTI_LANGUAGE = require("./modules/multiLanguage");
const PREDEFINED = require("./modules/predefined");
const TASK_MANAGER = require("./modules/taskManager");
const UPDATER = require("./modules/updater");
const WEBSERVER = require("./modules/webserver");
const SECURITY = require("./modules/security");
const STATS_COLLECTION = require("./modules/statsCollection");
const CORES_MANAGER = require("./modules/coresManager");
const DOWNLOADS_MANAGER = require("./modules/downloadsManager");
const JAVA_MANAGER = require("./modules/javaManager");
const SERVERS_GENERATOR = require("./modules/serversGenerator");
const FTP_DAEMON = require("./modules/ftpDaemon");

const collStats = STATS_COLLECTION.collectStats();
Expand Down
14 changes: 5 additions & 9 deletions modules/configuration.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
const fs = require("fs");
const crypto = require("crypto");
const path = require("path");
const colors = require("colors");

const PREDEFINED = require("./predefined");
const COMMONS = require("./commons");
const SECURITY = require("./security");
const SERVERS_CONTROLLER = require("./serversController");

global.autoStartedServers = [];
Expand Down Expand Up @@ -69,7 +69,7 @@ exports.writeDefaultConfig = () => {

// Записать стандартный файл пользователей
exports.writeDefaultUsersConfig = () => {
let newHash = crypto.randomUUID().toString();
let newHash = SECURITY.generateSecureID();
let preparedUsersConfig = PREDEFINED.CONFIGURATIONS.USERS;
preparedUsersConfig["kubek"]["secret"] = newHash;
this.writeAnyConfig("users.json", preparedUsersConfig);
Expand Down Expand Up @@ -132,15 +132,11 @@ exports.writeUsersConfig = (data) => {

// Прочитать конфиг серверов (записать и отдать дефолтный при отсутствии)
exports.readServersConfig = () => {
if (fs.existsSync("./servers/servers.json")) {
let rdServersCfg = this.readAnyConfig("./servers/servers.json");
return rdServersCfg;
} else {
if (!fs.existsSync("./servers")) {
fs.mkdirSync("./servers");
}
if (!fs.existsSync("./servers/servers.json")) {
this.writeAnyConfig("./servers/servers.json", PREDEFINED.CONFIGURATIONS.SERVERS);
return PREDEFINED.CONFIGURATIONS.SERVERS;
} else {
return this.readAnyConfig("./servers/servers.json");
}
};

Expand Down
8 changes: 4 additions & 4 deletions modules/predefined.js
Original file line number Diff line number Diff line change
Expand Up @@ -73,10 +73,10 @@ exports.KUBEK_LOGO_ASCII = " /$$ /$$ /$$ \n
exports.UPDATES_URL_API = "https://api.github.com/repos/Seeroy/kubek-minecraft-dashboard/releases";

// URL к API для отправки статистики
exports.STATS_SEND_URL = "https://statscol.seeroy.ru/save_kubek?savedata=";
exports.STATS_SEND_URL = "https://statscol.seeeroy.ru/save_kubek?savedata=";

// URL с файлом ядер Spigot
exports.SPIGOT_JSON_URL = "https://kubek.seeroy.ru/spigots.json";
exports.SPIGOT_JSON_URL = "https://kubek.seeeroy.ru/spigots.json";

// URL со списком доступных версий Java
exports.JAVA_LIST_URL = "https://api.adoptium.net/v3/info/available_releases";
Expand Down Expand Up @@ -144,7 +144,7 @@ exports.SERVER_CORES = {
name: "vanilla",
displayName: "Vanilla",
versionsMethod: "externalURL",
versionsUrl: "https://kubek.seeroy.ru/vanilla.json",
versionsUrl: "https://kubek.seeeroy.ru/vanilla.json",
urlGetMethod: "externalURL"
},
paper: {
Expand Down Expand Up @@ -175,7 +175,7 @@ exports.SERVER_CORES = {
name: "spigot",
displayName: "Spigot",
versionsMethod: "externalURL",
versionsUrl: "https://kubek.seeroy.ru/spigots.json",
versionsUrl: "https://kubek.seeeroy.ru/spigots.json",
urlGetMethod: "externalURL"
},
};
Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 1 addition & 3 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "kubek-minecraft-dashboard",
"version": "3.0.4",
"version": "3.0.5",
"description": "",
"main": "app.js",
"author": "Seeroy",
Expand All @@ -23,8 +23,6 @@
"decompress": "^4.2.1",
"express": "^4.18.2",
"express-fileupload": "^1.4.3",
"express-group-routes": "^1.1.0",
"express-longpoll": "^0.0.6",
"ftpd": "^0.2.16",
"iconv-lite": "^0.6.3",
"is-in-subnet": "^4.0.1",
Expand Down

0 comments on commit 10276b4

Please sign in to comment.