Compare commits

..
4 changed files with 108 additions and 65 deletions
+5 -5
View File
@@ -1,7 +1,7 @@
# Maintainer: Randall Winkhart <idgr at tutanota dot com>
pkgname=sshyp
pkgver=2021.12.01.fr2
pkgver=2021.12.01.fr2.1
pkgrel=1
pkgdesc='A self-hosted, synchronized password manager'
url='https://github.com/rwinkhart/sshyp'
@@ -9,10 +9,10 @@ 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/sshyp-2021.12.01.fr2.tar.xz')
source_aarch64=('https://github.com/rwinkhart/sshyp/releases/download/v2021.12.01.fr2/sshyp-2021.12.01.fr2.tar.xz')
sha512sums_x86_64=('88b1db43a0234e00cc9b2b5aa6aff642a350109e101a1ebc95e06e7ebc294b09c8369eead06fd16bbffd1f6ce564fb1e8736685ee716f7806532710d7357a5cb')
sha512sums_aarch64=('88b1db43a0234e00cc9b2b5aa6aff642a350109e101a1ebc95e06e7ebc294b09c8369eead06fd16bbffd1f6ce564fb1e8736685ee716f7806532710d7357a5cb')
source_x86_64=('https://github.com/rwinkhart/sshyp/releases/download/v2021.12.01.fr2.1/sshyp-2021.12.01.fr2.1.tar.xz')
source_aarch64=('https://github.com/rwinkhart/sshyp/releases/download/v2021.12.01.fr2.1/sshyp-2021.12.01.fr2.1.tar.xz')
sha512sums_x86_64=('fdef7455fd48d190794d2323b3e8d75251d21a472cffb72757e1422c532731492234f250c292e6f27955f6670aa528c609ad786f4abab79a5b4a4d070ce6343b')
sha512sums_aarch64=('fdef7455fd48d190794d2323b3e8d75251d21a472cffb72757e1422c532731492234f250c292e6f27955f6670aa528c609ad786f4abab79a5b4a4d070ce6343b')
package() {
+44 -42
View File
@@ -2,7 +2,7 @@
# external modules
from os import environ, remove, system
from os import environ, mkdir, remove, system
from shutil import copy, move, rmtree
from sys import argv, exit as s_exit
import random
@@ -12,16 +12,6 @@ import string
# utility functions
def argument_filter(): # filters arguments to usable text
_argument_list = argv
_i, _argument = 0, ''
for _ in _argument_list:
while _i < len(_argument_list) - 1:
_i += 1
_argument += _argument_list[_i] + ' '
return _argument[:-1]
def replace_line(file_name, line_num, text): # replaces text in a given line with different text
_lines = open(file_name, 'r').readlines()
_lines[line_num] = text
@@ -33,7 +23,7 @@ def shm_gen(): # generates random folder in /dev/shm for security and returns r
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)))
system(f"mkdir -p /dev/shm/{_shm_folder_gen}") # TODO generate with Python
mkdir(f"/dev/shm/{_shm_folder_gen}", 0o700)
return _shm_folder_gen, _shm_entry_gen
@@ -57,7 +47,10 @@ def edit_note(_shm_folder, _shm_entry):
def tweak(): # runs configuration wizard
# storage directory creation
system(f"mkdir -p /home/{environ.get('USER')}/.password-pasture")
try:
mkdir(f"/home/{environ.get('USER')}/.password-pasture", 0o700)
except FileExistsError:
pass
# device type configuration
_device_type = input('\nIs this installation for a client or for a server? (C/s) ')
@@ -154,7 +147,7 @@ def version(): # displays version information
print('/ /')
print('/ sshyp Copyright (C) 2021 Randall Winkhart /')
print('/ /')
print('/ Version 2021.12.01.fr2 /')
print('/ Version 2021.12.01.fr2.1 /')
print('/ The Lighter Update /')
print('/ /')
print('////////////////////////////////////////////////////////\n')
@@ -225,7 +218,7 @@ def add_entry(): # adds a new entry
def add_folder(): # creates a new folder
_folder_name = str(input('Name of new folder: '))
system(f"mkdir '{directory}{_folder_name}'") # TODO create using Python
mkdir(directory + _folder_name, 0o700)
system(f"ssh -p {port} {username_ssh}@{ip} \"mkdir -p '{directory_ssh}{_folder_name}'\"")
@@ -372,27 +365,41 @@ def remove_data(): # deletes an entry or folder from both the client and the se
# program start sequence
# import saved userdata
device_type = ''
try:
device_type = open('/var/lib/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')
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':
print('\n!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!')
print("Not all necessary configuration files are present. Please run 'sshyp tweak'!")
print('!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!\n')
s_exit()
# retrieve typed argument
argument = argument_filter()
argument_list = argv
i, argument = 0, ''
for _ in argument_list:
while i < len(argument_list) - 1:
i += 1
argument += argument_list[i] + ' '
argument = argument[:-1]
# import saved userdata
if argument != 'tweak':
device_type = ''
try:
device_type = open('/var/lib/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')
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':
print('\n!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!')
print("Not all necessary configuration files are present. Please run 'sshyp tweak'!")
print('!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!\n')
s_exit()
else:
try:
tweak()
s_exit()
except KeyboardInterrupt:
print('\n')
s_exit()
# run function based on argument
error = 0 # create an error flag to determine if syncing should occur at end
@@ -404,12 +411,6 @@ elif argument == '':
except KeyboardInterrupt:
print('\n')
s_exit()
elif argument == 'tweak':
try:
tweak()
except KeyboardInterrupt:
print('\n')
s_exit()
elif argument == 'help' or argument == '--help' or argument == '-h':
helper()
elif argument == 'license':
@@ -478,5 +479,6 @@ if argument != '' and argument != 'help' and argument != '--help' and argument !
argument != 'add' and argument != 'sync' and argument != 'edit' and argument != 'copy username' and argument \
!= 'copy -u' and argument != 'copy password' and argument != 'copy -p' and argument != 'copy url' and argument \
!= 'copy -l' and argument != 'copy note' and argument != 'copy -n' and argument != 'copy' and argument != \
'tweak' and argument != 'shear' and argument != '-rm' and error == 0 and argument.startswith('/') is False:
'shear' and argument != '-rm' and argument != 'version' and argument != '-v' and error == 0 and \
argument.startswith('/') is False:
sync()
+50
View File
@@ -1,5 +1,55 @@
<><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><>
sshyp 2021.12.01.fr2.1
The Lighter Update - Patch 1
This release is a hotfix for 2021.12.01.fr2.
Changes:
- fixed a bug where "sshyp tweak" would not function on new installations
- moved the argument parser to the global process
- running "sshyp version" or "sshyp -v" no longer triggers syncing
- folders are now created natively with Python, rather than through system commands
An fr2.2 patch is planned for this version. It will include the following:
- 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
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, 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
- detatch sshync and make it a separate package
- manpage
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
The Lighter Update
+9 -18
View File
@@ -1,32 +1,22 @@
sshyp 2021.12.01.fr2
sshyp 2021.12.01.fr2.1
The Lighter Update
The Lighter Update - Patch 1
This release features a major re-write of old "rpass" code.
sshyp is now more reliable and better documented.
New features:
- a full re-write of the old "rpass" code used in the last release
^ includes more reliable argument parsing and various optimizations
- a full re-write of "sshync", many issues fixed
^fixed many instances where sshync would refuse to upload/download
^fixed errors that were being thrown despite sshync working as intended
- new folders are now also created on the server
This release is a hotfix for 2021.12.01.fr2.
Changes:
- nested folders actually work now
- multi-word entry and folder titles are fixed
- fixed a bug where "sshyp tweak" would not function on new installations
- moved the argument parser to the global process
- running "sshyp version" or "sshyp -v" no longer triggers syncing
- folders are now created natively with Python, rather than through system commands
An fr2.1 patch is planned for this version. It will include the following:
An fr2.2 patch is planned for this version. It will include the following:
- 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
- the argument parser will be moved to the global process (no need for it to be in a function)
- folders will be created natively in python
Planned for next major update (The Fluffier Update):
@@ -40,6 +30,7 @@ Planned for next major update (The Fluffier Update):
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
- detatch sshync and make it a separate package