Fixed checking /lib/sshyp instead of /usr/lib/sshyp

Former-commit-id: fc0ea87c0c15077897a5cbee7fc38b22f8022c70
Former-commit-id: e2abdc03fc4b3fa8c62f4c08164d36e83647a645
This commit is contained in:
2023-06-08 19:36:20 -04:00
parent 2322140af7
commit 6c2d51aea6
3 changed files with 13 additions and 11 deletions
+1 -1
View File
@@ -69,7 +69,7 @@ def get_local_data(_directory, _device):
def remote_list_fetch(_user_data): def remote_list_fetch(_user_data):
try: try:
_remote_data = run(('ssh', '-i', _user_data[5], '-p', _user_data[2], f"{_user_data[0]}@{_user_data[1]}", _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 f'("{_user_data[6]}", "{_user_data[4]}")\''), stdout=PIPE, text=True, check=True
).stdout.split('\x1d') ).stdout.split('\x1d')
except CalledProcessError: except CalledProcessError:
+2 -2
View File
@@ -574,7 +574,7 @@ def rename():
move(f"{directory}{entry_name}", f"{directory}{_new_name}") move(f"{directory}{entry_name}", f"{directory}{_new_name}")
if not ssh_error: if not ssh_error:
run(('ssh', '-i', f"{home}/.ssh/sshyp", '-p', port, f"{username_ssh}@{ip}", 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 # edits the contents of an entry
@@ -698,7 +698,7 @@ def remove_data():
determine_decrypt(f"{home}/.config/sshyp/lock.gpg", None, None) determine_decrypt(f"{home}/.config/sshyp/lock.gpg", None, None)
if not ssh_error: if not ssh_error:
run(('ssh', '-i', f"{home}/.ssh/sshyp", '-p', port, f"{username_ssh}@{ip}", 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: else:
offline_delete(entry_name, 'locally', silent_sync) offline_delete(entry_name, 'locally', silent_sync)
+10 -8
View File
@@ -241,10 +241,11 @@ def global_menu(_device_type, _top_message):
_options, _choice, _term_message, _exit_signal = ['change device/synchronization types'], 0, False, False _options, _choice, _term_message, _exit_signal = ['change device/synchronization types'], 0, False, False
try: try:
if _device_type == 'client': if _device_type == 'client':
_options.extend(['change gpg key', 're-configure ssh(ync)', 'change device name', _options.extend(['change gpg key', 're-configure ssh(ync)', 'change device name',
'[OPTIONAL, RECOMMENDED] set custom text editor', '[OPTIONAL, RECOMMENDED] set custom text editor',
'[OPTIONAL, RECOMMENDED] enable/disable quick-unlock', '[OPTIONAL, NOT IMPLEMENTED] su security mode', '[OPTIONAL, RECOMMENDED] enable/disable quick-unlock',
'[OPTIONAL, NOT IMPLEMENTED] extensions and updates']) '[OPTIONAL, NOT IMPLEMENTED] su security mode',
'[OPTIONAL, NOT IMPLEMENTED] extensions and updates'])
else: else:
_options.extend(['manage quick-unlock']) _options.extend(['manage quick-unlock'])
_options.extend(['exit/done']) _options.extend(['exit/done'])
@@ -253,7 +254,8 @@ def global_menu(_device_type, _top_message):
if _choice == 0: if _choice == 0:
_dev_sync_types = install_type() _dev_sync_types = install_type()
# if not running in server or offline mode and a sshync config has not been made # 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() _ip, _username_ssh, _port = ssh_config()
# if no device id is set # if no device id is set
if not listdir(f"{home}/.config/sshyp/devices"): if not listdir(f"{home}/.config/sshyp/devices"):
@@ -280,9 +282,9 @@ def global_menu(_device_type, _top_message):
_enabled = quick_unlock_config(False) _enabled = quick_unlock_config(False)
if _enabled == 'true': if _enabled == 'true':
# TODO update for future menu-based quick-unlock management # 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," _term_message = ("\nquick-unlock has been enabled client-side - in order for this feature to "
"\nyou must first log in to the sshyp server and run:\n\nsshyp whitelist setup (if not" "function,\nyou must first log in to the sshyp server and run:\n\nsshyp whitelist "
" already done)\nsshyp whitelist add " "setup (if not already done)\nsshyp whitelist add "
f"'{listdir(f'{home}/.config/sshyp/devices')[0].rstrip()}'\n") f"'{listdir(f'{home}/.config/sshyp/devices')[0].rstrip()}'\n")
elif _choice == 8: elif _choice == 8:
_exit_signal = True _exit_signal = True