Compare commits

...
18 Commits
Author SHA1 Message Date
RandyTheSilly d9873df2d1 Add distribution names to packages
Former-commit-id: 9dd795c4a3d84f7cba92c99de1389a200aad9d9f
Former-commit-id: dfd3368e54eaf4429637f27cf437d3535ae78d4c
2023-04-02 00:57:15 -04:00
RandyTheSilly 0c85703a73 Properly reset trimmed_paths for zsh completion
Former-commit-id: adda3df4ca4afbc7da162fb64592e853617802d4
Former-commit-id: 96917ce98bef0c879f392a2444f6d600589d9b53
2023-04-01 23:44:22 -04:00
RandyTheSilly 41c9d0a22b Complete 'help' if the entry directory is empty or does not exist
Former-commit-id: 1167f06b14ce50baa0c96e67a835247c6579aaa9
Former-commit-id: ea6be360d50c16579253d1e2d0b1825c5a1f1a4a
2023-04-01 23:19:56 -04:00
RandyTheSilly aa65ecf8fb Fixed typo preventing Termux package from being created
Former-commit-id: 582d5bf600455b8b494317607aa8aa98f0572713
Former-commit-id: 16f9db10858a8c3ba3f5c8e064505d4553f40b3c
2023-04-01 22:19:16 -04:00
RandyTheSilly 432a5f1e5a Update documentation for v1.4.1
Former-commit-id: 044613130dbc6d7cec9bb3a0d64f0727b868442b
Former-commit-id: 82716630a6f2395a89ed00398acea531647703c3
2023-04-01 21:29:25 -04:00
RandyTheSilly 03c8bdbf74 Integrate zsh completion into all supported platforms
Former-commit-id: 0e1e86349aaffb1269c9dd94606722779edb3d24
Former-commit-id: 3dfd223582096959789e6ce4dcf3ff5a7f3ef5e7
2023-03-28 01:17:58 -04:00
RandyTheSilly 1e0aa8aa39 Made source variables explicitly local
Former-commit-id: 0f7810121a1d7a905b10b208d0f31df2480207e8
Former-commit-id: 820c9bfcc79dadb363a1c62e615854a294b64a3a
2023-03-27 23:08:55 -04:00
RandyTheSilly 924d066676 Added source for APKBUILD
Former-commit-id: 8de8179129c2346368c65015fd91ccbc8dca0c26
Former-commit-id: b2b9f223c4dbaa571b21c19d9c41a8c50eca83c6
2023-03-27 23:07:09 -04:00
RandyTheSilly 07cfc7ddaf Fixed checks for dpkg and freebsd-pkg installations
Former-commit-id: ace1f3bd23195eaf52ea8d67dd79c40f732524c7
Former-commit-id: 23decaf206b05d7b62ece38bc332826b1da098bc
2023-03-27 22:43:35 -04:00
RandyTheSilly 6e0f19e8b8 No longer print sha512 sums, remove extra new lines
Former-commit-id: 5c37c834839bac92f6f95afd4b11abee3214a539
Former-commit-id: dca450cfb0eccc1cc9184d076979d1f74112fd2b
2023-03-27 22:16:53 -04:00
RandyTheSilly d2ee90a52c Removed the use of Bash-isms in packaging script
Former-commit-id: ce475f74daf3649b3522f865d382665fce75faff
Former-commit-id: 85b1a646261ed6dc3f80212e316a52a8cb48a1de
2023-03-27 21:55:23 -04:00
RandyTheSilly 3f4173b4fd Improved order completions are served in
Former-commit-id: e1eae46e144920b58c613d5e710d1ee30d3841a7
Former-commit-id: b6e78af74b29add6e63a708bdfc807dfe92c1094
2023-03-27 10:34:19 -04:00
RandyTheSilly fc94bfd774 Updated Bash completion to reflect zsh completion behavior
Former-commit-id: ea8d14d76e85500eb1d2a27884b068dc302ea225
Former-commit-id: c631d938ccf3aa6131f54e12249a983f74d4a09d
2023-03-27 10:12:31 -04:00
RandyTheSilly 0226180339 Use "extreme" compression mode for generic package
Former-commit-id: 9ec45bd900f397bdd9b846ec7079f3cbdc88cf32
Former-commit-id: 121fcfb0b424ee7214f2959ea807b8d4ba21b4a1
2023-03-13 10:03:05 -04:00
RandyTheSilly ed9c69248b Fixed zsh completions script breaking $path
Former-commit-id: 7179fd168dd5c5a68854a72efe6a00153b97f1e5
Former-commit-id: 3329e42498daa2a78295bcd8949d8c7281d3575b
2023-03-09 16:24:47 -05:00
RandyTheSilly 902e041f51 Initial zsh completion support (for generic-based packages)
Former-commit-id: 17f1773c8653e8525fd58380a34f6574473ed62c
Former-commit-id: 3c90b366b8c9ad3c083110d0c9b0f19080fbdea7
2023-03-09 16:04:17 -05:00
RandyTheSilly 648bed832f Made Bash completions significantly faster, temporarily ensure recursive globbing is enabled
Former-commit-id: c974ce1e0cb0198094d6ece325ab3216f1925f36
Former-commit-id: 762562fbbdb298f4b13210d0014a942b430c1197
2023-03-08 23:00:53 -05:00
RandyTheSilly 843dff6527 Use globbing to generate entry list for shell completion (faster)
Former-commit-id: ea8212223896fc86368f772f43053f6ee8742068
Former-commit-id: 5f35b58014dcc00cb733d4980e28157e4de1ffcb
2023-03-08 16:19:02 -05:00
9 changed files with 241 additions and 174 deletions
+1 -2
View File
@@ -34,8 +34,7 @@ What sshyp can do:
- everything above on Haiku, FreeBSD, Linux, and Termux! - everything above on Haiku, FreeBSD, Linux, and Termux!
# Installation # Installation
**Important:** *Bash completions will NOT function until you install your distribution's "bash-completion" package or manually source the Bash completion script.* **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.*
*A restart of your terminal is required after installing "bash-completion".*
Please see the [installation guide](https://github.com/rwinkhart/sshyp/wiki/Installation) in the sshyp wiki for directions specific to your distribution/OS. Please see the [installation guide](https://github.com/rwinkhart/sshyp/wiki/Installation) in the sshyp wiki for directions specific to your distribution/OS.
+22
View File
@@ -1,3 +1,25 @@
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 sshyp v1.4.0
the argumentative agronomist update the argumentative agronomist update
+41
View File
@@ -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
+30
View File
@@ -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
+8 -8
View File
@@ -1,4 +1,4 @@
.TH sshyp 1 "04 March 2023" "v1.4.0" "sshyp man page" .TH sshyp 1 "02 April 2023" "v1.4.1" "sshyp man page"
.SH NAME .SH NAME
sshyp \- A very simple self-hosted, synchronized password manager for UNIX(-like) systems. Alternative to (and compatible with) pass/password-store. sshyp \- A very simple self-hosted, synchronized password manager for UNIX(-like) systems. Alternative to (and compatible with) pass/password-store.
.SH SYNOPSIS .SH SYNOPSIS
@@ -14,25 +14,25 @@ Setting up sshyp for the first time or altering its configuration (also recommen
Viewing the entry database: Viewing the entry database:
sshyp 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 sshyp /development/github
Copying the password of an existing entry saved as ~/.local/share/sshyp/financial/bank.gpg: Copying the password of an existing entry saved as '~/.local/share/sshyp/financial/bank.gpg':
sshyp /financial/bank copy -p sshyp /financial/bank copy -p
Editing the username of an existing entry saved as ~/.local/share/sshyp/game.gpg: Editing the username of an existing entry saved as '~/.local/share/sshyp/game.gpg':
sshyp /game edit -u sshyp /game edit -u
Making a new entry saved as ~/.local/share/sshyp/school/university.gpg using the built-in password generator: Making a new entry saved as '~/.local/share/sshyp/school/university.gpg' using the built-in password generator:
sshyp /school/university gen sshyp /school/university gen
Creating a note-only entry saved as ~/.local/share/sshyp/notes/test note.gpg: Creating a note-only entry saved as '~/.local/share/sshyp/notes/test note.gpg':
sshyp /notes/test\ note add -n sshyp /notes/test\ note add -n
Manually syncing entries with the server: Manually syncing entries with the server:
sshyp sync sshyp sync
Removing an existing folder saved as ~/.local/share/sshyp/social: Removing an existing folder saved as '~/.local/share/sshyp/social':
sshyp /social/ shear sshyp /social/ shear
.SH EXAMPLES (SERVER) .SH EXAMPLES (SERVER)
Setting up the quick-unlock whitelist: Setting up the quick-unlock whitelist:
@@ -106,7 +106,7 @@ Client setup:
Run "sshyp tweak" and follow the prompts 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.) 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" 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! 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. 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.
-44
View File
@@ -1,44 +0,0 @@
#!/usr/bin/env bash
_path_gen() {
local sshyp_path="$HOME/.local/share/sshyp"
local sshyp_path_length="$(("${#sshyp_path}" + 1))"
mapfile -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_paths+=("$trimmed_path")
done
} &&
# from this point, this completions script was partially generated by
# completely (https://github.com/dannyben/completely)
_sshyp_completions() {
local cur=${COMP_WORDS[COMP_CWORD]}
local compwords=("${COMP_WORDS[@]:1:$COMP_CWORD-1}")
local compline="${compwords[*]}"
if [ "${#COMP_WORDS[@]}" -gt "2" ] && echo "${COMP_WORDS[@]}" | grep -q 'shear'; then
return
elif [ "${#COMP_WORDS[@]}" -gt "3" ] && (! echo "${COMP_WORDS[@]}" | grep -q '/' || echo "${COMP_WORDS[@]}" | grep -q 'shear'); then
return
elif [ "${#COMP_WORDS[@]}" -gt "4" ]; then
return
fi
if [[ "$compline" == *'edit'* ]]; then
while read -r; do COMPREPLY+=( "$REPLY" ); done < <( compgen -W "relocate username password note url" -- "$cur" )
elif [[ "$compline" == *'copy'* ]]; then
while read -r; do COMPREPLY+=( "$REPLY" ); done < <( compgen -W "username password url note" -- "$cur" )
elif [[ "$compline" == *'add'* ]]; then
while read -r; do COMPREPLY+=( "$REPLY" ); done < <( compgen -W "password note folder" -- "$cur" )
elif [[ "$compline" == *'gen'* ]]; then
while read -r; do COMPREPLY+=( "$REPLY" ); done < <( compgen -W "update" -- "$cur" )
elif [[ "$compline" == '/'* ]]; then
while read -r; do COMPREPLY+=( "$REPLY" ); done < <( compgen -W "add gen edit copy shear" -- "$cur" )
else
while read -r; do ITEM=${REPLY// /\\ }; COMPREPLY+=( "$ITEM" ); done < <( compgen -W "help version tweak add gen edit copy shear sync $(printf "'%s' " "${trimmed_paths[@]}")" -- "$cur" )
fi
} &&
_path_gen && complete -F _sshyp_completions sshyp
+1 -1
View File
@@ -329,7 +329,7 @@ def print_info(): # prints help text based on argument
'randall winkhart\u001b[38;5;15;48;5;15m \u001b[38;5;7;48;5;8m/\u001b[0m') 'randall winkhart\u001b[38;5;15;48;5;15m \u001b[38;5;7;48;5;8m/\u001b[0m')
print('\u001b[38;5;7;48;5;8m/\u001b[38;5;15;48;5;15m ' print('\u001b[38;5;7;48;5;8m/\u001b[38;5;15;48;5;15m '
'\u001b[38;5;7;48;5;8m/\u001b[0m') '\u001b[38;5;7;48;5;8m/\u001b[0m')
print('\u001b[38;5;7;48;5;8m/\u001b[38;5;15;48;5;15m \u001b[38;5;15;48;5;8mversion 1.4.0' print('\u001b[38;5;7;48;5;8m/\u001b[38;5;15;48;5;15m \u001b[38;5;15;48;5;8mversion 1.4.1'
'\u001b[38;5;15;48;5;15m \u001b[38;5;7;48;5;8m/\u001b[0m') '\u001b[38;5;15;48;5;15m \u001b[38;5;7;48;5;8m/\u001b[0m')
print('\u001b[38;5;7;48;5;8m/\u001b[38;5;15;48;5;15m \u001b[38;5;15;48;5;8mthe argumentative ' print('\u001b[38;5;7;48;5;8m/\u001b[38;5;15;48;5;15m \u001b[38;5;15;48;5;8mthe argumentative '
'agronomist update\u001b[38;5;15;48;5;15m \u001b[38;5;7;48;5;8m/\u001b[0m') 'agronomist update\u001b[38;5;15;48;5;15m \u001b[38;5;7;48;5;8m/\u001b[0m')
+116 -67
View File
@@ -1,4 +1,4 @@
#!/usr/bin/env bash #!/bin/sh
version=$(sed -n '1{p;q}' share/doc/sshyp/changelog | cut -c8-) version=$(sed -n '1{p;q}' share/doc/sshyp/changelog | cut -c8-)
if [ -z "$2" ]; then if [ -z "$2" ]; then
@@ -8,25 +8,29 @@ else
fi fi
_create_generic() { _create_generic() {
echo -e '\npackaging as generic...\n' printf '\npackaging as generic...\n'
mkdir -p output/generictemp/usr/{bin,lib/sshyp/extensions,share/{man/man1,bash-completion/completions}} 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/ cp -r lib/. output/generictemp/usr/lib/sshyp/
ln -s /usr/lib/sshyp/sshyp.py output/generictemp/usr/bin/sshyp ln -s /usr/lib/sshyp/sshyp.py output/generictemp/usr/bin/sshyp
cp -r share output/generictemp/usr/ 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 cp extra/manpage output/generictemp/usr/share/man/man1/sshyp.1
gzip 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 rm -rf output/generictemp
sha512="$(sha512sum output/sshyp-"$version".tar.xz | awk '{print $1;}')" sha512="$(sha512sum output/GENERIC-sshyp-"$version".tar.xz | awk '{print $1;}')"
echo -e "\nsha512 sum:\n$sha512" printf '\ngeneric packaging complete\n\n'
echo -e "\ngeneric packaging complete\n"
} && } &&
_create_pkgbuild() { _create_pkgbuild() {
source='https://github.com/rwinkhart/sshyp/releases/download/v$pkgver/sshyp-$pkgver.tar.xz' local source='https://github.com/rwinkhart/sshyp/releases/download/v$pkgver/GENERIC-sshyp-$pkgver.tar.xz'
echo -e '\ngenerating PKGBUILD...' printf '\ngenerating PKGBUILD...\n'
echo "# Maintainer: Randall Winkhart <idgr at tutanota dot com> printf "# Maintainer: Randall Winkhart <idgr at tutanota dot com>
pkgname=sshyp pkgname=sshyp
pkgver="$version" pkgver="$version"
pkgrel="$revision" pkgrel="$revision"
@@ -40,15 +44,16 @@ source=(\""$source"\")
sha512sums=('"$sha512"') sha512sums=('"$sha512"')
package() { package() {
tar xf sshyp-"\"\$pkgver\"".tar.xz -C "\"\${pkgdir}\"" tar xf GENERIC-sshyp-"\"\$pkgver\"".tar.xz -C "\"\${pkgdir}\""
} }
" > output/PKGBUILD " > output/PKGBUILD
echo -e "\nPKGBUILD generated\n" printf '\nPKGBUILD generated\n\n'
} && } &&
_create_apkbuild() { _create_apkbuild() {
echo -e '\ngenerating APKBUILD...' local source='https://github.com/rwinkhart/sshyp/releases/download/v$pkgver/GENERIC-sshyp-$pkgver.tar.xz'
echo "# Maintainer: Randall Winkhart <idgr@tutanota.com> printf '\ngenerating APKBUILD...\n'
printf "# Maintainer: Randall Winkhart <idgr@tutanota.com>
pkgname=sshyp pkgname=sshyp
pkgver="$version" pkgver="$version"
pkgrel="$((revision-1))" pkgrel="$((revision-1))"
@@ -62,20 +67,28 @@ source=\""$source"\"
package() { package() {
mkdir -p "\"\$pkgdir\"" 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\"" cp -r "\"\$srcdir/usr/"\" "\"\$pkgdir\""
} }
sha512sums=\" sha512sums=\"
"$sha512' 'sshyp-\"\$pkgver\".tar.xz" "$sha512' 'GENERIC-sshyp-\"\$pkgver\".tar.xz"
\" \"
" > output/APKBUILD " > output/APKBUILD
echo -e "\nAPKBUILD generated\n" printf '\nAPKBUILD generated\n\n'
} && } &&
_create_hpkg() { _create_hpkg() {
echo -e '\npackaging for Haiku...\n' printf '\npackaging for Haiku...\n'
mkdir -p output/haikutemp/{bin,lib/sshyp/extensions,documentation/{packages/sshyp,man/man1},data/bash-completion/completions} mkdir -p output/haikutemp/bin \
echo "name sshyp 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" version "$version"-"$revision"
architecture any architecture any
summary \"A light-weight, self-hosted, synchronized password manager\" summary \"A light-weight, self-hosted, synchronized password manager\"
@@ -86,7 +99,7 @@ licenses {
\"GNU GPL v3\" \"GNU GPL v3\"
} }
copyrights { copyrights {
\"2021-2022 Randall Winkhart\" \"2021-2023 Randall Winkhart\"
} }
provides { provides {
sshyp = "$version" sshyp = "$version"
@@ -107,22 +120,28 @@ urls {
ln -s /system/lib/sshyp/sshyp.py output/haikutemp/bin/sshyp ln -s /system/lib/sshyp/sshyp.py output/haikutemp/bin/sshyp
cp -r share/doc/sshyp/. output/haikutemp/documentation/packages/sshyp/ cp -r share/doc/sshyp/. output/haikutemp/documentation/packages/sshyp/
cp -r share/licenses/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 cp extra/manpage output/haikutemp/documentation/man/man1/sshyp.1
gzip output/haikutemp/documentation/man/man1/sshyp.1 gzip output/haikutemp/documentation/man/man1/sshyp.1
cd output/haikutemp cd output/haikutemp
package create -b sshyp-"$version"-"$revision"_all.hpkg package create -b HAIKU-sshyp-"$version"-"$revision"_all.hpkg
package add sshyp-"$version"-"$revision"_all.hpkg bin lib documentation data package add HAIKU-sshyp-"$version"-"$revision"_all.hpkg bin lib documentation data
cd ../.. cd ../..
mv output/haikutemp/sshyp-"$version"-"$revision"_all.hpkg output/ mv output/haikutemp/HAIKU-sshyp-"$version"-"$revision"_all.hpkg output/
rm -rf output/haikutemp rm -rf output/haikutemp
echo -e "\nHaiku packaging complete\n" printf '\nHaiku packaging complete\n\n'
} && } &&
_create_deb() { _create_deb() {
echo -e '\npackaging for Debian/Ubuntu...\n' printf '\npackaging for Debian/Ubuntu...\n'
mkdir -p output/debiantemp/sshyp_"$version"-"$revision"_all/{DEBIAN,usr/{lib/sshyp/extensions,bin,share/{bash-completion/completions,man/man1}}} mkdir -p output/debiantemp/sshyp_"$version"-"$revision"_all/DEBIAN \
echo "Package: sshyp 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 Version: $version
Section: utils Section: utils
Architecture: all Architecture: all
@@ -136,19 +155,25 @@ Installed-Size: 14584
cp -r lib/. output/debiantemp/sshyp_"$version"-"$revision"_all/usr/lib/sshyp/ 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 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 -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 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 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/ 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 rm -rf output/debiantemp
echo -e "\nDebian/Ubuntu packaging complete\n" printf '\nDebian/Ubuntu packaging complete\n\n'
} && } &&
_create_termux() { _create_termux() {
echo -e '\npackaging for Termux...\n' printf '\npackaging for Termux...\n'
mkdir -p output/termuxtemp/sshyp_"$version"-"$revision"_all_termux/{DEBIAN,data/data/com.termux/files/usr/{lib/sshyp/extensions,bin,share/{bash-completion/completions,man/man1}}} mkdir -p output/termuxtemp/sshyp_"$version"-"$revision"_all_termux/DEBIAN \
echo "Package: sshyp 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 Version: $version
Section: utils Section: utils
Architecture: all 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/ 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 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 -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 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 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/ 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 rm -rf output/termuxtemp
echo -e "\nTermux packaging complete\n" printf '\nTermux packaging complete\n\n'
} && } &&
_create_rpm() { _create_rpm() {
echo -e '\npackaging for Fedora...\n' printf '\npackaging for Fedora...\n'
rm -rf ~/rpmbuild rm -rf ~/rpmbuild
rpmdev-setuptree rpmdev-setuptree
cp output/sshyp-"$version".tar.xz ~/rpmbuild/SOURCES cp output/GENERIC-sshyp-"$version".tar.xz ~/rpmbuild/SOURCES
echo "Name: sshyp printf "Name: sshyp
Version: "$version" Version: "$version"
Release: "$revision" Release: "$revision"
Summary: A light-weight, self-hosted, synchronized password manager Summary: A light-weight, self-hosted, synchronized password manager
BuildArch: noarch BuildArch: noarch
License: GPL-3.0-only License: GPL-3.0-only
URL: https://github.com/rwinkhart/sshyp URL: https://github.com/rwinkhart/sshyp
Source0: sshyp-"$version".tar.xz Source0: GENERIC-sshyp-"$version".tar.xz
Requires: python gnupg openssh-clients wl-clipboard Requires: python gnupg openssh-clients wl-clipboard
Recommends: bash-completion Recommends: bash-completion
%description %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. 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 %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} cp -r %{_sourcedir}/usr %{buildroot}
%files %files
/usr/bin/sshyp /usr/bin/sshyp
/usr/lib/sshyp/sshyp.py /usr/lib/sshyp/sshyp.py
/usr/lib/sshyp/sshync.py /usr/lib/sshyp/sshync.py
/usr/share/bash-completion/completions/sshyp /usr/share/bash-completion/completions/sshyp
/usr/share/zsh/functions/Completion/Unix/_sshyp
%license /usr/share/licenses/sshyp/license %license /usr/share/licenses/sshyp/license
%doc %doc
/usr/share/doc/sshyp/changelog /usr/share/doc/sshyp/changelog
/usr/share/man/man1/sshyp.1.gz /usr/share/man/man1/sshyp.1.gz
" > ~/rpmbuild/SPECS/sshyp.spec " > ~/rpmbuild/SPECS/sshyp.spec
rpmbuild -bb ~/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 rm -rf ~/rpmbuild
echo -e "\nFedora packaging complete\n" printf '\nFedora packaging complete\n\n'
} && } &&
_create_freebsd_pkg() { _create_freebsd_pkg() {
echo -e '\npackaging for FreeBSD...' printf '\npackaging for FreeBSD...\n'
mkdir -p output/freebsdtemp/usr/{lib/sshyp/extensions,bin,share/man/man1,local/share/bash-completion/completions} mkdir -p output/freebsdtemp/usr/lib/sshyp/extensions \
echo "name: sshyp 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"\" version: \""$version"\"
abi = \"FreeBSD:13:*\"; abi = \"FreeBSD:13:*\";
arch = \"freebsd:13:*\"; arch = \"freebsd:13:*\";
@@ -235,10 +266,11 @@ prefix: /
}, },
}, },
" > output/freebsdtemp/+MANIFEST " > output/freebsdtemp/+MANIFEST
echo "/usr/bin/sshyp printf "/usr/bin/sshyp
/usr/lib/sshyp/sshync.py /usr/lib/sshyp/sshync.py
/usr/lib/sshyp/sshyp.py /usr/lib/sshyp/sshyp.py
/usr/local/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/doc/sshyp/changelog
/usr/share/licenses/sshyp/license /usr/share/licenses/sshyp/license
/usr/share/man/man1/sshyp.1.gz /usr/share/man/man1/sshyp.1.gz
@@ -246,44 +278,61 @@ echo "/usr/bin/sshyp
cp -r lib/. output/freebsdtemp/usr/lib/sshyp/ cp -r lib/. output/freebsdtemp/usr/lib/sshyp/
ln -s /usr/lib/sshyp/sshyp.py output/freebsdtemp/usr/bin/sshyp ln -s /usr/lib/sshyp/sshyp.py output/freebsdtemp/usr/bin/sshyp
cp -r share output/freebsdtemp/usr/ cp -r share output/freebsdtemp/usr/
cp extra/sshyp-completion.bash output/freebsdtemp/usr/local/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 cp extra/manpage output/freebsdtemp/usr/share/man/man1/sshyp.1
gzip 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/ 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 rm -rf output/freebsdtemp
echo -e "\nFreeBSD packaging complete\n" printf '\nFreeBSD packaging complete\n\n'
} && } &&
if [ "$1" == "generic" ]; then # build scripts case "$1" in
generic)
_create_generic _create_generic
elif [ "$1" == "pkgbuild" ]; then ;;
pkgbuild)
_create_generic _create_generic
_create_pkgbuild _create_pkgbuild
elif [ "$1" == "apkbuild" ]; then ;;
apkbuild)
_create_generic _create_generic
_create_apkbuild _create_apkbuild
elif [ "$1" == "haiku" ]; then # distribution packages ;;
haiku)
_create_hpkg _create_hpkg
elif [ "$1" == "debian" ]; then ;;
debian)
_create_deb _create_deb
elif [ "$1" == "termux" ]; then ;;
termux)
_create_termux _create_termux
elif [ "$1" == "fedora" ]; then ;;
fedora)
_create_generic _create_generic
_create_rpm _create_rpm
elif [ "$1" == "freebsd" ]; then ;;
freebsd)
_create_freebsd_pkg _create_freebsd_pkg
elif [ "$1" == "buildable-arch" ]; then ;;
buildable-arch)
_create_generic _create_generic
_create_pkgbuild _create_pkgbuild
_create_apkbuild _create_apkbuild
if [[ $(pacman -Q dpkg) == "dpkg"* ]]; then case "$(pacman -Q dpkg)" in
dpkg*)
_create_deb _create_deb
_create_termux _create_termux
fi ;;
if [[ "$(pacman -Q freebsd-pkg)" == "freebsd-pkg"* ]]; then esac
case "$(pacman -Q freebsd-pkg)" in
freebsd-pkg*)
_create_freebsd_pkg _create_freebsd_pkg
fi ;;
else esac
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 *)
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
+8 -38
View File
@@ -1,52 +1,22 @@
sshyp v1.4.0 sshyp v1.4.1
the argumentative agronomist update the argumentative agronomist update - patch one
this release overhauls sshyp's argument system and further streamlines this release improves sshyp's shell completions by adding zsh support and significantly optimizing and improving Bash support
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: user-facing features:
- when typing an entry/folder name, it is now always the FIRST argument - zsh completion support
^ e.g. instead of "sshyp copy -p /example/test", it would now be "sshyp /example/test copy -p" ^ ensure modern completions are enabled in your ~/.zshrc
^ 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: fixes/optimizations:
- replaced "+=" with ".append" when extending lists to prevent creating an additional list - Bash completions are now much faster due to the use of recursive globbing
- optimized usage of "str.split()" and replaced it with "str.splitlines()" where applicable - Bash completions have been modified to be functionally similar to the new zsh completions
- 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: other notable changes:
- removed some uncommonly used, redundant arguments - some official packages now use more space-efficient compression
^ 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
<><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><> <><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><>