修复文档和配置

This commit is contained in:
dragon
2025-05-09 15:19:32 +08:00
parent 252f251710
commit 321da54f88
3 changed files with 81 additions and 20 deletions

View File

@@ -1,57 +1,55 @@
# gitea-pages
> 新一代 Gitea Pages替换之前的 caddy-gitea-proxy
> Next-generation Gitea Pages, replacing the previous caddy-gitea-proxy
**此项目是 Dragon's Zone HomeLab 的一部分**
**This project is part of Dragon's Zone HomeLab**
本项目的侧重于功能实现,并未考虑任何性能优化,亦未考虑大规模部署的情况,由此带来的任何问题与项目无关。
This project focuses on functional implementation and does not consider any performance optimizations or large-scale deployment scenarios. Any issues arising from this are not related to the project.
注意,项目在最近加入了自定义渲染器功能,可能导致严重的安全和性能问题,如出现相关问题请反馈。
**Note**: The project recently added custom renderers and reverse proxy functionality, which may lead to serious security and performance issues. If not needed, it can be turned off in the settings.
## Get Started
安装 `go1.23` 或更高版本,同时安装 `Make` 工具 ,然后执行如下命令:
Install `go1.24` or later, along with the `Make` tool, and then execute the following command:
```bash
make gitea-pages
```
之后可使用如下命令启动
After that, you can start it using the following command:
```bash
./gitea-pages -conf config.yaml
```
具体配置可查看 [`config.yaml`](./config.yaml)
For specific configurations, check [`config.yaml`](./config.yaml).
### Page Config
在项目的默认分支创建 `.pages.yaml`,填入如下内容
Create `.pages.yaml` in the project's default branch and fill in the following content:
```yaml
v-route: true # 虚拟路由
v-route: true # Virtual routing
alias: # CNAME
- "example.com"
- "example2.com"
renders: # 渲染器
templates: # Renderer
gotemplate: '**/*.tmpl,**/index.html'
proxy:
/api: https://github.com/api
ignore: .git/**,.pages.yaml
```
## TODO
- [x] 内容缓存
- [x] CNAME 自定义域名
- [x] 模板渲染
- [x] 反向代理请求
- [ ] OAuth2 授权访问私有页面
- [ ] ~~http01 自动签发证书~~: 交由 Caddy 完成
- [ ] ~~Web 钩子触发更新~~: 对实时性需求不大
- [x] Content caching
- [x] CNAME custom domains
- [x] Template rendering
- [x] Reverse proxy requests
- [ ] OAuth2 authorized access to private pages
- [ ] ~~http01 auto-certificate issuance~~: Handled by Caddy
- [ ] ~~Webhook-triggered updates~~: Not a high priority for real-time needs
## LICENSE
此项目使用 [Apache-2.0](./LICENSE)
This project is licensed under [Apache-2.0](./LICENSE)

56
README_zh.md Normal file
View File

@@ -0,0 +1,56 @@
# gitea-pages
> 新一代 Gitea Pages替换之前的 `caddy-gitea-proxy`
**此项目是 Dragon's Zone HomeLab 的一部分**
本项目的侧重于功能实现,并未考虑任何性能优化,亦未考虑大规模部署的情况,由此带来的任何问题与项目无关。
**注意**:项目在最近加入了自定义渲染器和反向代理功能,可能导致严重的安全和性能问题,如不需要可在设置中关闭。
## Get Started
安装 `go1.24` 或更高版本,同时安装 `Make` 工具 ,然后执行如下命令:
```bash
make gitea-pages
```
之后可使用如下命令启动
```bash
./gitea-pages -conf config.yaml
```
具体配置可查看 [`config.yaml`](./config.yaml)。
### Page Config
在项目的默认分支创建 `.pages.yaml`,填入如下内容
```yaml
v-route: true # 虚拟路由
alias: # CNAME
- "example.com"
- "example2.com"
templates: # 渲染器
gotemplate: '**/*.tmpl,**/index.html'
proxy:
/api: https://github.com/api
ignore: .git/**,.pages.yaml
```
## TODO
- [x] 内容缓存
- [x] CNAME 自定义域名
- [x] 模板渲染
- [x] 反向代理请求
- [ ] OAuth2 授权访问私有页面
- [ ] ~~http01 自动签发证书~~: 交由 Caddy 完成
- [ ] ~~Web 钩子触发更新~~: 对实时性需求不大
## LICENSE
此项目使用 [Apache-2.0](./LICENSE)

View File

@@ -23,3 +23,10 @@ page:
404: /path/to/html.gotmpl
# 默认 500 页面模板
500: /path/to/html.gotmpl
# 渲染器配置
render:
enable: false
# 反向代理配置
proxy:
enable: false