未验证 提交 ae3870e2 编写于 作者: E Eugene 提交者: GitHub

Merge pull request #2601 from JonathanBeverley/jmb/features

...@@ -28,3 +28,5 @@ docs/api ...@@ -28,3 +28,5 @@ docs/api
.electron-symbols .electron-symbols
sentry.properties sentry.properties
sentry-symbols.js sentry-symbols.js
terminus-ssh/util/pagent.exe
...@@ -9,10 +9,12 @@ ...@@ -9,10 +9,12 @@
"typings": "typings/index.d.ts", "typings": "typings/index.d.ts",
"scripts": { "scripts": {
"build": "webpack --progress --color", "build": "webpack --progress --color",
"watch": "webpack --progress --color --watch" "watch": "webpack --progress --color --watch",
"postinstall": "xcopy /i node_modules\\ssh2\\util\\pagent.exe util\\"
}, },
"files": [ "files": [
"dist" "dist",
"util/pagent.exe"
], ],
"author": "Eugene Pankov", "author": "Eugene Pankov",
"license": "MIT", "license": "MIT",
......
...@@ -36,6 +36,7 @@ export interface SSHConnection { ...@@ -36,6 +36,7 @@ export interface SSHConnection {
skipBanner?: boolean skipBanner?: boolean
disableDynamicTitle?: boolean disableDynamicTitle?: boolean
jumpHost?: string jumpHost?: string
agentForward?: boolean
algorithms?: {[t: string]: string[]} algorithms?: {[t: string]: string[]}
} }
......
...@@ -83,6 +83,11 @@ ...@@ -83,6 +83,11 @@
.title X11 forwarding .title X11 forwarding
toggle([(ngModel)]='connection.x11') toggle([(ngModel)]='connection.x11')
.form-line
.header
.title Allow Agent Forwarding
toggle([(ngModel)]='connection.agentForward')
.form-line .form-line
.header .header
.title Tab color .title Tab color
......
...@@ -16,10 +16,6 @@ import { PromptModalComponent } from '../components/promptModal.component' ...@@ -16,10 +16,6 @@ import { PromptModalComponent } from '../components/promptModal.component'
import { PasswordStorageService } from './passwordStorage.service' import { PasswordStorageService } from './passwordStorage.service'
import { SSHTabComponent } from '../components/sshTab.component' import { SSHTabComponent } from '../components/sshTab.component'
try {
var windowsProcessTreeNative = require('windows-process-tree/build/Release/windows_process_tree.node') // eslint-disable-line @typescript-eslint/no-var-requires, no-var
} catch { }
@Injectable({ providedIn: 'root' }) @Injectable({ providedIn: 'root' })
export class SSHService { export class SSHService {
private logger: Logger private logger: Logger
...@@ -187,14 +183,7 @@ export class SSHService { ...@@ -187,14 +183,7 @@ export class SSHService {
let agent: string|null = null let agent: string|null = null
if (this.hostApp.platform === Platform.Windows) { if (this.hostApp.platform === Platform.Windows) {
const pageantRunning = new Promise<boolean>(resolve => { agent = 'pageant'
windowsProcessTreeNative.getProcessList(list => { // eslint-disable-line block-scoped-var
resolve(list.some(x => x.name === 'pageant.exe'))
}, 0)
})
if (await pageantRunning) {
agent = 'pageant'
}
} else { } else {
agent = process.env.SSH_AUTH_SOCK as string agent = process.env.SSH_AUTH_SOCK as string
} }
...@@ -208,7 +197,7 @@ export class SSHService { ...@@ -208,7 +197,7 @@ export class SSHService {
privateKey: privateKey || undefined, privateKey: privateKey || undefined,
tryKeyboard: true, tryKeyboard: true,
agent: agent || undefined, agent: agent || undefined,
agentForward: !!agent, agentForward: session.connection.agentForward && !!agent,
keepaliveInterval: session.connection.keepaliveInterval, keepaliveInterval: session.connection.keepaliveInterval,
keepaliveCountMax: session.connection.keepaliveCountMax, keepaliveCountMax: session.connection.keepaliveCountMax,
readyTimeout: session.connection.readyTimeout, readyTimeout: session.connection.readyTimeout,
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册