Compare commits

..
Author SHA1 Message Date
RandyTheSilly 55b07eb8f6 Rebranding step 3 + final rpass version prep 2021-11-01 16:23:08 -04:00
RandyTheSilly 96161e870d Rebranding step 2 2021-11-01 15:17:29 -04:00
RandyTheSilly 8c557ee290 Rebranding step 1 2021-11-01 15:15:01 -04:00
RandyTheSilly 59be7d7602 Completed initial implementation of sshync 2021-11-01 13:59:25 -04:00
RandyTheSilly b60efd86d6 sftp/sshync syncing progress 2021-10-27 01:12:57 -04:00
RandyTheSilly 18b27c9dce Partial fix for data loss (syncing temporarily disabled) 2021-10-12 23:13:03 -04:00
RandyTheSilly 6cdc158074 Updated changelog/roadmap 2021-10-11 15:03:51 -04:00
RandyTheSilly 2911087b40 Fixed an issue with copying notes (2) 2021-10-11 13:47:53 -04:00
RandyTheSilly f7c0e81f02 Fixed an issue with copying notes 2021-10-11 13:45:50 -04:00
RandyTheSilly 02059d367c Updated roadmap 2021-10-11 13:22:36 -04:00
RandyTheSilly 91dcd4585a Update PKGBUILD... again 2021-10-07 23:20:15 -04:00
RandyTheSilly 4cefccf4c6 Updated PKGBUILD 2021-10-07 23:14:46 -04:00
RandyTheSilly ea117c2cb5 Updated changelog and PKGBUILD 2021-10-07 23:12:11 -04:00
RandyTheSilly 0a74d36845 Update readme 2021-10-07 23:04:35 -04:00
RandyTheSilly 2bf1859bc7 Cleanup and security enhancements in preparation for release 5 2021-10-07 22:59:59 -04:00
RandyTheSilly e1e7254fc1 Fixed naming error 2021-10-07 17:05:40 -04:00
RandyTheSilly 338af44841 Added multi-line notes support 2021-10-07 16:15:02 -04:00
RandyTheSilly 5aa22c82fc Changed SSH key type to ed25519 2021-10-07 09:36:33 -04:00
RandyTheSilly 9e8c580bb7 Fixed issues with copy syntax (2) 2021-09-23 14:28:30 -04:00
RandyTheSilly 864caffbca Fixed issues with copy syntax 2021-09-23 14:19:18 -04:00
RandyTheSilly f82f3c78a0 Added roadmap for next update 2021-09-23 09:44:15 -04:00
RandyTheSilly 17812d5ca4 Added url to PKGBUILD 2021-09-15 19:22:05 -04:00
RandyTheSilly 5df1ae30a4 Updated PKGBUILD 2021-09-15 19:03:51 -04:00
RandyTheSilly 366c76d683 Fxed sync and remote entry deletion 2021-09-15 18:54:10 -04:00
RandyTheSilly 2f3807294a Updated PKGBUILD 2021-09-15 01:40:50 -04:00
RandyTheSilly c455a9a7fb Fixed gpg key prompt in config 2021-09-15 01:38:06 -04:00
RandyTheSilly 691aaab634 Fixed gpg key prompt in config 2021-09-15 01:37:04 -04:00
RandyTheSilly 0365c17a34 Added share folder 2021-09-15 01:15:13 -04:00
RandyTheSilly 87502ceb22 Added PKGBUILD, corrected typos 2021-09-15 01:14:05 -04:00
8 changed files with 1508 additions and 98 deletions
+23
View File
@@ -0,0 +1,23 @@
# Maintainer: Randall Winkhart <idgr at tutanota dot com>
# The source package is no longer recieving updates past this version.
pkgname=rpass
pkgver=2021.11.01.mr5.1
pkgrel=1
pkgdesc='An rsync-based password manager and alternative to GNU pass'
url='https://github.com/rwinkhart/sshyp'
arch=('x86_64' 'aarch64')
license=('GPL3')
depends=( python gnupg openssh rsync nano xclip wl-clipboard)
source_x86_64=('https://github.com/rwinkhart/sshyp/releases/download/v2021.11.01.mr5.1/rpass-2021.11.01.mr5.1.tar.xz')
source_aarch64=('https://github.com/rwinkhart/sshyp/releases/download/v2021.11.01.mr5.1/rpass-2021.11.01.mr5.1.tar.xz')
sha512sums_x86_64=('bf0c958721de1a13ca814d91bf74cbaaebe458198cba14b96b95fb1eeb72a1b901c8d3d00ea4c18ddff0d10d9ef6504a17a4caa345917412108df4787add61fd')
sha512sums_aarch64=('bf0c958721de1a13ca814d91bf74cbaaebe458198cba14b96b95fb1eeb72a1b901c8d3d00ea4c18ddff0d10d9ef6504a17a4caa345917412108df4787add61fd')
package() {
tar xf rpass-"$pkgver".tar.xz -C "${pkgdir}"
chown -R "$USER" ${pkgdir}/var/lib/rpass
}
+16 -13
View File
@@ -1,16 +1,19 @@
# rpass
A very simple password manager with rsync integration - alternative to GNU pass
# sshyp
A very simple self-hosted, synchronized password manager. Alternative to GNU pass.
# Mission Statement
sshyp aims to make it as simple as possible to manage passwords and notes via CLI across multiple devices in a self-hosted fashion.
# Installation
Arch Linux (x86_64, aarch64)
rpass releases are available in the Arch User Repository as 'rpass'.
sshyp releases are available in the Arch User Repository as 'sshyp'.
Install with your preferred AUR helper or use:
```
git clone https://aur.archlinux.org/rpass.git
cd rpass
git clone https://aur.archlinux.org/sshyp.git
cd sshyp
makepkg -si
```
@@ -20,33 +23,33 @@ Packaging for other distributions coming soon.
Upon initial installation, be sure to run:
```
rpass config
sshyp config
```
This command will allow you to configure the settings necessary for rpass to function.
As of right now, rpass is rapidly changing, and as such, it is a good idea to run "rpass config" after each update.
All available options can be found with:
```
rpass --help
sshyp --help
```
# Roadmap
Short-term Goals:
- re-write bad, leftover "rpass" code
- create new file list w/color and w/o file extensions
- create a man page
- allow for multi-line notes
- overhaul argument system
- fix lots of bugs!
- make lots of optimizations!
Medium-term Goals:
- add libsecret integration to allow rpass to act as a gnome-keyring alternative
- create a minimal GUI app optimized for the Pinephone (also compatible with x86_64)
- create minimal GUI apps (Linux x86_64, Linux aarch64, Android aarch64)
- auto-completion on tab for CLI version
Long-term Goals:
- make an Android port (including GUI)
- make a minimal Windows port
- investigate auto-completion on tab
- seize the thrones, shear the humans
+109 -85
View File
@@ -8,11 +8,13 @@ from os import environ
from shutil import move
from shutil import rmtree
from sys import argv
from re import search
from re import escape
import random
import string
# custom modules
# custom modules
def clear():
print('\n' * 100)
@@ -22,12 +24,25 @@ def term(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):
lines = open(file_name, 'r').readlines()
lines[line_num] = text
out = open(file_name, 'w')
out.writelines(lines)
out.close()
xlines = open(file_name, 'r').readlines()
xlines[line_num] = text
open(file_name, 'w').writelines(xlines)
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():
@@ -101,8 +116,8 @@ if argument == 'version' or argument == '-v':
print('/ /')
print('/ rpass Copyright (C) 2021 Randall Winkhart /')
print('/ /')
print('/ Version 2021.09.15.pr4 /')
print('/ The Housekeeping Update (Pt. 1) /')
print('/ Version 2021.11.01.mr5.1 /')
print('/ The Notetaker Update /')
print('/ /')
print('////////////////////////////////////////////////////////\n')
@@ -130,27 +145,24 @@ if argument == 'config':
if directorychoice == 'n' or directorychoice == 'N':
print('\nFormat: /this/path/ends/with/a/slash/\n')
directory = str(input('Please input a custom directory: '))
with open("/var/lib/rpass/rpass-dir", 'w') as f:
f.write(directory + '\n')
open("/var/lib/rpass/rpass-dir", 'w').write(directory + '\n')
else:
with open("/var/lib/rpass/rpass-dir", 'w') as f:
f.write('/home/' + environ.get('USER') + '/.rpass-store/' + '\n')
open("/var/lib/rpass/rpass-dir", 'w').write('/home/' + environ.get('USER') + '/.rpass-store/' + '\n')
print()
devicetype = str(input('Will this be a client, server, or offline device? (C/s/o) '))
if devicetype == 's' or devicetype == 'S':
with open("/var/lib/rpass/rpass-ssh", 'w') as f:
f.write('\n\n\n\n' + devicetype)
open("/var/lib/rpass/rpass-ssh", 'w').write('\n\n\n\n' + devicetype)
print('\nMake sure the ssh service is running and properly configured.\n')
print('Configuration complete!\n')
if devicetype == 'o' or devicetype == 'O' or devicetype == 'c' or devicetype == 'C':
else:
gpgid = ''
print()
gpgpresent = str(input(
'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':
print()
gpgid = str(input('Please input the ID of your gpg key: '))
with open("/var/lib/rpass/rpass-gpg", 'w') as f:
f.write(gpgid + '\n')
open("/var/lib/rpass/rpass-gpg", 'w').write(gpgid + '\n')
else:
print()
gpggen = str(
@@ -162,18 +174,23 @@ if argument == 'config':
term('gpg --full-generate-key')
print()
gpgid = str(input('Please input the ID of your gpg key: '))
with open("/var/lib/rpass/rpass-gpg", 'w') as f:
f.write(gpgid + '\n')
open("/var/lib/rpass/rpass-gpg", 'w').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':
with open("/var/lib/rpass/rpass-ssh", 'w') as f:
f.write('\n\n\n\n' + devicetype)
open("/var/lib/rpass/rpass-ssh", 'w').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) '))
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')
ip_port = str(input('What is the IP and ssh port of the remote server? '))
print()
@@ -186,14 +203,13 @@ if argument == 'config':
directoryssh = str(input('What directory is the server using?: '))
else:
directoryssh = ('/home/' + usernamessh + '/.rpass-store/')
with open("/var/lib/rpass/rpass-ssh", 'w') as f:
f.write(usernamessh + '\n' + ip + '\n' + port + '\n' + directoryssh + '\n' + devicetype)
open("/var/lib/rpass/rpass-ssh", 'w').write(usernamessh + '\n' + ip + '\n' + port + '\n' + directoryssh +
'\n' + devicetype)
print('\nConfiguration complete!\n')
except KeyboardInterrupt:
print('\n\nConfiguration cancelled.\n')
exit()
# startup help
if argument == '':
@@ -206,17 +222,16 @@ 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)
directory = ''
try:
with open("/var/lib/rpass/rpass-gpg") as f:
gpgid = f.read().strip()
with open("/var/lib/rpass/rpass-dir") as f:
directory = f.read().strip()
gpgid = open("/var/lib/rpass/rpass-gpg").read().strip()
directory = open("/var/lib/rpass/rpass-dir").read().strip()
term('mkdir -p ' + directory)
except FileNotFoundError:
print('\n!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!')
@@ -262,28 +277,26 @@ if argument == 'add note' or argument == 'add -n':
try:
clear()
entryname = str(input('Name of note: '))
notes = str(input('Contents of note: '))
except KeyboardInterrupt:
entryname, notes = (0, 0)
print('\n\nEntry add cancelled.\n')
exit()
shmfolder, shmentry = shmgen()
term('nano /dev/shm/' + shmfolder + '/' + shmentry + '-n')
notes = open('/dev/shm/' + shmfolder + '/' + shmentry + '-n', 'r').read()
try:
if entryname.startswith('/'):
if entryname.replace('/', '', 1).__contains__('/'):
if entryname.startswith('/'): # check if user input contains slashes
if entryname.replace('/', '', 1).__contains__('/'): # create folder and entry if there are two slashes
folder, sep, folderentry = entryname.replace('/', '', 1).partition('/')
with open('/dev/shm/' + shmfolder + '/' + shmentry, 'w') as f:
f.writelines('\n\n\n' + notes + '\n\n')
open('/dev/shm/' + shmfolder + '/' + shmentry, 'w').writelines('\n\n\n\n' + notes + '\n\n')
encryptfolder()
term('gpg -d ' + directory + folder + '/' + "'" + folderentry + '.gpg' + "'")
else:
with open('/dev/shm/' + shmfolder + '/' + shmentry, 'w') as f:
f.writelines('\n\n\n' + notes + '\n\n')
else: # create entry if there is only one slash
open('/dev/shm/' + shmfolder + '/' + shmentry, 'w').writelines('\n\n\n\n' + notes + '\n\n')
encrypt()
term('gpg -d ' + directory + "'" + entryname.replace('/', '', 1) + '.gpg' + "'")
else:
with open('/dev/shm/' + shmfolder + '/' + shmentry, 'w') as f:
f.writelines('\n\n\n' + notes + '\n\n')
else: # create entry if there are no slashes
open('/dev/shm/' + shmfolder + '/' + shmentry, 'w').writelines('\n\n\n\n' + notes + '\n\n')
encrypt()
term('gpg -d ' + directory + "'" + entryname + '.gpg' + "'")
except FileNotFoundError:
@@ -300,28 +313,33 @@ if argument == 'add password' or argument == 'add -p':
username = str(input('Username: '))
password = str(input('Password: '))
url = str(input('URL: '))
notes = str(input('Additional notes: '))
except KeyboardInterrupt:
entryname, username, password, url, notes = (0, 0, 0, 0, 0)
print('\n\nEntry add cancelled.\n')
exit()
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:
if entryname.startswith('/'):
if entryname.replace('/', '', 1).__contains__('/'):
folder, sep, folderentry = entryname.replace('/', '', 1).partition('/')
with open('/dev/shm/' + shmfolder + '/' + shmentry, 'w') as f:
f.writelines(username + '\n' + password + '\n' + url + '\n' + notes + '\n\n')
open('/dev/shm/' + shmfolder + '/' + shmentry, 'w').writelines(username + '\n' + password + '\n' + url
+ '\n\n' + notes + '\n\n')
encryptfolder()
term('gpg -d ' + directory + folder + '/' + "'" + folderentry + '.gpg' + "'")
else:
with open('/dev/shm/' + shmfolder + '/' + shmentry, 'w') as f:
f.writelines(username + '\n' + password + '\n' + url + '\n' + notes + '\n\n')
open('/dev/shm/' + shmfolder + '/' + shmentry, 'w').writelines(username + '\n' + password + '\n' + url
+ '\n\n' + notes + '\n\n')
encrypt()
term('gpg -d ' + directory + "'" + entryname.replace('/', '', 1) + '.gpg' + "'")
else:
with open('/dev/shm/' + shmfolder + '/' + shmentry, 'w') as f:
f.writelines(username + '\n' + password + '\n' + url + '\n' + notes + '\n\n')
open('/dev/shm/' + shmfolder + '/' + shmentry, 'w').writelines(username + '\n' + password + '\n' + url
+ '\n\n' + notes + '\n\n')
encrypt()
term('gpg -d ' + directory + "'" + entryname + '.gpg' + "'")
except FileNotFoundError:
@@ -504,7 +522,6 @@ if argument == 'edit note' or argument == 'edit -n':
term('cd ' + directory + '; ls -1 *')
print()
entryname = str(input('What file would you like to edit? '))
notes = str(input('New Note: '))
except KeyboardInterrupt:
entryname, notes = (0, 0)
print('\n\nEdit cancelled.\n')
@@ -516,20 +533,20 @@ if argument == 'edit note' or argument == 'edit -n':
folder, sep, folderentry = entryname.replace('/', '', 1).partition('/')
term('gpg -d --output /dev/shm/' + shmfolder + '/' + shmentry + ' ' + directory +
folder + '/' + folderentry + '.gpg')
replace_line('/dev/shm/' + shmfolder + '/' + shmentry, 3, notes + '\n')
edit_note()
remove(directory + folder + '/' + folderentry + '.gpg')
encryptfolder()
term('gpg -d ' + directory + folder + '/' + "'" + folderentry + '.gpg' + "'")
else:
term('gpg -d --output /dev/shm/' + shmfolder + '/' + shmentry + ' ' + directory +
entryname.replace('/', '', 1) + '.gpg')
replace_line('/dev/shm/' + shmfolder + '/' + shmentry, 3, notes + '\n')
edit_note()
remove(directory + entryname.replace('/', '', 1) + '.gpg')
encrypt()
term('gpg -d ' + directory + "'" + entryname.replace('/', '', 1) + '.gpg' + "'")
else:
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')
encrypt()
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')
copyline = open('/dev/shm/' + shmfolder + '/' + shmentry, 'r').readlines()
if environ.get('WAYLAND_DISPLAY') == 'wayland-0':
term('wl-copy ' + "'" + copyline[1].replace('\n', '') + "'")
term('wl-copy ' + "'" + copyline[1].replace('\n', '').replace("'", "'\\''") + "'")
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)
except FileNotFoundError:
print('\n!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!')
@@ -644,9 +661,9 @@ if argument == 'copy note' or argument == 'copy -n':
term('gpg -d --output /dev/shm/' + shmfolder + '/' + shmentry + ' ' + directory + readentry + '.gpg')
copyline = open('/dev/shm/' + shmfolder + '/' + shmentry, 'r').readlines()
if environ.get('WAYLAND_DISPLAY') == 'wayland-0':
term('wl-copy ' + "'" + copyline[3].replace('\n', '') + "'")
term('wl-copy ' + "'" + copyline[4].replace('\n', '') + "'")
else:
term('echo -n ' + "'" + copyline[3].replace('\n', '') + "'" + ' | xclip -sel c')
term('echo -n ' + "'" + copyline[4].replace('\n', '') + "'" + ' | xclip -sel c')
rmtree('/dev/shm/' + shmfolder)
except FileNotFoundError:
print('\n!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!')
@@ -680,18 +697,18 @@ if argument == 'gen':
if entryname.startswith('/'):
if entryname.replace('/', '', 1).__contains__('/'):
folder, sep, folderentry = entryname.replace('/', '', 1).partition('/')
with open('/dev/shm/' + shmfolder + '/' + shmentry, 'w') as f:
f.writelines(username + '\n' + passgen + '\n' + url + '\n' + notes + '\n\n')
open('/dev/shm/' + shmfolder + '/' + shmentry, 'w').writelines(username + '\n' + passgen + '\n' + url
+ '\n' + notes + '\n\n')
encryptfolder()
term('gpg -d ' + directory + folder + '/' + "'" + folderentry + '.gpg' + "'")
else:
with open('/dev/shm/' + shmfolder + '/' + shmentry, 'w') as f:
f.writelines(username + '\n' + passgen + '\n' + url + '\n' + notes + '\n\n')
open('/dev/shm/' + shmfolder + '/' + shmentry, 'w').writelines(username + '\n' + passgen + '\n' + url
+ '\n' + notes + '\n\n')
encrypt()
term('gpg -d ' + directory + "'" + entryname.replace('/', '', 1) + '.gpg' + "'")
else:
with open('/dev/shm/' + shmfolder + '/' + shmentry, 'w') as f:
f.writelines(username + '\n' + passgen + '\n' + url + '\n' + notes + '\n\n')
open('/dev/shm/' + shmfolder + '/' + shmentry, 'w').writelines(username + '\n' + passgen + '\n' + url
+ '\n' + notes + '\n\n')
encrypt()
term('gpg -d ' + directory + "'" + entryname + '.gpg' + "'")
except FileNotFoundError:
@@ -757,21 +774,28 @@ if argument == 'remove' or argument == '-rm':
print()
try:
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.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')
@@ -782,12 +806,12 @@ if argument == 'remove' or argument == '-rm':
print('!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!\n')
exit()
if argument.__contains__('add') or argument.__contains__('-rm') or argument.__contains__('remove') or argument.\
__contains__('edit') or argument.__contains__('gen') or argument.__contains__('version') or argument.\
__contains__('-v') or argument.__contains__('config') or argument.__contains__('copy') or argument.\
__contains__('show') or argument.__contains__('/') or argument == 'sync' or argument == '-s' or argument == '' \
or argument == 'help' or argument == '--help' or argument == '-h':
null = 'null'
if argument.__contains__('-rm') or string_found('remove', argument) or string_found('add', argument) or \
string_found('edit', argument) or string_found('gen', argument) or string_found('copy', argument) or \
string_found('/', argument) or argument == 'sync' or argument == '-s' or argument == '' or argument == 'help' \
or argument == '--help' or argument == '-h' or argument == 'version' or argument == '-v' or argument == \
'config' or argument == 'show w' or argument == 'show c':
pass
else:
print('\n!!!!!!!!!!!!!!!')
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 {} +')
# rsync - ran at end of program to ensure all files are properly synced
if devicetype == 'c' or 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':
if devicetype == 'c':
if argument.__contains__('-rm') or string_found('remove', argument) or string_found('add', argument) or \
string_found('edit', argument) or string_found('gen', argument) 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)
Executable
+208
View File
@@ -0,0 +1,208 @@
#!/usr/bin/python3
# Main Targets:
# TODO Make it so that when a new folder is created in sshyp, it is automatically created on the remote server
# TODO Replace references to rpass/sshyp directory with a changeable variable
# TODO Clean everything up and move sshync to a separate package
# TODO Add dry run support
# sshync 2021.11.01.unreleased3
# sshync was created to solve a problem with rpass/sshyp, and as such, sshync will be bundled with sshyp until it is
# polished enough for a standalone release
# sshync is a wrapper around sftp that allows easy remote directory synchronization via Python
# openssh (on POSIX compliant Unix) is required
# sshync will always overwrite the older files with the newer files, regardless of all other conditions
# ^the age is determined by the date and time of the last modification to the files
# syncing via sshync is always done recursively
# external modules
from os import walk
from os import system as term
from os.path import getmtime
from os.path import join as path_join
# internal modules
# recursively scans a local directory for all files and saves file paths and mod times to lists
def get_file_paths_mod(directory, name_database, time_database):
file_paths = []
temp_mod_times = []
mod_times = []
for root, directories, files in walk(directory):
for filename in files:
filepath = path_join(root, filename)
file_paths.append(filepath)
temp_mod_times.append(str(getmtime(filepath)))
for time in temp_mod_times:
mod_times.append(round(float(time), 2))
open(name_database, 'w').write(str(file_paths))
open(time_database, 'w').write(str(mod_times))
return file_paths, mod_times
# recursively scans a remote directory for all files and saves file paths and mod times to lists
def get_file_paths_mod_remote(profile_dir):
# import profile data
profile_data = get_profile(profile_dir)
user = profile_data[0].replace('\n', '')
ip = profile_data[1].replace('\n', '')
port = profile_data[2].replace('\n', '')
remote_dir = profile_data[4].replace('\n', '')
identity = profile_data[5].replace('\n', '')
term("ssh -i " + "'" + identity + "'" + " -p " + port + " " + user + "@" + ip + " \"python -c \'import sshync; "
"sshync.get_file_paths_mod(" +
"\"'\"" + remote_dir + "/\"'\", " + "\"'\"/var/lib/rpass/sshyncdatabase_names\"'\", " +
"\"'\"/var/lib/rpass/sshyncdatabase_times\"'\")\'\"")
term(
'sftp -P ' + port + ' ' + user + '@' + ip + ':/var/lib/rpass/sshyncdatabase_names ' +
'/var/lib/rpass/sshyncdatabase_names')
term(
'sftp -P ' + port + ' ' + user + '@' + ip + ':/var/lib/rpass/sshyncdatabase_times ' +
'/var/lib/rpass/sshyncdatabase_times')
remote_mod_names = (open('/var/lib/rpass/sshyncdatabase_names').read()).replace('[', '').replace(']', '').replace(
' ', '').replace("'", '').split(',')
remote_mod_times = (open('/var/lib/rpass/sshyncdatabase_times').read()).replace('[', '').replace(']', '').replace(
' ', '').replace("'", '').split(',')
return remote_mod_names, remote_mod_times
# regular profiles check the mod time of every individual file in the directory, making them slow but versatile
def make_profile(profile_dir, local_dir, remote_dir, identity, ip, port, user):
open(profile_dir, 'w').write(user + '\n' + ip + '\n' + port + '\n' + local_dir + '\n' + remote_dir + '\n' + identity
+ '\n')
# returns the settings for a specified profile
def get_profile(profile_dir):
try:
profile_data = open(profile_dir).readlines()
except (FileNotFoundError, IndexError):
profile_data = 0
return profile_data
# sorts name lists so that local and remote are in the same order
def name_sort(local_names, remote_names):
remote_names_new = []
for ele in local_names:
if ele in remote_names:
remote_names_new.append(ele)
for ele in remote_names:
if ele not in remote_names_new:
remote_names_new.append(ele)
return remote_names_new
# sorts time lists to compensate for name list re-ordering
def time_sort(old_names, new_names, old_times):
remote_mod_times_new = []
new_pos = -1
for title in new_names:
new_pos += 1
if title in old_names:
old_pos = old_names.index(title)
remote_mod_times_new.append(old_times[old_pos])
return remote_mod_times_new
getter_loop_count = -1
def loop_getter(split_remote_dir):
global getter_loop_count
getter_loop_count += 1
new_var = split_remote_dir[getter_loop_count] + '/'
return new_var
def run_profile(profile_dir):
# import profile data
profile_data = get_profile(profile_dir)
user = profile_data[0].replace('\n', '')
ip = profile_data[1].replace('\n', '')
port = profile_data[2].replace('\n', '')
local_dir = profile_data[3].replace('\n', '')
remote_dir = profile_data[4].replace('\n', '')
identity = profile_data[5].replace('\n', '')
# get file modification times
local_mod_names, local_mod_times = get_file_paths_mod(local_dir + '/', '/var/lib/rpass/sshyncdatabase_names',
'/var/lib/rpass/sshyncdatabase_times')
remote_mod_times = []
remote_mod_names, remote_mod_times_temp = get_file_paths_mod_remote('/var/lib/rpass/rpass.sshync')
for time in remote_mod_times_temp: # remove quotes from remote_mod_times
remote_mod_times.append(float(time))
lmod_short = []
rmod_short = []
matching_names = []
matching_times_local = []
matching_times_remote = []
for lmod in local_mod_names:
lmod_short.append(lmod.replace(local_dir, ''))
for rmod in remote_mod_names:
rmod_short.append(rmod.replace(remote_dir, ''))
rmod_short_old = rmod_short
rmod_short = name_sort(lmod_short, rmod_short)
remote_mod_times = time_sort(rmod_short_old, rmod_short, remote_mod_times)
i = -1
for lshort in lmod_short:
i += 1
if lshort in rmod_short:
matching_names.append(lshort)
matching_times_local.append(local_mod_times[i])
else:
print('Uploading ' + lshort)
lshort_split = lshort.replace('/', '', 1).split('/')
c = -1
for _ in lshort_split:
c += 1
global getter_loop_count
getter_loop_count = -1
q = ''
for _ in range(c):
q += loop_getter(lshort_split)
term('sftp -p -i ' + "'" + identity + "' " + '-P ' + port + ' ' + user + '@' + ip + ':' + remote_dir + q +
" <<< $'put " + local_dir + lshort.replace('/', '', 1) + "'")
i = -1
for rshort in rmod_short:
i += 1
if rshort in lmod_short:
matching_times_remote.append(float(remote_mod_times[i]))
else:
print('Downloading ' + rshort)
term('sftp -p -i ' + "'" + identity + "' " + '-P ' + port + ' ' + user + '@' + ip + ':' + remote_dir +
rshort.replace('/', '', 1) + ' ' + local_dir + rshort.replace('/', '', 1))
i = -1
for ltime in matching_times_local:
i += 1
ltime = int(ltime)
if ltime == int(matching_times_remote[i]):
print('Local ' + matching_names[i] + ' is up to date, not syncing.')
elif ltime > int(matching_times_remote[i]):
print('Local ' + matching_names[i] + ' is newer, uploading.')
matching_names_split = matching_names[i].replace('/', '', 1).split('/')
c = -1
for _ in matching_names_split:
c += 1
getter_loop_count = -1
q = ''
for _ in range(c):
q += loop_getter(matching_names_split)
term('sftp -p -i ' + "'" + identity + "' " + '-P ' + port + ' ' + user + '@' + ip + ':' + remote_dir + q +
" <<< $'put " + local_dir + matching_names[i].replace('/', '', 1) + "'")
elif ltime < int(matching_times_remote[i]):
print('Local ' + matching_names[i] + ' is older, downloading.')
term('sftp -p -i ' + "'" + identity + "' " + '-P ' + port + ' ' + user + '@' + ip + ':' + remote_dir +
matching_names[i].replace('/', '', 1) + ' ' + local_dir + matching_names[i].replace('/', '', 1))
Executable
+833
View File
@@ -0,0 +1,833 @@
#!/usr/bin/python3
# external modules
import sshync
from os import system as term
from os import remove
from os import environ
from shutil import move
from shutil import rmtree
from sys import argv
from re import search
from re import escape
import random
import string
# internal modules
def clear():
print('\n' * 100)
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):
xlines = open(file_name, 'r').readlines()
xlines[line_num] = text
open(file_name, 'w').writelines(xlines)
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():
shmfoldergen = ''.join(random.SystemRandom().choice(string.ascii_letters + string.digits)
for _ in range(random.randint(10, 30)))
shmentrygen = ''.join(random.SystemRandom().choice(string.ascii_letters + string.digits)
for _ in range(random.randint(10, 30)))
term('mkdir -p /dev/shm/' + shmfoldergen)
return shmfoldergen, shmentrygen
def encrypt():
term('gpg -r ' + str(gpgid) + ' -e ' + "'" + '/dev/shm/' + shmfolder + '/' + shmentry + "'")
move('/dev/shm/' + shmfolder + '/' + shmentry + '.gpg', directory + entryname.replace('/', '', 1) + '.gpg')
rmtree('/dev/shm/' + shmfolder)
def encryptfolder():
term('gpg -r ' + str(gpgid) + ' -e ' + "'" + '/dev/shm/' + shmfolder + '/' + shmentry + "'")
move('/dev/shm/' + shmfolder + '/' + shmentry + '.gpg', directory + folder + '/' + folderentry + '.gpg')
rmtree('/dev/shm/' + shmfolder)
# argument - filter the argument to usable text
argument = str(argv).replace('[', '', 1).replace(']', '', 1).replace(',', '').replace("'", '') \
.replace(' ', '', 1).replace('/usr/bin/', '', 1).replace('rpass', '', 1).replace('./', '', 1).replace('.py', '', 1)
# help
if argument == 'help' or argument == '--help' or argument == '-h':
print('\nrpass Copyright (C) 2021 Randall Winkhart')
print("This program comes with ABSOLUTELY NO WARRANTY; for details type `rpass show w'.\nThis is free software, "
"and you are welcome to redistribute it under certain conditions; type `rpass show c' for details.")
print('\nUSAGE: rpass [/<entry name>] [OPTION] [FLAG]\n')
print('Options: ')
print('help/--help/-h bring up this menu')
print('version/-v display rpass version info')
print('config configure rpass')
print('add add an entry')
print('gen generate a new password')
print('edit edit an existing entry')
print('copy copy details of an entry to your clipboard')
print('remove/-rm delete an existing entry')
print('sync/-s manually sync the entry directory via rsync\n')
print('Flags:')
print('add:')
print(' password/-p add a password entry')
print(' note/-n add a note entry')
print(' folder/-f add a new folder for entries')
print('edit:')
print(' rename/relocate/-r rename or relocate an entry')
print(' username/-u change the username of an entry')
print(' password/-p change the password of an entry')
print(' note/-n change the note attached to an entry')
print(' url/-l change the url attached to an entry')
print('copy:')
print(' username/-u copy the username of an entry to your clipboard')
print(' password/-p copy the password of an entry to your clipboard')
print(' url/-l copy the URL of an entry to your clipboard')
print(' note/-n copy the note of an entry to your clipboard')
print('gen:')
print(' update/-u generate a password for an existing entry\n')
print("Tip: You can quickly read an entry with 'rpass /<entry name>'!")
print("When specifying entry names, do not include the file extension! '.gpg' is assumed!\n")
# version info
if argument == 'version' or argument == '-v':
print('\n////////////////////////////////////////////////////////')
print('/ /')
print('/ rpass Copyright (C) 2021 Randall Winkhart /')
print('/ /')
print('/ Version 2021.10.18.mr5.1 /')
print('/ The Notetaker Update /')
print('/ /')
print('////////////////////////////////////////////////////////\n')
# licensing info
if argument == 'show w':
clear()
print('This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;')
print('without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.')
print('See the GNU General Public License for more details.')
print('\nhttps://opensource.org/licenses/GPL-3.0\n')
if argument == 'show c':
clear()
print('This program is free software: you can redistribute it and/or modify it under the terms of the GNU General')
print('Public License as published by the Free Software Foundation, either version 3 of the License,')
print('or (at your option) any later version.\n')
# config
if argument == 'config':
try:
print()
devicetype = str(input('Will this be a client, server, or offline device? (C/s/o) '))
if devicetype == 's' or devicetype == 'S':
open("/var/lib/rpass/rpass-device", 'w').write(devicetype)
print('\nMake sure the ssh service is running and properly configured.\n')
print('Configuration complete!\n')
else:
gpgid = ''
print()
gpgpresent = str(input(
'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':
print()
gpgid = str(input('Please input the ID of your gpg key: '))
open("/var/lib/rpass/rpass-gpg", 'w').write(gpgid + '\n')
else:
print()
gpggen = str(
input('Would you like to generate one now? Note that if you choose not to do this, you will have '
'to re-run "rpass config" to specify a gpg key when you acquire one (Y/n) '))
if gpggen == 'n' or gpggen == 'N':
exit()
else:
term('gpg --full-generate-key')
print()
gpgid = str(input('Please input the ID of your gpg key: '))
open("/var/lib/rpass/rpass-gpg", 'w').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':
open("/var/lib/rpass/rpass-device", 'w').write(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) '))
if sshgen != 'n' and sshgen != 'N':
term('ssh-keygen -t ed25519 -f ~/.ssh/rpass')
print('\nExample input: 10.10.10.10:9999\n')
ip_port = str(input('What is the IP and ssh port of the remote server? '))
print()
ip, sep, port = ip_port.partition(':')
usernamessh = str(input('What is the username of the remote server? '))
print('\nDefault directory: ' + '/home/' + usernamessh + '/.rpass-store/\n')
directoryssh = str(input('Is the remote server using the default password directory? (Y/n) '))
if directoryssh == 'n' or directoryssh == 'N':
print('\nFormat: /this/path/ends/with/a/slash/\n')
directoryssh = str(input('What directory is the server using?: '))
else:
directoryssh = ('/home/' + usernamessh + '/.rpass-store/')
open("/var/lib/rpass/rpass-device", 'w').write(devicetype)
sshync.make_profile('/var/lib/rpass/rpass.sshync', '/home/' + environ.get('USER') + '/.rpass-store/',
directoryssh, '/home/' + environ.get('USER') + '/.ssh/rpass', ip, port, usernamessh)
print('\nConfiguration complete!\n')
except KeyboardInterrupt:
print('\n\nConfiguration cancelled.\n')
exit()
# startup help
if argument == '':
clear()
print("Use 'help', '--help', or '-h' to see a list of commands.\n")
print('rpass is currently early software with very little polish\n')
# import userdata
try:
devicetype = open('/var/lib/rpass/rpass-device').read().strip()
gpgid = open("/var/lib/rpass/rpass-gpg").read().strip()
sshinfo = sshync.get_profile('/var/lib/rpass/rpass.sshync')
usernamessh = sshinfo[0].replace('\n', '')
ip = sshinfo[1].replace('\n', '')
port = sshinfo[2].replace('\n', '')
directory = str(sshinfo[3].replace('\n', ''))
directoryssh = sshinfo[4].replace('\n', '')
term('mkdir -p ' + directory)
except FileNotFoundError:
print('\n!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!')
print("Not all necessary configuration files are present. Please run 'rpass config'!")
print('!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!\n')
devicetype, sshinfo, directory, directoryssh, ip, port, usernamessh = [0, 0, 0, 0, 0, 0, 0]
exit()
# no argument
if argument == '':
try:
print()
term('cd ' + directory + '; ls -1 *')
print()
readentry = str(input('Entry to read: '))
clear()
term('gpg -d ' + directory + "'" + readentry.replace('/', '', 1) + "'" + '.gpg')
print()
except KeyboardInterrupt:
print('\n\nSelection cancelled.\n')
exit()
# read shortcut
if argument.startswith('/'):
if argument.replace('/', '', 1).__contains__('/'):
folder, sep, folderentry = argument.replace('/', '', 1).partition('/')
term('gpg -d ' + directory + folder + '/' + "'" + folderentry + '.gpg' + "'")
else:
term('gpg -d ' + directory + "'" + argument.replace('/', '', 1) + '.gpg' + "'")
# add
if argument == 'add':
print('\nUSAGE: rpass add [FLAG]')
print('Flags:')
print('add:')
print(' password/-p add a password entry')
print(' note/-n add a note entry')
print(' folder/-f add a new folder for entries\n')
if argument == 'add note' or argument == 'add -n':
try:
clear()
entryname = str(input('Name of note: '))
except KeyboardInterrupt:
entryname, notes = (0, 0)
print('\n\nEntry add cancelled.\n')
exit()
shmfolder, shmentry = shmgen()
term('nano /dev/shm/' + shmfolder + '/' + shmentry + '-n')
notes = open('/dev/shm/' + shmfolder + '/' + shmentry + '-n', 'r').read()
try:
if entryname.startswith('/'): # check if user input contains slashes
if entryname.replace('/', '', 1).__contains__('/'): # create folder and entry if there are two slashes
folder, sep, folderentry = entryname.replace('/', '', 1).partition('/')
open('/dev/shm/' + shmfolder + '/' + shmentry, 'w').writelines('\n\n\n\n' + notes + '\n\n')
encryptfolder()
term('gpg -d ' + directory + folder + '/' + "'" + folderentry + '.gpg' + "'")
else: # create entry if there is only one slash
open('/dev/shm/' + shmfolder + '/' + shmentry, 'w').writelines('\n\n\n\n' + notes + '\n\n')
encrypt()
term('gpg -d ' + directory + "'" + entryname.replace('/', '', 1) + '.gpg' + "'")
else: # create entry if there are no slashes
open('/dev/shm/' + shmfolder + '/' + shmentry, 'w').writelines('\n\n\n\n' + notes + '\n\n')
encrypt()
term('gpg -d ' + directory + "'" + entryname + '.gpg' + "'")
except FileNotFoundError:
print('\n!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!')
print('The folder you requested to access does not exist!')
print('!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!\n')
rmtree('/dev/shm/' + shmfolder)
exit()
open("/var/lib/rpass/mod_time", 'w').write('add')
if argument == 'add password' or argument == 'add -p':
try:
clear()
entryname = str(input('Name of service: '))
username = str(input('Username: '))
password = str(input('Password: '))
url = str(input('URL: '))
except KeyboardInterrupt:
entryname, username, password, url, notes = (0, 0, 0, 0, 0)
print('\n\nEntry add cancelled.\n')
exit()
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:
if entryname.startswith('/'):
if entryname.replace('/', '', 1).__contains__('/'):
folder, sep, folderentry = entryname.replace('/', '', 1).partition('/')
open('/dev/shm/' + shmfolder + '/' + shmentry, 'w').writelines(username + '\n' + password + '\n' + url
+ '\n\n' + notes + '\n\n')
encryptfolder()
term('gpg -d ' + directory + folder + '/' + "'" + folderentry + '.gpg' + "'")
else:
open('/dev/shm/' + shmfolder + '/' + shmentry, 'w').writelines(username + '\n' + password + '\n' + url
+ '\n\n' + notes + '\n\n')
encrypt()
term('gpg -d ' + directory + "'" + entryname.replace('/', '', 1) + '.gpg' + "'")
else:
open('/dev/shm/' + shmfolder + '/' + shmentry, 'w').writelines(username + '\n' + password + '\n' + url
+ '\n\n' + notes + '\n\n')
encrypt()
term('gpg -d ' + directory + "'" + entryname + '.gpg' + "'")
except FileNotFoundError:
print('\n!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!')
print('The folder you requested to access does not exist!')
print('!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!\n')
rmtree('/dev/shm/' + shmfolder)
exit()
open("/var/lib/rpass/mod_time", 'w').write('add')
if argument == 'add folder' or argument == 'add -f':
newfolder = str(input('Name of new folder: '))
term('mkdir ' + "'" + directory + newfolder + "'")
open("/var/lib/rpass/mod_time", 'w').write('add')
# edit
if argument == 'edit':
print('\nUSAGE: rpass edit [FLAG]')
print('Flags:')
print('edit:')
print(' rename/relocate/-r rename or relocate an entry')
print(' username/-u change the username of an entry')
print(' password/-p change the password of an entry')
print(' url/-l change the url attached to an entry')
print(' note/-n change the note attached to an entry\n')
if argument == 'edit rename' or argument == 'edit relocate' or argument == 'edit -r':
try:
clear()
term('cd ' + directory + '; ls -1 *')
print()
entryname = str(input('What file would you like to edit? '))
newname = str(input('New Name: '))
if entryname.startswith('/'):
if entryname.replace('/', '', 1).__contains__('/'):
folder, sep, folderentry = entryname.replace('/', '', 1).partition('/')
move(directory + folder + '/' + folderentry + '.gpg', directory + '/' + newname + '.gpg')
else:
move(directory + entryname.replace('/', '', 1) + '.gpg',
directory + newname.replace('/', '', 1) + '.gpg')
else:
move(directory + entryname + '.gpg', directory + newname + '.gpg')
except KeyboardInterrupt:
print('\n\nEdit cancelled.\n')
exit()
except FileNotFoundError:
print('\n!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!')
print('The file you requested to edit does not exist!')
print('!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!\n')
exit()
open("/var/lib/rpass/mod_time", 'w').write('edit')
if argument == 'edit username' or argument == 'edit -u':
try:
clear()
term('cd ' + directory + '; ls -1 *')
print()
entryname = str(input('What file would you like to edit? '))
username = str(input('New Username: '))
except KeyboardInterrupt:
entryname, username = (0, 0)
print('\n\nEdit cancelled.\n')
exit()
shmfolder, shmentry = shmgen()
try:
if entryname.startswith('/'):
if entryname.replace('/', '', 1).__contains__('/'):
folder, sep, folderentry = entryname.replace('/', '', 1).partition('/')
term('gpg -d --output /dev/shm/' + shmfolder + '/' + shmentry + ' ' + directory +
folder + '/' + folderentry + '.gpg')
replace_line('/dev/shm/' + shmfolder + '/' + shmentry, 0, username + '\n')
remove(directory + folder + '/' + folderentry + '.gpg')
encryptfolder()
term('gpg -d ' + directory + folder + '/' + "'" + folderentry + '.gpg' + "'")
else:
term('gpg -d --output /dev/shm/' + shmfolder + '/' + shmentry + ' ' + directory +
entryname.replace('/', '', 1) + '.gpg')
replace_line('/dev/shm/' + shmfolder + '/' + shmentry, 0, username + '\n')
remove(directory + entryname.replace('/', '', 1) + '.gpg')
encrypt()
term('gpg -d ' + directory + "'" + entryname.replace('/', '', 1) + '.gpg' + "'")
else:
term('gpg -d --output /dev/shm/' + shmfolder + '/' + shmentry + ' ' + directory + entryname + '.gpg')
replace_line('/dev/shm/' + shmfolder + '/' + shmentry, 0, username + '\n')
remove(directory + entryname + '.gpg')
encrypt()
term('gpg -d ' + directory + "'" + entryname + '.gpg' + "'")
except FileNotFoundError:
print('\n!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!')
print('The file you requested to edit does not exist!')
print('!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!\n')
rmtree('/dev/shm/' + shmfolder)
exit()
open("/var/lib/rpass/mod_time", 'w').write('edit')
if argument == 'edit password' or argument == 'edit -p':
try:
clear()
term('cd ' + directory + '; ls -1 *')
print()
entryname = str(input('What file would you like to edit? '))
password = str(input('New Password: '))
except KeyboardInterrupt:
entryname, password = (0, 0)
print('\n\nEdit cancelled.\n')
exit()
shmfolder, shmentry = shmgen()
try:
if entryname.startswith('/'):
if entryname.replace('/', '', 1).__contains__('/'):
folder, sep, folderentry = entryname.replace('/', '', 1).partition('/')
term('gpg -d --output /dev/shm/' + shmfolder + '/' + shmentry + ' ' + directory +
folder + '/' + folderentry + '.gpg')
replace_line('/dev/shm/' + shmfolder + '/' + shmentry, 1, password + '\n')
remove(directory + folder + '/' + folderentry + '.gpg')
encryptfolder()
term('gpg -d ' + directory + folder + '/' + "'" + folderentry + '.gpg' + "'")
else:
term('gpg -d --output /dev/shm/' + shmfolder + '/' + shmentry + ' ' + directory +
entryname.replace('/', '', 1) + '.gpg')
replace_line('/dev/shm/' + shmfolder + '/' + shmentry, 1, password + '\n')
remove(directory + entryname.replace('/', '', 1) + '.gpg')
encrypt()
term('gpg -d ' + directory + "'" + entryname.replace('/', '', 1) + '.gpg' + "'")
else:
term('gpg -d --output /dev/shm/' + shmfolder + '/' + shmentry + ' ' + directory + entryname + '.gpg')
replace_line('/dev/shm/' + shmfolder + '/' + shmentry, 1, password + '\n')
remove(directory + entryname + '.gpg')
encrypt()
term('gpg -d ' + directory + "'" + entryname + '.gpg' + "'")
except FileNotFoundError:
print('\n!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!')
print('The file you requested to edit does not exist!')
print('!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!\n')
rmtree('/dev/shm/' + shmfolder)
exit()
open("/var/lib/rpass/mod_time", 'w').write('edit')
if argument == 'edit url' or argument == 'edit -l':
try:
clear()
term('cd ' + directory + '; ls -1 *')
print()
entryname = str(input('What file would you like to edit? '))
url = str(input('New URL: '))
except KeyboardInterrupt:
entryname, url = (0, 0)
print('\n\nEdit cancelled.\n')
exit()
shmfolder, shmentry = shmgen()
try:
if entryname.startswith('/'):
if entryname.replace('/', '', 1).__contains__('/'):
folder, sep, folderentry = entryname.replace('/', '', 1).partition('/')
term('gpg -d --output /dev/shm/' + shmfolder + '/' + shmentry + ' ' + directory +
folder + '/' + folderentry + '.gpg')
replace_line('/dev/shm/' + shmfolder + '/' + shmentry, 2, url + '\n')
remove(directory + folder + '/' + folderentry + '.gpg')
encryptfolder()
term('gpg -d ' + directory + folder + '/' + "'" + folderentry + '.gpg' + "'")
else:
term('gpg -d --output /dev/shm/' + shmfolder + '/' + shmentry + ' ' + directory +
entryname.replace('/', '', 1) + '.gpg')
replace_line('/dev/shm/' + shmfolder + '/' + shmentry, 2, url + '\n')
remove(directory + entryname.replace('/', '', 1) + '.gpg')
encrypt()
term('gpg -d ' + directory + "'" + entryname.replace('/', '', 1) + '.gpg' + "'")
else:
term('gpg -d --output /dev/shm/' + shmfolder + '/' + shmentry + ' ' + directory + entryname + '.gpg')
replace_line('/dev/shm/' + shmfolder + '/' + shmentry, 2, url + '\n')
remove(directory + entryname + '.gpg')
encrypt()
term('gpg -d ' + directory + "'" + entryname + '.gpg' + "'")
except FileNotFoundError:
print('\n!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!')
print('The file you requested to edit does not exist!')
print('!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!\n')
rmtree('/dev/shm/' + shmfolder)
exit()
open("/var/lib/rpass/mod_time", 'w').write('edit')
if argument == 'edit note' or argument == 'edit -n':
try:
clear()
term('cd ' + directory + '; ls -1 *')
print()
entryname = str(input('What file would you like to edit? '))
except KeyboardInterrupt:
entryname, notes = (0, 0)
print('\n\nEdit cancelled.\n')
exit()
shmfolder, shmentry = shmgen()
try:
if entryname.startswith('/'):
if entryname.replace('/', '', 1).__contains__('/'):
folder, sep, folderentry = entryname.replace('/', '', 1).partition('/')
term('gpg -d --output /dev/shm/' + shmfolder + '/' + shmentry + ' ' + directory +
folder + '/' + folderentry + '.gpg')
edit_note()
remove(directory + folder + '/' + folderentry + '.gpg')
encryptfolder()
term('gpg -d ' + directory + folder + '/' + "'" + folderentry + '.gpg' + "'")
else:
term('gpg -d --output /dev/shm/' + shmfolder + '/' + shmentry + ' ' + directory +
entryname.replace('/', '', 1) + '.gpg')
edit_note()
remove(directory + entryname.replace('/', '', 1) + '.gpg')
encrypt()
term('gpg -d ' + directory + "'" + entryname.replace('/', '', 1) + '.gpg' + "'")
else:
term('gpg -d --output /dev/shm/' + shmfolder + '/' + shmentry + ' ' + directory + entryname + '.gpg')
edit_note()
remove(directory + entryname + '.gpg')
encrypt()
term('gpg -d ' + directory + "'" + entryname + '.gpg' + "'")
except FileNotFoundError:
print('\n!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!')
print('The file you requested to edit does not exist!')
print('!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!\n')
rmtree('/dev/shm/' + shmfolder)
exit()
open("/var/lib/rpass/mod_time", 'w').write('edit')
# copy
if argument == 'copy':
print('\nUSAGE: rpass copy [FLAG]')
print('Flags:')
print('copy:')
print(' username/-u copy the username of an entry to your clipboard')
print(' password/-p copy the password of an entry to your clipboard')
print(' url/-l copy the URL of an entry to your clipboard')
print(' note/-n copy the note of an entry to your clipboard\n')
if argument == 'copy username' or argument == 'copy -u':
try:
print()
term('cd ' + directory + '; ls -1 *')
print()
readentry = str(input('Entry to copy: '))
except KeyboardInterrupt:
readentry = 0
print('\n\nCopy cancelled.\n')
exit()
shmfolder, shmentry = shmgen()
try:
term('gpg -d --output /dev/shm/' + shmfolder + '/' + shmentry + ' ' + directory + readentry + '.gpg')
copyline = open('/dev/shm/' + shmfolder + '/' + shmentry, 'r').readlines()
if environ.get('WAYLAND_DISPLAY') == 'wayland-0':
term('wl-copy ' + "'" + copyline[0].replace('\n', '') + "'")
else:
term('echo -n ' + "'" + copyline[0].replace('\n', '') + "'" + ' | xclip -sel c')
rmtree('/dev/shm/' + shmfolder)
except FileNotFoundError:
print('\n!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!')
print('The file you requested to edit does not exist!')
print('!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!\n')
rmtree('/dev/shm/' + shmfolder)
exit()
open("/var/lib/rpass/mod_time", 'w').write('copy')
if argument == 'copy password' or argument == 'copy -p':
try:
print()
term('cd ' + directory + '; ls -1 *')
print()
readentry = str(input('Entry to copy: '))
except KeyboardInterrupt:
readentry = 0
print('\n\nCopy cancelled.\n')
exit()
shmfolder, shmentry = shmgen()
try:
term('gpg -d --output /dev/shm/' + shmfolder + '/' + shmentry + ' ' + directory + readentry + '.gpg')
copyline = open('/dev/shm/' + shmfolder + '/' + shmentry, 'r').readlines()
if environ.get('WAYLAND_DISPLAY') == 'wayland-0':
term('wl-copy ' + "'" + copyline[1].replace('\n', '').replace("'", "'\\''") + "'")
else:
term('echo -n ' + "'" + copyline[1].replace('\n', '').replace("'", "'\\''") + "'" + ' | xclip -sel c')
rmtree('/dev/shm/' + shmfolder)
except FileNotFoundError:
print('\n!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!')
print('The file you requested to edit does not exist!')
print('!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!\n')
rmtree('/dev/shm/' + shmfolder)
exit()
open("/var/lib/rpass/mod_time", 'w').write('copy')
if argument == 'copy url' or argument == 'copy -l':
try:
print()
term('cd ' + directory + '; ls -1 *')
print()
readentry = str(input('Entry to copy: '))
except KeyboardInterrupt:
readentry = 0
print('\n\nCopy cancelled.\n')
exit()
shmfolder, shmentry = shmgen()
try:
term('gpg -d --output /dev/shm/' + shmfolder + '/' + shmentry + ' ' + directory + readentry + '.gpg')
copyline = open('/dev/shm/' + shmfolder + '/' + shmentry, 'r').readlines()
if environ.get('WAYLAND_DISPLAY') == 'wayland-0':
term('wl-copy ' + "'" + copyline[2].replace('\n', '') + "'")
else:
term('echo -n ' + "'" + copyline[2].replace('\n', '') + "'" + ' | xclip -sel c')
rmtree('/dev/shm/' + shmfolder)
except FileNotFoundError:
print('\n!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!')
print('The file you requested to edit does not exist!')
print('!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!\n')
rmtree('/dev/shm/' + shmfolder)
exit()
open("/var/lib/rpass/mod_time", 'w').write('copy')
if argument == 'copy note' or argument == 'copy -n':
try:
print()
term('cd ' + directory + '; ls -1 *')
print()
readentry = str(input('Entry to copy: '))
except KeyboardInterrupt:
readentry = 0
print('\n\nCopy cancelled.\n')
exit()
shmfolder, shmentry = shmgen()
try:
term('gpg -d --output /dev/shm/' + shmfolder + '/' + shmentry + ' ' + directory + readentry + '.gpg')
copyline = open('/dev/shm/' + shmfolder + '/' + shmentry, 'r').readlines()
if environ.get('WAYLAND_DISPLAY') == 'wayland-0':
term('wl-copy ' + "'" + copyline[4].replace('\n', '') + "'")
else:
term('echo -n ' + "'" + copyline[4].replace('\n', '') + "'" + ' | xclip -sel c')
rmtree('/dev/shm/' + shmfolder)
except FileNotFoundError:
print('\n!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!')
print('The file you requested to edit does not exist!')
print('!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!\n')
rmtree('/dev/shm/' + shmfolder)
exit()
open("/var/lib/rpass/mod_time", 'w').write('copy')
# gen
if argument == 'gen':
try:
clear()
entryname = str(input('Name of service: '))
username = str(input('Username: '))
passlength = int(input('How many characters should be in the password? '))
passtype = str(input('Should the password be simple (for compatibility) or complex (for security)? (s/C) '))
if passtype != 's':
passtype = string.ascii_letters + string.digits + string.punctuation
if passtype == 's':
passtype = string.ascii_letters + string.digits
passgen = ''.join(random.SystemRandom().choice(passtype) for _ in range(passlength))
url = str(input('URL: '))
notes = str(input('Additional notes: '))
except KeyboardInterrupt:
entryname, username, passgen, url, notes = (0, 0, 0, 0, 0)
print('\n\nEntry generation cancelled.\n')
exit()
shmfolder, shmentry = shmgen()
try:
if entryname.startswith('/'):
if entryname.replace('/', '', 1).__contains__('/'):
folder, sep, folderentry = entryname.replace('/', '', 1).partition('/')
open('/dev/shm/' + shmfolder + '/' + shmentry, 'w').writelines(username + '\n' + passgen + '\n' + url
+ '\n' + notes + '\n\n')
encryptfolder()
term('gpg -d ' + directory + folder + '/' + "'" + folderentry + '.gpg' + "'")
else:
open('/dev/shm/' + shmfolder + '/' + shmentry, 'w').writelines(username + '\n' + passgen + '\n' + url
+ '\n' + notes + '\n\n')
encrypt()
term('gpg -d ' + directory + "'" + entryname.replace('/', '', 1) + '.gpg' + "'")
else:
open('/dev/shm/' + shmfolder + '/' + shmentry, 'w').writelines(username + '\n' + passgen + '\n' + url
+ '\n' + notes + '\n\n')
encrypt()
term('gpg -d ' + directory + "'" + entryname + '.gpg' + "'")
except FileNotFoundError:
print('\n!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!')
print('The folder you requested to access does not exist!')
print('!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!\n')
rmtree('/dev/shm/' + shmfolder)
exit()
open("/var/lib/rpass/mod_time", 'w').write('gen')
if argument == 'gen update' or argument == 'gen -u':
try:
clear()
term('cd ' + directory + '; ls -1 *')
print()
entryname = str(input('Which password would you like to re-generate? '))
passlength = int(input('How many characters should be in the password? '))
passtype = str(input('Should the password be simple (for compatibility) or complex (for security)? (s/C) '))
except KeyboardInterrupt:
entryname, passlength, passtype = (0, 0, 0)
print('\n\nEntry generation cancelled.\n')
exit()
shmfolder, shmentry = shmgen()
try:
if passtype != 's':
passtype = string.ascii_letters + string.digits + string.punctuation
if passtype == 's':
passtype = string.ascii_letters + string.digits
passgen = ''.join(random.SystemRandom().choice(passtype) for _ in range(passlength))
if entryname.startswith('/'):
if entryname.replace('/', '', 1).__contains__('/'):
folder, sep, folderentry = entryname.replace('/', '', 1).partition('/')
term('gpg -d --output /dev/shm/' + shmfolder + '/' + shmentry + ' ' + directory +
folder + '/' + folderentry + '.gpg')
replace_line('/dev/shm/' + shmfolder + '/' + shmentry, 1, passgen + '\n')
remove(directory + folder + '/' + folderentry.replace('/', '', 1) + '.gpg')
encryptfolder()
term('gpg -d ' + directory + folder + '/' + "'" + folderentry + '.gpg' + "'")
else:
term('gpg -d --output /dev/shm/' + shmfolder + '/' + shmentry + ' ' + directory +
entryname.replace('/', '', 1) + '.gpg')
replace_line('/dev/shm/' + shmfolder + '/' + shmentry, 1, passgen + '\n')
remove(directory + entryname.replace('/', '', 1) + '.gpg')
encrypt()
term('gpg -d ' + directory + "'" + entryname.replace('/', '', 1) + '.gpg' + "'")
else:
term('gpg -d --output /dev/shm/' + shmfolder + '/' + shmentry + ' ' + directory + entryname + '.gpg')
replace_line('/dev/shm/' + shmfolder + '/' + shmentry, 1, passgen + '\n')
remove(directory + entryname + '.gpg')
encrypt()
term('gpg -d ' + directory + "'" + entryname + '.gpg' + "'")
except FileNotFoundError:
print('\n!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!')
print('The file you requested to edit does not exist!')
print('!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!\n')
rmtree('/dev/shm/' + shmfolder)
exit()
open("/var/lib/rpass/mod_time", 'w').write('gen')
# remove
if argument == 'remove' or argument == '-rm':
clear()
term('cd ' + directory + '; ls -1 *')
print()
try:
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.replace('/', '', 1).__contains__('/'):
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':
term('ssh -p ' + port + ' ' + usernamessh + '@' + ip + ' "' + ' rm -rf ' + "'" + directoryssh +
entryname.replace('/', '', 1) + "'" + '"')
rmtree(directory + entryname.replace('/', '', 1))
else:
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')
exit()
except FileNotFoundError:
print('\n!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!')
print('The file you requested to delete does not exist!')
print('!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!\n')
exit()
open("/var/lib/rpass/mod_time", 'w').write('rm')
if argument.__contains__('-rm') or string_found('remove', argument) or string_found('add', argument) or \
string_found('edit', argument) or string_found('gen', argument) or string_found('copy', argument) or \
string_found('/', argument) or argument == 'sync' or argument == '-s' or argument == '' or argument == 'help' \
or argument == '--help' or argument == '-h' or argument == 'version' or argument == '-v' or argument == \
'config' or argument == 'show w' or argument == 'show c':
pass
else:
print('\n!!!!!!!!!!!!!!!')
print('Argument error!')
print('!!!!!!!!!!!!!!!')
print("\nUse 'help', '--help', or '-h' to see a list of commands.\n")
# permissions - applied pre-sync to ensure permissions are correct before upload
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':
if argument.__contains__('-rm') or string_found('remove', argument) or string_found('add', argument) or \
string_found('edit', argument) or string_found('gen', argument) or argument == 'sync' or argument == '-s':
print('Syncing entries with other device(s)...\n')
sshync.run_profile('/var/lib/rpass/rpass.sshync')
+258
View File
@@ -0,0 +1,258 @@
<><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><>
rpass 2021.11.01.mr5.1
The Notetaker Update - Patch 1
This is the FINAL release of "rpass".
After this release, the project will be rebranded as "sshyp".
rpass's syncing system is fundamentally broken, hence the need for "sshyp"
and its new syncing system. I would highly advise against using this release.
New features:
- none
Changes:
- fixed an issue with copying notes (currently only copies first line, will be changed in the future)
- rpass is validated to work with Python 3.10 (no changes were needed)
Planned for next update (sshyp fr1)
- full project rebrand ("sshyp")
- new syncing back-end
<><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><>
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
The Housekeeping Update (Pt. 1) - Hotfix
Changes:
- the user is once again properly presented with a prompt to enter a gpg key when pressing enter through the config dialog
<><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><>
rpass-2021.09.15.mr4
The Housekeeping Update (Pt. 1) - Fourth main release of rpass
This release focuses primarily on polishing rpass and tying up loose ends before
making any major changes in the future.
New features:
- added clipboard support for copying entry information
- many common errors are now handled with proper exceptions
- offline support (sync no longer needs to be configured for rpass to function)
Changes:
- fixed gpg decryption warnings
- added version info argument
- re-ordered config wizard to make more sense
- entry deletion can now be done client-side
- removed rsyncup/rsyncdown/username/ip/port/directoryssh files,
^ replaced with one file that holds usernamessh, ip, port, directoryssh, and devicetype
- files should no longer be left in /dev/shm when an error is encountered
- fixed issues relating to using a non-default entry directory
- lots of optimizations have been made to reduce the size of rpass
Planned for next update (The Housekeeping Update Pt. 2):
- a clean, colorful entry list w/o file extensions
- manpage
- multi-line notes
- commented the code
- ability to pass entries as arguments for more functions
- improve exceptions for unknown arguments
Planned, no timeline:
- possible libsecret integration
- 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)
- auto-completion on tab (currently unsure of best way to make this work)
<><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><>
rpass 2021.09.07.pr3.1
The Sync and Foundations Update - Hotfix
Changes:
- gpg configuration now prompts for expiration, rather than defaulting to two years
- rsync is now configured to not delete anything from any remote device when uploading
^ this behavior may be modified in the future - this is a quick fix to prevent data loss
<><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><>
rpass 2021.09.07.pr3
The Sync and Foundations Update - Third public release of rpass.
As of this version, rpass has its intended base set of features and is considered usable.
It will now primarily recieve bug fixes and polish updates to prepare it to go
cross-platform and to make it compatible with GUI frontends.
New features:
- rsync support!
- new entry format with URL field (for future use)
- the temporary directory (/dev/shm) for editing entries has been somewhat secured
Changes:
- 'rpass edit relocate' is now properly bound
- dropped the use of 'echo'
- added 'rsync' and 'openssh' as dependencies
- fixed a bug with deleting entries from folders
- entry directory now has more secure permissions
^ these permissions are re-enforced every time rpass is used
- fixed some small typos and potential bugs, made some small optimizations
Planned for next update (The Housekeeping Update):
- move to github
- get rid of gpg decryption warnings
- proper error messages using 'except'
- add exceptions for unknown arguments
- cleanup file list by exporting to document and removing .gpg, adding color
- add a manpage
- allow notes to be multiple lines long (break lines after so many characters)
- validate for Python 3.10
- properly comment the code
Planned, no timeline:
- allow to function as alternative to gnome keyring (libsecret integration)
- 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)
- ability to pass entries as arguments for more functions
- auto-completion on tab (currently unsure of best way to make this work)
<><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><>
rpass 2021.09.02.pr2
The Folder Update - Second public release of rpass.
New features:
- entry and folder titles can now have spaces and be as long as you want
- entires and folders can now be deleted with 'rpass remove' or 'rpass -rm'
- entries now properly save to folders via 'rpass add' and should no longer throw errors
- entries saved in folders are now readable
- existing entries can now be moved to, from, and between folders
- previews are now shown after creating or editing an entry
Changes:
- every pre-existing function of rpass has been updated to work with the new folder system
- dropped awk as a dependency
- removed 'argument' file in /var/lib/rpass
- reduced unneccessary characters in argument parsing to decrease compatibility issues
- ensured all user input is handled correctly as a string or an integer
- lots of miscellaneous optimizations
Expected for next update (The rsync Update):
- rsync (over ssh) support!
^ including any fixes, changes, or optimizations necessary to make that happen
- new file formatting with support for URLs
^all entries created in new format should be compatible with future versions of rpass
- secure /dev/shm with random text generator
Expected for the next (next) update (The Housekeeping Update)
- get rid of gpg decryption warnings
- proper error messages using 'except'
- add exceptions for unknown arguments
- cleanup file list by exporting to document and removing .gpg, adding color
Planned, no timeline:
- make platform agnostic (basically, add windows support)
- create separate gui frontend targetting mobile devices (first linux phones, android at a later date)
^ the gui will also function on desktop linux
- ability to pass entries as arguments for more functions
- auto-completion on tab
<><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><>
rpass 2021.09.01.pr1.1
First public release of rpass.
Early build, missing critical features (e.g. sync support and the ability to have spaces in filenames).
What is currently functional:
- guided configuration wizard
- generate passwords
- add existing passwords
- make notes
- sort notes and passwords into folders
- gpg encryption
- edit password/note entries
<><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><>
+46
View File
@@ -0,0 +1,46 @@
sshyp 2021.11.01.fr1
First public release of sshyp.
This release fixes major bugs from rpass and rebrands the project.
New features:
- an entirely new syncing back-end called sshync (custom Python wrapper around sftp)
^ in thoery, all syncing-related data loss should now be fixed, however, this new
system has just been created and is still under testing. Maybe wait for a few patches
before trusting this system.
Changes:
- branding has been updated to reflect new project name and goals
Planned for next update (The Fluffy Update):
- modularized and optimized code
^ some older, bad code from "rpass" will be re-written.
- new visual features
^ this includes the new file list and thematic text art. sshyp will be
getting a retro computing theme.
- packages for more environments
^ "sshyp" will be officially packaged for Arch Linux, Alpine Linux, and Termux (Android).
Debian/Ubuntu and Fedora packaging will come later.
Planned for next update (The Sheep w/Shears Update):
- allow for copying entire notes (not just first line)
- allow for multi-client deletion... somehow
- ability to pass entries as arguments for more functions
- detatch sshync and make it a separate package
- manpage
Planned, no timeline:
- create separate gui frontend targetting mobile devices (first Android + Linux phones - 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 Debian and Fedora)
- auto-completion on tab (currently unsure of best way to make this work)
<><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><>
Future changelogs will include a link to the complete history of patches across rpass and sshyp.
+15
View File
@@ -0,0 +1,15 @@
rpass is a FOSS password manager that takes advantage of rsync
Copyright (C) 2021 Randall Winkhart idgr@tutanota.com
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.