mirror of
https://github.com/rwinkhart/sshyp.git
synced 2026-09-03 15:47:18 -04:00
Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
5cd50c7ad2 | ||
|
|
c48722f04f | ||
|
|
d32bd72d68 | ||
|
|
59d0844d77 | ||
|
|
0eb283892f |
+1
-1
@@ -1,4 +1,4 @@
|
|||||||
.TH sshyp 1 "30 April 2023" "v1.4.2" "sshyp man page"
|
.TH sshyp 1 "08 June 2023" "v1.4.3" "sshyp man page"
|
||||||
.SH NAME
|
.SH NAME
|
||||||
\fBsshyp\fR - Simple, self-hosted, synchronized password management for UNIX(-like) systems. Alternative to (and compatible with) pass/password-store.
|
\fBsshyp\fR - Simple, self-hosted, synchronized password management for UNIX(-like) systems. Alternative to (and compatible with) pass/password-store.
|
||||||
.SH SYNOPSIS
|
.SH SYNOPSIS
|
||||||
|
|||||||
+5
-5
@@ -68,7 +68,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:
|
||||||
@@ -162,19 +162,19 @@ def run_profile(_profile_dir, _silent):
|
|||||||
if int(_index_local[1][_i]) > int(_index_remote[1][_i]):
|
if int(_index_local[1][_i]) > int(_index_remote[1][_i]):
|
||||||
print(f"\u001b[38;5;4m{_title[:-4]}\u001b[0m is newer locally, uploading...")
|
print(f"\u001b[38;5;4m{_title[:-4]}\u001b[0m is newer locally, uploading...")
|
||||||
run(['scp', '-pqs', '-P', _user_data[2], '-i', _user_data[5], _user_data[3] + _title,
|
run(['scp', '-pqs', '-P', _user_data[2], '-i', _user_data[5], _user_data[3] + _title,
|
||||||
f"{_user_data[0]}@{_user_data[1]}:{_user_data[4]}{'/'.join(_title.split('/')[:-1]) + '/'}"])
|
f"{_user_data[0]}@[{_user_data[1]}]:{_user_data[4]}{'/'.join(_title.split('/')[:-1]) + '/'}"])
|
||||||
elif int(_index_local[1][_i]) < int(_index_remote[1][_i]):
|
elif int(_index_local[1][_i]) < int(_index_remote[1][_i]):
|
||||||
print(f"\u001b[38;5;2m{_title[:-4]}\u001b[0m is newer remotely, downloading...")
|
print(f"\u001b[38;5;2m{_title[:-4]}\u001b[0m is newer remotely, downloading...")
|
||||||
run(['scp', '-pqs', '-P', _user_data[2], '-i', _user_data[5],
|
run(['scp', '-pqs', '-P', _user_data[2], '-i', _user_data[5],
|
||||||
f"{_user_data[0]}@{_user_data[1]}:{_user_data[4]}{_title}",
|
f"{_user_data[0]}@[{_user_data[1]}]:{_user_data[4]}{_title}",
|
||||||
f"{_user_data[3]}{'/'.join(_title.split('/')[:-1]) + '/'}"])
|
f"{_user_data[3]}{'/'.join(_title.split('/')[:-1]) + '/'}"])
|
||||||
else:
|
else:
|
||||||
print(f"\u001b[38;5;4m{_title[:-4]}\u001b[0m is not on remote server, uploading...")
|
print(f"\u001b[38;5;4m{_title[:-4]}\u001b[0m is not on remote server, uploading...")
|
||||||
run(['scp', '-pqs', '-P', _user_data[2], '-i', _user_data[5], _user_data[3] + _title,
|
run(['scp', '-pqs', '-P', _user_data[2], '-i', _user_data[5], _user_data[3] + _title,
|
||||||
f"{_user_data[0]}@{_user_data[1]}:{_user_data[4]}{'/'.join(_title.split('/')[:-1]) + '/'}"])
|
f"{_user_data[0]}@[{_user_data[1]}]:{_user_data[4]}{'/'.join(_title.split('/')[:-1]) + '/'}"])
|
||||||
for _title in _index_remote[0]:
|
for _title in _index_remote[0]:
|
||||||
if _title not in _index_local[0]:
|
if _title not in _index_local[0]:
|
||||||
print(f"\u001b[38;5;2m{_title[:-4]}\u001b[0m is not in local directory, downloading...")
|
print(f"\u001b[38;5;2m{_title[:-4]}\u001b[0m is not in local directory, downloading...")
|
||||||
run(['scp', '-pqs', '-P', _user_data[2], '-i', _user_data[5],
|
run(['scp', '-pqs', '-P', _user_data[2], '-i', _user_data[5],
|
||||||
f"{_user_data[0]}@{_user_data[1]}:{_user_data[4]}{_title}",
|
f"{_user_data[0]}@[{_user_data[1]}]:{_user_data[4]}{_title}",
|
||||||
f"{_user_data[3]}{'/'.join(_title.split('/')[:-1]) + '/'}"])
|
f"{_user_data[3]}{'/'.join(_title.split('/')[:-1]) + '/'}"])
|
||||||
|
|||||||
+9
-16
@@ -345,7 +345,7 @@ def print_info():
|
|||||||
print(f"{_border}{_blank}\n\u001b[38;5;7;48;5;8m/\u001b[38;5;15;48;5;15m{3*' '}\u001b[38;5;15;48;5;8m"
|
print(f"{_border}{_blank}\n\u001b[38;5;7;48;5;8m/\u001b[38;5;15;48;5;15m{3*' '}\u001b[38;5;15;48;5;8m"
|
||||||
f"sshyp ", f"copyright (c) 2021-2023 ", f"randall winkhart\u001b[38;5;15;48;5;15m{3*' '}"
|
f"sshyp ", f"copyright (c) 2021-2023 ", f"randall winkhart\u001b[38;5;15;48;5;15m{3*' '}"
|
||||||
f"\u001b[38;5;7;48;5;8m/\u001b[0m\n{_blank}")
|
f"\u001b[38;5;7;48;5;8m/\u001b[0m\n{_blank}")
|
||||||
print(f"\u001b[38;5;7;48;5;8m/\u001b[38;5;15;48;5;15m{20*' '}\u001b[38;5;15;48;5;8mversion 1.4.2"
|
print(f"\u001b[38;5;7;48;5;8m/\u001b[38;5;15;48;5;15m{20*' '}\u001b[38;5;15;48;5;8mversion 1.4.3"
|
||||||
f"\u001b[38;5;15;48;5;15m{21*' '}\u001b[38;5;7;48;5;8m/\u001b[0m")
|
f"\u001b[38;5;15;48;5;15m{21*' '}\u001b[38;5;7;48;5;8m/\u001b[0m")
|
||||||
print(f"\u001b[38;5;7;48;5;8m/\u001b[38;5;15;48;5;15m{9*' '}\u001b[38;5;15;48;5;8mthe argumentative "
|
print(f"\u001b[38;5;7;48;5;8m/\u001b[38;5;15;48;5;15m{9*' '}\u001b[38;5;15;48;5;8mthe argumentative "
|
||||||
f"agronomist update\u001b[38;5;15;48;5;15m{10*' '}\u001b[38;5;7;48;5;8m/\u001b[0m")
|
f"agronomist update\u001b[38;5;15;48;5;15m{10*' '}\u001b[38;5;7;48;5;8m/\u001b[0m")
|
||||||
@@ -627,7 +627,7 @@ def add_folder():
|
|||||||
# renames an entry or folder
|
# renames an entry or folder
|
||||||
def rename():
|
def rename():
|
||||||
from shutil import copy
|
from shutil import copy
|
||||||
_file = True
|
_file, _folder_disabler = True, False
|
||||||
if not exists(f"{directory}{entry_name}.gpg") and not exists(f"{directory}{entry_name}"):
|
if not exists(f"{directory}{entry_name}.gpg") and not exists(f"{directory}{entry_name}"):
|
||||||
print(f"\n\u001b[38;5;9merror: (/{entry_name}) does not exist\u001b[0m\n")
|
print(f"\n\u001b[38;5;9merror: (/{entry_name}) does not exist\u001b[0m\n")
|
||||||
s_exit(2)
|
s_exit(2)
|
||||||
@@ -648,19 +648,12 @@ def rename():
|
|||||||
else:
|
else:
|
||||||
|
|
||||||
# if renaming a folder
|
# if renaming a folder
|
||||||
if isdir(f"{directory}{_new_name}"):
|
print('\n\u001b[38;5;9merror: folder renaming disabled due to a bug causing severe data loss'
|
||||||
print(f"\n\u001b[38;5;9merror: (/{_new_name}/) already exists\u001b[0m\n")
|
'- fixed in future release v1.5.0\u001b[0m\n')
|
||||||
s_exit(3)
|
_folder_disabler = True
|
||||||
if not ssh_error:
|
if not ssh_error and not _folder_disabler:
|
||||||
Path(f"{directory}{_new_name}").mkdir(mode=0o700, parents=True, exist_ok=True)
|
|
||||||
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'python3 -c \'from pathlib import Path; Path("{directory_ssh}{_new_name}")'
|
f'cd /usr/lib/sshyp; python3 -c \'from sshync import delete; delete("{entry_name}", "remotely")\''])
|
||||||
f'.mkdir(mode=0o700, parents=True, exist_ok=True)\''])
|
|
||||||
else:
|
|
||||||
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")\''])
|
|
||||||
|
|
||||||
|
|
||||||
# edits the contents of an entry
|
# edits the contents of an entry
|
||||||
@@ -747,7 +740,7 @@ def copy_data():
|
|||||||
# WSL clipboard detection
|
# WSL clipboard detection
|
||||||
if 'WSL_DISTRO_NAME' in environ:
|
if 'WSL_DISTRO_NAME' in environ:
|
||||||
run(['powershell.exe', '-c', "Set-Clipboard '" + _copy_line[_index].rstrip().replace("'", "''") + "'"])
|
run(['powershell.exe', '-c', "Set-Clipboard '" + _copy_line[_index].rstrip().replace("'", "''") + "'"])
|
||||||
Popen("sleep 30; pwsh.exe -c 'echo \"\" | Set-Clipboard'", shell=True)
|
Popen("sleep 30; powershell.exe -c Set-Clipboard ''", shell=True, stdout=DEVNULL, stderr=DEVNULL))
|
||||||
# Wayland clipboard detection
|
# Wayland clipboard detection
|
||||||
elif 'WAYLAND_DISPLAY' in environ:
|
elif 'WAYLAND_DISPLAY' in environ:
|
||||||
run(['wl-copy', _copy_line[_index].rstrip()])
|
run(['wl-copy', _copy_line[_index].rstrip()])
|
||||||
@@ -779,7 +772,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")\''])
|
f'cd /usr/lib/sshyp; python3 -c \'from sshync import delete; delete("{entry_name}", "remotely")\''])
|
||||||
else:
|
else:
|
||||||
offline_delete(entry_name, 'locally')
|
offline_delete(entry_name, 'locally')
|
||||||
|
|
||||||
|
|||||||
@@ -9,7 +9,7 @@ arguments = argv[1:]
|
|||||||
if len(arguments) > 0:
|
if len(arguments) > 0:
|
||||||
if arguments[0] == 'WSL':
|
if arguments[0] == 'WSL':
|
||||||
replacement = """run(['powershell.exe', '-c', "Set-Clipboard '" + _copy_line[_index].rstrip().replace("'", "''") + "'"])
|
replacement = """run(['powershell.exe', '-c', "Set-Clipboard '" + _copy_line[_index].rstrip().replace("'", "''") + "'"])
|
||||||
Popen("sleep 30; pwsh.exe -c 'echo \\"\\" | Set-Clipboard'", shell=True)"""
|
Popen("sleep 30; powershell.exe -c Set-Clipboard ''", shell=True, stdout=DEVNULL, stderr=DENVULL)"""
|
||||||
elif arguments[0] == 'MAC':
|
elif arguments[0] == 'MAC':
|
||||||
replacement = """run(['pbcopy'], stdin=Popen(['printf', _copy_line[_index].rstrip().replace('\\\\\\', '\\\\\\\\\\\\\\').replace('%', '%%')],
|
replacement = """run(['pbcopy'], stdin=Popen(['printf', _copy_line[_index].rstrip().replace('\\\\\\', '\\\\\\\\\\\\\\').replace('%', '%%')],
|
||||||
stdout=PIPE).stdout)
|
stdout=PIPE).stdout)
|
||||||
|
|||||||
+13
-27
@@ -1,39 +1,25 @@
|
|||||||
sshyp v1.4.2
|
sshyp v1.4.3
|
||||||
04/30/2023
|
06/08/2023
|
||||||
|
|
||||||
the argumentative agronomist update - patch two
|
the argumentative agronomist update - patch three
|
||||||
|
|
||||||
IMPORTANT: the next major release of sshyp, v1.5.0, will make breaking changes that will require
|
IMPORTANT: the next major release of sshyp, v1.5.0, will make breaking changes that will require
|
||||||
running through 'sshyp tweak' again - also starting with v1.5.0, a copy of the changelog will no
|
running through 'sshyp tweak' again - also starting with v1.5.0, a copy of the changelog will no
|
||||||
longer be packaged with sshyp (it will still be available on GitHub) and clipboard tools
|
longer be packaged with sshyp (it will still be available on GitHub) and clipboard tools
|
||||||
(x-clip and wl-clipboard) will be set to optional dependencies ('sshyp tweak' will warn of this)
|
(x-clip and wl-clipboard) will be set to optional dependencies ('sshyp tweak' will warn of this)
|
||||||
|
|
||||||
this release makes use of a new ports framework to make sshyp even smaller and faster than before
|
this is a highly unconventional release featuring backports to fix critical bugs found during the
|
||||||
|
development of the upcoming v1.5.0
|
||||||
|
|
||||||
user-facing features:
|
fixes:
|
||||||
|
|
||||||
- full WSL (Windows Subsystem for Linux) support
|
- folder renaming has been disabled to prevent a severe data loss bug from occuring
|
||||||
- partial MacOS support
|
^ this has been properly fixed for v1.5.0, but the fix requires all clients and servers
|
||||||
^ fully functional; packaging support has not yet been added
|
to be updated - to avoid breaking compatibility with 1.4.X, folder renaming was simply disabled
|
||||||
- dedicated help screen for 'gen'
|
for the time being
|
||||||
^ this was previously not included due to 'sshyp gen' being a valid command prior to v1.4.0
|
- backported fix for syncing over IPv6
|
||||||
- removed interactive input for whitelist management
|
- backported fix for multiple versions of Powershell being called under WSL
|
||||||
^ this is to be consistent with the removal of interactive input on clients in v1.4.0
|
- backported fix for checking /lib/sshyp instead of /usr/lib/sshyp
|
||||||
|
|
||||||
fixes/optimizations:
|
|
||||||
|
|
||||||
- leading and following spaces are no longer stripped when printing entry contents
|
|
||||||
- properly display an error when trying to remove a device from the whitelist that is not whitelisted
|
|
||||||
- ports framework to remove unneeded code for each platform
|
|
||||||
^ BLANKS.py removes all blank lines
|
|
||||||
^ CLIPBOARD.py removes non-platform-critical clipboard code
|
|
||||||
^ COMMENTS.py removes all comments
|
|
||||||
^ RMSERVER.py removes server-only code for creating client-only packages
|
|
||||||
^ the Haiku package, which was already unsupported as a server, now only includes client code
|
|
||||||
^ SHEBANG.sh sets the shebang to what is required by the platform
|
|
||||||
^ TABS.sh converts all groups of spaces to tabs for space efficiency
|
|
||||||
^ UNAME.py removes all instances of platform detection and leaves only the platform-required code
|
|
||||||
^ THESE SCRIPTS ARE ONLY USED FOR PACKAGING AND DO NOT AFFECT THE SOURCE FILES IN THE GIT REPO
|
|
||||||
|
|
||||||
<><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><>
|
<><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><>
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user