From 6c2d51aea6ea450d68b6d13a3b2507697194fd79 Mon Sep 17 00:00:00 2001 From: Randall Winkhart Date: Thu, 8 Jun 2023 19:36:20 -0400 Subject: [PATCH] Fixed checking /lib/sshyp instead of /usr/lib/sshyp Former-commit-id: fc0ea87c0c15077897a5cbee7fc38b22f8022c70 Former-commit-id: e2abdc03fc4b3fa8c62f4c08164d36e83647a645 --- lib/sshync.py | 2 +- lib/sshyp.py | 4 ++-- lib/stweak.py | 18 ++++++++++-------- 3 files changed, 13 insertions(+), 11 deletions(-) diff --git a/lib/sshync.py b/lib/sshync.py index 0ab4833..4904385 100644 --- a/lib/sshync.py +++ b/lib/sshync.py @@ -69,7 +69,7 @@ def get_local_data(_directory, _device): def remote_list_fetch(_user_data): try: _remote_data = run(('ssh', '-i', _user_data[5], '-p', _user_data[2], f"{_user_data[0]}@{_user_data[1]}", - f'cd /lib/sshyp; python3 -c \'from sshync import remote_list_gen; remote_list_gen' + f'cd /usr/lib/sshyp; python3 -c \'from sshync import remote_list_gen; remote_list_gen' f'("{_user_data[6]}", "{_user_data[4]}")\''), stdout=PIPE, text=True, check=True ).stdout.split('\x1d') except CalledProcessError: diff --git a/lib/sshyp.py b/lib/sshyp.py index 78aef20..520d335 100755 --- a/lib/sshyp.py +++ b/lib/sshyp.py @@ -574,7 +574,7 @@ def rename(): move(f"{directory}{entry_name}", f"{directory}{_new_name}") if not ssh_error: run(('ssh', '-i', f"{home}/.ssh/sshyp", '-p', port, f"{username_ssh}@{ip}", - f'cd /lib/sshyp; python3 -c \'from sshync import delete; delete("{entry_name}", "remotely", True)\'')) + f'cd /usr/lib/sshyp; python3 -c \'from sshync import delete; delete("{entry_name}", "remotely", True)\'')) # edits the contents of an entry @@ -698,7 +698,7 @@ def remove_data(): determine_decrypt(f"{home}/.config/sshyp/lock.gpg", None, None) if not ssh_error: run(('ssh', '-i', f"{home}/.ssh/sshyp", '-p', port, f"{username_ssh}@{ip}", - f'cd /lib/sshyp; python3 -c \'from sshync import delete; delete("{entry_name}", "remotely", False)\'')) + f'cd /usr/lib/sshyp; python3 -c \'from sshync import delete; delete("{entry_name}", "remotely", False)\'')) else: offline_delete(entry_name, 'locally', silent_sync) diff --git a/lib/stweak.py b/lib/stweak.py index b4c895c..79c4bf3 100644 --- a/lib/stweak.py +++ b/lib/stweak.py @@ -241,10 +241,11 @@ def global_menu(_device_type, _top_message): _options, _choice, _term_message, _exit_signal = ['change device/synchronization types'], 0, False, False try: if _device_type == 'client': - _options.extend(['change gpg key', 're-configure ssh(ync)', 'change device name', - '[OPTIONAL, RECOMMENDED] set custom text editor', - '[OPTIONAL, RECOMMENDED] enable/disable quick-unlock', '[OPTIONAL, NOT IMPLEMENTED] su security mode', - '[OPTIONAL, NOT IMPLEMENTED] extensions and updates']) + _options.extend(['change gpg key', 're-configure ssh(ync)', 'change device name', + '[OPTIONAL, RECOMMENDED] set custom text editor', + '[OPTIONAL, RECOMMENDED] enable/disable quick-unlock', + '[OPTIONAL, NOT IMPLEMENTED] su security mode', + '[OPTIONAL, NOT IMPLEMENTED] extensions and updates']) else: _options.extend(['manage quick-unlock']) _options.extend(['exit/done']) @@ -253,7 +254,8 @@ def global_menu(_device_type, _top_message): if _choice == 0: _dev_sync_types = install_type() # if not running in server or offline mode and a sshync config has not been made - if _dev_sync_types[0] != 'server' and _dev_sync_types[1] != 'true' and not sshyp_data.has_section('SSHYNC'): + if _dev_sync_types[0] != 'server' and _dev_sync_types[1] != 'true' \ + and not sshyp_data.has_section('SSHYNC'): _ip, _username_ssh, _port = ssh_config() # if no device id is set if not listdir(f"{home}/.config/sshyp/devices"): @@ -280,9 +282,9 @@ def global_menu(_device_type, _top_message): _enabled = quick_unlock_config(False) if _enabled == 'true': # TODO update for future menu-based quick-unlock management - _term_message = ("\nquick-unlock has been enabled client-side - in order for this feature to function," - "\nyou must first log in to the sshyp server and run:\n\nsshyp whitelist setup (if not" - " already done)\nsshyp whitelist add " + _term_message = ("\nquick-unlock has been enabled client-side - in order for this feature to " + "function,\nyou must first log in to the sshyp server and run:\n\nsshyp whitelist " + "setup (if not already done)\nsshyp whitelist add " f"'{listdir(f'{home}/.config/sshyp/devices')[0].rstrip()}'\n") elif _choice == 8: _exit_signal = True