Import Anubis v1.28.2

Replace the tree with upstream TecharoHQ/anubis v1.28.2 (a1384fbf42e3).
Masyunis customizations are re-applied in the following commits.
This commit is contained in:
sol_bot Bot committed 2026-11-28 14:52:26 +03:00
1 parent eb3e46d8d0
commit e07de898cd
573 files changed
+35846 -6807

No files matched your search

+8 -5
View File
@@ -3,6 +3,7 @@ package web
import (
"context"
"fmt"
"html"
"io"
"github.com/a-h/templ"
@@ -12,12 +13,12 @@ import (
"github.com/TecharoHQ/anubis/lib/localization"
)
func Base(title string, body templ.Component, impressum *config.Impressum, localizer *localization.SimpleLocalizer) templ.Component {
return base(title, body, impressum, nil, nil, localizer)
func Base(title string, body templ.Component, impressum *config.Impressum, honeypot *config.Honeypot, localizer *localization.SimpleLocalizer) templ.Component {
return base(title, body, impressum, honeypot, nil, nil, localizer)
}
func BaseWithChallengeAndOGTags(title string, body templ.Component, impressum *config.Impressum, challenge *challenge.Challenge, rules *config.ChallengeRules, ogTags map[string]string, localizer *localization.SimpleLocalizer) templ.Component {
return base(title, body, impressum, struct {
func BaseWithChallengeAndOGTags(title string, body templ.Component, impressum *config.Impressum, honeypot *config.Honeypot, challenge *challenge.Challenge, rules *config.ChallengeRules, ogTags map[string]string, localizer *localization.SimpleLocalizer) templ.Component {
return base(title, body, impressum, honeypot, struct {
Rules *config.ChallengeRules `json:"rules"`
Challenge any `json:"challenge"`
}{
@@ -36,7 +37,9 @@ func Bench(localizer *localization.SimpleLocalizer) templ.Component {
func honeypotLink(href string) templ.Component {
return templ.ComponentFunc(func(ctx context.Context, w io.Writer) error {
fmt.Fprintf(w, `<script type="ignore"><a href="%s">Don't click me</a></script>`, href)
if _, err := fmt.Fprintf(w, `<script type="ignore"><a href="%s">Don't click me</a></script>`, html.EscapeString(href)); err != nil {
return err
}
return nil
})
}