Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

758 provide more useful messages in the UI when a session is being created #764

Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
30 changes: 18 additions & 12 deletions packages/dart/sshnp_flutter/lib/l10n/app_en.arb
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@
"addNewConnectionDescription" : "To create a new connection as fast as possible, only fill in required fields, the rest will auto populate by default. You can always change your configurations later.",
"advancedConfiguration": "Advanced \nConfiguration",
"atKeysFilePath" : "atKeys File",
"authenticateClientToRvd" : "Authenticate Client to Socket Rendezvous",
"authenticateClientToRvdTooltip" : "When true, client will authenticate itself to rvd",
"authenticateDeviceToRvd" : "Authenticate Device to Socket Rendezvous",
"authenticateDeviceToRvdTooltip" : "When true, Device will authenticate itself to rvd",
"availableConnections" : "Available Connections",
"backupYourKeys" : "Backup Your Keys",
"cancel" : "Cancel",
Expand All @@ -27,9 +31,10 @@
"dest" : "Dest.",
"destination" : "Destination",
"device" : "Device Name",
"deviceHint" : "The device name of the sshnpd we wish to communicate with",
"deviceTooltip" : "Daemon device name",
"deviceTooltip" : "Receiving device name",
"edit" : "Edit",
"encryptRvdTraffic" : "Encrypt RVD Traffic",
"encryptRvdTrafficTooltip" : "When true, traffic via the socket rendezvous is encrypted, in addition to whatever encryption the traffic already has, (e.g. an ssh session)",
"error" : "Error",
"privateKeyFormFieldError" : "Unable to load the private key manager. Please try again.",
"export" : "Export",
Expand All @@ -39,17 +44,17 @@
"homeDirectory" : "Home Directory",
"homeDirectoryHint" : "The home directory on this host",
"host" : "SR Address (atSign)",
"hostTooltip" : "atSign for Server Rendezvous",
"hostTooltip" : "atSign of srvd daemon or FQDN/IP address to connect back to",
"hostSelection" : "Host Selection",
"import" : "Import",
"importProfile" : "Import Profile",
"keyFile" : "Key File",
"listDevices" : "List Devices",
"localPort": "Local Forwarding Port",
"localPortTooltip" : "Local TCP Forwarding Port (set to 0 for Ephemeral)",
"localPortTooltip" : "Port on which sshd is listening locally on the client host",
"localSshdPort": "Local SSHD Port",
"localSshOptions" : "Local SSH Options",
"localSshOptionsTooltip" : "Local SSH Options for Daemon",
"localSshOptionsTooltip" : "Add these commands to the local ssh command",
"localSshOptionsHint" : "Use \",\" to separate options",
"newSshKeyCreation" : "New SSH Key Creation",
"newText" : "New",
Expand All @@ -73,30 +78,31 @@
"privateKeyPassphrase" : "Private Key Passphrase",
"privatekeyPassPhraseTooltip" : "Passphrase of the Private Key",
"profileName" : "Profile Name",
"profileNameTooltip" : "Configuration Profile Name",
"profileNameTooltip" : "Name of the profile to use",
"remoteSshdPort": "Remote SSHD Port",
"remoteSshdPortTooltip" : "Remote device's sshd port",
"remoteSshdPortTooltip" : "Port on which sshd is listening locally on the device host",
"remoteUserName" : "Session username",
"remoteUserNameTooltip" : "SSH Session UNIX Username (Who to login as)",
"remoteUserNameTooltip" : "Username to use in the ssh session on the remote host",
"removeButton":"Remove",
"reset" : "Reset",
"resetDescription":"This will remove the selected atSign and its details from this app only.",
"resetErrorText":"Please select at least one atSign to reset",
"resetWarningText":"Warning: This action cannot be undone",
"result" : "Result",
"rootDomain" : "atDirectory Root Domain",
"rootDomainTooltip" : "Root Domain for atDirectory",
"rootDomainTooltip" : "atDirectory domain",
"rsa" : "Legacy RSA Key",
"select" : "Select",
"selectAFile" : "Select a file",
"selectPrivateKey" : "Select Private Key",
"sendSshPublicKey" : "Share SSH Public Key",
"sendSshPublicKeyTooltip" : "Share SSH Public Key with Daemon (Yes/No)",
"sendSshPublicKeyTooltip" : "When true, the ssh public key will be sent to the remote host for use in the ssh session",
"sessionId" : "Session ID",
"settings" : "Settings",
"support" : "Support",
"supportDescription" : "Our team of experts is here to help! Select your preferred method below",
"sourcePort" : "Source Port",
"socketRendezvousConfiguration" : "Socket Rendezvous\nConfiguration",
"sshAlgorithm" : "SSH Algorithm",
"sshButton" : "ssh",
"sshKeyManagement": "{newLine, select, yes{SSH Key \nConfiguration} no{SSH Key Management} other{SSH Key Management}}",
Expand All @@ -110,7 +116,7 @@
},
"sshnpdAtSign" : "Device Address (atSign)",
"sshnpdAtSignHint" : "The atSign of the sshnpd we wish to communicate with",
"sshnpdAtSignTooltip" : "atSign for Daemon",
"sshnpdAtSignTooltip" : "Receiving device atSign",
"sshPublicKey" : "SSH Public Key",
"status" : "Status",
"submit" : "Submit",
Expand All @@ -120,7 +126,7 @@
"terminalDescription" : "Connections currently running",
"to" : "To",
"tunnelUserName" : "Tunnel Username",
"tunnelUserNameTooltip" : "Initial Tunnel Session UNIX Username (User running sshnpd)",
"tunnelUserNameTooltip" : "Username to use for the initial ssh tunnel",
"username" : "Username",
"usernameHint": "The user name on this host",
"uploadNewKey" : "Upload New Key",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,8 +82,7 @@ class ConfigFamilyController extends AutoDisposeFamilyAsyncNotifier<SshnpParams,
}
try {
final result = await ConfigKeyRepository.getParams(arg, atClient: atClient);
log('config profile is: $arg');
log('From Config Controller identity file ${result.identityFile}');

return result;
} catch (e) {
log('From Config Controller ${e.toString()}');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ class ProfileFormCard extends StatelessWidget {
),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisSize: MainAxisSize.min,
children: formFields,
),
),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,7 @@ class _ProfileFormState extends ConsumerState<ProfileFormDesktopView> {
child: Form(
key: _formkey,
child: Column(
mainAxisSize: MainAxisSize.min,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Row(
Expand Down Expand Up @@ -156,9 +157,10 @@ class _ProfileFormState extends ConsumerState<ProfileFormDesktopView> {
Text(strings.connectionConfiguration, style: Theme.of(context).textTheme.bodyLarge),
gapH20,
ProfileFormCard(
largeScreenRightPadding: Sizes.p103,
largeScreenRightPadding: Sizes.p32,
formFields: [
Row(
mainAxisSize: MainAxisSize.min,
children: [
CustomTextFormField(
initialValue: oldConfig.remoteUsername,
Expand Down Expand Up @@ -191,6 +193,7 @@ class _ProfileFormState extends ConsumerState<ProfileFormDesktopView> {
),
gapH10,
Row(
mainAxisSize: MainAxisSize.min,
children: [
CustomTextFormField(
initialValue: oldConfig.remoteSshdPort.toString(),
Expand Down Expand Up @@ -221,8 +224,9 @@ class _ProfileFormState extends ConsumerState<ProfileFormDesktopView> {
gapH20,
Text(strings.sshKeyManagement('yes'), style: Theme.of(context).textTheme.bodyLarge),
gapH16,
ProfileFormCard(largeScreenRightPadding: 5, formFields: [
ProfileFormCard(largeScreenRightPadding: Sizes.p32, formFields: [
Row(
mainAxisSize: MainAxisSize.min,
children: [
privateKeyManagerListController.when(
loading: () => const Center(child: CircularProgressIndicator()),
Expand Down Expand Up @@ -280,27 +284,29 @@ class _ProfileFormState extends ConsumerState<ProfileFormDesktopView> {
}),
gapW38,
CustomSwitchWidget(
labelText: strings.sendSshPublicKey,
value: newConfig.sendSshPublicKey ?? oldConfig.sendSshPublicKey,
tooltip: strings.sendSshPublicKeyTooltip,
onChanged: (newValue) {
setState(() {
newConfig = SshnpPartialParams.merge(
newConfig,
SshnpPartialParams(sendSshPublicKey: newValue),
);
});
}),
labelText: strings.sendSshPublicKey,
value: newConfig.sendSshPublicKey ?? oldConfig.sendSshPublicKey,
tooltip: strings.sendSshPublicKeyTooltip,
onChanged: (newValue) {
setState(() {
newConfig = SshnpPartialParams.merge(
newConfig,
SshnpPartialParams(sendSshPublicKey: newValue),
);
});
},
),
],
),
]),
gapH20,
Text(strings.advancedConfiguration, style: Theme.of(context).textTheme.bodyMedium),
Text(strings.advancedConfiguration, style: Theme.of(context).textTheme.bodyLarge),
gapH20,
ProfileFormCard(
largeScreenRightPadding: Sizes.p103,
largeScreenRightPadding: Sizes.p32,
formFields: [
Row(
mainAxisSize: MainAxisSize.min,
children: [
CustomTextFormField(
initialValue: oldConfig.localSshOptions.join(','),
Expand All @@ -327,6 +333,65 @@ class _ProfileFormState extends ConsumerState<ProfileFormDesktopView> {
),
],
),
gapH20,
Text(strings.socketRendezvousConfiguration, style: Theme.of(context).textTheme.bodyLarge),
gapH20,
ProfileFormCard(
largeScreenRightPadding: Sizes.p32,
formFields: [
Row(
mainAxisSize: MainAxisSize.min,
children: [
CustomSwitchWidget(
labelText: strings.authenticateClientToRvd,
value: newConfig.authenticateClientToRvd ?? oldConfig.authenticateClientToRvd,
tooltip: strings.authenticateClientToRvdTooltip,
onChanged: (newValue) {
setState(() {
newConfig = SshnpPartialParams.merge(
newConfig,
SshnpPartialParams(authenticateClientToRvd: newValue),
);
});
},
),
gapW38,
CustomSwitchWidget(
labelText: strings.authenticateDeviceToRvd,
value: newConfig.authenticateDeviceToRvd ?? oldConfig.authenticateDeviceToRvd,
tooltip: strings.authenticateDeviceToRvdTooltip,
onChanged: (newValue) {
setState(() {
newConfig = SshnpPartialParams.merge(
newConfig,
SshnpPartialParams(authenticateDeviceToRvd: newValue),
);
});
},
),
],
),
gapH10,
Row(
mainAxisSize: MainAxisSize.min,
children: [
CustomSwitchWidget(
labelText: strings.encryptRvdTraffic,
value: newConfig.encryptRvdTraffic ?? oldConfig.encryptRvdTraffic,
tooltip: strings.encryptRvdTrafficTooltip,
onChanged: (newValue) {
setState(() {
newConfig = SshnpPartialParams.merge(
newConfig,
SshnpPartialParams(encryptRvdTraffic: newValue),
);
});
},
),
],
)
],
),
gapH30,
SizedBox(
width: kFieldDefaultWidth + Sizes.p233,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,9 +44,6 @@ class _TerminalScreenDesktopViewState extends ConsumerState<TerminalScreenDeskto

sessionController.issueDisplayName(shellInfo['params'].profileName!);

sessionController.write('Starting Shell Session...');
log('Starting Shell Session...');

try {
AtClient atClient = AtClientManager.getInstance().atClient;

Expand All @@ -68,6 +65,10 @@ class _TerminalScreenDesktopViewState extends ConsumerState<TerminalScreenDeskto
atClient: atClient,
identityKeyPair: keyPair,
);
sshnp.progressStream?.listen((progress) {
sessionController.write(progress);
log(progress);
});

final result = await sshnp.run();
if (result is SshnpError) {
Expand All @@ -76,12 +77,8 @@ class _TerminalScreenDesktopViewState extends ConsumerState<TerminalScreenDeskto

if (result is SshnpCommand) {
if (sshnp.canRunShell) {
sessionController.write('running shell session...');
log('running shell session...');

SshnpRemoteProcess shell = await sshnp.runShell();
sessionController.write('starting terminal session...');
log('starting terminal session');

sessionController.startSession(
shell,
terminalTitle: '${shellInfo['sshnpdAtSign']}-${shellInfo['params'].device}',
Expand All @@ -90,6 +87,7 @@ class _TerminalScreenDesktopViewState extends ConsumerState<TerminalScreenDeskto
}
} catch (e) {
sessionController.dispose();

if (mounted) {
log('error: ${e.toString()}');

Expand Down
8 changes: 4 additions & 4 deletions packages/dart/sshnp_flutter/pubspec.lock
Original file line number Diff line number Diff line change
Expand Up @@ -745,10 +745,10 @@ packages:
dependency: "direct main"
description:
name: noports_core
sha256: a74b987dde3f5781bab4a4646a3c825d63b6c8147b9f6eeedc4fa5dd7ddb18d2
sha256: "691a9547242e71d83704c127dba4455efeb70ab0457462e461c609b55fdbf595"
url: "https://pub.dev"
source: hosted
version: "5.0.4"
version: "6.0.1"
openssh_ed25519:
dependency: transitive
description:
Expand Down Expand Up @@ -1078,10 +1078,10 @@ packages:
dependency: "direct main"
description:
name: socket_connector
sha256: "8a5b67ae79e232186caa166ae640fac2247db390d4f5d11ed8975f95527fd355"
sha256: "7a063478d8a191447c297d480bf344179b239c52063f13f47d71acbaf4941064"
url: "https://pub.dev"
source: hosted
version: "1.0.11"
version: "2.0.1"
source_span:
dependency: transitive
description:
Expand Down
4 changes: 2 additions & 2 deletions packages/dart/sshnp_flutter/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -31,12 +31,12 @@ dependencies:
intl: any
macos_ui: ^2.0.0
mocktail: ^1.0.0
noports_core: ^5.0.0
noports_core: ^6.0.0
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

noports_core: ^6.0.1

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@CurtlyCritchlow still need to change the noports_core dependency

page_transition: ^2.0.9
path: ^1.8.3
path_provider: ^2.1.1
shared_preferences: ^2.2.2
socket_connector: ^1.0.11
socket_connector: ^2.0.1
url_launcher: ^6.1.14
uuid: ^3.0.7
xterm: ^3.5.0
Expand Down