From a5be4faa8a2a918afd3f1ad76b7175adc08e1b90 Mon Sep 17 00:00:00 2001 From: WeebDataHoarder <57538841+WeebDataHoarder@users.noreply.github.com> Date: Sun, 13 Apr 2025 19:06:37 +0200 Subject: [PATCH] Default to forgejo-auto on forgejo --- README.md | 2 +- cmd/go-away/main.go | 2 +- embed/templates/challenge-forgejo.gohtml | 2 +- examples/forgejo.yml | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index c2935cd..776d04d 100644 --- a/README.md +++ b/README.md @@ -67,7 +67,7 @@ Internal or external templates can be loaded to customize the look of the challe These templates are included by default: * `anubis`: An anubis-like themed challenge. -* `forgejo`: Uses the Forgejo template and assets from your own instance. Supports specifying themes like `forgejo-light` and `forgejo-dark`. +* `forgejo`: Uses the Forgejo template and assets from your own instance. Supports specifying themes like `forgejo-auto`, `forgejo-light` and `forgejo-dark`. External templates for your site can be loaded specifying a full path to the `.gohtml` file. See [embed/templates/](embed/templates/) for examples to follow. diff --git a/cmd/go-away/main.go b/cmd/go-away/main.go index 2302241..7230cd7 100644 --- a/cmd/go-away/main.go +++ b/cmd/go-away/main.go @@ -140,7 +140,7 @@ func main() { policyFile := flag.String("policy", "", "path to policy YAML file") challengeTemplate := flag.String("challenge-template", "anubis", "name or path of the challenge template to use (anubis, forgejo)") - challengeTemplateTheme := flag.String("challenge-template-theme", "", "name of the challenge template theme to use (forgejo => [forgejo-dark, forgejo-light, gitea...])") + challengeTemplateTheme := flag.String("challenge-template-theme", "", "name of the challenge template theme to use (forgejo => [forgejo-auto, forgejo-dark, forgejo-light, gitea...])") packageName := flag.String("package-path", internalPackageName, "package name to expose in .well-known url path") diff --git a/embed/templates/challenge-forgejo.gohtml b/embed/templates/challenge-forgejo.gohtml index 318bb6f..a483cd7 100644 --- a/embed/templates/challenge-forgejo.gohtml +++ b/embed/templates/challenge-forgejo.gohtml @@ -1,5 +1,5 @@ -{{$theme := "forgejo-dark"}} +{{$theme := "forgejo-auto"}} {{ if .Theme }} {{$theme = .Theme}} {{ end }} diff --git a/examples/forgejo.yml b/examples/forgejo.yml index 4c455c5..e114c10 100644 --- a/examples/forgejo.yml +++ b/examples/forgejo.yml @@ -1,5 +1,5 @@ # Example cmdline (forward requests from upstream to port :8080) -# $ go-away --bind :8080 --backend git.example.com=http://forgejo:3000 --policy examples/forgejo.yml --challenge-template forgejo --challenge-template-theme forgejo-dark +# $ go-away --bind :8080 --backend git.example.com=http://forgejo:3000 --policy examples/forgejo.yml --challenge-template forgejo --challenge-template-theme forgejo-auto