mirror of
https://gitlab.com/MrFry/mrfrys-node-server
synced 2025-04-01 20:24:18 +02:00
Prettied some stuff, and moved submodules around again
This commit is contained in:
parent
d8ef7cdcb0
commit
3f081d8dff
6 changed files with 106 additions and 182 deletions
2
.gitmodules
vendored
2
.gitmodules
vendored
|
@ -2,7 +2,7 @@
|
||||||
path = submodules/qmining-page
|
path = submodules/qmining-page
|
||||||
url = git@gitlab.com:MrFry/qmining-page.git
|
url = git@gitlab.com:MrFry/qmining-page.git
|
||||||
[submodule "modules/dataEditor/qmining-data-editor"]
|
[submodule "modules/dataEditor/qmining-data-editor"]
|
||||||
path = submodules/dataEditor/qmining-data-editor
|
path = submodules/qmining-data-editor
|
||||||
url = git@gitlab.com:MrFry/qmining-data-editor.git
|
url = git@gitlab.com:MrFry/qmining-data-editor.git
|
||||||
[submodule "qminingPublic/moodle-test-userscript"]
|
[submodule "qminingPublic/moodle-test-userscript"]
|
||||||
path = submodules/moodle-test-userscript
|
path = submodules/moodle-test-userscript
|
||||||
|
|
|
@ -2,7 +2,7 @@ const logger = require('../utils/logger.js')
|
||||||
const utils = require('../utils/utils.js')
|
const utils = require('../utils/utils.js')
|
||||||
const dbtools = require('../utils/dbtools.js')
|
const dbtools = require('../utils/dbtools.js')
|
||||||
|
|
||||||
module.exports = function (options) {
|
module.exports = function(options) {
|
||||||
const { userDB, jsonResponse, exceptions } = options
|
const { userDB, jsonResponse, exceptions } = options
|
||||||
|
|
||||||
const renderLogin = (req, res) => {
|
const renderLogin = (req, res) => {
|
||||||
|
@ -10,16 +10,16 @@ module.exports = function (options) {
|
||||||
if (jsonResponse) {
|
if (jsonResponse) {
|
||||||
res.json({
|
res.json({
|
||||||
result: 'nouser',
|
result: 'nouser',
|
||||||
msg: 'You are not logged in'
|
msg: 'You are not logged in',
|
||||||
})
|
})
|
||||||
} else {
|
} else {
|
||||||
res.render('login', {
|
res.render('login', {
|
||||||
devel: process.env.NS_DEVEL
|
devel: process.env.NS_DEVEL,
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return function (req, res, next) {
|
return function(req, res, next) {
|
||||||
const ip = req.headers['cf-connecting-ip'] || req.connection.remoteAddress
|
const ip = req.headers['cf-connecting-ip'] || req.connection.remoteAddress
|
||||||
const sessionID = req.cookies.sessionID
|
const sessionID = req.cookies.sessionID
|
||||||
const isException = exceptions.some((exc) => {
|
const isException = exceptions.some((exc) => {
|
||||||
|
@ -29,17 +29,20 @@ module.exports = function (options) {
|
||||||
if (process.env.NS_NOUSER) {
|
if (process.env.NS_NOUSER) {
|
||||||
req.session = {
|
req.session = {
|
||||||
user: {
|
user: {
|
||||||
id: 21323
|
id: 21323,
|
||||||
},
|
},
|
||||||
sessionID: sessionID || 111111111111111111,
|
sessionID: sessionID || 111111111111111111,
|
||||||
isException: false
|
isException: false,
|
||||||
}
|
}
|
||||||
next()
|
next()
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
// FIXME Allowing all urls with _next in it, but not in params
|
// FIXME Allowing all urls with _next in it, but not in params
|
||||||
if (req.url.split('?')[0].includes('_next') || req.url.split('?')[0].includes('well-known/acme-challenge')) {
|
if (
|
||||||
|
req.url.split('?')[0].includes('_next') ||
|
||||||
|
req.url.split('?')[0].includes('well-known/acme-challenge')
|
||||||
|
) {
|
||||||
req.session = { isException: true }
|
req.session = { isException: true }
|
||||||
next()
|
next()
|
||||||
return
|
return
|
||||||
|
@ -74,34 +77,44 @@ module.exports = function (options) {
|
||||||
req.session = {
|
req.session = {
|
||||||
user: user,
|
user: user,
|
||||||
sessionID: sessionID,
|
sessionID: sessionID,
|
||||||
isException: isException
|
isException: isException,
|
||||||
}
|
}
|
||||||
|
|
||||||
logger.DebugLog(`ID #${user.id}: ${req.url}`, 'auth', 1)
|
logger.DebugLog(`ID #${user.id}: ${req.url}`, 'auth', 1)
|
||||||
|
|
||||||
UpdateAccess(userDB, user, ip, sessionID)
|
UpdateAccess(userDB, user, ip, sessionID)
|
||||||
|
|
||||||
dbtools.Update(userDB, 'sessions', {
|
dbtools.Update(
|
||||||
lastAccess: utils.GetDateString()
|
userDB,
|
||||||
}, {
|
'sessions',
|
||||||
id: sessionID
|
{
|
||||||
})
|
lastAccess: utils.GetDateString(),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: sessionID,
|
||||||
|
}
|
||||||
|
)
|
||||||
|
|
||||||
dbtools.Update(userDB, 'users', {
|
dbtools.Update(
|
||||||
lastIP: ip,
|
userDB,
|
||||||
lastAccess: utils.GetDateString()
|
'users',
|
||||||
}, {
|
{
|
||||||
id: user.id
|
lastIP: ip,
|
||||||
})
|
lastAccess: utils.GetDateString(),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: user.id,
|
||||||
|
}
|
||||||
|
)
|
||||||
|
|
||||||
next()
|
next()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function UpdateAccess (db, user, ip, sessionID) {
|
function UpdateAccess(db, user, ip, sessionID) {
|
||||||
const accesses = dbtools.Select(db, 'accesses', {
|
const accesses = dbtools.Select(db, 'accesses', {
|
||||||
userId: user.id,
|
userId: user.id,
|
||||||
ip: ip
|
ip: ip,
|
||||||
})
|
})
|
||||||
|
|
||||||
if (accesses.length === 0) {
|
if (accesses.length === 0) {
|
||||||
|
@ -109,16 +122,16 @@ function UpdateAccess (db, user, ip, sessionID) {
|
||||||
userID: user.id,
|
userID: user.id,
|
||||||
ip: ip,
|
ip: ip,
|
||||||
sessionID: sessionID,
|
sessionID: sessionID,
|
||||||
date: utils.GetDateString()
|
date: utils.GetDateString(),
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function GetUserBySessionID (db, sessionID, req) {
|
function GetUserBySessionID(db, sessionID, req) {
|
||||||
logger.DebugLog(`Getting user from db`, 'auth', 2)
|
logger.DebugLog(`Getting user from db`, 'auth', 2)
|
||||||
|
|
||||||
const session = dbtools.Select(db, 'sessions', {
|
const session = dbtools.Select(db, 'sessions', {
|
||||||
id: sessionID
|
id: sessionID,
|
||||||
})[0]
|
})[0]
|
||||||
|
|
||||||
if (!session) {
|
if (!session) {
|
||||||
|
@ -126,7 +139,7 @@ function GetUserBySessionID (db, sessionID, req) {
|
||||||
}
|
}
|
||||||
|
|
||||||
const user = dbtools.Select(db, 'users', {
|
const user = dbtools.Select(db, 'users', {
|
||||||
id: session.userID
|
id: session.userID,
|
||||||
})[0]
|
})[0]
|
||||||
|
|
||||||
if (user) {
|
if (user) {
|
||||||
|
|
|
@ -1,11 +1,11 @@
|
||||||
const logger = require('../utils/logger.js')
|
const logger = require('../utils/logger.js')
|
||||||
|
|
||||||
module.exports = function (options) {
|
module.exports = function(options) {
|
||||||
const loggableKeywords = options ? options.loggableKeywords : undefined
|
const loggableKeywords = options ? options.loggableKeywords : undefined
|
||||||
const loggableModules = options ? options.loggableModules : undefined
|
const loggableModules = options ? options.loggableModules : undefined
|
||||||
|
|
||||||
return function (req, res, next) {
|
return function(req, res, next) {
|
||||||
res.on('finish', function () {
|
res.on('finish', function() {
|
||||||
if (req.url.includes('_next/static')) {
|
if (req.url.includes('_next/static')) {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
@ -22,18 +22,25 @@ module.exports = function (options) {
|
||||||
}
|
}
|
||||||
|
|
||||||
// fixme: regexp includes checking
|
// fixme: regexp includes checking
|
||||||
const hasLoggableKeyword = loggableKeywords && loggableKeywords.some((x) => {
|
const hasLoggableKeyword =
|
||||||
return req.url.includes(x)
|
loggableKeywords &&
|
||||||
})
|
loggableKeywords.some((x) => {
|
||||||
const hasLoggableModule = loggableModules && loggableModules.some((x) => {
|
return req.url.includes(x)
|
||||||
return hostname.includes(x)
|
})
|
||||||
})
|
const hasLoggableModule =
|
||||||
|
loggableModules &&
|
||||||
|
loggableModules.some((x) => {
|
||||||
|
return hostname.includes(x)
|
||||||
|
})
|
||||||
const toLog = hasLoggableModule || hasLoggableKeyword
|
const toLog = hasLoggableModule || hasLoggableKeyword
|
||||||
|
|
||||||
logger.LogReq(req, true, res.statusCode)
|
logger.LogReq(req, true, res.statusCode)
|
||||||
if (toLog) { logger.LogReq(req) }
|
if (toLog) {
|
||||||
|
logger.LogReq(req)
|
||||||
|
}
|
||||||
if (res.statusCode !== 404) {
|
if (res.statusCode !== 404) {
|
||||||
logger.LogStat(req.url,
|
logger.LogStat(
|
||||||
|
req.url,
|
||||||
ip,
|
ip,
|
||||||
hostname,
|
hostname,
|
||||||
req.session && req.session.user ? req.session.user.id : 'NOUSER'
|
req.session && req.session.user ? req.session.user.id : 'NOUSER'
|
||||||
|
|
|
@ -53,7 +53,7 @@ try {
|
||||||
const extraModules = JSON.parse(utils.ReadFile(extraModulesFile))
|
const extraModules = JSON.parse(utils.ReadFile(extraModulesFile))
|
||||||
modules = {
|
modules = {
|
||||||
...extraModules,
|
...extraModules,
|
||||||
...modules
|
...modules,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
|
@ -66,7 +66,7 @@ try {
|
||||||
process.on('SIGINT', () => exit('SIGINT'))
|
process.on('SIGINT', () => exit('SIGINT'))
|
||||||
process.on('SIGTERM', () => exit('SIGTERM'))
|
process.on('SIGTERM', () => exit('SIGTERM'))
|
||||||
|
|
||||||
function exit (reason) {
|
function exit(reason) {
|
||||||
console.log()
|
console.log()
|
||||||
logger.Log(`Exiting, reason: ${reason}`)
|
logger.Log(`Exiting, reason: ${reason}`)
|
||||||
Object.keys(modules).forEach((k, i) => {
|
Object.keys(modules).forEach((k, i) => {
|
||||||
|
@ -75,7 +75,10 @@ function exit (reason) {
|
||||||
try {
|
try {
|
||||||
x.cleanup()
|
x.cleanup()
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
logger.Log(`Error in ${k} cleanup! Details in STDERR`, logger.GetColor('redbg'))
|
logger.Log(
|
||||||
|
`Error in ${k} cleanup! Details in STDERR`,
|
||||||
|
logger.GetColor('redbg')
|
||||||
|
)
|
||||||
console.error(e)
|
console.error(e)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -90,11 +93,17 @@ function exit (reason) {
|
||||||
const app = express()
|
const app = express()
|
||||||
|
|
||||||
if (!process.env.NS_DEVEL) {
|
if (!process.env.NS_DEVEL) {
|
||||||
app.use(function (req, res, next) {
|
app.use(function(req, res, next) {
|
||||||
if (req.secure) {
|
if (req.secure) {
|
||||||
next()
|
next()
|
||||||
} else {
|
} else {
|
||||||
logger.DebugLog(`HTTPS ${req.method} redirect to: ${'https://' + req.headers.host + req.url}`, 'https', 1)
|
logger.DebugLog(
|
||||||
|
`HTTPS ${req.method} redirect to: ${'https://' +
|
||||||
|
req.headers.host +
|
||||||
|
req.url}`,
|
||||||
|
'https',
|
||||||
|
1
|
||||||
|
)
|
||||||
if (req.method === 'POST') {
|
if (req.method === 'POST') {
|
||||||
res.redirect(307, 'https://' + req.headers.host + req.url)
|
res.redirect(307, 'https://' + req.headers.host + req.url)
|
||||||
} else {
|
} else {
|
||||||
|
@ -104,23 +113,23 @@ if (!process.env.NS_DEVEL) {
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
// https://github.com/expressjs/cors#configuration-options
|
// https://github.com/expressjs/cors#configuration-options
|
||||||
app.use(cors({
|
app.use(
|
||||||
credentials: true,
|
cors({
|
||||||
origin: true
|
credentials: true,
|
||||||
// origin: [ /\.frylabs\.net$/ ]
|
origin: true,
|
||||||
}))
|
// origin: [ /\.frylabs\.net$/ ]
|
||||||
|
})
|
||||||
|
)
|
||||||
const cookieSecret = uuidv4()
|
const cookieSecret = uuidv4()
|
||||||
app.use(cookieParser(cookieSecret))
|
app.use(cookieParser(cookieSecret))
|
||||||
app.use(reqlogger({
|
app.use(
|
||||||
loggableKeywords: [
|
reqlogger({
|
||||||
'stable.user.js'
|
loggableKeywords: ['stable.user.js'],
|
||||||
],
|
loggableModules: ['dataeditor'],
|
||||||
loggableModules: [
|
})
|
||||||
'dataeditor'
|
)
|
||||||
]
|
|
||||||
}))
|
|
||||||
|
|
||||||
Object.keys(modules).forEach(function (k, i) {
|
Object.keys(modules).forEach(function(k, i) {
|
||||||
let x = modules[k]
|
let x = modules[k]
|
||||||
try {
|
try {
|
||||||
let mod = require(x.path)
|
let mod = require(x.path)
|
||||||
|
@ -135,7 +144,7 @@ Object.keys(modules).forEach(function (k, i) {
|
||||||
url: 'https://' + x.urls[0],
|
url: 'https://' + x.urls[0],
|
||||||
userDB: userDB,
|
userDB: userDB,
|
||||||
publicdirs: x.publicdirs,
|
publicdirs: x.publicdirs,
|
||||||
nextdir: x.nextdir
|
nextdir: x.nextdir,
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -161,8 +170,12 @@ const fullchainFile = '/etc/letsencrypt/live/frylabs.net/fullchain.pem'
|
||||||
const chainFile = '/etc/letsencrypt/live/frylabs.net/chain.pem'
|
const chainFile = '/etc/letsencrypt/live/frylabs.net/chain.pem'
|
||||||
|
|
||||||
var certsLoaded = false
|
var certsLoaded = false
|
||||||
if (startHTTPS && utils.FileExists(privkeyFile) && utils.FileExists(fullchainFile) && utils.FileExists(
|
if (
|
||||||
chainFile)) {
|
startHTTPS &&
|
||||||
|
utils.FileExists(privkeyFile) &&
|
||||||
|
utils.FileExists(fullchainFile) &&
|
||||||
|
utils.FileExists(chainFile)
|
||||||
|
) {
|
||||||
try {
|
try {
|
||||||
const key = utils.ReadFile(privkeyFile)
|
const key = utils.ReadFile(privkeyFile)
|
||||||
const cert = utils.ReadFile(fullchainFile)
|
const cert = utils.ReadFile(fullchainFile)
|
||||||
|
@ -170,7 +183,7 @@ if (startHTTPS && utils.FileExists(privkeyFile) && utils.FileExists(fullchainFil
|
||||||
var certs = {
|
var certs = {
|
||||||
key: key,
|
key: key,
|
||||||
cert: cert,
|
cert: cert,
|
||||||
ca: ca
|
ca: ca,
|
||||||
}
|
}
|
||||||
certsLoaded = true
|
certsLoaded = true
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
|
@ -180,7 +193,7 @@ if (startHTTPS && utils.FileExists(privkeyFile) && utils.FileExists(fullchainFil
|
||||||
}
|
}
|
||||||
|
|
||||||
setLogTimer()
|
setLogTimer()
|
||||||
function setLogTimer () {
|
function setLogTimer() {
|
||||||
const now = new Date()
|
const now = new Date()
|
||||||
const night = new Date(
|
const night = new Date(
|
||||||
now.getFullYear(),
|
now.getFullYear(),
|
||||||
|
@ -196,17 +209,20 @@ function setLogTimer () {
|
||||||
logger.DebugLog(`Seconds To Midnight: ${msToMidnight / 1000}`, 'daily', 1)
|
logger.DebugLog(`Seconds To Midnight: ${msToMidnight / 1000}`, 'daily', 1)
|
||||||
|
|
||||||
if (msToMidnight < 0) {
|
if (msToMidnight < 0) {
|
||||||
logger.Log(`Error setting up Log Timer, msToMidnight is negative! (${msToMidnight})`, logger.GetColor('redbg'))
|
logger.Log(
|
||||||
|
`Error setting up Log Timer, msToMidnight is negative! (${msToMidnight})`,
|
||||||
|
logger.GetColor('redbg')
|
||||||
|
)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
setTimeout(function () {
|
setTimeout(function() {
|
||||||
LogTimerAction()
|
LogTimerAction()
|
||||||
setLogTimer()
|
setLogTimer()
|
||||||
}, msToMidnight)
|
}, msToMidnight)
|
||||||
}
|
}
|
||||||
|
|
||||||
function LogTimerAction () {
|
function LogTimerAction() {
|
||||||
logger.DebugLog(`Running Log Timer Action`, 'daily', 1)
|
logger.DebugLog(`Running Log Timer Action`, 'daily', 1)
|
||||||
Object.keys(modules).forEach((k, i) => {
|
Object.keys(modules).forEach((k, i) => {
|
||||||
const x = modules[k]
|
const x = modules[k]
|
||||||
|
@ -216,13 +232,17 @@ function LogTimerAction () {
|
||||||
logger.Log(`Running daily action of ${k}`)
|
logger.Log(`Running daily action of ${k}`)
|
||||||
x.dailyAction()
|
x.dailyAction()
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
logger.Log(`Error in ${k} daily action! Details in STDERR`, logger.GetColor('redbg'))
|
logger.Log(
|
||||||
|
`Error in ${k} daily action! Details in STDERR`,
|
||||||
|
logger.GetColor('redbg')
|
||||||
|
)
|
||||||
console.err(e)
|
console.err(e)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
const line = '==================================================================================================================================================='
|
const line =
|
||||||
|
'==================================================================================================================================================='
|
||||||
logger.Log(line)
|
logger.Log(line)
|
||||||
utils.AppendToFile(line, locLogFile)
|
utils.AppendToFile(line, locLogFile)
|
||||||
utils.AppendToFile(line, allLogFile)
|
utils.AppendToFile(line, allLogFile)
|
||||||
|
|
|
@ -1,116 +0,0 @@
|
||||||
/* ----------------------------------------------------------------------------
|
|
||||||
|
|
||||||
Question Server
|
|
||||||
GitLab: <https://gitlab.com/MrFry/mrfrys-node-server>
|
|
||||||
|
|
||||||
This program is free software: you can redistribute it and/or modify
|
|
||||||
it under the terms of the GNU General Public License as published by
|
|
||||||
the Free Software Foundation, either version 3 of the License, or
|
|
||||||
(at your option) any later version.
|
|
||||||
|
|
||||||
This program is distributed in the hope that it will be useful,
|
|
||||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
GNU General Public License for more details.
|
|
||||||
|
|
||||||
You should have received a copy of the GNU General Public License
|
|
||||||
along with this program. If not, see <https://www.gnu.org/licenses/>.
|
|
||||||
|
|
||||||
------------------------------------------------------------------------- */
|
|
||||||
|
|
||||||
// package requires
|
|
||||||
const express = require('express')
|
|
||||||
const bodyParser = require('body-parser')
|
|
||||||
const busboy = require('connect-busboy')
|
|
||||||
const app = express()
|
|
||||||
|
|
||||||
// other requires
|
|
||||||
const utils = require('../../utils/utils.js')
|
|
||||||
const logger = require('../../utils/logger.js')
|
|
||||||
const auth = require('../../middlewares/auth.middleware.js')
|
|
||||||
|
|
||||||
// stuff gotten from server.js
|
|
||||||
let userDB
|
|
||||||
let publicdirs = []
|
|
||||||
let nextdir = ''
|
|
||||||
|
|
||||||
function GetApp () {
|
|
||||||
app.use(bodyParser.urlencoded({
|
|
||||||
limit: '5mb',
|
|
||||||
extended: true
|
|
||||||
}))
|
|
||||||
app.use(bodyParser.json({
|
|
||||||
limit: '5mb'
|
|
||||||
}))
|
|
||||||
app.set('view engine', 'ejs')
|
|
||||||
app.set('views', [
|
|
||||||
'./modules/dataEditor/views',
|
|
||||||
'./sharedViews'
|
|
||||||
])
|
|
||||||
app.use(auth({
|
|
||||||
userDB: userDB,
|
|
||||||
jsonResponse: false,
|
|
||||||
exceptions: [
|
|
||||||
'/favicon.ico',
|
|
||||||
'/getVeteranPw'
|
|
||||||
]
|
|
||||||
}))
|
|
||||||
publicdirs.forEach((pdir) => {
|
|
||||||
logger.Log(`Using public dir: ${pdir}`)
|
|
||||||
app.use(express.static(pdir))
|
|
||||||
})
|
|
||||||
app.use(express.static(nextdir))
|
|
||||||
app.use(busboy({
|
|
||||||
limits: {
|
|
||||||
fileSize: 10000 * 1024 * 1024
|
|
||||||
}
|
|
||||||
}))
|
|
||||||
|
|
||||||
// --------------------------------------------------------------
|
|
||||||
|
|
||||||
function AddHtmlRoutes (files) {
|
|
||||||
const routes = files.reduce((acc, f) => {
|
|
||||||
if (f.includes('html')) {
|
|
||||||
acc.push(f.split('.')[0])
|
|
||||||
return acc
|
|
||||||
}
|
|
||||||
return acc
|
|
||||||
}, [])
|
|
||||||
|
|
||||||
routes.forEach((route) => {
|
|
||||||
logger.DebugLog(`Added route /${route}`, 'DataEditor routes', 1)
|
|
||||||
app.get(`/${route}`, function (req, res) {
|
|
||||||
logger.LogReq(req)
|
|
||||||
res.redirect(`${route}.html`)
|
|
||||||
})
|
|
||||||
})
|
|
||||||
}
|
|
||||||
AddHtmlRoutes(utils.ReadDir(nextdir))
|
|
||||||
|
|
||||||
// --------------------------------------------------------------
|
|
||||||
|
|
||||||
app.get('/', function (req, res) {
|
|
||||||
res.end('hai')
|
|
||||||
logger.LogReq(req)
|
|
||||||
})
|
|
||||||
|
|
||||||
app.get('*', function (req, res) {
|
|
||||||
res.status(404).render('404')
|
|
||||||
})
|
|
||||||
|
|
||||||
app.post('*', function (req, res) {
|
|
||||||
res.status(404).render('404')
|
|
||||||
})
|
|
||||||
|
|
||||||
return {
|
|
||||||
app: app
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
exports.name = 'Data editor'
|
|
||||||
exports.getApp = GetApp
|
|
||||||
exports.setup = (data) => {
|
|
||||||
userDB = data.userDB
|
|
||||||
publicdirs = data.publicdirs
|
|
||||||
nextdir = data.nextdir
|
|
||||||
}
|
|
Loading…
Add table
Add a link
Reference in a new issue