mirror of
https://github.com/rwinkhart/sshyp.git
synced 2026-08-29 05:16:27 -04:00
Fxed sync and remote entry deletion
This commit is contained in:
@@ -1,17 +1,17 @@
|
||||
# Maintainer: Randall Winkhart <idgr at tutanota dot com>
|
||||
|
||||
pkgname=rpass
|
||||
pkgver=2021.09.15.mr4.1
|
||||
pkgver=2021.09.15.mr4.2
|
||||
pkgrel=1
|
||||
pkgdesc="An rsync-based password manager and alternative to GNU pass"
|
||||
arch=('x86_64' 'aarch64')
|
||||
license=('GPL3')
|
||||
depends=( python gnupg openssh rsync xclip wl-clipboard)
|
||||
|
||||
source_x86_64=('https://github.com/rwinkhart/rpass/releases/download/v2021.09.15.mr4.1/rpass-2021.09.15.mr4.1.tar.xz')
|
||||
source_aarch64=('https://github.com/rwinkhart/rpass/releases/download/v2021.09.15.mr4.1/rpass-2021.09.15.mr4.1.tar.xz')
|
||||
sha512sums_x86_64=('fb162031b2bff1896a4ae2c6c78889ead6c278ec7e5cb6134ec8ccf08004bf87f38839f0cab952ce2047c53a075b0802ec882410048b04b4ababc89a68de71f8')
|
||||
sha512sums_aarch64=('fb162031b2bff1896a4ae2c6c78889ead6c278ec7e5cb6134ec8ccf08004bf87f38839f0cab952ce2047c53a075b0802ec882410048b04b4ababc89a68de71f8')
|
||||
source_x86_64=('https://github.com/rwinkhart/rpass/releases/download/v2021.09.15.mr4.1/rpass-2021.09.15.mr4.2.tar.xz')
|
||||
source_aarch64=('https://github.com/rwinkhart/rpass/releases/download/v2021.09.15.mr4.1/rpass-2021.09.15.mr4.2.tar.xz')
|
||||
sha512sums_x86_64=('f3948d7c6e26f53d19a08db32ba7f7a3576d0386dea2338ff529cb3ee72365c3d405d6de5c812b398e87b8fe50b765a4fc2bcc899fe09cef9d2db44c7978d6bf')
|
||||
sha512sums_aarch64=('f3948d7c6e26f53d19a08db32ba7f7a3576d0386dea2338ff529cb3ee72365c3d405d6de5c812b398e87b8fe50b765a4fc2bcc899fe09cef9d2db44c7978d6bf')
|
||||
|
||||
package() {
|
||||
|
||||
|
||||
@@ -101,7 +101,7 @@ if argument == 'version' or argument == '-v':
|
||||
print('/ /')
|
||||
print('/ rpass Copyright (C) 2021 Randall Winkhart /')
|
||||
print('/ /')
|
||||
print('/ Version 2021.09.15.mr4.1 /')
|
||||
print('/ Version 2021.09.15.mr4.2 /')
|
||||
print('/ The Housekeeping Update (Pt. 1) /')
|
||||
print('/ /')
|
||||
print('////////////////////////////////////////////////////////\n')
|
||||
@@ -169,6 +169,7 @@ if argument == 'config':
|
||||
f.write('\n\n\n\n' + devicetype)
|
||||
print('\nConfiguration complete!\n')
|
||||
elif devicetype != 's' and devicetype != 'S':
|
||||
devicetype = 'c'
|
||||
print('\nMake sure the ssh service on the remote server is running and properly configured.\n')
|
||||
sshgen = str(input('rsync support requires a unique ssh key. Would you like to have this '
|
||||
'automatically generated? (Y/n) '))
|
||||
@@ -206,10 +207,10 @@ if argument == '':
|
||||
try:
|
||||
sshinfo = open("/var/lib/rpass/rpass-ssh").readlines()
|
||||
usernamessh = sshinfo[0].replace('\n', '')
|
||||
ip = (sshinfo[1].replace('\n', ''))
|
||||
port = (sshinfo[2].replace('\n', ''))
|
||||
directoryssh = (sshinfo[3].replace('\n', ''))
|
||||
devicetype = (sshinfo[4].replace('\n', ''))
|
||||
ip = sshinfo[1].replace('\n', '')
|
||||
port = sshinfo[2].replace('\n', '')
|
||||
directoryssh = sshinfo[3].replace('\n', '')
|
||||
devicetype = sshinfo[4].replace('\n', '')
|
||||
except (FileNotFoundError, IndexError):
|
||||
usernamessh, ip, port, directoryssh, devicetype = (0, 0, 0, 0, 0)
|
||||
try:
|
||||
@@ -759,19 +760,19 @@ if argument == 'remove' or argument == '-rm':
|
||||
entryname = str(input('What would you like to delete? '))
|
||||
if entryname.startswith('/'):
|
||||
if entryname.replace('/', '', 1).__contains__('/'):
|
||||
if devicetype == 'c' or devicetype == 'C':
|
||||
term('ssh -p ' + port + '' + usernamessh + '@' + ip + ' rm -rf ' + "'" + directoryssh + "'" +
|
||||
entryname.replace('/', '', 1) + '.gpg')
|
||||
if devicetype == 'c':
|
||||
term('ssh -p ' + port + ' ' + usernamessh + '@' + ip + ' "' + ' rm -rf ' + "'" + directoryssh +
|
||||
entryname.replace('/', '', 1) + '.gpg' + "'" + '"')
|
||||
remove(directory + entryname.replace('/', '', 1) + '.gpg')
|
||||
else:
|
||||
if devicetype == 'c' or devicetype == 'C':
|
||||
term('ssh -p ' + port + '' + usernamessh + '@' + ip + ' rm -rf ' + "'" + directoryssh + "'" +
|
||||
entryname.replace('/', '', 1))
|
||||
if devicetype == 'c':
|
||||
term('ssh -p ' + port + ' ' + usernamessh + '@' + ip + ' "' + ' rm -rf ' + "'" + directoryssh +
|
||||
entryname.replace('/', '', 1) + "'" + '"')
|
||||
rmtree(directory + entryname.replace('/', '', 1))
|
||||
else:
|
||||
if devicetype == 'c' or devicetype == 'C':
|
||||
term('ssh -p ' + port + ' ' + usernamessh + '@' + ip + ' rm -rf ' + "'" + directoryssh + "'" +
|
||||
entryname + '.gpg')
|
||||
if devicetype == 'c':
|
||||
term('ssh -p ' + port + ' ' + usernamessh + '@' + ip + ' "' + ' rm -rf ' + "'" + directoryssh +
|
||||
entryname + '.gpg' + "'" + '"')
|
||||
remove(directory + entryname + '.gpg')
|
||||
except KeyboardInterrupt:
|
||||
print('\n\nDeletion cancelled.\n')
|
||||
@@ -800,11 +801,11 @@ term('find ' + directory + ' -type d -exec chmod -R 700 {} +')
|
||||
term('find ' + directory + ' -type f -exec chmod -R 600 {} +')
|
||||
|
||||
# rsync - ran at end of program to ensure all files are properly synced
|
||||
if devicetype == 'c' or devicetype == 'C':
|
||||
if devicetype == 'c':
|
||||
if argument.__contains__('add') or argument.__contains__('-rm') or argument.__contains__('remove') or argument. \
|
||||
__contains__('edit') or argument.__contains__('gen') or argument == 'sync' or argument == '-s':
|
||||
print('Syncing entries with other device(s)...\n')
|
||||
term('rsync -v -H -r -l -t -p -e ' + '"ssh -i ~/.ssh/rpass -p ' + port + '" ' + directory + ' ' + usernamessh
|
||||
+ '@' + ip + ':' + directoryssh)
|
||||
term('rsync -v -H -r -l -t -p -e ' + '"ssh -i ~/.ssh/rpass -p ' + port + '" ' + directory + ' ' +
|
||||
usernamessh + '@' + ip + ':' + directoryssh)
|
||||
term('rsync -v -H -r -l -t -p --delete -e ' + '"ssh -i ~/.ssh/rpass -p ' + port + '" ' + usernamessh
|
||||
+ '@' + ip + ':' + directoryssh + ' ' + directory)
|
||||
|
||||
@@ -1,5 +1,16 @@
|
||||
<><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><>
|
||||
|
||||
rpass 2021.09.15.mr4.2
|
||||
|
||||
The Housekeeping Update (Pt. 1) - Hotfix 2
|
||||
|
||||
Changes:
|
||||
|
||||
- sync support is fixed
|
||||
- files with spaces in their names can now be properly deleted from remote servers
|
||||
|
||||
<><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><>
|
||||
|
||||
rpass 2021.09.15.mr4.1
|
||||
|
||||
The Housekeeping Update (Pt. 1) - Hotfix
|
||||
|
||||
Reference in New Issue
Block a user