Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
后端镜像
Tabby
提交
168e6f17
T
Tabby
项目概览
后端镜像
/
Tabby
通知
37
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
T
Tabby
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
168e6f17
编写于
2月 09, 2019
作者:
E
Eugene Pankov
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
allow selecting ssh ciphers (fixes #645)
上级
a2c636fd
变更
8
展开全部
隐藏空白更改
内联
并排
Showing
8 changed file
with
81 addition
and
373 deletion
+81
-373
terminus-core/src/components/checkbox.component.scss
terminus-core/src/components/checkbox.component.scss
+4
-0
terminus-ssh/package.json
terminus-ssh/package.json
+2
-1
terminus-ssh/src/api.ts
terminus-ssh/src/api.ts
+9
-0
terminus-ssh/src/components/editConnectionModal.component.pug
...inus-ssh/src/components/editConnectionModal.component.pug
+21
-0
terminus-ssh/src/components/editConnectionModal.component.ts
terminus-ssh/src/components/editConnectionModal.component.ts
+42
-1
terminus-ssh/src/services/ssh.service.ts
terminus-ssh/src/services/ssh.service.ts
+1
-0
terminus-ssh/webpack.config.js
terminus-ssh/webpack.config.js
+1
-0
terminus-ssh/yarn.lock
terminus-ssh/yarn.lock
+1
-371
未找到文件。
terminus-core/src/components/checkbox.component.scss
浏览文件 @
168e6f17
...
...
@@ -20,6 +20,10 @@
flex-direction
:
row
;
align-items
:
center
;
.off
{
color
:
rgba
(
0
,
0
,
0
,
.5
);
}
.icon
{
position
:
relative
;
flex
:
none
;
...
...
terminus-ssh/package.json
浏览文件 @
168e6f17
...
...
@@ -40,6 +40,7 @@
"xkeychain"
:
"^0.0.6"
},
"dependencies"
:
{
"ssh2"
:
"^0.8.2"
"ssh2"
:
"^0.8.2"
,
"ssh2-streams"
:
"^0.4.2"
}
}
terminus-ssh/src/api.ts
浏览文件 @
168e6f17
...
...
@@ -7,6 +7,13 @@ export interface LoginScript {
optional
?:
boolean
}
export
enum
SSHAlgorithmType
{
HMAC
=
'
hmac
'
,
KEX
=
'
kex
'
,
CIPHER
=
'
cipher
'
,
HOSTKEY
=
'
serverHostKey
'
}
export
interface
SSHConnection
{
name
?:
string
host
:
string
...
...
@@ -19,6 +26,8 @@ export interface SSHConnection {
keepaliveInterval
?:
number
keepaliveCountMax
?:
number
readyTimeout
?:
number
algorithms
?:
{[
t
:
string
]:
string
[]}
}
export
class
SSHSession
extends
BaseSession
{
...
...
terminus-ssh/src/components/editConnectionModal.component.pug
浏览文件 @
168e6f17
...
...
@@ -85,6 +85,27 @@
placeholder='20000',
[(ngModel)]='connection.readyTimeout',
)
.form-group
label Ciphers
div(*ngFor='let alg of supportedAlgorithms.cipher')
checkbox([text]='alg', [(ngModel)]='algorithms.cipher[alg]')
.form-group
label Key exchange
div(*ngFor='let alg of supportedAlgorithms.kex')
checkbox([text]='alg', [(ngModel)]='algorithms.kex[alg]')
.form-group
label HMAC
div(*ngFor='let alg of supportedAlgorithms.hmac')
checkbox([text]='alg', [(ngModel)]='algorithms.hmac[alg]')
.form-group
label Host key
div(*ngFor='let alg of supportedAlgorithms.serverHostKey')
checkbox([text]='alg', [(ngModel)]='algorithms.serverHostKey[alg]')
ngb-tab(id='scripts')
ng-template(ngbTabTitle)
...
...
terminus-ssh/src/components/editConnectionModal.component.ts
浏览文件 @
168e6f17
...
...
@@ -2,7 +2,8 @@ import { Component } from '@angular/core'
import
{
NgbActiveModal
}
from
'
@ng-bootstrap/ng-bootstrap
'
import
{
ElectronService
,
HostAppService
}
from
'
terminus-core
'
import
{
PasswordStorageService
}
from
'
../services/passwordStorage.service
'
import
{
SSHConnection
,
LoginScript
}
from
'
../api
'
import
{
SSHConnection
,
LoginScript
,
SSHAlgorithmType
}
from
'
../api
'
import
{
ALGORITHMS
}
from
'
ssh2-streams/lib/constants
'
@
Component
({
template
:
require
(
'
./editConnectionModal.component.pug
'
),
...
...
@@ -12,6 +13,10 @@ export class EditConnectionModalComponent {
newScript
:
LoginScript
hasSavedPassword
:
boolean
supportedAlgorithms
:
{[
id
:
string
]:
string
[]}
=
{}
defaultAlgorithms
:
{[
id
:
string
]:
string
[]}
=
{}
algorithms
:
{[
id
:
string
]:
{[
a
:
string
]:
boolean
}}
=
{}
constructor
(
private
modalInstance
:
NgbActiveModal
,
private
electron
:
ElectronService
,
...
...
@@ -19,10 +24,41 @@ export class EditConnectionModalComponent {
private
passwordStorage
:
PasswordStorageService
,
)
{
this
.
newScript
=
{
expect
:
''
,
send
:
''
}
for
(
let
k
of
Object
.
values
(
SSHAlgorithmType
))
{
this
.
supportedAlgorithms
[
k
]
=
ALGORITHMS
[
{
[
SSHAlgorithmType
.
KEX
]:
'
SUPPORTED_KEX
'
,
[
SSHAlgorithmType
.
HOSTKEY
]:
'
SUPPORTED_SERVER_HOST_KEY
'
,
[
SSHAlgorithmType
.
CIPHER
]:
'
SUPPORTED_CIPHER
'
,
[
SSHAlgorithmType
.
HMAC
]:
'
SUPPORTED_HMAC
'
,
}[
k
]
]
this
.
defaultAlgorithms
[
k
]
=
ALGORITHMS
[
{
[
SSHAlgorithmType
.
KEX
]:
'
KEX
'
,
[
SSHAlgorithmType
.
HOSTKEY
]:
'
SERVER_HOST_KEY
'
,
[
SSHAlgorithmType
.
CIPHER
]:
'
CIPHER
'
,
[
SSHAlgorithmType
.
HMAC
]:
'
HMAC
'
,
}[
k
]
]
}
console
.
log
(
this
)
}
async
ngOnInit
()
{
this
.
hasSavedPassword
=
!!
(
await
this
.
passwordStorage
.
loadPassword
(
this
.
connection
))
this
.
connection
.
algorithms
=
this
.
connection
.
algorithms
||
{}
for
(
let
k
of
Object
.
values
(
SSHAlgorithmType
))
{
if
(
!
this
.
connection
.
algorithms
[
k
])
{
this
.
connection
.
algorithms
[
k
]
=
this
.
defaultAlgorithms
[
k
]
}
this
.
algorithms
[
k
]
=
{}
for
(
let
alg
of
this
.
connection
.
algorithms
[
k
])
{
this
.
algorithms
[
k
][
alg
]
=
true
}
}
}
clearSavedPassword
()
{
...
...
@@ -43,6 +79,11 @@ export class EditConnectionModalComponent {
}
save
()
{
for
(
let
k
of
Object
.
values
(
SSHAlgorithmType
))
{
this
.
connection
.
algorithms
[
k
]
=
Object
.
entries
(
this
.
algorithms
[
k
])
.
filter
(([
k
,
v
])
=>
!!
v
)
.
map
(([
k
,
v
])
=>
k
)
}
this
.
modalInstance
.
close
(
this
.
connection
)
}
...
...
terminus-ssh/src/services/ssh.service.ts
浏览文件 @
168e6f17
...
...
@@ -164,6 +164,7 @@ export class SSHService {
return
true
},
hostHash
:
'
sha256
'
as
any
,
algorithms
:
session
.
connection
.
algorithms
,
})
}
catch
(
e
)
{
this
.
toastr
.
error
(
e
.
message
)
...
...
terminus-ssh/webpack.config.js
浏览文件 @
168e6f17
...
...
@@ -44,6 +44,7 @@ module.exports = {
externals
:
[
'
fs
'
,
'
node-ssh
'
,
'
ssh2-streams
'
,
'
xkeychain
'
,
'
wincredmgr
'
,
'
path
'
,
...
...
terminus-ssh/yarn.lock
浏览文件 @
168e6f17
此差异已折叠。
点击以展开。
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录