refactor: centralize system paths and SSH key discovery #134
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This pull request refactors SSH key management and related constants to centralize logic, improve maintainability, and ensure consistent usage of SSH directory paths across the codebase. The main changes involve moving SSH key utilities and constants to
config_observer.rs, updating references throughout the application, and enhancing user-facing messages for clarity.SSH Key Management Refactor:
SshKeyPairstruct,get_ssh_dir, andload_ssh_keysfunctions fromui/ssh_keys.rstoconfig_observer.rs, consolidating SSH key logic in a single location. ([[1]](https://github.com/Cleboost/Rustmius/pull/134/files#diff-62a48d93070189103c8bcddc6c959538d130cbd7c9349316fa20fc3575caa25cR17-R56),[[2]](https://github.com/Cleboost/Rustmius/pull/134/files#diff-4750f20168a2936759b01f845a100a3b1044258228152af5e6519aa82463a7aaL35-L69))ui/ssh_keys.rsandadd_server_dialog.rsto use the new centralized definitions fromconfig_observer.rs. ([[1]](https://github.com/Cleboost/Rustmius/pull/134/files#diff-4750f20168a2936759b01f845a100a3b1044258228152af5e6519aa82463a7aaL6-R6),[[2]](https://github.com/Cleboost/Rustmius/pull/134/files#diff-d99b8afb47f078a6bc7632396dc533fdb025c64fc50ed134a142d46c4d9c6d09L3-R3))SSH Directory Constants and Usage:
REMOTE_SSH_DIR,REMOTE_AUTHORIZED_KEYS, andREMOTE_SSH_CONFIGinconfig_observer.rsfor consistent referencing of SSH-related paths. ([src/config_observer.rsR17-R56](https://github.com/Cleboost/Rustmius/pull/134/files#diff-62a48d93070189103c8bcddc6c959538d130cbd7c9349316fa20fc3575caa25cR17-R56))ssh_engine.rsto use these new constants, ensuring path correctness and maintainability. ([[1]](https://github.com/Cleboost/Rustmius/pull/134/files#diff-f48442d6fe3dd48b17416029df81da8c6b5451d004bbd8cd074a377dfed85b5eL5-R5),[[2]](https://github.com/Cleboost/Rustmius/pull/134/files#diff-f48442d6fe3dd48b17416029df81da8c6b5451d004bbd8cd074a377dfed85b5eL72-R76))UI Improvements:
[[1]](https://github.com/Cleboost/Rustmius/pull/134/files#diff-4750f20168a2936759b01f845a100a3b1044258228152af5e6519aa82463a7aaL119-R82),[[2]](https://github.com/Cleboost/Rustmius/pull/134/files#diff-4750f20168a2936759b01f845a100a3b1044258228152af5e6519aa82463a7aaL424-R387),[[3]](https://github.com/Cleboost/Rustmius/pull/134/files#diff-4750f20168a2936759b01f845a100a3b1044258228152af5e6519aa82463a7aaL543-R506))Other Improvements:
get_default_config_pathinconfig_observer.rsto use the newget_ssh_dirfunction for consistency. ([src/config_observer.rsL70-R110](https://github.com/Cleboost/Rustmius/pull/134/files#diff-62a48d93070189103c8bcddc6c959538d130cbd7c9349316fa20fc3575caa25cL70-R110))These changes collectively improve code organization, reduce duplication, and make the handling of SSH keys and paths more robust and user-friendly.