mirror of
https://github.com/rwinkhart/sshyp.git
synced 2026-08-28 04:46:34 -04:00
Fixed checking /lib/sshyp instead of /usr/lib/sshyp
Former-commit-id: fc0ea87c0c15077897a5cbee7fc38b22f8022c70 Former-commit-id: e2abdc03fc4b3fa8c62f4c08164d36e83647a645
This commit is contained in:
+1
-1
@@ -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:
|
||||
|
||||
+2
-2
@@ -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)
|
||||
|
||||
|
||||
+10
-8
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user