Files
Website/README.md
T
KenanZhu 8c5f639347
Build and publish website container / build (push) Successful in 56s
Apply published main images to the production website
2026-11-05 13:05:07 +08:00

35 lines
1.7 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters
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.
# AutoLibrary Website
AutoLibrary 官网、软件下载中心与主题市场,使用 Vue 3、TypeScript、Go/Gin、SQLite 和 Casdoor。
[官网](https://www.autolibrary.kenanzhu.com) · [用户手册](https://manuals.autolibrary.kenanzhu.com) · [产品发布](https://gitea.kenanzhu.com/KenanZhu/AutoLibrary/releases)
## 本地开发
需要 Go 1.25.6+、Node.js 22.13+ 和支持 CGO 的 C 编译器。
```sh
cp config.example.json config.json
npm --prefix frontend ci
go run . backend
# 在另一个终端启动前端
npm --prefix frontend run dev
```
打开 `http://127.0.0.1:5173`。后端默认端口为 `8080`,登录功能需要配置 Casdoor。
## 构建与发布
```sh
npm --prefix frontend run build
go test ./...
docker build -t autolibrary-web:local .
bash deploy/smoke-container.sh autolibrary-web:local
```
推送 `main` 后,Gitea Actions 构建、测试并发布镜像,再提交生产更新请求。宿主机更新服务校验当前 `main` 与镜像摘要后更新网站容器,健康检查失败时回滚。仓库 Secrets 需配置 `REGISTRY_USERNAME` 和具有软件包写入权限的 `REGISTRY_TOKEN`。
使用 `compose.yaml` 部署,设置 `AUTOLIBRARY_IMAGE`、`AUTOLIBRARY_CONFIG`、`AUTOLIBRARY_DATA_DIR` 和 `AUTOLIBRARY_LOG_DIR`,并按宿主机权限设置 `AUTOLIBRARY_UID`、`AUTOLIBRARY_GID`。前端健康检查端口由 `AUTOLIBRARY_HTTP_PORT` 指定,默认 `3003`。
配置只读挂载,数据库、主题文件和日志持久化在宿主机。生产安装 `deploy/systemd/autolibrary-update.*` 与 `deploy/update-container.py`;Runner 将专用请求目录挂载到 `/release-request`。更新日志使用 `journalctl -u autolibrary-update.service` 查看。