mirror of
https://github.com/Eugeny/tabby.git
synced 2025-06-24 05:19:57 +00:00
allow forcing ssh agent type
This commit is contained in:
parent
5a894ebfd3
commit
fce8565835
@ -10,7 +10,7 @@ import stripAnsi from 'strip-ansi'
|
|||||||
import socksv5 from 'socksv5'
|
import socksv5 from 'socksv5'
|
||||||
import { Injector, NgZone } from '@angular/core'
|
import { Injector, NgZone } from '@angular/core'
|
||||||
import { NgbModal } from '@ng-bootstrap/ng-bootstrap'
|
import { NgbModal } from '@ng-bootstrap/ng-bootstrap'
|
||||||
import { FileProvidersService, HostAppService, Logger, NotificationsService, Platform, PlatformService, wrapPromise } from 'terminus-core'
|
import { ConfigService, FileProvidersService, HostAppService, Logger, NotificationsService, Platform, PlatformService, wrapPromise } from 'terminus-core'
|
||||||
import { BaseSession } from 'terminus-terminal'
|
import { BaseSession } from 'terminus-terminal'
|
||||||
import { Server, Socket, createServer, createConnection } from 'net'
|
import { Server, Socket, createServer, createConnection } from 'net'
|
||||||
import { Client, ClientChannel, SFTPWrapper } from 'ssh2'
|
import { Client, ClientChannel, SFTPWrapper } from 'ssh2'
|
||||||
@ -281,6 +281,7 @@ export class SSHSession extends BaseSession {
|
|||||||
private notifications: NotificationsService
|
private notifications: NotificationsService
|
||||||
private zone: NgZone
|
private zone: NgZone
|
||||||
private fileProviders: FileProvidersService
|
private fileProviders: FileProvidersService
|
||||||
|
private config: ConfigService
|
||||||
|
|
||||||
constructor (
|
constructor (
|
||||||
injector: Injector,
|
injector: Injector,
|
||||||
@ -294,6 +295,7 @@ export class SSHSession extends BaseSession {
|
|||||||
this.notifications = injector.get(NotificationsService)
|
this.notifications = injector.get(NotificationsService)
|
||||||
this.zone = injector.get(NgZone)
|
this.zone = injector.get(NgZone)
|
||||||
this.fileProviders = injector.get(FileProvidersService)
|
this.fileProviders = injector.get(FileProvidersService)
|
||||||
|
this.config = injector.get(ConfigService)
|
||||||
|
|
||||||
this.scripts = connection.scripts ?? []
|
this.scripts = connection.scripts ?? []
|
||||||
this.destroyed$.subscribe(() => {
|
this.destroyed$.subscribe(() => {
|
||||||
@ -307,6 +309,7 @@ export class SSHSession extends BaseSession {
|
|||||||
|
|
||||||
async init (): Promise<void> {
|
async init (): Promise<void> {
|
||||||
if (this.hostApp.platform === Platform.Windows) {
|
if (this.hostApp.platform === Platform.Windows) {
|
||||||
|
if (this.config.store.ssh.agentType === 'auto') {
|
||||||
if (await fs.exists(WINDOWS_OPENSSH_AGENT_PIPE)) {
|
if (await fs.exists(WINDOWS_OPENSSH_AGENT_PIPE)) {
|
||||||
this.agentPath = WINDOWS_OPENSSH_AGENT_PIPE
|
this.agentPath = WINDOWS_OPENSSH_AGENT_PIPE
|
||||||
} else {
|
} else {
|
||||||
@ -314,6 +317,11 @@ export class SSHSession extends BaseSession {
|
|||||||
this.agentPath = 'pageant'
|
this.agentPath = 'pageant'
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
} else if (this.config.store.ssh.agentType === 'pageant') {
|
||||||
|
this.agentPath = 'pageant'
|
||||||
|
} else {
|
||||||
|
this.agentPath = this.config.store.ssh.agentPath || WINDOWS_OPENSSH_AGENT_PIPE
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
this.agentPath = process.env.SSH_AUTH_SOCK!
|
this.agentPath = process.env.SSH_AUTH_SOCK!
|
||||||
}
|
}
|
||||||
|
@ -64,10 +64,33 @@ h3.mt-5 Options
|
|||||||
.form-line(*ngIf='hostApp.platform === Platform.Windows')
|
.form-line(*ngIf='hostApp.platform === Platform.Windows')
|
||||||
.header
|
.header
|
||||||
.title WinSCP path
|
.title WinSCP path
|
||||||
.descriptions When WinSCP is detected, you can launch an SCP session from the context menu.
|
.description When WinSCP is detected, you can launch an SCP session from the context menu.
|
||||||
input.form-control(
|
input.form-control(
|
||||||
type='text',
|
type='text',
|
||||||
placeholder='Auto-detect',
|
placeholder='Auto-detect',
|
||||||
[(ngModel)]='config.store.ssh.winSCPPath',
|
[(ngModel)]='config.store.ssh.winSCPPath',
|
||||||
(ngModelChange)='config.save()',
|
(ngModelChange)='config.save()',
|
||||||
)
|
)
|
||||||
|
|
||||||
|
.form-line(*ngIf='hostApp.platform === Platform.Windows')
|
||||||
|
.header
|
||||||
|
.title Agent type
|
||||||
|
.description Forces a specific SSH agent connection type.
|
||||||
|
select.form-control(
|
||||||
|
[(ngModel)]='config.store.ssh.agentType',
|
||||||
|
(ngModelChange)='config.save()',
|
||||||
|
)
|
||||||
|
option(value='auto') Automatic
|
||||||
|
option(value='pageant') Pageant
|
||||||
|
option(value='pipe') Named pipe
|
||||||
|
|
||||||
|
.form-line(*ngIf='config.store.ssh.agentType === "pipe"')
|
||||||
|
.header
|
||||||
|
.title Agent pipe path
|
||||||
|
.description Sets the SSH agent's named pipe path.
|
||||||
|
input.form-control(
|
||||||
|
type='text',
|
||||||
|
placeholder='Default: \\\\.\\pipe\\openssh-ssh-agent',
|
||||||
|
[(ngModel)]='config.store.ssh.agentPath',
|
||||||
|
(ngModelChange)='config.save()',
|
||||||
|
)
|
||||||
|
@ -8,6 +8,8 @@ export class SSHConfigProvider extends ConfigProvider {
|
|||||||
recentConnections: [],
|
recentConnections: [],
|
||||||
warnOnClose: false,
|
warnOnClose: false,
|
||||||
winSCPPath: null,
|
winSCPPath: null,
|
||||||
|
agentType: 'auto',
|
||||||
|
agentPath: null,
|
||||||
},
|
},
|
||||||
hotkeys: {
|
hotkeys: {
|
||||||
ssh: [
|
ssh: [
|
||||||
|
Loading…
x
Reference in New Issue
Block a user