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
9f85e818
Commit
9f85e818
authored
6 years ago
by
Bob Mottram
Browse files
Options
Downloads
Patches
Plain Diff
Retain password until the system has gone through setup
parent
9f317a24
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-installer
+13
-4
13 additions, 4 deletions
src/freedombone-installer
with
13 additions
and
4 deletions
src/freedombone-installer
+
13
−
4
View file @
9f85e818
...
...
@@ -44,6 +44,7 @@ pending_removes="$webadmin_install_dir/pending_removes.txt"
pending_installs
=
"
$webadmin_install_dir
/pending_installs.txt"
INSTALL_DIR
=
/root/build
webadmin_user
=
'admin'
webadmin_temp_password_file
=
/root/.temp_webadmin_password
function
wait_for_enough_entropy
{
# Wait indefinitely until enough entropy is available to
...
...
@@ -91,9 +92,13 @@ function web_admin_setup_login {
touch
"
$webadmin_install_dir
/.setupscreenactive"
fi
wait_for_enough_entropy
webadmin_password
=
"
$(
openssl rand
-base64
32 |
tr
-dc
A-Za-z0-9 |
head
-c
10
;
echo
-n
''
)
"
if
[
!
-f
$webadmin_temp_password_file
]
;
then
wait_for_enough_entropy
webadmin_password
=
"
$(
openssl rand
-base64
32 |
tr
-dc
A-Za-z0-9 |
head
-c
10
;
echo
-n
''
)
"
echo
-n
"
$webadmin_password
"
>
$webadmin_temp_password_file
else
webadmin_password
=
$(
cat
$webadmin_temp_password_file
)
fi
web_admin_create_user
"
$webadmin_user
"
"
$webadmin_password
"
...
...
@@ -283,7 +288,8 @@ function before_setup_runs {
MY_USERNAME
=
"
$webadmin_user
"
else
if
[[
"
$MY_USERNAME
"
!=
"
$webadmin_user
"
]]
;
then
web_admin_create_user
"
$webadmin_user
"
"
$webadmin_password
"
temp_webadmin_password
=
$(
cat
$webadmin_temp_password_file
)
web_admin_create_user
"
$webadmin_user
"
"
$temp_webadmin_password
"
webadmin_user
=
"
$MY_USERNAME
"
fi
...
...
@@ -345,6 +351,9 @@ function after_setup_has_finished {
set_webadmin_permissions
remove_temporary_setup_files
restore_webadmin_files
if
[
-f
$webadmin_temp_password_file
]
;
then
rm
$webadmin_temp_password_file
fi
systemctl restart nginx
if
[
-f
/root/.finished_install_command
]
;
then
systemctl reboot
-i
...
...
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