Skip to content

Portal integration#2

Open
pvvhoang wants to merge 16 commits into
devfrom
portal_integration
Open

Portal integration#2
pvvhoang wants to merge 16 commits into
devfrom
portal_integration

Conversation

@pvvhoang

@pvvhoang pvvhoang commented May 18, 2026

Copy link
Copy Markdown
Collaborator

//—------------------------------------------
// 1) Explorer uses local stack from portal
//—------------------------------------------
Update docker-compose.yml
//—------------------------------------------
// 2) Change from http to https
//—------------------------------------------
env
env.explorer
docker-compose.yml
hosted/Dockerfile

Add file hosted/nginx.ssl.conf
listen 5000 ssl;

    ssl_certificate     /etc/ssl/certs/nginx-selfsigned.crt;
    ssl_certificate_key /etc/ssl/private/nginx-selfsigned.key;

    ssl_protocols       TLSv1.2 TLSv1.3;
    ssl_ciphers         HIGH:!aNULL:!MD5;

//—------------------------------------------
// 3) Explorer uses explorer.corporanet.local instead of localhost
//—------------------------------------------
Run this command:
sudo bash -c 'cat >> /etc/hosts << EOF
127.0.0.1 explorer.corporanet.local
EOF'

env.explorer
//—------------------------------------------
// 4) To use explorer in portal, we need to change from "frame-ancestors": ["'none'"], to "frame-ancestors": [os.getenv("FRONTEND_URL")],
env.explorer
server/ecs/app.py
//—------------------------------------------

So, with these updates, explorer can run at localhost using https://explorer.corporanet.local:5500/e/test.cxg/

Note: For these files .env.example, .env.explorer.example, and nginx.ssl.conf.example, please change their names by removing .example at the end, then review and update the correct information before running at local

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR integrates the Explorer local stack with the portal-oriented local development flow by switching local URLs to HTTPS and explorer.corporanet.local, adding portal network attachment, and relaxing CSP frame embedding for a frontend origin.

Changes:

  • Switch example local Explorer env values from localhost/HTTP to explorer.corporanet.local/HTTPS.
  • Add Docker build support for local self-signed SSL nginx configuration.
  • Update compose networking to attach Explorer to the portal corporanet network.

Reviewed changes

Copilot reviewed 5 out of 6 changed files in this pull request and generated 5 comments.

Show a summary per file
File Description
server/ecs/app.py Changes CSP frame-ancestors to use FRONTEND_URL.
hosted/Dockerfile Adds OpenSSL and conditional self-signed certificate/nginx SSL config setup.
docker-compose.yml Adds SSL build arg, removes Explorer dependency on localstack, and attaches Explorer to portal network.
.gitignore Ignores local nginx SSL config.
.env.explorer.example Updates Explorer local domains/protocol and adds FRONTEND_URL.
.env.example Enables local SSL certificate generation by default.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread hosted/Dockerfile Outdated
Comment on lines +17 to +21
COPY hosted/nginx.ssl.conf* /etc/nginx/nginx.ssl.conf
ARG LOCALHOST_SSL_CERT=false
# Generate self-signed SSL certificate only when LOCALHOST_SSL_CERT=true
RUN if [ "$LOCALHOST_SSL_CERT" = "true" ]; then \
mv /etc/nginx/nginx.ssl.conf /etc/nginx/nginx.conf; \

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed, COPY hosted/nginx.ssl.conf* /etc/nginx/, then if using local ssl cert, overwrite /etc/nginx/nginx.conf by /etc/nginx/nginx.ssl.conf

Comment thread server/ecs/app.py Outdated
"object-src": ["'none'"],
"base-uri": ["'none'"],
"frame-ancestors": ["'none'"],
"frame-ancestors": [os.getenv("FRONTEND_URL")],

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed, only setting frame-ancestors when FRONTEND_URL existed

Comment thread hosted/Dockerfile Outdated
-keyout /etc/ssl/private/nginx-selfsigned.key \
-out /etc/ssl/certs/nginx-selfsigned.crt \
-days 3650 \
-subj "/CN=explorer.corporanet.local"; \

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed

Comment thread docker-compose.yml Outdated
Comment on lines +61 to +63
single-cell-data-portal_corporanet:
aliases:
- explorer.corporanet.local

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

localstack has been removed from the section of depends_on in explorer service

Comment thread docker-compose.yml Outdated
networks:
corporanet:
single-cell-data-portal_corporanet:
external: true

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 7 out of 8 changed files in this pull request and generated 7 comments.

Comment thread server/ecs/app.py
Comment on lines 92 to 95
"object-src": ["'none'"],
"base-uri": ["'none'"],
"frame-ancestors": ["'none'"],
"frame-ancestors": [os.getenv("FRONTEND_URL")],
}

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed, if no FRONTEND_URL, will use "'none'"

Comment thread client/src/components/App/App.tsx Outdated
Comment on lines +118 to +119
process.env.DEPLOYMENT_TYPE !== "vcp-hosted" &&
process.env.USE_FOR_PORTAL === "false" && (

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed

Comment thread hosted/Dockerfile
Comment on lines 16 to +22
COPY hosted/nginx.conf /etc/nginx/nginx.conf
COPY hosted/nginx.ssl.conf* /etc/nginx/nginx.ssl.conf
ARG LOCALHOST_SSL_CERT=false
# Generate self-signed SSL certificate only when LOCALHOST_SSL_CERT=true
RUN if [ "$LOCALHOST_SSL_CERT" = "true" ]; then \
mv /etc/nginx/nginx.ssl.conf /etc/nginx/nginx.conf; \
openssl req -x509 -newkey rsa:4096 -nodes \

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed, copy into a directory instead of a target file

Comment thread docker-compose.yml
- BUILDKIT_INLINE_CACHE=1
- IMAGE_TAG
- BASE_IMAGE=${BASE_IMAGE}
- LOCALHOST_SSL_CERT=${LOCALHOST_SSL_CERT}

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed, add in args in docker-compose

Comment thread docker-compose.yml
Comment on lines 33 to 38
- BASE_IMAGE=${BASE_IMAGE}
- LOCALHOST_SSL_CERT=${LOCALHOST_SSL_CERT}
restart: always
depends_on:
- localstack
env_file:
- ./.env.explorer
ports:

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

explorer does not use this localstack anymore, it will use localstack from portal

Comment thread docker-compose.yml Outdated
Comment on lines +61 to +67
single-cell-data-portal_corporanet:
aliases:
- explorer.corporanet.local
networks:
corporanet:
single-cell-data-portal_corporanet:
external: true

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed as suggestion

Comment thread server/ecs/app.py
Comment on lines 93 to 95
"base-uri": ["'none'"],
"frame-ancestors": ["'none'"],
"frame-ancestors": [os.getenv("FRONTEND_URL")],
}

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It works with the setting for frame-ancestors, because frame-ancestors has a higher priority compared frame-options

@pvvhoang pvvhoang marked this pull request as ready for review May 21, 2026 06:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants