update dockerfile / readme

change again default
This commit is contained in:
Simon Gregor Ebner 2025-02-21 00:14:55 +01:00
parent b749679e17
commit df43b513ab
3 changed files with 12 additions and 3 deletions

View File

@ -2,6 +2,9 @@ FROM caddy:builder-alpine AS builder
RUN xcaddy build --with github.com/simongregorebner/gitea-pages
FROM alpine
COPY --from=builder /usr/bin/caddy /usr/bin/caddy
CMD ["/usr/bin/caddy", "run", "--config", "/etc/caddy/Caddyfile", "--adapter", "caddyfile"]

View File

@ -47,6 +47,13 @@ Afterward you can simply run:
./caddy run --config Caddyfile
```
If you build/use the docker container you can run it like this:
```bash
# Create a Caddyfile (configuration file) first !
docker run -v $(pwd)/Caddyfile:/etc/caddy/Caddyfile -p 8080:8080 gitea-pages
```
## Configuration
These are the possible configuration options with their defaults:
@ -60,7 +67,7 @@ gitea-pages {
server https://your-gitea-server
token gitea-access-token
pages_branch gitea-pages
postfix_pages_repository gitea.io
postfix_pages_repository gitea-pages
url_scheme simple
}
log {

View File

@ -77,7 +77,7 @@ func (module *GiteaPagesModule) UnmarshalCaddyfile(d *caddyfile.Dispenser) error
module.PagesBranch = "gitea-pages"
}
if module.PostfixPagesRepository == "" {
module.PostfixPagesRepository = "gitea.io"
module.PostfixPagesRepository = "gitea-pages"
}
if module.URLScheme == "" {
@ -99,7 +99,6 @@ func (module GiteaPagesModule) ServeHTTP(writer http.ResponseWriter, request *ht
var organization, repository, path string
if module.URLScheme == "simple" {
fmt.Println("SIMPLE")
// "Simple" URL case - we expect the organization and repository in the URL
// The URL/path looks like http(s)://<giteaserver>[:<port>]/<organization>/<repository>[/<filepath>]