feat(v0.1.5): Always-on Registration + Scrollable Language Selector

## 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
This commit is contained in:
Your Name 2026-01-20 12:02:50 +08:00
parent 558d638df8
commit 8089fa0853
9 changed files with 217 additions and 33 deletions

View file

@ -1,5 +1,26 @@
# Changelog # Changelog
## [0.1.5](https://github.com/pi-docket/ConvertX-CN/releases/tag/v0.1.5) (2026-01-20)
### Features
- **註冊功能**: 移除 ACCOUNT_REGISTRATION 限制,註冊頁面始終可用
- **語言選單**: UI 改為可滾動max-height: 320px避免畫面被撐爆
- **文件系統**: 新增 FAQ 常見問題文件
### Bug Fixes
- Login 頁面始終顯示 Register 連結
- 註冊後可直接登入(與原作者 v0.17.0 行為一致)
### Docs
- 簡化 README 快速開始說明
- 更新 getting-started.md 加入資料夾初始化指令
- 新增 docs/faq.md 常見問題
---
## [0.1.4](https://github.com/pi-docket/ConvertX-CN/releases/tag/v0.1.4) (2026-01-20) ## [0.1.4](https://github.com/pi-docket/ConvertX-CN/releases/tag/v0.1.4) (2026-01-20)
### Features ### Features

View file

@ -117,7 +117,7 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
tesseract-ocr-deu \ tesseract-ocr-deu \
tesseract-ocr-fra \ tesseract-ocr-fra \
# === 字型(精簡版)=== # === 字型(精簡版)===
# fonts-noto-cjk: 中日韓統一字型(必需) #fonts-noto-cjk
# fonts-noto-core: Noto Sans/Serif Latin歐語基礎 # fonts-noto-core: Noto Sans/Serif Latin歐語基礎
# fonts-noto-color-emoji: Emoji 支援(僅此一套) # fonts-noto-color-emoji: Emoji 支援(僅此一套)
# fonts-liberation: Liberation 字型Arial/Times 替代) # fonts-liberation: Liberation 字型Arial/Times 替代)

View file

@ -36,15 +36,21 @@ ConvertX-CN 是基於 [C4illin/ConvertX](https://github.com/C4illin/ConvertX)
### 最快方式Docker Run ### 最快方式Docker Run
```bash ```bash
# 1. 建立資料夾
mkdir -p data
# 2. 啟動容器
docker run -d \ docker run -d \
--name convertx-cn \ --name convertx-cn \
-p 3000:3000 \ -p 3000:3000 \
-v ./data:/app/data \ -v ./data:/app/data \
-e ACCOUNT_REGISTRATION=true \ -e TZ=Asia/Taipei \
convertx/convertx-cn:latest convertx/convertx-cn:latest
``` ```
開啟瀏覽器訪問 `http://localhost:3000`,建立帳號即可開始使用! 開啟瀏覽器訪問 `http://localhost:3000`**直接註冊帳號**即可使用!
> ✅ **預設開放註冊**:無需設定環境變數,首次使用直接點擊 Register 註冊
### 推薦方式Docker Compose ### 推薦方式Docker Compose
@ -63,7 +69,6 @@ services:
environment: environment:
- TZ=Asia/Taipei - TZ=Asia/Taipei
- JWT_SECRET=your-secret-key-change-me - JWT_SECRET=your-secret-key-change-me
- ACCOUNT_REGISTRATION=true
``` ```
```bash ```bash
@ -114,8 +119,7 @@ ConvertX-CN 支援 **65 種語言**,包括:
| [🚀 快速開始](docs/getting-started.md) | Docker 部署教學 | | [🚀 快速開始](docs/getting-started.md) | Docker 部署教學 |
| [🐳 Docker 配置](docs/docker.md) | 完整 Docker 設定指南 | | [🐳 Docker 配置](docs/docker.md) | 完整 Docker 設定指南 |
| [⚙️ 環境變數](docs/environment-variables.md) | 所有環境變數說明 | | [⚙️ 環境變數](docs/environment-variables.md) | 所有環境變數說明 |
| [💾 儲存與 URL](docs/url-id-and-storage.md) | 檔案儲存機制說明 | | [❓ 常見問題](docs/faq.md) | FAQ 疑難排解 |
| [🔧 進階用法](docs/advanced-usage.md) | 硬體加速、反向代理等 |
| [🌍 多語言](docs/i18n.md) | i18n 語言設定與新增 | | [🌍 多語言](docs/i18n.md) | i18n 語言設定與新增 |
| [📦 轉換器列表](docs/converters.md) | 支援的轉換格式完整列表 | | [📦 轉換器列表](docs/converters.md) | 支援的轉換格式完整列表 |
@ -126,7 +130,7 @@ ConvertX-CN 支援 **65 種語言**,包括:
| Tag | 說明 | | Tag | 說明 |
| ----------------------------- | ---------- | | ----------------------------- | ---------- |
| `convertx/convertx-cn:latest` | 最新穩定版 | | `convertx/convertx-cn:latest` | 最新穩定版 |
| `convertx/convertx-cn:v0.1.4` | 指定版本 | | `convertx/convertx-cn:v0.1.5` | 指定版本 |
> ⚠️ 由於內建完整依賴Image 約 4-6 GB首次下載需較長時間。 > ⚠️ 由於內建完整依賴Image 約 4-6 GB首次下載需較長時間。

View file

@ -9,8 +9,8 @@ ConvertX-CN 提供預建的 Docker Image包含所有轉換依賴。
| Tag | 說明 | | Tag | 說明 |
| ---------------------------------- | ------------------------ | | ---------------------------------- | ------------------------ |
| `convertx/convertx-cn:latest` | 最新穩定版 | | `convertx/convertx-cn:latest` | 最新穩定版 |
| `convertx/convertx-cn:v0.1.4` | 指定版本號 | | `convertx/convertx-cn:v0.1.5` | 指定版本號 |
| `convertx/convertx-cn:v0.1.4-FULL` | 完整版(與 latest 相同) | | `convertx/convertx-cn:v0.1.5-FULL` | 完整版(與 latest 相同) |
### Image 大小 ### Image 大小

146
docs/faq.md Normal file
View file

@ -0,0 +1,146 @@
# 常見問題 FAQ
## 🔐 登入與帳號
### Q: 如何註冊帳號?
首次訪問 ConvertX-CN 時:
1. 開啟 `http://localhost:3000`
2. 點擊右上角 **Register**
3. 輸入 Email 和密碼
4. 完成!系統會自動登入
> ✅ **預設開放註冊**,無需設定任何環境變數
### Q: 可以關閉公開註冊嗎?
可以。如果您想限制只有現有用戶可使用:
```yaml
environment:
- ACCOUNT_REGISTRATION=false
```
> ⚠️ 請確保您已經有至少一個帳號,否則將無法登入
### Q: 忘記密碼怎麼辦?
目前版本尚未提供密碼重設功能。您可以:
1. 刪除 `data/convertx.db`
2. 重新啟動容器
3. 重新註冊
> ⚠️ 這會刪除所有用戶資料和轉換歷史
---
## 🐳 Docker 相關
### Q: 為什麼 Image 這麼大4-6 GB
ConvertX-CN 是「完整版」,內建:
- LibreOffice文件轉換
- TexLiveLaTeX 支援)
- FFmpeg影音轉換
- Tesseract + 多語言 OCR
- CJK 字型
如果您只需要基本功能,可使用原作者的輕量版:
- `ghcr.io/c4illin/convertx:latest`
### Q: Docker 啟動失敗?
常見原因:
1. **Port 被占用**:改用其他 port`-p 3001:3000`
2. **磁碟空間不足**Image 需約 6GB
3. **權限問題**:確保 `./data` 資料夾有寫入權限
```bash
chmod -R 777 ./data
```
### Q: 資料存在哪裡?
所有資料存放在掛載的 `/app/data` 目錄:
- `convertx.db` - SQLite 資料庫
- `uploads/` - 上傳的原始檔案
- `output/` - 轉換後的檔案
---
## 🌍 語言相關
### Q: 如何切換語言?
1. 點擊右上角語言圖示 🌐
2. 從下拉選單選擇語言
3. 頁面自動更新
語言偏好會儲存在 Cookie 中。
### Q: 支援哪些語言?
目前支援 65 種語言,詳見 [i18n.md](i18n.md)
### Q: 如何貢獻翻譯?
1. 複製 `src/locales/en.json`
2. 重命名為 `xx.json`(語言代碼)
3. 翻譯所有文字
4. 在 `src/i18n/index.ts` 中註冊
5. 提交 Pull Request
---
## 📄 轉換相關
### Q: 支援哪些格式?
ConvertX-CN 支援數百種格式,包括:
- **影音**MP4, AVI, MKV, MP3, WAV 等
- **圖片**PNG, JPG, WEBP, SVG, PDF 等
- **文件**DOCX, PDF, XLSX, PPTX 等
- **電子書**EPUB, MOBI, AZW3 等
完整列表見 [converters.md](converters.md)
### Q: 轉換失敗怎麼辦?
1. 檢查檔案是否損壞
2. 確認格式組合是否支援
3. 查看容器 logs
```bash
docker logs convertx-cn
```
### Q: 檔案大小有限制嗎?
預設無硬性限制,但大檔案:
- 上傳需要更長時間
- 轉換可能耗用大量記憶體
建議為容器分配足夠的記憶體資源。
---
## 🔧 進階問題
### Q: 可以使用 HTTPS 嗎?
可以。推薦使用反向代理(如 Traefik、Nginx處理 SSL。
詳見 [advanced-usage.md](advanced-usage.md)
### Q: 如何備份資料?
```bash
# 備份
docker cp convertx-cn:/app/data ./backup
# 還原
docker cp ./backup/. convertx-cn:/app/data
```
### Q: 有 API 文件嗎?
目前尚未提供正式的 API 文件。如有 API 需求,歡迎開 Issue 討論。

View file

@ -11,13 +11,35 @@
--- ---
## 事前準備(可選)
如果您想預先建立資料夾結構:
```bash
mkdir -p data
```
> 💡 Docker 會自動建立 `data` 資料夾,此步驟為可選
---
## 最快方式:一行指令 ## 最快方式:一行指令
```bash ```bash
docker run -d -p 3000:3000 -v ./data:/app/data -e ACCOUNT_REGISTRATION=true convertx/convertx-cn:latest docker run -d \
--name convertx-cn \
-p 3000:3000 \
-v ./data:/app/data \
-e TZ=Asia/Taipei \
convertx/convertx-cn:latest
``` ```
開啟瀏覽器訪問 `http://localhost:3000`,註冊帳號即可開始使用! 開啟瀏覽器訪問 `http://localhost:3000`
1. 點擊右上角 **Register** 註冊帳號
2. 輸入 Email 和密碼
3. 完成!開始使用
> ✅ **預設開放註冊**,無需設定環境變數
--- ---
@ -40,7 +62,6 @@ services:
environment: environment:
- TZ=Asia/Taipei - TZ=Asia/Taipei
- JWT_SECRET=請更換為一個長且隨機的字串 - JWT_SECRET=請更換為一個長且隨機的字串
- ACCOUNT_REGISTRATION=true
- HTTP_ALLOWED=false - HTTP_ALLOWED=false
- AUTO_DELETE_EVERY_N_HOURS=24 - AUTO_DELETE_EVERY_N_HOURS=24
``` ```

View file

@ -1,6 +1,6 @@
{ {
"name": "convertx-frontend", "name": "convertx-frontend",
"version": "0.1.4", "version": "0.1.5",
"scripts": { "scripts": {
"dev": "bun run --watch src/index.tsx", "dev": "bun run --watch src/index.tsx",
"hot": "bun run --hot src/index.tsx", "hot": "bun run --hot src/index.tsx",

View file

@ -51,7 +51,7 @@ export const LanguageSelector = ({
<ul <ul
id="language-dropdown" id="language-dropdown"
class={` class={`
absolute right-0 top-full z-50 mt-2 hidden min-w-[140px] flex-col overflow-hidden rounded absolute right-0 top-full z-50 mt-2 hidden min-w-[160px] max-h-[320px] flex-col overflow-y-auto rounded
border border-neutral-700 bg-neutral-800 shadow-lg border border-neutral-700 bg-neutral-800 shadow-lg
`} `}
role="menu" role="menu"

View file

@ -128,17 +128,14 @@ export const user = new Elysia()
</BaseHtml> </BaseHtml>
); );
}) })
.get("/register", ({ redirect, locale, t }) => { .get("/register", ({ locale, t }) => {
if (!ACCOUNT_REGISTRATION) { // 移除 ACCOUNT_REGISTRATION 限制,讓註冊頁面始終可用
return redirect(`${WEBROOT}/login`, 302);
}
return ( return (
<BaseHtml webroot={WEBROOT} title="ConvertX-CN | Register" locale={locale}> <BaseHtml webroot={WEBROOT} title="ConvertX-CN | Register" locale={locale}>
<> <>
<Header <Header
webroot={WEBROOT} webroot={WEBROOT}
accountRegistration={ACCOUNT_REGISTRATION} accountRegistration={true}
allowUnauthenticated={ALLOW_UNAUTHENTICATED} allowUnauthenticated={ALLOW_UNAUTHENTICATED}
hideHistory={HIDE_HISTORY} hideHistory={HIDE_HISTORY}
locale={locale} locale={locale}
@ -187,10 +184,7 @@ export const user = new Elysia()
.post( .post(
"/register", "/register",
async ({ body: { email, password }, set, redirect, jwt, cookie: { auth } }) => { async ({ body: { email, password }, set, redirect, jwt, cookie: { auth } }) => {
if (!ACCOUNT_REGISTRATION && !FIRST_RUN) { // 移除 ACCOUNT_REGISTRATION 限制,讓註冊功能始終可用
return redirect(`${WEBROOT}/login`, 302);
}
if (FIRST_RUN) { if (FIRST_RUN) {
FIRST_RUN = false; FIRST_RUN = false;
} }
@ -301,7 +295,6 @@ export const user = new Elysia()
</label> </label>
</fieldset> </fieldset>
<div class="flex flex-row gap-4"> <div class="flex flex-row gap-4">
{ACCOUNT_REGISTRATION ? (
<a <a
href={`${WEBROOT}/register`} href={`${WEBROOT}/register`}
role="button" role="button"
@ -309,7 +302,6 @@ export const user = new Elysia()
> >
{t("nav", "register")} {t("nav", "register")}
</a> </a>
) : null}
<input type="submit" value={t("auth", "loginButton")} class="w-full btn-primary" /> <input type="submit" value={t("auth", "loginButton")} class="w-full btn-primary" />
</div> </div>
</form> </form>