Commit ba1d83eb authored by NGPixel's avatar NGPixel

feat: db + redis error handling, setup options, updated deps

parent 1658fcbf
...@@ -13,7 +13,7 @@ import { ApolloClient } from 'apollo-client' ...@@ -13,7 +13,7 @@ import { ApolloClient } from 'apollo-client'
import { HttpLink } from 'apollo-link-http' import { HttpLink } from 'apollo-link-http'
import { InMemoryCache } from 'apollo-cache-inmemory' import { InMemoryCache } from 'apollo-cache-inmemory'
import store from './store' import store from './store'
import icons from '../svg/icons.svg' import icons from '../svg/nc-icons.svg'
// ==================================== // ====================================
// Load Modules // Load Modules
// ==================================== // ====================================
......
...@@ -32,6 +32,8 @@ export default { ...@@ -32,6 +32,8 @@ export default {
adminPasswordConfirm: '', adminPasswordConfirm: '',
gitAuthPass: '', gitAuthPass: '',
gitAuthSSHKey: '', gitAuthSSHKey: '',
gitAuthSSHKeyEnv: '',
gitAuthSSHKeyDB: '',
gitAuthSSL: true, gitAuthSSL: true,
gitAuthType: 'ssh', gitAuthType: 'ssh',
gitAuthUser: '', gitAuthUser: '',
...@@ -46,6 +48,7 @@ export default { ...@@ -46,6 +48,7 @@ export default {
pathRepo: './repo', pathRepo: './repo',
port: siteConfig.port || 80, port: siteConfig.port || 80,
public: (siteConfig.public === true), public: (siteConfig.public === true),
selfregister: (siteConfig.selfregister === true),
telemetry: true, telemetry: true,
title: siteConfig.title || 'Wiki', title: siteConfig.title || 'Wiki',
upgrade: false upgrade: false
......
.config-manager { .config-manager {
background-image: linear-gradient(to right, mc('indigo', '400'), mc('indigo', '600')); background-image: linear-gradient(to bottom right, mc('blue', '500'), mc('blue', '700'));
background-repeat: no-repeat; background-repeat: no-repeat;
width: 100%; width: 100%;
min-height: 100%; min-height: 100%;
...@@ -20,7 +20,7 @@ ...@@ -20,7 +20,7 @@
.welcome { .welcome {
text-align: center; text-align: center;
padding: 1rem 0 2rem 0; padding: 1rem 0 2rem 0;
border-bottom: 1px solid mc('indigo', '50'); border-bottom: 1px solid mc('blue', '50');
margin-bottom: 1rem; margin-bottom: 1rem;
img { img {
...@@ -38,7 +38,7 @@ ...@@ -38,7 +38,7 @@
.is-logo { .is-logo {
text-align: center; text-align: center;
padding: .5rem 0 1.5rem 0; padding: .5rem 0 1.5rem 0;
border-bottom: 1px solid mc('indigo', '50'); border-bottom: 1px solid mc('blue', '50');
margin-bottom: 1rem; margin-bottom: 1rem;
display: flex; display: flex;
justify-content: center; justify-content: center;
...@@ -58,16 +58,7 @@ ...@@ -58,16 +58,7 @@
i.icon-loader { i.icon-loader {
display: inline-block; display: inline-block;
color: mc('indigo', '500') color: mc('blue', '500')
}
i.ui-1_check-simple {
color: mc('green', '500')
}
i.ui-2_ban-bold {
color: mc('red', '500')
}
i.icon-warning-outline {
color: mc('orange', '500')
} }
.progress-bar { .progress-bar {
......
...@@ -38,6 +38,10 @@ ...@@ -38,6 +38,10 @@
box-shadow: inset 0 0 5px 0 mc('red', '100'); box-shadow: inset 0 0 5px 0 mc('red', '100');
} }
@include placeholder {
color: mc('grey', '400');
}
} }
&.is-fullwidth { &.is-fullwidth {
...@@ -48,6 +52,36 @@ ...@@ -48,6 +52,36 @@
} }
textarea {
background-color: #FFF;
display: flex;
padding: 6px 12px;
border: 1px solid mc('grey', '400');
border-radius: 3px;
font-family: $core-font-standard;
font-size: 14px;
color: mc('grey', '700');
transition: all .4s ease;
box-shadow: inset 0 0 5px 0 rgba(0,0,0,0.1);
min-height: 100px;
&:focus {
outline: none;
border-color: mc('light-blue', '500');
box-shadow: inset 0 0 5px 0 rgba(mc('light-blue', '500'), 0.3);
}
&:disabled {
background-color: mc('grey', '100');
}
&.is-dirty.is-invalid {
border-color: mc('red', '500');
box-shadow: inset 0 0 5px 0 mc('red', '100');
}
}
// =============================================================== // ===============================================================
// DROPDOWN // DROPDOWN
// =============================================================== // ===============================================================
......
...@@ -32,8 +32,8 @@ ...@@ -32,8 +32,8 @@
&.is-featured { &.is-featured {
border-top-left-radius: 4px; border-top-left-radius: 4px;
border-top-right-radius: 4px; border-top-right-radius: 4px;
background-color: mc('indigo', '400'); background-color: mc('blue', '700');
border-bottom-color: mc('indigo', '500'); border-bottom-color: mc('blue', '900');
color: #FFF; color: #FFF;
> i::before { > i::before {
......
...@@ -38,12 +38,12 @@ ...@@ -38,12 +38,12 @@
"dependencies": { "dependencies": {
"apollo-server-express": "1.2.0", "apollo-server-express": "1.2.0",
"auto-load": "3.0.0", "auto-load": "3.0.0",
"axios": "0.17.0", "axios": "0.17.1",
"bcryptjs-then": "1.0.1", "bcryptjs-then": "1.0.1",
"bluebird": "3.5.1", "bluebird": "3.5.1",
"body-parser": "1.18.2", "body-parser": "1.18.2",
"bugsnag": "2.0.1", "bugsnag": "2.0.1",
"bull": "3.3.5", "bull": "3.3.6",
"bunyan": "1.8.12", "bunyan": "1.8.12",
"cheerio": "1.0.0-rc.2", "cheerio": "1.0.0-rc.2",
"child-process-promise": "2.2.1", "child-process-promise": "2.2.1",
...@@ -65,9 +65,9 @@ ...@@ -65,9 +65,9 @@
"fs-extra": "4.0.2", "fs-extra": "4.0.2",
"git-wrapper2-promise": "0.2.9", "git-wrapper2-promise": "0.2.9",
"graphql": "0.11.7", "graphql": "0.11.7",
"graphql-tools": "2.6.1", "graphql-tools": "2.7.2",
"highlight.js": "9.12.0", "highlight.js": "9.12.0",
"i18next": "10.0.3", "i18next": "10.0.7",
"i18next-express-middleware": "1.0.7", "i18next-express-middleware": "1.0.7",
"i18next-localstorage-cache": "1.1.1", "i18next-localstorage-cache": "1.1.1",
"i18next-node-fs-backend": "1.0.0", "i18next-node-fs-backend": "1.0.0",
...@@ -90,8 +90,8 @@ ...@@ -90,8 +90,8 @@
"markdown-it-task-lists": "2.1.0", "markdown-it-task-lists": "2.1.0",
"mathjax-node": "1.2.1", "mathjax-node": "1.2.1",
"mime-types": "2.1.17", "mime-types": "2.1.17",
"moment": "2.19.1", "moment": "2.19.2",
"moment-timezone": "0.5.13", "moment-timezone": "0.5.14",
"mongodb": "2.2.33", "mongodb": "2.2.33",
"multer": "1.3.0", "multer": "1.3.0",
"node-2fa": "1.1.2", "node-2fa": "1.1.2",
...@@ -106,9 +106,9 @@ ...@@ -106,9 +106,9 @@
"passport-local": "1.0.0", "passport-local": "1.0.0",
"passport-slack": "0.0.7", "passport-slack": "0.0.7",
"passport-windowslive": "1.0.2", "passport-windowslive": "1.0.2",
"pg": "7.3.0", "pg": "7.4.0",
"pg-hstore": "2.3.2", "pg-hstore": "2.3.2",
"pg-promise": "7.0.3", "pg-promise": "7.3.1",
"pm2": "2.7.2", "pm2": "2.7.2",
"pug": "2.0.0-rc.4", "pug": "2.0.0-rc.4",
"qr-image": "3.2.0", "qr-image": "3.2.0",
...@@ -116,7 +116,7 @@ ...@@ -116,7 +116,7 @@
"remove-markdown": "0.2.2", "remove-markdown": "0.2.2",
"request": "2.83.0", "request": "2.83.0",
"semver": "5.4.1", "semver": "5.4.1",
"sequelize": "4.19.0", "sequelize": "4.22.6",
"serve-favicon": "2.4.5", "serve-favicon": "2.4.5",
"simplemde": "1.11.2", "simplemde": "1.11.2",
"stream-to-promise": "2.2.0", "stream-to-promise": "2.2.0",
...@@ -130,8 +130,8 @@ ...@@ -130,8 +130,8 @@
}, },
"devDependencies": { "devDependencies": {
"@glimpse/glimpse": "0.22.15", "@glimpse/glimpse": "0.22.15",
"@panter/vue-i18next": "0.8.0", "@panter/vue-i18next": "0.8.1",
"apollo-client-preset": "1.0.1", "apollo-client-preset": "1.0.2",
"autoprefixer": "7.1.6", "autoprefixer": "7.1.6",
"babel-cli": "6.26.0", "babel-cli": "6.26.0",
"babel-core": "6.26.0", "babel-core": "6.26.0",
...@@ -141,8 +141,8 @@ ...@@ -141,8 +141,8 @@
"babel-preset-stage-2": "6.24.1", "babel-preset-stage-2": "6.24.1",
"brace": "0.10.0", "brace": "0.10.0",
"colors": "1.1.2", "colors": "1.1.2",
"consolidate": "0.14.5", "consolidate": "0.15.0",
"eslint": "4.10.0", "eslint": "4.11.0",
"eslint-config-requarks": "1.0.7", "eslint-config-requarks": "1.0.7",
"eslint-config-standard": "10.2.1", "eslint-config-standard": "10.2.1",
"eslint-plugin-import": "2.8.0", "eslint-plugin-import": "2.8.0",
...@@ -150,31 +150,31 @@ ...@@ -150,31 +150,31 @@
"eslint-plugin-promise": "3.6.0", "eslint-plugin-promise": "3.6.0",
"eslint-plugin-standard": "3.0.1", "eslint-plugin-standard": "3.0.1",
"eslint-plugin-vue": "3.13.1", "eslint-plugin-vue": "3.13.1",
"fuse-box": "2.4.0", "fuse-box": "2.5.0-beta.1",
"graphql-tag": "^2.5.0", "graphql-tag": "^2.5.0",
"i18next-xhr-backend": "1.4.3", "i18next-xhr-backend": "1.5.0",
"jest": "21.2.1", "jest": "21.2.1",
"jest-junit": "3.1.0", "jest-junit": "3.1.0",
"js-cookie": "2.2.0", "js-cookie": "2.2.0",
"node-sass": "4.5.3", "node-sass": "4.6.1",
"nodemon": "1.12.1", "nodemon": "1.12.1",
"postcss-selector-parser": "3.1.0", "postcss-selector-parser": "3.1.1",
"pug-lint": "2.5.0", "pug-lint": "2.5.0",
"twemoji-awesome": "1.0.6", "twemoji-awesome": "1.0.6",
"typescript": "2.5.3", "typescript": "2.6.1",
"uglify-es": "3.1.5", "uglify-es": "3.1.9",
"vee-validate": "2.0.0-rc.19", "vee-validate": "2.0.0-rc.21",
"vue": "2.5.2", "vue": "2.5.3",
"vue-clipboards": "1.1.0", "vue-clipboards": "1.1.0",
"vue-hot-reload-api": "2.2.0", "vue-hot-reload-api": "2.2.3",
"vue-lodash": "1.0.4", "vue-lodash": "1.0.4",
"vue-material": "^0.8.1", "vue-material": "^0.8.1",
"vue-resource": "1.3.4", "vue-resource": "1.3.4",
"vue-simple-breakpoints": "1.0.3", "vue-simple-breakpoints": "1.0.3",
"vue-template-compiler": "2.5.2", "vue-template-compiler": "2.5.3",
"vue-template-es2015-compiler": "1.6.0", "vue-template-es2015-compiler": "1.6.0",
"vuex": "3.0.0", "vuex": "3.0.1",
"vuex-persistedstate": "2.0.0" "vuex-persistedstate": "2.3.2"
}, },
"jest": { "jest": {
"testResultsProcessor": "./node_modules/jest-junit", "testResultsProcessor": "./node_modules/jest-junit",
......
'use strict'
/* global wiki */ /* global wiki */
const fs = require('fs') const fs = require('fs')
...@@ -85,7 +83,8 @@ module.exports = { ...@@ -85,7 +83,8 @@ module.exports = {
wiki.logger.info('Database (PostgreSQL) connection: OK') wiki.logger.info('Database (PostgreSQL) connection: OK')
}).catch(err => { }).catch(err => {
wiki.logger.error('Failed to connect to PostgreSQL instance.') wiki.logger.error('Failed to connect to PostgreSQL instance.')
return err wiki.logger.error(err)
process.exit(1)
}) })
// Load DB Models // Load DB Models
......
...@@ -23,6 +23,10 @@ module.exports = { ...@@ -23,6 +23,10 @@ module.exports = {
red.on('ready', () => { red.on('ready', () => {
wiki.logger.info('Redis connection: OK') wiki.logger.info('Redis connection: OK')
}) })
red.on('error', () => {
wiki.logger.error('Failed to connect to Redis instance!')
process.exit(1)
})
return red return red
} else { } else {
wiki.logger.error('Invalid Redis configuration!') wiki.logger.error('Invalid Redis configuration!')
......
...@@ -81,7 +81,7 @@ block body ...@@ -81,7 +81,7 @@ block body
.panel-content.form-sections .panel-content.form-sections
section section
.is-logo .is-logo
svg.icons.is-64: use(xlink:href='#nc-butterfly') svg.icons.is-64: use(xlink:href='#nc-webpage-2-2')
h4 General Information h4 General Information
p.control.is-fullwidth p.control.is-fullwidth
label.label Site Title label.label Site Title
...@@ -111,6 +111,10 @@ block body ...@@ -111,6 +111,10 @@ block body
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')
label.label(for='ipt-public') Public Access label.label(for='ipt-public') Public Access
span.desc Should the site be accessible (read only) without login. span.desc Should the site be accessible (read only) without login.
p.control.is-fullwidth
input#ipt-selfregister(type='checkbox', v-model='conf.selfregister', data-vv-scope='general', name='ipt-selfregister')
label.label(for='ipt-selfregister') Allow Self-Registration
span.desc Can users create their own account to gain access?
section section
p.control.is-fullwidth p.control.is-fullwidth
label.label Local Server Repository Path label.label Local Server Repository Path
...@@ -141,7 +145,7 @@ block body ...@@ -141,7 +145,7 @@ 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.nc-icon-outline.ui-3_alert.animated.fadeOut.infinite] h3 The site will not be using HTTPS? #[svg.icons.is-20.is-outlined.animated.fadeOut.infinite: use(xlink:href='#nc-alert')]
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.
...@@ -182,8 +186,10 @@ block body ...@@ -182,8 +186,10 @@ block body
p.control.is-fullwidth p.control.is-fullwidth
label.label Authentication label.label Authentication
select(v-model='conf.gitAuthType') select(v-model='conf.gitAuthType')
option(value='ssh') SSH (recommended) option(value='ssh') SSH using Private Key file (recommended)
option(value='basic') Basic option(value='sshenv') SSH using Private Key in env. variable
option(value='sshdb') SSH using Private Key in database
option(value='basic') Basic Credentials
span.desc The authentication method used to connect to your remote Git repository. span.desc The authentication method used to connect to your remote Git repository.
p.control.is-fullwidth p.control.is-fullwidth
input#ipt-git-verify-ssl(type='checkbox', v-model='conf.gitAuthSSL') input#ipt-git-verify-ssl(type='checkbox', v-model='conf.gitAuthSSL')
...@@ -203,6 +209,16 @@ block body ...@@ -203,6 +209,16 @@ block body
label.label Private Key location label.label Private Key location
input(type='text', placeholder='e.g. /etc/wiki/keys/git.pem', v-model='conf.gitAuthSSHKey') input(type='text', placeholder='e.g. /etc/wiki/keys/git.pem', v-model='conf.gitAuthSSHKey')
span.desc The full path to the private key on disk. span.desc The full path to the private key on disk.
.column(v-show='conf.gitAuthType === "sshenv"')
p.control.is-fullwidth
label.label Private Key Environment Variable
input(type='text', placeholder='e.g. GIT_PRIVATE_KEY', v-model='conf.gitAuthSSHKeyEnv')
span.desc The environment variable containing the private key.
.column(v-show='conf.gitAuthType === "sshdb"')
p.control.is-fullwidth
label.label Private Key Contents
textarea(v-model='conf.gitAuthSSHKeyDB')
span.desc Paste the contents of the private key in the above field
section.columns section.columns
.column.is-one-third .column.is-one-third
p.control.is-fullwidth p.control.is-fullwidth
...@@ -227,9 +243,12 @@ block body ...@@ -227,9 +243,12 @@ block body
template(v-else-if='state === "gitcheck"') template(v-else-if='state === "gitcheck"')
.panel .panel
h2.panel-title.is-featured h2.panel-title.is-featured
span Git Repository Check span Wiki.js
i(v-if='loading') i(v-if='loading')
.panel-content.is-text .panel-content.is-text
.is-logo
img(src='svg/logo-git.svg', alt='Git Logo')
h4 Git Repository Check
p(v-if='loading') #[svg.icons.is-24.is-text: use(xlink:href='#nc-ms-dots')] Verifying Git repository settings... p(v-if='loading') #[svg.icons.is-24.is-text: use(xlink:href='#nc-ms-dots')] Verifying Git repository settings...
p(v-if='!loading && gitcheck.ok') p(v-if='!loading && gitcheck.ok')
ul ul
...@@ -251,9 +270,12 @@ block body ...@@ -251,9 +270,12 @@ block body
template(v-else-if='state === "admin"') template(v-else-if='state === "admin"')
.panel .panel
h2.panel-title.is-featured h2.panel-title.is-featured
span Administrator Account span Wiki.js
i(v-if='loading') i(v-if='loading')
.panel-content.is-text .panel-content.is-text
.is-logo
svg.icons.is-64: use(xlink:href='#nc-man-38')
h4 Administrator Account
p A root administrator account will be created for local authentication. From this account, you can create or authorize more users. p A root administrator account will be created for local authentication. From this account, you can create or authorize more users.
.panel-content.form-sections .panel-content.form-sections
section section
...@@ -284,9 +306,12 @@ block body ...@@ -284,9 +306,12 @@ block body
template(v-else-if='state === "upgrade"') template(v-else-if='state === "upgrade"')
.panel .panel
h2.panel-title.is-featured h2.panel-title.is-featured
span Upgrade from Wiki.js 1.x span Wiki.js
i(v-if='loading') i(v-if='loading')
.panel-content.is-text .panel-content.is-text
.is-logo
svg.icons.is-64: use(xlink:href='#nc-spaceship')
h4 Upgrade from Wiki.js 1.x
p Migrating from a Wiki.js 1.x installation is quick and simple. p Migrating from a Wiki.js 1.x installation is quick and simple.
.panel-content.form-sections .panel-content.form-sections
section section
...@@ -311,16 +336,19 @@ block body ...@@ -311,16 +336,19 @@ block body
template(v-else-if='state === "final"') template(v-else-if='state === "final"')
.panel .panel
h2.panel-title.is-featured h2.panel-title.is-featured
span Finalizing span Wiki.js
i(v-if='loading') i(v-if='loading')
.panel-content.is-text .panel-content.is-text
p(v-if='loading') #[i.icon-loader.animated.rotateIn.infinite] Finalizing your installation... .is-logo(v-if='loading')
p(v-if='!loading && final.ok') svg.icons.is-64: use(xlink:href='#nc-ms-dots')
i.icon-check h4 Finalizing your installation...
strong Wiki.js was configured successfully and is now ready for use. .is-logo(v-if='!loading && final.ok')
svg.icons.is-64: use(xlink:href='#nc-check-bold')
h4 All done!
p(v-if='!loading && final.ok'): strong Wiki.js was configured successfully and is now ready for use.
p(v-if='!loading && final.ok') p(v-if='!loading && final.ok')
| Click the <strong>Start</strong> button below to start the Wiki.js server. | Click the <strong>Start</strong> button below to start the Wiki.js server.
p(v-if='!loading && !final.ok') #[i.icon-square-cross] Error: {{ final.error }} p(v-if='!loading && !final.ok') #[svg.icons.is-18.is-text: use(xlink:href='#nc-square-remove-12')] Error: {{ final.error }}
.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='proceedToAdmin', v-bind:disabled='loading') Back button.button.is-small.is-light-blue.is-outlined(v-on:click='proceedToAdmin', v-bind:disabled='loading') Back
......
...@@ -41,7 +41,6 @@ if (dev) { ...@@ -41,7 +41,6 @@ if (dev) {
const ALIASES = { const ALIASES = {
'brace-ext-modelist': 'brace/ext/modelist.js', 'brace-ext-modelist': 'brace/ext/modelist.js',
'simplemde': 'simplemde/dist/simplemde.min.js', 'simplemde': 'simplemde/dist/simplemde.min.js',
'socket-io-client': 'socket.io-client/dist/socket.io.js',
'vue': (dev) ? 'vue/dist/vue.js' : 'vue/dist/vue.min.js', 'vue': (dev) ? 'vue/dist/vue.js' : 'vue/dist/vue.min.js',
'vue-lodash': 'vue-lodash/dist/vue-lodash.min.js', 'vue-lodash': 'vue-lodash/dist/vue-lodash.min.js',
'vue-resource': (dev) ? 'vue-resource/dist/vue-resource.js' : 'vue-resource/dist/vue-resource.es2015.js' 'vue-resource': (dev) ? 'vue-resource/dist/vue-resource.js' : 'vue-resource/dist/vue-resource.es2015.js'
...@@ -80,7 +79,11 @@ const scssChain = [ ...@@ -80,7 +79,11 @@ const scssChain = [
browsers: babelrc.presets[0][1].targets.browsers browsers: babelrc.presets[0][1].targets.browsers
}) })
]), ]),
fsbx.CSSPlugin() fsbx.CSSPlugin(dev ? {} : {
group: 'bundle.css',
outFile: './assets/css/bundle.css',
inject: false
})
] ]
globalTasks.then(() => { globalTasks.then(() => {
......
This diff was suppressed by a .gitattributes entry.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment