atsign-foundation / noports

Connect to any device with no external listening ports open
https://noports.com
BSD 3-Clause "New" or "Revised" License
265 stars 15 forks source link

Python sshnpd works but you need to specify `--no-ad --no-et` #1023

Closed cconstab closed 3 months ago

cconstab commented 4 months ago

Is your feature request related to a problem? Please describe.

need to specify --no-ad --no-et when the daemon is using the Python sshnpd.

How would you know to do this ?

Describe the solution you'd like

Could the sshnp command find this out and remove the need to specify these arguments ?

Describe alternatives you've considered

No response

Additional context

No response

gkc commented 4 months ago

Feature discovery is already done; currently clients (sshnp and npt) will throw an error if a feature they require is not available on the daemon

e.g. (snippet from sshnp in SshnpCore.initialize):

    List<(DaemonFeature, bool, String)> features = await featureCheckFuture;
    sendProgress('Received daemon feature check response');

    for (final (DaemonFeature _, bool supported, String reason) in features) {
      if (!supported) throw SshnpError(reason);
    }

We could improve the error messages which are displayed based on what features are missing; currently for example we would show "This device daemon does not authenticate to the socket rendezvous" - instead we could show "This device daemon is on an older version which does not support authentication to the socket rendezvous; use the '--no-ad' option in your client command-line"

All of the descriptions are in an extension to the DaemonFeature enum

extension FeatureDescription on DaemonFeature {
  String get description {
    switch (this) {
      case DaemonFeature.acceptsPublicKeys:
        return 'accept ssh public keys from the client';
      case DaemonFeature.srAuth:
        return 'authenticate to the socket rendezvous';
      case DaemonFeature.srE2ee:
        return 'encrypt traffic to the socket rendezvous';
      case DaemonFeature.supportsPortChoice:
        return 'support requests for specific device ports';
    }
  }
}

Path of least resistance, and safest imo, is to output a better message - i.e. update the descriptions in the FeatureDescription extension. I did initially consider having the clients auto-adjust their session parameters based on what the daemon supported but I think it is better to be very explicit.

cpswan commented 3 months ago

Docs updated by https://github.com/atsign-foundation/noports/pull/1048 to point out that flags are needed.