Browse Source

Merge branch 'master' of github.com:Eugeny/tabby

Eugene 5 months ago
parent
commit
ef59394b79

+ 6 - 0
tabby-ssh/src/algorithms.ts

@@ -6,6 +6,7 @@ export const supportedAlgorithms = {
     [SSHAlgorithmType.HOSTKEY]: russh.getSupportedKeyTypes().filter(x => x !== 'none'),
     [SSHAlgorithmType.CIPHER]: russh.getSupportedCiphers().filter(x => x !== 'clear'),
     [SSHAlgorithmType.HMAC]: russh.getSupportedMACs().filter(x => x !== 'none'),
+    [SSHAlgorithmType.COMPRESSION]: russh.getSupportedCompressionAlgorithms().reverse(),
 }
 
 export const defaultAlgorithms = {
@@ -42,4 +43,9 @@ export const defaultAlgorithms = {
         '[email protected]',
         'hmac-sha1',
     ],
+    [SSHAlgorithmType.COMPRESSION]: [
+        '[email protected]',
+        'zlib',
+        'none',
+    ],
 }

+ 2 - 0
tabby-ssh/src/api/interfaces.ts

@@ -5,6 +5,8 @@ export enum SSHAlgorithmType {
     KEX = 'kex',
     CIPHER = 'cipher',
     HOSTKEY = 'serverHostKey',
+    COMPRESSION = 'compression',
+
 }
 
 export interface SSHProfile extends ConnectableTerminalProfile {

+ 7 - 1
tabby-ssh/src/components/sshProfileSettings.component.pug

@@ -285,7 +285,13 @@ ul.nav-tabs(ngbNav, #nav='ngbNav')
                 .w-75
                     div(*ngFor='let alg of supportedAlgorithms.serverHostKey')
                         checkbox([text]='alg', [(ngModel)]='algorithms.serverHostKey[alg]')
-
+                        
+            .form-line.align-items-start
+                .header
+                    .title Compression
+                .w-75
+                    div(*ngFor='let alg of supportedAlgorithms.compression')
+                        checkbox([text]='alg', [(ngModel)]='algorithms.compression[alg]')
     li(ngbNavItem)
         a(ngbNavLink, translate) Colors
         ng-template(ngbNavContent)

+ 1 - 1
tabby-ssh/src/components/sshProfileSettings.component.ts

@@ -107,7 +107,7 @@ export class SSHProfileSettingsComponent {
             this.profile.options.algorithms![k] = Object.entries(this.algorithms[k])
                 .filter(([_, v]) => !!v)
                 .map(([key, _]) => key)
-            this.profile.options.algorithms![k].sort()
+            if(k !== SSHAlgorithmType.COMPRESSION) { this.profile.options.algorithms![k].sort() }
         }
 
         if (this.connectionMode !== 'jumpHost') {

+ 1 - 1
tabby-ssh/src/profiles.ts

@@ -55,7 +55,7 @@ export class SSHProfilesService extends QuickConnectProfileProvider<SSHProfile>
         super()
         for (const k of Object.values(SSHAlgorithmType)) {
             this.configDefaults.options.algorithms[k] = [...defaultAlgorithms[k]]
-            this.configDefaults.options.algorithms[k].sort()
+            if (k !== SSHAlgorithmType.COMPRESSION) { this.configDefaults.options.algorithms[k].sort() }
         }
     }
 

+ 1 - 0
tabby-ssh/src/session/ssh.ts

@@ -315,6 +315,7 @@ export class SSHSession {
                     kex: this.profile.options.algorithms?.[SSHAlgorithmType.KEX]?.filter(x => supportedAlgorithms[SSHAlgorithmType.KEX].includes(x)),
                     mac: this.profile.options.algorithms?.[SSHAlgorithmType.HMAC]?.filter(x => supportedAlgorithms[SSHAlgorithmType.HMAC].includes(x)),
                     key: this.profile.options.algorithms?.[SSHAlgorithmType.HOSTKEY]?.filter(x => supportedAlgorithms[SSHAlgorithmType.HOSTKEY].includes(x)),
+                    compression: this.profile.options.algorithms?.[SSHAlgorithmType.COMPRESSION]?.filter(x => supportedAlgorithms[SSHAlgorithmType.COMPRESSION].includes(x)),
                 },
                 keepaliveIntervalSeconds: Math.round((this.profile.options.keepaliveInterval ?? 15000) / 1000),
                 keepaliveCountMax: this.profile.options.keepaliveCountMax,