Bug fixes + interactive setup UI
This commit is contained in:
parent
3300d42866
commit
9414380c9f
13
CHANGELOG.md
13
CHANGELOG.md
@ -3,6 +3,19 @@ All notable changes to this project will be documented in this file.
|
|||||||
This project adheres to [Semantic Versioning](http://semver.org/).
|
This project adheres to [Semantic Versioning](http://semver.org/).
|
||||||
|
|
||||||
## [Unreleased]
|
## [Unreleased]
|
||||||
|
### Added
|
||||||
|
- Interactive setup
|
||||||
|
- GitHub and Slack authentication providers are now available
|
||||||
|
- Experimental: LDAP authentication provider
|
||||||
|
|
||||||
|
### Changed
|
||||||
|
- Content headers are now showing an anchor icon instead of a #
|
||||||
|
- Sidebar: Contents is now Page Contents
|
||||||
|
- Sidebar: Start is now Top of Page
|
||||||
|
|
||||||
|
### Fixed
|
||||||
|
- Search index should now update upon article creation
|
||||||
|
- Missing icons on login page
|
||||||
|
|
||||||
## [v1.0.0-beta.8] - 2017-02-19
|
## [v1.0.0-beta.8] - 2017-02-19
|
||||||
### Added
|
### Added
|
||||||
|
File diff suppressed because one or more lines are too long
7
assets/css/configure.css
Normal file
7
assets/css/configure.css
Normal file
File diff suppressed because one or more lines are too long
27
client/scss/configure.scss
Normal file
27
client/scss/configure.scss
Normal file
@ -0,0 +1,27 @@
|
|||||||
|
|
||||||
|
$primary: 'indigo';
|
||||||
|
|
||||||
|
@import 'core-client/scss/core';
|
||||||
|
@import 'core-client/scss/components/button';
|
||||||
|
@import 'core-client/scss/components/footer';
|
||||||
|
@import 'core-client/scss/components/form';
|
||||||
|
@import 'core-client/scss/components/grid';
|
||||||
|
@import 'core-client/scss/components/modal';
|
||||||
|
@import 'core-client/scss/components/nav';
|
||||||
|
@import 'core-client/scss/components/panel';
|
||||||
|
@import 'core-client/scss/components/typography';
|
||||||
|
|
||||||
|
.welcome {
|
||||||
|
text-align: center;
|
||||||
|
padding: 25px 0 0;
|
||||||
|
color: mc('grey', '700');
|
||||||
|
|
||||||
|
h1 {
|
||||||
|
margin-top: 5px;
|
||||||
|
}
|
||||||
|
|
||||||
|
h2 {
|
||||||
|
margin: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
@ -78,6 +78,14 @@ auth:
|
|||||||
clientSecret: SLACK_CLIENT_SECRET
|
clientSecret: SLACK_CLIENT_SECRET
|
||||||
ldap:
|
ldap:
|
||||||
enabled: false
|
enabled: false
|
||||||
|
url: ldap://serverhost:389
|
||||||
|
bindDn: cn='root'
|
||||||
|
bindCredentials: BIND_PASSWORD
|
||||||
|
searchBase: o=users,o=example.com
|
||||||
|
# searchFilter: {{username}} to use the provided username in search
|
||||||
|
searchFilter: (uid={{username}})
|
||||||
|
tlsEnabled: false
|
||||||
|
tlsCertPath: C:\example\root_ca_cert.crt
|
||||||
|
|
||||||
# ---------------------------------------------------------------------
|
# ---------------------------------------------------------------------
|
||||||
# Secret key to use when encrypting sessions
|
# Secret key to use when encrypting sessions
|
||||||
|
103
configure.js
Normal file
103
configure.js
Normal file
@ -0,0 +1,103 @@
|
|||||||
|
'use strict'
|
||||||
|
|
||||||
|
module.exports = (port, spinner) => {
|
||||||
|
const ROOTPATH = __dirname
|
||||||
|
const IS_DEBUG = process.env.NODE_ENV === 'development'
|
||||||
|
|
||||||
|
// ----------------------------------------
|
||||||
|
// Load modules
|
||||||
|
// ----------------------------------------
|
||||||
|
|
||||||
|
const bodyParser = require('body-parser')
|
||||||
|
const compression = require('compression')
|
||||||
|
const express = require('express')
|
||||||
|
const favicon = require('serve-favicon')
|
||||||
|
const http = require('http')
|
||||||
|
const path = require('path')
|
||||||
|
|
||||||
|
// ----------------------------------------
|
||||||
|
// Define Express App
|
||||||
|
// ----------------------------------------
|
||||||
|
|
||||||
|
var app = express()
|
||||||
|
app.use(compression())
|
||||||
|
|
||||||
|
// ----------------------------------------
|
||||||
|
// Public Assets
|
||||||
|
// ----------------------------------------
|
||||||
|
|
||||||
|
app.use(favicon(path.join(ROOTPATH, 'assets', 'favicon.ico')))
|
||||||
|
app.use(express.static(path.join(ROOTPATH, 'assets')))
|
||||||
|
|
||||||
|
// ----------------------------------------
|
||||||
|
// View Engine Setup
|
||||||
|
// ----------------------------------------
|
||||||
|
|
||||||
|
app.set('views', path.join(ROOTPATH, 'views'))
|
||||||
|
app.set('view engine', 'pug')
|
||||||
|
|
||||||
|
app.use(bodyParser.json())
|
||||||
|
app.use(bodyParser.urlencoded({ extended: false }))
|
||||||
|
|
||||||
|
app.locals._ = require('lodash')
|
||||||
|
|
||||||
|
// ----------------------------------------
|
||||||
|
// Controllers
|
||||||
|
// ----------------------------------------
|
||||||
|
|
||||||
|
app.get('*', (req, res) => {
|
||||||
|
res.render('configure/index')
|
||||||
|
})
|
||||||
|
|
||||||
|
// ----------------------------------------
|
||||||
|
// Error handling
|
||||||
|
// ----------------------------------------
|
||||||
|
|
||||||
|
app.use(function (req, res, next) {
|
||||||
|
var err = new Error('Not Found')
|
||||||
|
err.status = 404
|
||||||
|
next(err)
|
||||||
|
})
|
||||||
|
|
||||||
|
app.use(function (err, req, res, next) {
|
||||||
|
res.status(err.status || 500)
|
||||||
|
res.send({
|
||||||
|
message: err.message,
|
||||||
|
error: IS_DEBUG ? err : {}
|
||||||
|
})
|
||||||
|
spinner.fail(err.message)
|
||||||
|
process.exit(1)
|
||||||
|
})
|
||||||
|
|
||||||
|
// ----------------------------------------
|
||||||
|
// Start HTTP server
|
||||||
|
// ----------------------------------------
|
||||||
|
|
||||||
|
spinner.text = 'Starting HTTP server...'
|
||||||
|
|
||||||
|
app.set('port', port)
|
||||||
|
var server = http.createServer(app)
|
||||||
|
server.listen(port)
|
||||||
|
server.on('error', (error) => {
|
||||||
|
if (error.syscall !== 'listen') {
|
||||||
|
throw error
|
||||||
|
}
|
||||||
|
|
||||||
|
switch (error.code) {
|
||||||
|
case 'EACCES':
|
||||||
|
spinner.fail('Listening on port ' + port + ' requires elevated privileges!')
|
||||||
|
process.exit(1)
|
||||||
|
break
|
||||||
|
case 'EADDRINUSE':
|
||||||
|
spinner.fail('Port ' + port + ' is already in use!')
|
||||||
|
process.exit(1)
|
||||||
|
break
|
||||||
|
default:
|
||||||
|
throw error
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
|
server.on('listening', () => {
|
||||||
|
spinner.text = 'Browse to http://localhost:' + port + ' to configure Wiki.js!'
|
||||||
|
})
|
||||||
|
}
|
19
gulpfile.js
19
gulpfile.js
@ -95,6 +95,14 @@ gulp.task('server', ['scripts', 'css', 'fonts'], function () {
|
|||||||
env: { 'NODE_ENV': 'development' }
|
env: { 'NODE_ENV': 'development' }
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
gulp.task('configure', ['scripts', 'css', 'fonts'], function () {
|
||||||
|
nodemon({
|
||||||
|
exec: 'node wiki configure',
|
||||||
|
ignore: ['assets/', 'client/', 'data/', 'repo/', 'tests/'],
|
||||||
|
ext: 'js json',
|
||||||
|
env: { 'NODE_ENV': 'development' }
|
||||||
|
})
|
||||||
|
})
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* TASK - Process all scripts processes
|
* TASK - Process all scripts processes
|
||||||
@ -182,6 +190,7 @@ gulp.task('watch', function () {
|
|||||||
* TASK - Starts development server with watchers
|
* TASK - Starts development server with watchers
|
||||||
*/
|
*/
|
||||||
gulp.task('default', ['watch', 'server'])
|
gulp.task('default', ['watch', 'server'])
|
||||||
|
gulp.task('default-configure', ['watch', 'configure'])
|
||||||
|
|
||||||
gulp.task('dev', function () {
|
gulp.task('dev', function () {
|
||||||
paths.css.includes.pop()
|
paths.css.includes.pop()
|
||||||
@ -193,6 +202,16 @@ gulp.task('dev', function () {
|
|||||||
return run('default')
|
return run('default')
|
||||||
})
|
})
|
||||||
|
|
||||||
|
gulp.task('dev-configure', function () {
|
||||||
|
paths.css.includes.pop()
|
||||||
|
paths.css.includes.push('../core')
|
||||||
|
|
||||||
|
paths.fonts.pop()
|
||||||
|
paths.fonts.push('../core/core-client/fonts/**/*')
|
||||||
|
|
||||||
|
return run('default-configure')
|
||||||
|
})
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* TASK - Creates deployment packages
|
* TASK - Creates deployment packages
|
||||||
*/
|
*/
|
||||||
|
@ -37,8 +37,8 @@ var mkdown = md({
|
|||||||
.use(mdAnchor, {
|
.use(mdAnchor, {
|
||||||
slugify: _.kebabCase,
|
slugify: _.kebabCase,
|
||||||
permalink: true,
|
permalink: true,
|
||||||
permalinkClass: 'toc-anchor',
|
permalinkClass: 'toc-anchor icon-anchor',
|
||||||
permalinkSymbol: '#',
|
permalinkSymbol: '',
|
||||||
permalinkBefore: true
|
permalinkBefore: true
|
||||||
})
|
})
|
||||||
.use(mdFootnote)
|
.use(mdFootnote)
|
||||||
|
@ -50,6 +50,8 @@ userSchema.statics.processProfile = (profile) => {
|
|||||||
primaryEmail = (e) ? e.value : _.first(profile.emails).value
|
primaryEmail = (e) ? e.value : _.first(profile.emails).value
|
||||||
} else if (_.isString(profile.email) && profile.email.length > 5) {
|
} else if (_.isString(profile.email) && profile.email.length > 5) {
|
||||||
primaryEmail = profile.email
|
primaryEmail = profile.email
|
||||||
|
} else if (_.isString(profile.mail) && profile.mail.length > 5) {
|
||||||
|
primaryEmail = profile.mail
|
||||||
} else if (profile.user && profile.user.email && profile.user.email.length > 5) {
|
} else if (profile.user && profile.user.email && profile.user.email.length > 5) {
|
||||||
primaryEmail = profile.user.email
|
primaryEmail = profile.user.email
|
||||||
} else {
|
} else {
|
||||||
|
@ -9,11 +9,7 @@
|
|||||||
global.PROCNAME = 'SERVER'
|
global.PROCNAME = 'SERVER'
|
||||||
global.ROOTPATH = __dirname
|
global.ROOTPATH = __dirname
|
||||||
global.IS_DEBUG = process.env.NODE_ENV === 'development'
|
global.IS_DEBUG = process.env.NODE_ENV === 'development'
|
||||||
if (IS_DEBUG) {
|
global.CORE_PATH = (IS_DEBUG) ? ROOTPATH + '/../core/' : ROOTPATH + '/node_modules/requarks-core/'
|
||||||
global.CORE_PATH = ROOTPATH + '/../core/'
|
|
||||||
} else {
|
|
||||||
global.CORE_PATH = ROOTPATH + '/node_modules/requarks-core/'
|
|
||||||
}
|
|
||||||
|
|
||||||
process.env.VIPS_WARNING = false
|
process.env.VIPS_WARNING = false
|
||||||
|
|
||||||
|
58
views/configure/index.pug
Normal file
58
views/configure/index.pug
Normal file
@ -0,0 +1,58 @@
|
|||||||
|
doctype html
|
||||||
|
html
|
||||||
|
head
|
||||||
|
meta(http-equiv='X-UA-Compatible', content='IE=edge')
|
||||||
|
meta(charset='UTF-8')
|
||||||
|
title Wiki.js | Configure
|
||||||
|
|
||||||
|
// Favicon
|
||||||
|
each favsize in [32, 96, 16]
|
||||||
|
link(rel='icon', type='image/png', sizes=favsize + 'x' + favsize, href='/favicons/favicon-' + favsize + 'x' + favsize + '.png')
|
||||||
|
|
||||||
|
// CSS
|
||||||
|
link(type='text/css', rel='stylesheet', href='/css/libs.css')
|
||||||
|
link(type='text/css', rel='stylesheet', href='/css/configure.css')
|
||||||
|
|
||||||
|
// JS
|
||||||
|
script(type='text/javascript', src='/js/libs.js')
|
||||||
|
//script(type='text/javascript', src='/js/app.js')
|
||||||
|
|
||||||
|
block head
|
||||||
|
|
||||||
|
body
|
||||||
|
#root
|
||||||
|
#header-container
|
||||||
|
nav.nav#header
|
||||||
|
.nav-left
|
||||||
|
a.nav-item(href='/')
|
||||||
|
h1
|
||||||
|
i.icon-layers
|
||||||
|
| Wiki.js
|
||||||
|
main
|
||||||
|
.container
|
||||||
|
.welcome(style={'padding-bottom': '5px'})
|
||||||
|
img(src='/favicons/android-icon-96x96.png', alt='Wiki.js')
|
||||||
|
h1 Welcome to Wiki.js!
|
||||||
|
h2(style={'margin-bottom': 0}) Fill in the fields below to get up and running.
|
||||||
|
.content
|
||||||
|
.panel
|
||||||
|
h2.panel-title
|
||||||
|
span General
|
||||||
|
i(v-if='loading')
|
||||||
|
.panel-content.form-sections
|
||||||
|
section
|
||||||
|
p.control.is-fullwidth
|
||||||
|
label.label Site Title
|
||||||
|
input(type='text', placeholder='e.g. Wiki', v-model='title')
|
||||||
|
section
|
||||||
|
p.control.is-fullwidth
|
||||||
|
label.label Host
|
||||||
|
input(type='text', placeholder='http://', v-model='host')
|
||||||
|
.panel-footer
|
||||||
|
button.button.is-indigo(v-on:click='add', v-bind:disabled='loading') Continue
|
||||||
|
footer.footer
|
||||||
|
span
|
||||||
|
| Powered by
|
||||||
|
a(href='https://github.com/Requarks/wiki') Wiki.js
|
||||||
|
| .
|
||||||
|
block outside
|
@ -30,7 +30,7 @@ block adminContent
|
|||||||
i.icon-check
|
i.icon-check
|
||||||
span Save Changes
|
span Save Changes
|
||||||
.column
|
.column
|
||||||
.panel
|
.panel-aside
|
||||||
label.label Provider
|
label.label Provider
|
||||||
p.control.account-profile-provider
|
p.control.account-profile-provider
|
||||||
case user.provider
|
case user.provider
|
||||||
|
@ -63,7 +63,7 @@ block content
|
|||||||
i.icon-th-list
|
i.icon-th-list
|
||||||
span Page Contents
|
span Page Contents
|
||||||
ul.sidebar-menu
|
ul.sidebar-menu
|
||||||
li: a(href='#root', title='Top of Page') Top
|
li: a(href='#root', title='Top of Page') Top of Page
|
||||||
+tocMenu(pageData.tree)
|
+tocMenu(pageData.tree)
|
||||||
|
|
||||||
.column
|
.column
|
||||||
|
14
wiki.js
14
wiki.js
@ -1,6 +1,12 @@
|
|||||||
#!/usr/bin/env node
|
#!/usr/bin/env node
|
||||||
'use strict'
|
'use strict'
|
||||||
|
|
||||||
|
// ===========================================
|
||||||
|
// Wiki.js
|
||||||
|
// 1.0.0
|
||||||
|
// Licensed under AGPLv3
|
||||||
|
// ===========================================
|
||||||
|
|
||||||
const Promise = require('bluebird')
|
const Promise = require('bluebird')
|
||||||
const fs = Promise.promisifyAll(require('fs-extra'))
|
const fs = Promise.promisifyAll(require('fs-extra'))
|
||||||
const ora = require('ora')
|
const ora = require('ora')
|
||||||
@ -54,6 +60,14 @@ cmdr.command('stop')
|
|||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|
||||||
|
cmdr.command('configure [port]')
|
||||||
|
.description('Configure Wiki.js')
|
||||||
|
.action((port) => {
|
||||||
|
port = port || 3000
|
||||||
|
let spinner = ora('Initializing interactive setup...').start()
|
||||||
|
require('./configure')(port, spinner)
|
||||||
|
})
|
||||||
|
|
||||||
cmdr.parse(process.argv)
|
cmdr.parse(process.argv)
|
||||||
|
|
||||||
if (!process.argv.slice(2).length) {
|
if (!process.argv.slice(2).length) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user