mirror of
https://github.com/rwinkhart/sshyp.git
synced 2026-08-28 21:06:34 -04:00
Updated gen command to new notes system
This commit is contained in:
@@ -303,17 +303,22 @@ def gen(): # generates a password for a new or an existing entry
|
||||
_username = str(input('Username: '))
|
||||
_pass_length = int(input('How many characters should be in the password? '))
|
||||
_pass_type = str(input('Should the password be simple (for compatibility) or complex (for security)? (s/C) '))
|
||||
if _pass_type != 's':
|
||||
_pass_type = string.ascii_letters + string.digits + string.punctuation
|
||||
if _pass_type == 's':
|
||||
if _pass_type.lower() == 's':
|
||||
_pass_type = string.ascii_letters + string.digits
|
||||
else:
|
||||
_pass_type = string.ascii_letters + string.digits + string.punctuation
|
||||
_pass_gen = ''.join(random.SystemRandom().choice(_pass_type) for _ in range(_pass_length))
|
||||
if argument != 'gen update' and argument != 'gen -u':
|
||||
_url = str(input('URL: '))
|
||||
_notes = str(input('Additional notes: ')) # TODO update w/new notes system
|
||||
_add_note = input('Add a note to this entry? (y/N) ')
|
||||
_shm_folder, _shm_entry = shm_gen()
|
||||
open(f"/dev/shm/{_shm_folder}/{_shm_entry}", 'w').writelines(_username + '\n' + _pass_gen + '\n' + _url +
|
||||
'\n\n' + _notes + '\n\n')
|
||||
if _add_note.lower() == 'y':
|
||||
system(f"nano /dev/shm/{_shm_folder}/{_shm_entry}-n")
|
||||
_notes = open(f"/dev/shm/{_shm_folder}/{_shm_entry}-n", 'r').read()
|
||||
else:
|
||||
_notes = ''
|
||||
open(f"/dev/shm/{_shm_folder}/{_shm_entry}", 'w').writelines(_username + '\n' + _pass_gen + '\n' + _url + '\n\n'
|
||||
+ _notes + '\n\n')
|
||||
encrypt(_shm_folder, _shm_entry, _entry_name)
|
||||
system(f"gpg -d '{directory}{_entry_name}.gpg'")
|
||||
else:
|
||||
|
||||
@@ -10,10 +10,10 @@ New features:
|
||||
|
||||
Changes:
|
||||
|
||||
** the gen command in sshyp has been updated to use the newer notetaking system
|
||||
- the gen command has been updated to use the newer notetaking system
|
||||
- printing functions in sshyp have been combined into one function (arguments determine section to print)
|
||||
- file not found exceptions have been re-implemented
|
||||
** when syncing, a check is made to see if any folders are not on all devices - if the check comes back true, it is corrected
|
||||
** when syncing, a check is made to see if any folders are not on all devices - if the check comes back true, it is corrected (in sshyp)
|
||||
- folders in /dev/shm are no longer created before input from the user
|
||||
- .lower() is now used to remove casing when checking inputs
|
||||
- fixed syncing of files (specifically downloading) with special characters, such as '('
|
||||
@@ -34,7 +34,7 @@ Planned for next, next major update (The Shears Update Pt. 1):
|
||||
|
||||
- enforce permissions on the server-side
|
||||
- allow for copying entire notes (not just first line)
|
||||
- allow for multi-client deletion... somehow
|
||||
- allow for multi-client deletion... somehow (in sshync)
|
||||
- detatch sshync and make it a separate package
|
||||
|
||||
Planned for next, next, next major update (The Shears Update Pt. 2):
|
||||
|
||||
Reference in New Issue
Block a user