Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
F
freedombone
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Context Sensitive Group
freedombone
Commits
e4304ced
Commit
e4304ced
authored
7 years ago
by
Bob Mottram
Browse files
Options
Downloads
Patches
Plain Diff
Update muttrc after key reconstruction
parent
7c2df014
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/freedombone-utils-gpg
+14
-0
14 additions, 0 deletions
src/freedombone-utils-gpg
src/freedombone-utils-keys
+5
-3
5 additions, 3 deletions
src/freedombone-utils-keys
with
19 additions
and
3 deletions
src/freedombone-utils-gpg
+
14
−
0
View file @
e4304ced
...
...
@@ -28,6 +28,20 @@
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
function
gpg_update_mutt
{
key_username
=
$1
if
[
!
-f
/home/
$key_username
/.muttrc
]
;
then
return
fi
CURR_EMAIL_ADDRESS
=
$key_username
@
$HOSTNAME
CURR_GPG_ID
=
$(
gpg
--homedir
=
/home/
$key_username
/.gnupg
--list-keys
$CURR_EMAIL_ADDRESS
|
sed
-n
'2p'
|
sed
's/^[ \t]*//'
)
sed
-i
"s|set pgp_encrypt_only_command.*|set pgp_encrypt_only_command=
\"
/usr/lib/mutt/pgpewrap gpg --batch --quiet --no-verbose --output - --encrypt --textmode --armor --trust-model always --encrypt-to
$CURR_GPG_ID
-- -r %r -- %f
\"
|g"
/home/
$key_username
/.muttrc
chown
$key_username
:
$key_username
/home/
$key_username
/.muttrc
}
function
gpg_import_public_key
{
key_username
=
$1
key_filename
=
$2
...
...
This diff is collapsed.
Click to expand it.
src/freedombone-utils-keys
+
5
−
3
View file @
e4304ced
...
...
@@ -36,6 +36,7 @@ function interactive_gpg_from_usb {
GPG_LOADING
=
"yes"
SSH_IMPORTED
=
"no"
GPG_CTR
=
0
while
[[
$GPG_LOADING
==
"yes"
]]
do
detect_usb_drive
...
...
@@ -43,6 +44,7 @@ function interactive_gpg_from_usb {
if
[
!
-b
$USB_DRIVE
]
;
then
if
((
GPG_CTR
>
0
))
;
then
gpg_reconstruct_key
$MY_USERNAME
interactive
gpg_update_mutt
$MY_USERNAME
return
0
fi
dialog
--title
$"Recover Encryption Keys"
--msgbox
$'No USB drive found'
6 30
...
...
@@ -68,6 +70,7 @@ function interactive_gpg_from_usb {
if
((
GPG_CTR
>
0
))
;
then
backup_unmount_drive
${
USB_DRIVE
}
gpg_reconstruct_key
$MY_USERNAME
interactive
gpg_update_mutt
$MY_USERNAME
return
0
fi
dialog
--title
$"Recover Encryption Keys"
\
...
...
@@ -94,7 +97,7 @@ function interactive_gpg_from_usb {
echo
$'No backup key file found on USB drive'
exit
725729
fi
CURR_EMAIL_ADDRESS
=
$USER
@
$HOSTNAME
CURR_EMAIL_ADDRESS
=
$
MY_
USER
NAME
@
$HOSTNAME
CURR_GPG_ID
=
$(
gpg
--homedir
=
$HOME_DIR
/.gnupg
--list-keys
$CURR_EMAIL_ADDRESS
|
sed
-n
'2p'
|
sed
's/^[ \t]*//'
)
CURR_GPG_BACKUP_ID
=
$(
gpg
--homedir
=
$HOME_DIR
/.gnupg
--list-keys
"(backup key)"
|
sed
-n
'2p'
|
sed
's/^[ \t]*//'
)
...
...
@@ -118,8 +121,7 @@ function interactive_gpg_from_usb {
echo
$'Setting permissions'
gpg_set_permissions
$MY_USERNAME
echo
$"Updating muttrc for
$MY_USERNAME
"
CURR_GPG_ID
=
$(
gpg
--homedir
=
$HOME_DIR
/.gnupg
--list-keys
$CURR_EMAIL_ADDRESS
|
sed
-n
'2p'
|
sed
's/^[ \t]*//'
)
sed
-i
"s|set pgp_encrypt_only_command.*|set pgp_encrypt_only_command=
\"
/usr/lib/mutt/pgpewrap gpg --batch --quiet --no-verbose --output - --encrypt --textmode --armor --trust-model always --encrypt-to
$CURR_GPG_ID
-- -r %r -- %f
\"
|g"
/home/
$MY_USERNAME
/.muttrc
gpg_update_mutt
$MY_USERNAME
fi
GPG_LOADING
=
"no"
dialog
--title
$"Recover Encryption Keys"
\
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment