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
59ce39f0
Commit
59ce39f0
authored
May 14, 2017
by
NGPixel
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: config env vars parsing
parent
20ef07be
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
6 additions
and
16 deletions
+6
-16
config.heroku.yml
npm/configs/config.heroku.yml
+1
-1
package.json
npm/package.json
+1
-1
config.js
server/helpers/config.js
+1
-1
config.js
server/libs/config.js
+3
-13
No files found.
npm/configs/config.heroku.yml
View file @
59ce39f0
...
...
@@ -103,7 +103,7 @@ sessionSecret: 1234567890abcdefghijklmnopqrstuvxyz
# Database Connection String
# ---------------------------------------------------------------------
db
:
$(MONGO_URI)
db
:
$(MONGO
DB
_URI)
# ---------------------------------------------------------------------
# Git Connection Info
...
...
npm/package.json
View file @
59ce39f0
{
"name"
:
"wiki.js"
,
"version"
:
"1.0.0-beta.12"
,
"version"
:
"1.0.0-beta.12
.1
"
,
"description"
:
"A modern, lightweight and powerful wiki app built on NodeJS, Git and Markdown"
,
"main"
:
"install.js"
,
"scripts"
:
{
...
...
server/helpers/config.js
View file @
59ce39f0
...
...
@@ -12,7 +12,7 @@ module.exports = {
parseConfigValue
(
cfg
)
{
return
_
.
replace
(
cfg
,
(
/
\$\(
[
A-Z0-9_
]
+
\)
/g
,
(
/
\$\(
([
A-Z0-9_
]
+
)
\)
/g
,
(
m
)
=>
{
return
process
.
env
[
m
]
})
)
}
...
...
server/libs/config.js
View file @
59ce39f0
...
...
@@ -4,15 +4,7 @@ const fs = require('fs')
const
yaml
=
require
(
'js-yaml'
)
const
_
=
require
(
'lodash'
)
const
path
=
require
(
'path'
)
const
deepMap
=
(
obj
,
iterator
,
context
)
=>
{
return
_
.
transform
(
obj
,
(
result
,
val
,
key
)
=>
{
result
[
key
]
=
_
.
isObject
(
val
)
?
deepMap
(
val
,
iterator
,
context
)
:
iterator
.
call
(
context
,
val
,
key
,
obj
)
})
}
_
.
mixin
({
deepMap
})
const
cfgHelper
=
require
(
'../helpers/config'
)
/**
* Load Application Configuration
...
...
@@ -32,10 +24,8 @@ module.exports = (confPaths) => {
try
{
appconfig
=
yaml
.
safeLoad
(
_
.
replace
(
fs
.
readFileSync
(
confPaths
.
config
,
'utf8'
),
(
/
\$\([
A-Z0-9_
]
+
\)
/g
,
(
m
)
=>
{
return
process
.
env
[
m
]
})
cfgHelper
.
parseConfigValue
(
fs
.
readFileSync
(
confPaths
.
config
,
'utf8'
)
)
)
appdata
=
yaml
.
safeLoad
(
fs
.
readFileSync
(
confPaths
.
data
,
'utf8'
))
...
...
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