Skip to content

Commit

Permalink
[ALS-5344] Add banner_config.json (#109)
Browse files Browse the repository at this point in the history
* [ALS-5344] Add banner_config.json
The banner_config.json is now correctly uploaded to S3, copied to the HTTPD EC2, and mounted to the HTTPD docker volume.
  • Loading branch information
Gcolon021 committed Nov 29, 2023
1 parent cc00bc6 commit 97de043
Show file tree
Hide file tree
Showing 4 changed files with 35 additions and 0 deletions.
20 changes: 20 additions & 0 deletions app-infrastructure/configs/banner_config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
{
"bannerConfiguration": [
{
"text": "Because of a lapse in government funding, the information on this website may not be up to date, transactions submitted via the website may not be processed, and the agency may not be able to respond to inquiries until appropriations are enacted. <br />The NIH Clinical Center (the research hospital of NIH) is open. For more details about its operating status, please visit <a href='https://urldefense.proofpoint.com/v2/url?u=http-3A__cc.nih.gov_&d=DwMF-g&c=WO-RGvefibhHBZq3fL85hQ&r=JrvHRNUaLM4JEXPBO7asJ6K88twMitD1WUK5OovbsHHtoJgrwK3owhHE-Qe_RQjE&m=i1X4Vqc_51lPo_Vgc-Tr6mtbqokt7q4j6wEtg9e4sWaoYz7riX2NwLQBhJKhpbr5&s=VlQRwDFt1QfEHKjjrud8hpr3fUx5SGtHk3ImbwgjGak&e=' target='_blank'>cc.nih.gov</a>. <br />Updates regarding government operating status and resumption of normal operations can be found at <a href='https://urldefense.proofpoint.com/v2/url?u=https-3A__www.opm.gov_&d=DwMF-g&c=WO-RGvefibhHBZq3fL85hQ&r=JrvHRNUaLM4JEXPBO7asJ6K88twMitD1WUK5OovbsHHtoJgrwK3owhHE-Qe_RQjE&m=i1X4Vqc_51lPo_Vgc-Tr6mtbqokt7q4j6wEtg9e4sWaoYz7riX2NwLQBhJKhpbr5&s=tpDX_bYTpgVCobViig4inj3nuyix1vi_6Qs5XGcUzCM&e=' target='_blank'>OPM.gov</a>.",
"startDate": "2023-09-29T00:00:00Z",
"endDate": "2024-09-29T00:00:00Z",
"styles": "background-color: #C0143C; color: #fff; font-size: 1.1em; padding: 10px;",
"isDismissible": false,
"disabled": true
},
{
"text": "Open PIC-SURE without login is now live! Users can search, query, and build cohorts using data in BDC, with no login required. Check out this new feature <a href='https://openpicsure.biodatacatalyst.nhlbi.nih.gov/picsureui/' target='_blank' style='color: #fff; text-decoration: underline;'>here</a>.<br />The “Open Access” tab will no longer be accessible from this site starting December 2023. Please use the <a href='http://openpicsure.biodatacatalyst.nhlbi.nih.gov/' target='_blank' style='color: #fff; text-decoration: underline;'>Open PIC-SURE site</a> to continue using the Open Access functionality.",
"startDate": "2023-11-01T00:00:00Z",
"endDate": "2024-12-23T00:00:00Z",
"styles": "background-color: #1a568c; color: #fff; font-size: 1.1em; padding: 10px;",
"isDismissible": true,
"disabled": false
}
]
}
7 changes: 7 additions & 0 deletions app-infrastructure/s3_roles.tf
Original file line number Diff line number Diff line change
Expand Up @@ -189,6 +189,13 @@ resource "aws_iam_role_policy" "httpd-deployment-s3-policy" {
"Effect": "Allow",
"Resource": "arn:aws:s3:::${var.stack_s3_bucket}/configs/jenkins_pipeline_build_${var.stack_githash_long}/picsureui_settings.json"
},{
"Action": [
"s3:GetObject"
],
"Effect": "Allow",
"Resource": "arn:aws:s3:::${var.stack_s3_bucket}/configs/jenkins_pipeline_build_${var.stack_githash_long}/banner_config.json"
},
{
"Action": [
"s3:GetObject"
],
Expand Down
2 changes: 2 additions & 0 deletions app-infrastructure/scripts/httpd-user_data.sh
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ s3_copy s3://${stack_s3_bucket}/releases/jenkins_pipeline_build_${stack_githash}
s3_copy s3://${stack_s3_bucket}/configs/jenkins_pipeline_build_${stack_githash}/httpd-vhosts.conf /usr/local/docker-config/httpd-vhosts.conf
s3_copy s3://${stack_s3_bucket}/certs/httpd/ /usr/local/docker-config/cert/ --recursive
s3_copy s3://${stack_s3_bucket}/configs/jenkins_pipeline_build_${stack_githash}/picsureui_settings.json /usr/local/docker-config/picsureui_settings.json
s3_copy s3://${stack_s3_bucket}/configs/jenkins_pipeline_build_${stack_githash}/banner_config.json /usr/local/docker-config/banner_config.json
s3_copy s3://${stack_s3_bucket}/data/${dataset_s3_object_key}/fence_mapping.json /home/centos/fence_mapping.json

for i in 1 2 3 4 5; do echo "confirming wildfly resolvable" && sudo curl --connect-timeout 1 $(grep -A30 preprod /usr/local/docker-config/httpd-vhosts.conf | grep wildfly | grep api | cut -d "\"" -f 2 | sed 's/pic-sure-api-2.*//') || if [ $? = 6 ]; then (exit 1); fi && break || sleep 60; done
Expand All @@ -44,6 +45,7 @@ sudo docker run --name=httpd \
--log-driver syslog --log-opt tag=httpd \
-v /var/log/httpd-docker-logs/:/usr/local/apache2/logs/ \
-v /usr/local/docker-config/picsureui_settings.json:/usr/local/apache2/htdocs/picsureui/settings/settings.json \
-v /usr/local/docker-config/banner_config.json:/usr/local/apache2/htdocs/picsureui/settings/banner_config.json \
-v /home/centos/fence_mapping.json:/usr/local/apache2/htdocs/picsureui/studyAccess/studies-data.json \
-v /usr/local/docker-config/cert:/usr/local/apache2/cert/ \
-v /usr/local/docker-config/httpd-vhosts.conf:/usr/local/apache2/conf/extra/httpd-vhosts.conf \
Expand Down
6 changes: 6 additions & 0 deletions s3-deployment-roles/s3_roles.tf
Original file line number Diff line number Diff line change
Expand Up @@ -227,6 +227,12 @@ resource "aws_iam_role_policy" "httpd-deployment-s3-policy" {
],
"Effect": "Allow",
"Resource": "arn:aws:s3:::${var.stack_s3_bucket}/configs/jenkins_pipeline_build_${var.stack_githash_long}/picsureui_settings.json"
},{
"Action": [
"s3:GetObject"
],
"Effect": "Allow",
"Resource": "arn:aws:s3:::${var.stack_s3_bucket}/configs/jenkins_pipeline_build_${var.stack_githash_long}/banner_config.json"
},{
"Action": [
"s3:GetObject"
Expand Down

0 comments on commit 97de043

Please sign in to comment.