Skip to content

Commit

Permalink
Merge pull request #81 from NTIA/login-fixes
Browse files Browse the repository at this point in the history
Login fixes
  • Loading branch information
djanderson authored Jan 5, 2018
2 parents a7bc288 + ede688c commit 499e0f5
Show file tree
Hide file tree
Showing 9 changed files with 23 additions and 23 deletions.
4 changes: 4 additions & 0 deletions puppet/lib/facter/admin_email.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# admin_email.rb
Facter.add('admin_email') do
setcode '/bin/cat /opt/scos-sensor/.admin_email'
end
4 changes: 4 additions & 0 deletions puppet/lib/facter/admin_password.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# admin_password.rb
Facter.add('admin_password') do
setcode '/bin/cat /opt/scos-sensor/.admin_password'
end
4 changes: 0 additions & 4 deletions puppet/lib/facter/db_admin_email.rb

This file was deleted.

4 changes: 0 additions & 4 deletions puppet/lib/facter/db_admin_pw.rb

This file was deleted.

4 changes: 2 additions & 2 deletions puppet/manifests/clone.pp
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@
$ssl_dir = $scos::ssl_dir,
$ssl_cert = $scos::ssl_cert,
$ssl_key = $scos::ssl_key,
$db_admin_email = $scos::db_admin_email,
$db_admin_pw = $scos::db_admin_pw,
$admin_email = $scos::admin_email,
$admin_password = $scos::admin_password,
)

{
Expand Down
4 changes: 2 additions & 2 deletions puppet/manifests/docker.pp
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@
$ssl_dir = $scos::ssl_dir,
$ssl_cert = $scos::ssl_cert,
$ssl_key = $scos::ssl_key,
$db_admin_email = $scos::db_admin_email,
$db_admin_pw = $scos::db_admin_pw,
$admin_email = $scos::admin_email,
$admin_password = $scos::admin_password,
$secret_key = $scos::setup::secret_key,
)

Expand Down
4 changes: 2 additions & 2 deletions puppet/manifests/init.pp
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@
$ssl_dir = "${install_root}/nginx/certs",
$ssl_cert = undef,
$ssl_key = undef,
$db_admin_email = undef,
$db_admin_pw = 'changeme!',
$admin_email = undef,
$admin_password = 'changeme!',
)

{
Expand Down
12 changes: 6 additions & 6 deletions puppet/manifests/setup.pp
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@
$ssl_dir = $scos::ssl_dir,
$ssl_cert = $scos::ssl_cert,
$ssl_key = $scos::ssl_key,
$db_admin_email = $scos::db_admin_email,
$db_admin_pw = $scos::db_admin_pw,
$admin_email = $scos::admin_email,
$admin_password = $scos::admin_password,
)

{
Expand All @@ -24,12 +24,12 @@

$secret_key = fqdn_rand_string(32)

exec { 'db_admin_pw':
command => "/bin/echo ${db_admin_pw} > ${install_root}/.db_admin_pw",
exec { 'admin_password':
command => "/bin/echo ${admin_password} > ${install_root}/.admin_password",
}

exec { 'db_admin_email':
command => "/bin/echo ${db_admin_email} > ${install_root}/.db_admin_email",
exec { 'admin_email':
command => "/bin/echo ${admin_email} > ${install_root}/.admin_email",
}

file { "${ssl_dir}/ssl-cert-snakeoil.pem":
Expand Down
6 changes: 3 additions & 3 deletions scripts/create_superuser.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@
from django.contrib.auth import get_user_model # noqa

try:
with open('/opt/scos/.db_admin_pw', 'r') as admin_pw_file:
password = admin_pw_file.readline().rstrip()
with open('/opt/scos/.db_admin_email', 'r') as admin_email_file:
with open('/opt/scos-sensor/.admin_password', 'r') as admin_password_file:
password = admin_password_file.readline().rstrip()
with open('/opt/scos-sensor/.admin_email', 'r') as admin_email_file:
email = admin_email_file.readline().rstrip()

except IOError:
Expand Down

0 comments on commit 499e0f5

Please sign in to comment.