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
261c4ee9
Commit
261c4ee9
authored
9 years ago
by
Bob Mottram
Browse files
Options
Downloads
Patches
Plain Diff
Interactive installer can load gpg keys from USB drive
parent
0f712e41
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/freedombone-config
+73
-0
73 additions, 0 deletions
src/freedombone-config
with
73 additions
and
0 deletions
src/freedombone-config
+
73
−
0
View file @
261c4ee9
...
...
@@ -65,6 +65,7 @@ MY_NAME=
LOCAL_NETWORK_STATIC_IP_ADDRESS
=
ROUTER_IP_ADDRESS
=
ENABLE_CJDNS
=
ENABLE_BATMAN
=
DEBIAN_REPO
=
NAMESERVER1
=
NAMESERVER2
=
...
...
@@ -164,6 +165,9 @@ function save_configuration_file {
if
[
$ENABLE_CJDNS
]
;
then
echo
"ENABLE_CJDNS=
$ENABLE_CJDNS
"
>>
$CONFIGURATION_FILE
fi
if
[
$ENABLE_BATMAN
]
;
then
echo
"ENABLE_BATMAN=
$ENABLE_BATMAN
"
>>
$CONFIGURATION_FILE
fi
echo
"DEBIAN_REPO=
$DEBIAN_REPO
"
>>
$CONFIGURATION_FILE
echo
"NAMESERVER1=
$NAMESERVER1
"
>>
$CONFIGURATION_FILE
echo
"NAMESERVER2=
$NAMESERVER2
"
>>
$CONFIGURATION_FILE
...
...
@@ -233,6 +237,73 @@ function validate_domain_name {
fi
}
function
interactive_gpg
{
dialog
--title
"Encryption keys"
\
--backtitle
"Freedombone Configuration"
\
--defaultno
\
--yesno
"
\n
Do you have existing GPG/PGP keys that you wish to install?"
7 60
sel
=
$?
case
$sel
in
1
)
return
;;
255
)
exit
0
;;
esac
dialog
--title
"Encryption keys"
--msgbox
'Plug in a USB drive containing a copy of your .gnupg directory'
6 70
if
[[
$INSTALLING_ON_BBB
==
"yes"
]]
;
then
GPG_USB_DRIVE
=
'/dev/sda1'
if
[
!
-b
$GPG_USB_DRIVE
]
;
then
dialog
--title
"Encryption keys"
--msgbox
'No USB drive found'
6 30
exit
739836
fi
else
GPG_USB_DRIVE
=
'/dev/sdb1'
if
[
!
-b
$GPG_USB_DRIVE
]
;
then
GPG_USB_DRIVE
=
'/dev/sdc1'
if
[
!
-b
$GPG_USB_DRIVE
]
;
then
GPG_USB_DRIVE
=
'/dev/sdd1'
if
[
!
-b
$GPG_USB_DRIVE
]
;
then
dialog
--title
"Encryption keys"
--msgbox
'No USB drive found'
6 30
exit
27852
fi
fi
fi
fi
GPG_USB_MOUNT
=
'/mnt/usb'
umount
-f
$GPG_USB_MOUNT
if
[
!
-d
$GPG_USB_MOUNT
]
;
then
mkdir
-p
$GPG_USB_MOUNT
fi
if
[
-f
/dev/mapper/encrypted_usb
]
;
then
rm
-rf
/dev/mapper/encrypted_usb
fi
cryptsetup luksClose encrypted_usb
cryptsetup luksOpen
$GPG_USB_DRIVE
encrypted_usb
if
[
"
$?
"
=
"0"
]
;
then
GPG_USB_DRIVE
=
/dev/mapper/encrypted_usb
fi
mount
$GPG_USB_DRIVE
$GPG_USB_MOUNT
if
[
!
"
$?
"
=
"0"
]
;
then
dialog
--title
"Encryption keys"
--msgbox
"There was a problem mounting the USB drive to
$GPG_USB_MOUNT
"
6 70
rm
-rf
$GPG_USB_MOUNT
exit
74393
fi
if
[
!
-d
$GPG_USB_MOUNT
/.gnupg
]
;
then
dialog
--title
"Encryption keys"
--msgbox
"The directory
$GPG_USB_MOUNT
/.gnupg was not found"
6 70
umount
$GPG_USB_MOUNT
rm
-rf
$GPG_USB_MOUNT
exit
723814
fi
cp
-r
$GPG_USB_MOUNT
/.gnupg /home/
$(
grep
'MY_USERNAME'
temp.cfg |
awk
-F
'='
'{print $2}'
)
umount
$GPG_USB_MOUNT
rm
-rf
$GPG_USB_MOUNT
}
function
interactive_configuration
{
# create a temporary copy of the configuration file
# which can be used to pre-populate selections
...
...
@@ -325,6 +396,8 @@ function interactive_configuration {
fi
save_configuration_file
interactive_gpg
data
=
$(
tempfile 2>/dev/null
)
trap
"rm -f
$data
"
0 1 2 5 15
if
[[
$INSTALLING_ON_BBB
==
"no"
]]
;
then
...
...
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