Spaces:
Sleeping
Sleeping
Commit History
-
Update jupyter_lab_config.py
Verified signature54d7d39 -
Update start.sh
Verified signature74ba644 -
Update Dockerfile
Verified signature4bb9a18
-
fix: move DASHBOARD_HTML to module level (was unreachable after run_app)
6ad7c17 -
feat: universal multi-app proxy - streaming, cookie rewrite, body URL rewrite, WS subprotocol, auto-detect dashboard
2fb68e4 -
fix: strip accept-encoding + install brotli to prevent 502 on multi-port proxy
4ab4eac -
fix: JupyterLab base_url=/8888/ + rewrite Location headers for redirects
a05c7e2 -
feat: multi-port proxy - dashboard + any port routing
8267b84 -
perf: shared ClientSession with connection pooling + in-memory static cache
c211f6f -
fix: remove environment= from supervisord to preserve HF secrets (password)
2ad5d30 -
fix: set SHELL=/bin/bash so arrow keys work in terminal
1a48c86 -
fix: show hidden files in file browser (server config + frontend override)
fe0ff63 -
fix: add --allow-root flag for JupyterLab running as root
3b584fc -
fix: run JupyterLab as root so root_dir=/ is fully writable
43aa492 -
Add Node.js 20 (npm/npx) + Bun to Dockerfile
- Node.js 20.x via nodesource (provides node, npm, npx) - Bun installed globally via npm - System tools: ca-certificates for HTTPS downloadsfcc8d07 -
Set root_dir=/ so file browser + terminal can navigate entire filesystem
User wants free navigation from root /. Tradeoff accepted: only /data is persistent on HF; files outside /data are lost on restart. - jupyter_lab_config.py: root_dir = '/' - start.sh: cd / so terminal cwd matches file browser root4c3f229 -
cd to /data before launching JupyterLab so terminal cwd matches file browser
Root cause of 'sidebar empty but ls shows 3 files': terminals inherited the server's working directory (/home/user/app, containing proxy.py/start.sh/ login.html) while the file browser is rooted at /data (persistent storage). Now start.sh cd's into NOTEBOOK_DIR first, so both show the same directory.8324543 -
Auto-detect ALL WebSocket upgrades (fixes /api/events/subscribe, terminals, kernels)
Instead of hardcoding WS paths (which break when JupyterLab adds new ones), the catch-all handler now auto-detects any request with Upgrade: websocket header and routes it to the WS relay. This fixes: - /api/events/subscribe (JupyterLab 4.x real-time events - was failing) - /api/kernels/{id}/channels (kernel connections) - /terminals/websocket/{id} (terminal sessions) - Any future WS endpoints without code changesdd82a99 -
Remove accidentally committed cookies.txt, add .gitignore
3a62b4a -
Fix 502 on /lab: use aiohttp.ClientTimeout instead of invalid timeout_class
ClientSession.timeout_class(total=300) was invalid (AttributeError), caught by the except block -> returned 502 for every proxied request. Static JS chunks only 'worked' before via the old nginx container. Now uses ClientTimeout(total=300) and logs actual proxy errors.797c81a -
Fix ImportError: import WSMsgType from aiohttp (top-level), not aiohttp.client
Root cause of APP_STARTING stuck: proxy.py crashed on import: ImportError: cannot import name 'WSMsgType' from 'aiohttp.client' WSMsgType lives in the aiohttp top-level package.039827e -
Fix proxy.py: route order (WS before catch-all), robust error handling, no type hints
- Register WebSocket routes BEFORE the catch-all proxy_handler - Remove Python 3.10+ type hints for broader compatibility - Add 502 fallback when JupyterLab upstream not ready - Add startup print for debugging345bf6a -
Replace nginx+flask auth with single aiohttp proxy (fix JS chunks getting HTML 302)
The nginx auth_request subrequest silently dropped Cookie headers on some requests (especially JS <script> loads), causing JupyterLab chunks to get HTML 302 redirects instead of JS — breaking the entire UI. New architecture (no nginx): Browser → :7860 (aiohttp proxy.py) → auth check in-process → proxy to JupyterLab :8888 (HTTP + WebSocket relay) Benefits: - No subrequest header forwarding issues - Cookie always checked in the actual request context - WebSocket kernel connections relayed properly - Single process = simpler debugging4e29137 -
Fix: forward Cookie to auth_request subrequest (JupyterLab JS chunks were getting HTML 302)
nginx does not pass the Cookie header to auth_request by default, so every sub-request (e.g. /static/lab/*.js) looked unauthenticated and returned the HTML login page instead of JS — causing 'Unexpected token <' in the browser.b8588b9 -
Fix redirect scheme: relative redirects, respect X-Forwarded-Proto from HF
- absolute_redirect off + port_in_redirect off => redirects stay on HTTPS - map X-Forwarded-Proto so 302s use https not http:host:7860932d6db -
Run supervisord as root, drop privileges per-program (fix APP_STARTING hang)
- supervisord as root entrypoint; nginx master root + worker as uid 1000 - authgate + jupyterlab run as user via supervisor 'user=' directive - restore standard nginx pid path /run/nginx.pidbfebeff -
Fix Dockerfile layer ordering + non-root nginx/supervisor paths
- Install system deps + create dirs as root first, then switch to user - pip install into system site-packages (on PATH for non-root user) - Move pid/logs/temp to /tmp and /var paths owned by uid 1000 - supervisord runs as non-root user with writable socket/pid9a8be9e -
Add password gate (nginx + Flask auth) in front of token-less JupyterLab
- nginx reverse proxy on port 7860 with auth_request gate - Flask auth_server validates password against HF secret 'password', sets HMAC-signed session cookie (7d) - JupyterLab runs token-less on localhost:8888, only reachable via proxy - custom login.html gate (dark theme, password form) - supervisord runs nginx + authgate + jupyterlab906bfb8 -
Add JupyterLab setup (Docker SDK, CPU)
b41442b -
initial commit
Verified signaturea545a72