Compare commits

...
4 changed files with 167 additions and 90 deletions
+8 -7
View File
@@ -1,17 +1,18 @@
# Maintainer: Randall Winkhart <idgr at tutanota dot com> # Maintainer: Randall Winkhart <idgr at tutanota dot com>
pkgname=rpass pkgname=rpass
pkgver=2021.09.15.mr4.1 pkgver=2021.10.07.mr5
pkgrel=1 pkgrel=1
pkgdesc="An rsync-based password manager and alternative to GNU pass" pkgdesc='An rsync-based password manager and alternative to GNU pass'
url='https://github.com/rwinkhart/rpass'
arch=('x86_64' 'aarch64') arch=('x86_64' 'aarch64')
license=('GPL3') license=('GPL3')
depends=( python gnupg openssh rsync xclip wl-clipboard) depends=( python gnupg openssh rsync nano 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_x86_64=('https://github.com/rwinkhart/rpass/releases/download/v"$pkgver"/rpass-"$pkgver".tar.xz')
source_aarch64=('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/v"$pkgver"/rpass-"$pkgver".tar.xz')
sha512sums_x86_64=('fb162031b2bff1896a4ae2c6c78889ead6c278ec7e5cb6134ec8ccf08004bf87f38839f0cab952ce2047c53a075b0802ec882410048b04b4ababc89a68de71f8') sha512sums_x86_64=('a1600816cd37fa7055f603dd9fa3f0a4d1f37505083ebb93d30270536f87666718c45bf995c89af6c425af5fcd93bba2ac3df12d83eea6dc3207c4030d55d46b')
sha512sums_aarch64=('fb162031b2bff1896a4ae2c6c78889ead6c278ec7e5cb6134ec8ccf08004bf87f38839f0cab952ce2047c53a075b0802ec882410048b04b4ababc89a68de71f8') sha512sums_aarch64=('a1600816cd37fa7055f603dd9fa3f0a4d1f37505083ebb93d30270536f87666718c45bf995c89af6c425af5fcd93bba2ac3df12d83eea6dc3207c4030d55d46b')
package() { package() {
-1
View File
@@ -36,7 +36,6 @@ Short-term Goals:
- create new file list w/color and w/o file extensions - create new file list w/color and w/o file extensions
- create a man page - create a man page
- allow for multi-line notes
- overhaul argument system - overhaul argument system
- fix lots of bugs! - fix lots of bugs!
+106 -82
View File
@@ -8,11 +8,13 @@ from os import environ
from shutil import move from shutil import move
from shutil import rmtree from shutil import rmtree
from sys import argv from sys import argv
from re import search
from re import escape
import random import random
import string import string
# custom modules
# custom modules
def clear(): def clear():
print('\n' * 100) print('\n' * 100)
@@ -22,12 +24,25 @@ def term(cmd):
_ = system(cmd) _ = system(cmd)
def string_found(string1, string2):
if search(r"\b" + escape(string1) + r"\b", string2):
return True
return False
def replace_line(file_name, line_num, text): def replace_line(file_name, line_num, text):
lines = open(file_name, 'r').readlines() xlines = open(file_name, 'r').readlines()
lines[line_num] = text xlines[line_num] = text
out = open(file_name, 'w') open(file_name, 'w').writelines(xlines)
out.writelines(lines)
out.close()
def edit_note():
lines = open('/dev/shm/' + shmfolder + '/' + shmentry).readlines()
open('/dev/shm/' + shmfolder + '/' + shmentry, 'w').writelines(lines[0:3])
open('/dev/shm/' + shmfolder + '/' + shmentry + '-n', 'w').writelines(lines[4:-2])
term('nano /dev/shm/' + shmfolder + '/' + shmentry + '-n')
edit_notes = open('/dev/shm/' + shmfolder + '/' + shmentry + '-n').read()
open('/dev/shm/' + shmfolder + '/' + shmentry, 'a').write('\n' + edit_notes + '\n\n')
def shmgen(): def shmgen():
@@ -101,8 +116,8 @@ if argument == 'version' or argument == '-v':
print('/ /') print('/ /')
print('/ rpass Copyright (C) 2021 Randall Winkhart /') print('/ rpass Copyright (C) 2021 Randall Winkhart /')
print('/ /') print('/ /')
print('/ Version 2021.09.15.mr4.1 /') print('/ Version 2021.10.07.mr5 /')
print('/ The Housekeeping Update (Pt. 1) /') print('/ The Notetaker Update /')
print('/ /') print('/ /')
print('////////////////////////////////////////////////////////\n') print('////////////////////////////////////////////////////////\n')
@@ -130,27 +145,24 @@ if argument == 'config':
if directorychoice == 'n' or directorychoice == 'N': if directorychoice == 'n' or directorychoice == 'N':
print('\nFormat: /this/path/ends/with/a/slash/\n') print('\nFormat: /this/path/ends/with/a/slash/\n')
directory = str(input('Please input a custom directory: ')) directory = str(input('Please input a custom directory: '))
with open("/var/lib/rpass/rpass-dir", 'w') as f: open("/var/lib/rpass/rpass-dir", 'w').write(directory + '\n')
f.write(directory + '\n')
else: else:
with open("/var/lib/rpass/rpass-dir", 'w') as f: open("/var/lib/rpass/rpass-dir", 'w').write('/home/' + environ.get('USER') + '/.rpass-store/' + '\n')
f.write('/home/' + environ.get('USER') + '/.rpass-store/' + '\n')
print() print()
devicetype = str(input('Will this be a client, server, or offline device? (C/s/o) ')) devicetype = str(input('Will this be a client, server, or offline device? (C/s/o) '))
if devicetype == 's' or devicetype == 'S': if devicetype == 's' or devicetype == 'S':
with open("/var/lib/rpass/rpass-ssh", 'w') as f: open("/var/lib/rpass/rpass-ssh", 'w').write('\n\n\n\n' + devicetype)
f.write('\n\n\n\n' + devicetype)
print('\nMake sure the ssh service is running and properly configured.\n') print('\nMake sure the ssh service is running and properly configured.\n')
print('Configuration complete!\n') print('Configuration complete!\n')
else: else:
gpgid = ''
print() print()
gpgpresent = str(input( gpgpresent = str(input(
'rpass requires the use of a unique gpg key. Do you already have one you are willing to use? (y/N) ')) 'rpass requires the use of a unique gpg key. Do you already have one you are willing to use? (y/N) '))
if gpgpresent == 'y' or gpgpresent == 'Y': if gpgpresent == 'y' or gpgpresent == 'Y':
print() print()
gpgid = str(input('Please input the ID of your gpg key: ')) gpgid = str(input('Please input the ID of your gpg key: '))
with open("/var/lib/rpass/rpass-gpg", 'w') as f: open("/var/lib/rpass/rpass-gpg", 'w').write(gpgid + '\n')
f.write(gpgid + '\n')
else: else:
print() print()
gpggen = str( gpggen = str(
@@ -162,18 +174,23 @@ if argument == 'config':
term('gpg --full-generate-key') term('gpg --full-generate-key')
print() print()
gpgid = str(input('Please input the ID of your gpg key: ')) gpgid = str(input('Please input the ID of your gpg key: '))
with open("/var/lib/rpass/rpass-gpg", 'w') as f: open("/var/lib/rpass/rpass-gpg", 'w').write(gpgid + '\n')
f.write(gpgid + '\n') try:
open('/var/lib/rpass/lock', 'x').write('locked')
except FileExistsError:
pass
term('gpg -r ' + str(gpgid) + ' -e ' + '/var/lib/rpass/lock')
remove('/var/lib/rpass/lock')
if devicetype == 'o' or devicetype == 'O': if devicetype == 'o' or devicetype == 'O':
with open("/var/lib/rpass/rpass-ssh", 'w') as f: open("/var/lib/rpass/rpass-ssh", 'w').write('\n\n\n\n' + devicetype)
f.write('\n\n\n\n' + devicetype)
print('\nConfiguration complete!\n') print('\nConfiguration complete!\n')
elif devicetype != 's' and devicetype != 'S': elif devicetype != 's' and devicetype != 'S':
devicetype = 'c'
print('\nMake sure the ssh service on the remote server is running and properly configured.\n') 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 ' sshgen = str(input('rsync support requires a unique ssh key. Would you like to have this '
'automatically generated? (Y/n) ')) 'automatically generated? (Y/n) '))
if sshgen != 'n' and sshgen != 'N': if sshgen != 'n' and sshgen != 'N':
term('ssh-keygen -f ~/.ssh/rpass') term('ssh-keygen -t ed25519 -f ~/.ssh/rpass')
print('\nExample input: 10.10.10.10:9999\n') print('\nExample input: 10.10.10.10:9999\n')
ip_port = str(input('What is the IP and ssh port of the remote server? ')) ip_port = str(input('What is the IP and ssh port of the remote server? '))
print() print()
@@ -186,14 +203,13 @@ if argument == 'config':
directoryssh = str(input('What directory is the server using?: ')) directoryssh = str(input('What directory is the server using?: '))
else: else:
directoryssh = ('/home/' + usernamessh + '/.rpass-store/') directoryssh = ('/home/' + usernamessh + '/.rpass-store/')
with open("/var/lib/rpass/rpass-ssh", 'w') as f: open("/var/lib/rpass/rpass-ssh", 'w').write(usernamessh + '\n' + ip + '\n' + port + '\n' + directoryssh +
f.write(usernamessh + '\n' + ip + '\n' + port + '\n' + directoryssh + '\n' + devicetype) '\n' + devicetype)
print('\nConfiguration complete!\n') print('\nConfiguration complete!\n')
except KeyboardInterrupt: except KeyboardInterrupt:
print('\n\nConfiguration cancelled.\n') print('\n\nConfiguration cancelled.\n')
exit() exit()
# startup help # startup help
if argument == '': if argument == '':
@@ -206,17 +222,16 @@ if argument == '':
try: try:
sshinfo = open("/var/lib/rpass/rpass-ssh").readlines() sshinfo = open("/var/lib/rpass/rpass-ssh").readlines()
usernamessh = sshinfo[0].replace('\n', '') usernamessh = sshinfo[0].replace('\n', '')
ip = (sshinfo[1].replace('\n', '')) ip = sshinfo[1].replace('\n', '')
port = (sshinfo[2].replace('\n', '')) port = sshinfo[2].replace('\n', '')
directoryssh = (sshinfo[3].replace('\n', '')) directoryssh = sshinfo[3].replace('\n', '')
devicetype = (sshinfo[4].replace('\n', '')) devicetype = sshinfo[4].replace('\n', '')
except (FileNotFoundError, IndexError): except (FileNotFoundError, IndexError):
usernamessh, ip, port, directoryssh, devicetype = (0, 0, 0, 0, 0) usernamessh, ip, port, directoryssh, devicetype = (0, 0, 0, 0, 0)
directory = ''
try: try:
with open("/var/lib/rpass/rpass-gpg") as f: gpgid = open("/var/lib/rpass/rpass-gpg").read().strip()
gpgid = f.read().strip() directory = open("/var/lib/rpass/rpass-dir").read().strip()
with open("/var/lib/rpass/rpass-dir") as f:
directory = f.read().strip()
term('mkdir -p ' + directory) term('mkdir -p ' + directory)
except FileNotFoundError: except FileNotFoundError:
print('\n!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!') print('\n!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!')
@@ -262,28 +277,26 @@ if argument == 'add note' or argument == 'add -n':
try: try:
clear() clear()
entryname = str(input('Name of note: ')) entryname = str(input('Name of note: '))
notes = str(input('Contents of note: '))
except KeyboardInterrupt: except KeyboardInterrupt:
entryname, notes = (0, 0) entryname, notes = (0, 0)
print('\n\nEntry add cancelled.\n') print('\n\nEntry add cancelled.\n')
exit() exit()
shmfolder, shmentry = shmgen() shmfolder, shmentry = shmgen()
term('nano /dev/shm/' + shmfolder + '/' + shmentry + '-n')
notes = open('/dev/shm/' + shmfolder + '/' + shmentry + '-n', 'r').read()
try: try:
if entryname.startswith('/'): if entryname.startswith('/'): # check if user input contains slashes
if entryname.replace('/', '', 1).__contains__('/'): if entryname.replace('/', '', 1).__contains__('/'): # create folder and entry if there are two slashes
folder, sep, folderentry = entryname.replace('/', '', 1).partition('/') folder, sep, folderentry = entryname.replace('/', '', 1).partition('/')
with open('/dev/shm/' + shmfolder + '/' + shmentry, 'w') as f: open('/dev/shm/' + shmfolder + '/' + shmentry, 'w').writelines('\n\n\n\n' + notes + '\n\n')
f.writelines('\n\n\n' + notes + '\n\n')
encryptfolder() encryptfolder()
term('gpg -d ' + directory + folder + '/' + "'" + folderentry + '.gpg' + "'") term('gpg -d ' + directory + folder + '/' + "'" + folderentry + '.gpg' + "'")
else: else: # create entry if there is only one slash
with open('/dev/shm/' + shmfolder + '/' + shmentry, 'w') as f: open('/dev/shm/' + shmfolder + '/' + shmentry, 'w').writelines('\n\n\n\n' + notes + '\n\n')
f.writelines('\n\n\n' + notes + '\n\n')
encrypt() encrypt()
term('gpg -d ' + directory + "'" + entryname.replace('/', '', 1) + '.gpg' + "'") term('gpg -d ' + directory + "'" + entryname.replace('/', '', 1) + '.gpg' + "'")
else: else: # create entry if there are no slashes
with open('/dev/shm/' + shmfolder + '/' + shmentry, 'w') as f: open('/dev/shm/' + shmfolder + '/' + shmentry, 'w').writelines('\n\n\n\n' + notes + '\n\n')
f.writelines('\n\n\n' + notes + '\n\n')
encrypt() encrypt()
term('gpg -d ' + directory + "'" + entryname + '.gpg' + "'") term('gpg -d ' + directory + "'" + entryname + '.gpg' + "'")
except FileNotFoundError: except FileNotFoundError:
@@ -300,28 +313,33 @@ if argument == 'add password' or argument == 'add -p':
username = str(input('Username: ')) username = str(input('Username: '))
password = str(input('Password: ')) password = str(input('Password: '))
url = str(input('URL: ')) url = str(input('URL: '))
notes = str(input('Additional notes: '))
except KeyboardInterrupt: except KeyboardInterrupt:
entryname, username, password, url, notes = (0, 0, 0, 0, 0) entryname, username, password, url, notes = (0, 0, 0, 0, 0)
print('\n\nEntry add cancelled.\n') print('\n\nEntry add cancelled.\n')
exit() exit()
shmfolder, shmentry = shmgen() shmfolder, shmentry = shmgen()
add_note = input('Add a note to this entry? (y/N) ')
if add_note == 'y' or add_note == 'Y':
term('nano /dev/shm/' + shmfolder + '/' + shmentry + '-n')
notes = open('/dev/shm/' + shmfolder + '/' + shmentry + '-n', 'r').read()
else:
notes = ''
try: try:
if entryname.startswith('/'): if entryname.startswith('/'):
if entryname.replace('/', '', 1).__contains__('/'): if entryname.replace('/', '', 1).__contains__('/'):
folder, sep, folderentry = entryname.replace('/', '', 1).partition('/') folder, sep, folderentry = entryname.replace('/', '', 1).partition('/')
with open('/dev/shm/' + shmfolder + '/' + shmentry, 'w') as f: open('/dev/shm/' + shmfolder + '/' + shmentry, 'w').writelines(username + '\n' + password + '\n' + url
f.writelines(username + '\n' + password + '\n' + url + '\n' + notes + '\n\n') + '\n\n' + notes + '\n\n')
encryptfolder() encryptfolder()
term('gpg -d ' + directory + folder + '/' + "'" + folderentry + '.gpg' + "'") term('gpg -d ' + directory + folder + '/' + "'" + folderentry + '.gpg' + "'")
else: else:
with open('/dev/shm/' + shmfolder + '/' + shmentry, 'w') as f: open('/dev/shm/' + shmfolder + '/' + shmentry, 'w').writelines(username + '\n' + password + '\n' + url
f.writelines(username + '\n' + password + '\n' + url + '\n' + notes + '\n\n') + '\n\n' + notes + '\n\n')
encrypt() encrypt()
term('gpg -d ' + directory + "'" + entryname.replace('/', '', 1) + '.gpg' + "'") term('gpg -d ' + directory + "'" + entryname.replace('/', '', 1) + '.gpg' + "'")
else: else:
with open('/dev/shm/' + shmfolder + '/' + shmentry, 'w') as f: open('/dev/shm/' + shmfolder + '/' + shmentry, 'w').writelines(username + '\n' + password + '\n' + url
f.writelines(username + '\n' + password + '\n' + url + '\n' + notes + '\n\n') + '\n\n' + notes + '\n\n')
encrypt() encrypt()
term('gpg -d ' + directory + "'" + entryname + '.gpg' + "'") term('gpg -d ' + directory + "'" + entryname + '.gpg' + "'")
except FileNotFoundError: except FileNotFoundError:
@@ -504,7 +522,6 @@ if argument == 'edit note' or argument == 'edit -n':
term('cd ' + directory + '; ls -1 *') term('cd ' + directory + '; ls -1 *')
print() print()
entryname = str(input('What file would you like to edit? ')) entryname = str(input('What file would you like to edit? '))
notes = str(input('New Note: '))
except KeyboardInterrupt: except KeyboardInterrupt:
entryname, notes = (0, 0) entryname, notes = (0, 0)
print('\n\nEdit cancelled.\n') print('\n\nEdit cancelled.\n')
@@ -516,20 +533,20 @@ if argument == 'edit note' or argument == 'edit -n':
folder, sep, folderentry = entryname.replace('/', '', 1).partition('/') folder, sep, folderentry = entryname.replace('/', '', 1).partition('/')
term('gpg -d --output /dev/shm/' + shmfolder + '/' + shmentry + ' ' + directory + term('gpg -d --output /dev/shm/' + shmfolder + '/' + shmentry + ' ' + directory +
folder + '/' + folderentry + '.gpg') folder + '/' + folderentry + '.gpg')
replace_line('/dev/shm/' + shmfolder + '/' + shmentry, 3, notes + '\n') edit_note()
remove(directory + folder + '/' + folderentry + '.gpg') remove(directory + folder + '/' + folderentry + '.gpg')
encryptfolder() encryptfolder()
term('gpg -d ' + directory + folder + '/' + "'" + folderentry + '.gpg' + "'") term('gpg -d ' + directory + folder + '/' + "'" + folderentry + '.gpg' + "'")
else: else:
term('gpg -d --output /dev/shm/' + shmfolder + '/' + shmentry + ' ' + directory + term('gpg -d --output /dev/shm/' + shmfolder + '/' + shmentry + ' ' + directory +
entryname.replace('/', '', 1) + '.gpg') entryname.replace('/', '', 1) + '.gpg')
replace_line('/dev/shm/' + shmfolder + '/' + shmentry, 3, notes + '\n') edit_note()
remove(directory + entryname.replace('/', '', 1) + '.gpg') remove(directory + entryname.replace('/', '', 1) + '.gpg')
encrypt() encrypt()
term('gpg -d ' + directory + "'" + entryname.replace('/', '', 1) + '.gpg' + "'") term('gpg -d ' + directory + "'" + entryname.replace('/', '', 1) + '.gpg' + "'")
else: else:
term('gpg -d --output /dev/shm/' + shmfolder + '/' + shmentry + ' ' + directory + entryname + '.gpg') term('gpg -d --output /dev/shm/' + shmfolder + '/' + shmentry + ' ' + directory + entryname + '.gpg')
replace_line('/dev/shm/' + shmfolder + '/' + shmentry, 3, notes + '\n') edit_note()
remove(directory + entryname + '.gpg') remove(directory + entryname + '.gpg')
encrypt() encrypt()
term('gpg -d ' + directory + "'" + entryname + '.gpg' + "'") term('gpg -d ' + directory + "'" + entryname + '.gpg' + "'")
@@ -592,9 +609,9 @@ if argument == 'copy password' or argument == 'copy -p':
term('gpg -d --output /dev/shm/' + shmfolder + '/' + shmentry + ' ' + directory + readentry + '.gpg') term('gpg -d --output /dev/shm/' + shmfolder + '/' + shmentry + ' ' + directory + readentry + '.gpg')
copyline = open('/dev/shm/' + shmfolder + '/' + shmentry, 'r').readlines() copyline = open('/dev/shm/' + shmfolder + '/' + shmentry, 'r').readlines()
if environ.get('WAYLAND_DISPLAY') == 'wayland-0': if environ.get('WAYLAND_DISPLAY') == 'wayland-0':
term('wl-copy ' + "'" + copyline[1].replace('\n', '') + "'") term('wl-copy ' + "'" + copyline[1].replace('\n', '').replace("'", "'\\''") + "'")
else: else:
term('echo -n ' + "'" + copyline[1].replace('\n', '') + "'" + ' | xclip -sel c') term('echo -n ' + "'" + copyline[1].replace('\n', '').replace("'", "'\\''") + "'" + ' | xclip -sel c')
rmtree('/dev/shm/' + shmfolder) rmtree('/dev/shm/' + shmfolder)
except FileNotFoundError: except FileNotFoundError:
print('\n!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!') print('\n!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!')
@@ -680,18 +697,18 @@ if argument == 'gen':
if entryname.startswith('/'): if entryname.startswith('/'):
if entryname.replace('/', '', 1).__contains__('/'): if entryname.replace('/', '', 1).__contains__('/'):
folder, sep, folderentry = entryname.replace('/', '', 1).partition('/') folder, sep, folderentry = entryname.replace('/', '', 1).partition('/')
with open('/dev/shm/' + shmfolder + '/' + shmentry, 'w') as f: open('/dev/shm/' + shmfolder + '/' + shmentry, 'w').writelines(username + '\n' + passgen + '\n' + url
f.writelines(username + '\n' + passgen + '\n' + url + '\n' + notes + '\n\n') + '\n' + notes + '\n\n')
encryptfolder() encryptfolder()
term('gpg -d ' + directory + folder + '/' + "'" + folderentry + '.gpg' + "'") term('gpg -d ' + directory + folder + '/' + "'" + folderentry + '.gpg' + "'")
else: else:
with open('/dev/shm/' + shmfolder + '/' + shmentry, 'w') as f: open('/dev/shm/' + shmfolder + '/' + shmentry, 'w').writelines(username + '\n' + passgen + '\n' + url
f.writelines(username + '\n' + passgen + '\n' + url + '\n' + notes + '\n\n') + '\n' + notes + '\n\n')
encrypt() encrypt()
term('gpg -d ' + directory + "'" + entryname.replace('/', '', 1) + '.gpg' + "'") term('gpg -d ' + directory + "'" + entryname.replace('/', '', 1) + '.gpg' + "'")
else: else:
with open('/dev/shm/' + shmfolder + '/' + shmentry, 'w') as f: open('/dev/shm/' + shmfolder + '/' + shmentry, 'w').writelines(username + '\n' + passgen + '\n' + url
f.writelines(username + '\n' + passgen + '\n' + url + '\n' + notes + '\n\n') + '\n' + notes + '\n\n')
encrypt() encrypt()
term('gpg -d ' + directory + "'" + entryname + '.gpg' + "'") term('gpg -d ' + directory + "'" + entryname + '.gpg' + "'")
except FileNotFoundError: except FileNotFoundError:
@@ -757,21 +774,28 @@ if argument == 'remove' or argument == '-rm':
print() print()
try: try:
entryname = str(input('What would you like to delete? ')) entryname = str(input('What would you like to delete? '))
try:
term('gpg -d --output /dev/shm/rpass.lock /var/lib/rpass/lock.gpg')
unlocker = open('/dev/shm/rpass.lock', 'r').readlines()
remove('/dev/shm/rpass.lock')
except FileNotFoundError:
print('\nAccess denied.\n')
exit()
if entryname.startswith('/'): if entryname.startswith('/'):
if entryname.replace('/', '', 1).__contains__('/'): if entryname.replace('/', '', 1).__contains__('/'):
if devicetype == 'c' or devicetype == 'C': if devicetype == 'c':
term('ssh -p ' + port + '' + usernamessh + '@' + ip + ' rm -rf ' + "'" + directoryssh + "'" + term('ssh -p ' + port + ' ' + usernamessh + '@' + ip + ' "' + ' rm -rf ' + "'" + directoryssh +
entryname.replace('/', '', 1) + '.gpg') entryname.replace('/', '', 1) + '.gpg' + "'" + '"')
remove(directory + entryname.replace('/', '', 1) + '.gpg') remove(directory + entryname.replace('/', '', 1) + '.gpg')
else: else:
if devicetype == 'c' or devicetype == 'C': if devicetype == 'c':
term('ssh -p ' + port + '' + usernamessh + '@' + ip + ' rm -rf ' + "'" + directoryssh + "'" + term('ssh -p ' + port + ' ' + usernamessh + '@' + ip + ' "' + ' rm -rf ' + "'" + directoryssh +
entryname.replace('/', '', 1)) entryname.replace('/', '', 1) + "'" + '"')
rmtree(directory + entryname.replace('/', '', 1)) rmtree(directory + entryname.replace('/', '', 1))
else: else:
if devicetype == 'c' or devicetype == 'C': if devicetype == 'c':
term('ssh -p ' + port + ' ' + usernamessh + '@' + ip + ' rm -rf ' + "'" + directoryssh + "'" + term('ssh -p ' + port + ' ' + usernamessh + '@' + ip + ' "' + ' rm -rf ' + "'" + directoryssh +
entryname + '.gpg') entryname + '.gpg' + "'" + '"')
remove(directory + entryname + '.gpg') remove(directory + entryname + '.gpg')
except KeyboardInterrupt: except KeyboardInterrupt:
print('\n\nDeletion cancelled.\n') print('\n\nDeletion cancelled.\n')
@@ -782,12 +806,12 @@ if argument == 'remove' or argument == '-rm':
print('!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!\n') print('!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!\n')
exit() exit()
if argument.__contains__('add') or argument.__contains__('-rm') or argument.__contains__('remove') or argument.\ if argument.__contains__('-rm') or string_found('remove', argument) or string_found('add', argument) or \
__contains__('edit') or argument.__contains__('gen') or argument.__contains__('version') or argument.\ string_found('edit', argument) or string_found('gen', argument) or string_found('copy', argument) or \
__contains__('-v') or argument.__contains__('config') or argument.__contains__('copy') or argument.\ string_found('/', argument) or argument == 'sync' or argument == '-s' or argument == '' or argument == 'help' \
__contains__('show') or argument.__contains__('/') or argument == 'sync' or argument == '-s' or argument == '' \ or argument == '--help' or argument == '-h' or argument == 'version' or argument == '-v' or argument == \
or argument == 'help' or argument == '--help' or argument == '-h': 'config' or argument == 'show w' or argument == 'show c':
null = 'null' pass
else: else:
print('\n!!!!!!!!!!!!!!!') print('\n!!!!!!!!!!!!!!!')
print('Argument error!') print('Argument error!')
@@ -800,11 +824,11 @@ term('find ' + directory + ' -type d -exec chmod -R 700 {} +')
term('find ' + directory + ' -type f -exec chmod -R 600 {} +') term('find ' + directory + ' -type f -exec chmod -R 600 {} +')
# rsync - ran at end of program to ensure all files are properly synced # 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. \ if argument.__contains__('-rm') or string_found('remove', argument) or string_found('add', argument) or \
__contains__('edit') or argument.__contains__('gen') or argument == 'sync' or argument == '-s': string_found('edit', argument) or string_found('gen', argument) or argument == 'sync' or argument == '-s':
print('Syncing entries with other device(s)...\n') 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 term('rsync -v -H -r -l -t -p -e ' + '"ssh -i ~/.ssh/rpass -p ' + port + '" ' + directory + ' ' +
+ '@' + ip + ':' + directoryssh) usernamessh + '@' + ip + ':' + directoryssh)
term('rsync -v -H -r -l -t -p --delete -e ' + '"ssh -i ~/.ssh/rpass -p ' + port + '" ' + usernamessh term('rsync -v -H -r -l -t -p --delete -e ' + '"ssh -i ~/.ssh/rpass -p ' + port + '" ' + usernamessh
+ '@' + ip + ':' + directoryssh + ' ' + directory) + '@' + ip + ':' + directoryssh + ' ' + directory)
+53
View File
@@ -1,5 +1,58 @@
<><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><> <><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><>
rpass 2021.10.07.mr5
The Notetaker Update - Fifth main release of rpass
This release overhauls the note-taking system and provides general improvements
to overall code quality, including optimizations, bug fixes, and security improvements.
New features:
- notes are now edited in nano and can be split across multiple lines
- password confirmation has been added for entry deletion
Changes:
- fixed issues with copying passwords with certain special characters, e.g. '"()|
- auto-generated ssh key now uses ed25519, rather than rsa-3072
- entry format modified to include a blank line before the notes field (old format still mostly compatible)
- rpass is now much better at catching bad arguments
- some general code cleanup
Planned for next update (The Housekeeping Update Pt. 2):
- add new file list w/color and w/o extensions + proper displaying of nested folders
- ability to pass entries as arguments for more functions
- manpage
- add more comments to code
- validate for Python 3.10
Planned for next update (The cryptpass Update):
- initial implementation of a data store for other applications (libsecret alt.)
- modularize code in preparation for GUI frontends
Planned, no timeline:
- create separate gui frontend targetting mobile devices (first Linux phones, maybe Android at a later date - official iOS client not likely)
^ the gui will also function on desktop linux
- make platform agnostic (add Windows support and package for more Linux distributions, such as Alpine and Debian)
- auto-completion on tab (currently unsure of best way to make this work)
<><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><>
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 rpass 2021.09.15.mr4.1
The Housekeeping Update (Pt. 1) - Hotfix The Housekeeping Update (Pt. 1) - Hotfix