Compare commits

..
Author SHA1 Message Date
RandyTheSilly 3c4bf0115f Updated changelog for release fr3.2 2022-01-16 21:33:35 -05:00
RandyTheSilly 762211bae0 Fixed temporary directory for Termux 2022-01-16 21:01:56 -05:00
RandyTheSilly d9adcac8ec sshync now properly generates its config directory 2022-01-16 16:27:05 -05:00
RandyTheSilly 1d9000ab16 Updated changelog for release fr3.1 2022-01-16 05:45:43 -05:00
RandyTheSilly bdea49268d Update README.md 2022-01-16 05:39:18 -05:00
RandyTheSilly 187ea39861 Re-wrote get_titles_mods for better fr3 compatibility 2022-01-16 05:29:41 -05:00
RandyTheSilly ee8e7fc8a5 Simplified expanduser statements 2022-01-15 18:32:59 -05:00
RandyTheSilly 8a4ae469fa Another attempt at updating sshync for fr3 compatibility 2022-01-13 05:02:35 -05:00
RandyTheSilly 4330617060 Partial revert for last fix 2022-01-13 04:36:58 -05:00
RandyTheSilly 54397dcd13 Partial sync fix 2022-01-13 04:31:28 -05:00
RandyTheSilly 0e7595489b Update changelog for release fr3 2022-01-13 03:06:16 -05:00
RandyTheSilly cd378aadc2 Version bump to 2022.01.13.fr3 2022-01-13 03:03:04 -05:00
RandyTheSilly d26c2a5e08 ~/.config/sshyp is now auto-generated 2022-01-13 02:56:34 -05:00
RandyTheSilly b24bcdd413 Updated packaging script to reflect new config file directory 2022-01-13 02:53:04 -05:00
RandyTheSilly b0fa1f99c9 Changed method for detecting Termux 2022-01-13 02:46:18 -05:00
RandyTheSilly 2825b43659 Changed config directory from /var/lib/sshyp to ~/.config/sshyp (for Termux compatibility) 2022-01-13 02:34:35 -05:00
RandyTheSilly 49721cd39a Added Termux clipboard support 2022-01-13 01:57:07 -05:00
RandyTheSilly 715d58fb62 Added Debian support/improved support for other formats in packaging script 2022-01-13 01:25:56 -05:00
RandyTheSilly 73307e2b3c Added error message for unimplemented options 2022-01-12 20:09:11 -05:00
RandyTheSilly ab739e3920 Fixed packaging script using incorrect directories 2022-01-12 19:31:15 -05:00
RandyTheSilly 0253872c8d (hopefully) fixed generic packaging 2022-01-12 18:43:44 -05:00
RandyTheSilly 2d2b0aa0ec Updated roadmap for future releases 2022-01-12 18:16:43 -05:00
rwinkhart 532784d817 Delete PKGBUILD 2022-01-12 22:58:39 +00:00
RandyTheSilly 6d1bf9f96c Added Termux and PKGBUILD support to packaging script 2022-01-12 17:57:23 -05:00
RandyTheSilly 67a7c2e382 Update README.md 2022-01-12 00:56:33 -05:00
RandyTheSilly 9f229e7ae7 Updated packaging script to build in the active directory 2022-01-12 00:40:12 -05:00
RandyTheSilly e3b0d2dbe7 Added a packaging script 2022-01-12 00:24:12 -05:00
RandyTheSilly ce4e32c8f4 Updated roadmap for future releases 2022-01-11 21:42:33 -05:00
RandyTheSilly 0fb339a2ab Updated PKGBUILD 2022-01-10 23:38:15 -05:00
RandyTheSilly 51ac1a49fd Update README.md 2022-01-10 23:29:18 -05:00
RandyTheSilly 87576338fd Updated changelogs for release 2022-01-10 23:20:36 -05:00
RandyTheSilly 6116de41b1 Bumped sshync version number 2022-01-10 23:13:42 -05:00
RandyTheSilly a218e77e41 Updated gen command to new notes system 2022-01-10 22:59:52 -05:00
RandyTheSilly e00fd64c66 Further prevention of /dev/shm file retention 2022-01-10 22:36:19 -05:00
RandyTheSilly e2f45c7cac Prevent /dev/shm files being generated before a keyboard interrupt 2022-01-10 22:23:21 -05:00
RandyTheSilly 700d5701fd Fixed temporary file deletion 2022-01-10 09:57:36 -05:00
RandyTheSilly ac6f6f279f Fixed editing a file that doesn't exist 2022-01-10 09:39:29 -05:00
RandyTheSilly 019aa58411 Combined print functions 2022-01-10 08:35:46 -05:00
RandyTheSilly 398ac8a04a Simplified input checking w/.lower() 2022-01-10 02:46:53 -05:00
RandyTheSilly d63c663dd0 Fixed downloading with special characters 2022-01-10 02:37:37 -05:00
RandyTheSilly 078d6026e0 Fixed downloading with special characters 2022-01-10 02:36:01 -05:00
RandyTheSilly 76c4fff520 Removed unnecessary line from man page 2022-01-10 02:21:10 -05:00
RandyTheSilly 2ba2dd57e4 Added man page 2022-01-10 02:14:55 -05:00
RandyTheSilly e64ef1103d Updated roadmap 2021-12-05 19:32:15 -05:00
RandyTheSilly d3971af85b Updated roadmap 2021-12-05 19:13:29 -05:00
RandyTheSilly 7840f47b9f Removed old reference to rsync in config string 2021-12-04 12:06:05 -05:00
RandyTheSilly 21785ce380 Updated roadmap 2021-12-02 20:54:26 -05:00
RandyTheSilly c716073525 Added roadmap for next update 2021-12-02 00:11:38 -05:00
8 changed files with 686 additions and 252 deletions
-22
View File
@@ -1,22 +0,0 @@
# Maintainer: Randall Winkhart <idgr at tutanota dot com>
pkgname=sshyp
pkgver=2021.12.01.fr2.2
pkgrel=1
pkgdesc='A self-hosted, synchronized password manager'
url='https://github.com/rwinkhart/sshyp'
arch=('x86_64' 'aarch64')
license=('GPL3')
depends=( python gnupg openssh nano xclip wl-clipboard)
source_x86_64=('https://github.com/rwinkhart/sshyp/releases/download/v2021.12.01.fr2.2/sshyp-2021.12.01.fr2.2.tar.xz')
source_aarch64=('https://github.com/rwinkhart/sshyp/releases/download/v2021.12.01.fr2.2/sshyp-2021.12.01.fr2.2.tar.xz')
sha512sums_x86_64=('470f7b4fd2bb0cc34a98e8ab5506ae4bc82e311616e2a81ee4fc559dd9e2c2e46a05517a49ba4d4fe108f341f92250bd1d63acca134d277b37d2475e03713adf')
sha512sums_aarch64=('470f7b4fd2bb0cc34a98e8ab5506ae4bc82e311616e2a81ee4fc559dd9e2c2e46a05517a49ba4d4fe108f341f92250bd1d63acca134d277b37d2475e03713adf')
package() {
tar xf sshyp-"$pkgver".tar.xz -C "${pkgdir}"
chown -R "$USER" ${pkgdir}/var/lib/sshyp
}
+30 -11
View File
@@ -30,11 +30,9 @@ What sshyp definitely won't do:
- Windows support (I don't use Windows and I have no interest in developing for it)
# Installation
Arch Linux (x86_64, aarch64)
Arch Linux (all ISAs)
Note: currently unavailable in the AUR (the older version, "rpass", will remain available until sshyp is stable)
sshyp releases will be available in the Arch User Repository as 'sshyp'.
sshyp releases are available in the Arch User Repository as 'sshyp'.
Install with your preferred AUR helper or use:
@@ -46,8 +44,25 @@ makepkg -si
Packaging for other distributions coming soon.
# Building
Since sshyp is written entirely in Python, it doesn't need to be compiled. It does, however, need to be packaged for installation.
A packaging script is included in the root directory of the repo in order to package sshyp for your distribution. To package sshyp from source, simply run:
```
git clone https://github.com/rwinkhart/sshyp.git
cd sshyp
./package.sh
```
The packaging script has been tested on Arch Linux with dpkg as a dependency for Debian and Termux packaging.
The AUR version and the packages attatched to the release tags were already packaged using this script.
Currently, the script can create packages for Arch (PKGBUILD), Debian, Termux, and generic. Packaging for other distributions coming soon.
# Usage
Upon initial installation, be sure to run:
Upon initial installation (on both the server and client devices), be sure to run:
```
sshyp tweak
@@ -56,17 +71,24 @@ sshyp tweak
This command will allow you to configure the settings necessary for sshyp to function.
As of right now, sshyp is rapidly changing, and as such, it is a good idea to run "sshyp tweak" after each update.
Please note that decrypting and reading entries is disabled on server devices for security reasons. Only devices configured as clients can use the gpg key to decrypt entries.
All available options can be found with:
```
sshyp --help
```
Or alternatively, in the new manpage:
```
man sshyp
```
# Roadmap
Short-term Goals:
- create new file list w/color and w/o file extensions
- create a man page
- overhaul argument system
- fix lots of bugs!
- make lots of optimizations!
@@ -81,10 +103,7 @@ Long-term Goals:
- seize the thrones, shear the humans
# Known Issues
Broken Features in Latest Release:
- the 'gen' function uses the older notetaking system
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.
Broken Features in Source:
- the 'gen' function uses the older notetaking system
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.
+21 -21
View File
@@ -1,11 +1,11 @@
#!/usr/bin/python3
# sshync 2021.12.01.unreleased7
# sshync 2022.01.16.unreleased11
# external modules
from os import system, remove, walk
from os.path import getmtime, join
from os import system, remove, mkdir, walk
from os.path import getmtime, join, expanduser
from sys import exit as s_exit
@@ -13,31 +13,32 @@ from sys import exit as s_exit
def get_titles_mods(_directory, _destination, _user_data):
_title_list, _mod_list = [], []
try: # create config directory
mkdir(expanduser('~/.config/sshync'), 0o700)
except FileExistsError:
pass
# local fetching
if _destination == 'l':
if type(_user_data) == str:
_user_data = str(_user_data).strip('(').strip(')').replace(' ', '').split(',')
try:
remove(_user_data[6] + 'sshync_database')
except FileNotFoundError:
pass
remove(expanduser('~/.config/sshync/database')) # assumed to exist because remote runs first
open(expanduser('~/.config/sshync/database'), 'w') # create blank database file
for _root, _directories, _files in walk(_directory):
for _filename in _files:
_title_list.append(join(_root.replace(_directory, '', 1), _filename))
_mod_list.append(int(getmtime(join(_root, _filename))))
i = -1
for _title in _title_list:
open(_user_data[6] + 'sshync_database', 'a').write(str(_title) + '\n')
open(_user_data[6] + 'sshync_database', 'a').write('^&*\n')
open(expanduser('~/.config/sshync/database'), 'a').write(str(_title) + '\n')
open(expanduser('~/.config/sshync/database'), 'a').write('^&*\n')
for _mod in _mod_list:
open(_user_data[6] + 'sshync_database', 'a').write(str(_mod) + '\n')
open(expanduser('~/.config/sshync/database'), 'a').write(str(_mod) + '\n')
# remote fetching
if _destination == 'r':
system(f"ssh -i '{_user_data[5]}' -p {_user_data[2]} {_user_data[0]}@{_user_data[1]} \"python -c 'import sshync"
f"; sshync.get_titles_mods(\"'\"{_user_data[4]}\"'\", \"'\"l\"'\", \"'\"{_user_data}\"'\")'\"")
system(f"sftp -P {_user_data[2]} {_user_data[0]}@{_user_data[1]}:'{_user_data[6]}sshync_database' "
f"'{_user_data[6]}sshync_database'")
_titles, _sep, _mods = ' '.join(open(_user_data[6] + 'sshync_database').readlines()).replace('\n', '').partition('^&*')
system(f"sftp -P {_user_data[2]} {_user_data[0]}@{_user_data[1]}:"
f"'{expanduser(f'/home/{_user_data[0]}/.config/sshync/database')}' "
f"'{expanduser('~/.config/sshync/database')}'")
_titles, _sep, _mods = ' '.join(open(expanduser('~/.config/sshync/database')).readlines()).replace('\n', '')\
.partition('^&*')
_title_list, _mod_list = _titles.split(' ')[:-1], _mods.split(' ')[1:]
return _title_list, _mod_list
@@ -76,8 +77,7 @@ def get_profile(_profile_dir):
_local_dir = _profile_data[3].replace('\n', '')
_remote_dir = _profile_data[4].replace('\n', '')
_identity = _profile_data[5].replace('\n', '')
_data_dir = ' '.join(_profile_dir.split('/')[:-1]).replace(' ', '/') + '/'
return _user, _ip, _port, _local_dir, _remote_dir, _identity, _data_dir
return _user, _ip, _port, _local_dir, _remote_dir, _identity
def run_profile(_profile_dir):
@@ -97,7 +97,7 @@ def run_profile(_profile_dir):
elif int(_index_l[1][_i]) < int(_index_r[1][_i]):
print(f"[{_title}] Remote is newer, downloading...")
system(f"sftp -p -q -i '{_user_data[5]}' -P {_user_data[2]} {_user_data[0]}@{_user_data[1]}:"
f"{_user_data[4]}{_title} {_user_data[3]}{'/'.join(_title.split('/')[:-1]) + '/'}")
f"'{_user_data[4]}'{_title} {_user_data[3]}{'/'.join(_title.split('/')[:-1]) + '/'}")
else:
print(f"[{_title}] Not on remote server, uploading...")
system(f"sftp -p -q -i '{_user_data[5]}' -P {_user_data[2]} {_user_data[0]}@{_user_data[1]}:{_user_data[4]}"
@@ -105,5 +105,5 @@ def run_profile(_profile_dir):
for _title in _index_r[0]:
if _title not in _index_l[0]:
print(f"[{_title}] Not in local directory, downloading...")
system(f"sftp -p -q -i '{_user_data[5]}' -P {_user_data[2]} {_user_data[0]}@{_user_data[1]}:{_user_data[4]}"
f"{_title} {_user_data[3]}{'/'.join(_title.split('/')[:-1]) + '/'}")
system(f"sftp -p -q -i '{_user_data[5]}' -P {_user_data[2]} {_user_data[0]}@{_user_data[1]}:"
f"'{_user_data[4]}{_title}' {_user_data[3]}{'/'.join(_title.split('/')[:-1]) + '/'}")
+191 -167
View File
@@ -2,9 +2,10 @@
# external modules
from os import environ, mkdir, remove, system
from os import environ, mkdir, remove, system, path
from shutil import copy, move, rmtree
from sys import argv, exit as s_exit
from pathlib import Path
import random
import sshync
import string
@@ -18,77 +19,85 @@ def replace_line(file_name, line_num, text): # replaces text in a given line wi
open(file_name, 'w').writelines(_lines)
def shm_gen(): # generates random folder in /dev/shm for security and returns random names for the folder and temp file
def shm_gen(): # generates a random temporary folder for security and returns random names for the folder and temp file
_shm_folder_gen = ''.join(random.SystemRandom().choice(string.ascii_letters + string.digits)
for _ in range(random.randint(10, 30)))
_shm_entry_gen = ''.join(random.SystemRandom().choice(string.ascii_letters + string.digits)
for _ in range(random.randint(10, 30)))
mkdir(f"/dev/shm/{_shm_folder_gen}", 0o700)
mkdir(f"{tmp_dir}{_shm_folder_gen}", 0o700)
return _shm_folder_gen, _shm_entry_gen
def encrypt(_shm_folder, _shm_entry, _location):
system(f"gpg -r {str(gpg_id)} -e '/dev/shm/{_shm_folder}/{_shm_entry}'")
move(f"/dev/shm/{_shm_folder}/{_shm_entry}.gpg", f"{directory}{_location}.gpg")
rmtree(f"/dev/shm/{_shm_folder}")
system(f"gpg -r {str(gpg_id)} -e '{tmp_dir}{_shm_folder}/{_shm_entry}'")
move(f"{tmp_dir}{_shm_folder}/{_shm_entry}.gpg", f"{directory}{_location}.gpg")
rmtree(f"{tmp_dir}{_shm_folder}")
def edit_note(_shm_folder, _shm_entry):
lines = open(f"/dev/shm/{_shm_folder}/{_shm_entry}").readlines()
open(f"/dev/shm/{_shm_folder}/{_shm_entry}", 'w').writelines(lines[0:3])
open(f"/dev/shm/{_shm_folder}/{_shm_entry}-n", 'w').writelines(lines[4:-2])
system(f"nano /dev/shm/{_shm_folder}/{_shm_entry}-n")
edit_notes = open(f"/dev/shm/{_shm_folder}/{_shm_entry}-n").read()
open(f"/dev/shm/{_shm_folder}/{_shm_entry}", 'a').write('\n' + edit_notes + '\n\n')
lines = open(f"{tmp_dir}{_shm_folder}/{_shm_entry}").readlines()
open(f"{tmp_dir}{_shm_folder}/{_shm_entry}", 'w').writelines(lines[0:3])
open(f"{tmp_dir}{_shm_folder}/{_shm_entry}-n", 'w').writelines(lines[4:-2])
system(f"nano {tmp_dir}{_shm_folder}/{_shm_entry}-n")
edit_notes = open(f"{tmp_dir}{_shm_folder}/{_shm_entry}-n").read()
open(f"{tmp_dir}{_shm_folder}/{_shm_entry}", 'a').write('\n' + edit_notes + '\n\n')
# argument-specific functions
def tweak(): # runs configuration wizard
# storage directory creation
# storage/config directory creation
try:
mkdir(f"/home/{environ.get('USER')}/.password-pasture", 0o700)
mkdir(path.expanduser('~/.password-pasture'), 0o700)
except FileExistsError:
pass
try:
mkdir(path.expanduser('~/.config/sshyp'), 0o700)
except FileExistsError:
pass
if not Path(f"{path.expanduser('~/.config/sshyp/tmp')}").is_file():
if Path("/data/data/com.termux").is_file():
system(f"ln -s {path.expanduser('~/../usr/tmp')} {path.expanduser('~/.config/sshyp/tmp')}")
else:
system(f"ln -s /dev/shm {path.expanduser('~/.config/sshyp/tmp')}")
# device type configuration
_device_type = input('\nIs this installation for a client or for a server? (C/s) ')
if _device_type == 'S' or _device_type == 's':
open("/var/lib/sshyp/sshyp-device", 'w').write(_device_type)
copy('/usr/bin/sshync.py', f"/home/{environ.get('USER')}/")
if _device_type.lower() == 's':
open(path.expanduser('~/.config/sshyp/sshyp-device'), 'w').write(_device_type)
copy('/usr/bin/sshync.py', path.expanduser('~/'))
print('\nMake sure the ssh service is running and properly configured.\n\nConfiguration complete!\n')
s_exit()
else:
# device type configuration
_device_type = 'c' # ensure device type flag is properly set
open("/var/lib/sshyp/sshyp-device", 'w').write(_device_type)
open(path.expanduser('~/.config/sshyp/sshyp-device'), 'w').write(_device_type)
# gpg configuration
_gpg_id = input('\nsshyp requires the use of a unique gpg key. Do you already have one that you are '
'willing to use? (y/N)')
if _gpg_id != 'y' and _gpg_id != 'Y':
if _gpg_id.lower() != 'y':
print('\nA unique gpg key has been generated for you.')
system('gpg --full-generate-key')
_gpg_id = str(input('\nPlease input the ID of your gpg key: '))
open("/var/lib/sshyp/sshyp-gpg", 'w').write(_gpg_id + '\n')
open(path.expanduser('~/.config/sshyp/sshyp-gpg'), 'w').write(_gpg_id + '\n')
# lock file generation
try:
open('/var/lib/sshyp/lock', 'x').write('')
open(path.expanduser('~/.config/sshyp/lock'), 'x').write('')
except FileExistsError:
pass
system(f"gpg -r {str(_gpg_id)} -e /var/lib/sshyp/lock")
remove('/var/lib/sshyp/lock')
system(f"gpg -r {str(_gpg_id)} -e {path.expanduser('~/.config/sshyp/lock')}")
remove(f"{path.expanduser('~/.config/sshyp')}/lock")
# ssh key configuration
_ssh_gen = (input('\nMake sure the ssh service on the remote server is running and properly configured.'
'\n\nrsync support requires a unique ssh key. Would you like to have this automatically '
'\n\nSync support requires a unique ssh key. Would you like to have this automatically '
'generated? (Y/n) '))
if _ssh_gen != 'n' and _ssh_gen != 'N':
if _ssh_gen.lower() != 'n':
system('ssh-keygen -t ed25519 -f ~/.ssh/sshyp')
else:
print(f"\nEnsure that the key file you are using is located at /home/{environ.get('USER')}/.ssh/sshyp")
print(f"\nEnsure that the key file you are using is located at {path.expanduser('~/.ssh/sshyp')}")
# ssh ip+port configuration
print('\nExample input: 10.10.10.10:9999\n')
@@ -100,58 +109,88 @@ def tweak(): # runs configuration wizard
print(f"\nEntry directory: /home/{_username_ssh}/.password-pasture/")
# sshync profile generation
sshync.make_profile('/var/lib/sshyp/sshyp.sshync', f"/home/{environ.get('USER')}/.password-pasture/",
f"/home/{_username_ssh}/.password-pasture/", f"/home/{environ.get('USER')}/.ssh/sshyp",
_ip, _port, _username_ssh)
sshync.make_profile(path.expanduser('~/.config/sshyp/sshyp.sshync'),
path.expanduser('~/.password-pasture/'), f"/home/{_username_ssh}/.password-pasture/",
path.expanduser('~/.ssh/sshyp'), _ip, _port, _username_ssh)
print('\nConfiguration complete!\n')
def helper(): # displays help menu
print('\nsshyp Copyright (C) 2021 Randall Winkhart')
print("This is free software, and you are welcome to redistribute it under certain conditions;\nthis program comes "
"with ABSOLUTELY NO WARRANTY;\ntype `sshyp license' for details.")
print('\nUSAGE: sshyp [/<entry name>] [OPTION] [FLAG]\n')
print('Options: ')
print('help/--help/-h bring up this menu')
print('version/-v display sshyp version info')
print('tweak configure sshyp')
print('add add an entry')
print('gen generate a new password')
print('edit edit an existing entry')
print('copy copy details of an entry to your clipboard')
print('shear/-rm delete an existing entry')
print('sync/-s manually sync the entry directory via sshync\n')
print('Flags:')
print('add:')
print(' password/-p add a password entry')
print(' note/-n add a note entry')
print(' folder/-f add a new folder for entries')
print('edit:')
print(' rename/relocate/-r rename or relocate an entry')
print(' username/-u change the username of an entry')
print(' password/-p change the password of an entry')
print(' note/-n change the note attached to an entry')
print(' url/-l change the url attached to an entry')
print('copy:')
print(' username/-u copy the username of an entry to your clipboard')
print(' password/-p copy the password of an entry to your clipboard')
print(' url/-l copy the URL of an entry to your clipboard')
print(' note/-n copy the note of an entry to your clipboard')
print('gen:')
print(' update/-u generate a password for an existing entry\n')
print("Tip: You can quickly read an entry with 'sshyp /<entry name>'!")
print("When specifying entry names, do not include the file extension! '.gpg' is assumed!\n")
def version(): # displays version information
print('\n////////////////////////////////////////////////////////')
print('/ /')
print('/ sshyp Copyright (C) 2021 Randall Winkhart /')
print('/ /')
print('/ Version 2021.12.01.fr2.2 /')
print('/ The Lighter Update /')
print('/ /')
print('////////////////////////////////////////////////////////\n')
def print_info(): # prints help text based on argument
if argument == 'help' or argument == '--help' or argument == '-h':
print('\nsshyp Copyright (C) 2021 Randall Winkhart')
print("This is free software, and you are welcome to redistribute it under certain conditions;\nthis program "
"comes with ABSOLUTELY NO WARRANTY;\ntype `sshyp license' for details.")
print('\nUSAGE: sshyp [/<entry name>] [OPTION] [FLAG]\n')
print('Options: ')
print('help/--help/-h bring up this menu')
print('version/-v display sshyp version info')
print('tweak configure sshyp')
print('add add an entry')
print('gen generate a new password')
print('edit edit an existing entry')
print('copy copy details of an entry to your clipboard')
print('shear/-rm delete an existing entry')
print('sync/-s manually sync the entry directory via sshync\n')
print('Flags:')
print('add:')
print(' password/-p add a password entry')
print(' note/-n add a note entry')
print(' folder/-f add a new folder for entries')
print('edit:')
print(' rename/relocate/-r rename or relocate an entry')
print(' username/-u change the username of an entry')
print(' password/-p change the password of an entry')
print(' note/-n change the note attached to an entry')
print(' url/-l change the url attached to an entry')
print('copy:')
print(' username/-u copy the username of an entry to your clipboard')
print(' password/-p copy the password of an entry to your clipboard')
print(' url/-l copy the URL of an entry to your clipboard')
print(' note/-n copy the note of an entry to your clipboard')
print('gen:')
print(' update/-u generate a password for an existing entry\n')
print("Tip: You can quickly read an entry with 'sshyp /<entry name>'!")
print("When specifying entry names, do not include the file extension! '.gpg' is assumed!\n")
elif argument == 'version' or argument == '-v':
print('\n////////////////////////////////////////////////////////')
print('/ /')
print('/ sshyp Copyright (C) 2021 Randall Winkhart /')
print('/ /')
print('/ Version 2022.01.16.fr3.2 /')
print('/ The Boxing Update /')
print('/ /')
print('////////////////////////////////////////////////////////\n')
elif argument == 'license':
print('\nThis program is free software: you can redistribute it and/or modify it under the terms of the GNU '
'General\nPublic License as published by the Free Software Foundation, either version 3 of the License,'
'\nor (at your option) any later version.\n\nThis program is distributed in the hope that it will be '
'useful, but WITHOUT ANY WARRANTY;\nwithout even the implied warranty of MERCHANTABILITY or FITNESS FOR A'
' PARTICULAR PURPOSE.\nSee the GNU General Public License for more details.'
'\n\nhttps://opensource.org/licenses/GPL-3.0\n')
elif argument == 'add':
print('\nUSAGE: sshyp add [FLAG]')
print('Flags:')
print('add:')
print(' password/-p add a password entry')
print(' note/-n add a note entry')
print(' folder/-f add a new folder for entries\n')
elif argument == 'edit':
print('\nUSAGE: sshyp edit [FLAG]')
print('Flags:')
print('edit:')
print(' rename/relocate/-r rename or relocate an entry')
print(' username/-u change the username of an entry')
print(' password/-p change the password of an entry')
print(' url/-l change the url attached to an entry')
print(' note/-n change the note attached to an entry\n')
elif argument == 'copy':
print('\nUSAGE: sshyp copy [FLAG]')
print('Flags:')
print('copy:')
print(' username/-u copy the username of an entry to your clipboard')
print(' password/-p copy the password of an entry to your clipboard')
print(' url/-l copy the URL of an entry to your clipboard')
print(' note/-n copy the note of an entry to your clipboard\n')
def no_arg(): # displays a list of entries and gives an option to select one for viewing
@@ -162,15 +201,6 @@ def no_arg(): # displays a list of entries and gives an option to select one fo
print()
def show_license(): # displays licensing information
print('\nThis program is free software: you can redistribute it and/or modify it under the terms of the GNU General'
'\nPublic License as published by the Free Software Foundation, either version 3 of the License,\nor '
'(at your option) any later version.\n'
'\nThis program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;\nwithout even '
'the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\nSee the GNU General Public '
'License for more details.\n\nhttps://opensource.org/licenses/GPL-3.0\n')
def read_shortcut(): # shortcut to quickly read an entry
system(f"gpg -d '{directory}{argument.replace('/', '', 1)}.gpg'")
@@ -180,38 +210,31 @@ def sync(): # calls sshync to sync changes to the user's server
# set permissions before uploading
system('find ' + directory + ' -type d -exec chmod -R 700 {} +')
system('find ' + directory + ' -type f -exec chmod -R 600 {} +')
sshync.run_profile('/var/lib/sshyp/sshyp.sshync')
def add_info(): # displays 'add' syntax
print('\nUSAGE: sshyp add [FLAG]')
print('Flags:')
print('add:')
print(' password/-p add a password entry')
print(' note/-n add a note entry')
print(' folder/-f add a new folder for entries\n')
sshync.run_profile(path.expanduser('~/.config/sshyp/sshyp.sshync'))
def add_entry(): # adds a new entry
_shm_folder, _shm_entry = None, None # sets base-line values to avoid errors
_entry_name = str(input('\nName of entry: '))
if _entry_name.startswith('/'):
_entry_name = _entry_name.replace('/', '', 1)
_shm_folder, _shm_entry = shm_gen()
if argument == 'add note' or argument == 'add -n':
system(f"nano /dev/shm/{_shm_folder}/{_shm_entry}-n")
_notes = open(f"/dev/shm/{_shm_folder}/{_shm_entry}-n", 'r').read()
open(f"/dev/shm/{_shm_folder}/{_shm_entry}", 'w').writelines('\n\n\n\n' + _notes + '\n\n')
if argument == 'add password' or argument == 'add -p':
_shm_folder, _shm_entry = shm_gen()
system(f"nano {tmp_dir}{_shm_folder}/{_shm_entry}-n")
_notes = open(f"{tmp_dir}{_shm_folder}/{_shm_entry}-n", 'r').read()
open(f"{tmp_dir}{_shm_folder}/{_shm_entry}", 'w').writelines('\n\n\n\n' + _notes + '\n\n')
elif argument == 'add password' or argument == 'add -p':
_username = str(input('Username: '))
_password = str(input('Password: '))
_url = str(input('URL: '))
_add_note = input('Add a note to this entry? (y/N) ')
if _add_note == 'y' or _add_note == 'Y':
system(f"nano /dev/shm/{_shm_folder}/{_shm_entry}-n")
_notes = open(f"/dev/shm/{_shm_folder}/{_shm_entry}-n", 'r').read()
_shm_folder, _shm_entry = shm_gen()
if _add_note.lower() == 'y':
system(f"nano {tmp_dir}{_shm_folder}/{_shm_entry}-n")
_notes = open(f"{tmp_dir}{_shm_folder}/{_shm_entry}-n", 'r').read()
else:
_notes = ''
open(f"/dev/shm/{_shm_folder}/{_shm_entry}", 'w').writelines(_username + '\n' + _password + '\n' + _url + '\n\n'
open(f"{tmp_dir}{_shm_folder}/{_shm_entry}", 'w').writelines(_username + '\n' + _password + '\n' + _url + '\n\n'
+ _notes + '\n\n')
encrypt(_shm_folder, _shm_entry, _entry_name)
system(f"gpg -d '{directory}{_entry_name}.gpg'")
@@ -223,17 +246,6 @@ def add_folder(): # creates a new folder
system(f"ssh -p {port} {username_ssh}@{ip} \"mkdir -p '{directory_ssh}{_folder_name}'\"")
def edit_info(): # displays 'edit' syntax
print('\nUSAGE: sshyp edit [FLAG]')
print('Flags:')
print('edit:')
print(' rename/relocate/-r rename or relocate an entry')
print(' username/-u change the username of an entry')
print(' password/-p change the password of an entry')
print(' url/-l change the url attached to an entry')
print(' note/-n change the note attached to an entry\n')
def rename(): # renames an entry or folder TODO delete original from server to prevent re-downloading
print()
system(f"cd {directory}; ls -1 *") # TODO replace with new list
@@ -250,23 +262,33 @@ def rename(): # renames an entry or folder TODO delete original from server to
def edit(): # edits the contents of an entry
_shm_folder, _shm_entry = None, None # sets base-line values to avoid errors
print()
system(f"cd {directory}; ls -1 *") # TODO replace with new list
_entry_name = str(input('\nWhat file would you like to edit? '))
if not Path(f"{directory}{_entry_name}.gpg").is_file():
print("\nYou are trying to edit a file that does not exist!\n")
s_exit()
if _entry_name.startswith('/'):
_entry_name = _entry_name.replace('/', '', 1)
_shm_folder, _shm_entry = shm_gen()
system(f"gpg -d --output /dev/shm/{_shm_folder}/{_shm_entry} '{directory}{_entry_name}.gpg'")
if argument == 'edit username' or argument == 'edit -u':
_detail = str(input('New Username: '))
replace_line(f"/dev/shm/{_shm_folder}/{_shm_entry}", 0, _detail + '\n')
if argument == 'edit password' or argument == 'edit -p':
_shm_folder, _shm_entry = shm_gen()
system(f"gpg -d --output {tmp_dir}{_shm_folder}/{_shm_entry} '{directory}{_entry_name}.gpg'")
replace_line(f"{tmp_dir}{_shm_folder}/{_shm_entry}", 0, _detail + '\n')
elif argument == 'edit password' or argument == 'edit -p':
_detail = str(input('New Password: '))
replace_line(f"/dev/shm/{_shm_folder}/{_shm_entry}", 1, _detail + '\n')
if argument == 'edit url' or argument == 'edit -l':
_shm_folder, _shm_entry = shm_gen()
system(f"gpg -d --output {tmp_dir}{_shm_folder}/{_shm_entry} '{directory}{_entry_name}.gpg'")
replace_line(f"{tmp_dir}{_shm_folder}/{_shm_entry}", 1, _detail + '\n')
elif argument == 'edit url' or argument == 'edit -l':
_detail = str(input('New URL: '))
replace_line(f"/dev/shm/{_shm_folder}/{_shm_entry}", 2, _detail + '\n')
if argument == 'edit note' or argument == 'edit -n':
_shm_folder, _shm_entry = shm_gen()
system(f"gpg -d --output {tmp_dir}{_shm_folder}/{_shm_entry} '{directory}{_entry_name}.gpg'")
replace_line(f"{tmp_dir}{_shm_folder}/{_shm_entry}", 2, _detail + '\n')
elif argument == 'edit note' or argument == 'edit -n':
_shm_folder, _shm_entry = shm_gen()
system(f"gpg -d --output {tmp_dir}{_shm_folder}/{_shm_entry} '{directory}{_entry_name}.gpg'")
edit_note(_shm_folder, _shm_entry)
remove(f"{directory}{_entry_name}.gpg")
encrypt(_shm_folder, _shm_entry, _entry_name)
@@ -275,57 +297,67 @@ def edit(): # edits the contents of an entry
def gen(): # generates a password for a new or an existing entry
_username, _url, _notes = None, None, None # sets base-line values to avoid errors
_shm_folder, _shm_entry = shm_gen()
if argument == 'gen update' or argument == 'gen -u':
print()
system(f"cd {directory}; ls -1 *") # TODO replace with new list
_entry_name = str(input('\nName of service: '))
if _entry_name.startswith('/'):
_entry_name = _entry_name.replace('/', '', 1)
if argument == 'gen update' or argument == 'gen -u':
if not Path(f"{directory}{_entry_name}.gpg").is_file():
print("\nYou are trying to edit a file that does not exist!\n")
s_exit()
if argument != 'gen update' and argument != 'gen -u':
_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
if argument != 'gen update' and argument != 'gen -u':
open(f"/dev/shm/{_shm_folder}/{_shm_entry}", 'w').writelines(_username + '\n' + _pass_gen + '\n' + _url +
'\n\n' + _notes + '\n\n')
if argument != 'gen update' and argument != 'gen -u':
_add_note = input('Add a note to this entry? (y/N) ')
_shm_folder, _shm_entry = shm_gen()
if _add_note.lower() == 'y':
system(f"nano {tmp_dir}{_shm_folder}/{_shm_entry}-n")
_notes = open(f"{tmp_dir}{_shm_folder}/{_shm_entry}-n", 'r').read()
else:
_notes = ''
open(f"{tmp_dir}{_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:
system(f"gpg -d --output /dev/shm/{_shm_folder}/{_shm_entry} '{directory}{_entry_name}.gpg'")
replace_line(f"/dev/shm/{_shm_folder}/{_shm_entry}", 1, _pass_gen + '\n')
_shm_folder, _shm_entry = shm_gen()
system(f"gpg -d --output {tmp_dir}{_shm_folder}/{_shm_entry} '{directory}{_entry_name}.gpg'")
replace_line(f"{tmp_dir}{_shm_folder}/{_shm_entry}", 1, _pass_gen + '\n')
remove(f"{directory}{_entry_name}.gpg")
encrypt(_shm_folder, _shm_entry, _entry_name)
system(f"gpg -d '{directory}{_entry_name}.gpg'")
def copy_info(): # displays 'copy' syntax
print('\nUSAGE: sshyp copy [FLAG]')
print('Flags:')
print('copy:')
print(' username/-u copy the username of an entry to your clipboard')
print(' password/-p copy the password of an entry to your clipboard')
print(' url/-l copy the URL of an entry to your clipboard')
print(' note/-n copy the note of an entry to your clipboard\n')
def copy_data(): # copies a specified field of an entry to the clipboard
print()
system(f"cd {directory}; ls -1 *") # TODO replace with new list
_read_entry = str(input('\nEntry to copy: '))
if not Path(f"{directory}{_read_entry}.gpg").is_file():
print("\nThe file does not exist!\n")
s_exit()
_shm_folder, _shm_entry = shm_gen()
system(f"gpg -d --output /dev/shm/{_shm_folder}/{_shm_entry} '{directory}{_read_entry}.gpg'")
_copy_line = open(f"/dev/shm/{_shm_folder}/{_shm_entry}", 'r').readlines()
if environ.get('WAYLAND_DISPLAY') == 'wayland-0': # checks if the user is using Wayland or X for clipboard
system(f"gpg -d --output {tmp_dir}{_shm_folder}/{_shm_entry} '{directory}{_read_entry}.gpg'")
_copy_line = open(f"{tmp_dir}{_shm_folder}/{_shm_entry}", 'r').readlines()
if Path("/data/data/com.termux").is_file(): # checks for Termux, Wayland, or X
if argument == 'copy username' or argument == 'copy -u':
system('termux-clipboard-set ' + "'" + _copy_line[0].replace('\n', '').replace("'", "'\\''") + "'")
elif argument == 'copy password' or argument == 'copy -p':
system('termux-clipboard-set ' + "'" + _copy_line[1].replace('\n', '').replace("'", "'\\''") + "'")
elif argument == 'copy url' or argument == 'copy -l':
system('termux-clipboard-set ' + "'" + _copy_line[2].replace('\n', '').replace("'", "'\\''") + "'")
elif argument == 'copy note' or argument == 'copy -n':
system('termux-clipboard-set ' + "'" + _copy_line[4].replace('\n', '').replace("'", "'\\''") + "'")
elif environ.get('WAYLAND_DISPLAY') == 'wayland-0':
if argument == 'copy username' or argument == 'copy -u':
system('wl-copy ' + "'" + _copy_line[0].replace('\n', '').replace("'", "'\\''") + "'")
elif argument == 'copy password' or argument == 'copy -p':
@@ -343,7 +375,7 @@ def copy_data(): # copies a specified field of an entry to the clipboard
system('echo -n ' + "'" + _copy_line[2].replace('\n', '').replace("'", "'\\''") + "'" + ' | xclip -sel c')
elif argument == 'copy note' or argument == 'copy -n':
system('echo -n ' + "'" + _copy_line[4].replace('\n', '').replace("'", "'\\''") + "'" + ' | xclip -sel c')
rmtree(f"/dev/shm/{_shm_folder}")
rmtree(f"{tmp_dir}{_shm_folder}")
def remove_data(): # deletes an entry or folder from both the client and the server
@@ -353,9 +385,9 @@ def remove_data(): # deletes an entry or folder from both the client and the se
if _entry_name.startswith('/'):
_entry_name = _entry_name.replace('/', '', 1)
try:
system('gpg -d --output /dev/shm/sshyp.lock /var/lib/sshyp/lock.gpg')
_unlock = open('/dev/shm/sshyp.lock', 'r').readlines()
remove('/dev/shm/sshyp.lock')
system(f"gpg -d --output {tmp_dir}sshyp.lock {path.expanduser('~/.config/sshyp/lock.gpg')}")
_unlock = open('{tmp_dir}sshyp.lock', 'r').readlines()
remove(f"{tmp_dir}sshyp.lock")
except FileNotFoundError:
print('\nAccess denied.\n')
s_exit()
@@ -378,18 +410,19 @@ argument = argument[:-1]
# import saved userdata
if argument != 'tweak':
device_type = ''
tmp_dir = path.expanduser('~/.config/sshyp/tmp/')
try:
device_type = open('/var/lib/sshyp/sshyp-device').read().strip()
device_type = open(path.expanduser('~/.config/sshyp/sshyp-device')).read().strip()
if device_type == 'c':
gpg_id = open('/var/lib/sshyp/sshyp-gpg').read().strip()
ssh_info = sshync.get_profile('/var/lib/sshyp/sshyp.sshync')
gpg_id = open(path.expanduser('~/.config/sshyp/sshyp-gpg')).read().strip()
ssh_info = sshync.get_profile(path.expanduser('~/.config/sshyp/sshyp.sshync'))
username_ssh = ssh_info[0].replace('\n', '')
ip = ssh_info[1].replace('\n', '')
port = ssh_info[2].replace('\n', '')
directory = str(ssh_info[3].replace('\n', ''))
directory_ssh = '/home/' + username_ssh + '/.password-pasture/'
except FileNotFoundError:
if device_type != 's' and device_type != 'S':
if device_type.lower() != 's':
print('\n!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!')
print("Not all necessary configuration files are present. Please run 'sshyp tweak'!")
print('!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!\n')
@@ -412,14 +445,9 @@ elif argument == '':
except KeyboardInterrupt:
print('\n')
s_exit()
elif argument == 'help' or argument == '--help' or argument == '-h':
helper()
elif argument == 'license':
show_license()
elif argument == 'version' or argument == '-v':
version()
elif argument == 'add':
add_info()
elif argument == 'help' or argument == '--help' or argument == '-h' or argument == 'license' or argument == 'version' \
or argument == '-v' or argument == 'add' or argument == 'edit' or argument == 'copy':
print_info()
elif argument == 'add note' or argument == 'add -n' or argument == 'add password' or argument == 'add -p':
try:
add_entry()
@@ -432,8 +460,6 @@ elif argument == 'add folder' or argument == 'add -f':
except KeyboardInterrupt:
print('\n')
s_exit()
elif argument == 'edit':
edit_info()
elif argument == 'edit rename' or argument == 'edit relocate' or argument == 'edit -r':
try:
rename()
@@ -453,8 +479,6 @@ elif argument == 'gen' or argument == 'gen update' or argument == 'gen -u':
except KeyboardInterrupt:
print('\n')
s_exit()
elif argument == 'copy':
copy_info()
elif argument == 'copy username' or argument == 'copy -u' or argument == 'copy password' or argument == 'copy -p' or \
argument == 'copy url' or argument == 'copy -l' or argument == 'copy note' or argument == 'copy -n':
try:
+207
View File
@@ -1,5 +1,212 @@
<><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><>
sshyp 2022.01.16.fr3.2
The Boxing Update
This release is a hotfix for 2022.01.16.fr3.1. It fixes major bugs, including one massively impacting Termux.
Changes:
- sshyp now uses a symlink to the temporary storage directory, allowing for easy implementation of different temporary directories on different platforms
^ the first usage of this is enabling the use of temporary storage on Termux
- sshync now properly auto-generates its config directory
Additions planned for minor releases:
** updated the manpage with more information regarding how sshyp works and how to set it up
** ensured that it is now impossible for ghosts of entires to remain in /dev/shm
** reduced total lines of code with small optimizations
&&
Planned for next major update (fr4, 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 (fr5, The Farmer Shearing the sshyp Update):
** allow for multi-client deletion... somehow (in sshync)
** 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.01.16.fr3.1
The Boxing Update
This release is a hotfix for 2022.01.13.fr3. It fixes sshync/syncing support after the changes in the last release.
Changes:
- sshync has been updated to work with the new config directory
- sshync now uses its own directory to store the database file
^ this is preperation for separating sshync into its own package
- expanduser lines in sshyp have been simplified (no user-facing impact)
Additions planned for minor releases:
** updated the manpage with more information regarding how sshyp works and how to set it up
** ensured that it is now impossible for ghosts of entires to remain in /dev/shm
** reduced total lines of code with small optimizations
&&
Planned for next major update (fr4, 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 (fr5, The Farmer Shearing the sshyp Update):
** allow for multi-client deletion... somehow (in sshync)
** 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.01.13.fr3
The Boxing Update
This release adapts sshyp to be compatible with Termux and allows for packaging for various distributions in addition to Arch Linux.
Features:
- the copy function now has support for termux-clipboard-set from termux-api
^ this allows clipboard functionality to work on Termux
Changes:
- sshyp no longer writes to/reads from /var
^ configuration files are now stored under the user's home directory in ~/.config/sshyp
^ this change allows for compatibility with less standard environments, such as Termux on Android
Additions planned for minor releases:
** updated the manpage with more information regarding how sshyp works and how to set it up
** ensured that it is now impossible for ghosts of entires to remain in /dev/shm
** reduced total lines of code with small optimizations
&&
Planned for next major update (fr4, 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 (fr5, The Farmer Shearing the sshyp Update):
** allow for multi-client deletion... somehow (in sshync)
** 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.01.10.fr2.3
The Lighter Update - Patch 3
This release is a hotfix for 2021.12.01.fr2.2. It features critical security fixes and quality-of-life improvements.
New features:
- a man page has been added
Changes:
- folders in /dev/shm are no longer created before input from the user (fixes critical security flaws)
- fixed syncing of files (specifically downloading) with special characters, such as '('
- fixed program still continuing after trying to edit an entry that doesn't exist
- 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, fewer lines of code)
- file not found exceptions have been re-implemented
- .lower() is now used to remove casing when checking inputs
- removed an old reference to "rsync" in the configuration dialog
Planned for next major update (The Fluffier Update):
- new visual features
^ this includes the new file list and thematic text art. sshyp will be
getting a retro computing theme.
- packages for more environments
^ "sshyp" will be officially packaged for Arch Linux, Alpine Linux, and Termux (Android).
Debian/Ubuntu and Fedora packaging will come later.
- imporove password generator to guarantee more secure results
- 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)
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 (in sshync)
- detatch sshync and make it a separate package
Planned for next, next, next major update (The Shears Update Pt. 2):
- ability to pass entries as arguments for more functions
- auto-completion on tab (currently unsure of best way to make this work)
Backlog:
- package for more Linux distributions, such as Debian and Fedora
- create separate gui frontend targetting mobile and desktop Linux
<><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><>
sshyp 2021.12.01.fr2.2
The Lighter Update - Patch 2
+74
View File
@@ -0,0 +1,74 @@
.TH sshyp 1 "10 January 2022" "2021.12.01.fr2.3" "sshyp man page"
.SH NAME
sshyp \- A very simple self-hosted, synchronized password manager. Alternative to GNU pass.
.SH SYNOPSIS
sshyp [OPTION] [[FLAG]] [/<entry name>]
.SH DESCRIPTION
sshyp is a lightweight password and note management program written in Python. sshyp is used via CLI and is self-hosted with a client-server model. sshyp expects that you have access to a personal server with a properly configured ssh server, ideally accepting remote connections.
.SH EXAMPLES
Setting up sshyp for the first time or altering its configuration (also recommended after major updates):
sshyp tweak
*follow the prompts
Reading an existing entry saved as ~/.password-pasture/development/github.gpg:
sshyp /development/github
Copying the password of an existing entry saved as ~/.password-pasture/financial/bank.gpg:
sshyp copy -p
*answer the prompt with "/financial/bank"
*enter decryption password
Editing the username of an existing entry saved as ~/.password-pasture/game.gpg:
sshyp edit -u
*answer the first prompt with "game"
*follow the prompts
Making a new entry using the built-in password generator:
sshyp gen
*follow the prompts
Creating a note-only entry:
sshyp add -n
*follow the prompts
Syncing entries with the server:
sshyp sync
.SH OPTIONS
In order to quickly read an existing entry, just run "sshyp </entry name>".
Options for other operations are as follows:
help/--help/-h bring up the help menu
version/-v display sshyp version info
tweak configure sshyp
add add an entry
gen generate a new password
edit edit an existing entry
copy copy details of an entry to your clipboard
shear/-rm delete an existing entry
sync/-s manually sync the entry directory via sshync
.SH FLAGS
add:
password/-p add a password entry
note/-n add a note entry
folder/-f add a new folder for entries
edit:
rename/relocate/-r rename or relocate an entry
username/-u change the username of an entry
password/-p change the password of an entry
note/-n change the note attached to an entry
url/-l change the url attached to an entry
copy:
username/-u copy the username of an entry to your clipboard
password/-p copy the password of an entry to your clipboard
url/-l copy the URL of an entry to your clipboard
note/-n copy the note of an entry to your clipboard
gen:
update/-u generate a password for an existing entry
.SH BUGS
This is more of a current limitation than a bug, but:
Currently, if multiple clients are connected to a single server and a client deletes an entry, the entry is correctly deleted from the client and the server, but since the entry still exists on the other client, the next time it syncs the file will be re-uploaded. This will be fixed in an upcoming release of the syncing backend, sshync.
.SH AUTHOR
Randall Winkhart (https://github.com/rwinkhart)
Executable
+125
View File
@@ -0,0 +1,125 @@
#!/bin/bash
# This script packages sshyp (from source) for various Linux environments.
# NOTE It is recommended to instead use the latest officially packaged and tagged release.
# NOTE If using Arch, it is recommended to install from the AUR or from the PKGBUILD attatched to the latest official release.
# NOTE As of release fr4, sshync will become a separate package and thus a dependency for sshyp. sshync is automatically installed with the PKGBUILD version.
echo -e '\nOptions (please enter the number only):'
echo -e '\nDistribution Packages:\n\n1. Debian\n2. Termux\n3. Generic (used for PKGBUILD/APKBUILD)'
echo -e '\nBuild Scripts:\n\n4. Alpine Linux (APKBUILD)\n5. Arch Linux (PKGBUILD, also builds local generic package)'
echo -e '\nOther:\n\n6. All (generates all distribution packages and build scripts)\n'
read -n 1 -r -p "Distribution: " distro
echo -e '\n\nThe value entered in this field will only affect the version reported to the package manager. The latest source is used regardless.\n'
read -r -p "Version number: " version
echo -e '\nThe value entered in this field will only affect the revision number for build scripts.\n'
read -r -p "Revision number: " revision
if [ "$distro" == "4" ] || [ "$distro" == "5" ] || [ "$distro" == "6" ]; then
echo -e '\nOptions (please enter the number only):'
echo -e '\n1. GitHub Release Tag\n2. Local\n'
read -r -p "Source (for build scripts): " source
if [ "$source" == "1" ]; then
source='https://github.com/rwinkhart/sshyp/releases/download/v$pkgver/sshyp-$pkgver.tar.xz'
else
source=local://sshyp-"$version".tar.xz
fi
fi
mkdir -p packages
if [ "$distro" == "1" ] || [ "$distro" == "6" ]; then
echo -e '\nPackaging for Debian...\n'
mkdir -p packages/debiantemp/sshyp_"$version"-"$revision"_all/{DEBIAN,usr}
mkdir -p packages/debiantemp/sshyp_"$version"-"$revision"_all/usr/share/man/man1
echo "Package: sshyp
Version: $version
Section: utils
Architecture: all
Maintainer: Randall Winkhart <idgr at tutanota dot com>
Description: A light-weight, self-hosted, synchronized password manager
Depends: python3, gnupg, openssh-client, nano, xclip, wl-clipboard
Priority: optional
Installed-Size: 35
" > packages/debiantemp/sshyp_"$version"-"$revision"_all/DEBIAN/control
cp -r bin packages/debiantemp/sshyp_"$version"-"$revision"_all/usr/
cp -r share packages/debiantemp/sshyp_"$version"-"$revision"_all/usr/
cp extra/manpage packages/debiantemp/sshyp_"$version"-"$revision"_all/usr/share/man/man1/sshyp.1
gzip packages/debiantemp/sshyp_"$version"-"$revision"_all/usr/share/man/man1/sshyp.1
dpkg-deb --build --root-owner-group packages/debiantemp/sshyp_"$version"-"$revision"_all/
mv packages/debiantemp/sshyp_"$version"-"$revision"_all.deb packages/
rm -rf packages/debiantemp
echo -e "\nDebian packaging complete.\n"
fi
if [ "$distro" == "2" ] || [ "$distro" == "6" ]; then
echo -e '\nPackaging for Termux...\n'
mkdir -p packages/termuxtemp/sshyp_"$version"-"$revision"_all_termux/{data,DEBIAN}
mkdir -p packages/termuxtemp/sshyp_"$version"-"$revision"_all_termux/data/data/com.termux/files/usr/share/man/man1
echo "Package: sshyp
Version: $version
Section: utils
Architecture: all
Maintainer: Randall Winkhart <idgr at tutanota dot com>
Description: A light-weight, self-hosted, synchronized password manager
Depends: python, gnupg, openssh, nano, termux-api, termux-am
Priority: optional
Installed-Size: 35
" > packages/termuxtemp/sshyp_"$version"-"$revision"_all_termux/DEBIAN/control
cp -r bin packages/termuxtemp/sshyp_"$version"-"$revision"_all_termux/data/data/com.termux/files/usr/
cp -r share packages/termuxtemp/sshyp_"$version"-"$revision"_all_termux/data/data/com.termux/files/usr/
cp extra/manpage packages/termuxtemp/sshyp_"$version"-"$revision"_all_termux/data/data/com.termux/files/usr/share/man/man1/sshyp.1
gzip packages/termuxtemp/sshyp_"$version"-"$revision"_all_termux/data/data/com.termux/files/usr/share/man/man1/sshyp.1
dpkg-deb --build --root-owner-group packages/termuxtemp/sshyp_"$version"-"$revision"_all_termux/
mv packages/termuxtemp/sshyp_"$version"-"$revision"_all_termux.deb packages/
rm -rf packages/termuxtemp
echo -e "\nTermux packaging complete.\n"
fi
if [ "$distro" == "3" ] || [ "$distro" == "5" ] || [ "$distro" == "6" ]; then
echo -e '\nPackaging as generic...\n'
mkdir -p packages/archtemp/usr
cp -r bin packages/archtemp/usr/
cp -r share packages/archtemp/usr/
mkdir -p packages/archtemp/usr/share/man/man1
cp extra/manpage packages/archtemp/usr/share/man/man1/sshyp.1
gzip packages/archtemp/usr/share/man/man1/sshyp.1
tar -C packages/archtemp -cvf packages/sshyp-"$version".tar.xz usr/
rm -rf packages/archtemp
sha512="$(sha512sum packages/sshyp-"$version".tar.xz | awk '{print $1;}')"
echo -e "\nsha512 sum:\n$sha512"
echo -e "\nGeneric packaging complete.\n"
fi
if [ "$distro" == "5" ] || [ "$distro" == "6" ]; then
echo -e '\nGenerating PKGBUILD...'
echo "# Maintainer: Randall Winkhart <idgr at tutanota dot com>
pkgname=sshyp
pkgver="$version"
pkgrel="$revision"
pkgdesc='A light-weight, self-hosted, synchronized password manager'
url='https://github.com/rwinkhart/sshyp'
arch=('any')
license=('GPL3')
depends=(python gnupg openssh nano xclip wl-clipboard)
source=(\""$source"\")
sha512sums=('"$sha512"')
package() {
tar xf sshyp-"\"\$pkgver\"".tar.xz -C "\"\${pkgdir}\""
}
" > packages/PKGBUILD
echo -e "\nPKGBUILD generated.\n"
fi
if [ "$distro" == "4" ]; then
echo -e '\nThis packaging format is not yet supported, but will be in the near future!\n'
fi
+38 -31
View File
@@ -1,52 +1,59 @@
sshyp 2021.12.01.fr2.2
sshyp 2022.01.16.fr3.2
The Lighter Update - Patch 2
The Boxing Update
This release is a hotfix for 2021.12.01.fr2.1.
This release is a hotfix for 2022.01.16.fr3.1. It fixes major bugs, including one massively impacting Termux.
Changes:
- a major fix for "/var/lib/sshync_database" needing to already exist server-side
- a major fix for syncing functionality (it should actually work now)
- silenced some sftp output
- sshyp now uses a symlink to the temporary storage directory, allowing for easy implementation of different temporary directories on different platforms
^ the first usage of this is enabling the use of temporary storage on Termux
- sshync now properly auto-generates its config directory
An fr2.3 patch is planned for this version. It will include the following:
Additions planned for minor releases:
- fixes for any new bugs that may be discovered in the new sshyp and sshync code
- the gen command in sshyp will be updated to use the newer notetaking system
- printing functions in sshyp will be combined into one function (arguments will determine section to print)
- file not found exceptions will be re-implemented
- when syncing, a check will be made to see if any folders are not on all devices and this will be corrected
** updated the manpage with more information regarding how sshyp works and how to set it up
** ensured that it is now impossible for ghosts of entires to remain in /dev/shm
** reduced total lines of code with small optimizations
Planned for next major update (The Fluffier Update):
&&
- new visual features
^ this includes the new file list and thematic text art. sshyp will be
getting a retro computing theme.
- packages for more environments
^ "sshyp" will be officially packaged for Arch Linux, Alpine Linux, and Termux (Android).
Debian/Ubuntu and Fedora packaging will come later.
- imporove password generator to guarantee more secure results
Planned for next major update (fr4, The sshyp Doing a Split Update):
Planned for next, next major update (The Shears Update Pt. 1):
sshyp:
** sshyp has recieved a major visual overhaul
^ this includes the new file list and thematic text art
- enforce permissions on the server-side
- allow for copying entire notes (not just first line)
- allow for multi-client deletion... somehow
- detatch sshync and make it a separate package
- manpage
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, next major update (The Shears Update Pt. 2):
&&
- ability to pass entries as arguments for more functions
- auto-completion on tab (currently unsure of best way to make this work)
Planned for next, next major update (fr5, The Farmer Shearing the sshyp Update):
** allow for multi-client deletion... somehow (in sshync)
** 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:
- package for more Linux distributions, such as Debian and Fedora
- create separate gui frontend targetting mobile and desktop Linux
** create separate gui frontend targetting mobile and desktop Linux
** auto-completion on tab (currently unsure of best way to make this work)
<><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><>
The full history of changes to "sshyp" can be found on the following page:
https://raw.githubusercontent.com/rwinkhart/sshyp/main/extra/changelog-total
Legend:
** = feature/change not yet finished/implemented
- = feature/change implemented and pushed upstream
^ = note regarding the above feature/change
&& = visual separater for patch notes for different planned major version releases