Update Dockerfile, Passport-ActiveDirectory.js, package-lock.json, dpanel.js, index.js, and server.js
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
2024-03-27 20:06:02 +01:00
parent 96466073a5
commit 1d456a588a
7 changed files with 307 additions and 34 deletions

View File

@@ -12,18 +12,12 @@ const flash = require('connect-flash');
const fs = require('fs');
const SystemReport = require('./models/reportManager.js');
let setup = {};
try {
if (fs.existsSync('setup.json')) {
setup = JSON.parse(fs.readFileSync('setup.json', 'utf8'));
}
} catch (err) {
console.error('Error reading setup.json:', err);
}
let setup;
try {
setup = JSON.parse(fs.readFileSync('setup.json', 'utf8'));
} catch (err) {
console.error('Error reading setup.json:', err);
process.exit(1);
}
if (setup.discord !== undefined) {
@@ -34,22 +28,11 @@ if (setup.ldap !== undefined) {
require('./models/Passport-ActiveDirectory.js');
}
let user = {};
try {
if (fs.existsSync('user.json')) {
const data = fs.readFileSync('user.json', 'utf8');
user = data ? JSON.parse(data) : {};
}
} catch (err) {
console.error('Error reading user.json:', err);
}
app.use(express.static(path.join(__dirname, 'public')));
app.get(['/user.json', '/file_info.json', '/setup.json'], (req, res) => {
res.status(403).json({ error: 'Access Denied' });
});
app.use(express.urlencoded({ extended: true }));
res.status(403).send('Access Denied');
});app.use(express.urlencoded({ extended: true }));
app.use(session({
secret: '63a69c252dfe0bb20650b6365b48dc99ad6c7eac19faed62670e73a071c54236e2faf04ee009919592def437b98d3c726c40a56ef1d8759878c1703a93244aa3',