From b505b6a5fb37de2221cb29ab76fdc09391bc0161 Mon Sep 17 00:00:00 2001 From: dragon Date: Fri, 10 Jan 2025 17:28:18 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0=E9=BB=98=E8=AE=A4=E9=85=8D?= =?UTF-8?q?=E7=BD=AE=E5=92=8C=E4=BD=BF=E7=94=A8=E8=AF=B4=E6=98=8E?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 20 ++++++++++++++++---- config.yaml | 25 +++++++++++++++++++++++++ 2 files changed, 41 insertions(+), 4 deletions(-) create mode 100644 config.yaml diff --git a/README.md b/README.md index b6d7aa8..d6a5d5b 100644 --- a/README.md +++ b/README.md @@ -6,18 +6,30 @@ 本项目的侧重于功能实现,并未考虑任何性能优化,亦未考虑大规模部署的情况,由此带来的任何问题与项目无关。 -## Feature +## Get Started -- [x] 内容缓存 -- [x] CNAME 自定义域名 +安装 `go1.23` 或更高版本,同时安装 `Make` 工具 ,然后执行如下命令: + +```bash +make gitea-pages +``` + +之后可使用如下命令启动 + +```bash +./gitea-pages -conf config.yaml +``` + +具体配置可查看 [`config.yaml`](./config.yaml)。 ## TODO +- [x] 内容缓存 +- [x] CNAME 自定义域名 - [ ] OAuth2 授权访问私有页面 - [ ] ~~http01 自动签发证书~~: 交由 Caddy 完成 - [ ] ~~Web 钩子触发更新~~: 对实时性需求不大 - ## LICENSE 此项目使用 [Apache-2.0](./LICENSE) \ No newline at end of file diff --git a/config.yaml b/config.yaml new file mode 100644 index 0000000..6196929 --- /dev/null +++ b/config.yaml @@ -0,0 +1,25 @@ +# 服务器绑定地址 +bind: 127.0.0.1:18080 +# 基础域名 +domain: example.com +auth: + server: https://gitea.com + # 需要 user , org , repo 的 read 全新 + token: token +cache: + # 配置存储 + storage: /path/to/config.json + # 配置缓存时长 + ttl: 10m + + # 单个文件最大缓存大小 + size: 10MB + # 总缓存大小 + max: 1GB +page: + # 默认页面分支 + default_branch: gh-pages + # 默认 404 页面模板 + 404: /path/to/html.gotmpl + # 默认 500 页面模板 + 500: /path/to/html.gotmpl \ No newline at end of file