Merge #31
@ -69,7 +69,7 @@ module.exports = () => {
|
|||||||
}
|
}
|
||||||
if (pass){
|
if (pass){
|
||||||
if (command_bds === 'start'){
|
if (command_bds === 'start'){
|
||||||
var bds_init = bds.start()
|
bds.start()
|
||||||
var command_status = `Bds Started`
|
var command_status = `Bds Started`
|
||||||
} else if (command_bds === 'stop'){
|
} else if (command_bds === 'stop'){
|
||||||
bds.stop()
|
bds.stop()
|
||||||
|
14
API/log.js
14
API/log.js
@ -6,6 +6,19 @@ module.exports = () => {
|
|||||||
const app = express();
|
const app = express();
|
||||||
var cors = require('cors');
|
var cors = require('cors');
|
||||||
app.use(cors());
|
app.use(cors());
|
||||||
|
const rateLimit = require("express-rate-limit");
|
||||||
|
const limiter = rateLimit({
|
||||||
|
windowMs: 5 * 60 * 1000, // 5 minutes
|
||||||
|
message: {
|
||||||
|
"status": false,
|
||||||
|
"log": "we had an overflow of log requests, please wait 5 minutes."
|
||||||
|
},
|
||||||
|
statusCode: 200,
|
||||||
|
max: 5000 // limit each IP to 5000 requests per windowMs
|
||||||
|
});
|
||||||
|
app.use(limiter);
|
||||||
|
const requestIp = require('request-ip');
|
||||||
|
app.use(requestIp.mw())
|
||||||
app.get("/", (req, res) => {
|
app.get("/", (req, res) => {
|
||||||
if (typeof bds_log_string === 'undefined'){
|
if (typeof bds_log_string === 'undefined'){
|
||||||
if (fs.existsSync(localStorage.getItem("old_log_file"))){
|
if (fs.existsSync(localStorage.getItem("old_log_file"))){
|
||||||
@ -25,6 +38,7 @@ module.exports = () => {
|
|||||||
"sucess": sucess,
|
"sucess": sucess,
|
||||||
"log": text,
|
"log": text,
|
||||||
"log_file": log_file,
|
"log_file": log_file,
|
||||||
|
"ip": `${req.clientIp}`,
|
||||||
"requeset_date": bds.date()
|
"requeset_date": bds.date()
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
@ -18,6 +18,5 @@ This module was made to work both in the cli version and in gui versions like el
|
|||||||
|
|
||||||
some deven ports are unlocked by the firewall if enabled:
|
some deven ports are unlocked by the firewall if enabled:
|
||||||
|
|
||||||
- 28574
|
|
||||||
- 1932
|
- 1932
|
||||||
- 6565
|
- 6565
|
||||||
|
@ -43,6 +43,7 @@
|
|||||||
"qrcode": "^1.4.4",
|
"qrcode": "^1.4.4",
|
||||||
"shelljs": "^0.8.4",
|
"shelljs": "^0.8.4",
|
||||||
"systeminformation": "^5.0.10",
|
"systeminformation": "^5.0.10",
|
||||||
|
"request-ip": "^2.1.3",
|
||||||
"telegraf": "^4.0.0"
|
"telegraf": "^4.0.0"
|
||||||
},
|
},
|
||||||
"engines": {
|
"engines": {
|
||||||
|
@ -18,7 +18,7 @@ module.exports.start = () => {
|
|||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if (require('command-exists').sync('java')){
|
if (require('command-exists').sync('java')){
|
||||||
var start_server = exec(`java -jar server.jar nogui`, {cwd: bds.bds_dir_java});
|
var start_server = exec(`java -Xmx1024M -Xms1024M -jar server.jar nogui`, {cwd: bds.bds_dir_java});
|
||||||
} else {
|
} else {
|
||||||
if (bds.system == 'windows'){
|
if (bds.system == 'windows'){
|
||||||
require('open')("http://docs.sirherobrine23.com/bds_maneger_api_java#Windows");
|
require('open')("http://docs.sirherobrine23.com/bds_maneger_api_java#Windows");
|
||||||
|
Reference in New Issue
Block a user