From df43b513ab600fd70f4b348d0f7ee54647f6e5f8 Mon Sep 17 00:00:00 2001
From: Simon Gregor Ebner <simon.gregor.ebner@gmail.com>
Date: Fri, 21 Feb 2025 00:14:55 +0100
Subject: [PATCH] update dockerfile / readme

change again default
---
 Dockerfile    | 3 +++
 Readme.md     | 9 ++++++++-
 giteapages.go | 3 +--
 3 files changed, 12 insertions(+), 3 deletions(-)

diff --git a/Dockerfile b/Dockerfile
index 66d868e..51df2c0 100644
--- a/Dockerfile
+++ b/Dockerfile
@@ -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"]
\ No newline at end of file
diff --git a/Readme.md b/Readme.md
index 97f7b60..1df4fa5 100644
--- a/Readme.md
+++ b/Readme.md
@@ -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 {
diff --git a/giteapages.go b/giteapages.go
index 0ffa936..b0eed4f 100644
--- a/giteapages.go
+++ b/giteapages.go
@@ -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>]