mirror of
https://github.com/rwinkhart/sshyp.git
synced 2026-09-03 07:37:16 -04:00
Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
d9873df2d1 | ||
|
|
0c85703a73 | ||
|
|
41c9d0a22b | ||
|
|
aa65ecf8fb | ||
|
|
432a5f1e5a | ||
|
|
03c8bdbf74 | ||
|
|
1e0aa8aa39 | ||
|
|
924d066676 | ||
|
|
07cfc7ddaf | ||
|
|
6e0f19e8b8 | ||
|
|
d2ee90a52c | ||
|
|
3f4173b4fd | ||
|
|
fc94bfd774 | ||
|
|
0226180339 | ||
|
|
ed9c69248b | ||
|
|
902e041f51 | ||
|
|
648bed832f | ||
|
|
843dff6527 | ||
|
|
4f409f62d6 | ||
|
|
21550ddef2 | ||
|
|
c7dfb6a419 | ||
|
|
cc5d54914c | ||
|
|
b090c24d59 | ||
|
|
d1a994a103 | ||
|
|
6584686b2c | ||
|
|
0109816d3d | ||
|
|
30962b8cb2 | ||
|
|
fbf5ac02a4 | ||
|
|
6649fce7d1 | ||
|
|
6375a086cc | ||
|
|
43a53070a8 | ||
|
|
16f1225621 | ||
|
|
99cf9b7413 | ||
|
|
7d26170d7f | ||
|
|
6907c10f81 | ||
|
|
a5d36bf6b4 | ||
|
|
24ae771b85 | ||
|
|
0429070b5d | ||
|
|
6aa9a663b5 | ||
|
|
2c17a6b711 | ||
|
|
b649ae2c16 | ||
|
|
a0b533d9dd | ||
|
|
4c78ffb0de | ||
|
|
a2f2525df1 | ||
|
|
eefedde98c | ||
|
|
12cbcdd9af | ||
|
|
5219bf0448 | ||
|
|
a91c48533c | ||
|
|
e22066f015 | ||
|
|
d1cc6fe3e6 | ||
|
|
f9ad813ce6 | ||
|
|
bee3149c74 | ||
|
|
ccee566a22 | ||
|
|
e511159a6c | ||
|
|
f5bbe9516c | ||
|
|
6bbb84e1c0 | ||
|
|
39dbc1c83d | ||
|
|
1d969cc1f1 | ||
|
|
c5dd735f7a | ||
|
|
bf8adfc1c1 | ||
|
|
764d165ad4 | ||
|
|
9928a43d6a | ||
|
|
25121f3a5c | ||
|
|
2c78a1456c | ||
|
|
6173a11710 | ||
|
|
52e41dfab8 | ||
|
|
8b0f25479d | ||
|
|
0a210d0395 | ||
|
|
d29bee2d45 | ||
|
|
052a489bec | ||
|
|
b458265fd1 | ||
|
|
c916a738a2 | ||
|
|
9c5b007946 | ||
|
|
ff1c984024 | ||
|
|
164c719b90 | ||
|
|
d49ce1bb87 | ||
|
|
800a1181f8 | ||
|
|
d9414dbcdf | ||
|
|
0869b83505 | ||
|
|
7dfa12012a |
@@ -12,8 +12,6 @@ sshyp is a very simple self-hosted, synchronized password manager for UNIX(-like
|
||||
|
||||
sshyp is compatible with entries created by pass/password-store, as its original goal was to be like pass/password-store, but far more user-friendly to synchronize with a self-hosted server.
|
||||
|
||||
sshyp is (as of writing) the only password-store compatible CLI password manager available for Haiku.
|
||||
|
||||
sshyp makes use of a custom sftp wrapper, called sshync (ssh+sync), to reliably sync user entries with a local or remote server.
|
||||
|
||||
The name "sshyp" is a combination of its syncing library, "sshync", and "passwords".
|
||||
@@ -33,26 +31,20 @@ What sshyp can do:
|
||||
- securely sync said passwords and notes seamlessly between devices (or just manage them offline)
|
||||
- utilize [extensions](https://github.com/rwinkhart/sshyp-labs) to interact with your entries is additional ways (such as generating TOTP keys or managing your entries in a GUI)
|
||||
- everything above with entries created by pass/password-store!
|
||||
- everything above on Haiku, FreeBSD, Linux, and Termux (an Android terminal emulator)!
|
||||
|
||||
What sshyp definitely won't do:
|
||||
|
||||
- Non-UNIX(-like) support, e.g. Windows (I'd be happy to link to third-party ports, if someone were to make them)
|
||||
- everything above on Haiku, FreeBSD, Linux, and Termux!
|
||||
|
||||
# Installation
|
||||
**Important:** *Shell completions (both Bash and ZSH) may require additional configuration on some distributions - please see [this page](https://github.com/rwinkhart/sshyp/wiki/Completions) of the wiki for support.*
|
||||
|
||||
Please see the [installation guide](https://github.com/rwinkhart/sshyp/wiki/Installation) in the sshyp wiki for directions specific to your distribution/OS.
|
||||
|
||||
Pre-built packages exist for Haiku, FreeBSD, Alpine Linux, Arch Linux, Debian/Ubuntu Linux, Fedora Linux, and Termux. These can be downloaded from the releases page.
|
||||
|
||||
Requests for additional distribution/OS support can be filed as issues.
|
||||
Support for additional environments, such as MacOS and OpenBSD, is coming soon.
|
||||
|
||||
Extensions are available in the [sshyp-labs](https://github.com/rwinkhart/sshyp-labs) repository.
|
||||
|
||||
Bash completions can be enabled by installing your distribution's "bash-completion" package and restarting your terminal.
|
||||
|
||||
# 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:
|
||||
|
||||
```
|
||||
@@ -61,11 +53,11 @@ cd sshyp
|
||||
./package.sh [target] <revision>
|
||||
```
|
||||
|
||||
The packaging script has been tested on Arch Linux with "dpkg" as a dependency for Debian/Ubuntu and Termux packaging and "freebsd-pkg" as a dependency for FreeBSD packaging.
|
||||
The packaging script has been tested on Arch Linux with "dpkg" as a dependency for Debian/Ubuntu/Termux packaging and "freebsd-pkg" as a dependency for FreeBSD packaging.
|
||||
|
||||
Haiku and Fedora packaging must be done on their own respective distributions.
|
||||
|
||||
The AUR version and the packages attatched to the release tags were already packaged using this script.
|
||||
The AUR version and the packages attached to the release tags were already packaged using this script.
|
||||
|
||||
Currently, the script can create packages for Haiku, FreeBSD, Alpine Linux (APKBUILD), Arch Linux (PKGBUILD), Debian/Ubuntu Linux, Fedora Linux, Termux, and generic.
|
||||
|
||||
@@ -78,15 +70,15 @@ sshyp tweak
|
||||
|
||||
This command will allow you to configure the settings necessary for sshyp to function. To ensure configuration compatibility, it is a good idea to run 'sshyp tweak' after each major 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.
|
||||
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
|
||||
sshyp help
|
||||
```
|
||||
|
||||
Or alternatively, in the manpage:
|
||||
Or alternatively, in the man page:
|
||||
|
||||
```
|
||||
man sshyp
|
||||
@@ -95,8 +87,9 @@ man sshyp
|
||||
# Roadmap
|
||||
Short-term Goals:
|
||||
|
||||
- MacOS support
|
||||
- improved temporary directory security
|
||||
- a minimal GUI app - being made as an [extension](https://github.com/rwinkhart/sshyp-labs)
|
||||
- improved extension integration (allow extensions to add new arguments)
|
||||
|
||||
Long-term Goals:
|
||||
|
||||
|
||||
@@ -1,3 +1,77 @@
|
||||
sshyp v1.4.1
|
||||
|
||||
the argumentative agronomist update - patch one
|
||||
|
||||
this release improves sshyp's shell completions by adding zsh support and significantly optimizing and improving Bash support
|
||||
|
||||
user-facing features:
|
||||
|
||||
- zsh completion support
|
||||
^ ensure modern completions are enabled in your ~/.zshrc
|
||||
|
||||
fixes/optimizations:
|
||||
|
||||
- Bash completions are now much faster due to the use of recursive globbing
|
||||
- Bash completions have been modified to be functionally similar to the new zsh completions
|
||||
|
||||
other notable changes:
|
||||
|
||||
- some official packages now use more space-efficient compression
|
||||
|
||||
<><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><>
|
||||
|
||||
sshyp v1.4.0
|
||||
|
||||
the argumentative agronomist update
|
||||
|
||||
this release overhauls sshyp's argument system and further streamlines
|
||||
the experience with optimizations and the removal of legacy features
|
||||
|
||||
compatibility-breaking changes:
|
||||
|
||||
- there are no technical breaking changes, but the UX has changed significantly due to the new argument system (detailed below)
|
||||
|
||||
user-facing features:
|
||||
|
||||
- when typing an entry/folder name, it is now always the FIRST argument
|
||||
^ e.g. instead of "sshyp copy -p /example/test", it would now be "sshyp /example/test copy -p"
|
||||
^ this allows more easily editing the previous command to copy/edit a different field
|
||||
- better extension integration
|
||||
^ extensions can now ship with a config file that sshyp can use to call them from standard sshyp arguments
|
||||
^ the first extension supporting this is sshyp-mfa
|
||||
^ if sshyp-mfa v1.4.0.1+ is installed, "sshyp /example/test copy -m" will copy MFA keys to your clipboard
|
||||
- entry/folder names now MUST be specified as arguments
|
||||
^ there is no longer a separate input prompt if the entry/folder name is not provided as an argument
|
||||
^ the input prompt was a legacy feature from before arguments could specify entrys/folders with shell completion
|
||||
^ the entry list generated by entry_list_gen() is still present and can be viewed by running "sshyp" with no arguments
|
||||
- better Bash completions
|
||||
^ now correctly places backslashes to escape spaces in entry/folder names
|
||||
^ slightly faster than the previous iteration
|
||||
- IPv6 configuration support
|
||||
|
||||
fixes/optimizations:
|
||||
|
||||
- replaced "+=" with ".append" when extending lists to prevent creating an additional list
|
||||
- optimized usage of "str.split()" and replaced it with "str.splitlines()" where applicable
|
||||
- more concise "if... in ()" syntax replaces long "if" statement chains
|
||||
- lists have been substituted with tuples where applicable
|
||||
- entry_list_gen() has been re-written to be much smaller and faster
|
||||
- os.path is now used in place of pathlib.Path in areas where it is faster
|
||||
- the user's home directory is saved to a variable to prevent running expanduser() every time it is needed
|
||||
|
||||
other notable changes:
|
||||
|
||||
- removed some uncommonly used, redundant arguments
|
||||
^ e.g. "-rm", "-s", "delete"
|
||||
^ their functionality was NOT removed, just their redundant arguments, since "shear", "sync", and "del" are the accepted syntax
|
||||
- errors containing entry/folder names reinforce correct syntax by adding leading/following slashes where necessary
|
||||
- thanks to pull request #25, there are new error messages for the read shortcut
|
||||
^ includes when no entry name is provided or the entry name only refers to a directory
|
||||
- directories provided in user input are no longer denoted by a following slash
|
||||
^ instead, os.path is used to determine if the user is referring to a file or directory
|
||||
|
||||
<><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><>
|
||||
|
||||
sshyp v1.3.0
|
||||
|
||||
the serious shepherd update
|
||||
|
||||
Executable
+41
@@ -0,0 +1,41 @@
|
||||
# sshyp(1) completion
|
||||
|
||||
_path_gen() {
|
||||
local sshyp_path="$HOME/.local/share/sshyp"
|
||||
local glob_status=$(shopt -p globstar)
|
||||
[ -z "${glob_status##*u*}" ] && shopt -s globstar # if recursive globbing is disabled, enable it
|
||||
local full_paths=("$sshyp_path"/**/*.gpg)
|
||||
$glob_status # set recursive globbing to user default
|
||||
for scan_path in "${full_paths[@]}"; do
|
||||
trimmed_paths+=("${scan_path:${#sshyp_path}:-4}")
|
||||
done
|
||||
if [ "${trimmed_paths[0]}" == '/**/*' ]; then trimmed_paths[0]=help; fi
|
||||
} &&
|
||||
|
||||
_sshyp_completions() {
|
||||
local cur=${COMP_WORDS[COMP_CWORD]}
|
||||
local prev=${COMP_WORDS[COMP_CWORD-1]}
|
||||
|
||||
case $prev in
|
||||
sshyp )
|
||||
while read -r; do ITEM=${REPLY// /\\ }; COMPREPLY+=( "$ITEM" ); done < <( compgen -W "$(printf "'%s' " "${trimmed_paths[@]}")" -- "$cur" )
|
||||
;;
|
||||
/* )
|
||||
while read -r; do COMPREPLY+=( "$REPLY" ); done < <( compgen -W "add gen edit copy shear" -- "$cur" )
|
||||
;;
|
||||
add )
|
||||
while read -r; do COMPREPLY+=( "$REPLY" ); done < <( compgen -W "password note folder" -- "$cur" )
|
||||
;;
|
||||
copy )
|
||||
while read -r; do COMPREPLY+=( "$REPLY" ); done < <( compgen -W "password username url note" -- "$cur" )
|
||||
;;
|
||||
edit )
|
||||
while read -r; do COMPREPLY+=( "$REPLY" ); done < <( compgen -W "password username url note relocate" -- "$cur" )
|
||||
;;
|
||||
gen )
|
||||
while read -r; do COMPREPLY+=( "$REPLY" ); done < <( compgen -W "update" -- "$cur" )
|
||||
;;
|
||||
esac
|
||||
|
||||
} &&
|
||||
_path_gen && complete -F _sshyp_completions sshyp
|
||||
Executable
+30
@@ -0,0 +1,30 @@
|
||||
#compdef sshyp
|
||||
|
||||
sshyp_path="$HOME/.local/share/sshyp"
|
||||
full_paths=("$sshyp_path"/**/*.gpg)
|
||||
trimmed_paths=()
|
||||
for scan_path in "${full_paths[@]}"; do
|
||||
trimmed_paths+=("${${scan_path#$sshyp_path}%????}")
|
||||
done
|
||||
[[ -z $trimmed_paths ]] && trimmed_paths=(help)
|
||||
|
||||
case ${words[-2]} in
|
||||
sshyp )
|
||||
compadd $trimmed_paths
|
||||
;;
|
||||
/* )
|
||||
compadd {add,gen,edit,copy,shear}
|
||||
;;
|
||||
add )
|
||||
compadd {password,note,folder}
|
||||
;;
|
||||
copy )
|
||||
compadd {password,username,url,note}
|
||||
;;
|
||||
edit )
|
||||
compadd {password,username,url,note,relocate}
|
||||
;;
|
||||
gen )
|
||||
compadd update
|
||||
;;
|
||||
esac
|
||||
+27
-29
@@ -1,10 +1,10 @@
|
||||
.TH sshyp 1 "14 December 2022" "v1.3.0" "sshyp man page"
|
||||
.TH sshyp 1 "02 April 2023" "v1.4.1" "sshyp man page"
|
||||
.SH NAME
|
||||
sshyp \- A very simple self-hosted, synchronized password manager for UNIX(-like) systems. Alternative to (and compatible with) pass/password-store.
|
||||
.SH SYNOPSIS
|
||||
Client Usage: sshyp [option [flag] [<entry name>]] | [/<entry name>]
|
||||
Client Usage: sshyp [</entry name> [option] [flag]] [option]
|
||||
|
||||
Server Usage: sshyp [option [flag] [<device id>]]
|
||||
Server Usage: sshyp <option> [flag] [<device id>]
|
||||
.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 (CLIENT)
|
||||
@@ -14,26 +14,26 @@ Setting up sshyp for the first time or altering its configuration (also recommen
|
||||
Viewing the entry database:
|
||||
sshyp
|
||||
|
||||
Reading an existing entry saved as ~/.local/share/sshyp/development/github.gpg:
|
||||
Reading an existing entry saved as '~/.local/share/sshyp/development/github.gpg':
|
||||
sshyp /development/github
|
||||
|
||||
Copying the password of an existing entry saved as ~/.local/share/sshyp/financial/bank.gpg:
|
||||
sshyp copy -p /financial/bank
|
||||
Copying the password of an existing entry saved as '~/.local/share/sshyp/financial/bank.gpg':
|
||||
sshyp /financial/bank copy -p
|
||||
|
||||
Editing the username of an existing entry saved as ~/.local/share/sshyp/game.gpg:
|
||||
sshyp edit -u game
|
||||
Editing the username of an existing entry saved as '~/.local/share/sshyp/game.gpg':
|
||||
sshyp /game edit -u
|
||||
|
||||
Making a new entry saved as ~/.local/share/sshyp/school/university.gpg using the built-in password generator:
|
||||
sshyp gen /school/university
|
||||
Making a new entry saved as '~/.local/share/sshyp/school/university.gpg' using the built-in password generator:
|
||||
sshyp /school/university gen
|
||||
|
||||
Creating a note-only entry saved as ~/.local/share/sshyp/notes/testNote.gpg:
|
||||
sshyp add -n /notes/testNote
|
||||
Creating a note-only entry saved as '~/.local/share/sshyp/notes/test note.gpg':
|
||||
sshyp /notes/test\ note add -n
|
||||
|
||||
Manually syncing entries with the server:
|
||||
sshyp sync
|
||||
|
||||
Removing an existing folder saved as ~/.local/share/sshyp/social:
|
||||
sshyp shear social/
|
||||
Removing an existing folder saved as '~/.local/share/sshyp/social':
|
||||
sshyp /social/ shear
|
||||
.SH EXAMPLES (SERVER)
|
||||
Setting up the quick-unlock whitelist:
|
||||
sshyp whitelist setup
|
||||
@@ -41,21 +41,21 @@ Setting up the quick-unlock whitelist:
|
||||
Checking the quick-unlock whitelist status of all registered client devices:
|
||||
sshyp whitelist list
|
||||
|
||||
Adding a device with the id "laptop-im|lAoa;&;r&o:ez((g/Dz;EVb.nO_" to the quick-unlock whitelist:
|
||||
Adding a device with the id 'laptop-im|lAoa;&;r&o:ez((g/Dz;EVb.nO_' to the quick-unlock whitelist:
|
||||
sshyp whitelist add 'laptop-im|lAoa;&;r&o:ez((g/Dz;EVb.nO_'
|
||||
|
||||
Removing a device with the id "laptop-im|lAoa;&;r&o:ez((g/Dz;EVb.nO_" from the quick-unlock whitelist:
|
||||
Removing a device with the id 'laptop-im|lAoa;&;r&o:ez((g/Dz;EVb.nO_' from the quick-unlock whitelist:
|
||||
sshyp whitelist del 'laptop-im|lAoa;&;r&o:ez((g/Dz;EVb.nO_'
|
||||
.SH OPTIONS (CLIENT)
|
||||
help/--help/-h bring up the help menu
|
||||
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
|
||||
shear delete an existing entry
|
||||
sync manually sync the entry directory via sshync
|
||||
.SH FLAGS (CLIENT)
|
||||
add:
|
||||
password/-p add a password entry
|
||||
@@ -78,7 +78,7 @@ copy:
|
||||
gen:
|
||||
update/-u generate a password for an existing entry
|
||||
.SH OPTIONS (SERVER)
|
||||
help/--help/-h bring up this menu
|
||||
help/-h bring up this menu
|
||||
version/-v display sshyp version info
|
||||
tweak configure sshyp
|
||||
whitelist manage the quick-unlock whitelist
|
||||
@@ -87,7 +87,7 @@ whitelist:
|
||||
setup set up the quick-unlock whitelist
|
||||
list/-l view all registered device ids and their quick-unlock whitelist status
|
||||
add whitelist a device id for quick-unlock
|
||||
delete/del remove a device id from the quick-unlock whitelist
|
||||
del remove a device id from the quick-unlock whitelist
|
||||
.SH SETUP
|
||||
sshyp operates on a client-server model, and thus requires you to have access to your own server (whether it be a physical home server or a cloud rental) with remote access via SSH.
|
||||
|
||||
@@ -106,23 +106,21 @@ Client setup:
|
||||
Run "sshyp tweak" and follow the prompts
|
||||
Copy the generated public SSH key (located at ~/.ssh/sshyp.pub) to the server using preferred method (manually adding to authorized_keys, ssh-copy-id, etc.)
|
||||
If you already have entries on the server, sync them using "sshyp sync"
|
||||
Optionally, Bash completions can be enabled by installing your distribution's "bash-completion" package and restarting your terminal
|
||||
Optionally, shell completions (both Bash and ZSH) can be enabled with your shell's respective method
|
||||
Done!
|
||||
|
||||
Please note that the server setup intentionally does not allow the reading of entries (it does not allow adding a gpg decryption key). For security purposes, only clients can read entries.
|
||||
.SH EXIT CODES
|
||||
0 - no error
|
||||
|
||||
1 - argument error
|
||||
1 - configuration error
|
||||
|
||||
2 - configuration error
|
||||
2 - data not found error
|
||||
|
||||
3 - data not found error
|
||||
3 - data already exists error
|
||||
|
||||
4 - data already exists error
|
||||
4 - decryption/encryption error
|
||||
|
||||
5 - decryption/encryption error
|
||||
|
||||
6 - server connection error
|
||||
5 - server connection error
|
||||
.SH AUTHOR
|
||||
Randall Winkhart (https://github.com/rwinkhart)
|
||||
|
||||
@@ -1,50 +0,0 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
_path_gen() {
|
||||
local sshyp_path="$HOME/.local/share/sshyp"
|
||||
local sshyp_path_length="$(("${#sshyp_path}" + 1))"
|
||||
readarray -t full_paths < <(find "$sshyp_path" -type f -exec ls {} \;)
|
||||
for path in "${full_paths[@]}"; do
|
||||
trimmed_path=$(echo ${path%????} | cut -c"$sshyp_path_length"-)
|
||||
trimmed_path=$(echo ${trimmed_path// /\\ })
|
||||
trimmed_paths+=("$trimmed_path")
|
||||
done
|
||||
} &&
|
||||
|
||||
# from this point, this completions script was partially generated by
|
||||
# completely (https://github.com/dannyben/completely)
|
||||
|
||||
_sshyp_completions() {
|
||||
if [ "${#COMP_WORDS[@]}" -gt "4" ]; then
|
||||
return
|
||||
fi
|
||||
local cur=${COMP_WORDS[COMP_CWORD]}
|
||||
local compline="${COMP_WORDS[@]:1:$COMP_CWORD-1}"
|
||||
|
||||
case "$compline" in
|
||||
'add password'* | 'add -p'* | 'add note'* | 'add -n'* | 'add folder'*| 'add -f'* | 'edit relocate'* | 'edit -r'* | 'edit username'* | 'edit -u'* | 'edit password'* | 'edit -p'* | 'edit url'* | 'edit -l'* | 'edit note'* | 'edit -n'* | 'copy username'* | 'copy -u'* | 'copy password'* | 'copy -p'* | 'copy note'* | 'copy -n'* | 'copy url'* | 'copy -l'* | 'gen update'* | 'gen -u'*)
|
||||
while read; do COMPREPLY+=( "$REPLY" ); done < <( compgen -W "$(printf "'%s' " "${trimmed_paths[@]}")" -- "$cur" )
|
||||
;;
|
||||
|
||||
'edit'*)
|
||||
while read; do COMPREPLY+=( "$REPLY" ); done < <( compgen -W "relocate username password note url" -- "$cur" )
|
||||
;;
|
||||
|
||||
'copy'*)
|
||||
while read; do COMPREPLY+=( "$REPLY" ); done < <( compgen -W "username password url note" -- "$cur" )
|
||||
;;
|
||||
|
||||
'add'*)
|
||||
while read; do COMPREPLY+=( "$REPLY" ); done < <( compgen -W "password note folder" -- "$cur" )
|
||||
;;
|
||||
|
||||
'gen'*)
|
||||
while read; do COMPREPLY+=( "$REPLY" ); done < <( compgen -W "update" -- "$cur" )
|
||||
;;
|
||||
*)
|
||||
while read; do COMPREPLY+=( "$REPLY" ); done < <( compgen -W "help version tweak add gen edit copy shear sync $(printf "'%s' " "${trimmed_paths[@]}")" -- "$cur" )
|
||||
;;
|
||||
|
||||
esac
|
||||
} &&
|
||||
_path_gen && complete -F _sshyp_completions sshyp
|
||||
+21
-19
@@ -1,28 +1,29 @@
|
||||
#!/usr/bin/env python3
|
||||
from os import listdir, remove, walk
|
||||
from os.path import expanduser, getmtime, join
|
||||
from os.path import expanduser, isdir, getmtime, join
|
||||
from subprocess import CalledProcessError, PIPE, run
|
||||
from sys import exit as s_exit
|
||||
home = expanduser("~")
|
||||
|
||||
|
||||
# REMOTE
|
||||
|
||||
def remote_list_gen(_client_device_name, _remote_dir): # prints all necessary remote data to stdout
|
||||
# deletions
|
||||
for _file in listdir(expanduser('~/.config/sshyp/deleted')):
|
||||
for _file in listdir(f"{home}/.config/sshyp/deleted"):
|
||||
_file_path, _sep, _device = _file.partition('\x1f')
|
||||
_file_path = _file_path.replace('\x1e', '/')
|
||||
if _device == _client_device_name:
|
||||
print(_file_path)
|
||||
try:
|
||||
remove(f"{expanduser('~/.config/sshyp/deleted/')}{_file}")
|
||||
remove(f"{home}/.config/sshyp/deleted/{_file}")
|
||||
except FileNotFoundError:
|
||||
pass
|
||||
print('\x1d')
|
||||
# folders
|
||||
for _root, _directories, _files in walk(expanduser('~/.local/share/sshyp')):
|
||||
for _root, _directories, _files in walk(f"{home}/.local/share/sshyp"):
|
||||
for _dir in _directories:
|
||||
print(f"{_root.replace(expanduser('~'), '')}/{_dir}")
|
||||
print(f"{_root.replace(home, '')}/{_dir}")
|
||||
print('\x1d')
|
||||
get_local_data(_remote_dir, 'server') # titles and mod times
|
||||
|
||||
@@ -31,16 +32,17 @@ def remote_list_gen(_client_device_name, _remote_dir): # prints all necessary r
|
||||
|
||||
def delete(_file_path, _target_database): # deletes a file or folder and/or marks it for deletion upon syncing
|
||||
from shutil import rmtree
|
||||
_directory = f"{home}/.local/share/sshyp/"
|
||||
try:
|
||||
if _file_path.endswith('/'):
|
||||
rmtree(f"{expanduser('~/.local/share/sshyp/')}{_file_path}")
|
||||
if isdir(_directory + _file_path):
|
||||
rmtree(_directory + _file_path)
|
||||
else:
|
||||
remove(f"{expanduser('~/.local/share/sshyp/')}{_file_path}.gpg")
|
||||
remove(f"{_directory}{_file_path}.gpg")
|
||||
except FileNotFoundError:
|
||||
print(f"location does not exist {_target_database}")
|
||||
if _target_database == 'remotely':
|
||||
for _device_name in listdir(expanduser('~/.config/sshyp/devices')):
|
||||
open(expanduser('~/.config/sshyp/deleted/') + _file_path.replace('/', '\x1e') + '\x1f' + _device_name, 'w')
|
||||
for _device_name in listdir(f"{home}/.config/sshyp/devices"):
|
||||
open(f"{home}/.config/sshyp/deleted/" + _file_path.replace('/', '\x1e') + '\x1f' + _device_name, 'w')
|
||||
|
||||
|
||||
def get_local_data(_directory, _device): # retrieves and returns titles and mod times from the local device
|
||||
@@ -68,10 +70,10 @@ def remote_list_fetch(_user_data): # captures and returns all necessary data fr
|
||||
except CalledProcessError:
|
||||
print('\n\u001b[38;5;9merror: failed to connect to the remote server\u001b[0m\n')
|
||||
_remote_data = ''
|
||||
s_exit(6)
|
||||
_deletion_database = _remote_data[0].strip().split('\n')
|
||||
_folder_database = _remote_data[1].strip().split('\n')
|
||||
_titles_mods = _remote_data[2].strip().split('\n')
|
||||
s_exit(5)
|
||||
_deletion_database = _remote_data[0].strip().splitlines()
|
||||
_folder_database = _remote_data[1].strip().splitlines()
|
||||
_titles_mods = _remote_data[2].strip().splitlines()
|
||||
return _deletion_database, _folder_database, _titles_mods[:len(_titles_mods)//2], \
|
||||
_titles_mods[len(_titles_mods)//2:]
|
||||
|
||||
@@ -79,7 +81,7 @@ def remote_list_fetch(_user_data): # captures and returns all necessary data fr
|
||||
def deletion_sync(_deletion_database, _silent): # checks for and acts upon files and folders marked for deletion
|
||||
for _file in _deletion_database:
|
||||
if _file != '':
|
||||
if _silent != 1:
|
||||
if not _silent:
|
||||
print(f"\u001b[38;5;208m{_file}\u001b[0m has been sheared, removing...")
|
||||
delete(_file, 'locally')
|
||||
|
||||
@@ -87,10 +89,10 @@ def deletion_sync(_deletion_database, _silent): # checks for and acts upon file
|
||||
def folder_sync(_folder_database): # creates matches of remote folders on the local client
|
||||
from pathlib import Path
|
||||
for _folder in _folder_database:
|
||||
if _folder != '' and not Path(f"{expanduser('~')}{_folder}").is_dir():
|
||||
if _folder != '' and not isdir(home + _folder):
|
||||
print(f"\u001b[38;5;2m{_folder.replace('/.local/share/sshyp/', '')}/\u001b[0m does not exist locally, "
|
||||
f"creating...")
|
||||
Path(f"{expanduser('~')}{_folder}").mkdir(mode=0o700, parents=True, exist_ok=True)
|
||||
Path(home + _folder).mkdir(mode=0o700, parents=True, exist_ok=True)
|
||||
|
||||
|
||||
def sort_titles_mods(_list_1, _list_2): # creates and returns two lists (of titles and mod times) generated by sorting
|
||||
@@ -119,14 +121,14 @@ def get_profile(_profile_dir): # returns a list of data read from a sshync job
|
||||
except (FileNotFoundError, IndexError):
|
||||
print('\n\u001b[38;5;9merror: the profile does not exist or is corrupted\u001b[0m\n')
|
||||
_profile_data = None
|
||||
s_exit(3)
|
||||
s_exit(2)
|
||||
_user = _profile_data[0].rstrip()
|
||||
_ip = _profile_data[1].rstrip()
|
||||
_port = _profile_data[2].rstrip()
|
||||
_local_dir = _profile_data[3].rstrip()
|
||||
_remote_dir = _profile_data[4].rstrip()
|
||||
_identity = _profile_data[5].rstrip()
|
||||
_client_device_id = listdir(expanduser('~/.config/sshyp/devices'))[0].rstrip()
|
||||
_client_device_id = listdir(f"{home}/.config/sshyp/devices")[0].rstrip()
|
||||
return _user, _ip, _port, _local_dir, _remote_dir, _identity, _client_device_id
|
||||
|
||||
|
||||
|
||||
+368
-418
File diff suppressed because it is too large
Load Diff
+131
-82
@@ -1,4 +1,4 @@
|
||||
#!/usr/bin/env bash
|
||||
#!/bin/sh
|
||||
|
||||
version=$(sed -n '1{p;q}' share/doc/sshyp/changelog | cut -c8-)
|
||||
if [ -z "$2" ]; then
|
||||
@@ -8,25 +8,29 @@ else
|
||||
fi
|
||||
|
||||
_create_generic() {
|
||||
echo -e '\npackaging as generic...\n'
|
||||
mkdir -p output/generictemp/usr/{bin,lib/sshyp,share/{man/man1,bash-completion/completions}}
|
||||
printf '\npackaging as generic...\n'
|
||||
mkdir -p output/generictemp/usr/bin \
|
||||
output/generictemp/usr/lib/sshyp/extensions \
|
||||
output/generictemp/usr/share/man/man1 \
|
||||
output/generictemp/usr/share/bash-completion/completions \
|
||||
output/generictemp/usr/share/zsh/functions/Completion/Unix
|
||||
cp -r lib/. output/generictemp/usr/lib/sshyp/
|
||||
ln -s /usr/lib/sshyp/sshyp.py output/generictemp/usr/bin/sshyp
|
||||
cp -r share output/generictemp/usr/
|
||||
cp extra/sshyp-completion.bash output/generictemp/usr/share/bash-completion/completions/sshyp
|
||||
cp extra/completion.bash output/generictemp/usr/share/bash-completion/completions/sshyp
|
||||
cp extra/completion.zsh output/generictemp/usr/share/zsh/functions/Completion/Unix/_sshyp
|
||||
cp extra/manpage output/generictemp/usr/share/man/man1/sshyp.1
|
||||
gzip output/generictemp/usr/share/man/man1/sshyp.1
|
||||
tar -C output/generictemp -cvJf output/sshyp-"$version".tar.xz usr/
|
||||
XZ_OPT=-e6 tar -C output/generictemp -cvJf output/GENERIC-sshyp-"$version".tar.xz usr/
|
||||
rm -rf output/generictemp
|
||||
sha512="$(sha512sum output/sshyp-"$version".tar.xz | awk '{print $1;}')"
|
||||
echo -e "\nsha512 sum:\n$sha512"
|
||||
echo -e "\ngeneric packaging complete\n"
|
||||
sha512="$(sha512sum output/GENERIC-sshyp-"$version".tar.xz | awk '{print $1;}')"
|
||||
printf '\ngeneric packaging complete\n\n'
|
||||
} &&
|
||||
|
||||
_create_pkgbuild() {
|
||||
source='https://github.com/rwinkhart/sshyp/releases/download/v$pkgver/sshyp-$pkgver.tar.xz'
|
||||
echo -e '\ngenerating PKGBUILD...'
|
||||
echo "# Maintainer: Randall Winkhart <idgr at tutanota dot com>
|
||||
local source='https://github.com/rwinkhart/sshyp/releases/download/v$pkgver/GENERIC-sshyp-$pkgver.tar.xz'
|
||||
printf '\ngenerating PKGBUILD...\n'
|
||||
printf "# Maintainer: Randall Winkhart <idgr at tutanota dot com>
|
||||
pkgname=sshyp
|
||||
pkgver="$version"
|
||||
pkgrel="$revision"
|
||||
@@ -40,15 +44,16 @@ source=(\""$source"\")
|
||||
sha512sums=('"$sha512"')
|
||||
|
||||
package() {
|
||||
tar xf sshyp-"\"\$pkgver\"".tar.xz -C "\"\${pkgdir}\""
|
||||
tar xf GENERIC-sshyp-"\"\$pkgver\"".tar.xz -C "\"\${pkgdir}\""
|
||||
}
|
||||
" > output/PKGBUILD
|
||||
echo -e "\nPKGBUILD generated\n"
|
||||
printf '\nPKGBUILD generated\n\n'
|
||||
} &&
|
||||
|
||||
_create_apkbuild() {
|
||||
echo -e '\ngenerating APKBUILD...'
|
||||
echo "# Maintainer: Randall Winkhart <idgr@tutanota.com>
|
||||
local source='https://github.com/rwinkhart/sshyp/releases/download/v$pkgver/GENERIC-sshyp-$pkgver.tar.xz'
|
||||
printf '\ngenerating APKBUILD...\n'
|
||||
printf "# Maintainer: Randall Winkhart <idgr@tutanota.com>
|
||||
pkgname=sshyp
|
||||
pkgver="$version"
|
||||
pkgrel="$((revision-1))"
|
||||
@@ -62,20 +67,28 @@ source=\""$source"\"
|
||||
|
||||
package() {
|
||||
mkdir -p "\"\$pkgdir\""
|
||||
mkdir -p "\"\$srcdir/usr/share/zsh/site-functions"\"
|
||||
mv "\"\$srcdir/usr/share/zsh/functions/Completion/Unix/_sshyp"\" "\"\$srcdir/usr/share/zsh/site-functions/_sshyp"\"
|
||||
rm -rf "\"\$srcdir/usr/share/zsh/functions"\"
|
||||
cp -r "\"\$srcdir/usr/"\" "\"\$pkgdir\""
|
||||
}
|
||||
|
||||
sha512sums=\"
|
||||
"$sha512' 'sshyp-\"\$pkgver\".tar.xz"
|
||||
"$sha512' 'GENERIC-sshyp-\"\$pkgver\".tar.xz"
|
||||
\"
|
||||
" > output/APKBUILD
|
||||
echo -e "\nAPKBUILD generated\n"
|
||||
printf '\nAPKBUILD generated\n\n'
|
||||
} &&
|
||||
|
||||
_create_hpkg() {
|
||||
echo -e '\npackaging for Haiku...\n'
|
||||
mkdir -p output/haikutemp/{bin,lib/sshyp,documentation/{packages/sshyp,man/man1},data/bash-completion/completions}
|
||||
echo "name sshyp
|
||||
printf '\npackaging for Haiku...\n'
|
||||
mkdir -p output/haikutemp/bin \
|
||||
output/haikutemp/lib/sshyp/extensions \
|
||||
output/haikutemp/documentation/packages/sshyp \
|
||||
output/haikutemp/documentation/man/man1 \
|
||||
output/haikutemp/data/bash-completion/completions \
|
||||
output/haikutemp/data/zsh/site-functions
|
||||
printf "name sshyp
|
||||
version "$version"-"$revision"
|
||||
architecture any
|
||||
summary \"A light-weight, self-hosted, synchronized password manager\"
|
||||
@@ -86,7 +99,7 @@ licenses {
|
||||
\"GNU GPL v3\"
|
||||
}
|
||||
copyrights {
|
||||
\"2021-2022 Randall Winkhart\"
|
||||
\"2021-2023 Randall Winkhart\"
|
||||
}
|
||||
provides {
|
||||
sshyp = "$version"
|
||||
@@ -107,22 +120,28 @@ urls {
|
||||
ln -s /system/lib/sshyp/sshyp.py output/haikutemp/bin/sshyp
|
||||
cp -r share/doc/sshyp/. output/haikutemp/documentation/packages/sshyp/
|
||||
cp -r share/licenses/sshyp/. output/haikutemp/documentation/packages/sshyp/
|
||||
cp extra/sshyp-completion.bash output/haikutemp/data/bash-completion/completions/sshyp
|
||||
cp extra/completion.bash output/haikutemp/data/bash-completion/completions/sshyp
|
||||
cp extra/completion.zsh output/haikutemp/data/zsh/site-functions/_sshyp
|
||||
cp extra/manpage output/haikutemp/documentation/man/man1/sshyp.1
|
||||
gzip output/haikutemp/documentation/man/man1/sshyp.1
|
||||
cd output/haikutemp
|
||||
package create -b sshyp-"$version"-"$revision"_all.hpkg
|
||||
package add sshyp-"$version"-"$revision"_all.hpkg bin lib documentation data
|
||||
package create -b HAIKU-sshyp-"$version"-"$revision"_all.hpkg
|
||||
package add HAIKU-sshyp-"$version"-"$revision"_all.hpkg bin lib documentation data
|
||||
cd ../..
|
||||
mv output/haikutemp/sshyp-"$version"-"$revision"_all.hpkg output/
|
||||
mv output/haikutemp/HAIKU-sshyp-"$version"-"$revision"_all.hpkg output/
|
||||
rm -rf output/haikutemp
|
||||
echo -e "\nHaiku packaging complete\n"
|
||||
printf '\nHaiku packaging complete\n\n'
|
||||
} &&
|
||||
|
||||
_create_deb() {
|
||||
echo -e '\npackaging for Debian/Ubuntu...\n'
|
||||
mkdir -p output/debiantemp/sshyp_"$version"-"$revision"_all/{DEBIAN,usr/{lib/sshyp,bin,share/{bash-completion/completions,man/man1}}}
|
||||
echo "Package: sshyp
|
||||
printf '\npackaging for Debian/Ubuntu...\n'
|
||||
mkdir -p output/debiantemp/sshyp_"$version"-"$revision"_all/DEBIAN \
|
||||
output/debiantemp/sshyp_"$version"-"$revision"_all/usr/lib/sshyp/extensions \
|
||||
output/debiantemp/sshyp_"$version"-"$revision"_all/usr/bin \
|
||||
output/debiantemp/sshyp_"$version"-"$revision"_all/usr/share/man/man1 \
|
||||
output/debiantemp/sshyp_"$version"-"$revision"_all/usr/share/bash-completion/completions \
|
||||
output/debiantemp/sshyp_"$version"-"$revision"_all/usr/share/zsh/functions/Completion/Unix
|
||||
printf "Package: sshyp
|
||||
Version: $version
|
||||
Section: utils
|
||||
Architecture: all
|
||||
@@ -136,19 +155,25 @@ Installed-Size: 14584
|
||||
cp -r lib/. output/debiantemp/sshyp_"$version"-"$revision"_all/usr/lib/sshyp/
|
||||
ln -s /usr/lib/sshyp/sshyp.py output/debiantemp/sshyp_"$version"-"$revision"_all/usr/bin/sshyp
|
||||
cp -r share output/debiantemp/sshyp_"$version"-"$revision"_all/usr/
|
||||
cp extra/sshyp-completion.bash output/debiantemp/sshyp_"$version"-"$revision"_all/usr/share/bash-completion/completions/sshyp
|
||||
cp extra/completion.bash output/debiantemp/sshyp_"$version"-"$revision"_all/usr/share/bash-completion/completions/sshyp
|
||||
cp extra/completion.zsh output/debiantemp/sshyp_"$version"-"$revision"_all/usr/share/zsh/functions/Completion/Unix/_sshyp
|
||||
cp extra/manpage output/debiantemp/sshyp_"$version"-"$revision"_all/usr/share/man/man1/sshyp.1
|
||||
gzip output/debiantemp/sshyp_"$version"-"$revision"_all/usr/share/man/man1/sshyp.1
|
||||
dpkg-deb --build --root-owner-group output/debiantemp/sshyp_"$version"-"$revision"_all/
|
||||
mv output/debiantemp/sshyp_"$version"-"$revision"_all.deb output/
|
||||
mv output/debiantemp/sshyp_"$version"-"$revision"_all.deb output/DEBIAN-sshyp_"$version"-"$revision"_all.deb
|
||||
rm -rf output/debiantemp
|
||||
echo -e "\nDebian/Ubuntu packaging complete\n"
|
||||
printf '\nDebian/Ubuntu packaging complete\n\n'
|
||||
} &&
|
||||
|
||||
_create_termux() {
|
||||
echo -e '\npackaging for Termux...\n'
|
||||
mkdir -p output/termuxtemp/sshyp_"$version"-"$revision"_all_termux/{DEBIAN,data/data/com.termux/files/usr/{lib/sshyp,bin,share/{bash-completion/completions,man/man1}}}
|
||||
echo "Package: sshyp
|
||||
printf '\npackaging for Termux...\n'
|
||||
mkdir -p output/termuxtemp/sshyp_"$version"-"$revision"_all_termux/DEBIAN \
|
||||
output/termuxtemp/sshyp_"$version"-"$revision"_all_termux/data/data/com.termux/files/usr/lib/sshyp/extensions \
|
||||
output/termuxtemp/sshyp_"$version"-"$revision"_all_termux/data/data/com.termux/files/usr/bin \
|
||||
output/termuxtemp/sshyp_"$version"-"$revision"_all_termux/data/data/com.termux/files/usr/share/man/man1 \
|
||||
output/termuxtemp/sshyp_"$version"-"$revision"_all_termux/data/data/com.termux/files/usr/share/bash-completion/completions \
|
||||
output/termuxtemp/sshyp_"$version"-"$revision"_all_termux/data/data/com.termux/files/usr/share/zsh/functions/Completion/Unix
|
||||
printf "Package: sshyp
|
||||
Version: $version
|
||||
Section: utils
|
||||
Architecture: all
|
||||
@@ -162,55 +187,61 @@ Installed-Size: 14584
|
||||
cp -r lib/. output/termuxtemp/sshyp_"$version"-"$revision"_all_termux/data/data/com.termux/files/usr/lib/sshyp/
|
||||
ln -s /data/data/com.termux/files/usr/lib/sshyp/sshyp.py output/termuxtemp/sshyp_"$version"-"$revision"_all_termux/data/data/com.termux/files/usr/bin/sshyp
|
||||
cp -r share output/termuxtemp/sshyp_"$version"-"$revision"_all_termux/data/data/com.termux/files/usr/
|
||||
cp extra/sshyp-completion.bash output/termuxtemp/sshyp_"$version"-"$revision"_all_termux/data/data/com.termux/files/usr/share/bash-completion/completions/sshyp
|
||||
cp extra/completion.bash output/termuxtemp/sshyp_"$version"-"$revision"_all_termux/data/data/com.termux/files/usr/share/bash-completion/completions/sshyp
|
||||
cp extra/completion.zsh output/termuxtemp/sshyp_"$version"-"$revision"_all_termux/data/data/com.termux/files/usr/share/zsh/functions/Completion/Unix/_sshyp
|
||||
cp extra/manpage output/termuxtemp/sshyp_"$version"-"$revision"_all_termux/data/data/com.termux/files/usr/share/man/man1/sshyp.1
|
||||
gzip output/termuxtemp/sshyp_"$version"-"$revision"_all_termux/data/data/com.termux/files/usr/share/man/man1/sshyp.1
|
||||
dpkg-deb --build --root-owner-group output/termuxtemp/sshyp_"$version"-"$revision"_all_termux/
|
||||
mv output/termuxtemp/sshyp_"$version"-"$revision"_all_termux.deb output/
|
||||
mv output/termuxtemp/sshyp_"$version"-"$revision"_all_termux.deb output/TERMUX-sshyp_"$version"-"$revision"_all_termux.deb
|
||||
rm -rf output/termuxtemp
|
||||
echo -e "\nTermux packaging complete\n"
|
||||
printf '\nTermux packaging complete\n\n'
|
||||
} &&
|
||||
|
||||
_create_rpm() {
|
||||
echo -e '\npackaging for Fedora...\n'
|
||||
printf '\npackaging for Fedora...\n'
|
||||
rm -rf ~/rpmbuild
|
||||
rpmdev-setuptree
|
||||
cp output/sshyp-"$version".tar.xz ~/rpmbuild/SOURCES
|
||||
echo "Name: sshyp
|
||||
cp output/GENERIC-sshyp-"$version".tar.xz ~/rpmbuild/SOURCES
|
||||
printf "Name: sshyp
|
||||
Version: "$version"
|
||||
Release: "$revision"
|
||||
Summary: A light-weight, self-hosted, synchronized password manager
|
||||
BuildArch: noarch
|
||||
License: GPL-3.0-only
|
||||
URL: https://github.com/rwinkhart/sshyp
|
||||
Source0: sshyp-"$version".tar.xz
|
||||
Source0: GENERIC-sshyp-"$version".tar.xz
|
||||
Requires: python gnupg openssh-clients wl-clipboard
|
||||
Recommends: bash-completion
|
||||
%description
|
||||
sshyp is a password-store compatible CLI password manager available for UNIX(-like) systems - its primary goal is to make syncing passwords and notes across devices as easy as possible via CLI.
|
||||
%install
|
||||
tar xf %{_sourcedir}/sshyp-"$version".tar.xz -C %{_sourcedir}
|
||||
tar xf %{_sourcedir}/GENERIC-sshyp-"$version".tar.xz -C %{_sourcedir}
|
||||
cp -r %{_sourcedir}/usr %{buildroot}
|
||||
%files
|
||||
/usr/bin/sshyp
|
||||
/usr/lib/sshyp/sshyp.py
|
||||
/usr/lib/sshyp/sshync.py
|
||||
/usr/share/bash-completion/completions/sshyp
|
||||
/usr/share/zsh/functions/Completion/Unix/_sshyp
|
||||
%license /usr/share/licenses/sshyp/license
|
||||
%doc
|
||||
/usr/share/doc/sshyp/changelog
|
||||
/usr/share/man/man1/sshyp.1.gz
|
||||
" > ~/rpmbuild/SPECS/sshyp.spec
|
||||
rpmbuild -bb ~/rpmbuild/SPECS/sshyp.spec
|
||||
mv ~/rpmbuild/RPMS/noarch/* output/
|
||||
mv ~/rpmbuild/RPMS/noarch/sshyp-"$version"-"$revision".noarch.rpm output/FEDORA-sshyp-"$version"-"$revision".noarch.rpm
|
||||
rm -rf ~/rpmbuild
|
||||
echo -e "\nFedora packaging complete\n"
|
||||
printf '\nFedora packaging complete\n\n'
|
||||
} &&
|
||||
|
||||
_create_freebsd_pkg() {
|
||||
echo -e '\npackaging for FreeBSD...'
|
||||
mkdir -p output/freebsdtemp/usr/{lib/sshyp,bin,share/{bash-completion/completions,man/man1}}
|
||||
echo "name: sshyp
|
||||
printf '\npackaging for FreeBSD...\n'
|
||||
mkdir -p output/freebsdtemp/usr/lib/sshyp/extensions \
|
||||
output/freebsdtemp/usr/bin \
|
||||
output/freebsdtemp/usr/share/man/man1 \
|
||||
output/freebsdtemp/usr/local/share/bash-completion/completions \
|
||||
output/freebsdtemp/usr/local/share/zsh/site-functions
|
||||
printf "name: sshyp
|
||||
version: \""$version"\"
|
||||
abi = \"FreeBSD:13:*\";
|
||||
arch = \"freebsd:13:*\";
|
||||
@@ -235,10 +266,11 @@ prefix: /
|
||||
},
|
||||
},
|
||||
" > output/freebsdtemp/+MANIFEST
|
||||
echo "/usr/bin/sshyp
|
||||
printf "/usr/bin/sshyp
|
||||
/usr/lib/sshyp/sshync.py
|
||||
/usr/lib/sshyp/sshyp.py
|
||||
/usr/share/bash-completion/completions/sshyp
|
||||
/usr/local/share/bash-completion/completions/sshyp
|
||||
/usr/local/share/zsh/site-functions/_sshyp
|
||||
/usr/share/doc/sshyp/changelog
|
||||
/usr/share/licenses/sshyp/license
|
||||
/usr/share/man/man1/sshyp.1.gz
|
||||
@@ -246,44 +278,61 @@ echo "/usr/bin/sshyp
|
||||
cp -r lib/. output/freebsdtemp/usr/lib/sshyp/
|
||||
ln -s /usr/lib/sshyp/sshyp.py output/freebsdtemp/usr/bin/sshyp
|
||||
cp -r share output/freebsdtemp/usr/
|
||||
cp extra/sshyp-completion.bash output/freebsdtemp/usr/share/bash-completion/completions/sshyp
|
||||
cp extra/completion.bash output/freebsdtemp/usr/local/share/bash-completion/completions/sshyp
|
||||
cp extra/completion.zsh output/freebsdtemp/usr/local/share/zsh/site-functions/_sshyp
|
||||
cp extra/manpage output/freebsdtemp/usr/share/man/man1/sshyp.1
|
||||
gzip output/freebsdtemp/usr/share/man/man1/sshyp.1
|
||||
pkg create -m output/freebsdtemp/ -r output/freebsdtemp/ -p output/freebsdtemp/plist -o output/
|
||||
mv output/sshyp-"$version".pkg output/FREEBSD-sshyp-"$version"-"$revision".pkg
|
||||
rm -rf output/freebsdtemp
|
||||
echo -e "\nFreeBSD packaging complete\n"
|
||||
printf '\nFreeBSD packaging complete\n\n'
|
||||
} &&
|
||||
|
||||
if [ "$1" == "generic" ]; then # build scripts
|
||||
_create_generic
|
||||
elif [ "$1" == "pkgbuild" ]; then
|
||||
_create_generic
|
||||
_create_pkgbuild
|
||||
elif [ "$1" == "apkbuild" ]; then
|
||||
_create_generic
|
||||
_create_apkbuild
|
||||
elif [ "$1" == "haiku" ]; then # distribution packages
|
||||
_create_hpkg
|
||||
elif [ "$1" == "debian" ]; then
|
||||
_create_deb
|
||||
elif [ "$1" == "termux" ]; then
|
||||
_create_termux
|
||||
elif [ "$1" == "fedora" ]; then
|
||||
_create_generic
|
||||
_create_rpm
|
||||
elif [ "$1" == "freebsd" ]; then
|
||||
_create_freebsd_pkg
|
||||
elif [ "$1" == "buildable-arch" ]; then
|
||||
_create_generic
|
||||
_create_pkgbuild
|
||||
_create_apkbuild
|
||||
if [[ $(pacman -Q dpkg) == "dpkg"* ]]; then
|
||||
case "$1" in
|
||||
generic)
|
||||
_create_generic
|
||||
;;
|
||||
pkgbuild)
|
||||
_create_generic
|
||||
_create_pkgbuild
|
||||
;;
|
||||
apkbuild)
|
||||
_create_generic
|
||||
_create_apkbuild
|
||||
;;
|
||||
haiku)
|
||||
_create_hpkg
|
||||
;;
|
||||
debian)
|
||||
_create_deb
|
||||
;;
|
||||
termux)
|
||||
_create_termux
|
||||
fi
|
||||
if [[ "$(pacman -Q freebsd-pkg)" == "freebsd-pkg"* ]]; then
|
||||
;;
|
||||
fedora)
|
||||
_create_generic
|
||||
_create_rpm
|
||||
;;
|
||||
freebsd)
|
||||
_create_freebsd_pkg
|
||||
fi
|
||||
else
|
||||
echo -e '\nusage: package.sh [target] <revision>\n\ntargets:\n mainline: pkgbuild apkbuild haiku fedora debian\n experimental: freebsd termux\n other: buildable-arch\n'
|
||||
fi
|
||||
;;
|
||||
buildable-arch)
|
||||
_create_generic
|
||||
_create_pkgbuild
|
||||
_create_apkbuild
|
||||
case "$(pacman -Q dpkg)" in
|
||||
dpkg*)
|
||||
_create_deb
|
||||
_create_termux
|
||||
;;
|
||||
esac
|
||||
case "$(pacman -Q freebsd-pkg)" in
|
||||
freebsd-pkg*)
|
||||
_create_freebsd_pkg
|
||||
;;
|
||||
esac
|
||||
;;
|
||||
*)
|
||||
printf '\nusage: package.sh [target] <revision>\n\ntargets:\n mainline: pkgbuild apkbuild haiku fedora debian\n experimental: freebsd termux\n other: buildable-arch\n\n'
|
||||
;;
|
||||
esac
|
||||
|
||||
@@ -1,48 +1,22 @@
|
||||
sshyp v1.3.0
|
||||
sshyp v1.4.1
|
||||
|
||||
the serious shepherd update
|
||||
the argumentative agronomist update - patch one
|
||||
|
||||
this release ties up many of sshyp's loose ends where there was
|
||||
room for major performance, compatibility, and security improvements
|
||||
|
||||
compatibility-breaking changes:
|
||||
|
||||
- due to a near full re-write of the syncing functionality, all clients and servers
|
||||
must be updated to this release (v1.3.0 is not backwards compatible with any prior release)
|
||||
- it is recommended to either delete the contents of ~/.config/sshyp/deleted (on the server-side)
|
||||
or sync all of your clients before updating
|
||||
^ old entries in this folder will throw errors with v1.3.0
|
||||
this release improves sshyp's shell completions by adding zsh support and significantly optimizing and improving Bash support
|
||||
|
||||
user-facing features:
|
||||
|
||||
- none - all changes were under-the-hood - the user experience should be
|
||||
exactly the same as v1.2.0 - just faster, less buggy, and more secure
|
||||
- zsh completion support
|
||||
^ ensure modern completions are enabled in your ~/.zshrc
|
||||
|
||||
major fixes/optimizations:
|
||||
fixes/optimizations:
|
||||
|
||||
- a near full re-write of the syncing functionality
|
||||
^ all syncing logic has been moved into sshync.py (from sshyp.py and sshypRemote.py)
|
||||
^ in my setup, a dry, local "sshyp sync" went from 2.00+ seconds (v1.2.0) to 0.36 seconds (v1.3.0)
|
||||
^ the performance improvements are even greater when syncing from outside your local network
|
||||
- the following character sequences will no longer break the syncing logic: "@", "^&*", and "*&^"
|
||||
^ ASCII separator characters 29-31 are now used, instead
|
||||
- os.system has been replaced with subprocess.run in all cases, shell=True is no longer used with subprocess.run
|
||||
^ this protects against shell escape attacks and potentially makes sshyp more compatible with some environments
|
||||
- replaced shell commands with python built-in library functions where applicable
|
||||
^ this brings speed and compatibility improvements
|
||||
- sshyp should no longer incorrectly assume an X11 environment when Wayland is in use
|
||||
^ this fixes clipboard support in some Wayland environments, such as Sway (Plasma/Gnome/Phosh were unaffected)
|
||||
- sshyp now uses the default pinentry on Haiku thanks to haikuports/haikuports#7457
|
||||
^ this brings the Haiku port in-line with the other sshyp packages in terms of security
|
||||
- "python3" is now called over ssh, rather than "python"
|
||||
^ some environments do not have a "python" symlink, or it links to "python2" - changing this increases compatibility
|
||||
- fixed an issue from v1.2.0 where renaming threw an error if not in offline mode
|
||||
- Bash completions are now much faster due to the use of recursive globbing
|
||||
- Bash completions have been modified to be functionally similar to the new zsh completions
|
||||
|
||||
other notable changes:
|
||||
|
||||
- quick-unlock password input is now hidden while the user is typing
|
||||
^ user input is now invisible to prevent snooping
|
||||
- lots of smaller optimizations not listed here
|
||||
- some official packages now use more space-efficient compression
|
||||
|
||||
<><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><>
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
sshyp is a FOSS password manager that uses an sftp-based syncing back-end.
|
||||
Copyright (C) 2022 Randall Winkhart idgr@tutanota.com
|
||||
Copyright (C) 2021-2023 Randall Winkhart idgr@tutanota.com
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of version 3 (only) of the GNU General Public License
|
||||
|
||||
Reference in New Issue
Block a user