Files
42_124/CT124_Picsur操作手冊_20260622.md
Timmy bcba077fdf 新增 CT124 Picsur 操作手冊
圖床操作/ShareX/備份;DB 綁定卷 postgres-data,Watchtower 自動更新。

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-22 22:19:19 +08:00

53 lines
2.2 KiB
Markdown
Raw Permalink Blame History

This file contains invisible Unicode characters
This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# CT124 Picsur(自架圖床)— 操作手冊
> 主機:CT124192.168.42.124Ubuntu 24.04 LXC | 位置:`/opt/picsur`
> 用途:自架圖片上傳/分享(ShareX 相容),產生短網址圖片連結
---
## 一、基本資訊
- 版本:**Picsur 0.5.6**`ghcr.io/caramelfur/picsur:latest`+ **PostgreSQL 17**
- 容器:`picsur`(:8080)、`picsur_postgres`(postgres:17-alpine,內網)
- 埠:`8080 → 8080`
- 對外:**NPM 反代 `https://picsur.lotimmy.com`**(已驗證 200
- **自動更新**:`picsur``com.centurylinklabs.watchtower.enable=true` → Watchtower 會自動拉新版,版號可能自己跳。
## 二、存取與帳號
- Web:`https://picsur.lotimmy.com`(內網 `http://192.168.42.124:8080`
- 管理員:帳號固定 `admin`(不可改),密碼在 compose 的 `PICSUR_ADMIN_PASSWORD`(目前值見 compose / 密碼管理器)。
- 該密碼僅首次建立帳號時生效;之後請在 UI 改密碼,compose 那行可留作 reset 用途。
## 三、操作
```bash
cd /opt/picsur
docker compose up -d
docker compose ps
docker compose logs -f picsur
docker compose pull && docker compose up -d # 手動更新(平常 Watchtower 也會自動更)
```
## 四、資料與備份
- Postgres 資料:**綁定卷 `./postgres-data`**(→ `/var/lib/postgresql/data`,目前 ~417M,圖片也存 DB 內)。
- 備份(整個圖床狀態都在這顆 DB):
```bash
# 檔案層(停服務較保險)
cd /opt/picsur && docker compose stop && tar -czf picsur-data-$(date +%F).tar.gz postgres-data && docker compose start
# 或邏輯備份
docker exec picsur_postgres pg_dump -U picsur picsur > picsur-$(date +%F).sql
```
## 五、ShareX / 上傳設定
- Picsur 內建 ShareX 設定下載:登入後到使用者設定頁取得 `.sxcu`,或用 API token 上傳。
- API:`POST https://picsur.lotimmy.com/api/image/upload`(帶 Authorization)。詳見官方:https://github.com/CaramelFur/Picsur
## 六、注意事項
- 圖片與 metadata **都存在 PostgreSQL**,備份只認 `postgres-data`(或 `pg_dump`),別只備 compose。
- 對外 443 經 NPM → 依賴 docker daemon 與 NPM 容器(見 [`CT124_故障復原_20260529.md`](CT124_故障復原_20260529.md))。
- Watchtower 自動更新雖方便,但 `:latest` 偶有 breaking change;重要資料記得先有近期備份。