Compare commits
No commits in common. "16a25499420bd641c7a9f4d9391052685a81afea" and "64799792934e3ead15bf5dd0ac16d10f3e805f41" have entirely different histories.
16a2549942
...
6479979293
33
index.js
33
index.js
@ -6,7 +6,6 @@ const helper = require("./helpers.js");
|
||||
const loggy = require("./logging")
|
||||
const Eta = require("eta");
|
||||
const _ = require("underscore")
|
||||
const path = require("path")
|
||||
|
||||
loggy.init(true)
|
||||
|
||||
@ -25,26 +24,6 @@ app.use(
|
||||
})
|
||||
);
|
||||
|
||||
// Allowed urls for requests to /assets/
|
||||
const allowsURLs = [
|
||||
'bootstrap-icons/font/bootstrap-icons.css',
|
||||
'js-cookie/dist/js.cookie.min.js',
|
||||
'bootstrap/dist/css/bootstrap.min.css',
|
||||
'mdbootstrap/css/style.css',
|
||||
'bootstrap/dist/js/bootstrap.bundle.min.js',
|
||||
'jquery/dist/jquery.min.js',
|
||||
'darkreader/darkreader.js',
|
||||
'bootstrap-duration-picker/dist/bootstrap-duration-picker.css',
|
||||
'flatpickr/dist/flatpickr.min.css',
|
||||
'bootstrap-duration-picker/dist/bootstrap-duration-picker-debug.js',
|
||||
'flatpickr/dist/flatpickr.js',
|
||||
'bootstrap-icons/font/fonts/bootstrap-icons.woff2',
|
||||
'bootstrap/dist/css/bootstrap.min.css.map',
|
||||
'less/dist/less.min.js',
|
||||
'less/dist/less.min.js.map',
|
||||
'mdbootstrap/js/mdb.min.js'
|
||||
];
|
||||
|
||||
let loadedData = {}
|
||||
|
||||
loggy.log("Loading config", "info", "Config");
|
||||
@ -412,16 +391,6 @@ app.get("/api/ui/v1/lang/set", function (req, res) {
|
||||
});
|
||||
|
||||
|
||||
app.use("/assets/*", function handleModuleFiles(req, res) {
|
||||
if(allowsURLs.indexOf(req.params[0]) > -1){
|
||||
res.sendFile(path.join(__dirname, "node_modules", req.params[0]));
|
||||
} else {
|
||||
loggy.log("Attempt to access restricted asset file " + req.params[0], "error", "Security")
|
||||
res.status(403).json({ status: "error", reason: "Access to restricted asset file denied" });
|
||||
}
|
||||
// console.log(recordedURLs)
|
||||
})
|
||||
|
||||
app.use(function (req, res, next) {
|
||||
res.status(404);
|
||||
loggy.log("Server responded with 404 error", "warn", "Server", true);
|
||||
@ -446,8 +415,6 @@ app.use(function (req, res, next) {
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/*app.use(function(err, req, res, next) {
|
||||
console.error(err.stack);
|
||||
if(String(err.stack).includes("TypeError: Cannot read properties of undefined")) {
|
||||
|
@ -1 +1 @@
|
||||
[{"timestamp":"2022-08-18 16:11:01.607","level":"info","module":"Logging","message":"2022-08-18 16:11:01.607 [info] [Logging] Logging initialized"},{"timestamp":"2022-08-18 16:11:01.608","level":"info","module":"Server","message":"2022-08-18 16:11:01.608 [info] [Server] Preparing server"},{"timestamp":"2022-08-18 16:11:01.609","level":"info","module":"Server","message":"2022-08-18 16:11:01.609 [info] [Server] Preparing static routes"},{"timestamp":"2022-08-18 16:11:01.610","level":"info","module":"Server","message":"2022-08-18 16:11:01.610 [info] [Server] Preparing middlewares"},{"timestamp":"2022-08-18 16:11:01.611","level":"info","module":"Config","message":"2022-08-18 16:11:01.611 [info] [Config] Loading config"},{"timestamp":"2022-08-18 16:11:01.612","level":"info","module":"Language","message":"2022-08-18 16:11:01.612 [info] [Language] Searching for languages"},{"timestamp":"2022-08-18 16:11:01.612","level":"info","module":"Language","message":"2022-08-18 16:11:01.612 [info] [Language] Found 3 languages"},{"timestamp":"2022-08-18 16:11:01.612","level":"info","module":"Language","message":"2022-08-18 16:11:01.612 [info] [Language] Reading language file"},{"timestamp":"2022-08-18 16:11:01.612","level":"info","module":"Websocket","message":"2022-08-18 16:11:01.612 [info] [Websocket] Preparing websocket"},{"timestamp":"2022-08-18 16:11:01.613","level":"info","module":"Server","message":"2022-08-18 16:11:01.613 [info] [Server] Preparing routes"},{"timestamp":"2022-08-18 16:11:01.614","level":"info","module":"Server","message":"2022-08-18 16:11:01.614 [info] [Server] Starting server"},{"timestamp":"2022-08-18 16:13:27.222","level":"error","module":"Security","message":"2022-08-18 16:13:27.222 [error] [Security] Attempt to access restricted asset file mdbootstrap/js/mdb.min.js"},{"timestamp":"2022-08-18 16:13:27.674","level":"error","module":"Security","message":"2022-08-18 16:13:27.674 [error] [Security] Attempt to access restricted asset file mdbootstrap/js/mdb.min.js"},{"timestamp":"2022-08-18 16:13:46.931","level":"info","module":"Shutdown","message":"2022-08-18 16:13:46.931 [info] [Shutdown] Caught interrupt signal and shutting down gracefully"}]
|
||||
[{"timestamp":"2022-07-23 12:23:17.692","level":"info","module":"Logging","message":"2022-07-23 12:23:17.692 [info] [Logging] Logging initialized"},{"timestamp":"2022-07-23 12:23:17.694","level":"info","module":"Server","message":"2022-07-23 12:23:17.694 [info] [Server] Preparing server"},{"timestamp":"2022-07-23 12:23:17.695","level":"info","module":"Server","message":"2022-07-23 12:23:17.695 [info] [Server] Preparing static routes"},{"timestamp":"2022-07-23 12:23:17.696","level":"info","module":"Server","message":"2022-07-23 12:23:17.696 [info] [Server] Preparing middlewares"},{"timestamp":"2022-07-23 12:23:17.696","level":"info","module":"Config","message":"2022-07-23 12:23:17.696 [info] [Config] Loading config"},{"timestamp":"2022-07-23 12:23:17.698","level":"info","module":"Language","message":"2022-07-23 12:23:17.698 [info] [Language] Searching for languages"},{"timestamp":"2022-07-23 12:23:17.699","level":"info","module":"Language","message":"2022-07-23 12:23:17.699 [info] [Language] Found 3 languages"},{"timestamp":"2022-07-23 12:23:17.699","level":"info","module":"Language","message":"2022-07-23 12:23:17.699 [info] [Language] Reading language file"},{"timestamp":"2022-07-23 12:23:17.699","level":"info","module":"Websocket","message":"2022-07-23 12:23:17.699 [info] [Websocket] Preparing websocket"},{"timestamp":"2022-07-23 12:23:17.700","level":"info","module":"Server","message":"2022-07-23 12:23:17.700 [info] [Server] Preparing routes"},{"timestamp":"2022-07-23 12:23:17.701","level":"info","module":"Server","message":"2022-07-23 12:23:17.701 [info] [Server] Starting server"},{"timestamp":"2022-07-23 13:34:09.137","level":"info","module":"Shutdown","message":"2022-07-23 13:34:09.137 [info] [Shutdown] Caught interrupt signal and shutting down gracefully"}]
|
4
package-lock.json
generated
4
package-lock.json
generated
@ -1,12 +1,12 @@
|
||||
{
|
||||
"name": "opencountdown",
|
||||
"version": "1.0.2",
|
||||
"version": "1.0.1",
|
||||
"lockfileVersion": 2,
|
||||
"requires": true,
|
||||
"packages": {
|
||||
"": {
|
||||
"name": "opencountdown",
|
||||
"version": "1.0.2",
|
||||
"version": "1.0.1",
|
||||
"license": "LGPL-3.0",
|
||||
"dependencies": {
|
||||
"body-parser": "^1.19.2",
|
||||
|
1
static/bootstrap-duration-picker
Symbolic link
1
static/bootstrap-duration-picker
Symbolic link
@ -0,0 +1 @@
|
||||
../node_modules/bootstrap-duration-picker/dist/
|
1
static/bootstrap/dist
Symbolic link
1
static/bootstrap/dist
Symbolic link
@ -0,0 +1 @@
|
||||
../../node_modules/bootstrap/dist
|
1
static/colorpicker/css
Symbolic link
1
static/colorpicker/css
Symbolic link
@ -0,0 +1 @@
|
||||
../../node_modules/bootstrap-colorpicker/dist/css
|
1
static/colorpicker/js
Symbolic link
1
static/colorpicker/js
Symbolic link
@ -0,0 +1 @@
|
||||
../../node_modules/bootstrap-colorpicker/dist/js
|
1
static/css/bootstrap-icons.css
vendored
Symbolic link
1
static/css/bootstrap-icons.css
vendored
Symbolic link
@ -0,0 +1 @@
|
||||
../../node_modules/bootstrap-icons/font/bootstrap-icons.css
|
1
static/css/fonts/bootstrap-icons.woff
Symbolic link
1
static/css/fonts/bootstrap-icons.woff
Symbolic link
@ -0,0 +1 @@
|
||||
../../../node_modules/bootstrap-icons/font/fonts/bootstrap-icons.woff
|
1
static/css/fonts/bootstrap-icons.woff2
Symbolic link
1
static/css/fonts/bootstrap-icons.woff2
Symbolic link
@ -0,0 +1 @@
|
||||
../../../node_modules/bootstrap-icons/font/fonts/bootstrap-icons.woff2
|
1
static/flatpickr/dist
Symbolic link
1
static/flatpickr/dist
Symbolic link
@ -0,0 +1 @@
|
||||
../../node_modules/flatpickr/dist/
|
1
static/js/cookie.js
Symbolic link
1
static/js/cookie.js
Symbolic link
@ -0,0 +1 @@
|
||||
../../node_modules/js-cookie/dist/js.cookie.min.js
|
1
static/js/darkreader.js
Symbolic link
1
static/js/darkreader.js
Symbolic link
@ -0,0 +1 @@
|
||||
../../node_modules/darkreader/darkreader.js
|
1
static/js/jquery.min.js
vendored
Symbolic link
1
static/js/jquery.min.js
vendored
Symbolic link
@ -0,0 +1 @@
|
||||
../../node_modules/jquery/dist/jquery.min.js
|
1
static/js/less.min.js
vendored
Symbolic link
1
static/js/less.min.js
vendored
Symbolic link
@ -0,0 +1 @@
|
||||
../../node_modules/less/dist/less.min.js
|
1
static/mdbootstrap/css
Symbolic link
1
static/mdbootstrap/css
Symbolic link
@ -0,0 +1 @@
|
||||
../../node_modules/mdbootstrap/css/
|
1
static/mdbootstrap/js
Symbolic link
1
static/mdbootstrap/js
Symbolic link
@ -0,0 +1 @@
|
||||
../../node_modules/mdbootstrap/js
|
@ -10,27 +10,26 @@
|
||||
<meta name="author" content="TheGreydiamond">
|
||||
|
||||
|
||||
<link rel="stylesheet" href="/assets/bootstrap-icons/font/bootstrap-icons.css">
|
||||
<link rel="stylesheet" href="/assets/mdbootstrap/css/style.css">
|
||||
<link rel="stylesheet" href="/css/bootstrap-icons.css">
|
||||
<link rel="stylesheet" href="/mdbootstrap/css/style.css">
|
||||
|
||||
<script src="/assets/bootstrap/dist/js/bootstrap.bundle.min.js"></script>
|
||||
<script src="/assets/jquery/dist/jquery.min.js"></script>
|
||||
<script src="/bootstrap/dist/js/bootstrap.bundle.min.js"></script>
|
||||
<script src="/js/jquery.min.js"></script>
|
||||
<script type="text/javascript" src="/mdbootstrap/js/mdb.min.js"></script>
|
||||
|
||||
<script type="text/javascript" src="/js/darkreader.js"></script>
|
||||
<script type="text/javascript" src="/assets/js-cookie/dist/js.cookie.min.js"></script>
|
||||
<link href="/assets/bootstrap/dist/css/bootstrap.min.css" rel="stylesheet">
|
||||
<script type="text/javascript" src="/js/cookie.js"></script>
|
||||
<link href="/bootstrap/dist/css/bootstrap.min.css" rel="stylesheet">
|
||||
<link href="/css/mainStyle.css" rel="stylesheet">
|
||||
<link rel="stylesheet" href="/coloris/coloris.min.css" />
|
||||
<link rel="stylesheet" href="/assets/bootstrap-duration-picker/dist/bootstrap-duration-picker.css" />
|
||||
<link rel="stylesheet" href="/assets/flatpickr/dist/flatpickr.min.css" />
|
||||
<script src="/assets/bootstrap-duration-picker/dist/bootstrap-duration-picker-debug.js"></script>
|
||||
<link rel="stylesheet" href="/bootstrap-duration-picker/bootstrap-duration-picker.css" />
|
||||
<link rel="stylesheet" href="/flatpickr/dist/flatpickr.min.css" />
|
||||
<script src="/bootstrap-duration-picker/bootstrap-duration-picker-debug.js"></script>
|
||||
<script src="/coloris/coloris.min.js"></script>
|
||||
|
||||
<script type="text/javascript" src="/assets/flatpickr/dist/flatpickr.js"> </script>
|
||||
<script type="text/javascript" src="/flatpickr/dist/flatpickr.js"> </script>
|
||||
|
||||
|
||||
<link rel="icon" href="/logo/favicon.svg" type="image/svg+xml">
|
||||
<link rel="stylesheet" href="/css/bootstrap-icons.css">
|
||||
</head>
|
||||
|
||||
<body>
|
||||
@ -116,9 +115,17 @@
|
||||
</page>
|
||||
</pages>
|
||||
</main>
|
||||
<script type="text/javascript" src="/js/jsonview.js"></script>
|
||||
<script type="text/javascript" src="js/jsonview.js"></script>
|
||||
<script type="text/javascript" src="/js/interface.js"> </script>
|
||||
<script type="text/javascript">
|
||||
|
||||
Coloris({
|
||||
el: '.coloris',
|
||||
alpha: false,
|
||||
});
|
||||
$(function () {
|
||||
$('[data-toggle="tooltip"]').tooltip({ container: "body" })
|
||||
})
|
||||
$("#applyLang").on("click", function (event) {
|
||||
const lang = $("#lang").val()
|
||||
saveOption("/api/ui/v1/lang/set?lang=" + lang, function handleLangSelect(event, xmlHttp) {
|
||||
|
@ -9,8 +9,8 @@
|
||||
<meta name="description" content="openCountdown">
|
||||
<meta name="author" content="TheGreydiamond">
|
||||
|
||||
<script type="text/javascript" src="/assets/js-cookie/dist/js.cookie.min.js"></script>
|
||||
<link rel="stylesheet" href="/assets/bootstrap-icons/font/bootstrap-icons.css">
|
||||
<script type="text/javascript" src="/js/cookie.js"></script>
|
||||
|
||||
<link rel="stylesheet/less" type="text/css" href="/css/errorPage/styles.less" />
|
||||
|
||||
|
||||
@ -19,9 +19,11 @@
|
||||
javascriptEnabled: true
|
||||
};
|
||||
</script>
|
||||
<script src="/assets/less/dist/less.min.js"></script>
|
||||
<script src="/js/less.min.js"></script>
|
||||
|
||||
<link rel="stylesheet" href="/css/errorPage/style.css">
|
||||
|
||||
<link rel="stylesheet" href="/css/bootstrap-icons.css">
|
||||
</head>
|
||||
|
||||
<body>
|
||||
|
@ -10,27 +10,28 @@
|
||||
<meta name="author" content="TheGreydiamond">
|
||||
|
||||
|
||||
<link rel="stylesheet" href="/assets/bootstrap-icons/font/bootstrap-icons.css">
|
||||
<link rel="stylesheet" href="/assets/mdbootstrap/css/style.css">
|
||||
<link rel="stylesheet" href="/css/bootstrap-icons.css">
|
||||
<link rel="stylesheet" href="/mdbootstrap/css/style.css">
|
||||
|
||||
<script src="/assets/bootstrap/dist/js/bootstrap.bundle.min.js"></script>
|
||||
<script src="/assets/jquery/dist/jquery.min.js"></script>
|
||||
<script type="text/javascript" src="/assets/mdbootstrap/js/mdb.min.js"></script>
|
||||
<script src="/bootstrap/dist/js/bootstrap.bundle.min.js"></script>
|
||||
<script src="/js/jquery.min.js"></script>
|
||||
<script type="text/javascript" src="/mdbootstrap/js/mdb.min.js"></script>
|
||||
|
||||
<script type="text/javascript" src="/assets/darkreader/darkreader.js"></script>
|
||||
<script type="text/javascript" src="/assets/js-cookie/dist/js.cookie.min.js"></script>
|
||||
<link href="/assets/bootstrap/dist/css/bootstrap.min.css" rel="stylesheet">
|
||||
<script type="text/javascript" src="/js/darkreader.js"></script>
|
||||
<script type="text/javascript" src="/js/cookie.js"></script>
|
||||
<link href="/bootstrap/dist/css/bootstrap.min.css" rel="stylesheet">
|
||||
<link href="/css/mainStyle.css" rel="stylesheet">
|
||||
<link rel="stylesheet" href="/coloris/coloris.min.css" />
|
||||
<link rel="stylesheet" href="/assets/bootstrap-duration-picker/dist/bootstrap-duration-picker.css" />
|
||||
<link rel="stylesheet" href="/assets/flatpickr/dist/flatpickr.min.css" />
|
||||
<script src="/assets/bootstrap-duration-picker/dist/bootstrap-duration-picker-debug.js"></script>
|
||||
<link rel="stylesheet" href="/bootstrap-duration-picker/bootstrap-duration-picker.css" />
|
||||
<link rel="stylesheet" href="/flatpickr/dist/flatpickr.min.css" />
|
||||
<script src="/bootstrap-duration-picker/bootstrap-duration-picker-debug.js"></script>
|
||||
<script src="/coloris/coloris.min.js"></script>
|
||||
|
||||
<script type="text/javascript" src="/assets/flatpickr/dist/flatpickr.js"> </script>
|
||||
<script type="text/javascript" src="/flatpickr/dist/flatpickr.js"> </script>
|
||||
|
||||
<link rel="stylesheet" href="/css/bootstrap-icons.css">
|
||||
|
||||
<link rel="icon" href="/logo/faviconLogo.svg" type="image/svg+xml">
|
||||
<link rel="icon" href="/favicon.svg" type="image/svg+xml">
|
||||
</head>
|
||||
|
||||
<body>
|
||||
@ -428,7 +429,7 @@
|
||||
</page>
|
||||
</pages>
|
||||
</main>
|
||||
<script type="text/javascript" src="/js/jsonview.js"></script>
|
||||
<script type="text/javascript" src="js/jsonview.js"></script>
|
||||
<script type="text/javascript" src="/js/interface.js"> </script>
|
||||
<script type="text/javascript">
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user