diff --git a/client/js/components/navigator.vue b/client/js/components/navigator.vue index 076067bb..3820a201 100644 --- a/client/js/components/navigator.vue +++ b/client/js/components/navigator.vue @@ -81,12 +81,11 @@ diff --git a/dev/webpack/webpack.prod.js b/dev/webpack/webpack.prod.js index 39741213..1d239430 100644 --- a/dev/webpack/webpack.prod.js +++ b/dev/webpack/webpack.prod.js @@ -9,14 +9,20 @@ const DuplicatePackageCheckerPlugin = require('duplicate-package-checker-webpack const common = require('./webpack.common.js') -console.info(process.cwd()) - module.exports = merge(common, { module: { rules: [] }, plugins: [ - new CleanWebpackPlugin(['assets'], { root: process.cwd() }), + new CleanWebpackPlugin([ + 'assets/js/*.*', + 'assets/css/*.*', + 'assets/*.js', + 'assets/*.json' + ], { + root: process.cwd(), + verbose: false + }), new UglifyJSPlugin(), new webpack.DefinePlugin({ 'process.env.NODE_ENV': JSON.stringify('production') diff --git a/server/controllers/auth.js b/server/controllers/auth.js index 92e62b67..5c564a54 100644 --- a/server/controllers/auth.js +++ b/server/controllers/auth.js @@ -34,7 +34,7 @@ const bruteforce = new ExpressBrute(EBstore, { * Login form */ router.get('/login', function (req, res, next) { - res.render('auth/login') + res.render('pages/login') }) router.post('/login', bruteforce.prevent, function (req, res, next) { diff --git a/server/setup.js b/server/setup.js index 520dbb55..82366382 100644 --- a/server/setup.js +++ b/server/setup.js @@ -77,7 +77,7 @@ module.exports = () => { app.get('*', async (req, res) => { let packageObj = await fs.readJson(path.join(wiki.ROOTPATH, 'package.json')) - res.render('setup', { + res.render('pages/setup', { packageObj, telemetryClientID: wiki.telemetry.cid }) @@ -375,12 +375,12 @@ module.exports = () => { wiki.logger.info(`HTTP Server on port: ${wiki.config.port}`) app.set('port', wiki.config.port) - server = http.createServer(app) - server.listen(wiki.config.port) + wiki.server = http.createServer(app) + wiki.server.listen(wiki.config.port) var openConnections = [] - server.on('connection', (conn) => { + wiki.server.on('connection', (conn) => { let key = conn.remoteAddress + ':' + conn.remotePort openConnections[key] = conn conn.on('close', () => { @@ -388,14 +388,14 @@ module.exports = () => { }) }) - server.destroy = (cb) => { - server.close(cb) + wiki.server.destroy = (cb) => { + wiki.server.close(cb) for (let key in openConnections) { openConnections[key].destroy() } } - server.on('error', (error) => { + wiki.server.on('error', (error) => { if (error.syscall !== 'listen') { throw error } @@ -412,7 +412,7 @@ module.exports = () => { } }) - server.on('listening', () => { + wiki.server.on('listening', () => { wiki.logger.info('HTTP Server: RUNNING') }) } diff --git a/server/views/auth/login.pug b/server/views/pages/login.pug similarity index 100% rename from server/views/auth/login.pug rename to server/views/pages/login.pug diff --git a/server/views/setup.pug b/server/views/pages/setup.pug similarity index 87% rename from server/views/setup.pug rename to server/views/pages/setup.pug index 9407bd17..8cedecf6 100644 --- a/server/views/setup.pug +++ b/server/views/pages/setup.pug @@ -1,4 +1,4 @@ -extends master.pug +extends ../master.pug block body body