add basic startup logging

This commit is contained in:
Mystikfluu 2022-07-25 19:03:42 +02:00
parent 9fad64a9ef
commit 2b42c2f1a7
2 changed files with 21 additions and 10 deletions

View File

@ -44,13 +44,13 @@ module.exports = {
// res.status(200).send("")
// })
allowAllTraffic("/api/pid")
allowAllTraffic("/api/post","POST")
allowAllTraffic("/api/getotheruser")
allowAllTraffic("/api/getPost")
allowAllTraffic("/api/getPostsLowerThan")
allowAllTraffic("/api/settings")
allowAllTraffic("/api/settings","POST")
allowAllTraffic(router,"/api/pid")
allowAllTraffic(router,"/api/post","POST")
allowAllTraffic(router,"/api/getotheruser")
allowAllTraffic(router,"/api/getPost")
allowAllTraffic(router,"/api/getPostsLowerThan")
allowAllTraffic(router,"/api/settings")
allowAllTraffic(router,"/api/settings","POST")
}

View File

@ -61,6 +61,10 @@ console.log = log_info
console.log(5,"starting up")
const http = require('http');
const https = require('https');
const crypto = require("crypto");
@ -71,15 +75,14 @@ const bodyParser = require("body-parser");
const cookieParser = require('cookie-parser');
const signature = require('cookie-signature')
const mysql = require('mysql');
const csurf = require("csurf");
const WebSocket = require("ws").Server;
const Jimp = require('jimp');
console.log(5,"loaded dependencies")
const router = express.Router();
const app = express();
const csrfProtection = csurf({ cookie: true })
const HASHES_DB = config.cookies.server_hashes
const HASHES_COOKIE = config.cookies.client_hashes
const HASHES_DIFF = HASHES_DB - HASHES_COOKIE
@ -320,6 +323,8 @@ function increaseUSERCall(req,res,next) {
return true
}
console.log(5,"loading routes")
app.use(useragent.express());
app.use(fileUpload())
app.use(bodyParser.json({ limit: "100mb" }));
@ -394,6 +399,8 @@ router.get("/",function(req,res) {
res.sendFile(dir+"views/index.html")
})
console.log(5,"finished loading user routes, starting with api routes")
/*
START /API/*
@ -1067,6 +1074,8 @@ router.post("/login",async function(req,res) {
});
})
console.log(5,"finished loading routes")
app.use(router)
const httpServer = http.createServer(app);
@ -1118,3 +1127,5 @@ wss.on("connection", function connection(ws) {
}
})
})
console.log(5,"starting up all services")