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
3b5c0a9b
Commit
3b5c0a9b
authored
Feb 11, 2017
by
NGPixel
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed SSH authentication + uploads folder check
parent
c6853a03
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
32 additions
and
17 deletions
+32
-17
CHANGELOG.md
CHANGELOG.md
+6
-0
data.yml
app/data.yml
+3
-5
config.sample.yml
config.sample.yml
+4
-6
git.js
libs/git.js
+18
-5
local.js
libs/local.js
+1
-1
No files found.
CHANGELOG.md
View file @
3b5c0a9b
...
@@ -3,6 +3,12 @@ All notable changes to this project will be documented in this file.
...
@@ -3,6 +3,12 @@ All notable changes to this project will be documented in this file.
This project adheres to
[
Semantic Versioning
](
http://semver.org/
)
.
This project adheres to
[
Semantic Versioning
](
http://semver.org/
)
.
## [Unreleased]
## [Unreleased]
### Fixed
-
Fixed folder name typo during uploads folder permissions check
-
Fixed SSH authentication for Git
### Changed
-
Removed separate OAuth authentication option. Select basic authentication to use tokens.
## [v1.0-beta.3] - 2017-02-10
## [v1.0-beta.3] - 2017-02-10
### Added
### Added
...
...
app/data.yml
View file @
3b5c0a9b
...
@@ -22,8 +22,8 @@ defaults:
...
@@ -22,8 +22,8 @@ defaults:
public
:
false
public
:
false
auth
:
auth
:
local
:
local
:
enabled
:
true
enabled
:
true
microsoft
:
microsoft
:
enabled
:
false
enabled
:
false
google
:
google
:
enabled
:
false
enabled
:
false
...
@@ -39,10 +39,9 @@ defaults:
...
@@ -39,10 +39,9 @@ defaults:
type
:
basic
type
:
basic
username
:
null
username
:
null
password
:
null
password
:
null
publicKey
:
null
privateKey
:
null
privateKey
:
null
sslVerify
:
true
sslVerify
:
true
signature
:
signature
:
name
:
Wiki
name
:
Wiki
email
:
wiki@example.com
email
:
wiki@example.com
# ---------------------------------
# ---------------------------------
\ No newline at end of file
config.sample.yml
View file @
3b5c0a9b
...
@@ -100,18 +100,17 @@ git:
...
@@ -100,18 +100,17 @@ git:
branch
:
master
branch
:
master
auth
:
auth
:
# Type: basic
, oauth
or ssh
# Type: basic or ssh
type
:
ssh
type
:
ssh
# Only for Basic authentication:
username
:
marty
username
:
marty
# Password, OAuth token or private key passphrase:
password
:
MartyMcFly88
password
:
MartyMcFly88
# Only for SSH authentication:
# Only for SSH authentication:
publicKey
:
/etc/wiki/keys/git.pem
privateKey
:
/etc/wiki/keys/git.pem
privateKey
:
/etc/wiki/keys/git.pem
sslVerify
:
true
sslVerify
:
true
signature
:
signature
:
name
:
Marty
name
:
Marty
email
:
marty@example.com
email
:
marty@example.com
\ No newline at end of file
libs/git.js
View file @
3b5c0a9b
...
@@ -89,19 +89,32 @@ module.exports = {
...
@@ -89,19 +89,32 @@ module.exports = {
// Initialize remote
// Initialize remote
let
urlObj
=
URL
.
parse
(
appconfig
.
git
.
url
)
let
urlObj
=
URL
.
parse
(
appconfig
.
git
.
url
)
urlObj
.
auth
=
appconfig
.
git
.
auth
.
username
+
((
appconfig
.
git
.
auth
.
type
!==
'ssh'
)
?
':'
+
appconfig
.
git
.
auth
.
password
:
''
)
if
(
appconfig
.
git
.
auth
.
type
!==
'ssh'
)
{
urlObj
.
auth
=
appconfig
.
git
.
auth
.
username
+
':'
+
appconfig
.
git
.
auth
.
password
}
self
.
_url
=
URL
.
format
(
urlObj
)
self
.
_url
=
URL
.
format
(
urlObj
)
let
gitConfigs
=
[
()
=>
{
return
self
.
_git
.
exec
(
'config'
,
[
'--local'
,
'user.name'
,
self
.
_signature
.
name
])
},
()
=>
{
return
self
.
_git
.
exec
(
'config'
,
[
'--local'
,
'user.email'
,
self
.
_signature
.
email
])
},
()
=>
{
return
self
.
_git
.
exec
(
'config'
,
[
'--local'
,
'--bool'
,
'http.sslVerify'
,
_
.
toString
(
appconfig
.
git
.
auth
.
sslVerify
)])
}
]
if
(
appconfig
.
git
.
auth
.
type
===
'ssh'
)
{
gitConfigs
.
push
(()
=>
{
return
self
.
_git
.
exec
(
'config'
,
[
'--local'
,
'core.sshCommand'
,
'ssh -i "'
+
appconfig
.
git
.
auth
.
privateKey
+
'" -o StrictHostKeyChecking=no'
])
})
}
return
self
.
_git
.
exec
(
'remote'
,
'show'
).
then
((
cProc
)
=>
{
return
self
.
_git
.
exec
(
'remote'
,
'show'
).
then
((
cProc
)
=>
{
let
out
=
cProc
.
stdout
.
toString
()
let
out
=
cProc
.
stdout
.
toString
()
if
(
_
.
includes
(
out
,
'origin'
))
{
if
(
_
.
includes
(
out
,
'origin'
))
{
return
true
return
true
}
else
{
}
else
{
return
Promise
.
join
(
return
Promise
.
each
(
gitConfigs
,
fn
=>
{
return
fn
()
}).
then
(()
=>
{
self
.
_git
.
exec
(
'config'
,
[
'--local'
,
'user.name'
,
self
.
_signature
.
name
]),
self
.
_git
.
exec
(
'config'
,
[
'--local'
,
'user.email'
,
self
.
_signature
.
email
])
).
then
(()
=>
{
return
self
.
_git
.
exec
(
'remote'
,
[
'add'
,
'origin'
,
self
.
_url
])
return
self
.
_git
.
exec
(
'remote'
,
[
'add'
,
'origin'
,
self
.
_url
])
}).
catch
(
err
=>
{
winston
.
error
(
err
)
})
})
}
}
})
})
...
...
libs/local.js
View file @
3b5c0a9b
...
@@ -114,7 +114,7 @@ module.exports = {
...
@@ -114,7 +114,7 @@ module.exports = {
fs
.
ensureDirSync
(
path
.
resolve
(
ROOTPATH
,
appconfig
.
paths
.
repo
,
'./uploads'
))
fs
.
ensureDirSync
(
path
.
resolve
(
ROOTPATH
,
appconfig
.
paths
.
repo
,
'./uploads'
))
if
(
os
.
type
()
!==
'Windows_NT'
)
{
if
(
os
.
type
()
!==
'Windows_NT'
)
{
fs
.
chmodSync
(
path
.
resolve
(
ROOTPATH
,
appconfig
.
paths
.
repo
,
'./upload'
),
'644'
)
fs
.
chmodSync
(
path
.
resolve
(
ROOTPATH
,
appconfig
.
paths
.
repo
,
'./upload
s
'
),
'644'
)
}
}
}
catch
(
err
)
{
}
catch
(
err
)
{
winston
.
error
(
err
)
winston
.
error
(
err
)
...
...
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