diff --git a/deployments/prod/environment.py b/deployments/prod/environment.py index 297961d7b..ee171a0a1 100644 --- a/deployments/prod/environment.py +++ b/deployments/prod/environment.py @@ -1141,15 +1141,6 @@ def mkdict(previous_catalog: dict[str, str], # @formatter:on ])) -pilot1_sources = mkdict({}, 4, mkdelta([ - # @formatter:off - mksrc('bigquery', 'datarepo-11e4dc06', 'hca_prod_59b3bfd9cf454d538c8ee240273cba71__20240410_dcp2_20240410_dcpPilot'), # noqa E501 - mksrc('bigquery', 'datarepo-9ebf5be4', 'hca_prod_5bbd9f925bf447cb91999a9750d3fbcd__20240410_dcp2_20240410_dcpPilot'), # noqa E501 - mksrc('bigquery', 'datarepo-d1a1fd3e', 'hca_prod_cc2f49634bc54d008fac69a8663b45fb__20240410_dcp2_20240410_dcpPilot'), # noqa E501 - mksrc('bigquery', 'datarepo-ecbcde24', 'hca_prod_edc54c5d82404681844462a086d1d1be__20240410_dcp2_20240410_dcpPilot') - # @formatter:on -])) - lungmap_sources = mkdict({}, 3, mkdelta([ mksrc('bigquery', 'datarepo-32f75497', 'lungmap_prod_00f056f273ff43ac97ff69ca10e38c89__20220308_20220308'), mksrc('bigquery', 'datarepo-7066459d', 'lungmap_prod_1bdcecde16be420888f478cd2133d11d__20220308_20220308'), @@ -1238,7 +1229,6 @@ def env() -> Mapping[str, Optional[str]]: for atlas, catalog, sources in [ ('hca', 'dcp42', dcp42_sources), ('hca', 'dcp43', dcp43_sources), - ('hca', 'pilot1', pilot1_sources), ('lungmap', 'lm7', lm7_sources), ('lungmap', 'lm8', lm8_sources) ] for suffix, internal in [ diff --git a/terraform/browser/add_response_security_headers.js b/terraform/browser/add_response_security_headers.js deleted file mode 100644 index f10f7382f..000000000 --- a/terraform/browser/add_response_security_headers.js +++ /dev/null @@ -1,20 +0,0 @@ -// FIXME: Delete me -// https://github.com/DataBiosphere/azul/issues/5871 - -function handler(event) { - var response = event.response; - var headers = response.headers; - - // Set HTTP security headers - // Since JavaScript doesn't allow for hyphens in variable names, we use the - // dict['key'] notation - headers['strict-transport-security'] = { - value: 'max-age=63072000; includeSubdomains; preload' - }; - headers['x-content-type-options'] = { value: 'nosniff' }; - headers['x-frame-options'] = { value: 'DENY' }; - headers['x-xss-protection'] = { value: '1; mode=block' }; - - // Return the response to viewers - return response; -} \ No newline at end of file diff --git a/terraform/browser/add_trailing_slash.js b/terraform/browser/add_trailing_slash.js deleted file mode 100644 index 632e0705b..000000000 --- a/terraform/browser/add_trailing_slash.js +++ /dev/null @@ -1,27 +0,0 @@ -// Adds a trailing slash to the url to avoid 302 redirects - -function handler(event) { - - var request = event.request; - var uri = request.uri; - - if (uri == "/"){ - return request; - } - - if(uri.endsWith("/")){ - //already ends with / so do not bother - request.uri +="index.html"; - return request; - } - - if(uri.includes(".")){ - // is a request for a file , leaeve alone - return request; - } - - // Otherwise add the trailing / - request.uri +="/index.html"; - - return request; -} \ No newline at end of file diff --git a/terraform/browser/browser.tf.json.template.py b/terraform/browser/browser.tf.json.template.py index c1818ce65..649bc58a0 100644 --- a/terraform/browser/browser.tf.json.template.py +++ b/terraform/browser/browser.tf.json.template.py @@ -191,6 +191,7 @@ def emit(): 'aws_cloudfront_function': { script.stem: cloudfront_function(script) for script in Path(__file__).parent.glob('*.js') + if provision_custom_search or not script.stem == 'add_google_search_api_key' }, 'aws_cloudfront_response_headers_policy': { name: { diff --git a/terraform/browser/explorer_domain_router.js b/terraform/browser/explorer_domain_router.js deleted file mode 100644 index 3e7e82d67..000000000 --- a/terraform/browser/explorer_domain_router.js +++ /dev/null @@ -1,60 +0,0 @@ -// FIXME: Delete me -// https://github.com/DataBiosphere/azul/issues/5871 - -function handler(event) { - - var request = event.request; - var host = request.headers['host'].value; - -// FIXME: Stop hard-coding this -// https://github.com/DataBiosphere/azul/issues/5151 - - var hostPath = { - "ux-dev.singlecell.gi.ucsc.edu":"ux-dev", - "hca.dev.singlecell.gi.ucsc.edu":"hca", - "lungmap.dev.singlecell.gi.ucsc.edu":"lungmap", - "anvil.dev.singlecell.gi.ucsc.edu":"anvil", - "anvil.gi.ucsc.edu":"anvil-cmg", - "anvil-catalog.dev.singlecell.gi.ucsc.edu":"anvil-catalog", - "ncpi-catalog.dev.singlecell.gi.ucsc.edu":"ncpi-catalog", - "ncpi-catalog-dug.dev.singlecell.gi.ucsc.edu":"ncpi-catalog-dug", - }; - - // Default to ux-dev if site is unknown - var path = hostPath[host]; - if (!path){ - path = "anvil-cmg"; - } - - var explorePath= "/explore/"+ path; - var uri = request.uri; - uri = uri.replace("/explore", explorePath); - request.uri = uri; - - if(uri.endsWith(explorePath)){ - //this was a request for /explore, add the trailing slash. - request.uri +="/index.html"; - return request; - } - - if(uri.endsWith(explorePath+"/")){ - //this was a request for /explore/ will find its index.html - request.uri +="index.html"; - return request; - } - - if(uri.includes(".")){ - // is a request for a file , leaeve alone - return request; - } - - if(uri.endsWith("/")){ - //this was a request for for something like /explore/files/ remove the trailing / - request.uri = request.uri.slice(0, -1); - } - - // final case add .html as this was not a file /explore or /explore/ - request.uri +=".html"; - - return request; -} diff --git a/terraform/browser/ptm_add_response_headers.js b/terraform/browser/ptm_add_response_headers.js deleted file mode 100644 index 80263af8f..000000000 --- a/terraform/browser/ptm_add_response_headers.js +++ /dev/null @@ -1,18 +0,0 @@ -// FIXME: Delete me -// https://github.com/DataBiosphere/azul/issues/5871 - -function handler(event) { - var response = event.response; - var headers = response.headers; - - // Set HTTP security headers - // Since JavaScript doesn't allow for hyphens in variable names, we use the dict["key"] notation - headers['strict-transport-security'] = { value: 'max-age=63072000; includeSubdomains; preload'}; - // headers['content-security-policy'] = { value: "default-src 'none'; img-src 'self'; script-src 'self'; style-src 'self'; object-src 'none'"}; - // headers['x-content-type-options'] = { value: 'nosniff'}; - // headers['x-frame-options'] = {value: 'DENY'}; - // headers['x-xss-protection'] = {value: '1; mode=block'}; - - // Return the response to viewers - return response; -} diff --git a/terraform/browser/ptm_next_path_mapper.js b/terraform/browser/ptm_next_path_mapper.js deleted file mode 100644 index eb076befe..000000000 --- a/terraform/browser/ptm_next_path_mapper.js +++ /dev/null @@ -1,22 +0,0 @@ -function handler(event) { - - var request = event.request; - - var uri = request.uri; - - - if(uri.includes(".")){ - // is a request for a file , leaeve alone - return request; - } - - if(uri.endsWith("/")){ - //this was a request for for something like /explore/files/ remove the trailing / - request.uri = request.uri.slice(0, -1); - } - - // final case add .html as this was not a file /explore or /explore/ - request.uri +=".html"; - - return request; -}