-
Notifications
You must be signed in to change notification settings - Fork 3
Description
@s1monj @ryanlovett and Eric (don't know his GitHub handle)
As we continue refining our deployment setup for JupyterHealth Exchange (JHE), we should also tighten our production deployment documentation to reflect real-world production needs. To ensure proper security and compatibility — especially for OAuth2 + PKCE — we need to document how to serve Django securely behind HTTPS.
In our documentation site, we should provide examples in both Kubernetes-based and non-Kubernetes environments.
⚠️ Context
Modern browsers restrict use of sensitive cryptographic APIs (like Crypto.subtle
) to secure contexts (HTTPS), with the one exception being development over localhost
. Since Django does not support HTTPS directly, we’ll need to use a reverse proxy like nginx
in front of Django to terminate HTTPS. This is a standard production deployment pattern, and it ensures that browser-based workflows (like OAuth2 + PKCE) function correctly and securely.
Recommended Non-Kubernetes Production Setup
- Provision a Linux Server
- Install and Configure PostgreSQL
- Install the Application (JHE)
- Run Database Migrations
- Run Gunicorn Application Server
- Configure systemd Service
- Set Up Nginx as Reverse Proxy
- Configure HTTPS with certbot
- Set Up DNS
- Test Deployment
Post-Deployment: Administering JHE
- Run Database Migrations
- Seed Initial Data
- Create a Django Admin User
- Configure OAuth Application
- Integrate JupyterHub Authentication
- Enable Group-Based Access
Recommended Kubernetes-Based Production Setup
(via AWS EKS, ingress-nginx, and cert-manager)
- Create the Kubernetes Cluster
- Install ingress-nginx with AWS NLB support
- Install cert-manager for HTTPS
- Deploy JupyterHealth Exchange
- Set up DNS and expose JHE endpoint
- Connect a PostgreSQL database
Post-Deployment: Administering JHE
- Migrate the database
- Seed initial data
- Configure OAuth client in Django Admin
- Integrate JupyterHub authentication
- Group-based access control
For Local Development
HTTPS is not required if you’re running on localhost
. Modern browsers allow insecure HTTP access on localhost
for development purposes.
If you're seeing Crypto.subtle
errors on localhost, verify:
- You're using
localhost
, not a LAN IP or hostname - You're not forcing HTTPS-only mode in the browser