Spaces:
Running
Running
Commit History
-
Fix UTF-8 PDF download filenames Running
th6e47fe8 -
feat: upgrade deps + security hardening (v2.0.0)β
Deps: fastapi 0.115.5->0.137.1, uvicorn 0.32.1->0.49.0, pydantic 2.10.3->2.13.4, playwright 1.48.0->1.60.0 (Chromium 148); drop unused python-multipart. Dockerfile: add libatspi2.0-0/libdrm2/ libxkbcommon0/libxshmfence1 for the newer Chromium. Hardening (app.py): - API_KEY now required; service refuses to start without it (removed the insecure default "sisi_default_key_change_me"); constant-time compare - Shared Chromium launched once via lifespan + per-request context, capped by a semaphore (PDF_MAX_CONCURRENCY, default 4) instead of launching a browser per request - HTML payload size limit (MAX_HTML_BYTES, default 2MB) -> 413 - Content-Disposition filename sanitized (no header injection) - SSRF guard: block renderer sub-requests to private/loopback/link-local hosts and non-http(s) schemes; data:/blob: (embedded logos) still allowed - CORS origins env-configurable (ALLOWED_ORIGINS), default permissive Verified locally: docker build OK (Chromium 148 headless-shell), refuse-toβ¦f61f44d -
Improve PDF rendering and document integration
thbebd683
-
π Add API Key authentication to prevent abuseβ
SisiTheFox- Add API_KEY environment variable check - Protect /generate-pdf endpoint with API key - Protect /generate-pdf-base64 endpoint with API key - Keep /health endpoint public for monitoring - Return 403 error for unauthorized requests This protects the PDF generation API from being abused. π¦ Created by SisiTheFox97018c0
-
Fix: Remove --with-deps flag to avoid font package conflictsβ
thChanges: - Use `playwright install chromium` without --with-deps - All system dependencies already installed manually in first RUN layer - This avoids the ttf-unifont/ttf-ubuntu-font-family conflicts The first RUN layer already includes all necessary deps: - fonts-noto-cjk (Chinese) - fonts-noto-color-emoji (Emoji) - fonts-noto-cjk-extra (Extended CJK) - All Chromium runtime dependencies π€ Generated with Claude Code Co-Authored-By: Claude <noreply@anthropic.com>7893cd8 -
Fix Dockerfile: Use --with-deps for Playwright installationβ
thChanges: - Replace separate `playwright install-deps` with `--with-deps` flag - Add fonts-noto-cjk-extra for better Chinese character coverage - Simplify dependency installation to avoid package name conflicts This fixes the HF Space build error: E: Package 'ttf-unifont' has no installation candidate E: Package 'ttf-ubuntu-font-family' has no installation candidate π€ Generated with Claude Code Co-Authored-By: Claude <noreply@anthropic.com>25faf9b -
Add HF Spaces metadata to READMEβ
th- Configure docker SDK - Set app port 7860 - Add purple-pink gradient theme - Enable public access π€ Generated with Claude Code Co-Authored-By: Claude <noreply@anthropic.com>4d9617f -
Merge: Use our comprehensive README
th077fb99 -
initial commit
Verified signature41adad4 -
π¦ Initial commit: Sisi PDF API with Playwrightβ
thβ¨ Features: - Perfect Chinese support (Simplified & Traditional) - Colorful emoji rendering π¦πβ¨ - 100% accurate SVG graphics - Modern CSS3 support (Flexbox, Grid, Gradients) - Async/concurrent PDF generation - Two endpoints: binary PDF & base64 JSON ποΈ Tech Stack: - FastAPI + Playwright + Chromium - Docker optimized for HF Spaces - Fonts: Noto CJK + Noto Color Emoji π Performance: - 2-5 seconds per PDF - 5-10 concurrent requests - Perfect for production use π― Use Cases: - Birth chart reports (Sisi Astrology) - Bazi readings (Astrology Bazi) - Healing reports (SisiTheFox) - Any document with Chinese/Emoji/SVGe72cddb