feat: setup wizard cleanup + upgrade UI

[ci skip]
pull/621/head
NGPixel 7 years ago
parent c94e2d5700
commit ca8451720f

@ -8,6 +8,7 @@ import CONSTANTS from './constants'
import Vue from 'vue' import Vue from 'vue'
import VueResource from 'vue-resource' import VueResource from 'vue-resource'
import VueClipboards from 'vue-clipboards' import VueClipboards from 'vue-clipboards'
import VeeValidate from 'vee-validate'
import { ApolloClient, createBatchingNetworkInterface } from 'apollo-client' import { ApolloClient, createBatchingNetworkInterface } from 'apollo-client'
import store from './store' import store from './store'
@ -83,6 +84,17 @@ Vue.use(VueResource)
Vue.use(VueClipboards) Vue.use(VueClipboards)
Vue.use(localization.VueI18Next) Vue.use(localization.VueI18Next)
Vue.use(helpers) Vue.use(helpers)
Vue.use(VeeValidate, {
enableAutoClasses: true,
classNames: {
touched: 'is-touched', // the control has been blurred
untouched: 'is-untouched', // the control hasn't been blurred
valid: 'is-valid', // model is valid
invalid: 'is-invalid', // model is invalid
pristine: 'is-pristine', // control has not been interacted with
dirty: 'is-dirty' // control has been interacted with
}
})
// ==================================== // ====================================
// Register Vue Components // Register Vue Components

@ -1,22 +1,7 @@
'use strict'
/* global siteConfig */ /* global siteConfig */
import VeeValidate from 'vee-validate'
import axios from 'axios' import axios from 'axios'
Vue.use(VeeValidate, {
enableAutoClasses: true,
classNames: {
touched: 'is-touched', // the control has been blurred
untouched: 'is-untouched', // the control hasn't been blurred
valid: 'is-valid', // model is valid
invalid: 'is-invalid', // model is invalid
pristine: 'is-pristine', // control has not been interacted with
dirty: 'is-dirty' // control has been interacted with
}
})
export default { export default {
name: 'configManager', name: 'configManager',
data() { data() {
@ -42,12 +27,12 @@ export default {
results: [] results: []
}, },
conf: { conf: {
upgrade: false,
title: siteConfig.title || 'Wiki', title: siteConfig.title || 'Wiki',
host: siteConfig.host || 'http://', host: siteConfig.host || 'http://',
port: siteConfig.port || 80, port: siteConfig.port || 80,
lang: siteConfig.lang || 'en', lang: siteConfig.lang || 'en',
public: (siteConfig.public === true), public: (siteConfig.public === true),
db: siteConfig.db || 'mongodb://localhost:27017/wiki',
pathData: './data', pathData: './data',
pathRepo: './repo', pathRepo: './repo',
gitUseRemote: (siteConfig.git !== false), gitUseRemote: (siteConfig.git !== false),
@ -82,28 +67,19 @@ export default {
perc = (this.syscheck.ok) ? '15%' : '5%' perc = (this.syscheck.ok) ? '15%' : '5%'
break break
case 'general': case 'general':
perc = '20%' perc = '25%'
break break
case 'considerations': case 'considerations':
perc = '30%' perc = '30%'
break break
case 'db':
perc = '35%'
break
case 'dbcheck':
perc = (this.dbcheck.ok) ? '50%' : '40%'
break
case 'paths':
perc = '55%'
break
case 'git': case 'git':
perc = '60%' perc = '50%'
break break
case 'gitcheck': case 'gitcheck':
perc = (this.gitcheck.ok) ? '75%' : '65%' perc = (this.gitcheck.ok) ? '70%' : '55%'
break break
case 'admin': case 'admin':
perc = '80%' perc = '75%'
break break
} }
return perc return perc
@ -176,48 +152,6 @@ export default {
this.state = 'considerations' this.state = 'considerations'
this.loading = false this.loading = false
}, },
proceedToDb: function (ev) {
let self = this
self.state = 'db'
self.loading = false
self.$nextTick(() => {
self.$validator.validateAll('db')
})
},
proceedToDbcheck: function (ev) {
let self = this
this.state = 'dbcheck'
this.loading = true
self.dbcheck = {
ok: false,
error: ''
}
this.$helpers._.delay(() => {
axios.post('/dbcheck', {
db: self.conf.db
}).then(resp => {
if (resp.data.ok === true) {
self.dbcheck.ok = true
} else {
self.dbcheck.ok = false
self.dbcheck.error = resp.data.error
}
self.loading = false
self.$nextTick()
}).catch(err => {
window.alert(err.message)
})
}, 1000)
},
proceedToPaths: function (ev) {
let self = this
self.state = 'paths'
self.loading = false
self.$nextTick(() => {
self.$validator.validateAll('paths')
})
},
proceedToGit: function (ev) { proceedToGit: function (ev) {
let self = this let self = this
self.state = 'git' self.state = 'git'

@ -26,6 +26,7 @@ defaults:
readonly: false readonly: false
site: site:
path: '' path: ''
lang: en
title: Wiki.js title: Wiki.js
configNamespaces: configNamespaces:
- auth - auth
@ -86,6 +87,9 @@ langs:
- -
id: ko id: ko
name: Korean - 한국어 name: Korean - 한국어
-
id: fa
name: Persian (Fārsi) - فارسی
- -
id: pt id: pt
name: Portuguese - Português name: Portuguese - Português

@ -53,7 +53,9 @@ module.exports = () => {
// ---------------------------------------- // ----------------------------------------
app.get('*', (req, res) => { app.get('*', (req, res) => {
res.render('configure/index') fs.readJsonAsync(path.join(wiki.ROOTPATH, 'package.json')).then(packageObj => {
res.render('configure/index', { packageObj })
})
}) })
/** /**
@ -63,7 +65,7 @@ module.exports = () => {
Promise.mapSeries([ Promise.mapSeries([
() => { () => {
const semver = require('semver') const semver = require('semver')
if (!semver.satisfies(semver.clean(process.version), '>=6.9.0')) { if (!semver.satisfies(semver.clean(process.version), '>=6.11.1')) {
throw new Error('Node.js version is too old. Minimum is 6.11.1.') throw new Error('Node.js version is too old. Minimum is 6.11.1.')
} }
return 'Node.js ' + process.version + ' detected. Minimum is 6.11.1.' return 'Node.js ' + process.version + ' detected. Minimum is 6.11.1.'
@ -113,43 +115,6 @@ module.exports = () => {
}) })
}) })
/**
* Check the DB connection
*/
app.post('/dbcheck', (req, res) => {
let mongo = require('mongodb').MongoClient
let mongoURI = cfgHelper.parseConfigValue(req.body.db)
mongo.connect(mongoURI, {
autoReconnect: false,
reconnectTries: 2,
reconnectInterval: 1000,
connectTimeoutMS: 5000,
socketTimeoutMS: 5000
}, (err, db) => {
if (err === null) {
// Try to create a test collection
db.createCollection('test', (err, results) => {
if (err === null) {
// Try to drop test collection
db.dropCollection('test', (err, results) => {
if (err === null) {
res.json({ ok: true })
} else {
res.json({ ok: false, error: 'Unable to delete test collection. Verify permissions. ' + err.message })
}
db.close()
})
} else {
res.json({ ok: false, error: 'Unable to create test collection. Verify permissions. ' + err.message })
db.close()
}
})
} else {
res.json({ ok: false, error: err.message })
}
})
})
/** /**
* Check the Git connection * Check the Git connection
*/ */

@ -1,6 +1,6 @@
'use strict' 'use strict'
/* global db, lang, rights, winston */ /* global wiki */
var express = require('express') var express = require('express')
var router = express.Router() var router = express.Router()
@ -33,14 +33,14 @@ router.post('/profile', (req, res) => {
return res.render('error-forbidden') return res.render('error-forbidden')
} }
return db.User.findById(req.user.id).then((usr) => { return wiki.db.User.findById(req.user.id).then((usr) => {
usr.name = _.trim(req.body.name) usr.name = _.trim(req.body.name)
if (usr.provider === 'local' && req.body.password !== '********') { if (usr.provider === 'local' && req.body.password !== '********') {
let nPwd = _.trim(req.body.password) let nPwd = _.trim(req.body.password)
if (nPwd.length < 6) { if (nPwd.length < 6) {
return Promise.reject(new Error('New Password too short!')) return Promise.reject(new Error('New Password too short!'))
} else { } else {
return db.User.hashPassword(nPwd).then((pwd) => { return wiki.db.User.hashPassword(nPwd).then((pwd) => {
usr.password = pwd usr.password = pwd
return usr.save() return usr.save()
}) })
@ -61,9 +61,9 @@ router.get('/stats', (req, res) => {
} }
Promise.all([ Promise.all([
db.Entry.count(), wiki.db.Entry.count(),
db.UplFile.count(), wiki.db.UplFile.count(),
db.User.count() wiki.db.User.count()
]).spread((totalEntries, totalUploads, totalUsers) => { ]).spread((totalEntries, totalUploads, totalUsers) => {
return res.render('pages/admin/stats', { return res.render('pages/admin/stats', {
totalEntries, totalUploads, totalUsers, adminTab: 'stats' totalEntries, totalUploads, totalUsers, adminTab: 'stats'
@ -78,7 +78,7 @@ router.get('/users', (req, res) => {
return res.render('error-forbidden') return res.render('error-forbidden')
} }
db.User.find({}) wiki.db.User.find({})
.select('-password -rights') .select('-password -rights')
.sort('name email') .sort('name email')
.exec().then((usrs) => { .exec().then((usrs) => {
@ -95,7 +95,7 @@ router.get('/users/:id', (req, res) => {
return res.render('error-forbidden') return res.render('error-forbidden')
} }
db.User.findById(req.params.id) wiki.db.User.findById(req.params.id)
.select('-password -providerId') .select('-password -providerId')
.exec().then((usr) => { .exec().then((usr) => {
let usrOpts = { let usrOpts = {
@ -137,12 +137,12 @@ router.post('/users/create', (req, res) => {
return res.status(400).json({ msg: 'Name is missing' }) return res.status(400).json({ msg: 'Name is missing' })
} }
db.User.findOne({ email: nUsr.email, provider: nUsr.provider }).then(exUsr => { wiki.db.User.findOne({ email: nUsr.email, provider: nUsr.provider }).then(exUsr => {
if (exUsr) { if (exUsr) {
return res.status(400).json({ msg: 'User already exists!' }) || true return res.status(400).json({ msg: 'User already exists!' }) || true
} }
let pwdGen = (nUsr.provider === 'local') ? db.User.hashPassword(nUsr.password) : Promise.resolve(true) let pwdGen = (nUsr.provider === 'local') ? wiki.db.User.hashPassword(nUsr.password) : Promise.resolve(true)
return pwdGen.then(nPwd => { return pwdGen.then(nPwd => {
if (nUsr.provider !== 'local') { if (nUsr.provider !== 'local') {
nUsr.password = '' nUsr.password = ''
@ -158,37 +158,37 @@ router.post('/users/create', (req, res) => {
deny: false deny: false
}] }]
return db.User.create(nUsr).then(() => { return wiki.db.User.create(nUsr).then(() => {
return res.json({ ok: true }) return res.json({ ok: true })
}) })
}).catch(err => { }).catch(err => {
winston.warn(err) wiki.logger.warn(err)
return res.status(500).json({ msg: err }) return res.status(500).json({ msg: err })
}) })
}).catch(err => { }).catch(err => {
winston.warn(err) wiki.logger.warn(err)
return res.status(500).json({ msg: err }) return res.status(500).json({ msg: err })
}) })
}) })
router.post('/users/:id', (req, res) => { router.post('/users/:id', (req, res) => {
if (!res.locals.rights.manage) { if (!res.locals.rights.manage) {
return res.status(401).json({ msg: lang.t('errors:unauthorized') }) return res.status(401).json({ msg: wiki.lang.t('errors:unauthorized') })
} }
if (!validator.isMongoId(req.params.id)) { if (!validator.isMongoId(req.params.id)) {
return res.status(400).json({ msg: lang.t('errors:invaliduserid') }) return res.status(400).json({ msg: wiki.lang.t('errors:invaliduserid') })
} }
return db.User.findById(req.params.id).then((usr) => { return wiki.db.User.findById(req.params.id).then((usr) => {
usr.name = _.trim(req.body.name) usr.name = _.trim(req.body.name)
usr.rights = JSON.parse(req.body.rights) usr.rights = JSON.parse(req.body.rights)
if (usr.provider === 'local' && req.body.password !== '********') { if (usr.provider === 'local' && req.body.password !== '********') {
let nPwd = _.trim(req.body.password) let nPwd = _.trim(req.body.password)
if (nPwd.length < 6) { if (nPwd.length < 6) {
return Promise.reject(new Error(lang.t('errors:newpasswordtooshort'))) return Promise.reject(new Error(wiki.lang.t('errors:newpasswordtooshort')))
} else { } else {
return db.User.hashPassword(nPwd).then((pwd) => { return wiki.db.User.hashPassword(nPwd).then((pwd) => {
usr.password = pwd usr.password = pwd
return usr.save() return usr.save()
}) })
@ -199,7 +199,7 @@ router.post('/users/:id', (req, res) => {
}).then((usr) => { }).then((usr) => {
// Update guest rights for future requests // Update guest rights for future requests
if (usr.provider === 'local' && usr.email === 'guest') { if (usr.provider === 'local' && usr.email === 'guest') {
rights.guest = usr wiki.rights.guest = usr
} }
return usr return usr
}).then(() => { }).then(() => {
@ -214,14 +214,14 @@ router.post('/users/:id', (req, res) => {
*/ */
router.delete('/users/:id', (req, res) => { router.delete('/users/:id', (req, res) => {
if (!res.locals.rights.manage) { if (!res.locals.rights.manage) {
return res.status(401).json({ msg: lang.t('errors:unauthorized') }) return res.status(401).json({ msg: wiki.lang.t('errors:unauthorized') })
} }
if (!validator.isMongoId(req.params.id)) { if (!validator.isMongoId(req.params.id)) {
return res.status(400).json({ msg: lang.t('errors:invaliduserid') }) return res.status(400).json({ msg: wiki.lang.t('errors:invaliduserid') })
} }
return db.User.findByIdAndRemove(req.params.id).then(() => { return wiki.db.User.findByIdAndRemove(req.params.id).then(() => {
return res.json({ ok: true }) return res.json({ ok: true })
}).catch((err) => { }).catch((err) => {
res.status(500).json({ ok: false, msg: err.message }) res.status(500).json({ ok: false, msg: err.message })
@ -249,7 +249,7 @@ router.get('/system', (req, res) => {
cwd: process.cwd() cwd: process.cwd()
} }
fs.readJsonAsync(path.join(ROOTPATH, 'package.json')).then(packageObj => { fs.readJsonAsync(path.join(wiki.ROOTPATH, 'package.json')).then(packageObj => {
axios.get('https://api.github.com/repos/Requarks/wiki/releases/latest').then(resp => { axios.get('https://api.github.com/repos/Requarks/wiki/releases/latest').then(resp => {
let sysversion = { let sysversion = {
current: 'v' + packageObj.version, current: 'v' + packageObj.version,
@ -259,7 +259,7 @@ router.get('/system', (req, res) => {
res.render('pages/admin/system', { adminTab: 'system', hostInfo, sysversion }) res.render('pages/admin/system', { adminTab: 'system', hostInfo, sysversion })
}).catch(err => { }).catch(err => {
winston.warn(err) wiki.logger.warn(err)
res.render('pages/admin/system', { adminTab: 'system', hostInfo, sysversion: { current: 'v' + packageObj.version } }) res.render('pages/admin/system', { adminTab: 'system', hostInfo, sysversion: { current: 'v' + packageObj.version } })
}) })
}) })
@ -287,19 +287,19 @@ router.post('/theme', (req, res) => {
return res.render('error-forbidden') return res.render('error-forbidden')
} }
if (!validator.isIn(req.body.primary, appdata.colors)) { if (!validator.isIn(req.body.primary, wiki.data.colors)) {
return res.status(406).json({ msg: 'Primary color is invalid.' }) return res.status(406).json({ msg: 'Primary color is invalid.' })
} else if (!validator.isIn(req.body.alt, appdata.colors)) { } else if (!validator.isIn(req.body.alt, wiki.data.colors)) {
return res.status(406).json({ msg: 'Alternate color is invalid.' }) return res.status(406).json({ msg: 'Alternate color is invalid.' })
} else if (!validator.isIn(req.body.footer, appdata.colors)) { } else if (!validator.isIn(req.body.footer, wiki.data.colors)) {
return res.status(406).json({ msg: 'Footer color is invalid.' }) return res.status(406).json({ msg: 'Footer color is invalid.' })
} }
appconfig.theme.primary = req.body.primary wiki.config.theme.primary = req.body.primary
appconfig.theme.alt = req.body.alt wiki.config.theme.alt = req.body.alt
appconfig.theme.footer = req.body.footer wiki.config.theme.footer = req.body.footer
appconfig.theme.code.dark = req.body.codedark === 'true' wiki.config.theme.code.dark = req.body.codedark === 'true'
appconfig.theme.code.colorize = req.body.codecolorize === 'true' wiki.config.theme.code.colorize = req.body.codecolorize === 'true'
return res.json({ msg: 'OK' }) return res.json({ msg: 'OK' })
}) })

@ -23,6 +23,14 @@ block body
.panel-content.is-text .panel-content.is-text
p This installation wizard will guide you through the steps needed to get your wiki up and running in no time! p This installation wizard will guide you through the steps needed to get your wiki up and running in no time!
p Detailed information about installation and usage can be found on the #[a(href='https://docs.wiki.requarks.io/') official documentation site]. #[br] Should you have any question or would like to report something that doesn't look right, feel free to create a new issue on the #[a(href='https://github.com/Requarks/wiki/issues') GitHub project]. p Detailed information about installation and usage can be found on the #[a(href='https://docs.wiki.requarks.io/') official documentation site]. #[br] Should you have any question or would like to report something that doesn't look right, feel free to create a new issue on the #[a(href='https://github.com/Requarks/wiki/issues') GitHub project].
.panel-content.form-sections
section
p #[i.nc-icon-outline.tech_cd-reader] You are about to install Wiki.js #[strong= packageObj.version].
section
p.control.is-fullwidth
input#ipt-upgrade(type='checkbox', v-model='conf.upgrade', name='ipt-upgrade')
label.label(for='ipt-upgrade') Upgrade from Wiki.js 1.x
span.desc Check this box if you are upgrading from Wiki.js 1.x and wish to migrate your existing data.
.panel-footer .panel-footer
.progress-bar: div(v-bind:style='{width: currentProgress}') .progress-bar: div(v-bind:style='{width: currentProgress}')
button.button.is-small.is-light-blue(v-on:click='proceedToSyscheck', v-bind:disabled='loading') Start button.button.is-small.is-light-blue(v-on:click='proceedToSyscheck', v-bind:disabled='loading') Start
@ -49,6 +57,7 @@ block body
.progress-bar: div(v-bind:style='{width: currentProgress}') .progress-bar: div(v-bind:style='{width: currentProgress}')
button.button.is-small.is-light-blue.is-outlined(v-on:click='proceedToWelcome', v-bind:disabled='loading') Back button.button.is-small.is-light-blue.is-outlined(v-on:click='proceedToWelcome', v-bind:disabled='loading') Back
button.button.is-small.is-teal(v-on:click='proceedToSyscheck', v-if='!loading && !syscheck.ok') Check Again button.button.is-small.is-teal(v-on:click='proceedToSyscheck', v-if='!loading && !syscheck.ok') Check Again
button.button.is-small.is-red.is-outlined(v-on:click='proceedToGeneral', v-if='!loading && !syscheck.ok') Continue Anyway
button.button.is-small.is-light-blue(v-on:click='proceedToGeneral', v-if='loading || syscheck.ok', v-bind:disabled='loading') Continue button.button.is-small.is-light-blue(v-on:click='proceedToGeneral', v-if='loading || syscheck.ok', v-bind:disabled='loading') Continue
//- ============================================== //- ==============================================
@ -70,7 +79,7 @@ block body
p.control.is-fullwidth p.control.is-fullwidth
label.label Host label.label Host
input(type='text', placeholder='http://', v-model='conf.host', data-vv-scope='general', name='ipt-host', v-validate='{ required: true, min: 4 }') input(type='text', placeholder='http://', v-model='conf.host', data-vv-scope='general', name='ipt-host', v-validate='{ required: true, min: 4 }')
span.desc The full URL to your wiki, without the trailing slash. E.g.: http://wiki.domain.com. Note that sub-folders are #[u not supported]. span.desc The full URL to your wiki, without the trailing slash, e.g.: http://wiki.domain.com. Make sure to include the port if different than 80/443.
section section
p.control p.control
label.label Port label.label Port
@ -79,10 +88,15 @@ block body
section section
p.control p.control
label.label Site UI Language label.label Site UI Language
select(v-model='conf.site.lang') select(v-model='conf.lang')
each lg in data.langs each lg in data.langs
option(value=lg.id)= lg.name option(value=lg.id)= lg.name
span.desc The language in which navigation, help and other UI elements will be displayed. span.desc The language in which navigation, help and other UI elements will be displayed.
section
p.control.is-fullwidth
label.label Local Repository Path
input(type='text', placeholder='e.g. ./repo', v-model='conf.pathRepo', data-vv-scope='general', name='ipt-repopath', v-validate='{ required: true, min: 2 }')
span.desc The path where the local git repository will be created, used to store content in markdown files and uploads.#[br] #[strong It is recommended to leave the default value].
section section
p.control.is-fullwidth p.control.is-fullwidth
input#ipt-public(type='checkbox', v-model='conf.public', data-vv-scope='general', name='ipt-public') input#ipt-public(type='checkbox', v-model='conf.public', data-vv-scope='general', name='ipt-public')
@ -111,88 +125,18 @@ block body
li - Do not rewrite URLs after the domain. This can cause unexpected issues in Wiki.js navigation. li - Do not rewrite URLs after the domain. This can cause unexpected issues in Wiki.js navigation.
li - Do not remove or alter the client IP when proxying the requests. This can cause the authentication brute force protection to engage unexpectedly. li - Do not remove or alter the client IP when proxying the requests. This can cause the authentication brute force protection to engage unexpectedly.
template(v-if='considerations.https') template(v-if='considerations.https')
h3 The site will not be using HTTPS? #[i.icon-warning-outline.animated.fadeOut.infinite] h3 The site will not be using HTTPS? #[i.nc-icon-outline.ui-3_alert.animated.fadeOut.infinite]
p The host URL you specified is not HTTPS. It is highly recommended to use HTTPS. You must use a web server / proxy (e.g. nginx / apache / IIS) in front of Wiki.js to use HTTPS. Wiki.js does not provide HTTPS handling by itself. p The host URL you specified is not HTTPS. It is highly recommended to use HTTPS. You must use a web server / proxy (e.g. nginx / apache / IIS) in front of Wiki.js to use HTTPS. Wiki.js does not provide HTTPS handling by itself.
template(v-if='considerations.port') template(v-if='considerations.port')
h3 You are using a non-standard port. h3 You are using a non-standard port.
p If you are not planning on using a web server / proxy in front of Wiki.js, be aware that users will need to specify the port when accessing the wiki. Make sure this is the intended behavior. Otherwise set a standard HTTP port such as 80. p If you are not planning on using a web server / proxy in front of Wiki.js, be aware that users will need to specify the port when accessing the wiki. Make sure this is the intended behavior. Otherwise set a standard HTTP port such as 80.
template(v-if='considerations.localhost') template(v-if='considerations.localhost')
h3 Are you sure you want to use localhost as the host base URL? #[i.icon-warning-outline.animated.fadeOut.infinite] h3 Are you sure you want to use localhost as the host base URL? #[i.nc-icon-outline.ui-3_alert.animated.fadeOut.infinite]
p The host URL you specified is localhost. Unless you are a developer running Wiki.js locally on your machine, this is not recommended! p The host URL you specified is localhost. Unless you are a developer running Wiki.js locally on your machine, this is not recommended!
.panel-footer .panel-footer
.progress-bar: div(v-bind:style='{width: currentProgress}') .progress-bar: div(v-bind:style='{width: currentProgress}')
button.button.is-small.is-light-blue.is-outlined(v-on:click='proceedToGeneral', v-bind:disabled='loading') Back button.button.is-small.is-light-blue.is-outlined(v-on:click='proceedToGeneral', v-bind:disabled='loading') Back
button.button.is-small.is-light-blue(v-on:click='proceedToDb', v-bind:disabled='loading') Continue button.button.is-small.is-light-blue(v-on:click='proceedToGit', v-bind:disabled='loading') Continue
//- ==============================================
//- DATABASE
//- ==============================================
template(v-else-if='state === "db"')
.panel
h2.panel-title.is-featured
span Database
i(v-if='loading')
.panel-content.is-text
p Wiki.js stores administrative data such as users, permissions and assets metadata in a MongoDB database. Article contents and uploads are <u>not</u> stored in the DB. Instead, they are stored on-disk and synced automatically with a remote git repository of your choice.
.panel-content.form-sections
section
p.control.is-fullwidth
label.label MongoDB Connection String
input(type='text', placeholder='e.g. mongodb://localhost:27017/wiki', v-model='conf.db', data-vv-scope='db', name='ipt-db', v-validate='{ required: true, min: 3 }')
span.desc The connection string to your MongoDB server. Leave the default localhost value if MongoDB is installed on the same server.<br />You can also specify an environment variable as the connection string, e.g. $(MONGO_URI).
.panel-footer
.progress-bar: div(v-bind:style='{width: currentProgress}')
button.button.is-small.is-light-blue.is-outlined(v-on:click='proceedToConsiderations', v-bind:disabled='loading') Back
button.button.is-small.is-light-blue(v-on:click='proceedToDbcheck', v-bind:disabled='loading || errors.any("db")') Connect
//- ==============================================
//- DATABASE CHECK
//- ==============================================
template(v-else-if='state === "dbcheck"')
.panel
h2.panel-title.is-featured
span Database Check
i(v-if='loading')
.panel-content.is-text
p(v-if='loading') #[i.icon-loader.animated.rotateIn.infinite] Testing the connection to MongoDB...
p(v-if='!loading && dbcheck.ok')
i.icon-check
strong Connected successfully!
p(v-if='!loading && !dbcheck.ok') #[i.icon-square-cross] Error: {{ dbcheck.error }}
.panel-footer
.progress-bar: div(v-bind:style='{width: currentProgress}')
button.button.is-small.is-light-blue.is-outlined(v-on:click='proceedToDb', v-bind:disabled='loading') Back
button.button.is-small.is-teal(v-on:click='proceedToDbcheck', v-if='!loading && !dbcheck.ok') Try Again
button.button.is-small.is-light-blue(v-on:click='proceedToPaths', v-if='loading || dbcheck.ok', v-bind:disabled='loading') Continue
//- ==============================================
//- PATHS
//- ==============================================
template(v-else-if='state === "paths"')
.panel
h2.panel-title.is-featured
span Paths
i(v-if='loading')
.panel-content.is-text
p It is recommended to leave the default values.
.panel-content.form-sections
section
p.control.is-fullwidth
label.label Local Data Path
input(type='text', placeholder='e.g. ./data', v-model='conf.pathData', data-vv-scope='paths', name='ipt-datapath', v-validate='{ required: true, min: 2 }')
span.desc The path where cache (processed content, thumbnails, search index, etc.) will be stored on disk.
section
p.control.is-fullwidth
label.label Local Repository Path
input(type='text', placeholder='e.g. ./repo', v-model='conf.pathRepo', data-vv-scope='paths', name='ipt-repopath', v-validate='{ required: true, min: 2 }')
span.desc The path where the local git repository will be created, used to store content in markdown files and uploads.
.panel-footer
.progress-bar: div(v-bind:style='{width: currentProgress}')
button.button.is-small.is-light-blue.is-outlined(v-on:click='proceedToDb', v-bind:disabled='loading') Back
button.button.is-small.is-light-blue(v-on:click='proceedToGit', v-bind:disabled='loading || errors.any("paths")') Continue
//- ============================================== //- ==============================================
//- GIT //- GIT
@ -256,7 +200,7 @@ block body
span.desc The default/fallback email to use when creating commits to the git repository. span.desc The default/fallback email to use when creating commits to the git repository.
.panel-footer .panel-footer
.progress-bar: div(v-bind:style='{width: currentProgress}') .progress-bar: div(v-bind:style='{width: currentProgress}')
button.button.is-small.is-light-blue.is-outlined(v-on:click='proceedToPaths', v-bind:disabled='loading') Back button.button.is-small.is-light-blue.is-outlined(v-on:click='proceedToGeneral', v-bind:disabled='loading') Back
button.button.is-small.is-light-blue.is-outlined(v-on:click='conf.gitUseRemote = false; proceedToGitCheck()', v-bind:disabled='loading') Skip this step button.button.is-small.is-light-blue.is-outlined(v-on:click='conf.gitUseRemote = false; proceedToGitCheck()', v-bind:disabled='loading') Skip this step
button.button.is-small.is-light-blue(v-on:click='conf.gitUseRemote = true; proceedToGitCheck()', v-bind:disabled='loading || errors.any("git")') Continue button.button.is-small.is-light-blue(v-on:click='conf.gitUseRemote = true; proceedToGitCheck()', v-bind:disabled='loading || errors.any("git")') Continue

Loading…
Cancel
Save