百科.dev
全部条目在线工具AI 编程趋势榜开源项目技术资讯提交条目
登录
< 返回工具列表
C

caddy-gitea

> 开发工具
开源

使用 caddy 为 gitea 创建 GitHub 页面 (以及更多页面)

187 stars0 点赞1 次浏览
访问官网GitHub

工具介绍

使用 caddy 为 gitea 创建 GitHub 页面 (以及更多页面)

caddy-gitea

Gitea plugin for Caddy v2.

This allows you to have github pages (with more features) in Gitea. This also requires you to setup a wildcard CNAME to your gitea host.

For now markdown files (with .md extension) will also be automatically generated to HTML.

  • caddy-gitea
    • Getting started
      • Caddy config
      • DNS config
      • Gitea config
        • gitea-pages repo
        • any repo with configurable allowed branch/tag/commits
        • any repo with all branches/tags/commits exposed
    • Building caddy

Getting started

Caddy config

The Caddyfile below creates a webserver listening on :3000 which will interact with gitea on using agiteatoken as the token. The agiteatoken should be a token from gitea that has the necessary read rights on the repo's that you want to expose.

caddyfile
{
        order gitea before file_server
}
:3000
gitea {
        server https://yourgitea.yourdomain.com
        token agiteatoken
        domain pages.yourdomain.com #this is optional
}

DNS config

This works with a wildcard domain. So you'll need to make a *.pages.yourdomain.com CNAME to the server you'll be running caddy on. (this doesn't need to be the same server as gitea).

Depending on the gitea config below you'll be able to access your pages using:

  • (org is the organization or username)
  • (org is the organization or username)
  • (if you have created a gitea-pages repo it'll be served on the root)

Gitea config

There are multiple options to expose your repo's as a page, that you can use both at the same time.

  • creating a gitea-pages repo with a gitea-pages branch and a gitea-pages topic
  • adding a gitea-pages branch to any repo of choice and a gitea-pages topic
  • adding a gitea-pages-allowall topic to your repo (easiest, but less secure)

gitea-pages repo

e.g. we'll use the yourorg org.

  1. create a gitea-pages repo in yourorg org
  2. Add a gitea-pages topic to this gitea-pages repo (this is used to opt-in your repo),
  3. Create a gitea-pages branch in this gitea-pages repo.
  4. Put your content in this branch. (eg file.html)

Your content will now be available on

any repo with configurable allowed branch/tag/commits

e.g. we'll use the yourrepo repo in the yourorg org and there is a file.html in the master branch and a otherfile.html in the dev branch. The master branch is your default branch.

  1. Add a gitea-pages topic to the yourrepo repo (this is used to opt-in your repo).
  2. Create a gitea-pages branch in this yourrepo repo.
  3. Put a gitea-pages.toml file in this gitea-pages branch of yourrepo repo. (more info about the content below)

The gitea-pages.toml file will contain the git reference (branch/tag/commit) you allow to be exposed. To allow everything use the example below:

toml
allowedrefs=["*"]

To only allow main and dev:

toml
allowedrefs=["main","dev"]
  • Your file.html in the master branch will now be available on
  • Your file.html in the master branch will now be available on
  • Your otherfile.html in the dev branch will now be available on
  • Your otherfile.html in the dev branch will now be available on

any repo with all branches/tags/commits exposed

e.g. we'll use the yourrepo repo in the yourorg org and there is a file.html in the master branch and a otherfile.html in the dev branch. The master branch is your default branch.

  1. Add a gitea-pages-allowall topic to the yourrepo repo (this is used to opt-in your repo).
  • Your file.html in the master branch will now be available on
  • Your file.html in the master branch will now be available on
  • Your otherfile.html in the dev branch will now be available on
  • Your otherfile.html in the dev branch will now be available on

Building caddy

As this is a 3rd party plugin you'll need to build caddy (or use the binaries). To build with this plugin you'll need to have go1.19 installed.

go
go install github.com/caddyserver/xcaddy/cmd/xcaddy@latest #this will install xcaddy in ~/go/bin
~/go/bin/xcaddy build --with github.com/42wim/caddy-gitea@v0.0.4

Issues· 0 开放

查看全部 Issues在 GitHub 打开

暂无开放 Issues,或尚未同步最近议题。

> 标签

Gocaddy-plugingitea

暂无评论,来聊聊你的看法吧

> 工具信息

发布日期2026年8月1日
最后更新2026年9月18日
分类开发工具
定价开源

> 相关工具

V
VS Code
流行的开源代码编辑器
G
Git
分布式版本控制系统
V
Vite
下一代前端构建工具