Repository navigation
Tenant Lifecycle and Verification with Browser app and auth #1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
kumanday
wants to merge
20
commits into
main
Choose a base branch
from
feat/client
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
20 commits
Select commit
Hold shift + click to select a range
1a1557d
Plan Tenant Wrapper subprojects
kumanday 5b2838d
doc: replace newlines with br tags for mermaid
kumanday f9038a4
Implement OCTW one-click deploy
kumanday 0c65803
Harden proxy config and docs
kumanday da4153b
Harden HTTP calls and Docker user
kumanday 44f4c5e
Document Google Workspace secrets
kumanday b51a69f
Add USER directive in proxy Dockerfi
kumanday dd6fb0d
Monitor docker compose services
kumanday 42a023b
Add /health endpoint to edge
kumanday 88bf4b1
Investigate hanging site after cert
kumanday b0f17f1
Troubleshoot octw-dev hanging page
kumanday c155d68
Fix oauth2 redirect loop
kumanday 8a27d58
Fix infinite oauth redirect loop
kumanday 9f03bb3
Fix slug regex overriding routes
kumanday 27a6efb
Add spinner and fix provisioning
kumanday 8d5a01c
Fix provisioning foreign key failure
kumanday cd74c1a
Fix messaging and localization
kumanday 4c01b4a
Update tenant email heading
kumanday b892927
Fix chat websocket responses
kumanday 6ff71f0
Fix tenant header and Enter send
kumanday File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,12 @@ | ||
| # Project-specific playbook rules | ||
| # These are merged with your global ~/.cass-memory/playbook.yaml | ||
| # Project rules take precedence over global rules | ||
| schema_version: 2 | ||
| name: repo-playbook | ||
| description: Project-specific rules for this repository | ||
| metadata: | ||
| createdAt: 2026-03-09T04:30:43.156Z | ||
| totalReflections: 0 | ||
| totalSessionsProcessed: 0 | ||
| deprecatedPatterns: [] | ||
| bullets: [] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,44 @@ | ||
| # Core control-plane settings | ||
| OCTW_DB_URL=postgresql+asyncpg://octw:octw@octw-db:5432/octw | ||
| OCTW_REDIS_URL=redis://octw-cache:6379/0 | ||
| OCTW_PUBLIC_BASE_URL=https://octw.example.com | ||
| OCTW_SERVER_NAME=octw.example.com | ||
| OCTW_EDGE_DOMAIN=octw.example.com | ||
| OCTW_API_INTERNAL_BASE_URL=http://octw-api:8000 | ||
| OCTW_TRUSTED_PROXY_ENABLED=true | ||
| OCTW_TRUSTED_PROXY_USER_HEADER=X-Forwarded-Email | ||
| OCTW_TRUSTED_PROXY_IPS=172.30.0.0/24 | ||
| OCTW_DEFAULT_PROVIDER=zai | ||
|
|
||
| # Secrets | ||
| # Generate with: python3 -c "import secrets; print(secrets.token_urlsafe(32))" | ||
| OCTW_JWT_SECRET=replace-with-strong-random-token | ||
| # Generate with: python3 -c "import os; print(os.urandom(32).hex())" | ||
| OCTW_KEK=replace-with-64-hex-character-kek | ||
|
|
||
| # Shared provider API keys (set at least one) | ||
| OCTW_ZAI_API_KEY= | ||
| OCTW_MOONSHOT_API_KEY= | ||
| OCTW_MINIMAX_API_KEY= | ||
|
|
||
| # oauth2-proxy base settings | ||
| # Valid providers include: oidc, keycloak-oidc, google | ||
| OCTW_OIDC_PROVIDER=oidc | ||
| # Config file under configs/oauth2-proxy/ used by the oauth2-proxy container. | ||
| OCTW_OIDC_CONFIG_FILE=oauth2-proxy.cfg | ||
| # Required for generic OIDC and keycloak-oidc. Leave blank for google. | ||
| OCTW_OIDC_ISSUER_URL=https://issuer.example.com/realms/octw | ||
| OCTW_OIDC_CLIENT_ID=octw | ||
| OCTW_OIDC_CLIENT_SECRET=replace-with-oidc-client-secret | ||
| # Generate with: python3 -c "import base64, os; print(base64.urlsafe_b64encode(os.urandom(32)).decode().rstrip('='))" | ||
| OCTW_OIDC_COOKIE_SECRET=replace-with-base64-cookie-secret | ||
| # Restrict login to your workspace domain. Use * only for isolated test environments. | ||
| OCTW_OIDC_EMAIL_DOMAINS=example.com | ||
| # Allow oauth2-proxy redirects back to this host. Prefix subdomains with a dot. | ||
| OCTW_OIDC_WHITELIST_DOMAINS=.example.com | ||
|
|
||
| # Provider-specific examples live in: | ||
| # configs/oauth2-proxy/keycloak.example.cfg | ||
| # configs/oauth2-proxy/google-workspace.example.cfg | ||
| # For Google Workspace group checks, place the Admin SDK service account JSON at: | ||
| # configs/oauth2-proxy/credentials/google-admin-sdk.json |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Empty file.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,98 @@ | ||
| map $http_upgrade $connection_upgrade { | ||
| default upgrade; | ||
| '' close; | ||
| } | ||
|
|
||
| server { | ||
| listen 8080; | ||
| server_name ${OCTW_SERVER_NAME}; | ||
| port_in_redirect off; | ||
| return 301 https://$host$request_uri; | ||
| } | ||
|
|
||
| server { | ||
| listen 8443 ssl; | ||
| http2 on; | ||
| server_name ${OCTW_SERVER_NAME}; | ||
| port_in_redirect off; | ||
|
|
||
| ssl_certificate ${OCTW_SSL_CERT_FILE}; | ||
| ssl_certificate_key ${OCTW_SSL_KEY_FILE}; | ||
| ssl_session_timeout 1d; | ||
| ssl_session_cache shared:SSL:10m; | ||
| ssl_protocols TLSv1.2 TLSv1.3; | ||
|
|
||
| proxy_http_version 1.1; | ||
| proxy_set_header Host $host; | ||
| proxy_set_header X-Real-IP $remote_addr; | ||
| proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; | ||
| proxy_set_header X-Forwarded-Proto https; | ||
| proxy_set_header X-Forwarded-Host $host; | ||
| proxy_set_header X-Forwarded-Port 443; | ||
|
|
||
| location ^~ /oauth2/ { | ||
| proxy_pass http://octw-oidc:4180; | ||
| proxy_set_header X-Forwarded-Uri $request_uri; | ||
| proxy_set_header X-Scheme https; | ||
| } | ||
|
|
||
| location = /oauth2/auth { | ||
| internal; | ||
| proxy_pass http://octw-oidc:4180/oauth2/auth; | ||
| proxy_set_header X-Forwarded-Uri $request_uri; | ||
| proxy_set_header Content-Length ""; | ||
| proxy_pass_request_body off; | ||
| } | ||
|
|
||
| error_page 401 = @oauth2_signin; | ||
|
|
||
| location @oauth2_signin { | ||
| return 302 /oauth2/start?rd=$scheme://$http_host$request_uri; | ||
| } | ||
|
|
||
| location = /health { | ||
| proxy_pass http://octw-api:8000/health; | ||
| } | ||
|
|
||
| location = / { | ||
| return 302 /app; | ||
| } | ||
|
|
||
| location ^~ /app { | ||
| auth_request /oauth2/auth; | ||
| auth_request_set $user_email $upstream_http_x_auth_request_email; | ||
| proxy_set_header X-Forwarded-Email $user_email; | ||
| proxy_pass http://octw-api:8000; | ||
| } | ||
|
|
||
| location ^~ /api/v1/app/ { | ||
| auth_request /oauth2/auth; | ||
| auth_request_set $user_email $upstream_http_x_auth_request_email; | ||
| proxy_set_header X-Forwarded-Email $user_email; | ||
| proxy_read_timeout 300s; | ||
| proxy_send_timeout 300s; | ||
| proxy_pass http://octw-api:8000; | ||
| } | ||
|
|
||
| location /t/ { | ||
| auth_request /oauth2/auth; | ||
| proxy_set_header Upgrade $http_upgrade; | ||
| proxy_set_header Connection $connection_upgrade; | ||
| proxy_pass http://octw-edge:8443; | ||
| } | ||
|
|
||
| location /oauth2/sign_out { | ||
| proxy_pass http://octw-oidc:4180/oauth2/sign_out; | ||
| } | ||
|
|
||
| location ~ ^/[a-z0-9][a-z0-9-]*/? { | ||
| auth_request /oauth2/auth; | ||
|
kumanday marked this conversation as resolved.
Resolved
|
||
| proxy_set_header Upgrade $http_upgrade; | ||
| proxy_set_header Connection $connection_upgrade; | ||
| proxy_pass http://octw-edge:8443; | ||
| } | ||
|
|
||
| location / { | ||
| return 404; | ||
| } | ||
| } | ||
Empty file.
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.