Skip to content

Commit

Permalink
chore: Use staging env deep zoom assets for localhost (#1103)
Browse files Browse the repository at this point in the history
  • Loading branch information
tihuan authored Sep 13, 2024
1 parent f767f66 commit c951f21
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 7 deletions.
2 changes: 1 addition & 1 deletion .infra/rdev/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ stack:
services:
explorer:
image:
tag: sha-5ec059bf
tag: sha-f55da22f
replicaCount: 1
env:
# env vars common to all deployment stages
Expand Down
14 changes: 10 additions & 4 deletions client/src/components/graph/util.ts
Original file line number Diff line number Diff line change
Expand Up @@ -169,12 +169,18 @@ function getSpatialUrl(s3URI: string) {

// TODO(thuang): Take rdev into account

if (hostname.includes("staging")) {
if (
/**
* (thuang): `dev` env for Explorer is out of sync with Terraform, so don't
* use it anymore
*/
hostname.includes("dev") ||
hostname.includes("staging") ||
hostname.includes("localhost")
) {
return `https://cellxgene.staging.single-cell.czi.technology/spatial-deep-zoom/${datasetVersionId}/`;
}
if (hostname.includes("dev") || hostname.includes("localhost")) {
return `https://cellxgene.dev.single-cell.czi.technology/spatial-deep-zoom/${datasetVersionId}/`;
}

return `https://cellxgene.cziscience.com/spatial-deep-zoom/${datasetVersionId}/`;
}

Expand Down
7 changes: 5 additions & 2 deletions server/ecs/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,14 +45,17 @@ def _before_adding_routes(app, app_config):

EXPLORER_DEV_URL = "https://cellxgene.dev.single-cell.czi.technology"

EXPLORER_STAGING_URL = "https://cellxgene.staging.single-cell.czi.technology"

csp = {
"default-src": ["'self'", HUBSPOT_FORMS_URL, HUBSPOT_JS_URL],
"form-action": ["'self'", HUBSPOT_FORMS_URL],
"connect-src": ["'self'", PLAUSIBLE_URL, HUBSPOT_FORMS_URL, EXPLORER_DEV_URL] + extra_connect_src,
"connect-src": ["'self'", PLAUSIBLE_URL, HUBSPOT_FORMS_URL, EXPLORER_DEV_URL, EXPLORER_STAGING_URL]
+ extra_connect_src,
"script-src": ["'self'", "'unsafe-eval'", PLAUSIBLE_URL, HUBSPOT_FORMS_URL, HUBSPOT_JS_URL] + script_hashes,
"style-src": ["'self'", "'unsafe-inline'", "https://fonts.googleapis.com"],
"font-src": ["'self'", "https://fonts.gstatic.com"],
"img-src": ["'self'", "https://cellxgene.cziscience.com", EXPLORER_DEV_URL]
"img-src": ["'self'", "https://cellxgene.cziscience.com", EXPLORER_DEV_URL, EXPLORER_STAGING_URL]
+ extra_connect_src
+ ["data:", HUBSPOT_FORMS_URL],
"object-src": ["'none'"],
Expand Down

0 comments on commit c951f21

Please sign in to comment.