feat(i18n): add multilingual support with translations for English, Japanese, and Simplified Chinese

- Create README.md for internationalization (i18n) documentation
- Add English translation for main README and quick start guide
- Add Japanese translation for main README
- Add Simplified Chinese translation for main README
- Introduce sample Docker Compose configurations for various deployment scenarios
- Implement CI/CD documentation for testing and deployment workflows
- Establish end-to-end testing guidelines and strategies
- Create test strategy documentation outlining unit, integration, and E2E tests
This commit is contained in:
Your Name 2026-01-23 14:32:27 +08:00
parent b3b382d1e0
commit da856d89ff
42 changed files with 4901 additions and 263 deletions

54
docs/samples/README.md Normal file
View file

@ -0,0 +1,54 @@
# Docker Compose 範例與配置
本目錄提供各種場景的 Docker Compose 範例配置。
---
## 範例檔案
| 檔案 | 用途 | 說明 |
| -------------------------- | ---------- | ---------------- |
| `compose.minimal.yml` | 快速啟動 | 最精簡配置 |
| `compose.production.yml` | 生產環境 | 包含安全設定 |
| `compose.with-traefik.yml` | 反向代理 | Traefik 整合 |
| `nginx.example.conf` | Nginx 設定 | 反向代理設定範例 |
---
## 如何使用
### 1. 下載範例
```bash
# 下載最小配置
curl -O https://raw.githubusercontent.com/pi-docket/ConvertX-CN/main/docs/samples/compose.minimal.yml
# 重命名
mv compose.minimal.yml docker-compose.yml
```
### 2. 修改設定
```bash
# 編輯配置
nano docker-compose.yml
# 重點修改:
# - JWT_SECRET
# - TZ
```
### 3. 啟動
```bash
mkdir -p data
docker compose up -d
```
---
## 相關文件
- [Docker 部署](../deployment/docker.md)
- [環境變數](../configuration/environment-variables.md)
- [反向代理](../deployment/reverse-proxy.md)

View file

@ -0,0 +1,15 @@
# ConvertX-CN 最小配置
# 適用於:快速測試、個人使用
services:
convertx:
image: convertx/convertx-cn:latest
container_name: convertx-cn
restart: unless-stopped
ports:
- "3000:3000"
volumes:
- ./data:/app/data
environment:
- TZ=Asia/Taipei
- JWT_SECRET=請更換為長且隨機的字串至少32字元

View file

@ -0,0 +1,46 @@
# ConvertX-CN 生產環境配置
# 適用於:正式部署
services:
convertx:
image: convertx/convertx-cn:latest
container_name: convertx-cn
restart: unless-stopped
ports:
- "127.0.0.1:3000:3000" # 只允許本機存取,透過反向代理對外
volumes:
- ./data:/app/data
environment:
# 必填:登入驗證金鑰(至少 32 字元)
- JWT_SECRET=${JWT_SECRET:?請設定 JWT_SECRET}
# 時區
- TZ=Asia/Taipei
# 安全性設定
- HTTP_ALLOWED=false # 禁止 HTTP使用 HTTPS
- TRUST_PROXY=true # 信任反向代理
- ACCOUNT_REGISTRATION=false # 關閉公開註冊
# 清理設定
- AUTO_DELETE_EVERY_N_HOURS=24
deploy:
resources:
limits:
memory: 4G
reservations:
memory: 2G
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:3000/healthcheck"]
interval: 30s
timeout: 10s
retries: 3
start_period: 60s
logging:
driver: json-file
options:
max-size: "10m"
max-file: "3"

View file

@ -0,0 +1,37 @@
# ConvertX-CN + Traefik 配置
# 適用於:使用 Traefik 作為反向代理
services:
convertx:
image: convertx/convertx-cn:latest
container_name: convertx-cn
restart: unless-stopped
volumes:
- ./data:/app/data
environment:
- JWT_SECRET=${JWT_SECRET:?請設定 JWT_SECRET}
- TZ=Asia/Taipei
- HTTP_ALLOWED=false
- TRUST_PROXY=true
- ACCOUNT_REGISTRATION=false
labels:
- "traefik.enable=true"
# HTTP 路由
- "traefik.http.routers.convertx.rule=Host(`convertx.example.com`)"
- "traefik.http.routers.convertx.entrypoints=web"
- "traefik.http.routers.convertx.middlewares=https-redirect"
# HTTPS 路由
- "traefik.http.routers.convertx-secure.rule=Host(`convertx.example.com`)"
- "traefik.http.routers.convertx-secure.entrypoints=websecure"
- "traefik.http.routers.convertx-secure.tls=true"
- "traefik.http.routers.convertx-secure.tls.certresolver=letsencrypt"
# 服務
- "traefik.http.services.convertx.loadbalancer.server.port=3000"
# 中間件
- "traefik.http.middlewares.https-redirect.redirectscheme.scheme=https"
networks:
- traefik-network
networks:
traefik-network:
external: true

View file

@ -0,0 +1,71 @@
# ConvertX-CN Nginx 反向代理配置範例
# 檔案位置:/etc/nginx/sites-available/convertx
# HTTP → HTTPS 重導向
server {
listen 80;
listen [::]:80;
server_name convertx.example.com;
# Let's Encrypt 驗證
location /.well-known/acme-challenge/ {
root /var/www/certbot;
}
# 重導向到 HTTPS
location / {
return 301 https://$server_name$request_uri;
}
}
# HTTPS 伺服器
server {
listen 443 ssl http2;
listen [::]:443 ssl http2;
server_name convertx.example.com;
# SSL 憑證Let's Encrypt
ssl_certificate /etc/letsencrypt/live/convertx.example.com/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/convertx.example.com/privkey.pem;
# SSL 設定(安全強化)
ssl_protocols TLSv1.2 TLSv1.3;
ssl_prefer_server_ciphers on;
ssl_ciphers ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384;
ssl_session_cache shared:SSL:10m;
ssl_session_timeout 10m;
# 安全 Headers
add_header Strict-Transport-Security "max-age=31536000; includeSubDomains" always;
add_header X-Content-Type-Options nosniff;
add_header X-Frame-Options DENY;
add_header X-XSS-Protection "1; mode=block";
# 檔案上傳大小限制(依需求調整)
client_max_body_size 500M;
# 上傳超時設定(大檔案需要)
proxy_connect_timeout 300s;
proxy_send_timeout 300s;
proxy_read_timeout 300s;
# 主要位置
location / {
proxy_pass http://127.0.0.1:3000;
proxy_http_version 1.1;
# 必要的 Headers
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 $scheme;
# WebSocket 支援
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
# 緩衝設定
proxy_buffering off;
proxy_request_buffering off;
}
}