Skip to content

Commit

Permalink
fix: git custom ssh port not handled
Browse files Browse the repository at this point in the history
  • Loading branch information
NGPixel committed Apr 21, 2020
1 parent 02816b6 commit 2213ba2
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion server/modules/storage/git/definition.yml
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ props:
type: Number
title: SSH Port
default: 22
hint: Optional - SSH Authentication Only - Allows overriding ssh default port.
hint: Optional - SSH Authentication Only - Allows overriding ssh default port (22).
order: 60
actions:
- handler: syncUntracked
Expand Down
2 changes: 1 addition & 1 deletion server/modules/storage/git/storage.js
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ module.exports = {
throw err
}
}
if (!this.config.sshPort || !_.isSafeInteger(this.config.sshPort) || this.config.sshPort <= 0) {
if (!this.config.sshPort || (_.isString(this.config.sshPort) && _.isEmpty(this.config.sshPort.length)) || (_.isSafeInteger(this.config.sshPort) && this.config.sshPort <= 0)) {
this.config.sshPort = 22
}
await this.git.addConfig('core.sshCommand', `ssh -i "${this.config.sshPrivateKeyPath}" -o StrictHostKeyChecking=no -p ${this.config.sshPort}`)
Expand Down

0 comments on commit 2213ba2

Please sign in to comment.