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
f7ebccbb
Commit
f7ebccbb
authored
Jun 04, 2019
by
Nick
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: avoid setting db ssl unless explicitly provided
parent
a50bb2f2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
19 additions
and
2 deletions
+19
-2
data.yml
server/app/data.yml
+1
-0
db.js
server/core/db.js
+18
-2
No files found.
server/app/data.yml
View file @
f7ebccbb
...
@@ -14,6 +14,7 @@ defaults:
...
@@ -14,6 +14,7 @@ defaults:
user
:
wikijs
user
:
wikijs
pass
:
wikijsrocks
pass
:
wikijsrocks
db
:
wiki
db
:
wiki
ssl
:
false
storage
:
./db.sqlite
storage
:
./db.sqlite
ssl
:
ssl
:
enabled
:
false
enabled
:
false
...
...
server/core/db.js
View file @
f7ebccbb
...
@@ -29,18 +29,27 @@ module.exports = {
...
@@ -29,18 +29,27 @@ module.exports = {
user
:
WIKI
.
config
.
db
.
user
,
user
:
WIKI
.
config
.
db
.
user
,
password
:
WIKI
.
config
.
db
.
pass
,
password
:
WIKI
.
config
.
db
.
pass
,
database
:
WIKI
.
config
.
db
.
db
,
database
:
WIKI
.
config
.
db
.
db
,
port
:
WIKI
.
config
.
db
.
port
,
port
:
WIKI
.
config
.
db
.
port
ssl
:
!
_
.
isNil
(
WIKI
.
config
.
db
.
ssl
)
&&
WIKI
.
config
.
db
.
ssl
!==
false
}
}
const
dbUseSSL
=
(
WIKI
.
config
.
db
.
ssl
===
true
||
WIKI
.
config
.
db
.
ssl
===
'true'
||
WIKI
.
config
.
db
.
ssl
===
1
||
WIKI
.
config
.
db
.
ssl
===
'1'
)
switch
(
WIKI
.
config
.
db
.
type
)
{
switch
(
WIKI
.
config
.
db
.
type
)
{
case
'postgres'
:
case
'postgres'
:
dbClient
=
'pg'
dbClient
=
'pg'
if
(
dbUseSSL
&&
_
.
isPlainObject
(
dbConfig
))
{
dbConfig
.
ssl
=
true
}
break
break
case
'mariadb'
:
case
'mariadb'
:
case
'mysql'
:
case
'mysql'
:
dbClient
=
'mysql2'
dbClient
=
'mysql2'
if
(
dbUseSSL
&&
_
.
isPlainObject
(
dbConfig
))
{
dbConfig
.
ssl
=
true
}
// Fix mysql boolean handling...
// Fix mysql boolean handling...
dbConfig
.
typeCast
=
(
field
,
next
)
=>
{
dbConfig
.
typeCast
=
(
field
,
next
)
=>
{
if
(
field
.
type
===
'TINY'
&&
field
.
length
===
1
)
{
if
(
field
.
type
===
'TINY'
&&
field
.
length
===
1
)
{
...
@@ -52,6 +61,13 @@ module.exports = {
...
@@ -52,6 +61,13 @@ module.exports = {
break
break
case
'mssql'
:
case
'mssql'
:
dbClient
=
'mssql'
dbClient
=
'mssql'
if
(
_
.
isPlainObject
(
dbConfig
))
{
dbConfig
.
appName
=
'Wiki.js'
if
(
dbUseSSL
)
{
dbConfig
.
encrypt
=
true
}
}
break
break
case
'sqlite'
:
case
'sqlite'
:
dbClient
=
'sqlite3'
dbClient
=
'sqlite3'
...
...
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