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
6fdea32a
Commit
6fdea32a
authored
Apr 07, 2017
by
NGPixel
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Install fixes
parent
9f9e75c9
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
22 additions
and
40 deletions
+22
-40
configure.js
configure.js
+1
-1
auth.js
libs/auth.js
+15
-39
install.js
npm/install.js
+6
-0
No files found.
configure.js
View file @
6fdea32a
...
...
@@ -91,7 +91,7 @@ module.exports = (port, spinner) => {
reject
(
new
Error
(
'Git is not installed or not reachable from PATH.'
))
}
let
gitver
=
_
.
chain
(
stdout
.
replace
(
/
[^\d
.
]
/g
,
''
)).
split
(
'.'
).
take
(
3
).
join
(
'.'
).
value
()
if
(
!
semver
.
satisfies
(
semver
.
clean
(
gitver
),
'>=2.
11.0
'
))
{
if
(
!
semver
.
satisfies
(
semver
.
clean
(
gitver
),
'>=2.
7.4
'
))
{
reject
(
new
Error
(
'Git version is too old. Minimum is v2.7.4.'
))
}
resolve
(
'Git v'
+
gitver
+
' detected. Minimum is v2.7.4.'
)
...
...
libs/auth.js
View file @
6fdea32a
...
...
@@ -192,47 +192,23 @@ module.exports = function (passport) {
db
.
onReady
.
then
(()
=>
{
db
.
User
.
findOne
({
provider
:
'local'
,
email
:
'guest'
}).
then
((
c
)
=>
{
if
(
c
<
1
)
{
// Create root admin account
winston
.
info
(
'[AUTH] No administrator account found. Creating a new one...'
)
db
.
User
.
hashPassword
(
'admin123'
).
then
((
pwd
)
=>
{
return
db
.
User
.
create
({
provider
:
'local'
,
email
:
appconfig
.
admin
,
name
:
'Administrator'
,
password
:
pwd
,
rights
:
[{
role
:
'admin'
,
path
:
'/'
,
exact
:
false
,
deny
:
false
}]
})
// Create guest account
return
db
.
User
.
create
({
provider
:
'local'
,
email
:
'guest'
,
name
:
'Guest'
,
password
:
''
,
rights
:
[{
role
:
'read'
,
path
:
'/'
,
exact
:
false
,
deny
:
!
appconfig
.
public
}]
}).
then
(()
=>
{
winston
.
info
(
'[AUTH] Administrator account created successfully!'
)
}).
then
(()
=>
{
if
(
appdata
.
capabilities
.
guest
)
{
// Create guest account
return
db
.
User
.
create
({
provider
:
'local'
,
email
:
'guest'
,
name
:
'Guest'
,
password
:
''
,
rights
:
[{
role
:
'read'
,
path
:
'/'
,
exact
:
false
,
deny
:
!
appconfig
.
public
}]
}).
then
(()
=>
{
winston
.
info
(
'[AUTH] Guest account created successfully!'
)
})
}
else
{
return
true
}
winston
.
info
(
'[AUTH] Guest account created successfully!'
)
}).
catch
((
err
)
=>
{
winston
.
error
(
'[AUTH] An error occured while creating
administrator/
guest account:'
)
winston
.
error
(
'[AUTH] An error occured while creating guest account:'
)
winston
.
error
(
err
)
})
}
...
...
npm/install.js
View file @
6fdea32a
...
...
@@ -11,6 +11,7 @@ const zlib = require('zlib')
const
inquirer
=
require
(
'inquirer'
)
const
colors
=
require
(
'colors/safe'
)
const
_
=
require
(
'lodash'
)
const
os
=
require
(
'os'
)
let
installDir
=
path
.
resolve
(
__dirname
,
'../..'
)
...
...
@@ -33,6 +34,11 @@ pm2.connectAsync().then(() => {
return
true
})
}).
then
(()
=>
{
if
(
os
.
totalmem
()
<
1024
*
1024
*
768
)
{
throw
new
Error
(
'Not enough memory to install dependencies. Minimum is 768 MB.'
)
}
return
true
}).
then
(()
=>
{
/**
* Fetch version from npm package
*/
...
...
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