machineconfig 7.98__py3-none-any.whl → 8.61__py3-none-any.whl
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.
- machineconfig/cluster/remote/run_cluster.py +1 -1
- machineconfig/cluster/remote/run_remote.py +1 -1
- machineconfig/cluster/sessions_managers/utils/maker.py +10 -8
- machineconfig/cluster/sessions_managers/wt_local.py +1 -1
- machineconfig/cluster/sessions_managers/wt_local_manager.py +1 -1
- machineconfig/cluster/sessions_managers/zellij_local.py +1 -1
- machineconfig/cluster/sessions_managers/zellij_local_manager.py +1 -1
- machineconfig/jobs/installer/checks/check_installations.py +133 -0
- machineconfig/jobs/installer/checks/install_utils.py +132 -0
- machineconfig/jobs/installer/checks/report_utils.py +39 -0
- machineconfig/jobs/installer/checks/vt_utils.py +89 -0
- machineconfig/jobs/installer/installer_data.json +271 -152
- machineconfig/jobs/installer/linux_scripts/docker.sh +6 -9
- machineconfig/jobs/installer/package_groups.py +11 -9
- machineconfig/jobs/installer/{custom → python_scripts}/boxes.py +1 -2
- machineconfig/jobs/installer/{custom_dev → python_scripts}/brave.py +1 -1
- machineconfig/jobs/installer/{custom_dev → python_scripts}/code.py +10 -8
- machineconfig/jobs/installer/{custom → python_scripts}/hx.py +30 -13
- machineconfig/jobs/installer/{custom_dev → python_scripts}/nerdfont.py +1 -1
- machineconfig/jobs/installer/{custom_dev → python_scripts}/nerfont_windows_helper.py +6 -5
- machineconfig/jobs/installer/{custom_dev → python_scripts}/sysabc.py +28 -43
- machineconfig/jobs/installer/{custom_dev → python_scripts}/wezterm.py +1 -1
- machineconfig/jobs/installer/{custom → python_scripts}/yazi.py +39 -19
- machineconfig/jobs/scripts/powershell_scripts/cmatrix.ps1 +52 -0
- machineconfig/jobs/scripts_dynamic/a.py +428 -0
- machineconfig/logger.py +1 -1
- machineconfig/profile/create_helper.py +21 -10
- machineconfig/profile/create_links.py +77 -20
- machineconfig/profile/create_links_export.py +63 -58
- machineconfig/profile/create_shell_profile.py +14 -0
- machineconfig/profile/mapper_data.toml +45 -0
- machineconfig/profile/mapper_dotfiles.toml +249 -0
- machineconfig/scripts/python/agents.py +76 -171
- machineconfig/scripts/python/ai/initai.py +3 -1
- machineconfig/scripts/python/ai/scripts/__init__.py +1 -0
- machineconfig/scripts/python/ai/scripts/lint_and_type_check.ps1 +2 -0
- machineconfig/scripts/python/ai/scripts/lint_and_type_check.sh +8 -6
- machineconfig/scripts/python/ai/solutions/claude/claude.py +1 -1
- machineconfig/scripts/python/ai/solutions/cline/cline.py +1 -1
- machineconfig/scripts/python/ai/solutions/copilot/github_copilot.py +1 -1
- machineconfig/scripts/python/ai/solutions/copilot/instructions/python/dev.instructions.md +29 -0
- machineconfig/scripts/python/ai/solutions/crush/crush.py +1 -1
- machineconfig/scripts/python/ai/solutions/cursor/cursors.py +1 -1
- machineconfig/scripts/python/ai/solutions/gemini/gemini.py +1 -1
- machineconfig/scripts/python/ai/solutions/gemini/settings.json +3 -0
- machineconfig/scripts/python/ai/{solutions → utils}/generic.py +2 -15
- machineconfig/scripts/python/ai/utils/vscode_tasks.py +6 -3
- machineconfig/scripts/python/cloud.py +58 -11
- machineconfig/scripts/python/croshell.py +4 -155
- machineconfig/scripts/python/devops.py +57 -38
- machineconfig/scripts/python/devops_navigator.py +17 -3
- machineconfig/scripts/python/fire_jobs.py +10 -193
- machineconfig/scripts/python/ftpx.py +5 -224
- machineconfig/scripts/python/graph/cli_graph.json +8743 -0
- machineconfig/scripts/python/{env_manager → helper_env}/path_manager_tui.py +2 -2
- machineconfig/scripts/python/{env_manager → helpers/helper_env}/env_manager_tui.py +1 -1
- machineconfig/scripts/python/helpers/helper_env/path_manager_tui.py +228 -0
- machineconfig/scripts/python/{helpers_agents → helpers/helpers_agents}/agentic_frameworks/fire_crush.py +1 -1
- machineconfig/scripts/python/{helpers_agents → helpers/helpers_agents}/agentic_frameworks/fire_cursor_agents.py +1 -1
- machineconfig/scripts/python/{helpers_agents → helpers/helpers_agents}/agentic_frameworks/fire_gemini.py +1 -1
- machineconfig/scripts/python/{helpers_agents → helpers/helpers_agents}/agentic_frameworks/fire_qwen.py +1 -1
- machineconfig/scripts/python/helpers/helpers_agents/agents_impl.py +168 -0
- machineconfig/scripts/python/{helpers_agents → helpers/helpers_agents}/fire_agents_help_launch.py +10 -7
- machineconfig/scripts/python/helpers/helpers_agents/privacy/configs/aichat/config.yaml +5 -0
- machineconfig/scripts/python/helpers/helpers_agents/privacy/configs/aider/.aider.conf.yml +2 -0
- machineconfig/scripts/python/helpers/helpers_agents/privacy/configs/copilot/config.yml +1 -0
- machineconfig/scripts/python/helpers/helpers_agents/privacy/configs/crush/crush.json +10 -0
- machineconfig/scripts/python/helpers/helpers_agents/privacy/configs/gemini/settings.json +12 -0
- machineconfig/scripts/python/helpers/helpers_agents/privacy/privacy.py +109 -0
- machineconfig/scripts/python/{helpers_agents → helpers/helpers_agents}/templates/template.sh +3 -1
- machineconfig/scripts/python/{helpers_cloud → helpers/helpers_cloud}/cloud_copy.py +6 -6
- machineconfig/scripts/python/{helpers_cloud → helpers/helpers_cloud}/cloud_mount.py +10 -5
- machineconfig/scripts/python/{helpers_cloud → helpers/helpers_cloud}/cloud_sync.py +4 -4
- machineconfig/scripts/python/{helpers_cloud → helpers/helpers_cloud}/helpers2.py +1 -1
- machineconfig/scripts/python/helpers/helpers_croshell/croshell_impl.py +229 -0
- machineconfig/scripts/python/{helpers_croshell → helpers/helpers_croshell}/scheduler.py +4 -4
- machineconfig/scripts/python/{helpers_croshell → helpers/helpers_croshell}/start_slidev.py +7 -6
- machineconfig/scripts/python/helpers/helpers_devops/backup_config.py +149 -0
- machineconfig/scripts/python/helpers/helpers_devops/cli_backup_retrieve.py +262 -0
- machineconfig/scripts/python/helpers/helpers_devops/cli_config.py +130 -0
- machineconfig/scripts/python/helpers/helpers_devops/cli_config_dotfile.py +274 -0
- machineconfig/scripts/python/helpers/helpers_devops/cli_config_mount.py +77 -0
- machineconfig/scripts/python/helpers/helpers_devops/cli_data.py +71 -0
- machineconfig/scripts/python/helpers/helpers_devops/cli_nw.py +285 -0
- machineconfig/scripts/python/helpers/helpers_devops/cli_repos.py +274 -0
- machineconfig/scripts/python/{helpers_devops → helpers/helpers_devops}/cli_self.py +84 -33
- machineconfig/scripts/python/{helpers_devops → helpers/helpers_devops}/cli_share_file.py +44 -30
- machineconfig/scripts/python/{helpers_devops → helpers/helpers_devops}/cli_share_server.py +26 -43
- machineconfig/scripts/python/helpers/helpers_devops/cli_share_temp.py +69 -0
- machineconfig/scripts/python/{helpers_devops → helpers/helpers_devops}/cli_share_terminal.py +12 -6
- machineconfig/scripts/python/helpers/helpers_devops/cli_ssh.py +167 -0
- machineconfig/scripts/python/{helpers_devops → helpers/helpers_devops}/devops_status.py +12 -6
- machineconfig/scripts/python/{helpers_devops → helpers/helpers_devops}/devops_update_repos.py +1 -1
- machineconfig/scripts/python/{interactive.py → helpers/helpers_devops/interactive.py} +64 -50
- machineconfig/scripts/python/helpers/helpers_devops/mount_helpers/commands.py +25 -0
- machineconfig/scripts/python/helpers/helpers_devops/mount_helpers/device_entry.py +17 -0
- machineconfig/scripts/python/helpers/helpers_devops/mount_helpers/devices.py +17 -0
- machineconfig/scripts/python/helpers/helpers_devops/mount_helpers/linux.py +103 -0
- machineconfig/scripts/python/helpers/helpers_devops/mount_helpers/macos.py +100 -0
- machineconfig/scripts/python/helpers/helpers_devops/mount_helpers/selection.py +47 -0
- machineconfig/scripts/python/helpers/helpers_devops/mount_helpers/utils.py +28 -0
- machineconfig/scripts/python/helpers/helpers_devops/mount_helpers/windows.py +91 -0
- machineconfig/scripts/python/helpers/helpers_devops/run_script.py +197 -0
- machineconfig/scripts/python/helpers/helpers_devops/themes/choose_starship_theme.ps1 +41 -0
- machineconfig/scripts/python/helpers/helpers_devops/themes/choose_starship_theme.sh +48 -0
- machineconfig/scripts/python/{helpers_devops → helpers/helpers_devops}/themes/choose_wezterm_theme.py +3 -3
- machineconfig/scripts/python/{helpers_fire_command → helpers/helpers_fire_command}/file_wrangler.py +1 -0
- machineconfig/scripts/python/{helpers_fire_command → helpers/helpers_fire_command}/fire_jobs_args_helper.py +1 -0
- machineconfig/scripts/python/helpers/helpers_fire_command/fire_jobs_impl.py +233 -0
- machineconfig/scripts/python/{helpers_fire_command → helpers/helpers_fire_command}/fire_jobs_route_helper.py +3 -3
- machineconfig/scripts/python/helpers/helpers_fire_command/fire_jobs_streamlit_helper.py +0 -0
- machineconfig/scripts/python/helpers/helpers_msearch/msearch_impl.py +248 -0
- machineconfig/scripts/python/{helpers_msearch → helpers/helpers_msearch}/scripts_linux/fzfg +4 -3
- machineconfig/scripts/python/helpers/helpers_msearch/scripts_linux/search_with_context.sh +48 -0
- machineconfig/scripts/python/{helpers_msearch → helpers/helpers_msearch}/scripts_windows/fzfg.ps1 +2 -7
- machineconfig/scripts/python/helpers/helpers_navigator/__init__.py +20 -0
- machineconfig/scripts/python/helpers/helpers_navigator/cli_graph_loader.py +234 -0
- machineconfig/scripts/python/{helpers_navigator → helpers/helpers_navigator}/command_builder.py +61 -13
- machineconfig/scripts/python/helpers/helpers_navigator/command_detail.py +153 -0
- machineconfig/scripts/python/helpers/helpers_navigator/command_tree.py +45 -0
- machineconfig/scripts/python/{helpers_navigator → helpers/helpers_navigator}/data_models.py +18 -11
- machineconfig/scripts/python/{helpers_navigator → helpers/helpers_navigator}/main_app.py +5 -5
- machineconfig/scripts/python/helpers/helpers_network/__init__.py +0 -0
- machineconfig/scripts/python/{helpers_network → helpers/helpers_network}/address.py +52 -10
- machineconfig/scripts/python/helpers/helpers_network/address_switch.py +78 -0
- machineconfig/scripts/python/helpers/helpers_network/ftpx_impl.py +276 -0
- machineconfig/scripts/python/helpers/helpers_network/ssh/__init__.py +0 -0
- machineconfig/scripts/python/helpers/helpers_network/ssh/ssh_add_identity.py +73 -0
- machineconfig/scripts/python/helpers/helpers_network/ssh/ssh_add_key_windows.py +23 -0
- machineconfig/scripts/python/helpers/helpers_network/ssh/ssh_add_ssh_key.py +169 -0
- machineconfig/scripts/python/helpers/helpers_network/ssh/ssh_cloud_init.py +33 -0
- machineconfig/scripts/python/helpers/helpers_network/ssh/ssh_debug_linux.py +338 -0
- machineconfig/scripts/python/helpers/helpers_network/ssh/ssh_debug_linux_utils.py +35 -0
- machineconfig/scripts/python/helpers/helpers_network/ssh/ssh_debug_windows.py +245 -0
- machineconfig/scripts/python/helpers/helpers_network/ssh/ssh_debug_windows_utils.py +34 -0
- machineconfig/scripts/python/{helpers_repos → helpers/helpers_repos}/action.py +3 -3
- machineconfig/scripts/python/{helpers_repos → helpers/helpers_repos}/action_helper.py +3 -3
- machineconfig/scripts/python/{helpers_repos → helpers/helpers_repos}/cloud_repo_sync.py +120 -37
- machineconfig/scripts/python/{helpers_repos → helpers/helpers_repos}/grource.py +3 -2
- machineconfig/scripts/python/{helpers_repos → helpers/helpers_repos}/record.py +33 -13
- machineconfig/scripts/python/{helpers_repos → helpers/helpers_repos}/repo_analyzer_2.py +63 -19
- machineconfig/scripts/python/{helpers_repos → helpers/helpers_repos}/update.py +0 -6
- machineconfig/scripts/python/helpers/helpers_search/script_help.py +81 -0
- machineconfig/scripts/python/helpers/helpers_sessions/__init__.py +0 -0
- machineconfig/scripts/python/helpers/helpers_sessions/attach_impl.py +87 -0
- machineconfig/scripts/python/helpers/helpers_sessions/sessions_impl.py +114 -0
- machineconfig/scripts/python/{helpers_sessions → helpers/helpers_sessions}/sessions_multiprocess.py +1 -2
- machineconfig/scripts/python/helpers/helpers_sessions/utils.py +69 -0
- machineconfig/scripts/python/{helpers_utils → helpers/helpers_utils}/download.py +1 -1
- machineconfig/scripts/python/{helpers_devops/cli_utils.py → helpers/helpers_utils/pdf.py} +2 -2
- machineconfig/scripts/python/{helpers_utils/path.py → helpers/helpers_utils/python.py} +65 -40
- machineconfig/scripts/python/helpers/helpers_utils/specs.py +246 -0
- machineconfig/scripts/python/mcfg_entry.py +126 -48
- machineconfig/scripts/python/msearch.py +16 -61
- machineconfig/scripts/python/sessions.py +137 -191
- machineconfig/scripts/python/utils.py +104 -24
- machineconfig/settings/atuin/config.toml +294 -0
- machineconfig/settings/atuin/themes/catppuccin-mocha-mauve.toml +12 -0
- machineconfig/settings/linters/.ruff.toml +2 -1
- machineconfig/settings/mprocs/windows/mprocs.yaml +2 -2
- machineconfig/settings/shells/bash/init.sh +6 -10
- machineconfig/settings/shells/nushell/config.nu +23 -1
- machineconfig/settings/shells/nushell/env.nu +22 -48
- machineconfig/settings/shells/nushell/init.nu +64 -240
- machineconfig/settings/shells/pwsh/init.ps1 +71 -5
- machineconfig/settings/shells/pwsh/search_pwsh_history.ps1 +99 -0
- machineconfig/settings/shells/wezterm/wezterm.lua +4 -0
- machineconfig/settings/shells/wt/settings.json +31 -37
- machineconfig/settings/shells/zsh/init.sh +25 -5
- machineconfig/settings/television/cable_unix/bash-history.toml +1 -1
- machineconfig/settings/television/cable_windows/pwsh-history.toml +1 -1
- machineconfig/settings/tv/config.toml +234 -0
- machineconfig/settings/tv/themes/catppuccin-mocha-sky.toml +22 -0
- machineconfig/settings/wsl/.wslconfig +5 -30
- machineconfig/settings/wt/__init__.py +0 -0
- machineconfig/settings/yazi/yazi_linux.toml +18 -8
- machineconfig/settings/zellij/__init__.py +0 -0
- machineconfig/settings/zellij/config.kdl +0 -295
- machineconfig/settings/zellij/layouts/__init__.py +0 -0
- machineconfig/settings/zellij/layouts/st.kdl +39 -9
- machineconfig/settings/zellij/layouts/st2.kdl +6 -2
- machineconfig/setup_linux/__init__.py +0 -1
- machineconfig/setup_linux/apps_desktop.sh +8 -27
- machineconfig/setup_linux/web_shortcuts/interactive.sh +10 -10
- machineconfig/setup_linux/web_shortcuts/live_from_github.sh +3 -0
- machineconfig/setup_mac/__init__.py +0 -2
- machineconfig/setup_windows/__init__.py +2 -5
- machineconfig/setup_windows/web_shortcuts/interactive.ps1 +14 -13
- machineconfig/setup_windows/web_shortcuts/live_from_github.ps1 +4 -3
- machineconfig/setup_windows/web_shortcuts/quick_init.ps1 +3 -3
- machineconfig/type_hinting/sql/__init__.py +1 -0
- machineconfig/type_hinting/sql/base.py +216 -0
- machineconfig/type_hinting/sql/core_schema.py +64 -0
- machineconfig/type_hinting/sql/core_schema_typeddict.py +41 -0
- machineconfig/type_hinting/sql/typeddict_codegen.py +222 -0
- machineconfig/type_hinting/typedict/__init__.py +1 -0
- machineconfig/type_hinting/typedict/ast_utils.py +130 -0
- machineconfig/type_hinting/typedict/generator_helpers.py +319 -0
- machineconfig/type_hinting/typedict/generators.py +231 -0
- machineconfig/type_hinting/typedict/polars_schema.py +24 -0
- machineconfig/type_hinting/typedict/polars_schema_typeddict.py +63 -0
- machineconfig/utils/accessories.py +24 -0
- machineconfig/utils/code.py +78 -33
- machineconfig/utils/files/ascii_art.py +10 -14
- machineconfig/utils/files/headers.py +3 -5
- machineconfig/utils/files/read.py +8 -1
- machineconfig/utils/installer_utils/github_release_bulk.py +11 -91
- machineconfig/utils/installer_utils/github_release_scraper.py +99 -0
- machineconfig/utils/installer_utils/install_from_url.py +1 -1
- machineconfig/utils/installer_utils/installer_class.py +12 -4
- machineconfig/utils/installer_utils/installer_cli.py +7 -17
- machineconfig/utils/installer_utils/installer_helper.py +52 -36
- machineconfig/utils/installer_utils/installer_locator_utils.py +15 -25
- machineconfig/utils/installer_utils/installer_runner.py +4 -4
- machineconfig/utils/io.py +25 -8
- machineconfig/utils/meta.py +6 -4
- machineconfig/utils/options.py +49 -19
- machineconfig/utils/options_utils/__init__.py +0 -0
- machineconfig/utils/options_utils/options_tv_linux.py +211 -0
- machineconfig/utils/options_utils/options_tv_windows.py +88 -0
- machineconfig/utils/options_utils/tv_options.py +37 -0
- machineconfig/utils/path_extended.py +8 -7
- machineconfig/utils/procs.py +35 -27
- machineconfig/utils/scheduler.py +8 -2
- machineconfig/utils/schemas/fire_agents/fire_agents_input.py +1 -1
- machineconfig/utils/schemas/layouts/layout_types.py +10 -0
- machineconfig/utils/source_of_truth.py +7 -1
- machineconfig/utils/ssh.py +73 -23
- machineconfig/utils/ssh_utils/abc.py +1 -1
- machineconfig/utils/ssh_utils/copy_from_here.py +19 -14
- machineconfig/utils/ssh_utils/copy_to_here.py +2 -1
- machineconfig/utils/ssh_utils/utils.py +23 -7
- machineconfig/utils/ssh_utils/wsl.py +107 -170
- machineconfig/utils/ssh_utils/wsl_helper.py +217 -0
- machineconfig/utils/upgrade_packages.py +4 -8
- {machineconfig-7.98.dist-info → machineconfig-8.61.dist-info}/METADATA +30 -23
- machineconfig-8.61.dist-info/RECORD +539 -0
- {machineconfig-7.98.dist-info → machineconfig-8.61.dist-info}/entry_points.txt +0 -1
- machineconfig/jobs/installer/check_installations.py +0 -248
- machineconfig/profile/backup.toml +0 -49
- machineconfig/profile/mapper.toml +0 -263
- machineconfig/scripts/linux/other/share_cloud.sh +0 -64
- machineconfig/scripts/linux/other/share_nfs +0 -49
- machineconfig/scripts/linux/other/start_docker +0 -23
- machineconfig/scripts/linux/other/switch_ip +0 -20
- machineconfig/scripts/python/helpers/run_py_script.py +0 -79
- machineconfig/scripts/python/helpers/tmp_py_scripts/a.py +0 -26
- machineconfig/scripts/python/helpers_devops/cli_config.py +0 -105
- machineconfig/scripts/python/helpers_devops/cli_config_dotfile.py +0 -89
- machineconfig/scripts/python/helpers_devops/cli_data.py +0 -25
- machineconfig/scripts/python/helpers_devops/cli_nw.py +0 -214
- machineconfig/scripts/python/helpers_devops/cli_repos.py +0 -215
- machineconfig/scripts/python/helpers_devops/devops_backup_retrieve.py +0 -80
- machineconfig/scripts/python/helpers_devops/themes/choose_starship_theme.bash +0 -3
- machineconfig/scripts/python/helpers_navigator/__init__.py +0 -20
- machineconfig/scripts/python/helpers_navigator/command_detail.py +0 -44
- machineconfig/scripts/python/helpers_navigator/command_tree.py +0 -620
- machineconfig/scripts/python/helpers_network/devops_add_identity.py +0 -82
- machineconfig/scripts/python/helpers_network/devops_add_ssh_key.py +0 -153
- machineconfig/scripts/python/helpers_network/mount_drive +0 -128
- machineconfig/scripts/python/helpers_network/mount_nfs +0 -49
- machineconfig/scripts/python/helpers_network/mount_nfs.py +0 -85
- machineconfig/scripts/python/helpers_network/mount_nw_drive +0 -61
- machineconfig/scripts/python/helpers_network/mount_nw_drive.py +0 -48
- machineconfig/scripts/python/helpers_network/mount_smb +0 -3
- machineconfig/scripts/python/helpers_network/mount_ssh.py +0 -64
- machineconfig/scripts/python/helpers_network/ssh_debug_linux.py +0 -391
- machineconfig/scripts/python/helpers_network/ssh_debug_windows.py +0 -338
- machineconfig/scripts/python/helpers_network/wsl_windows_transfer.py +0 -67
- machineconfig/scripts/python/helpers_repos/entrypoint.py +0 -77
- machineconfig/scripts/python/terminal.py +0 -133
- machineconfig/scripts/windows/mounts/Restore-ThunderbirdProfile.ps1 +0 -92
- machineconfig/scripts/windows/mounts/mount_nfs.ps1 +0 -42
- machineconfig/scripts/windows/mounts/mount_nw.ps1 +0 -9
- machineconfig/scripts/windows/mounts/mount_smb.ps1 +0 -2
- machineconfig/scripts/windows/mounts/mount_ssh.ps1 +0 -13
- machineconfig/scripts/windows/mounts/share_cloud.cmd +0 -34
- machineconfig/scripts/windows/mounts/share_smb.ps1 +0 -16
- machineconfig/settings/zellij/config.orig.kdl +0 -295
- machineconfig/setup_linux/others/android.sh +0 -2
- machineconfig/setup_linux/others/mint_keyboard_shortcuts.sh +0 -30
- machineconfig/setup_linux/ssh/openssh_all.sh +0 -25
- machineconfig/setup_linux/ssh/openssh_wsl.sh +0 -38
- machineconfig/setup_mac/ssh/openssh_setup.sh +0 -114
- machineconfig/setup_windows/others/docker.ps1 +0 -7
- machineconfig/setup_windows/others/obs.ps1 +0 -4
- machineconfig/setup_windows/others/power_options.ps1 +0 -7
- machineconfig/setup_windows/ssh/add-sshkey.ps1 +0 -29
- machineconfig/setup_windows/ssh/add_identity.ps1 +0 -11
- machineconfig/setup_windows/ssh/openssh-server.ps1 +0 -37
- machineconfig/setup_windows/ssh/openssh-server_add_key.ps1 +0 -7
- machineconfig/setup_windows/ssh/openssh-server_copy-ssh-id.ps1 +0 -14
- machineconfig/utils/options_tv.py +0 -119
- machineconfig/utils/tst.py +0 -20
- machineconfig-7.98.dist-info/RECORD +0 -504
- /machineconfig/{jobs/installer/custom_dev → cluster/sessions_managers/wt_utils/examples}/__init__.py +0 -0
- /machineconfig/{scripts/python/helpers_agents → jobs/installer/checks}/__init__.py +0 -0
- /machineconfig/{scripts/python/helpers_agents/agentic_frameworks → jobs/installer/python_scripts}/__init__.py +0 -0
- /machineconfig/jobs/installer/{custom_dev → python_scripts}/alacritty.py +0 -0
- /machineconfig/jobs/installer/{custom_dev → python_scripts}/bypass_paywall.py +0 -0
- /machineconfig/jobs/installer/{custom_dev → python_scripts}/cloudflare_warp_cli.py +0 -0
- /machineconfig/jobs/installer/{custom_dev → python_scripts}/cursor.py +0 -0
- /machineconfig/jobs/installer/{custom_dev → python_scripts}/dubdb_adbc.py +0 -0
- /machineconfig/jobs/installer/{custom_dev → python_scripts}/espanso.py +0 -0
- /machineconfig/jobs/installer/{custom → python_scripts}/gh.py +0 -0
- /machineconfig/jobs/installer/{custom_dev → python_scripts}/goes.py +0 -0
- /machineconfig/jobs/installer/{custom_dev → python_scripts}/lvim.py +0 -0
- /machineconfig/jobs/installer/{custom_dev → python_scripts}/redis.py +0 -0
- /machineconfig/jobs/installer/{custom_dev → python_scripts}/winget.py +0 -0
- /machineconfig/jobs/{installer/linux_scripts → scripts/bash_scripts}/lid.sh +0 -0
- /machineconfig/{scripts/windows/mounts → jobs/scripts/powershell_scripts}/unlock_bitlocker.ps1 +0 -0
- /machineconfig/scripts/python/ai/{solutions/_shared.py → utils/shared.py} +0 -0
- /machineconfig/scripts/python/{helpers_cloud → graph}/__init__.py +0 -0
- /machineconfig/scripts/python/{helpers_croshell → helpers}/__init__.py +0 -0
- /machineconfig/scripts/python/{env_manager → helpers/helper_env}/__init__.py +0 -0
- /machineconfig/scripts/python/{env_manager → helpers/helper_env}/path_manager_backend.py +0 -0
- /machineconfig/scripts/python/{helpers_devops → helpers/helpers_agents}/__init__.py +0 -0
- /machineconfig/scripts/python/{helpers_devops/themes → helpers/helpers_agents/agentic_frameworks}/__init__.py +0 -0
- /machineconfig/scripts/python/{helpers_agents → helpers/helpers_agents}/agentic_frameworks/fire_crush.json +0 -0
- /machineconfig/scripts/python/{helpers_agents → helpers/helpers_agents}/fire_agents_help_search.py +0 -0
- /machineconfig/scripts/python/{helpers_agents → helpers/helpers_agents}/fire_agents_helper_types.py +0 -0
- /machineconfig/scripts/python/{helpers_agents → helpers/helpers_agents}/fire_agents_load_balancer.py +0 -0
- /machineconfig/scripts/python/{helpers_agents → helpers/helpers_agents}/templates/prompt.txt +0 -0
- /machineconfig/scripts/python/{helpers_agents → helpers/helpers_agents}/templates/template.ps1 +0 -0
- /machineconfig/scripts/python/{helpers_fire_command → helpers/helpers_cloud}/__init__.py +0 -0
- /machineconfig/scripts/python/{helpers_cloud → helpers/helpers_cloud}/cloud_helpers.py +0 -0
- /machineconfig/scripts/python/{helpers_cloud → helpers/helpers_cloud}/helpers5.py +0 -0
- /machineconfig/scripts/python/{helpers_network → helpers/helpers_croshell}/__init__.py +0 -0
- /machineconfig/scripts/python/{helpers_croshell → helpers/helpers_croshell}/crosh.py +0 -0
- /machineconfig/scripts/python/{helpers_croshell → helpers/helpers_croshell}/pomodoro.py +0 -0
- /machineconfig/scripts/python/{helpers_croshell → helpers/helpers_croshell}/viewer.py +0 -0
- /machineconfig/scripts/python/{helpers_croshell → helpers/helpers_croshell}/viewer_template.py +0 -0
- /machineconfig/scripts/python/{helpers_sessions → helpers/helpers_devops}/__init__.py +0 -0
- /machineconfig/{setup_windows/wt_and_pwsh → scripts/python/helpers/helpers_devops/mount_helpers}/__init__.py +0 -0
- /machineconfig/scripts/python/{helpers_devops/themes/choose_starship_theme.ps1 → helpers/helpers_devops/themes/__init__.py} +0 -0
- /machineconfig/scripts/python/{helpers_devops → helpers/helpers_devops}/themes/choose_pwsh_theme.ps1 +0 -0
- /machineconfig/scripts/python/{helpers_fire_command/f.py → helpers/helpers_fire_command/__init__.py} +0 -0
- /machineconfig/scripts/python/{helpers_fire_command → helpers/helpers_fire_command}/cloud_manager.py +0 -0
- /machineconfig/scripts/python/{helpers_fire_command/fire_jobs_streamlit_helper.py → helpers/helpers_fire_command/f.py} +0 -0
- /machineconfig/scripts/python/{helpers_msearch → helpers/helpers_msearch}/__init__.py +0 -0
- /machineconfig/scripts/python/{helpers_navigator → helpers/helpers_navigator}/search_bar.py +0 -0
- /machineconfig/scripts/python/{helpers_network → helpers/helpers_network}/onetimeshare.py +0 -0
- /machineconfig/scripts/python/{helpers_network → helpers/helpers_network}/wifi_conn.py +0 -0
- /machineconfig/scripts/python/{helpers_repos → helpers/helpers_repos}/clone.py +0 -0
- /machineconfig/scripts/python/{helpers_repos → helpers/helpers_repos}/repo_analyzer_1.py +0 -0
- /machineconfig/scripts/python/{helpers_repos → helpers/helpers_repos}/sync.py +0 -0
- /machineconfig/scripts/python/helpers/{ast_search.py → helpers_search/ast_search.py} +0 -0
- /machineconfig/scripts/python/helpers/{qr_code.py → helpers_search/qr_code.py} +0 -0
- /machineconfig/scripts/python/helpers/{repo_rag.py → helpers_search/repo_rag.py} +0 -0
- /machineconfig/scripts/python/helpers/{symantic_search.py → helpers_search/symantic_search.py} +0 -0
- /machineconfig/{setup_windows/wt_and_pwsh → settings/wt}/set_wt_settings.py +0 -0
- {machineconfig-7.98.dist-info → machineconfig-8.61.dist-info}/WHEEL +0 -0
- {machineconfig-7.98.dist-info → machineconfig-8.61.dist-info}/top_level.txt +0 -0
|
@@ -1,82 +0,0 @@
|
|
|
1
|
-
"""ID"""
|
|
2
|
-
|
|
3
|
-
# from platform import system
|
|
4
|
-
from machineconfig.utils.path_extended import PathExtended
|
|
5
|
-
from machineconfig.utils.options import choose_from_options
|
|
6
|
-
from rich.panel import Panel
|
|
7
|
-
from rich.text import Text
|
|
8
|
-
|
|
9
|
-
BOX_WIDTH = 150 # width for box drawing
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
def main() -> None:
|
|
13
|
-
title = "🔑 SSH IDENTITY MANAGEMENT"
|
|
14
|
-
print(Panel(Text(title, justify="center"), expand=False))
|
|
15
|
-
print(Panel("🔍 Searching for existing SSH keys...", expand=False))
|
|
16
|
-
private_keys = [x.with_name(x.stem) for x in PathExtended.home().joinpath(".ssh").search("*.pub")]
|
|
17
|
-
private_keys = [x for x in private_keys if x.exists()]
|
|
18
|
-
if private_keys:
|
|
19
|
-
print(Panel(f"✅ Found {len(private_keys)} SSH private key(s)", expand=False))
|
|
20
|
-
else:
|
|
21
|
-
print(Panel("⚠️ No SSH private keys found", expand=False))
|
|
22
|
-
|
|
23
|
-
choice = choose_from_options(msg="Path to private key to be used when ssh'ing: ", options=[str(x) for x in private_keys] + ["I have the path to the key file", "I want to paste the key itself"], multi=False)
|
|
24
|
-
|
|
25
|
-
if choice == "I have the path to the key file":
|
|
26
|
-
print(Panel("📄 Please enter the path to your private key file", expand=False))
|
|
27
|
-
path_to_key = PathExtended(input("📋 Input path here: ")).expanduser().absolute()
|
|
28
|
-
print(Panel(f"📂 Using key from custom path: {path_to_key}", expand=False))
|
|
29
|
-
|
|
30
|
-
elif choice == "I want to paste the key itself":
|
|
31
|
-
print(Panel("📋 Please provide a filename and paste the private key content", expand=False))
|
|
32
|
-
key_filename = input("📝 File name (default: my_pasted_key): ") or "my_pasted_key"
|
|
33
|
-
path_to_key = PathExtended.home().joinpath(f".ssh/{key_filename}")
|
|
34
|
-
path_to_key.parent.mkdir(parents=True, exist_ok=True)
|
|
35
|
-
path_to_key.write_text(input("🔑 Paste the private key here: "), encoding="utf-8")
|
|
36
|
-
print(Panel(f"💾 Key saved to: {path_to_key}", expand=False))
|
|
37
|
-
|
|
38
|
-
else:
|
|
39
|
-
path_to_key = PathExtended(choice)
|
|
40
|
-
print(Panel(f"🔑 Using selected key: {path_to_key.name}", expand=False))
|
|
41
|
-
|
|
42
|
-
txt = f"IdentityFile {path_to_key.collapseuser().as_posix()}" # adds this id for all connections, no host specified.
|
|
43
|
-
config_path = PathExtended.home().joinpath(".ssh/config")
|
|
44
|
-
|
|
45
|
-
print(Panel("📝 Updating SSH configuration...", expand=False))
|
|
46
|
-
|
|
47
|
-
# Inline the previous modify_text behavior (now deprecated):
|
|
48
|
-
# - If file doesn't exist, seed content with txt_search
|
|
49
|
-
# - Otherwise, replace a matching line or append if not found
|
|
50
|
-
if config_path.exists():
|
|
51
|
-
current = config_path.read_text(encoding="utf-8")
|
|
52
|
-
print(Panel("✏️ Updated existing SSH config file", expand=False))
|
|
53
|
-
else:
|
|
54
|
-
current = txt
|
|
55
|
-
print(Panel("📄 Created new SSH config file", expand=False))
|
|
56
|
-
lines = current.split("\n")
|
|
57
|
-
found = False
|
|
58
|
-
for i, line in enumerate(lines):
|
|
59
|
-
if txt in line:
|
|
60
|
-
lines[i] = txt
|
|
61
|
-
found = True
|
|
62
|
-
if not found:
|
|
63
|
-
lines.insert(0, txt)
|
|
64
|
-
new_content = "\n".join(lines)
|
|
65
|
-
config_path.write_text(new_content, encoding="utf-8")
|
|
66
|
-
|
|
67
|
-
panel_complete = Panel(Text("✅ SSH IDENTITY CONFIGURATION COMPLETE\nIdentity added to SSH config file\nConsider reloading the SSH config to apply changes", justify="center"), expand=False, border_style="green")
|
|
68
|
-
program = f"echo '{panel_complete}'"
|
|
69
|
-
|
|
70
|
-
success_message = f"🎉 CONFIGURATION SUCCESSFUL\nIdentity added: {path_to_key.name}\nConfig file: {config_path}"
|
|
71
|
-
print(Panel(Text(success_message, justify="center"), expand=False, border_style="green"))
|
|
72
|
-
|
|
73
|
-
import subprocess
|
|
74
|
-
|
|
75
|
-
# run program
|
|
76
|
-
subprocess.run(program, shell=True, check=True, text=True)
|
|
77
|
-
print(Panel("🔐 Identity added to SSH agent", expand=False, border_style="green"))
|
|
78
|
-
return None
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
if __name__ == "__main__":
|
|
82
|
-
pass
|
|
@@ -1,153 +0,0 @@
|
|
|
1
|
-
"""SSH"""
|
|
2
|
-
|
|
3
|
-
from platform import system
|
|
4
|
-
from machineconfig.utils.source_of_truth import LIBRARY_ROOT
|
|
5
|
-
from machineconfig.utils.path_extended import PathExtended
|
|
6
|
-
from rich.console import Console
|
|
7
|
-
from rich.panel import Panel
|
|
8
|
-
from rich import box
|
|
9
|
-
from typing import Optional, Annotated
|
|
10
|
-
import typer
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
console = Console()
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
def get_add_ssh_key_script(path_to_key: PathExtended) -> str:
|
|
17
|
-
console.print(Panel("🔑 SSH KEY CONFIGURATION", title="[bold blue]SSH Setup[/bold blue]"))
|
|
18
|
-
if system() == "Linux" or system() == "Darwin":
|
|
19
|
-
authorized_keys = PathExtended.home().joinpath(".ssh/authorized_keys")
|
|
20
|
-
console.print(Panel(f"🐧 Linux SSH configuration\n📄 Authorized keys file: {authorized_keys}", title="[bold blue]System Info[/bold blue]"))
|
|
21
|
-
elif system() == "Windows":
|
|
22
|
-
authorized_keys = PathExtended("C:/ProgramData/ssh/administrators_authorized_keys")
|
|
23
|
-
console.print(Panel(f"🪟 Windows SSH configuration\n📄 Authorized keys file: {authorized_keys}", title="[bold blue]System Info[/bold blue]"))
|
|
24
|
-
else:
|
|
25
|
-
console.print(Panel("❌ ERROR: Unsupported operating system\nOnly Linux and Windows are supported", title="[bold red]Error[/bold red]"))
|
|
26
|
-
raise NotImplementedError
|
|
27
|
-
|
|
28
|
-
if authorized_keys.exists():
|
|
29
|
-
split = "\n"
|
|
30
|
-
keys_text = authorized_keys.read_text(encoding="utf-8").split(split)
|
|
31
|
-
key_count = len([k for k in keys_text if k.strip()])
|
|
32
|
-
console.print(Panel(f"🔍 Current SSH authorization status\n✅ Found {key_count} authorized key(s)", title="[bold blue]Status[/bold blue]"))
|
|
33
|
-
if path_to_key.read_text(encoding="utf-8") in authorized_keys.read_text(encoding="utf-8"):
|
|
34
|
-
console.print(Panel(f"⚠️ Key already authorized\nKey: {path_to_key.name}\nStatus: Already present in authorized_keys file\nNo action required", title="[bold yellow]Warning[/bold yellow]"))
|
|
35
|
-
program = ""
|
|
36
|
-
else:
|
|
37
|
-
console.print(Panel(f"➕ Adding new SSH key to authorized keys\n🔑 Key file: {path_to_key.name}", title="[bold blue]Action[/bold blue]"))
|
|
38
|
-
if system() == "Linux" or system() == "Darwin":
|
|
39
|
-
program = f"cat {path_to_key} >> ~/.ssh/authorized_keys"
|
|
40
|
-
elif system() == "Windows":
|
|
41
|
-
program_path = LIBRARY_ROOT.joinpath("setup_windows/add-sshkey.ps1")
|
|
42
|
-
program = program_path.expanduser().read_text(encoding="utf-8")
|
|
43
|
-
place_holder = r'$sshfile = "$env:USERPROFILE\.ssh\pubkey.pub"'
|
|
44
|
-
assert place_holder in program, f"This section performs string manipulation on the script {program_path} to add the key to the authorized_keys file. The script has changed and the string {place_holder} is not found."
|
|
45
|
-
program = program.replace(place_holder, f'$sshfile = "{path_to_key}"')
|
|
46
|
-
console.print(Panel("🔧 Configured PowerShell script for Windows\n📝 Replaced placeholder with actual key path", title="[bold blue]Configuration[/bold blue]"))
|
|
47
|
-
else:
|
|
48
|
-
raise NotImplementedError
|
|
49
|
-
else:
|
|
50
|
-
console.print(Panel(f"📝 Creating new authorized_keys file\n🔑 Using key: {path_to_key.name}", title="[bold blue]Action[/bold blue]"))
|
|
51
|
-
if system() == "Linux" or system() == "Darwin":
|
|
52
|
-
program = f"cat {path_to_key} > ~/.ssh/authorized_keys"
|
|
53
|
-
else:
|
|
54
|
-
program_path = LIBRARY_ROOT.joinpath("setup_windows/openssh-server_add-sshkey.ps1")
|
|
55
|
-
program = PathExtended(program_path).expanduser().read_text(encoding="utf-8").replace('$sshfile=""', f'$sshfile="{path_to_key}"')
|
|
56
|
-
console.print(Panel("🔧 Configured PowerShell script for Windows\n📝 Set key path in script", title="[bold blue]Configuration[/bold blue]"))
|
|
57
|
-
|
|
58
|
-
if system() == "Linux" or system() == "Darwin":
|
|
59
|
-
program += """
|
|
60
|
-
sudo chmod 700 ~/.ssh
|
|
61
|
-
sudo chmod 644 ~/.ssh/authorized_keys
|
|
62
|
-
sudo chmod 644 ~/.ssh/*.pub
|
|
63
|
-
sudo service ssh --full-restart
|
|
64
|
-
# from superuser.com/questions/215504/permissions-on-private-key-in-ssh-folder
|
|
65
|
-
"""
|
|
66
|
-
return program
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
"""
|
|
70
|
-
Common pitfalls:
|
|
71
|
-
🚫 Wrong line endings (LF/CRLF) in config files
|
|
72
|
-
🌐 Network port conflicts (try 2222 -> 2223) between WSL and Windows
|
|
73
|
-
sudo service ssh restart
|
|
74
|
-
sudo service ssh status
|
|
75
|
-
sudo nano /etc/ssh/sshd_config
|
|
76
|
-
"""
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
def main(pub_path: Annotated[Optional[str], typer.Argument(..., help="Path to the public key file")] = None,
|
|
80
|
-
pub_choose: Annotated[bool, typer.Option(..., "--choose", "-c", help="Choose from available public keys in ~/.ssh")] = False,
|
|
81
|
-
pub_val: Annotated[bool, typer.Option(..., "--paste", "-p", help="Paste the public key content manually")] = False,
|
|
82
|
-
from_github: Annotated[Optional[str], typer.Option(..., "--from-github", "-g", help="Fetch public keys from a GitHub username")] = None
|
|
83
|
-
) -> None:
|
|
84
|
-
|
|
85
|
-
if pub_path:
|
|
86
|
-
key_path = PathExtended(pub_path).expanduser().absolute()
|
|
87
|
-
key_path.parent.mkdir(parents=True, exist_ok=True)
|
|
88
|
-
if not key_path.exists():
|
|
89
|
-
console.print(Panel(f"❌ ERROR: Provided key path does not exist\nPath: {key_path}", title="[bold red]Error[/bold red]"))
|
|
90
|
-
raise FileNotFoundError(f"Provided key path does not exist: {key_path}")
|
|
91
|
-
console.print(Panel(f"📄 Using provided public key file: {key_path}", title="[bold blue]Info[/bold blue]"))
|
|
92
|
-
program = get_add_ssh_key_script(key_path)
|
|
93
|
-
from machineconfig.utils.code import run_shell_script
|
|
94
|
-
run_shell_script(script=program)
|
|
95
|
-
console.print(Panel("✅ SSH KEY AUTHORIZATION COMPLETED", box=box.DOUBLE_EDGE, title_align="left"))
|
|
96
|
-
return
|
|
97
|
-
elif pub_choose:
|
|
98
|
-
console.print(Panel("🔐 SSH PUBLIC KEY AUTHORIZATION TOOL", box=box.DOUBLE_EDGE, title_align="left"))
|
|
99
|
-
console.print(Panel("🔍 Searching for public keys...", title="[bold blue]SSH Setup[/bold blue]", border_style="blue"))
|
|
100
|
-
pub_keys = PathExtended.home().joinpath(".ssh").search("*.pub")
|
|
101
|
-
if pub_keys:
|
|
102
|
-
console.print(Panel(f"✅ Found {len(pub_keys)} public key(s)", title="[bold green]Status[/bold green]", border_style="green"))
|
|
103
|
-
else:
|
|
104
|
-
console.print(Panel("⚠️ No public keys found", title="[bold yellow]Warning[/bold yellow]", border_style="yellow"))
|
|
105
|
-
return
|
|
106
|
-
console.print(Panel(f"🔄 Processing all {len(pub_keys)} public keys...", title="[bold blue]Processing[/bold blue]", border_style="blue"))
|
|
107
|
-
program = "\n\n\n".join([get_add_ssh_key_script(key) for key in pub_keys])
|
|
108
|
-
|
|
109
|
-
elif pub_val:
|
|
110
|
-
console.print(Panel("📋 Please provide a filename and paste the public key content", title="[bold blue]Input Required[/bold blue]", border_style="blue"))
|
|
111
|
-
key_filename = input("📝 File name (default: my_pasted_key.pub): ") or "my_pasted_key.pub"
|
|
112
|
-
key_path = PathExtended.home().joinpath(f".ssh/{key_filename}")
|
|
113
|
-
key_path.parent.mkdir(parents=True, exist_ok=True)
|
|
114
|
-
key_path.write_text(input("🔑 Paste the public key here: "), encoding="utf-8")
|
|
115
|
-
console.print(Panel(f"💾 Key saved to: {key_path}", title="[bold green]Success[/bold green]", border_style="green"))
|
|
116
|
-
program = get_add_ssh_key_script(key_path)
|
|
117
|
-
elif from_github:
|
|
118
|
-
console.print(Panel(f"🌐 Fetching public keys from GitHub user: {from_github}", title="[bold blue]GitHub Fetch[/bold blue]", border_style="blue"))
|
|
119
|
-
import requests
|
|
120
|
-
response = requests.get(f"https://api.github.com/users/{from_github}/keys")
|
|
121
|
-
if response.status_code != 200:
|
|
122
|
-
console.print(Panel(f"❌ ERROR: Failed to fetch keys from GitHub user {from_github}\nStatus Code: {response.status_code}", title="[bold red]Error[/bold red]", border_style="red"))
|
|
123
|
-
raise RuntimeError(f"Failed to fetch keys from GitHub user {from_github}: Status Code {response.status_code}")
|
|
124
|
-
keys = response.json()
|
|
125
|
-
if not keys:
|
|
126
|
-
console.print(Panel(f"⚠️ No public keys found for GitHub user: {from_github}", title="[bold yellow]Warning[/bold yellow]", border_style="yellow"))
|
|
127
|
-
return
|
|
128
|
-
console.print(Panel(f"✅ Found {len(keys)} public key(s) for user: {from_github}", title="[bold green]Success[/bold green]", border_style="green"))
|
|
129
|
-
key_path = PathExtended.home().joinpath(f".ssh/{from_github}_github_keys.pub")
|
|
130
|
-
key_path.parent.mkdir(parents=True, exist_ok=True)
|
|
131
|
-
key_path.write_text("\n".join([key["key"] for key in keys]), encoding="utf-8")
|
|
132
|
-
console.print(Panel(f"💾 Keys saved to: {key_path}", title="[bold green]Success[/bold green]", border_style="green"))
|
|
133
|
-
program = get_add_ssh_key_script(key_path)
|
|
134
|
-
else:
|
|
135
|
-
console.print(Panel("❌ ERROR: No method provided to add SSH key\nUse --help for options", title="[bold red]Error[/bold red]", border_style="red"))
|
|
136
|
-
raise ValueError("No method provided to add SSH key. Use --help for options.")
|
|
137
|
-
console.print(Panel("🚀 SSH KEY AUTHORIZATION READY\nRun the generated script to apply changes", box=box.DOUBLE_EDGE, title_align="left"))
|
|
138
|
-
from machineconfig.utils.code import run_shell_script
|
|
139
|
-
run_shell_script(script=program)
|
|
140
|
-
|
|
141
|
-
import machineconfig.scripts.python.helpers_network.address as helper
|
|
142
|
-
res = helper.select_lan_ipv4(prefer_vpn=False)
|
|
143
|
-
if res is None:
|
|
144
|
-
console.print(Panel("❌ ERROR: Could not determine local LAN IPv4 address", title="[bold red]Error[/bold red]", border_style="red"))
|
|
145
|
-
raise typer.Exit(code=1)
|
|
146
|
-
local_ip_v4 = res
|
|
147
|
-
|
|
148
|
-
console.print(Panel(f"🌐 This computer is accessible at: {local_ip_v4}", title="[bold green]Network Info[/bold green]", border_style="green"))
|
|
149
|
-
console.print(Panel("✅ SSH KEY AUTHORIZATION COMPLETED", box=box.DOUBLE_EDGE, title_align="left"))
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
if __name__ == "__main__":
|
|
153
|
-
pass
|
|
@@ -1,128 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env bash
|
|
2
|
-
|
|
3
|
-
set -euo pipefail
|
|
4
|
-
|
|
5
|
-
# Constants
|
|
6
|
-
CREDS_DIR="$HOME/dotfiles/creds/data"
|
|
7
|
-
BITLOCKER_PWD_FILE="$CREDS_DIR/bitlocker_pwd"
|
|
8
|
-
MOUNT_BASE_DIR="/media"
|
|
9
|
-
|
|
10
|
-
# Functions
|
|
11
|
-
print_separator() {
|
|
12
|
-
echo "--------------------------------------"
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
install_if_missing() {
|
|
16
|
-
local package=$1
|
|
17
|
-
if ! command -v "$package" &> /dev/null; then
|
|
18
|
-
echo "⚠️ $package could not be found"
|
|
19
|
-
echo "💡 Installing $package"
|
|
20
|
-
sudo nala install -y "$package"
|
|
21
|
-
fi
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
get_user_input() {
|
|
25
|
-
local prompt=$1
|
|
26
|
-
local default=$2
|
|
27
|
-
local response
|
|
28
|
-
|
|
29
|
-
read -p "$prompt (default: $default): " response
|
|
30
|
-
echo "${response:-$default}"
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
get_bitlocker_password() {
|
|
34
|
-
if [[ -f "$BITLOCKER_PWD_FILE" ]]; then
|
|
35
|
-
echo "🔑 Bitlocker Password file detected at $BITLOCKER_PWD_FILE"
|
|
36
|
-
cat "$BITLOCKER_PWD_FILE"
|
|
37
|
-
else
|
|
38
|
-
echo "🤔🔑 Password file does not exist"
|
|
39
|
-
read -sp "Enter bitlocker password: " bitlocker_pwd
|
|
40
|
-
echo
|
|
41
|
-
mkdir -p "$(dirname "$BITLOCKER_PWD_FILE")"
|
|
42
|
-
echo "$bitlocker_pwd" > "$BITLOCKER_PWD_FILE"
|
|
43
|
-
chmod 600 "$BITLOCKER_PWD_FILE"
|
|
44
|
-
echo "$bitlocker_pwd"
|
|
45
|
-
fi
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
mount_bitlocker() {
|
|
49
|
-
local device=$1
|
|
50
|
-
local mnt_name=$2
|
|
51
|
-
local bitlocker_pwd
|
|
52
|
-
|
|
53
|
-
install_if_missing dislocker
|
|
54
|
-
|
|
55
|
-
bitlocker_pwd=$(get_bitlocker_password)
|
|
56
|
-
|
|
57
|
-
sudo mkdir -p "$MOUNT_BASE_DIR/${mnt_name}_bitlocker"
|
|
58
|
-
sudo dislocker "/dev/$device" "-u$bitlocker_pwd" -- "$MOUNT_BASE_DIR/${mnt_name}_bitlocker"
|
|
59
|
-
sudo mount -o loop,rw,uid=$(id -u),gid=$(id -g) "$MOUNT_BASE_DIR/${mnt_name}_bitlocker/dislocker-file" "$MOUNT_BASE_DIR/$mnt_name"
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
mount_regular() {
|
|
63
|
-
local device=$1
|
|
64
|
-
local mnt_name=$2
|
|
65
|
-
|
|
66
|
-
sudo mount --source "/dev/$device" --target "$MOUNT_BASE_DIR/$mnt_name"
|
|
67
|
-
}
|
|
68
|
-
|
|
69
|
-
add_to_fstab() {
|
|
70
|
-
local device=$1
|
|
71
|
-
local mnt_name=$2
|
|
72
|
-
|
|
73
|
-
local drive_uuid=$(sudo blkid -s UUID -o value "/dev/$device")
|
|
74
|
-
local drive_type=$(lsblk -no FSTYPE "/dev/$device")
|
|
75
|
-
local drive_mount_point="$MOUNT_BASE_DIR/$mnt_name"
|
|
76
|
-
local drive_mount_options="defaults"
|
|
77
|
-
local drive_dump="0"
|
|
78
|
-
local drive_pass="0"
|
|
79
|
-
|
|
80
|
-
if [[ "$drive_type" == "ntfs" ]]; then
|
|
81
|
-
drive_mount_options="$drive_mount_options,ntfs-3g"
|
|
82
|
-
fi
|
|
83
|
-
|
|
84
|
-
local fstab_entry="UUID=$drive_uuid $drive_mount_point $drive_type $drive_mount_options $drive_dump $drive_pass"
|
|
85
|
-
|
|
86
|
-
if grep -q "$drive_uuid" /etc/fstab; then
|
|
87
|
-
sudo sed -i "s|.*$drive_uuid.*|$fstab_entry|" /etc/fstab
|
|
88
|
-
else
|
|
89
|
-
echo "$fstab_entry" | sudo tee -a /etc/fstab
|
|
90
|
-
fi
|
|
91
|
-
|
|
92
|
-
echo "🔧 Updated /etc/fstab with the new entry"
|
|
93
|
-
}
|
|
94
|
-
|
|
95
|
-
# Main script
|
|
96
|
-
echo "💾 Available devices:"
|
|
97
|
-
sudo fdisk -l
|
|
98
|
-
print_separator
|
|
99
|
-
lsblk
|
|
100
|
-
print_separator
|
|
101
|
-
|
|
102
|
-
device=$(get_user_input "Enter device name" "sdb1")
|
|
103
|
-
mnt_name=$(get_user_input "Enter mount name" "mymnt")
|
|
104
|
-
|
|
105
|
-
sudo mkdir -p "$MOUNT_BASE_DIR/$mnt_name"
|
|
106
|
-
|
|
107
|
-
if lsblk -no FSTYPE "/dev/$device" | grep -q "BitLocker"; then
|
|
108
|
-
echo "🔒 Drive is BitLocker encrypted"
|
|
109
|
-
mount_bitlocker "$device" "$mnt_name"
|
|
110
|
-
else
|
|
111
|
-
echo "Drive is not encrypted"
|
|
112
|
-
mount_regular "$device" "$mnt_name"
|
|
113
|
-
fi
|
|
114
|
-
|
|
115
|
-
if [[ $? -eq 0 ]]; then
|
|
116
|
-
echo "✅ The drive has been successfully mounted at $MOUNT_BASE_DIR/$mnt_name"
|
|
117
|
-
print_separator
|
|
118
|
-
|
|
119
|
-
read -p "Do you want to add the drive to fstab? (y/N): " add_fstab
|
|
120
|
-
if [[ "${add_fstab,,}" == "y" ]]; then
|
|
121
|
-
add_to_fstab "$device" "$mnt_name"
|
|
122
|
-
fi
|
|
123
|
-
else
|
|
124
|
-
echo "❌ There was an error while mounting the drive. Please check your input and try again."
|
|
125
|
-
exit 1
|
|
126
|
-
fi
|
|
127
|
-
|
|
128
|
-
echo "If Mount failed, try: sudo fuser -v /dev/"$device"; sudo kill piddd"
|
|
@@ -1,49 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env bash
|
|
2
|
-
|
|
3
|
-
# mount nfs share on linux
|
|
4
|
-
# sudo nala install nfs-common
|
|
5
|
-
# mkdir ~/data/local
|
|
6
|
-
# sudo mount -o nolock,noatime,nodiratime,proto=tcp,timeo=600,retrans=2,noac alex-p51s-5:/home/alex/data/local ./data/local
|
|
7
|
-
|
|
8
|
-
# Check if remote server is reachable and share folder exists
|
|
9
|
-
if ! ping -c 1 "$remote_server" &> /dev/null; then
|
|
10
|
-
echo "💥 Error: Remote server $remote_server is not reachable."
|
|
11
|
-
exit 1
|
|
12
|
-
fi
|
|
13
|
-
|
|
14
|
-
#if ! showmount -e "$remote_server" | grep -q "$share_path"; then
|
|
15
|
-
# echo "Error: NFS share folder $share_path is not available on $remote_server."
|
|
16
|
-
# exit 1
|
|
17
|
-
#fi
|
|
18
|
-
|
|
19
|
-
# Check if the share is already mounted
|
|
20
|
-
if mount | grep -q ":$share_path on "; then
|
|
21
|
-
echo "⚠️ The NFS share $share_info is already mounted."
|
|
22
|
-
exit 0
|
|
23
|
-
fi
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
if [ ! -d "$local_mount_point" ]; then
|
|
27
|
-
echo "➡️ Creating local mount point directory $local_mount_point"
|
|
28
|
-
sudo mkdir -p "$local_mount_point"
|
|
29
|
-
sudo chown "$(id -u):$(id -g)" "$local_mount_point"
|
|
30
|
-
fi
|
|
31
|
-
|
|
32
|
-
sudo service rpcbind start
|
|
33
|
-
sudo service nfs-common start
|
|
34
|
-
# without the two above, on wsl, you get error: https://superuser.com/questions/657071/mount-nfs-rpc-statd-is-not-running-but-is-required-for-remote-locking
|
|
35
|
-
|
|
36
|
-
echo "💡 Mounting NFS share $share_info at $local_mount_point using command:"
|
|
37
|
-
echo "sudo mount -t nfs $share_info $local_mount_point"
|
|
38
|
-
sudo mount -t nfs "$share_info" "$local_mount_point"
|
|
39
|
-
|
|
40
|
-
# Add a line to fstab file to ensure automount
|
|
41
|
-
fstab_line="$remote_server:$share_path $local_mount_point nfs defaults 0 0"
|
|
42
|
-
if grep -qF "$fstab_line" /etc/fstab; then
|
|
43
|
-
echo "🤷♂️ The following line already exists in /etc/fstab:"
|
|
44
|
-
echo "$fstab_line"
|
|
45
|
-
else
|
|
46
|
-
echo "➡️ Adding the following line to /etc/fstab:"
|
|
47
|
-
echo "$fstab_line"
|
|
48
|
-
echo "$fstab_line" | sudo tee -a /etc/fstab > /dev/null
|
|
49
|
-
fi
|
|
@@ -1,85 +0,0 @@
|
|
|
1
|
-
"""NFS mounting script"""
|
|
2
|
-
|
|
3
|
-
from pathlib import Path
|
|
4
|
-
|
|
5
|
-
from machineconfig.utils.ssh import SSH
|
|
6
|
-
from machineconfig.utils.options import choose_from_options, choose_ssh_host
|
|
7
|
-
|
|
8
|
-
import platform
|
|
9
|
-
import subprocess
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
def main():
|
|
13
|
-
print("\n" + "=" * 50)
|
|
14
|
-
print("🚀 Starting NFS Mounting Process")
|
|
15
|
-
print("=" * 50 + "\n")
|
|
16
|
-
|
|
17
|
-
share_info = input("🔗 Enter share path (e.g., machine:~/data/share_nfs) [Press Enter for interactive choice]: ")
|
|
18
|
-
if share_info == "":
|
|
19
|
-
print("\n🔍 Interactive mode selected for choosing share path.")
|
|
20
|
-
tmp = choose_ssh_host(multi=False)
|
|
21
|
-
assert isinstance(tmp, str)
|
|
22
|
-
ssh = SSH(host=tmp, username=None, hostname=None, ssh_key_path=None, password=None, port=22, enable_compression=False)
|
|
23
|
-
default = f"{ssh.hostname}:{ssh.run_shell_cmd_on_remote(command='echo $HOME', verbose_output=False, description='Get home directory', strict_stderr=False, strict_return_code=True).op}/data/share_nfs"
|
|
24
|
-
share_info = choose_from_options(msg="📂 Choose a share path:", options=[f"{ssh.hostname}:{item.split(' ')[0]}" for item in ssh.run_shell_cmd_on_remote(command="cat /etc/exports", verbose_output=False, description='Get NFS exports', strict_stderr=False, strict_return_code=False).op.split("\n") if not item.startswith("#")] + [default], default=default, multi=False)
|
|
25
|
-
assert isinstance(share_info, str), f"❌ share_info must be a string. Got {type(share_info)}"
|
|
26
|
-
|
|
27
|
-
remote_server = share_info.split(":")[0]
|
|
28
|
-
share_path = share_info.split(":")[1]
|
|
29
|
-
|
|
30
|
-
print(f"\n🌐 Remote Server: {remote_server}")
|
|
31
|
-
print(f"📁 Share Path: {share_path}\n")
|
|
32
|
-
|
|
33
|
-
if platform.system() in ["Linux", "Darwin"]:
|
|
34
|
-
mount_path_1 = Path(share_path)
|
|
35
|
-
mount_path_2 = Path.home().joinpath("data/mount_nfs", remote_server)
|
|
36
|
-
if str(mount_path_1).startswith("/home"):
|
|
37
|
-
mount_path_3 = Path.home().joinpath(*mount_path_1.parts[3:])
|
|
38
|
-
else:
|
|
39
|
-
mount_path_3 = mount_path_2
|
|
40
|
-
|
|
41
|
-
print("🔧 Preparing mount paths...")
|
|
42
|
-
local_mount_point_choice = choose_from_options(
|
|
43
|
-
msg="📂 Choose mount path OR input custom one:",
|
|
44
|
-
options=[mount_path_1, mount_path_2, mount_path_3],
|
|
45
|
-
default=mount_path_2,
|
|
46
|
-
custom_input=True,
|
|
47
|
-
multi=False,
|
|
48
|
-
)
|
|
49
|
-
local_mount_point = Path(local_mount_point_choice).expanduser()
|
|
50
|
-
|
|
51
|
-
txt = f"""
|
|
52
|
-
share_info={share_info}
|
|
53
|
-
remote_server={remote_server}
|
|
54
|
-
share_path={share_path}
|
|
55
|
-
local_mount_point={local_mount_point}
|
|
56
|
-
"""
|
|
57
|
-
# PROGRAM_PATH.write_text(txt)
|
|
58
|
-
subprocess.run(txt, shell=True, check=True)
|
|
59
|
-
|
|
60
|
-
print("✅ Mount paths prepared successfully!\n")
|
|
61
|
-
|
|
62
|
-
elif platform.system() == "Windows":
|
|
63
|
-
print("\n🔍 Checking existing drives...")
|
|
64
|
-
completed = subprocess.run(["powershell", "-Command", "Get-PSDrive -PSProvider 'FileSystem'"], capture_output=True, check=False, text=True)
|
|
65
|
-
print((completed.stdout or "").strip())
|
|
66
|
-
driver_letter = input(r"🖥️ Choose driver letter (e.g., Z:\\) [Avoid already used ones]: ") or "Z:\\"
|
|
67
|
-
txt = f"""
|
|
68
|
-
$server = "{remote_server}"
|
|
69
|
-
$sharePath = "{share_path}"
|
|
70
|
-
$driveLetter = "{driver_letter}"
|
|
71
|
-
"""
|
|
72
|
-
# PROGRAM_PATH.write_text(txt)
|
|
73
|
-
subprocess.run(txt, shell=True, check=True)
|
|
74
|
-
print("✅ Drive letter selected and configuration saved!\n")
|
|
75
|
-
|
|
76
|
-
print("\n📄 Configuration File Content:")
|
|
77
|
-
print("-" * 50)
|
|
78
|
-
# print(PROGRAM_PATH.read_text(encoding="utf-8"))
|
|
79
|
-
print("-" * 50 + "\n")
|
|
80
|
-
|
|
81
|
-
print("🎉 NFS Mounting Process Completed Successfully!\n")
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
if __name__ == "__main__":
|
|
85
|
-
main()
|
|
@@ -1,61 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env bash
|
|
2
|
-
|
|
3
|
-
# mount shared windows folder on linux
|
|
4
|
-
# sudo mount -t drvfs '\\SAH0229234\t7share' /mnt/t7share
|
|
5
|
-
# or sudo mount -t drvfs 'M:' /mnt/t7share
|
|
6
|
-
|
|
7
|
-
#write an extremely verbose bash script to mount a windows network drive in wsl.
|
|
8
|
-
#1) The user is prompted for inputs, and is given examples and defaults if enter was pressed.
|
|
9
|
-
#2) Before every command is executed, echo what are you doing and what command is used to achieve that
|
|
10
|
-
#3) echo long '-----------' between steps
|
|
11
|
-
#4) Make the code very robust so it can catch all errors and execute gracefully if anything went wrong.
|
|
12
|
-
#5) prompt the user whether he wants the process to be done automatically, in which case add settings to fstab file and refresh it.
|
|
13
|
-
#6) if username and password not passed, don't pass them to mount command
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
drive_location=''
|
|
17
|
-
mount_point=''
|
|
18
|
-
username=''
|
|
19
|
-
password=''
|
|
20
|
-
machineconfig.scripts.python.mount_nw_drive
|
|
21
|
-
|
|
22
|
-
# Check if mount point directory exists, create if not
|
|
23
|
-
if [ ! -d "$mount_point" ]; then
|
|
24
|
-
echo "The mount point directory does not exist, creating it now..."
|
|
25
|
-
mkdir -p "$mount_point"
|
|
26
|
-
fi
|
|
27
|
-
|
|
28
|
-
# Mount the network drive
|
|
29
|
-
echo "Mounting the network drive at $mount_point using the following command:"
|
|
30
|
-
mount_command="sudo mount -t drvfs $drive_location $mount_point "
|
|
31
|
-
if [[ ! -z $username ]]; then
|
|
32
|
-
mount_command="$mount_command -o username=$username"
|
|
33
|
-
fi
|
|
34
|
-
if [[ ! -z $password ]]; then
|
|
35
|
-
mount_command="$mount_command,password=$password"
|
|
36
|
-
fi
|
|
37
|
-
echo "$mount_command"
|
|
38
|
-
$mount_command
|
|
39
|
-
|
|
40
|
-
# Check if mount was successful
|
|
41
|
-
if [ $? -eq 0 ]; then
|
|
42
|
-
echo "The network drive has been successfully mounted at $mount_point."
|
|
43
|
-
echo "--------------------------------------"
|
|
44
|
-
else
|
|
45
|
-
echo "There was an error while mounting the network drive. Please check your input and try again."
|
|
46
|
-
exit 1
|
|
47
|
-
fi
|
|
48
|
-
|
|
49
|
-
# Prompt user if they want to add the mount to fstab
|
|
50
|
-
read -p "Do you want to automatically mount this network drive on system startup? (y/n): " auto_mount
|
|
51
|
-
|
|
52
|
-
if [[ $auto_mount == "y" ]]; then
|
|
53
|
-
echo "Adding mount point to fstab..."
|
|
54
|
-
fstab_entry="$drive_location $mount_point drvfs defaults,uid=$(id -u),gid=$(id -g),metadata"
|
|
55
|
-
echo "$fstab_entry" | sudo tee -a /etc/fstab
|
|
56
|
-
echo "Refreshing fstab..."
|
|
57
|
-
sudo mount -a
|
|
58
|
-
echo "The network drive has been added to fstab and will automatically mount on system startup."
|
|
59
|
-
fi
|
|
60
|
-
|
|
61
|
-
exit 0
|
|
@@ -1,48 +0,0 @@
|
|
|
1
|
-
from pathlib import Path
|
|
2
|
-
import platform
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
def main():
|
|
6
|
-
print("\n" + "=" * 50)
|
|
7
|
-
print("🚀 Welcome to the Windows Network Drive Mounting Wizard")
|
|
8
|
-
print("=" * 50 + "\n")
|
|
9
|
-
|
|
10
|
-
drive_location = input("🔗 Enter the network drive location (e.g., //192.168.1.100/Share): ")
|
|
11
|
-
machine_name = drive_location.split("//")[1].split("/")[0]
|
|
12
|
-
|
|
13
|
-
mount_point_input = input(f"📂 Enter the mount point directory (e.g., /mnt/network) [Default: ~/data/mount_nw/{machine_name}]: ")
|
|
14
|
-
if mount_point_input == "":
|
|
15
|
-
mount_point = Path.home().joinpath(rf"data/mount_nw/{machine_name}")
|
|
16
|
-
else:
|
|
17
|
-
mount_point = Path(mount_point_input).expanduser()
|
|
18
|
-
|
|
19
|
-
print(f"\n🌐 Network Drive Location: {drive_location}")
|
|
20
|
-
print(f"📁 Mount Point: {mount_point}\n")
|
|
21
|
-
|
|
22
|
-
username = input("👤 Enter the username: ")
|
|
23
|
-
password = input("🔒 Enter the password: ")
|
|
24
|
-
|
|
25
|
-
if platform.system() in ["Linux", "Darwin"]:
|
|
26
|
-
print("\n🔧 Saving configuration for Linux...")
|
|
27
|
-
txt = f"""
|
|
28
|
-
drive_location='{drive_location}'
|
|
29
|
-
mount_point='{mount_point}'
|
|
30
|
-
username='{username}'
|
|
31
|
-
password='{password}'
|
|
32
|
-
|
|
33
|
-
"""
|
|
34
|
-
# PROGRAM_PATH.write_text(txt, encoding="utf-8",)
|
|
35
|
-
import subprocess
|
|
36
|
-
|
|
37
|
-
subprocess.run(txt, shell=True, check=True)
|
|
38
|
-
print("✅ Configuration saved successfully!\n")
|
|
39
|
-
|
|
40
|
-
elif platform.system() == "Windows":
|
|
41
|
-
print("❌ Windows platform is not yet supported.")
|
|
42
|
-
raise NotImplementedError
|
|
43
|
-
|
|
44
|
-
print("🎉 Windows Network Drive Mounting Process Completed!\n")
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
if __name__ == "__main__":
|
|
48
|
-
main()
|