Re-ordered config wizard for better rsync support

This commit is contained in:
2021-09-08 00:54:00 -04:00
parent f06684798d
commit 5c457e4ec0
3 changed files with 55 additions and 57 deletions
+15 -17
View File
@@ -1,9 +1,5 @@
#!/usr/bin/python #!/usr/bin/python
# rpass 2021.09.08.pr4
# rpass is the gnu pass alternative for those who don't want to use git
# rpass is freely licensed for modification and redistribution under the GNU General Public License V3
from os import system from os import system
from os import remove from os import remove
from os import environ from os import environ
@@ -115,7 +111,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.08.pr4 /') print('/ Version 2021.09.08.pr4 /')
print('/ The Housekeeping Update (Pt. 1) /')
print('/ /') print('/ /')
print('////////////////////////////////////////////////////////') print('////////////////////////////////////////////////////////')
print() print()
@@ -154,6 +151,13 @@ if argument == 'config':
with open("/var/lib/rpass/rpassdir", 'w') as f: with open("/var/lib/rpass/rpassdir", 'w') as f:
f.write(directory + '\n') f.write(directory + '\n')
print() print()
devicetype = str(input('Will this be a client or a server device? (c/S) '))
if devicetype != 'c':
print()
print('Make sure the ssh service is running and properly configured.')
print()
if devicetype == 'c':
print()
gpgpresent = str(input('rpass requires the use of a unique gpg key. Do you already have one you are willing to ' gpgpresent = str(input('rpass requires the use of a unique gpg key. Do you already have one you are willing to '
'use? (y/N) ')) 'use? (y/N) '))
if gpgpresent == 'y' or gpgpresent == 'Y': if gpgpresent == 'y' or gpgpresent == 'Y':
@@ -163,7 +167,8 @@ if argument == 'config':
f.write(gpgid + '\n') f.write(gpgid + '\n')
if gpgpresent != 'y': if gpgpresent != 'y':
print() print()
gpggen = str(input('Would you like to generate one now? Note that if you choose not to do this, you will have ' 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) ')) 'to re-run "rpass config" to specify a gpg key when you acquire one (Y/n) '))
if gpggen != 'n': if gpggen != 'n':
term('gpg --full-generate-key') term('gpg --full-generate-key')
@@ -174,23 +179,13 @@ if argument == 'config':
if gpggen == 'n' or gpggen == 'N': if gpggen == 'n' or gpggen == 'N':
exit() exit()
print() print()
syncsetup = str(input('Would you like to configure rsync over ssh for entry backup and syncing? (Y/n) ')) print('Make sure the ssh service on the remote server is running and properly configured.')
if syncsetup != 'n':
print() print()
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': if sshgen != 'n':
term('ssh-keygen -f ~/.ssh/rpass') term('ssh-keygen -f ~/.ssh/rpass')
print() print()
print('The server device(s) should be configured first.')
print()
devicetype = str(input('Will this be a client or a server device? (c/S) '))
if devicetype != 'c':
print()
print('Make sure the ssh service is running and that the proper port is forwarded.')
if devicetype == 'c':
print()
print('Make sure the ssh service is running and that the proper port is forwarded on the remote server.')
print('Example input: 10.10.10.10:9999') print('Example input: 10.10.10.10:9999')
print() print()
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? '))
@@ -218,6 +213,9 @@ if argument == 'config':
directoryssh = str(input('What directory is the server using?: ')) directoryssh = str(input('What directory is the server using?: '))
with open("/var/lib/rpass/rpassdirssh", 'w') as f: with open("/var/lib/rpass/rpassdirssh", 'w') as f:
f.write(directoryssh + '\n') f.write(directoryssh + '\n')
print()
print('Configuration complete!')
print()
# import userdata # import userdata
+3 -3
View File
@@ -2,14 +2,14 @@
rpass-2021.09.08.pr4 rpass-2021.09.08.pr4
The Housekeeping Update - Fourth public release of rpass The Housekeeping Update (Pt. 1) - Fourth public release of rpass
This release focuses primarily on polishing rpass and tying up loose ends before This release focuses primarily on polishing rpass and tying up loose ends before
making any major changes in the future. making any major changes in the future.
New features: New features:
**overhaul error message using exceptions **overhaul error messages using exceptions
**add exceptions for unknown arguments **add exceptions for unknown arguments
**make clean, colorful file list by exporting to document and removing extensions **make clean, colorful file list by exporting to document and removing extensions
**make a manpage **make a manpage
@@ -19,8 +19,8 @@ Changes:
- fixed gpg decryption warnings - fixed gpg decryption warnings
- added version info argument - added version info argument
- re-ordered config wizard for better rsync support
**optimize code (specifically for when there is no folder but there is a slash) **optimize code (specifically for when there is no folder but there is a slash)
**update rsync config wizard
**fix rsync delete on upload **fix rsync delete on upload
**properly comment the code **properly comment the code
**validate for Python 3.10 **validate for Python 3.10
View File