-
Notifications
You must be signed in to change notification settings - Fork 15
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
refactor: make sshnp more modular #201
Conversation
…in functionality. Have not yet tested using sshrvd, but have found no issues otherwise via manual testing
Testing your branch sshnpd
sshnp
ERROR on sshnp
When switched back to trunk, I no longer get the above error. |
…ndLineArgs` to pass it to the constructor docs: added more documentation of all instance variables refactor: removed the `counter` instance variable, made into a local variable instead refactor: renamed `ack` and `ackErrors` instance variables, introduced `sshnpdAck` and `sshnpdAckErrors` to track responses from sshnpd, and introduced `sshrvdAck` to track response from sshrvd refactor: renamed `setupSshKeys` to `generateSshKeys` refactor: moved the code to initialize `localPort` and `commandToSend` into `init()`
….$sshrvdNameSpace'` (i.e. added a "dot" separator) in `getHostAndPortFromSshrvd` ... bug crept in because `device` pre-refactor had the 'dot' appended to it, but the refactored version just has the device name and is appending the dot separator where needed elsewhere - but I missed this usage
While we have the code open.. sshnp shoukd have a -u option to specify the username if the sshnpd was not sharing it. This is a bug/oversight in sshnp right now.. |
Latest commits fixed this issue. Additional context and proof can be found in the issue ticket |
I see a LateInitializationError that I need to fix |
refactor: move generation of sessionId into SSHNP.fromCommandLineArgs; add sessionId as final instance variable to SSHNP class, and inject it via SSHNP constructor refactor: combine home_directory.dart, check_non_ascii.dart and check_file_exists.dart into single new file, sshnp_utils.dart refactor: move getUserName() from bin/sshnp.dart to sshnp_utils.dart
Fixed in latest commit |
This PR is ready for review and merge, subject to another round of verification testing from @JeremyTubongbanua or @cconstab |
@gkc getting these as of commit 5a02053 sshnp error
sshnpd error
sshnpatsign@94accbdfd63d:~$ ~/.local/binrefactor/sshnp -f @jeremy_0 -t @smoothalligator -d docker -h @rv_am -s id_ed25519.pub -v
INFO|2023-06-14 01:16:00.735783|AtClientManager|setCurrentAtSign called with atSign @jeremy_0
INFO|2023-06-14 01:16:00.735822|AtClientManager|Switching atSigns from null to @jeremy_0
INFO|2023-06-14 01:16:00.737096|HiveBase|commit_log_3c074c7d3712aa56c1d3e81561c463442f282dfda4ddcc62a724ea0844c2f0e0 initialized successfully
INFO|2023-06-14 01:16:00.737993|HiveBase|3c074c7d3712aa56c1d3e81561c463442f282dfda4ddcc62a724ea0844c2f0e0 initialized successfully
INFO|2023-06-14 01:16:00.738030|AtClientCommitLogCompaction (@jeremy_0)|Starting commit log compaction job running for every 11 minute(s)
INFO|2023-06-14 01:16:00.738491|AtClientManager|setCurrentAtSign complete
INFO|2023-06-14 01:16:00.738523|AtLookup|Creating new connection
INFO|2023-06-14 01:16:01.258288|AtLookup|New connection created OK
INFO|2023-06-14 01:16:01.402257|AtLookup|auth success
INFO|2023-06-14 01:16:01.404670| sshnp |Subscribing to notifications on 801f4ff9-fb71-4015-a90a-b28a5c02e5d4.docker.sshnp@
INFO|2023-06-14 01:16:01.678340|Monitor (@jeremy_0)|monitor started for @jeremy_0 with last notification time: null
INFO|2023-06-14 01:16:01.720694|AbstractAtKeyEncryption (@jeremy_0)|Encrypted shared symmetric key for @jeremy_0 not found in local storage
INFO|2023-06-14 01:16:01.720725|AbstractAtKeyEncryption (@jeremy_0)|Deleting @rv_am:shared_key@jeremy_0 from LocalSecondary
INFO|2023-06-14 01:16:01.720829|AbstractAtKeyEncryption (@jeremy_0)|Fetching shared symmetric key for @jeremy_0 from atServer
INFO|2023-06-14 01:16:01.791019|AbstractAtKeyEncryption (@jeremy_0)|Retrieved my encrypted copy of shared symmetric key for @rv_am from atServer - saving to local storage
INFO|2023-06-14 01:16:01.793855|AbstractAtKeyEncryption (@jeremy_0)|'Their' copy of shared symmetric key for @rv_am not found in local storage - will check atServer
INFO|2023-06-14 01:16:01.863674|AbstractAtKeyEncryption (@jeremy_0)|Found 'their' copy of shared symmetric key for @rv_am in atServer - saving to local storage
INFO|2023-06-14 01:16:02.551375| sshnp |SUCCESS:id: 4ca0828b-b5f2-47c2-ba23-8c11301ab7e3 status: NotificationStatusEnum.delivered @rv_am:docker.sshrvd@jeremy_0
INFO|2023-06-14 01:16:02.775665|AbstractAtKeyEncryption (@jeremy_0)|Encrypted shared symmetric key for @jeremy_0 not found in local storage
INFO|2023-06-14 01:16:02.775711|AbstractAtKeyEncryption (@jeremy_0)|Deleting @smoothalligator:shared_key@jeremy_0 from LocalSecondary
INFO|2023-06-14 01:16:02.775886|AbstractAtKeyEncryption (@jeremy_0)|Fetching shared symmetric key for @jeremy_0 from atServer
INFO|2023-06-14 01:16:02.832401|AbstractAtKeyEncryption (@jeremy_0)|Retrieved my encrypted copy of shared symmetric key for @smoothalligator from atServer - saving to local storage
INFO|2023-06-14 01:16:02.835821|AbstractAtKeyEncryption (@jeremy_0)|'Their' copy of shared symmetric key for @smoothalligator not found in local storage - will check atServer
INFO|2023-06-14 01:16:02.895765|AbstractAtKeyEncryption (@jeremy_0)|Found 'their' copy of shared symmetric key for @smoothalligator in atServer - saving to local storage
INFO|2023-06-14 01:16:03.584285| sshnp |SUCCESS:id: 9b5bb531-b49a-4302-bbc6-2f0374360449 status: NotificationStatusEnum.delivered
INFO|2023-06-14 01:16:04.311256| sshnp |SUCCESS:id: 4bf14f0f-9b40-4ab9-a016-37c32421b19d status: NotificationStatusEnum.delivered
INFO|2023-06-14 01:16:04.648421| sshnp |Received 801f4ff9-fb71-4015-a90a-b28a5c02e5d4 notification
Remote sshnpd error: Remote SSH Client failure : SocketException: Failed host lookup: '@rv_am' (OS Error: Name or service not known, errno = -2)
INFO|2023-06-14 01:16:05.008236| sshnp |SUCCESS:id: 3dde7632-0b46-4a04-b80f-76c089cf8bc4 status: NotificationStatusEnum.delivered 37449 22 atsign @rv_am 801f4ff9-fb71-4015-a90a-b28a5c02e5d4
INFO|2023-06-14 01:16:05.008266| sshnp |Tidying up files
atsign@94accbdfd63d:~$ sshnpd
|
Oh bother, I borked it again. Will fix in the am, it's a sequencing problem I introduced in the commit to fix the late initialization error. I should have just fixed the log messages |
…g sshString must happen _after_ we have fetched stuff from sshrvd (if required to)
@JeremyTubongbanua Decided not to wait until the morning. I've fixed that sequencing problem now in a28c44f |
@gkc That worked! sshnp
sshnpd
Goodnight :) |
… mandatory args are not supplied)
…and `getHomeDirectory` in sshnp_utils.dart
…etSSHNPParams, which does some additional work after first using the ArgParser
… args are supplied feat: created methods feat: created `getDefaultAtKeysFilePath` and `getDefaultSshDirectory` functions in sshnp_utils.dart refactor: removed some redundant code fix: wherever using literal '/' in path names, replace with `Platform.pathSeparator`
# Conflicts: # lib/sshnp.dart
feat: implemented #202
Merged in changes from #208 (thank you @purnimavenkatasubbu) |
- What I did
complete restructuring of sshnp.dart
- How I did it
final
orlate final
orlate
or just normal volatile instance variables as appropriateinit()
andrun()
)main()
in bin/sshnp.dart