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
8af92128
Commit
8af92128
authored
Feb 11, 2017
by
NGPixel
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added offline mode (no remote git sync)
parent
1d237296
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
18 additions
and
2 deletions
+18
-2
CHANGELOG.md
CHANGELOG.md
+2
-0
pages.js
controllers/pages.js
+1
-0
git.js
libs/git.js
+15
-2
No files found.
CHANGELOG.md
View file @
8af92128
...
...
@@ -3,6 +3,8 @@ All notable changes to this project will be documented in this file.
This project adheres to
[
Semantic Versioning
](
http://semver.org/
)
.
## [Unreleased]
### Added
-
Offline mode (no remote git sync) can now be enabled by setting
`git: false`
in config.yml
## [v1.0-beta.4] - 2017-02-11
### Fixed
...
...
controllers/pages.js
View file @
8af92128
...
...
@@ -186,6 +186,7 @@ router.get('/*', (req, res, next) => {
newpath
:
safePath
})
}
return
true
}).
catch
((
err
)
=>
{
res
.
render
(
'error'
,
{
message
:
err
.
message
,
...
...
libs/git.js
View file @
8af92128
...
...
@@ -51,8 +51,10 @@ module.exports = {
// Define signature
self
.
_signature
.
name
=
appconfig
.
git
.
signature
.
name
||
'Wiki'
self
.
_signature
.
email
=
appconfig
.
git
.
signature
.
email
||
'user@example.com'
if
(
appconfig
.
git
)
{
self
.
_signature
.
name
=
appconfig
.
git
.
signature
.
name
||
'Wiki'
self
.
_signature
.
email
=
appconfig
.
git
.
signature
.
email
||
'user@example.com'
}
return
self
},
...
...
@@ -86,6 +88,11 @@ module.exports = {
self
.
_repo
.
exists
=
false
})
}).
then
(()
=>
{
if
(
appconfig
.
git
===
false
)
{
winston
.
info
(
'['
+
PROCNAME
+
'][GIT] Remote syncing is disabled. Not recommended!'
)
return
Promise
.
resolve
(
true
)
}
// Initialize remote
let
urlObj
=
URL
.
parse
(
appconfig
.
git
.
url
)
...
...
@@ -144,6 +151,12 @@ module.exports = {
resync
()
{
let
self
=
this
// Is git remote disabled?
if
(
appconfig
.
git
===
false
)
{
return
Promise
.
resolve
(
true
)
}
// Fetch
winston
.
info
(
'['
+
PROCNAME
+
'][GIT] Performing pull from remote repository...'
)
...
...
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