Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wiki-js
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
1
Issues
1
List
Board
Labels
Milestones
Merge Requests
1
Merge Requests
1
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Jacklull
wiki-js
Commits
2668dde7
Commit
2668dde7
authored
Nov 20, 2017
by
NGPixel
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: upgradeFromMongo (wip) + panel UI improvements
parent
82ea0b50
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
59 additions
and
120 deletions
+59
-120
config-manager.component.js
client/js/components/config-manager.component.js
+1
-2
panel.scss
client/scss/components/panel.scss
+6
-0
data.yml
server/app/data.yml
+2
-0
configure.js
server/configure.js
+26
-11
system.js
server/modules/system.js
+22
-8
index.pug
server/views/configure/index.pug
+0
-5
fuse.js
tools/fuse.js
+2
-2
wercker.yml
wercker.yml
+0
-92
No files found.
client/js/components/config-manager.component.js
View file @
2668dde7
...
...
@@ -51,8 +51,7 @@ export default {
telemetry
:
true
,
title
:
siteConfig
.
title
||
'Wiki'
,
upgrade
:
false
,
upgMongo
:
'mongodb://'
,
upgUserGroups
:
false
upgMongo
:
'mongodb://'
},
considerations
:
{
https
:
false
,
...
...
client/scss/components/panel.scss
View file @
2668dde7
...
...
@@ -33,7 +33,9 @@
border-top-left-radius
:
4px
;
border-top-right-radius
:
4px
;
background-color
:
mc
(
'blue'
,
'700'
);
background-image
:
linear-gradient
(
to
bottom
,
mc
(
'blue'
,
'700'
)
0%
,
mc
(
'blue'
,
'800'
)
100%
);
border-bottom-color
:
mc
(
'blue'
,
'900'
);
box-shadow
:
inset
0
0
0
1px
mc
(
'blue'
,
'600'
)
,
inset
0
0
0px
2px
rgba
(
mc
(
'blue'
,
'800'
)
,
.5
);
color
:
#FFF
;
>
i
:
:
before
{
...
...
@@ -42,6 +44,10 @@
}
&
+
.panel-content
{
box-shadow
:
inset
0
0
0
1px
#FFF
,
inset
0
30px
80px
-25px
mc
(
'blue'
,
'100'
);
}
>
span
{
font-weight
:
500
;
}
...
...
server/app/data.yml
View file @
2668dde7
...
...
@@ -108,4 +108,6 @@ langs:
-
id
:
es
name
:
Spanish - Español
rtlLangs
:
-
fa
# ---------------------------------
server/configure.js
View file @
2668dde7
...
...
@@ -20,7 +20,7 @@ module.exports = () => {
const
favicon
=
require
(
'serve-favicon'
)
const
http
=
require
(
'http'
)
const
Promise
=
require
(
'bluebird'
)
const
fs
=
require
(
'fs-extra'
)
const
fs
=
Promise
.
promisifyAll
(
require
(
'fs-extra'
)
)
const
yaml
=
require
(
'js-yaml'
)
const
_
=
require
(
'lodash'
)
const
cfgHelper
=
require
(
'./helpers/config'
)
...
...
@@ -236,22 +236,37 @@ module.exports = () => {
})
}
//
Load configuration
file
let
confRaw
=
await
fs
.
readFile
(
path
.
join
(
wiki
.
ROOTPATH
,
'config.yml'
),
'utf8'
)
//
Update config
file
let
confRaw
=
await
fs
.
readFile
Async
(
path
.
join
(
wiki
.
ROOTPATH
,
'config.yml'
),
'utf8'
)
let
conf
=
yaml
.
safeLoad
(
confRaw
)
// Update config
conf
.
host
=
req
.
body
.
host
conf
.
port
=
req
.
body
.
port
conf
.
paths
.
repo
=
req
.
body
.
pathRepo
// Generate session secret
let
sessionSecret
=
(
await
crypto
.
randomBytesAsync
(
32
)).
toString
(
'hex'
)
console
.
info
(
sessionSecret
)
// Save updated config to file
confRaw
=
yaml
.
safeDump
(
conf
)
await
fs
.
writeFile
(
path
.
join
(
wiki
.
ROOTPATH
,
'config.yml'
),
confRaw
)
await
fs
.
writeFileAsync
(
path
.
join
(
wiki
.
ROOTPATH
,
'config.yml'
),
confRaw
)
// Populate config namespaces
wiki
.
config
.
auth
=
wiki
.
config
.
auth
||
{}
wiki
.
config
.
features
=
wiki
.
config
.
features
||
{}
wiki
.
config
.
git
=
wiki
.
config
.
git
||
{}
wiki
.
config
.
logging
=
wiki
.
config
.
logging
||
{}
wiki
.
config
.
site
=
wiki
.
config
.
site
||
{}
wiki
.
config
.
theme
=
wiki
.
config
.
theme
||
{}
wiki
.
config
.
uploads
=
wiki
.
config
.
uploads
||
{}
// Site namespace
wiki
.
config
.
site
.
title
=
req
.
body
.
title
wiki
.
config
.
site
.
path
=
req
.
body
.
path
wiki
.
config
.
site
.
lang
=
req
.
body
.
lang
wiki
.
config
.
site
.
rtl
=
_
.
includes
(
wiki
.
data
.
rtlLangs
,
req
.
body
.
lang
)
wiki
.
config
.
site
.
sessionSecret
=
(
await
crypto
.
randomBytesAsync
(
32
)).
toString
(
'hex'
)
// Auth namespace
wiki
.
config
.
auth
.
public
=
(
req
.
body
.
public
===
'true'
)
// Logging namespace
wiki
.
config
.
logging
.
telemetry
=
(
req
.
body
.
telemetry
===
'true'
)
res
.
json
({
ok
:
true
})
}
catch
(
err
)
{
...
...
server/modules/system.js
View file @
2668dde7
...
...
@@ -2,7 +2,7 @@
const
Promise
=
require
(
'bluebird'
)
// const pm2 = Promise.promisifyAll(require('pm2'))
//
const _ = require('lodash')
const
_
=
require
(
'lodash'
)
const
cfgHelper
=
require
(
'../helpers/config'
)
module
.
exports
=
{
...
...
@@ -20,7 +20,7 @@ module.exports = {
return
new
Promise
((
resolve
,
reject
)
=>
{
// Connect to MongoDB
return
mongo
.
connect
(
parsedMongoConStr
,
{
mongo
.
connect
(
parsedMongoConStr
,
{
autoReconnect
:
false
,
reconnectTries
:
2
,
reconnectInterval
:
1000
,
...
...
@@ -34,19 +34,33 @@ module.exports = {
// Check if users table is populated
let
userCount
=
await
users
.
count
()
if
(
userCount
<
1
)
{
throw
new
Error
(
'
Users table is empty or invalid
!'
)
if
(
userCount
<
2
)
{
throw
new
Error
(
'
MongoDB Upgrade: Users table is empty
!'
)
}
// Fetch all users
let
userData
=
await
users
.
find
({}).
toArray
()
console
.
info
(
userData
)
// Import all users
let
userData
=
await
users
.
find
({
email
:
{
$not
:
'guest'
}
}).
toArray
()
await
wiki
.
db
.
User
.
bulkCreate
(
_
.
map
(
userData
,
usr
=>
{
return
{
email
:
usr
.
email
,
name
:
usr
.
name
||
'Imported User'
,
password
:
usr
.
password
||
''
,
provider
:
usr
.
provider
||
'local'
,
providerId
:
usr
.
providerId
||
''
,
role
:
'user'
,
createdAt
:
usr
.
createdAt
}
}))
resolve
(
true
)
}
catch
(
err
)
{
reject
(
err
)
db
.
close
()
}
db
.
close
()
})
})
}
...
...
server/views/configure/index.pug
View file @
2668dde7
...
...
@@ -319,11 +319,6 @@ block body
label.label Connection String to Wiki.js 1.x MongoDB database
input(type='text', placeholder='mongodb://', v-model='conf.upgMongo', data-vv-scope='upgrade', name='ipt-mongo', v-validate='{ required: true, min: 2 }')
span.desc A MongoDB database connection string where a Wiki.js 1.x installation is located. #[strong No alterations will be made to this database. ]
section
p.control.is-fullwidth
input#ipt-public(type='checkbox', v-model='conf.upgUserGroups', data-vv-scope='upgrade', name='ipt-public')
label.label(for='ipt-public') Create groups based on individual permissions
span.desc User groups will be created based on existing users permissions. If multiple users have the exact same permission rules, they will be put in the same user group.
.panel-footer
.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
...
...
tools/fuse.js
View file @
2668dde7
...
...
@@ -29,9 +29,9 @@ const args = require('yargs')
const
dev
=
args
.
dev
if
(
dev
)
{
console
.
info
(
colors
.
bgWhite
.
black
(
' Starting
Fuse
in DEVELOPER mode... '
))
console
.
info
(
colors
.
bgWhite
.
black
(
' Starting
Wiki.js
in DEVELOPER mode... '
))
}
else
{
console
.
info
(
colors
.
bgWhite
.
black
(
' Starting
Fuse
in BUILD mode... '
))
console
.
info
(
colors
.
bgWhite
.
black
(
' Starting
Wiki.js
in BUILD mode... '
))
}
// -------------------------------------------------------
...
...
wercker.yml
deleted
100644 → 0
View file @
82ea0b50
build
:
box
:
node:8
steps
:
-
script
:
name
:
install dependencies
code
:
|
apt-get update
apt-get install build-essential -y
npm install -g yarn
-
script
:
name
:
yarn install
code
:
|
yarn config set cache-folder "$WERCKER_CACHE_DIR/yarn"
yarn install
-
script
:
name
:
build
code
:
yarn run build
-
npm-test
-
script
:
name
:
purge dev files
code
:
|
yarn install --production --ignore-scripts --prefer-offline
deploy-docker-master
:
box
:
node:8-alpine
steps
:
-
script
:
name
:
install dependencies
code
:
|
apk update
apk add bash curl git openssh
-
script
:
name
:
copy app files
code
:
|
mkdir -p /var/wiki
cp -LR assets node_modules server config.sample.yml package.json LICENSE /var/wiki
rm -rf /pipeline
-
internal/docker-push
:
username
:
$DOCKER_HUB_USERNAME
password
:
$DOCKER_HUB_PASSWORD
tag
:
latest, master
ports
:
"
3000"
working-dir
:
/var/wiki
entrypoint
:
node server
env
:
"
WIKI_JS_HEROKU=1"
repository
:
requarks/wiki
registry
:
https://registry.hub.docker.com
deploy-docker-dev
:
box
:
node:8-alpine
steps
:
-
script
:
name
:
install dependencies
code
:
|
apk update
apk add bash curl git openssh
-
script
:
name
:
copy app files
code
:
|
mkdir -p /var/wiki
cp -LR assets node_modules server config.sample.yml package.json LICENSE /var/wiki
rm -rf /pipeline
-
internal/docker-push
:
username
:
$DOCKER_HUB_USERNAME
password
:
$DOCKER_HUB_PASSWORD
tag
:
dev
ports
:
"
3000"
working-dir
:
/var/wiki
entrypoint
:
node server
repository
:
requarks/wiki
registry
:
https://registry.hub.docker.com
deploy-github
:
box
:
node:8
steps
:
-
script
:
name
:
package
code
:
|
tar -chzf wiki-js.tar.gz assets server config.sample.yml package.json wiki.js LICENSE
tar -chzf node_modules.tar.gz node_modules
SEMVER_NEXT=`curl --request POST --url https://beta.requarks.io/api/version/increment --header "authorization: $WIKIJSORG_TOKEN" --header 'cache-control: no-cache' --header 'content-type: application/json' --data '{"channel": "stable"}'`
-
github-create-release
:
token
:
$GITHUB_TOKEN
tag
:
"
v${SEMVER_NEXT}"
prerelease
:
true
title
:
"
$SEMVER_NEXT
Release"
-
github-upload-asset
:
token
:
$GITHUB_TOKEN
file
:
wiki-js.tar.gz
-
github-upload-asset
:
token
:
$GITHUB_TOKEN
file
:
node_modules.tar.gz
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment