Compare commits

...
Author SHA1 Message Date
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
6 changed files with 276 additions and 75 deletions
-20
View File
@@ -1,20 +0,0 @@
# Maintainer: Randall Winkhart <idgr at tutanota dot com>
pkgname=sshyp
pkgver=2022.01.10.fr2.3
pkgrel=1
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=("https://github.com/rwinkhart/sshyp/releases/download/v$pkgver/sshyp-$pkgver.tar.xz")
sha512sums=('be6695cc231f4414322f2c4b919caf0759f4111e50259b3a6bbcb6e90a0ceba5d094c8766c287e5443c61adfdf414c1a93bc70e505dfd4bf34097c713b6e7d2f')
package() {
tar xf sshyp-"$pkgver".tar.xz -C "${pkgdir}"
chown -R "$USER" ${pkgdir}/var/lib/sshyp
}
+18 -1
View File
@@ -44,8 +44,23 @@ 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 (currently only a generic package used for the AUR PKGBUILD is supported). To package sshyp from source, simply run:
```
git clone https://github.com/rwinkhart/sshyp.git
cd sshyp
./package.sh
```
The AUR version and the packages attatched to the release tags were already packaged using this script.
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
@@ -54,6 +69,8 @@ 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:
```
+35 -22
View File
@@ -2,7 +2,7 @@
# 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
@@ -47,23 +47,27 @@ def edit_note(_shm_folder, _shm_entry):
def tweak(): # runs configuration wizard
# storage directory creation
# storage/config directory creation
try:
mkdir(f"/home/{environ.get('USER')}/.password-pasture", 0o700)
mkdir(f"{path.expanduser('~')}/.password-pasture", 0o700)
except FileExistsError:
pass
try:
mkdir(path.expanduser('~/.config/sshyp'), 0o700)
except FileExistsError:
pass
# device type configuration
_device_type = input('\nIs this installation for a client or for a server? (C/s) ')
if _device_type.lower() == 's':
open("/var/lib/sshyp/sshyp-device", 'w').write(_device_type)
copy('/usr/bin/sshync.py', f"/home/{environ.get('USER')}/")
open(f"{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(f"{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 '
@@ -72,15 +76,15 @@ def tweak(): # runs configuration wizard
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(f"{path.expanduser('~/.config/sshyp')}/sshyp-gpg", 'w').write(_gpg_id + '\n')
# lock file generation
try:
open('/var/lib/sshyp/lock', 'x').write('')
open(f"{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.'
@@ -89,7 +93,7 @@ def tweak(): # runs configuration wizard
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')
@@ -101,9 +105,9 @@ 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(f"{path.expanduser('~/.config/sshyp')}/sshyp.sshync",
f"{path.expanduser('~')}/.password-pasture/", f"/home/{_username_ssh}/.password-pasture/",
f"{path.expanduser('~')}/.ssh/sshyp", _ip, _port, _username_ssh)
print('\nConfiguration complete!\n')
@@ -148,8 +152,8 @@ def print_info(): # prints help text based on argument
print('/ /')
print('/ sshyp Copyright (C) 2021 Randall Winkhart /')
print('/ /')
print('/ Version 2022.01.10.fr2.3 /')
print('/ The Lighter Update /')
print('/ Version 2022.01.13.fr3 /')
print('/ The Boxing Update /')
print('/ /')
print('////////////////////////////////////////////////////////\n')
elif argument == 'license':
@@ -202,7 +206,7 @@ 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')
sshync.run_profile(f"{path.expanduser('~/.config/sshyp')}/sshyp.sshync")
def add_entry(): # adds a new entry
@@ -340,7 +344,16 @@ def copy_data(): # copies a specified field of an entry to the clipboard
_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
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':
@@ -368,7 +381,7 @@ 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')
system(f"gpg -d --output /dev/shm/sshyp.lock {path.expanduser('~/.config/sshyp')}/lock.gpg")
_unlock = open('/dev/shm/sshyp.lock', 'r').readlines()
remove('/dev/shm/sshyp.lock')
except FileNotFoundError:
@@ -394,10 +407,10 @@ argument = argument[:-1]
if argument != 'tweak':
device_type = ''
try:
device_type = open('/var/lib/sshyp/sshyp-device').read().strip()
device_type = open(f"{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(f"{path.expanduser('~/.config/sshyp')}/sshyp-gpg").read().strip()
ssh_info = sshync.get_profile(f"{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', '')
+55
View File
@@ -1,5 +1,60 @@
<><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><>
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
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
+43 -32
View File
@@ -1,53 +1,64 @@
sshyp 2022.01.10.fr2.3
sshyp 2022.01.13.fr3
The Lighter Update - Patch 3
The Boxing Update
This release is a hotfix for 2021.12.01.fr2.2. It features critical security fixes and quality-of-life improvements.
This release adapts sshyp to be compatible with Termux and allows for packaging for various distributions in addition to Arch Linux.
New features:
Features:
- a man page has been added
- the copy function now has support for termux-clipboard-set from termux-api
^ this allows clipboard functionality to work on Termux
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
- 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
Planned for next major update (The Fluffier Update):
Additions planned for minor releases:
- 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)
** 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, 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 major update (fr4, The sshyp Doing a Split Update):
Planned for next, next, next major update (The Shears Update Pt. 2):
sshyp:
** sshyp has recieved a major visual overhaul
^ this includes the new file list and thematic text art
- ability to pass entries as arguments for more functions
- auto-completion on tab (currently unsure of best way to make this work)
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:
- 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