-
-
Notifications
You must be signed in to change notification settings - Fork 870
Chore/update docker pulls metrics #520
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
Chore/update docker pulls metrics #520
Conversation
Update README to reflect current project status and features.
- Add i18n framework with locale detection and cookie persistence - Support English, Traditional Chinese (zh-TW), Simplified Chinese (zh-CN), Japanese (ja), Korean (ko) - Add LanguageSelector component in navigation header - Create locale JSON files with full translations - Update all page components (root, user, results, history) with i18n support - Add client-side translation helpers for dynamic content - Auto-detect user's preferred language from browser settings - Bump version to v0.1.3
- Fix TypeScript TS2345 error in i18n/service.ts by parsing cookie from header - Rebrand all ConvertX references to ConvertX-CN - Change default language from en to zh-TW - Fix footer to always display English 'Powered by ConvertX-CN' - Update GitHub links to pi-docket/ConvertX-CN - Add /docs folder with documentation: - getting-started.md - configuration.md - converters.md - i18n.md - Update all locale files with new branding
🌐 國際化 (i18n) - 從 5 種語言擴展到 65 種語言支援 - 新增:歐洲語系 (de, fr, es, it, pt, ru, nl, pl, tr, uk, cs, sv, da, fi, no, el, hu, ro, bg, hr, sk, sl, lt, lv, et, is, ga, cy, mt, mk, sq, ca, eu, gl, sr) - 新增:中東語系 (ar, he, fa) - 新增:南亞語系 (hi, bn, ta, te, mr, gu, kn, ml, ne, si) - 新增:東南亞語系 (th, vi, id, ms, fil, my, km, lo) - 新增:非洲語系 (af, sw, am, zu) - 完整翻譯所有 UI 文字 📖 文件系統 - 重構 README.md 為入口型首頁 - 新增 docs/getting-started.md - 快速入門指南 - 新增 docs/docker.md - Docker 部署指南 - 新增 docs/environment-variables.md - 環境變數說明 - 新增 docs/url-id-and-storage.md - 儲存結構說明 - 新增 docs/advanced-usage.md - 進階使用指南 - 更新 docs/i18n.md - 65 種語言清單 ✅ 建構驗證 - TypeScript 編譯通過 - Docker 建構通過
## Changes ### i18n Module Fixes - Fix import paths in service.ts, languageSelector.tsx, header.tsx, base.tsx, results.tsx - Change from '../i18n' to '../i18n/index' or './index' for proper module resolution ### Registration (Breaking Change) - Change ACCOUNT_REGISTRATION default from false to true (out-of-box ready) - Login and Register pages now both visible by default ### Version Bump - Update package.json to v0.1.4 - Update CHANGELOG.md with v0.1.4 release notes - Update README.md and docs with new version numbers ### Build Verification - bun run build: PASSED - Docker build: PASSED - TypeScript compilation: PASSED (no errors)
## Registration (Breaking Change) - Remove ACCOUNT_REGISTRATION restriction on Register page - Login page always shows Register link - Registration behavior now matches upstream v0.17.0 ## UI Improvements - Language selector dropdown: add max-height (320px) + overflow-y: auto - Prevents UI overflow when 65+ languages are displayed ## Documentation - New docs/faq.md with common questions - Simplified README quick start (remove ACCOUNT_REGISTRATION from examples) - Updated getting-started.md with folder initialization guide ## Build Verification - bun run build: PASSED - Docker build: PASSED - TypeScript: PASSED
- Remove unused SupportedLocale import in results.tsx - Remove unused webroot variable in public/i18n.js - Configure knip.json to ignore i18n public API exports - Add language-selector and language-option to ESLint ignore list - Auto-fix Prettier formatting across all files - Fix better-tailwindcss line wrapping issues
- 優化 Dockerfile 註解與標頭 - 新增 Dockerfile.full 擴充範本 (FROM convertx-cn:latest) - 依地區分類 65+ OCR 語言 - 額外字型/TexLive 套件選項 - 每個區塊含預估大小說明 - 更新 docker.md 雙 Image 說明文件 - 版本更新至 0.1.6
- dockerhub-description.yml: - 修正 IMAGE_NAME 為 convertx/convertx-cn - 新增 continue-on-error 避免阻擋 Release - 新增 workflow_run 觸發器 - release.yml: - 新增 workflow_dispatch 手動觸發支援 - 新增 permissions 設定 - 優化 disk cleanup 錯誤處理 - docker-publish.yml: - 修正 DOCKERHUB_USERNAME 從 secrets 讀取 - 修正 DOCKER_IMAGE 為正確的 convertx/convertx-cn
## Bug Fixes - Cookie sameSite 從 strict 改為 lax(修復遠端存取問題) - 新增 Cookie path 設定確保覆蓋整個應用 - 新增 TRUST_PROXY 環境變數支援 reverse proxy ## Features - Dockerfile 新增 texlive-lang-arabic/other(阿拉伯/希伯來語) - Dockerfile 新增 python3-opencv(電腦視覺) - Dockerfile 新增 libavcodec-extra(額外編解碼器) - Locale 預設改為 zh_TW.UTF-8 - Pandoc PDF 引擎改用 pdflatex ## Docs - compose.yaml 新增 TRUST_PROXY 說明 - 新增遠端部署注意事項
- 新增 PDF 匯入管線:PDF → DOCX/ODT/RTF/TXT/HTML 使用 --infilter=writer_pdf_import - 新增輸出檔案存在性驗證,避免 ENOENT 錯誤 - 改善錯誤訊息:密碼保護、檔案損壞、無匯出過濾器等情境 - 重寫測試套件:19 個測試全數通過
✨ Features: - 全頁拖曳上傳:檔案可拖曳到頁面任何位置上傳 - 原本的上傳框視覺效果保持不變 🌍 i18n: - 刪除任務的 confirm/alert 訊息改用 i18n - 隨語言切換即時更新顯示內容 📚 Documentation: - README 新增「如何更新 ConvertX-CN 版本」章節 - 新增 deployment.md(Reverse Proxy、HTTPS) - 新增 Docker Compose 範例分層 - 更新 environment-variables.md
✨ Features: - 全頁拖曳上傳:檔案可拖曳到頁面任何位置 - Setup 頁面新增語言選擇器 🐛 Bug Fixes: - 語言 icon 尺寸修復(h-5→h-6) - Dropdown 背景完全不透明 - 新增 scrollbar 樣式 🌍 i18n: - 所有 confirm/alert 訊息國際化 - Setup 頁面 i18n 完整化 📚 Documentation: - README 精簡為開箱即用版本 - 新增 docs/deployment/, docs/config/, docs/versions/
README 改動: - 新增 Docker Run 快速啟動區塊 - 重新編排為 10 個標準區塊 - 加入作業系統資料夾提醒表格 - 精簡進階設定為連結列表 - 減少 emoji 使用 docs 改動: - i18n.md 新增語言選擇器 UI 規範 - getting-started.md 去重並加入返回連結 - 標題與連結一致化
- Implement JWT authentication layer - Add Engine Registry with 20+ conversion engines - Implement Conversion Service with background job processing - REST API endpoints for file conversion operations - GraphQL API with queries and mutations - Comprehensive error handling with conversion suggestions - Integration tests for both REST and GraphQL APIs - Complete API documentation Features: - REST API: /api/v1/* endpoints - GraphQL API: /graphql endpoint with playground - JWT Bearer token authentication - Engine validation with alternative suggestions - File download via API (not exposing file paths) - Support for FFmpeg, ImageMagick, LibreOffice, Pandoc, and more
…Server - API Server Dockerfile (多階段建置) - .env.api.example 環境變數範本 - integration_tests.rs 完整整合測試 - health_check.sh 健康檢查腳本 - 主專案 README 新增 API Server 說明區塊
- Updated tables for service ports, environment variables, HTTP status codes, and error codes to enhance readability. - Streamlined JavaScript examples for file conversion and added comments for better understanding. - Enhanced troubleshooting section with clearer formatting and additional explanations. - Improved licensing section with detailed requirements and third-party component licenses. - Organized the document structure for better navigation and accessibility.
- Dockerfile: 將 mineru[all] 改為 mineru,移除 PyTorch CUDA 依賴 - Dockerfile.full: 新增 GPU 加速選項(PyTorch CUDA)供進階用戶啟用 - 預估 image 大小從 10-14GB 降至 3-5GB - MinerU 仍可正常運行(使用 pipeline backend)
…eration and prediction model - Add formatCandidateRules.ts to define rules for generating format candidates based on file features. - Introduce formatPredictionModel.ts to predict the most likely target format based on user behavior and file features. - Create inferenceService.ts to integrate all inference modules and provide a unified inference API. - Develop inference.tsx as an API endpoint for frontend calls to predict formats and engines based on file extensions. - Implement logging for conversion events and dismissals, along with user profile retrieval. - Ensure warmup management for engine predictions and provide status checks.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
11 issues found across 282 files
Note: This PR contains a large number of files. cubic only reviews up to 75 files per PR, so some files may not have been reviewed.
Prompt for AI agents (all issues)
Check if these issues are valid — if so, understand the root cause of each and fix them.
<file name="docs/API/端點.md">
<violation number="1" location="docs/API/端點.md:33">
P2: REST docs repeat the `/api/v1` prefix in both Base URL and endpoint paths, leading to inconsistent URL construction (double `/api/v1`).</violation>
</file>
<file name="docs/Docker組合配置/README.md">
<violation number="1" location="docs/Docker組合配置/README.md:94">
P2: OCR built-in language list (7 items) conflicts with the stated default count (8), creating a documentation inconsistency.</violation>
</file>
<file name="docs/配置設定/環境變數.md">
<violation number="1" location="docs/配置設定/環境變數.md:42">
P2: Inconsistent default value for PDFMATHTRANSLATE_MODELS_PATH between quick reference and detailed section.</violation>
</file>
<file name="api-server/src/config.rs">
<violation number="1" location="api-server/src/config.rs:33">
P1: Hardcoded fallback JWT secret allows the server to run with a predictable signing key when JWT_SECRET is unset, enabling token forgery if configuration is missed.</violation>
</file>
<file name="Dockerfile.full">
<violation number="1" location="Dockerfile.full:29">
P2: Base image uses the mutable `latest` tag, which breaks reproducible builds and increases supply-chain risk. Pin to a specific version or digest.</violation>
</file>
<file name="api-server/src/auth.rs">
<violation number="1" location="api-server/src/auth.rs:142">
P1: Avoid falling back to a hardcoded JWT secret. If JWT_SECRET is missing, authentication becomes predictable and tokens can be forged with the default key. Fail fast with an internal error instead.</violation>
</file>
<file name="docs/功能說明/OCR.md">
<violation number="1" location="docs/功能說明/OCR.md:166">
P3: Inconsistent built-in OCR language count in the same doc (7 vs 8) can mislead users; align the count or clarify auto-detection mode separately.</violation>
</file>
<file name="api-server/Dockerfile">
<violation number="1" location="api-server/Dockerfile:97">
P2: Healthcheck uses curl but the runtime image never installs curl, so the container healthcheck will always fail (`curl: not found`).</violation>
</file>
<file name="docs/功能說明/多語言介面.md">
<violation number="1" location="docs/功能說明/多語言介面.md:116">
P2: The Southeast Asia section header says 7 languages, but the table lists 8, creating a documentation inconsistency.</violation>
<violation number="2" location="docs/功能說明/多語言介面.md:146">
P2: Section count claims 3 languages but lists 4, causing documentation inconsistency.</violation>
</file>
<file name=".github/UPSTREAM_SYNC.md">
<violation number="1" location=".github/UPSTREAM_SYNC.md:170">
P2: Smoke test docs curl localhost without publishing container port, so host curl will not reach the container.</violation>
</file>
Since this is your first cubic review, here's how it works:
- cubic automatically reviews your code and comments on bugs and improvements
- Teach cubic by replying to its comments. cubic learns from your replies and gets better over time
- Ask questions if you need clarification on any suggestion
Reply with feedback, questions, or to request a fix. Tag @cubic-dev-ai to re-run a review.
| port: env::var("API_PORT") | ||
| .unwrap_or_else(|_| "3001".to_string()) | ||
| .parse()?, | ||
| jwt_secret: env::var("JWT_SECRET") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
P1: Hardcoded fallback JWT secret allows the server to run with a predictable signing key when JWT_SECRET is unset, enabling token forgery if configuration is missed.
Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At api-server/src/config.rs, line 33:
<comment>Hardcoded fallback JWT secret allows the server to run with a predictable signing key when JWT_SECRET is unset, enabling token forgery if configuration is missed.</comment>
<file context>
@@ -0,0 +1,75 @@
+ port: env::var("API_PORT")
+ .unwrap_or_else(|_| "3001".to_string())
+ .parse()?,
+ jwt_secret: env::var("JWT_SECRET")
+ .unwrap_or_else(|_| "your-super-secret-jwt-key-change-in-production".to_string()),
+ upload_dir: env::var("UPLOAD_DIR")
</file context>
| let jwt_secret = std::env::var("JWT_SECRET") | ||
| .unwrap_or_else(|_| "your-super-secret-jwt-key-change-in-production".to_string()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
P1: Avoid falling back to a hardcoded JWT secret. If JWT_SECRET is missing, authentication becomes predictable and tokens can be forged with the default key. Fail fast with an internal error instead.
Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At api-server/src/auth.rs, line 142:
<comment>Avoid falling back to a hardcoded JWT secret. If JWT_SECRET is missing, authentication becomes predictable and tokens can be forged with the default key. Fail fast with an internal error instead.</comment>
<file context>
@@ -0,0 +1,287 @@
+
+ async fn from_request_parts(parts: &mut Parts, _state: &S) -> Result<Self, Self::Rejection> {
+ // Get the JWT secret from environment or use default
+ let jwt_secret = std::env::var("JWT_SECRET")
+ .unwrap_or_else(|_| "your-super-secret-jwt-key-change-in-production".to_string());
+
</file context>
| let jwt_secret = std::env::var("JWT_SECRET") | |
| .unwrap_or_else(|_| "your-super-secret-jwt-key-change-in-production".to_string()); | |
| let jwt_secret = std::env::var("JWT_SECRET") | |
| .map_err(|_| AuthError(ApiError::InternalError("JWT_SECRET must be set".into())))?; |
|
|
||
| ### 引擎管理 | ||
|
|
||
| #### `GET /api/v1/engines` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
P2: REST docs repeat the /api/v1 prefix in both Base URL and endpoint paths, leading to inconsistent URL construction (double /api/v1).
Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At docs/API/端點.md, line 33:
<comment>REST docs repeat the `/api/v1` prefix in both Base URL and endpoint paths, leading to inconsistent URL construction (double `/api/v1`).</comment>
<file context>
@@ -0,0 +1,261 @@
+
+### 引擎管理
+
+#### `GET /api/v1/engines`
+
+列出所有可用的轉換引擎。
</file context>
|
|
||
| > 💡 內建 OCR 語言:英文、繁體中文、簡體中文、日文、韓文、德文、法文 | ||
| > | ||
| > 翻譯引擎支援 15 種語言,但 OCR 預設只內建 8 種 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
P2: OCR built-in language list (7 items) conflicts with the stated default count (8), creating a documentation inconsistency.
Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At docs/Docker組合配置/README.md, line 94:
<comment>OCR built-in language list (7 items) conflicts with the stated default count (8), creating a documentation inconsistency.</comment>
<file context>
@@ -0,0 +1,94 @@
+
+> 💡 內建 OCR 語言:英文、繁體中文、簡體中文、日文、韓文、德文、法文
+>
+> 翻譯引擎支援 15 種語言,但 OCR 預設只內建 8 種
</file context>
| | 變數 | 說明 | 預設值 | | ||
| | ------------------------------ | -------- | --------- | | ||
| | `PDFMATHTRANSLATE_SERVICE` | 翻譯服務 | `google` | | ||
| | `PDFMATHTRANSLATE_MODELS_PATH` | 模型路徑 | `/models` | |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
P2: Inconsistent default value for PDFMATHTRANSLATE_MODELS_PATH between quick reference and detailed section.
Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At docs/配置設定/環境變數.md, line 42:
<comment>Inconsistent default value for PDFMATHTRANSLATE_MODELS_PATH between quick reference and detailed section.</comment>
<file context>
@@ -0,0 +1,299 @@
+| 變數 | 說明 | 預設值 |
+| ------------------------------ | -------- | --------- |
+| `PDFMATHTRANSLATE_SERVICE` | 翻譯服務 | `google` |
+| `PDFMATHTRANSLATE_MODELS_PATH` | 模型路徑 | `/models` |
+
+---
</file context>
| EXPOSE 3001/tcp | ||
|
|
||
| # Health check | ||
| HEALTHCHECK --interval=30s --timeout=10s --start-period=5s --retries=3 \ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
P2: Healthcheck uses curl but the runtime image never installs curl, so the container healthcheck will always fail (curl: not found).
Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At api-server/Dockerfile, line 97:
<comment>Healthcheck uses curl but the runtime image never installs curl, so the container healthcheck will always fail (`curl: not found`).</comment>
<file context>
@@ -0,0 +1,101 @@
+EXPOSE 3001/tcp
+
+# Health check
+HEALTHCHECK --interval=30s --timeout=10s --start-period=5s --retries=3 \
+ CMD curl -f http://localhost:3001/health || exit 1
+
</file context>
| | `sq` | 阿爾巴尼亞 | Shqip | | ||
| | `el` | 希臘文 | Ελληνικά | | ||
|
|
||
| ### 非洲語言(3 種) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
P2: Section count claims 3 languages but lists 4, causing documentation inconsistency.
Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At docs/功能說明/多語言介面.md, line 146:
<comment>Section count claims 3 languages but lists 4, causing documentation inconsistency.</comment>
<file context>
@@ -0,0 +1,186 @@
+| `sq` | 阿爾巴尼亞 | Shqip |
+| `el` | 希臘文 | Ελληνικά |
+
+### 非洲語言(3 種)
+
+| 代碼 | 語言 | 原生名稱 |
</file context>
| ### 非洲語言(3 種) | |
| ### 非洲語言(4 種) |
| | `ne` | 尼泊爾文 | नेपाली | | ||
| | `si` | 僧伽羅文 | සිංහල | | ||
|
|
||
| ### 東南亞語言(7 種) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
P2: The Southeast Asia section header says 7 languages, but the table lists 8, creating a documentation inconsistency.
Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At docs/功能說明/多語言介面.md, line 116:
<comment>The Southeast Asia section header says 7 languages, but the table lists 8, creating a documentation inconsistency.</comment>
<file context>
@@ -0,0 +1,186 @@
+| `ne` | 尼泊爾文 | नेपाली |
+| `si` | 僧伽羅文 | සිංහල |
+
+### 東南亞語言(7 種)
+
+| 代碼 | 語言 | 原生名稱 |
</file context>
| ### 東南亞語言(7 種) | |
| ### 東南亞語言(8 種) |
|
|
||
| ```bash | ||
| # 啟動 container 並等待 healthcheck 回應 | ||
| docker run -d --name convertx-test $IMAGE |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
P2: Smoke test docs curl localhost without publishing container port, so host curl will not reach the container.
Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At .github/UPSTREAM_SYNC.md, line 170:
<comment>Smoke test docs curl localhost without publishing container port, so host curl will not reach the container.</comment>
<file context>
@@ -0,0 +1,280 @@
+
+```bash
+# 啟動 container 並等待 healthcheck 回應
+docker run -d --name convertx-test $IMAGE
+curl http://localhost:3000/healthcheck
+```
</file context>
| docker run -d --name convertx-test $IMAGE | |
| docker run -d --name convertx-test -p 3000:3000 $IMAGE |
No description provided.