From 7773d2da6b4d2a67c207957dfd82d549eb6ace86 Mon Sep 17 00:00:00 2001 From: Rory McNicholl Date: Tue, 8 Oct 2024 15:50:56 +0100 Subject: [PATCH 1/4] use env vars --- app/controllers/application_controller.rb | 2 +- ops/staging-deploy.tmpl.yaml | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb index 1e3b3aa3..7113d1e6 100644 --- a/app/controllers/application_controller.rb +++ b/app/controllers/application_controller.rb @@ -56,7 +56,7 @@ def authenticate_if_needed return true if Rails.env.test? if (is_hidden || is_staging) && !is_api_or_pdf authenticate_or_request_with_http_basic do |username, password| - username == "samvera" && password == "hyku" + username == ENV.fetch("HYKU_DEMO_USER") && password == ENV.fetch("HYKU_DEMO_PASSWORD") end end end diff --git a/ops/staging-deploy.tmpl.yaml b/ops/staging-deploy.tmpl.yaml index 5f57bcf7..09968e0a 100644 --- a/ops/staging-deploy.tmpl.yaml +++ b/ops/staging-deploy.tmpl.yaml @@ -141,6 +141,10 @@ extraEnvVars: &envVars value: "true" - name: HYKU_ROOT_HOST value: bl-staging.notch8.cloud + - name: HYKU_DEMO_USER + value: "bl_hyku_demo_user" + - name: HYKU_DEMO_PASSWORD + value: "26G_-7KXUU8jM-t" - name: S3_DOWNLOADS value: "true" - name: SMTP_ADDRESS From 5d175062db68e7051aec2c8c1e82237fda3999a2 Mon Sep 17 00:00:00 2001 From: Rory McNicholl Date: Tue, 15 Oct 2024 13:02:22 +0100 Subject: [PATCH 2/4] demo_user --- ops/production-deploy.tmpl.yaml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/ops/production-deploy.tmpl.yaml b/ops/production-deploy.tmpl.yaml index e01bcd74..f916c76b 100644 --- a/ops/production-deploy.tmpl.yaml +++ b/ops/production-deploy.tmpl.yaml @@ -134,6 +134,10 @@ extraEnvVars: &envVars value: iro.bl.uk - name: HYKU_SMTP_SETTINGS value: '{"from":"openaccess@bl.uk","user_name":"apikey","password":"$SMTP_PASSWORD","address":"smtp.sendgrid.net","domain":"bl.uk","port":"587","authentication":"plain","enable_starttls_auto":true}' + - name: HYKU_DEMO_USER + value: "bl_hyku_demo_user" + - name: HYKU_DEMO_PASSWORD + value: "26G_-7KXUU8jM-t" - name: SMTP_ADDRESS value: smtp.sendgrid.net - name: SMTP_DOMAIN From 8f66080265f674490766549ac68f10eced3cf7b1 Mon Sep 17 00:00:00 2001 From: Rory McNicholl Date: Tue, 15 Oct 2024 13:29:45 +0100 Subject: [PATCH 3/4] use env --- ops/staging-deploy.tmpl.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ops/staging-deploy.tmpl.yaml b/ops/staging-deploy.tmpl.yaml index 09968e0a..51827de7 100644 --- a/ops/staging-deploy.tmpl.yaml +++ b/ops/staging-deploy.tmpl.yaml @@ -144,7 +144,7 @@ extraEnvVars: &envVars - name: HYKU_DEMO_USER value: "bl_hyku_demo_user" - name: HYKU_DEMO_PASSWORD - value: "26G_-7KXUU8jM-t" + value: $HYKU_DEMO_PASSWORD - name: S3_DOWNLOADS value: "true" - name: SMTP_ADDRESS From 01611d78b3cade6955500e1bdf6db2cedb7c1c39 Mon Sep 17 00:00:00 2001 From: Rory McNicholl Date: Tue, 15 Oct 2024 13:33:14 +0100 Subject: [PATCH 4/4] use env --- ops/production-deploy.tmpl.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ops/production-deploy.tmpl.yaml b/ops/production-deploy.tmpl.yaml index f916c76b..db6bf660 100644 --- a/ops/production-deploy.tmpl.yaml +++ b/ops/production-deploy.tmpl.yaml @@ -137,7 +137,7 @@ extraEnvVars: &envVars - name: HYKU_DEMO_USER value: "bl_hyku_demo_user" - name: HYKU_DEMO_PASSWORD - value: "26G_-7KXUU8jM-t" + value: $HYKU_DEMO_PASSWORD - name: SMTP_ADDRESS value: smtp.sendgrid.net - name: SMTP_DOMAIN