Added express-brute-loki, UI improvements, error page
This commit is contained in:
parent
24f90d4a17
commit
aa740dea7a
File diff suppressed because one or more lines are too long
@ -1,4 +1,4 @@
|
|||||||
@import './layout/_fonts';
|
//@import './layout/_fonts';
|
||||||
@import './layout/_base';
|
@import './layout/_base';
|
||||||
|
|
||||||
$warning: #f68b39;
|
$warning: #f68b39;
|
||||||
|
@ -5,4 +5,5 @@ html {
|
|||||||
box-sizing: inherit;
|
box-sizing: inherit;
|
||||||
}
|
}
|
||||||
|
|
||||||
$family-sans-serif: "Roboto", "Helvetica", "Arial", sans-serif;
|
//$family-sans-serif: "Roboto", "Helvetica", "Arial", sans-serif;
|
||||||
|
$family-sans-serif: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";
|
@ -1,4 +1,11 @@
|
|||||||
|
|
||||||
|
|
||||||
|
.sd-menus {
|
||||||
|
|
||||||
|
width: 300px;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
.mkcontent {
|
.mkcontent {
|
||||||
|
|
||||||
h1 {
|
h1 {
|
||||||
@ -12,13 +19,21 @@
|
|||||||
font-size: 80%;
|
font-size: 80%;
|
||||||
color: $purple;
|
color: $purple;
|
||||||
border-bottom: none;
|
border-bottom: none;
|
||||||
|
|
||||||
|
&:visited {
|
||||||
|
color: $purple !important;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.hljs {
|
.hljs {
|
||||||
padding: 0;
|
padding: 0;
|
||||||
border-bottom: 1px solid $grey-light;
|
|
||||||
border-right: 1px solid $grey-light;
|
|
||||||
border-radius: 3px;
|
border-radius: 3px;
|
||||||
|
|
||||||
|
> code {
|
||||||
|
box-shadow: inset 0 0 5px 0 $grey-light;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
pre + p {
|
pre + p {
|
||||||
@ -29,4 +44,40 @@
|
|||||||
float:right;
|
float:right;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
img.pagelogo {
|
||||||
|
float: right;
|
||||||
|
margin-top: -50px;
|
||||||
|
max-width: 200px;
|
||||||
|
}
|
||||||
|
|
||||||
|
strong {
|
||||||
|
color: $grey-dark;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
.content a:not(.button):visited {
|
||||||
|
color: $turquoise;
|
||||||
|
font-weight: 500;
|
||||||
|
}
|
||||||
|
|
||||||
|
code {
|
||||||
|
font-weight: 500;
|
||||||
|
color: $purple;
|
||||||
|
}
|
||||||
|
|
||||||
|
p code {
|
||||||
|
padding: 2px 5px;
|
||||||
|
border-radius: 4px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.card-header {
|
||||||
|
background-color: $turquoise;
|
||||||
|
}
|
||||||
|
|
||||||
|
.card-header-title {
|
||||||
|
color: #FFF;
|
||||||
|
font-weight: 400;
|
||||||
|
font-size: 16px;
|
||||||
|
padding: 10px 20px;
|
||||||
}
|
}
|
@ -2,15 +2,14 @@ var express = require('express');
|
|||||||
var router = express.Router();
|
var router = express.Router();
|
||||||
var passport = require('passport');
|
var passport = require('passport');
|
||||||
var ExpressBrute = require('express-brute');
|
var ExpressBrute = require('express-brute');
|
||||||
//var ExpressBruteRedisStore = require('express-brute-redis');
|
var ExpressBruteLokiStore = require('D:\\git\\express-brute-loki');
|
||||||
var moment = require('moment');
|
var moment = require('moment');
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Setup Express-Brute
|
* Setup Express-Brute
|
||||||
*/
|
*/
|
||||||
/*var EBstore = new ExpressBruteRedisStore({
|
var EBstore = new ExpressBruteLokiStore({
|
||||||
prefix: 'bf:',
|
path: './data/brute.db'
|
||||||
client: red
|
|
||||||
});
|
});
|
||||||
var bruteforce = new ExpressBrute(EBstore, {
|
var bruteforce = new ExpressBrute(EBstore, {
|
||||||
freeRetries: 5,
|
freeRetries: 5,
|
||||||
@ -26,7 +25,7 @@ var bruteforce = new ExpressBrute(EBstore, {
|
|||||||
});
|
});
|
||||||
res.redirect('/login');
|
res.redirect('/login');
|
||||||
}
|
}
|
||||||
});*/
|
});
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Login form
|
* Login form
|
||||||
@ -37,7 +36,7 @@ router.get('/login', function(req, res, next) {
|
|||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
router.post('/login', /*bruteforce.prevent,*/ function(req, res, next) {
|
router.post('/login', bruteforce.prevent, function(req, res, next) {
|
||||||
passport.authenticate('local', function(err, user, info) {
|
passport.authenticate('local', function(err, user, info) {
|
||||||
|
|
||||||
if (err) { return next(err); }
|
if (err) { return next(err); }
|
||||||
@ -54,9 +53,9 @@ router.post('/login', /*bruteforce.prevent,*/ function(req, res, next) {
|
|||||||
|
|
||||||
req.logIn(user, function(err) {
|
req.logIn(user, function(err) {
|
||||||
if (err) { return next(err); }
|
if (err) { return next(err); }
|
||||||
//req.brute.reset(function () {
|
req.brute.reset(function () {
|
||||||
return res.redirect('/');
|
return res.redirect('/');
|
||||||
//});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
})(req, res, next);
|
})(req, res, next);
|
||||||
|
@ -11,10 +11,11 @@ router.get('/', (req, res) => {
|
|||||||
var Promise = require('bluebird');
|
var Promise = require('bluebird');
|
||||||
var fs = Promise.promisifyAll(require("fs"));
|
var fs = Promise.promisifyAll(require("fs"));
|
||||||
|
|
||||||
fs.readFileAsync("repo/Home.md", "utf8").then(function(contents) {
|
fs.readFileAsync("repo/Storage/Redis.md", "utf8").then(function(contents) {
|
||||||
let pageData = mark.parse(contents);
|
let pageData = mark.parse(contents);
|
||||||
if(!pageData.title) {
|
if(!pageData.title) {
|
||||||
pageData.title = 'Gollum';
|
pageData.title = 'Redis';
|
||||||
|
pageData.subtitle = 'An open source, in-memory data structure store, used as database, cache and message broker.'
|
||||||
}
|
}
|
||||||
res.render('pages/view', { pageData });
|
res.render('pages/view', { pageData });
|
||||||
});
|
});
|
||||||
|
@ -38,7 +38,7 @@
|
|||||||
"cheerio": "^0.20.0",
|
"cheerio": "^0.20.0",
|
||||||
"compression": "^1.6.2",
|
"compression": "^1.6.2",
|
||||||
"connect-flash": "^0.1.1",
|
"connect-flash": "^0.1.1",
|
||||||
"connect-loki": "^1.0.4",
|
"connect-loki": "^1.0.5",
|
||||||
"connect-redis": "^3.1.0",
|
"connect-redis": "^3.1.0",
|
||||||
"cookie-parser": "^1.4.3",
|
"cookie-parser": "^1.4.3",
|
||||||
"express": "^4.14.0",
|
"express": "^4.14.0",
|
||||||
@ -102,7 +102,7 @@
|
|||||||
"mocha": "^3.0.2",
|
"mocha": "^3.0.2",
|
||||||
"mocha-lcov-reporter": "^1.2.0",
|
"mocha-lcov-reporter": "^1.2.0",
|
||||||
"nodemon": "^1.10.2",
|
"nodemon": "^1.10.2",
|
||||||
"snyk": "^1.18.0",
|
"snyk": "^1.18.1",
|
||||||
"vue": "^1.0.26"
|
"vue": "^1.0.26"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -6,11 +6,8 @@ nav.nav.has-shadow.stickyscroll
|
|||||||
a.nav-item(href='/')
|
a.nav-item(href='/')
|
||||||
h1.title Wiki
|
h1.title Wiki
|
||||||
.nav-center
|
.nav-center
|
||||||
p.nav-item.control.has-addons
|
p.nav-item
|
||||||
input.input(type='text', placeholder='Find...')
|
input.input(type='text', placeholder='Search...', style= { 'max-width': '300px', width: '33vw' })
|
||||||
a.button.is-info
|
|
||||||
span.icon.is-small
|
|
||||||
i.fa.fa-search
|
|
||||||
span.nav-toggle
|
span.nav-toggle
|
||||||
span
|
span
|
||||||
span
|
span
|
||||||
@ -25,7 +22,7 @@ nav.nav.has-shadow.stickyscroll
|
|||||||
span.icon
|
span.icon
|
||||||
i.fa.fa-edit
|
i.fa.fa-edit
|
||||||
span Edit
|
span Edit
|
||||||
a.button.is-primary(href='#')
|
a.button.is-primary(href='#', onclick='$(".modal").addClass("is-active");')
|
||||||
span.icon
|
span.icon
|
||||||
i.fa.fa-plus
|
i.fa.fa-plus
|
||||||
span Create
|
span Create
|
||||||
|
@ -14,8 +14,17 @@ html
|
|||||||
link(type='text/css', rel='stylesheet', href='/css/app.css')
|
link(type='text/css', rel='stylesheet', href='/css/app.css')
|
||||||
|
|
||||||
body(class='server-error')
|
body(class='server-error')
|
||||||
#root
|
section.hero.is-warning.is-fullheight
|
||||||
img(src='/images/logo-text_218x80.png')
|
.hero-body
|
||||||
h1 Oops, something went wrong
|
.container
|
||||||
h4= message
|
a(href='/'): img(src='/favicons/android-icon-96x96.png')
|
||||||
pre #{error.stack}
|
h1.title(style={ 'margin-top': '30px'})= message
|
||||||
|
h2.subtitle(style={ 'margin-bottom': '50px'}) Oops, something went wrong
|
||||||
|
a.button.is-warning.is-inverted(href='/') Go Home
|
||||||
|
|
||||||
|
if error.stack
|
||||||
|
section.section
|
||||||
|
.container.is-fluid
|
||||||
|
.content
|
||||||
|
h3 Detailed debug trail:
|
||||||
|
pre: code #{error.stack}
|
@ -14,7 +14,7 @@ block content
|
|||||||
.container.is-fluid
|
.container.is-fluid
|
||||||
.columns
|
.columns
|
||||||
|
|
||||||
.column.is-narrow
|
.column.is-narrow.sd-menus.is-hidden-touch
|
||||||
|
|
||||||
.box
|
.box
|
||||||
aside.menu(style= { 'min-width': '200px' })
|
aside.menu(style= { 'min-width': '200px' })
|
||||||
@ -23,6 +23,8 @@ block content
|
|||||||
ul.menu-list
|
ul.menu-list
|
||||||
li
|
li
|
||||||
a(href='/') Home
|
a(href='/') Home
|
||||||
|
li
|
||||||
|
a(href='/') Storage
|
||||||
li
|
li
|
||||||
a(href='/account') Account
|
a(href='/account') Account
|
||||||
.box.stickyscroll(data-margin-top=70)
|
.box.stickyscroll(data-margin-top=70)
|
||||||
@ -41,3 +43,18 @@ block content
|
|||||||
.content.mkcontent
|
.content.mkcontent
|
||||||
!= pageData.html
|
!= pageData.html
|
||||||
|
|
||||||
|
.modal
|
||||||
|
.modal-background
|
||||||
|
.modal-container
|
||||||
|
.modal-content
|
||||||
|
.card.is-fullwidth
|
||||||
|
header.card-header
|
||||||
|
p.card-header-title Create New Page
|
||||||
|
.card-content
|
||||||
|
.content
|
||||||
|
label.label Enter the full path:
|
||||||
|
p.control
|
||||||
|
input.input(type='text', placeholder='/path', value='/storage/new-page')
|
||||||
|
footer.card-footer
|
||||||
|
a.card-footer-item(onclick='$(".modal").removeClass("is-active");') Discard
|
||||||
|
a.card-footer-item Create
|
||||||
|
Loading…
Reference in New Issue
Block a user