mirror of
https://github.com/rwinkhart/sshyp.git
synced 2026-08-27 20:36:27 -04:00
Remove trailing spaces upon commit
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
#!/bin/sh
|
||||
sed -i 's/[[:space:]]*$//' ./lib/* ./port-jobs/* ./package.sh
|
||||
git add -f extra lib/sshyp.py lib/sshync.py lib/stweak.py lib/clipclear.py port-jobs share LICENSE README.md package.sh commit.sh .gitignore
|
||||
git commit -m "$1"
|
||||
git push
|
||||
|
||||
+9
-9
@@ -232,7 +232,7 @@ def target_exists_check(_target_name, _expected_presence):
|
||||
else:
|
||||
print(f"\n\u001b[38;5;9merror: (/{_target_name}) does not exist\u001b[0m\n")
|
||||
s_exit(2)
|
||||
|
||||
|
||||
|
||||
# returns target type (entry == True, folder == False, null == None), optional errors
|
||||
def target_type_check(_target_name, _expected_type=True, _error=False):
|
||||
@@ -299,7 +299,7 @@ def print_info():
|
||||
f"version 1.5.2\u001b[38;5;15;48;5;15m{18*' '}\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{14*' '}\u001b[38;5;15;48;5;8mthe fortified flock"
|
||||
f" update\u001b[38;5;15;48;5;15m{15*' '}\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{9*' '}\u001b[38;5;15;48;5;8mcopyright 2021-2024 ",
|
||||
print(f"\u001b[38;5;7;48;5;8m\\\u001b[38;5;15;48;5;15m{9*' '}\u001b[38;5;15;48;5;8mcopyright 2021-2024 ",
|
||||
f"randall winkhart\u001b[38;5;15;48;5;15m{9*' '}\u001b[38;5;7;48;5;8m/\u001b[0m")
|
||||
print(f"{_blank}\n{_border}\nsee https://github.com/rwinkhart/sshyp for more information\n")
|
||||
elif arguments[0] == 'license':
|
||||
@@ -461,7 +461,7 @@ def rename():
|
||||
Path(f"{directory}{_new_name}").mkdir(mode=0o700, parents=True, exist_ok=True)
|
||||
run(('ssh', '-i', identity, '-p', port, f"{username_ssh}@{ip}",
|
||||
f'python3 -c \'from pathlib import Path; Path("{directory_ssh}{entry_name}")'
|
||||
f'.rename(Path("{directory_ssh}{_new_name}"))\''))
|
||||
f'.rename(Path("{directory_ssh}{_new_name}"))\''))
|
||||
else:
|
||||
move(f"{directory}{entry_name}", f"{directory}{_new_name}")
|
||||
if not ssh_error:
|
||||
@@ -473,7 +473,7 @@ def rename():
|
||||
def edit():
|
||||
# set to avoid PEP8 warnings
|
||||
_detail, _edit_line = None, None
|
||||
|
||||
|
||||
# ensure the edit target is an entry
|
||||
target_type_check(entry_name, True, True)
|
||||
|
||||
@@ -501,7 +501,7 @@ def gen():
|
||||
_username, _url, _notes = None, None, None
|
||||
# gen update
|
||||
if arg_count == 3 and arguments[2] in ('update', '-u'):
|
||||
# ensure the gen update target is an entry
|
||||
# ensure the gen update target is an entry
|
||||
target_type_check(entry_name, True, True)
|
||||
_new_lines = line_edit(decrypt(directory + entry_name, _quick_verify=quick_unlock_enabled), pass_gen(), 0)
|
||||
# gen
|
||||
@@ -613,10 +613,10 @@ if __name__ == "__main__":
|
||||
try:
|
||||
# set default states
|
||||
ssh_error, success_flag, sync_flag, silent_sync, pass_show = False, False, False, False, False
|
||||
|
||||
|
||||
# set to avoid PEP8 warnings
|
||||
arg_start, device_type, offline_mode_enabled = None, None, None
|
||||
|
||||
|
||||
# retrieve typed argument
|
||||
arguments = argv[1:]
|
||||
arg_count = len(arguments)
|
||||
@@ -716,14 +716,14 @@ if __name__ == "__main__":
|
||||
success_flag = True
|
||||
from stweak import wrapped_entry
|
||||
wrapped_entry(device_type)
|
||||
|
||||
|
||||
if arg_count > 0 and success_flag == 0 and arguments[0] != 'sync':
|
||||
if arguments[0] not in ('help', '-h', 'version', '-v', 'license'):
|
||||
extension_runner()
|
||||
else:
|
||||
print_info()
|
||||
elif not ssh_error:
|
||||
if sync_flag:
|
||||
if sync_flag:
|
||||
sync()
|
||||
elif (arg_count > 0 and arguments[0] == 'sync') or (arg_count > 1 and arguments[1] == 'shear'):
|
||||
sync('\n')
|
||||
|
||||
+7
-7
@@ -217,7 +217,7 @@ def ssh_config(_reconfig=False):
|
||||
run(('ssh-keygen', '-q', '-t', 'ed25519', '-N', _passphrase, '-f', _ssh_key))
|
||||
else:
|
||||
_ssh_key = _keys[_key_selected_num]
|
||||
|
||||
|
||||
# ssh+sshync configuration
|
||||
_uiport = curses_text('enter the username, ip, and ssh port of your sshyp server:\n\n\n\n\n(ctrl+g/enter to '
|
||||
'confirm)\n\nexample inputs:\n\n ipv4: user@10.10.10.10:22\n ipv6: user@[2000:2000:2000:2000'
|
||||
@@ -300,7 +300,7 @@ def refresh_encryption():
|
||||
f" matching the following:\n\n{home}/.local/share/sshyp.old\n{home}/.local/"
|
||||
"share/sshyp.new\n\nare you sure you wish to re-encrypt all entries?")
|
||||
if _sure != 1:
|
||||
return 3
|
||||
return 3
|
||||
|
||||
# set new gpg key
|
||||
gpg_config()
|
||||
@@ -319,7 +319,7 @@ def refresh_encryption():
|
||||
for _extension in ('.new', '.old'):
|
||||
if exists(f"{_directory}{_extension}"):
|
||||
rmtree(f"{_directory}{_extension}")
|
||||
|
||||
|
||||
# decrypt, optimize, and re-encrypt each entry with the newly selected key
|
||||
if isdir(_directory):
|
||||
_gpg_id = sshyp_data.get('CLIENT-GENERAL', 'gpg_id')
|
||||
@@ -329,13 +329,13 @@ def refresh_encryption():
|
||||
encrypt(decrypt(f"{_root}/{_filename[:-4]}"),
|
||||
f"{_root.replace(_directory, _directory + '.new', 1)}/{_filename[:-4]}", _gpg_id)
|
||||
|
||||
# create a backup of the original version and activate the new version
|
||||
# create a backup of the original version and activate the new version
|
||||
move(_directory, _directory + '.old')
|
||||
move(_directory + '.new', _directory)
|
||||
return 1
|
||||
else:
|
||||
return 2
|
||||
|
||||
|
||||
|
||||
# PORT START WHITELIST-SERVER
|
||||
# removes a registered device id from the server-side pool and prunes the quick-unlock whitelist
|
||||
@@ -426,7 +426,7 @@ def whitelist_manage(_action, _back=False):
|
||||
# runs quick-unlock configuration menu
|
||||
def whitelist_menu():
|
||||
while True:
|
||||
_choice = curses_radio(('setup/create pin', 'add to whitelist', 'remove from whitelist',
|
||||
_choice = curses_radio(('setup/create pin', 'add to whitelist', 'remove from whitelist',
|
||||
'BACK'), 'quick-unlock/whitelist management')
|
||||
if _choice == 0:
|
||||
whitelist_setup()
|
||||
@@ -564,7 +564,7 @@ def global_menu(_scr, _device_type, _top_message):
|
||||
dev_id_config(_port, _username_ssh, _ip, _identity)
|
||||
# ...or ssh_error is missing
|
||||
elif not sshyp_data.has_option('CLIENT-ONLINE', 'ssh_error'):
|
||||
sshyp_data.set('CLIENT-ONLINE', 'ssh_error', '1')
|
||||
sshyp_data.set('CLIENT-ONLINE', 'ssh_error', '1')
|
||||
write_config()
|
||||
_device_type = _dev_sync_types[0]
|
||||
elif _choice == 1:
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
#!/usr/bin/env python3
|
||||
import re
|
||||
|
||||
targets = (('TWEAK-EXTEND-FUNCTIONS', 'stweak.py', '\n', '\n\n', ''),
|
||||
targets = (('TWEAK-EXTEND-FUNCTIONS', 'stweak.py', '\n', '\n\n', ''),
|
||||
('TWEAK-EXTEND-OPTION', 'stweak.py', '', '', "curses_radio(['okay'], "
|
||||
"'extension management is not supported on this platform\\\\n\\\\ninstead, you may install and manage "
|
||||
"extensions through your system package manager\\\\n\\\\nofficial extension packages are available "
|
||||
|
||||
Reference in New Issue
Block a user