@theia/remote 1.52.0 → 1.53.0-next.55
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +61 -61
- package/lib/electron-node/setup/remote-setup-script-service.js +11 -11
- package/package.json +5 -5
- package/src/electron-browser/port-forwarding/port-forwading-contribution.ts +33 -33
- package/src/electron-browser/port-forwarding/port-forwarding-service.ts +92 -92
- package/src/electron-browser/port-forwarding/port-forwarding-widget.tsx +140 -140
- package/src/electron-browser/remote-electron-file-dialog-service.ts +47 -47
- package/src/electron-browser/remote-frontend-contribution.ts +143 -143
- package/src/electron-browser/remote-frontend-module.ts +68 -68
- package/src/electron-browser/remote-preferences.ts +62 -62
- package/src/electron-browser/remote-registry-contribution.ts +73 -73
- package/src/electron-browser/remote-service.ts +31 -31
- package/src/electron-browser/remote-ssh-contribution.ts +102 -102
- package/src/electron-browser/style/port-forwarding-widget.css +44 -44
- package/src/electron-common/remote-port-forwarding-provider.ts +30 -30
- package/src/electron-common/remote-ssh-connection-provider.ts +29 -29
- package/src/electron-common/remote-status-service.ts +35 -35
- package/src/electron-node/backend-remote-service-impl.ts +45 -45
- package/src/electron-node/remote-backend-module.ts +87 -87
- package/src/electron-node/remote-connection-service.ts +56 -56
- package/src/electron-node/remote-connection-socket-provider.ts +34 -34
- package/src/electron-node/remote-port-forwarding-provider.ts +66 -66
- package/src/electron-node/remote-proxy-server-provider.ts +37 -37
- package/src/electron-node/remote-status-service.ts +41 -41
- package/src/electron-node/remote-types.ts +64 -64
- package/src/electron-node/setup/app-native-dependency-contribution.ts +48 -48
- package/src/electron-node/setup/main-copy-contribution.ts +28 -28
- package/src/electron-node/setup/remote-copy-contribution.ts +74 -74
- package/src/electron-node/setup/remote-copy-service.ts +116 -116
- package/src/electron-node/setup/remote-native-dependency-contribution.ts +63 -63
- package/src/electron-node/setup/remote-native-dependency-service.ts +111 -111
- package/src/electron-node/setup/remote-node-setup-service.ts +123 -123
- package/src/electron-node/setup/remote-setup-script-service.ts +146 -146
- package/src/electron-node/setup/remote-setup-service.ts +220 -220
- package/src/electron-node/ssh/remote-ssh-connection-provider.ts +358 -358
- package/src/electron-node/ssh/ssh-identity-file-collector.ts +137 -137
- package/src/package.spec.ts +29 -29
|
@@ -1,35 +1,35 @@
|
|
|
1
|
-
// *****************************************************************************
|
|
2
|
-
// Copyright (C) 2023 TypeFox and others.
|
|
3
|
-
//
|
|
4
|
-
// This program and the accompanying materials are made available under the
|
|
5
|
-
// terms of the Eclipse Public License v. 2.0 which is available at
|
|
6
|
-
// http://www.eclipse.org/legal/epl-2.0.
|
|
7
|
-
//
|
|
8
|
-
// This Source Code may also be made available under the following Secondary
|
|
9
|
-
// Licenses when the conditions for such availability set forth in the Eclipse
|
|
10
|
-
// Public License v. 2.0 are satisfied: GNU General Public License, version 2
|
|
11
|
-
// with the GNU Classpath Exception which is available at
|
|
12
|
-
// https://www.gnu.org/software/classpath/license.html.
|
|
13
|
-
//
|
|
14
|
-
// SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-only WITH Classpath-exception-2.0
|
|
15
|
-
// *****************************************************************************
|
|
16
|
-
|
|
17
|
-
export type RemoteStatus = RemoteConnectedStatus | RemoteDisconnectedStatus;
|
|
18
|
-
|
|
19
|
-
export interface RemoteDisconnectedStatus {
|
|
20
|
-
alive: false;
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
export interface RemoteConnectedStatus {
|
|
24
|
-
alive: true;
|
|
25
|
-
type: string;
|
|
26
|
-
name: string;
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
export const RemoteStatusServicePath = '/remote/status';
|
|
30
|
-
|
|
31
|
-
export const RemoteStatusService = Symbol('RemoteStatusService');
|
|
32
|
-
|
|
33
|
-
export interface RemoteStatusService {
|
|
34
|
-
getStatus(localPort: number): Promise<RemoteStatus>
|
|
35
|
-
}
|
|
1
|
+
// *****************************************************************************
|
|
2
|
+
// Copyright (C) 2023 TypeFox and others.
|
|
3
|
+
//
|
|
4
|
+
// This program and the accompanying materials are made available under the
|
|
5
|
+
// terms of the Eclipse Public License v. 2.0 which is available at
|
|
6
|
+
// http://www.eclipse.org/legal/epl-2.0.
|
|
7
|
+
//
|
|
8
|
+
// This Source Code may also be made available under the following Secondary
|
|
9
|
+
// Licenses when the conditions for such availability set forth in the Eclipse
|
|
10
|
+
// Public License v. 2.0 are satisfied: GNU General Public License, version 2
|
|
11
|
+
// with the GNU Classpath Exception which is available at
|
|
12
|
+
// https://www.gnu.org/software/classpath/license.html.
|
|
13
|
+
//
|
|
14
|
+
// SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-only WITH Classpath-exception-2.0
|
|
15
|
+
// *****************************************************************************
|
|
16
|
+
|
|
17
|
+
export type RemoteStatus = RemoteConnectedStatus | RemoteDisconnectedStatus;
|
|
18
|
+
|
|
19
|
+
export interface RemoteDisconnectedStatus {
|
|
20
|
+
alive: false;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
export interface RemoteConnectedStatus {
|
|
24
|
+
alive: true;
|
|
25
|
+
type: string;
|
|
26
|
+
name: string;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
export const RemoteStatusServicePath = '/remote/status';
|
|
30
|
+
|
|
31
|
+
export const RemoteStatusService = Symbol('RemoteStatusService');
|
|
32
|
+
|
|
33
|
+
export interface RemoteStatusService {
|
|
34
|
+
getStatus(localPort: number): Promise<RemoteStatus>
|
|
35
|
+
}
|
|
@@ -1,45 +1,45 @@
|
|
|
1
|
-
// *****************************************************************************
|
|
2
|
-
// Copyright (C) 2023 TypeFox and others.
|
|
3
|
-
//
|
|
4
|
-
// This program and the accompanying materials are made available under the
|
|
5
|
-
// terms of the Eclipse Public License v. 2.0 which is available at
|
|
6
|
-
// http://www.eclipse.org/legal/epl-2.0.
|
|
7
|
-
//
|
|
8
|
-
// This Source Code may also be made available under the following Secondary
|
|
9
|
-
// Licenses when the conditions for such availability set forth in the Eclipse
|
|
10
|
-
// Public License v. 2.0 are satisfied: GNU General Public License, version 2
|
|
11
|
-
// with the GNU Classpath Exception which is available at
|
|
12
|
-
// https://www.gnu.org/software/classpath/license.html.
|
|
13
|
-
//
|
|
14
|
-
// SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-only WITH Classpath-exception-2.0
|
|
15
|
-
// *****************************************************************************
|
|
16
|
-
|
|
17
|
-
import { CliContribution } from '@theia/core/lib/node';
|
|
18
|
-
import { injectable } from '@theia/core/shared/inversify';
|
|
19
|
-
import { Arguments, Argv } from '@theia/core/shared/yargs';
|
|
20
|
-
import { BackendRemoteService } from '@theia/core/lib/node/remote/backend-remote-service';
|
|
21
|
-
|
|
22
|
-
export const REMOTE_START = 'remote';
|
|
23
|
-
|
|
24
|
-
@injectable()
|
|
25
|
-
export class BackendRemoteServiceImpl extends BackendRemoteService implements CliContribution {
|
|
26
|
-
|
|
27
|
-
protected isRemote: boolean = false;
|
|
28
|
-
|
|
29
|
-
configure(conf: Argv): void {
|
|
30
|
-
conf.option(REMOTE_START, {
|
|
31
|
-
description: 'Starts the server as an endpoint for a remote connection (i.e. through SSH)',
|
|
32
|
-
type: 'boolean',
|
|
33
|
-
default: false
|
|
34
|
-
});
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
setArguments(args: Arguments): void {
|
|
38
|
-
this.isRemote = Boolean(args[REMOTE_START]);
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
override isRemoteServer(): boolean {
|
|
42
|
-
return this.isRemote;
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
}
|
|
1
|
+
// *****************************************************************************
|
|
2
|
+
// Copyright (C) 2023 TypeFox and others.
|
|
3
|
+
//
|
|
4
|
+
// This program and the accompanying materials are made available under the
|
|
5
|
+
// terms of the Eclipse Public License v. 2.0 which is available at
|
|
6
|
+
// http://www.eclipse.org/legal/epl-2.0.
|
|
7
|
+
//
|
|
8
|
+
// This Source Code may also be made available under the following Secondary
|
|
9
|
+
// Licenses when the conditions for such availability set forth in the Eclipse
|
|
10
|
+
// Public License v. 2.0 are satisfied: GNU General Public License, version 2
|
|
11
|
+
// with the GNU Classpath Exception which is available at
|
|
12
|
+
// https://www.gnu.org/software/classpath/license.html.
|
|
13
|
+
//
|
|
14
|
+
// SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-only WITH Classpath-exception-2.0
|
|
15
|
+
// *****************************************************************************
|
|
16
|
+
|
|
17
|
+
import { CliContribution } from '@theia/core/lib/node';
|
|
18
|
+
import { injectable } from '@theia/core/shared/inversify';
|
|
19
|
+
import { Arguments, Argv } from '@theia/core/shared/yargs';
|
|
20
|
+
import { BackendRemoteService } from '@theia/core/lib/node/remote/backend-remote-service';
|
|
21
|
+
|
|
22
|
+
export const REMOTE_START = 'remote';
|
|
23
|
+
|
|
24
|
+
@injectable()
|
|
25
|
+
export class BackendRemoteServiceImpl extends BackendRemoteService implements CliContribution {
|
|
26
|
+
|
|
27
|
+
protected isRemote: boolean = false;
|
|
28
|
+
|
|
29
|
+
configure(conf: Argv): void {
|
|
30
|
+
conf.option(REMOTE_START, {
|
|
31
|
+
description: 'Starts the server as an endpoint for a remote connection (i.e. through SSH)',
|
|
32
|
+
type: 'boolean',
|
|
33
|
+
default: false
|
|
34
|
+
});
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
setArguments(args: Arguments): void {
|
|
38
|
+
this.isRemote = Boolean(args[REMOTE_START]);
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
override isRemoteServer(): boolean {
|
|
42
|
+
return this.isRemote;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
}
|
|
@@ -1,87 +1,87 @@
|
|
|
1
|
-
// *****************************************************************************
|
|
2
|
-
// Copyright (C) 2023 TypeFox and others.
|
|
3
|
-
//
|
|
4
|
-
// This program and the accompanying materials are made available under the
|
|
5
|
-
// terms of the Eclipse Public License v. 2.0 which is available at
|
|
6
|
-
// http://www.eclipse.org/legal/epl-2.0.
|
|
7
|
-
//
|
|
8
|
-
// This Source Code may also be made available under the following Secondary
|
|
9
|
-
// Licenses when the conditions for such availability set forth in the Eclipse
|
|
10
|
-
// Public License v. 2.0 are satisfied: GNU General Public License, version 2
|
|
11
|
-
// with the GNU Classpath Exception which is available at
|
|
12
|
-
// https://www.gnu.org/software/classpath/license.html.
|
|
13
|
-
//
|
|
14
|
-
// SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-only WITH Classpath-exception-2.0
|
|
15
|
-
// *****************************************************************************
|
|
16
|
-
|
|
17
|
-
import { ContainerModule } from '@theia/core/shared/inversify';
|
|
18
|
-
import { BackendApplicationContribution, CliContribution } from '@theia/core/lib/node';
|
|
19
|
-
import { RemoteConnectionService } from './remote-connection-service';
|
|
20
|
-
import { RemoteProxyServerProvider } from './remote-proxy-server-provider';
|
|
21
|
-
import { RemoteConnectionSocketProvider } from './remote-connection-socket-provider';
|
|
22
|
-
import { ConnectionContainerModule } from '@theia/core/lib/node/messaging/connection-container-module';
|
|
23
|
-
import { RemoteSSHConnectionProvider, RemoteSSHConnectionProviderPath } from '../electron-common/remote-ssh-connection-provider';
|
|
24
|
-
import { RemoteSSHConnectionProviderImpl } from './ssh/remote-ssh-connection-provider';
|
|
25
|
-
import { SSHIdentityFileCollector } from './ssh/ssh-identity-file-collector';
|
|
26
|
-
import { RemoteCopyService } from './setup/remote-copy-service';
|
|
27
|
-
import { RemoteSetupService } from './setup/remote-setup-service';
|
|
28
|
-
import { RemoteNativeDependencyService } from './setup/remote-native-dependency-service';
|
|
29
|
-
import { BackendRemoteServiceImpl } from './backend-remote-service-impl';
|
|
30
|
-
import { BackendRemoteService } from '@theia/core/lib/node/remote/backend-remote-service';
|
|
31
|
-
import { RemoteNodeSetupService } from './setup/remote-node-setup-service';
|
|
32
|
-
import { RemotePosixScriptStrategy, RemoteSetupScriptService, RemoteWindowsScriptStrategy } from './setup/remote-setup-script-service';
|
|
33
|
-
import { RemoteStatusService, RemoteStatusServicePath } from '../electron-common/remote-status-service';
|
|
34
|
-
import { RemoteStatusServiceImpl } from './remote-status-service';
|
|
35
|
-
import { ConnectionHandler, RpcConnectionHandler, bindContributionProvider } from '@theia/core';
|
|
36
|
-
import { RemoteCopyRegistryImpl } from './setup/remote-copy-contribution';
|
|
37
|
-
import { RemoteCopyContribution } from '@theia/core/lib/node/remote/remote-copy-contribution';
|
|
38
|
-
import { MainCopyContribution } from './setup/main-copy-contribution';
|
|
39
|
-
import { RemoteNativeDependencyContribution } from './setup/remote-native-dependency-contribution';
|
|
40
|
-
import { AppNativeDependencyContribution } from './setup/app-native-dependency-contribution';
|
|
41
|
-
import { RemotePortForwardingProviderImpl } from './remote-port-forwarding-provider';
|
|
42
|
-
import { RemotePortForwardingProvider, RemoteRemotePortForwardingProviderPath } from '../electron-common/remote-port-forwarding-provider';
|
|
43
|
-
|
|
44
|
-
export const remoteConnectionModule = ConnectionContainerModule.create(({ bind, bindBackendService }) => {
|
|
45
|
-
bind(RemoteSSHConnectionProviderImpl).toSelf().inSingletonScope();
|
|
46
|
-
bind(RemoteSSHConnectionProvider).toService(RemoteSSHConnectionProviderImpl);
|
|
47
|
-
bindBackendService(RemoteSSHConnectionProviderPath, RemoteSSHConnectionProvider);
|
|
48
|
-
|
|
49
|
-
bind(RemotePortForwardingProviderImpl).toSelf().inSingletonScope();
|
|
50
|
-
bind(RemotePortForwardingProvider).toService(RemotePortForwardingProviderImpl);
|
|
51
|
-
bindBackendService(RemoteRemotePortForwardingProviderPath, RemotePortForwardingProvider);
|
|
52
|
-
});
|
|
53
|
-
|
|
54
|
-
export default new ContainerModule((bind, _unbind, _isBound, rebind) => {
|
|
55
|
-
bind(RemoteProxyServerProvider).toSelf().inSingletonScope();
|
|
56
|
-
bind(RemoteConnectionSocketProvider).toSelf().inSingletonScope();
|
|
57
|
-
bind(RemoteConnectionService).toSelf().inSingletonScope();
|
|
58
|
-
bind(BackendApplicationContribution).toService(RemoteConnectionService);
|
|
59
|
-
bind(RemoteStatusServiceImpl).toSelf().inSingletonScope();
|
|
60
|
-
bind(RemoteStatusService).toService(RemoteStatusServiceImpl);
|
|
61
|
-
bind(ConnectionHandler).toDynamicValue(
|
|
62
|
-
ctx => new RpcConnectionHandler(RemoteStatusServicePath, () => ctx.container.get(RemoteStatusService))
|
|
63
|
-
).inSingletonScope();
|
|
64
|
-
|
|
65
|
-
bind(RemoteCopyService).toSelf().inSingletonScope();
|
|
66
|
-
bind(RemoteSetupService).toSelf().inSingletonScope();
|
|
67
|
-
bind(RemoteNodeSetupService).toSelf().inSingletonScope();
|
|
68
|
-
bind(RemoteWindowsScriptStrategy).toSelf().inSingletonScope();
|
|
69
|
-
bind(RemotePosixScriptStrategy).toSelf().inSingletonScope();
|
|
70
|
-
bind(RemoteSetupScriptService).toSelf().inSingletonScope();
|
|
71
|
-
bind(RemoteNativeDependencyService).toSelf().inSingletonScope();
|
|
72
|
-
bind(RemoteCopyRegistryImpl).toSelf().inSingletonScope();
|
|
73
|
-
bindContributionProvider(bind, RemoteCopyContribution);
|
|
74
|
-
bindContributionProvider(bind, RemoteNativeDependencyContribution);
|
|
75
|
-
bind(MainCopyContribution).toSelf().inSingletonScope();
|
|
76
|
-
bind(RemoteCopyContribution).toService(MainCopyContribution);
|
|
77
|
-
bind(AppNativeDependencyContribution).toSelf().inSingletonScope();
|
|
78
|
-
bind(RemoteNativeDependencyContribution).toService(AppNativeDependencyContribution);
|
|
79
|
-
|
|
80
|
-
bind(ConnectionContainerModule).toConstantValue(remoteConnectionModule);
|
|
81
|
-
|
|
82
|
-
bind(BackendRemoteServiceImpl).toSelf().inSingletonScope();
|
|
83
|
-
rebind(BackendRemoteService).toService(BackendRemoteServiceImpl);
|
|
84
|
-
bind(CliContribution).toService(BackendRemoteServiceImpl);
|
|
85
|
-
|
|
86
|
-
bind(SSHIdentityFileCollector).toSelf().inSingletonScope();
|
|
87
|
-
});
|
|
1
|
+
// *****************************************************************************
|
|
2
|
+
// Copyright (C) 2023 TypeFox and others.
|
|
3
|
+
//
|
|
4
|
+
// This program and the accompanying materials are made available under the
|
|
5
|
+
// terms of the Eclipse Public License v. 2.0 which is available at
|
|
6
|
+
// http://www.eclipse.org/legal/epl-2.0.
|
|
7
|
+
//
|
|
8
|
+
// This Source Code may also be made available under the following Secondary
|
|
9
|
+
// Licenses when the conditions for such availability set forth in the Eclipse
|
|
10
|
+
// Public License v. 2.0 are satisfied: GNU General Public License, version 2
|
|
11
|
+
// with the GNU Classpath Exception which is available at
|
|
12
|
+
// https://www.gnu.org/software/classpath/license.html.
|
|
13
|
+
//
|
|
14
|
+
// SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-only WITH Classpath-exception-2.0
|
|
15
|
+
// *****************************************************************************
|
|
16
|
+
|
|
17
|
+
import { ContainerModule } from '@theia/core/shared/inversify';
|
|
18
|
+
import { BackendApplicationContribution, CliContribution } from '@theia/core/lib/node';
|
|
19
|
+
import { RemoteConnectionService } from './remote-connection-service';
|
|
20
|
+
import { RemoteProxyServerProvider } from './remote-proxy-server-provider';
|
|
21
|
+
import { RemoteConnectionSocketProvider } from './remote-connection-socket-provider';
|
|
22
|
+
import { ConnectionContainerModule } from '@theia/core/lib/node/messaging/connection-container-module';
|
|
23
|
+
import { RemoteSSHConnectionProvider, RemoteSSHConnectionProviderPath } from '../electron-common/remote-ssh-connection-provider';
|
|
24
|
+
import { RemoteSSHConnectionProviderImpl } from './ssh/remote-ssh-connection-provider';
|
|
25
|
+
import { SSHIdentityFileCollector } from './ssh/ssh-identity-file-collector';
|
|
26
|
+
import { RemoteCopyService } from './setup/remote-copy-service';
|
|
27
|
+
import { RemoteSetupService } from './setup/remote-setup-service';
|
|
28
|
+
import { RemoteNativeDependencyService } from './setup/remote-native-dependency-service';
|
|
29
|
+
import { BackendRemoteServiceImpl } from './backend-remote-service-impl';
|
|
30
|
+
import { BackendRemoteService } from '@theia/core/lib/node/remote/backend-remote-service';
|
|
31
|
+
import { RemoteNodeSetupService } from './setup/remote-node-setup-service';
|
|
32
|
+
import { RemotePosixScriptStrategy, RemoteSetupScriptService, RemoteWindowsScriptStrategy } from './setup/remote-setup-script-service';
|
|
33
|
+
import { RemoteStatusService, RemoteStatusServicePath } from '../electron-common/remote-status-service';
|
|
34
|
+
import { RemoteStatusServiceImpl } from './remote-status-service';
|
|
35
|
+
import { ConnectionHandler, RpcConnectionHandler, bindContributionProvider } from '@theia/core';
|
|
36
|
+
import { RemoteCopyRegistryImpl } from './setup/remote-copy-contribution';
|
|
37
|
+
import { RemoteCopyContribution } from '@theia/core/lib/node/remote/remote-copy-contribution';
|
|
38
|
+
import { MainCopyContribution } from './setup/main-copy-contribution';
|
|
39
|
+
import { RemoteNativeDependencyContribution } from './setup/remote-native-dependency-contribution';
|
|
40
|
+
import { AppNativeDependencyContribution } from './setup/app-native-dependency-contribution';
|
|
41
|
+
import { RemotePortForwardingProviderImpl } from './remote-port-forwarding-provider';
|
|
42
|
+
import { RemotePortForwardingProvider, RemoteRemotePortForwardingProviderPath } from '../electron-common/remote-port-forwarding-provider';
|
|
43
|
+
|
|
44
|
+
export const remoteConnectionModule = ConnectionContainerModule.create(({ bind, bindBackendService }) => {
|
|
45
|
+
bind(RemoteSSHConnectionProviderImpl).toSelf().inSingletonScope();
|
|
46
|
+
bind(RemoteSSHConnectionProvider).toService(RemoteSSHConnectionProviderImpl);
|
|
47
|
+
bindBackendService(RemoteSSHConnectionProviderPath, RemoteSSHConnectionProvider);
|
|
48
|
+
|
|
49
|
+
bind(RemotePortForwardingProviderImpl).toSelf().inSingletonScope();
|
|
50
|
+
bind(RemotePortForwardingProvider).toService(RemotePortForwardingProviderImpl);
|
|
51
|
+
bindBackendService(RemoteRemotePortForwardingProviderPath, RemotePortForwardingProvider);
|
|
52
|
+
});
|
|
53
|
+
|
|
54
|
+
export default new ContainerModule((bind, _unbind, _isBound, rebind) => {
|
|
55
|
+
bind(RemoteProxyServerProvider).toSelf().inSingletonScope();
|
|
56
|
+
bind(RemoteConnectionSocketProvider).toSelf().inSingletonScope();
|
|
57
|
+
bind(RemoteConnectionService).toSelf().inSingletonScope();
|
|
58
|
+
bind(BackendApplicationContribution).toService(RemoteConnectionService);
|
|
59
|
+
bind(RemoteStatusServiceImpl).toSelf().inSingletonScope();
|
|
60
|
+
bind(RemoteStatusService).toService(RemoteStatusServiceImpl);
|
|
61
|
+
bind(ConnectionHandler).toDynamicValue(
|
|
62
|
+
ctx => new RpcConnectionHandler(RemoteStatusServicePath, () => ctx.container.get(RemoteStatusService))
|
|
63
|
+
).inSingletonScope();
|
|
64
|
+
|
|
65
|
+
bind(RemoteCopyService).toSelf().inSingletonScope();
|
|
66
|
+
bind(RemoteSetupService).toSelf().inSingletonScope();
|
|
67
|
+
bind(RemoteNodeSetupService).toSelf().inSingletonScope();
|
|
68
|
+
bind(RemoteWindowsScriptStrategy).toSelf().inSingletonScope();
|
|
69
|
+
bind(RemotePosixScriptStrategy).toSelf().inSingletonScope();
|
|
70
|
+
bind(RemoteSetupScriptService).toSelf().inSingletonScope();
|
|
71
|
+
bind(RemoteNativeDependencyService).toSelf().inSingletonScope();
|
|
72
|
+
bind(RemoteCopyRegistryImpl).toSelf().inSingletonScope();
|
|
73
|
+
bindContributionProvider(bind, RemoteCopyContribution);
|
|
74
|
+
bindContributionProvider(bind, RemoteNativeDependencyContribution);
|
|
75
|
+
bind(MainCopyContribution).toSelf().inSingletonScope();
|
|
76
|
+
bind(RemoteCopyContribution).toService(MainCopyContribution);
|
|
77
|
+
bind(AppNativeDependencyContribution).toSelf().inSingletonScope();
|
|
78
|
+
bind(RemoteNativeDependencyContribution).toService(AppNativeDependencyContribution);
|
|
79
|
+
|
|
80
|
+
bind(ConnectionContainerModule).toConstantValue(remoteConnectionModule);
|
|
81
|
+
|
|
82
|
+
bind(BackendRemoteServiceImpl).toSelf().inSingletonScope();
|
|
83
|
+
rebind(BackendRemoteService).toService(BackendRemoteServiceImpl);
|
|
84
|
+
bind(CliContribution).toService(BackendRemoteServiceImpl);
|
|
85
|
+
|
|
86
|
+
bind(SSHIdentityFileCollector).toSelf().inSingletonScope();
|
|
87
|
+
});
|
|
@@ -1,56 +1,56 @@
|
|
|
1
|
-
// *****************************************************************************
|
|
2
|
-
// Copyright (C) 2023 TypeFox and others.
|
|
3
|
-
//
|
|
4
|
-
// This program and the accompanying materials are made available under the
|
|
5
|
-
// terms of the Eclipse Public License v. 2.0 which is available at
|
|
6
|
-
// http://www.eclipse.org/legal/epl-2.0.
|
|
7
|
-
//
|
|
8
|
-
// This Source Code may also be made available under the following Secondary
|
|
9
|
-
// Licenses when the conditions for such availability set forth in the Eclipse
|
|
10
|
-
// Public License v. 2.0 are satisfied: GNU General Public License, version 2
|
|
11
|
-
// with the GNU Classpath Exception which is available at
|
|
12
|
-
// https://www.gnu.org/software/classpath/license.html.
|
|
13
|
-
//
|
|
14
|
-
// SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-only WITH Classpath-exception-2.0
|
|
15
|
-
// *****************************************************************************
|
|
16
|
-
|
|
17
|
-
import { inject, injectable } from '@theia/core/shared/inversify';
|
|
18
|
-
import { RemoteConnection } from './remote-types';
|
|
19
|
-
import { Disposable } from '@theia/core';
|
|
20
|
-
import { RemoteCopyService } from './setup/remote-copy-service';
|
|
21
|
-
import { BackendApplicationContribution } from '@theia/core/lib/node';
|
|
22
|
-
import { RemoteSetupService } from './setup/remote-setup-service';
|
|
23
|
-
|
|
24
|
-
@injectable()
|
|
25
|
-
export class RemoteConnectionService implements BackendApplicationContribution {
|
|
26
|
-
|
|
27
|
-
@inject(RemoteCopyService)
|
|
28
|
-
protected readonly copyService: RemoteCopyService;
|
|
29
|
-
|
|
30
|
-
// Workaround for the fact that connection scoped services cannot directly inject these services.
|
|
31
|
-
@inject(RemoteSetupService)
|
|
32
|
-
protected readonly remoteSetupService: RemoteSetupService;
|
|
33
|
-
|
|
34
|
-
protected readonly connections = new Map<string, RemoteConnection>();
|
|
35
|
-
|
|
36
|
-
getConnection(id: string): RemoteConnection | undefined {
|
|
37
|
-
return this.connections.get(id);
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
getConnectionFromPort(port: number): RemoteConnection | undefined {
|
|
41
|
-
return Array.from(this.connections.values()).find(connection => connection.localPort === port);
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
register(connection: RemoteConnection): Disposable {
|
|
45
|
-
this.connections.set(connection.id, connection);
|
|
46
|
-
return Disposable.create(() => {
|
|
47
|
-
this.connections.delete(connection.id);
|
|
48
|
-
});
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
onStop(): void {
|
|
52
|
-
for (const connection of this.connections.values()) {
|
|
53
|
-
connection.dispose();
|
|
54
|
-
}
|
|
55
|
-
}
|
|
56
|
-
}
|
|
1
|
+
// *****************************************************************************
|
|
2
|
+
// Copyright (C) 2023 TypeFox and others.
|
|
3
|
+
//
|
|
4
|
+
// This program and the accompanying materials are made available under the
|
|
5
|
+
// terms of the Eclipse Public License v. 2.0 which is available at
|
|
6
|
+
// http://www.eclipse.org/legal/epl-2.0.
|
|
7
|
+
//
|
|
8
|
+
// This Source Code may also be made available under the following Secondary
|
|
9
|
+
// Licenses when the conditions for such availability set forth in the Eclipse
|
|
10
|
+
// Public License v. 2.0 are satisfied: GNU General Public License, version 2
|
|
11
|
+
// with the GNU Classpath Exception which is available at
|
|
12
|
+
// https://www.gnu.org/software/classpath/license.html.
|
|
13
|
+
//
|
|
14
|
+
// SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-only WITH Classpath-exception-2.0
|
|
15
|
+
// *****************************************************************************
|
|
16
|
+
|
|
17
|
+
import { inject, injectable } from '@theia/core/shared/inversify';
|
|
18
|
+
import { RemoteConnection } from './remote-types';
|
|
19
|
+
import { Disposable } from '@theia/core';
|
|
20
|
+
import { RemoteCopyService } from './setup/remote-copy-service';
|
|
21
|
+
import { BackendApplicationContribution } from '@theia/core/lib/node';
|
|
22
|
+
import { RemoteSetupService } from './setup/remote-setup-service';
|
|
23
|
+
|
|
24
|
+
@injectable()
|
|
25
|
+
export class RemoteConnectionService implements BackendApplicationContribution {
|
|
26
|
+
|
|
27
|
+
@inject(RemoteCopyService)
|
|
28
|
+
protected readonly copyService: RemoteCopyService;
|
|
29
|
+
|
|
30
|
+
// Workaround for the fact that connection scoped services cannot directly inject these services.
|
|
31
|
+
@inject(RemoteSetupService)
|
|
32
|
+
protected readonly remoteSetupService: RemoteSetupService;
|
|
33
|
+
|
|
34
|
+
protected readonly connections = new Map<string, RemoteConnection>();
|
|
35
|
+
|
|
36
|
+
getConnection(id: string): RemoteConnection | undefined {
|
|
37
|
+
return this.connections.get(id);
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
getConnectionFromPort(port: number): RemoteConnection | undefined {
|
|
41
|
+
return Array.from(this.connections.values()).find(connection => connection.localPort === port);
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
register(connection: RemoteConnection): Disposable {
|
|
45
|
+
this.connections.set(connection.id, connection);
|
|
46
|
+
return Disposable.create(() => {
|
|
47
|
+
this.connections.delete(connection.id);
|
|
48
|
+
});
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
onStop(): void {
|
|
52
|
+
for (const connection of this.connections.values()) {
|
|
53
|
+
connection.dispose();
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
}
|
|
@@ -1,34 +1,34 @@
|
|
|
1
|
-
// *****************************************************************************
|
|
2
|
-
// Copyright (C) 2023 TypeFox and others.
|
|
3
|
-
//
|
|
4
|
-
// This program and the accompanying materials are made available under the
|
|
5
|
-
// terms of the Eclipse Public License v. 2.0 which is available at
|
|
6
|
-
// http://www.eclipse.org/legal/epl-2.0.
|
|
7
|
-
//
|
|
8
|
-
// This Source Code may also be made available under the following Secondary
|
|
9
|
-
// Licenses when the conditions for such availability set forth in the Eclipse
|
|
10
|
-
// Public License v. 2.0 are satisfied: GNU General Public License, version 2
|
|
11
|
-
// with the GNU Classpath Exception which is available at
|
|
12
|
-
// https://www.gnu.org/software/classpath/license.html.
|
|
13
|
-
//
|
|
14
|
-
// SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-only WITH Classpath-exception-2.0
|
|
15
|
-
// *****************************************************************************
|
|
16
|
-
|
|
17
|
-
import { injectable } from '@theia/core/shared/inversify';
|
|
18
|
-
import { io, Socket } from 'socket.io-client';
|
|
19
|
-
|
|
20
|
-
export interface RemoteProxySocketProviderOptions {
|
|
21
|
-
port: number;
|
|
22
|
-
path: string;
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
@injectable()
|
|
26
|
-
export class RemoteConnectionSocketProvider {
|
|
27
|
-
|
|
28
|
-
getProxySocket(options: RemoteProxySocketProviderOptions): Socket {
|
|
29
|
-
const socket = io(`ws://localhost:${options.port}${options.path}`);
|
|
30
|
-
socket.connect();
|
|
31
|
-
return socket;
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
}
|
|
1
|
+
// *****************************************************************************
|
|
2
|
+
// Copyright (C) 2023 TypeFox and others.
|
|
3
|
+
//
|
|
4
|
+
// This program and the accompanying materials are made available under the
|
|
5
|
+
// terms of the Eclipse Public License v. 2.0 which is available at
|
|
6
|
+
// http://www.eclipse.org/legal/epl-2.0.
|
|
7
|
+
//
|
|
8
|
+
// This Source Code may also be made available under the following Secondary
|
|
9
|
+
// Licenses when the conditions for such availability set forth in the Eclipse
|
|
10
|
+
// Public License v. 2.0 are satisfied: GNU General Public License, version 2
|
|
11
|
+
// with the GNU Classpath Exception which is available at
|
|
12
|
+
// https://www.gnu.org/software/classpath/license.html.
|
|
13
|
+
//
|
|
14
|
+
// SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-only WITH Classpath-exception-2.0
|
|
15
|
+
// *****************************************************************************
|
|
16
|
+
|
|
17
|
+
import { injectable } from '@theia/core/shared/inversify';
|
|
18
|
+
import { io, Socket } from 'socket.io-client';
|
|
19
|
+
|
|
20
|
+
export interface RemoteProxySocketProviderOptions {
|
|
21
|
+
port: number;
|
|
22
|
+
path: string;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
@injectable()
|
|
26
|
+
export class RemoteConnectionSocketProvider {
|
|
27
|
+
|
|
28
|
+
getProxySocket(options: RemoteProxySocketProviderOptions): Socket {
|
|
29
|
+
const socket = io(`ws://localhost:${options.port}${options.path}`);
|
|
30
|
+
socket.connect();
|
|
31
|
+
return socket;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
}
|