Skip to content

Commit

Permalink
fix: remove ssh port param for git module
Browse files Browse the repository at this point in the history
  • Loading branch information
NGPixel committed Apr 25, 2020
1 parent c15d1a4 commit b293147
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 21 deletions.
12 changes: 1 addition & 11 deletions client/components/admin/admin-utilities-importv1.vue
Original file line number Diff line number Diff line change
Expand Up @@ -44,22 +44,14 @@
hide-details
color='primary'
)
v-col(:cols='gitAuthMode === `ssh` ? 6 : 8')
v-col(cols='8')
v-text-field(
outlined
label='Repository URL'
:placeholder='(gitAuthMode === `ssh`) ? `e.g. [email protected]:orgname/repo.git` : `e.g. https://github.com/orgname/repo.git`'
hide-details
v-model='gitRepoUrl'
)
v-col(v-if='gitAuthMode === `ssh`', cols='2')
v-text-field(
label='Port'
placeholder='e.g. 22'
v-model='gitRepoPort'
outlined
hide-details
)
v-col(cols='4')
v-text-field(
label='Branch'
Expand Down Expand Up @@ -304,7 +296,6 @@ export default {
],
gitVerifySSL: true,
gitRepoUrl: '',
gitRepoPort: 22,
gitRepoBranch: 'master',
gitPrivKey: '',
gitUsername: '',
Expand Down Expand Up @@ -396,7 +387,6 @@ export default {
{ key: 'authType', value: { value: this.gitAuthMode } },
{ key: 'repoUrl', value: { value: this.gitRepoUrl } },
{ key: 'branch', value: { value: this.gitRepoBranch } },
{ key: 'sshPort', value: { value: this.gitRepoPort } },
{ key: 'sshPrivateKeyMode', value: { value: 'contents' } },
{ key: 'sshPrivateKeyPath', value: { value: '' } },
{ key: 'sshPrivateKeyContent', value: { value: this.gitPrivKey } },
Expand Down
6 changes: 0 additions & 6 deletions server/modules/storage/git/definition.yml
Original file line number Diff line number Diff line change
Expand Up @@ -93,12 +93,6 @@ props:
default: ''
hint: Optional - Absolute path to the Git binary, when not available in PATH. Leave empty to use the default PATH location (recommended).
order: 50
sshPort:
type: Number
title: SSH Port
default: 22
hint: Optional - SSH Authentication Only - Allows overriding ssh default port (22).
order: 60
actions:
- handler: syncUntracked
label: Add Untracked Changes
Expand Down
5 changes: 1 addition & 4 deletions server/modules/storage/git/storage.js
Original file line number Diff line number Diff line change
Expand Up @@ -77,10 +77,7 @@ module.exports = {
throw err
}
}
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}`)
await this.git.addConfig('core.sshCommand', `ssh -i "${this.config.sshPrivateKeyPath}" -o StrictHostKeyChecking=no`)
WIKI.logger.info('(STORAGE/GIT) Adding origin remote via SSH...')
await this.git.addRemote('origin', this.config.repoUrl)
break
Expand Down

0 comments on commit b293147

Please sign in to comment.