Fork of the [caddy-gitea](https://github.com/42wim/caddy-gitea) project: [Gitea](https://gitea.io) plugin for [Caddy v2](https://github.com/caddyserver/caddy). List of [alternatives](https://docs.gitea.com/awesome#web-hosting).
The Caddyfile below creates a webserver listening on :3000 which will interact with gitea on <https://yourgitea.yourdomain.com> using `agiteatoken` as the token.
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 <http://yourorg.pages.yourdomain.com:3000/yourrepo/file.html>
- Your `file.html` in the `master` branch will now be available on <http://yourrepo.yourorg.pages.yourdomain.com:3000/file.html>
- Your `otherfile.html` in the `dev` branch will now be available on <http://yourorg.pages.yourdomain.com:3000/yourrepo/file.html?ref=dev>
- Your `otherfile.html` in the `dev` branch will now be available on <http://dev.yourrepo.yourorg.pages.yourdomain.com:3000/file.html>
#### 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 <http://yourorg.pages.yourdomain.com:3000/yourrepo/file.html>
- Your `file.html` in the `master` branch will now be available on <http://yourrepo.yourorg.pages.yourdomain.com:3000/file.html>
- Your `otherfile.html` in the `dev` branch will now be available on <http://yourorg.pages.yourdomain.com:3000/yourrepo/file.html?ref=dev>
- Your `otherfile.html` in the `dev` branch will now be available on <http://dev.yourrepo.yourorg.pages.yourdomain.com:3000/file.html>
Afther the release is done, `gitea-pages` docker image shall be availvable at the [Docker Hub](https://hub.docker.com/repository/docker/djmil/gitea-pages/general)