Compare commits

..
Author SHA1 Message Date
RandyTheSilly b08456e873 Updated documentation for release fr4.7 2022-02-16 16:24:11 -05:00
RandyTheSilly ef828b88a0 Added user-facing messages when deleting via sync 2022-02-16 16:10:37 -05:00
RandyTheSilly bde243c644 Continuation of recursive fix 2022-02-16 15:59:11 -05:00
RandyTheSilly 894f406fd2 Fix recursive folder syncing reporting incorrect directories 2022-02-16 15:57:23 -05:00
RandyTheSilly 00b935f1bb Allow for recursive folder syncing 2022-02-16 15:43:33 -05:00
RandyTheSilly 49608cb839 Updated changelog for fr4.6 2022-02-16 13:51:12 -05:00
RandyTheSilly a417478aa0 Fixed critical typo preventing folder syncing from working 2022-02-16 13:46:42 -05:00
RandyTheSilly 344c74b728 Updated changelog for release fr4.5 2022-02-16 13:28:00 -05:00
RandyTheSilly fc0e4bb4a5 Bump version 2022-02-16 13:23:43 -05:00
RandyTheSilly 37867cb673 More renaming 2022-02-16 13:22:10 -05:00
RandyTheSilly 86aa7da038 Renamed file to avoid syntax error 2022-02-16 13:20:24 -05:00
RandyTheSilly 9231257af8 Updated README.md to reflect new folder syncing changes 2022-02-16 12:50:29 -05:00
RandyTheSilly 102f22143f Updated manpage to reflect new folder syncing changes 2022-02-16 12:48:24 -05:00
RandyTheSilly 3dd12b4d6d Updated changelog for release fr4.4 2022-02-16 12:46:52 -05:00
RandyTheSilly a0b5dad073 Automatically remove old device names locally 2022-02-16 12:37:20 -05:00
RandyTheSilly 2ba19f9a39 Initial folder sync implementation 2022-02-16 12:02:45 -05:00
RandyTheSilly 8af71ceb1a More renaming 2022-02-16 09:44:24 -05:00
RandyTheSilly 81c9b35c75 Rename deletion check function 2022-02-16 09:27:22 -05:00
RandyTheSilly eeabc18f18 Fixed typo 2022-02-16 09:23:29 -05:00
RandyTheSilly 73128665fb Rename sshyp-shear.py to sshyp-remote.py for future intentions 2022-02-16 09:15:33 -05:00
RandyTheSilly 607a4709f6 Update README.md 2022-02-16 01:42:08 -05:00
RandyTheSilly c643e861d9 Updated changelog for release fr4.3 2022-02-16 01:39:35 -05:00
RandyTheSilly 23e7e375ae Properly applied fix from last commit 2022-02-16 01:35:48 -05:00
RandyTheSilly b8743d5fe2 Fixed local entry (not folders this time) deletion 2022-02-16 01:33:08 -05:00
RandyTheSilly e95aa85453 Updated changelog for release fr4.2 2022-02-16 01:18:12 -05:00
RandyTheSilly caf130568e Version bump for release fr4.2 2022-02-16 01:15:19 -05:00
RandyTheSilly f65adc17f3 Actually fixed local folder deletion this time 2022-02-16 01:13:35 -05:00
RandyTheSilly fc2f42a1aa Removed extra new line printed after some remote file checks 2022-02-16 01:07:03 -05:00
6 changed files with 315 additions and 25 deletions
+1 -3
View File
@@ -104,6 +104,4 @@ Long-term Goals:
# Known Issues
Currently, files deleted from a client or server may re-appear if another client that had the same file reconnects and later re-uploads it to the server. This will be addressed.
Currently, if a client is missing folders that exist on the server, the contents of the missing folders will fail to download. A temporary workaround is to manually create the folders on the client. This will be addressed.
Currently, the entry list displays each entry with the file extension ".gpg" visible (which you do not type when reading, modifying, or creating an entry). This will be corrected when the new entry list is added.
+30 -9
View File
@@ -61,7 +61,7 @@ def tweak(): # runs configuration wizard
open(path.expanduser('~/.config/sshyp/sshyp-device'), 'w').write(_device_type)
Path(path.expanduser('~/.config/sshyp/deleted')).mkdir(0o700, parents=True, exist_ok=True)
copy('/usr/bin/sshync.py', path.expanduser('~/'))
copy('/usr/bin/sshyp-shear.py', path.expanduser('~/shear.py'))
copy('/usr/bin/sshypRemote.py', path.expanduser('~/sshypRemote.py'))
print('\nMake sure the ssh service is running and properly configured.\n\nConfiguration complete!\n')
s_exit()
else:
@@ -107,6 +107,8 @@ def tweak(): # runs configuration wizard
path.expanduser('~/.ssh/sshyp'), _ip, _port, _username_ssh)
# device name configuration
for _name in listdir(path.expanduser('~/.config/sshyp/devices')): # remove existing device name
remove(f"{path.expanduser('~/.config/sshyp/devices/')}{_name}")
print('\nIMPORTANT: This name MUST be unique amongst your client devices. '
'\nThis is used to keep track of which devices have up-to-date databases.\n')
_client_device_name = str(input('What would you like to name this device? '))
@@ -158,7 +160,7 @@ def print_info(): # prints help text based on argument
print('/ /')
print('/ sshyp Copyright (C) 2021-2022 Randall Winkhart /')
print('/ /')
print('/ Version 2022.02.16.fr4.1 /')
print('/ Version 2022.02.16.fr4.7 /')
print('/ The High-Tech Shears Update /')
print('/ /')
print('////////////////////////////////////////////////////////\n')
@@ -210,8 +212,8 @@ def read_shortcut(): # shortcut to quickly read an entry
def sync(): # calls sshync to sync changes to the user's server
print('\nSyncing entries with the server device...\n')
# check for deletions
system(f"ssh -i '{path.expanduser('~/.ssh/sshyp')}' -p {port} {username_ssh}@{ip} \"python -c 'import shear"
f"; shear.check(\"'\"{client_device_name}\"'\")'\"")
system(f"ssh -i '{path.expanduser('~/.ssh/sshyp')}' -p {port} {username_ssh}@{ip} \"python -c 'import sshypRemote"
f"; sshypRemote.deletion_check(\"'\"{client_device_name}\"'\")'\"")
system(f"sftp -p -q -i '{path.expanduser('~/.ssh/sshyp')}' -P {port} {username_ssh}@{ip}:"
f"'/home/{username_ssh}/.config/sshyp/deletion_database' {path.expanduser('~/.config/sshyp/')}")
try:
@@ -221,16 +223,35 @@ def sync(): # calls sshync to sync changes to the user's server
_deletion_database = None
s_exit()
for _file in _deletion_database:
if _file.endswith('/'):
if _file[:-1].endswith('/'):
try:
print(f"Removing folder {path.expanduser('~/.password-pasture/')}{_file[:-1]}...\n")
rmtree(f"{path.expanduser('~/.password-pasture/')}{_file[:-1]}")
except FileNotFoundError:
print('Folder does not exist locally.\n')
else:
try:
remove(f"{path.expanduser('~/.password-pasture/')}{_file[:-1]}")
except FileNotFoundError:
print(f"Removing entry {path.expanduser('~/.password-pasture/')}{_file[:-1]}...\n")
remove(f"{path.expanduser('~/.password-pasture/')}{_file[:-1]}.gpg")
except (FileNotFoundError, IsADirectoryError):
print('File does not exist locally.\n')
# check for new folders
system(f"ssh -i '{path.expanduser('~/.ssh/sshyp')}' -p {port} {username_ssh}@{ip} \"python -c 'import sshypRemote"
f"; sshypRemote.folder_check()'\"")
system(f"sftp -p -q -i '{path.expanduser('~/.ssh/sshyp')}' -P {port} {username_ssh}@{ip}:"
f"'/home/{username_ssh}/.config/sshyp/folder_database' {path.expanduser('~/.config/sshyp/')}")
try:
_folder_database = open(path.expanduser('~/.config/sshyp/folder_database')).readlines()
except (FileNotFoundError, IndexError):
print('\nThe folder database does not exist or is corrupted.\n')
_folder_database = None
s_exit()
for _folder in _folder_database:
if Path(f"{path.expanduser('~')}{_folder[:-1]}").is_dir():
pass
else:
print(f"Adding folder {path.expanduser('~')}{_folder[:-1]}...\n")
Path(f"{path.expanduser('~')}{_folder[:-1]}").mkdir(0o700, parents=True, exist_ok=True)
# set permissions before uploading
system('find ' + directory + ' -type d -exec chmod -R 700 {} +')
system('find ' + directory + ' -type f -exec chmod -R 600 {} +')
@@ -416,8 +437,8 @@ def remove_data(): # deletes an entry from the server and flags it for local de
except FileNotFoundError:
print('\nAccess denied.\n')
s_exit()
system(f"ssh -i '{path.expanduser('~/.ssh/sshyp')}' -p {port} {username_ssh}@{ip} \"python -c 'import shear"
f"; shear.delete(\"'\"{_entry_name}\"'\")'\"")
system(f"ssh -i '{path.expanduser('~/.ssh/sshyp')}' -p {port} {username_ssh}@{ip} \"python -c 'import sshypRemote"
f"; sshypRemote.delete(\"'\"{_entry_name}\"'\")'\"")
# program start sequence
+11 -3
View File
@@ -2,7 +2,7 @@
# external modules
from os import remove, listdir
from os import listdir, remove, walk
from os.path import expanduser
from shutil import rmtree
@@ -19,12 +19,12 @@ def delete(_file_path):
try:
remove(f"{expanduser('~/.password-pasture/')}{_file_path}.gpg")
except FileNotFoundError:
print('\nFile does not exist remotely.\n')
print('\nFile does not exist remotely.')
for _device_name in listdir(expanduser('~/.config/sshyp/devices')):
open(f"{expanduser('~/.config/sshyp/deleted/')}{_file_path.replace('/', '@')}^&*{_device_name}", 'w')
def check(_client_device_name):
def deletion_check(_client_device_name):
open(expanduser('~/.config/sshyp/deletion_database'), 'w').write('')
for _file in listdir(expanduser('~/.config/sshyp/deleted')):
_file_path = _file.replace('@', '/').split('^&*')[0]
@@ -35,3 +35,11 @@ def check(_client_device_name):
except FileNotFoundError:
pass
open(expanduser('~/.config/sshyp/deletion_database'), 'a').write(_file_path + '\n')
def folder_check():
open(expanduser('~/.config/sshyp/folder_database'), 'w').write('')
for _root, _directories, _files in walk(expanduser('~/.password-pasture')):
for _dir in _directories:
open(expanduser('~/.config/sshyp/folder_database'), 'a')\
.write(f"{_root.replace(expanduser('~'), '')}/{_dir}\n")
+264
View File
@@ -1,3 +1,267 @@
sshyp 2022.02.16.fr4.7
The High-Tech Shears Update - Patch 7
This release enables recursive folder syncing.
Note: Upgrading from releases older than fr4.7 requires the configuration ("sshyp tweak") to be re-done, as the configuration process has changed.
Changes:
- re-wrote folder checking function to fetch subdirectories recursively
- added in user-facing messages for when folders are being synced or entries are being removed
- fixed a typo preventing folder syncing from working (actually tested this time)
&&
Planned for next major update (fr5, The sshyp Doing a Split Update):
sshyp:
** sshyp has recieved a major visual overhaul
^ this includes the new file list and thematic text art
sshync:
** sshync has been split into a separate package and now has standalone functionality as a backup/syncing utility
^ more details will be available in the sshync repo, once it is created
&&
Planned for next, next major update (fr6, The Farmer Shearing the sshyp Update):
** imporove password generator to guarantee more secure results
** enforce permissions on the server-side
** allow for copying entire notes (not just first line)
** ability to pass entries as arguments for more functions
&&
Backlog:
** create separate gui frontend targetting mobile and desktop Linux
** auto-completion on tab (currently unsure of best way to make this work)
<><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><>
sshyp 2022.02.16.fr4.6
The High-Tech Shears Update - Patch 6
This release addresses a critical typo.
Note: Upgrading from releases older than fr4.6 requires the configuration ("sshyp tweak") to be re-done, as the configuration process has changed.
Changes:
- corrected a typo error causing folder syncing issues
&&
Planned for next major update (fr5, The sshyp Doing a Split Update):
sshyp:
** sshyp has recieved a major visual overhaul
^ this includes the new file list and thematic text art
sshync:
** sshync has been split into a separate package and now has standalone functionality as a backup/syncing utility
^ more details will be available in the sshync repo, once it is created
&&
Planned for next, next major update (fr6, The Farmer Shearing the sshyp Update):
** 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)
** imporove password generator to guarantee more secure results
** enforce permissions on the server-side
** allow for copying entire notes (not just first line)
** ability to pass entries as arguments for more functions
&&
Backlog:
** create separate gui frontend targetting mobile and desktop Linux
** auto-completion on tab (currently unsure of best way to make this work)
<><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><>
sshyp 2022.02.16.fr4.5
The High-Tech Shears Update - Patch 5
This release addresses a critical syntax error.
Note: Upgrading from releases older than fr4.5 requires the configuration ("sshyp tweak") to be re-done, as the configuration process has changed.
Changes:
- corrected a syntax error causing critical functionality issues
&&
Planned for next major update (fr5, The sshyp Doing a Split Update):
sshyp:
** sshyp has recieved a major visual overhaul
^ this includes the new file list and thematic text art
sshync:
** sshync has been split into a separate package and now has standalone functionality as a backup/syncing utility
^ more details will be available in the sshync repo, once it is created
&&
Planned for next, next major update (fr6, The Farmer Shearing the sshyp Update):
** 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)
** imporove password generator to guarantee more secure results
** enforce permissions on the server-side
** allow for copying entire notes (not just first line)
** ability to pass entries as arguments for more functions
&&
Backlog:
** create separate gui frontend targetting mobile and desktop Linux
** auto-completion on tab (currently unsure of best way to make this work)
<><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><>
sshyp 2022.02.16.fr4.4
The High-Tech Shears Update - Patch 4
This release automatically generates user-created folders on new client devices.
Note: Upgrading to releases in the fr4 series requires the configuration ("sshyp tweak") to be re-done, as a device name now must be set (for multi-client deletion). Even upgrading from fr4.3 to fr4.4 will require re-running "sshyp tweak" due to file name changes.
Features:
- implemented proper folder syncing for new clients and clients missing folders that exist server-side
Changes:
- old device names are now automatically deleted (locally) when running "sshyp tweak", to prevent conflicts
&&
Planned for next major update (fr5, The sshyp Doing a Split Update):
sshyp:
** sshyp has recieved a major visual overhaul
^ this includes the new file list and thematic text art
sshync:
** sshync has been split into a separate package and now has standalone functionality as a backup/syncing utility
^ more details will be available in the sshync repo, once it is created
&&
Planned for next, next major update (fr6, The Farmer Shearing the sshyp Update):
** 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)
** imporove password generator to guarantee more secure results
** enforce permissions on the server-side
** allow for copying entire notes (not just first line)
** ability to pass entries as arguments for more functions
&&
Backlog:
** create separate gui frontend targetting mobile and desktop Linux
** auto-completion on tab (currently unsure of best way to make this work)
<><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><>
sshyp 2022.02.16.fr4.3
The High-Tech Shears Update - Patch 3
This release addresses a bug with local entry deletion.
Note: Upgrading to releases in the fr4 series requires the configuration ("sshyp tweak") to be re-done, as a device name now must be set (for multi-client deletion).
Changes:
- fixed an issue where entries could not be deleted locally
&&
Planned for next major update (fr5, The sshyp Doing a Split Update):
sshyp:
** sshyp has recieved a major visual overhaul
^ this includes the new file list and thematic text art
sshync:
** sshync has been split into a separate package and now has standalone functionality as a backup/syncing utility
^ more details will be available in the sshync repo, once it is created
&&
Planned for next, next major update (fr6, The Farmer Shearing the sshyp Update):
** 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)
** imporove password generator to guarantee more secure results
** enforce permissions on the server-side
** allow for copying entire notes (not just first line)
** ability to pass entries as arguments for more functions
&&
Backlog:
** create separate gui frontend targetting mobile and desktop Linux
** auto-completion on tab (currently unsure of best way to make this work)
<><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><>
sshyp 2022.02.16.fr4.2
The High-Tech Shears Update - Patch 2
This release re-addresses a bug with local folder deletion.
Note: Upgrading to releases in the fr4 series requires the configuration ("sshyp tweak") to be re-done, as a device name now must be set (for multi-client deletion).
Changes:
- fixed an issue where folders could not be deleted locally (actually, this time)
- properly handled an exception for when the user forgets a following '/' when attempting to delete a folder
&&
Planned for next major update (fr5, The sshyp Doing a Split Update):
sshyp:
** sshyp has recieved a major visual overhaul
^ this includes the new file list and thematic text art
sshync:
** sshync has been split into a separate package and now has standalone functionality as a backup/syncing utility
^ more details will be available in the sshync repo, once it is created
&&
Planned for next, next major update (fr6, The Farmer Shearing the sshyp Update):
** 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)
** imporove password generator to guarantee more secure results
** enforce permissions on the server-side
** allow for copying entire notes (not just first line)
** ability to pass entries as arguments for more functions
&&
Backlog:
** create separate gui frontend targetting mobile and desktop Linux
** auto-completion on tab (currently unsure of best way to make this work)
<><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><>
sshyp 2022.02.16.fr4.1
The High-Tech Shears Update - Patch 1
+2 -3
View File
@@ -1,4 +1,4 @@
.TH sshyp 1 "16 February 2022" "2022.02.16.fr4.1" "sshyp man page"
.TH sshyp 1 "16 February 2022" "2022.02.16.fr4.7" "sshyp man page"
.SH NAME
sshyp \- A very simple self-hosted, synchronized password manager. Alternative to GNU pass.
.SH SYNOPSIS
@@ -73,11 +73,10 @@ gen:
.SH LIMITATIONS
The following limitations will be corrected in future updates:
Currently, folders (for sorting) are not replicated onto new clients (they need to be manually created before syncing).
Currently, the entry list displays each entry with the file extension ".gpg" visible (which you do not type when reading, modifying, or creating an entry). This will be corrected when the new entry list is added.
The following characters/character sequences are not supported in entry/folder titles:
@ ^&*
.SH SETUP
sshyp operates on a client-server model, and thus requires you to have access to your own server (whether it be a physical home server or a cloud rental) with remote access via SSH.
+7 -7
View File
@@ -1,15 +1,16 @@
sshyp 2022.02.16.fr4.1
sshyp 2022.02.16.fr4.7
The High-Tech Shears Update - Patch 1
The High-Tech Shears Update - Patch 7
This release addresses a bug with local folder deletion.
This release enables recursive folder syncing.
Note: Upgrading to releases in the fr4 series requires the configuration ("sshyp tweak") to be re-done, as a device name now must be set (for multi-client deletion).
Note: Upgrading from releases older than fr4.7 requires the configuration ("sshyp tweak") to be re-done, as the configuration process has changed.
Changes:
- fixed an issue where folders could not be deleted locally
- optimized deletion flags
- re-wrote folder checking function to fetch subdirectories recursively
- added in user-facing messages for when folders are being synced or entries are being removed
- fixed a typo preventing folder syncing from working (actually tested this time)
&&
@@ -27,7 +28,6 @@ sshync:
Planned for next, next major update (fr6, The Farmer Shearing the sshyp Update):
** 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)
** imporove password generator to guarantee more secure results
** enforce permissions on the server-side
** allow for copying entire notes (not just first line)