update patches
This commit is contained in:
parent
05d5287cc7
commit
1783d6fb4b
3 changed files with 473 additions and 204 deletions
|
@ -1,4 +1,4 @@
|
|||
From a945efa8b08faf19ac548ff11daf07a5aad70fbb Mon Sep 17 00:00:00 2001
|
||||
From bad9dd03ecf45316772ec386f4997817d435cc57 Mon Sep 17 00:00:00 2001
|
||||
From: Fijxu <fijxu@nadeko.net>
|
||||
Date: Sun, 30 Mar 2025 01:06:20 -0300
|
||||
Subject: [PATCH 1/2] xess: change default background color
|
||||
|
|
|
@ -0,0 +1,472 @@
|
|||
From 4177cb828912d26ff1bd97428663e315a4ae6945 Mon Sep 17 00:00:00 2001
|
||||
From: Fijxu <fijxu@nadeko.net>
|
||||
Date: Mon, 14 Apr 2025 15:37:58 -0400
|
||||
Subject: [PATCH 2/2] add option to enable or disable the anubis mascot
|
||||
|
||||
---
|
||||
anubis.go | 2 +
|
||||
cmd/anubis/main.go | 1 +
|
||||
web/index.templ | 11 +++
|
||||
web/index_templ.go | 179 +++++++++++++++++++++++++++++++++++----------
|
||||
web/js/main.mjs | 17 +++--
|
||||
5 files changed, 166 insertions(+), 44 deletions(-)
|
||||
|
||||
diff --git a/anubis.go b/anubis.go
|
||||
index b184a45..7ba4e0c 100644
|
||||
--- a/anubis.go
|
||||
+++ b/anubis.go
|
||||
@@ -17,3 +17,5 @@ const StaticPath = "/.within.website/x/cmd/anubis/"
|
||||
// DefaultDifficulty is the default "difficulty" (number of leading zeroes)
|
||||
// that must be met by the client in order to pass the challenge.
|
||||
const DefaultDifficulty = 4
|
||||
+
|
||||
+var EnableMascot = false
|
||||
diff --git a/cmd/anubis/main.go b/cmd/anubis/main.go
|
||||
index 724f88a..544c639 100644
|
||||
--- a/cmd/anubis/main.go
|
||||
+++ b/cmd/anubis/main.go
|
||||
@@ -169,6 +169,7 @@ func startDecayMapCleanup(ctx context.Context, s *libanubis.Server) {
|
||||
}
|
||||
|
||||
func main() {
|
||||
+ flag.BoolVar(&anubis.EnableMascot, "enable-mascot", false, "enables the anubis mascot, it's recommended to disable it to allow clients with slow internet, load the captcha webpage faster")
|
||||
flagenv.Parse()
|
||||
flag.Parse()
|
||||
|
||||
diff --git a/web/index.templ b/web/index.templ
|
||||
index 01d12b6..5d2c197 100644
|
||||
--- a/web/index.templ
|
||||
+++ b/web/index.templ
|
||||
@@ -56,6 +56,7 @@ templ base(title string, body templ.Component, ogTags map[string]string) {
|
||||
}
|
||||
</style>
|
||||
@templ.JSONScript("anubis_version", anubis.Version)
|
||||
+ @templ.JSONScript("enable_mascot", anubis.EnableMascot)
|
||||
|
||||
</head>
|
||||
<body id="top">
|
||||
@@ -71,7 +72,9 @@ templ base(title string, body templ.Component, ogTags map[string]string) {
|
||||
href="https://techaro.lol"
|
||||
>Techaro</a>. Made with ❤️ in 🇨🇦.
|
||||
</p>
|
||||
+ if anubis.EnableMascot {
|
||||
<p>Mascot design by <a href="https://bsky.app/profile/celphase.bsky.social">CELPHASE</a>.</p>
|
||||
+ }
|
||||
</center>
|
||||
</footer>
|
||||
</main>
|
||||
@@ -81,18 +84,22 @@ templ base(title string, body templ.Component, ogTags map[string]string) {
|
||||
|
||||
templ index() {
|
||||
<div class="centered-div">
|
||||
+ if anubis.EnableMascot {
|
||||
<img
|
||||
id="image"
|
||||
style="width:100%;max-width:256px;"
|
||||
src={ "/.within.website/x/cmd/anubis/static/img/pensive.webp?cacheBuster=" +
|
||||
anubis.Version }
|
||||
/>
|
||||
+ }
|
||||
+ if anubis.EnableMascot {
|
||||
<img
|
||||
style="display:none;"
|
||||
style="width:100%;max-width:256px;"
|
||||
src={ "/.within.website/x/cmd/anubis/static/img/happy.webp?cacheBuster=" +
|
||||
anubis.Version }
|
||||
/>
|
||||
+ }
|
||||
<p id="status">Loading...</p>
|
||||
<script async type="module" src={
|
||||
"/.within.website/x/cmd/anubis/static/js/main.mjs?cacheBuster=" + anubis.Version }></script>
|
||||
@@ -131,12 +138,14 @@ templ index() {
|
||||
|
||||
templ errorPage(message string, mail string) {
|
||||
<div class="centered-div">
|
||||
+ if anubis.EnableMascot {
|
||||
<img
|
||||
id="image"
|
||||
alt="Sad Anubis"
|
||||
style="width:100%;max-width:256px;"
|
||||
src={ "/.within.website/x/cmd/anubis/static/img/reject.webp?cacheBuster=" + anubis.Version }
|
||||
/>
|
||||
+ }
|
||||
<p>{ message }.</p>
|
||||
<button onClick="window.location.reload();">Try again</button>
|
||||
if mail != "" {
|
||||
@@ -168,12 +177,14 @@ templ bench() {
|
||||
style="padding-top:0.25rem;display:grid;grid-template-columns:subgrid;grid-auto-rows:min-content;grid-column:1/-1;row-gap:0.25rem;overflow-y:auto;font-variant-numeric:tabular-nums"></tbody>
|
||||
</table>
|
||||
<div class="centered-div">
|
||||
+ if anubis.EnableMascot {
|
||||
<img
|
||||
id="image"
|
||||
style="width:100%;max-width:256px;"
|
||||
src={ "/.within.website/x/cmd/anubis/static/img/pensive.webp?cacheBuster=" +
|
||||
anubis.Version }
|
||||
/>
|
||||
+ }
|
||||
<p id="status" style="max-width:256px">Loading...</p>
|
||||
<script async type="module" src={
|
||||
"/.within.website/x/cmd/anubis/static/js/bench.mjs?cacheBuster=" + anubis.Version }></script>
|
||||
diff --git a/web/index_templ.go b/web/index_templ.go
|
||||
index e4cece2..13d5995 100644
|
||||
--- a/web/index_templ.go
|
||||
+++ b/web/index_templ.go
|
||||
@@ -104,6 +104,10 @@ func base(title string, body templ.Component, ogTags map[string]string) templ.Co
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
+ templ_7745c5c3_Err = templ.JSONScript("enable_mascot", anubis.EnableMascot).Render(ctx, templ_7745c5c3_Buffer)
|
||||
+ if templ_7745c5c3_Err != nil {
|
||||
+ return templ_7745c5c3_Err
|
||||
+ }
|
||||
templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 8, "</head><body id=\"top\"><main><center><h1 id=\"title\" class=\".centered-div\">")
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
@@ -111,7 +115,7 @@ func base(title string, body templ.Component, ogTags map[string]string) templ.Co
|
||||
var templ_7745c5c3_Var6 string
|
||||
templ_7745c5c3_Var6, templ_7745c5c3_Err = templ.JoinStringErrs(title)
|
||||
if templ_7745c5c3_Err != nil {
|
||||
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `index.templ`, Line: 64, Col: 52}
|
||||
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `index.templ`, Line: 65, Col: 52}
|
||||
}
|
||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var6))
|
||||
if templ_7745c5c3_Err != nil {
|
||||
@@ -125,7 +129,17 @@ func base(title string, body templ.Component, ogTags map[string]string) templ.Co
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 10, "<footer><center><p>Protected by <a href=\"https://github.com/TecharoHQ/anubis\">Anubis</a> from <a href=\"https://techaro.lol\">Techaro</a>. Made with ❤️ in 🇨🇦.</p><p>Mascot design by <a href=\"https://bsky.app/profile/celphase.bsky.social\">CELPHASE</a>.</p></center></footer></main></body></html>")
|
||||
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 10, "<footer><center><p>Protected by <a href=\"https://github.com/TecharoHQ/anubis\">Anubis</a> from <a href=\"https://techaro.lol\">Techaro</a>. Made with ❤️ in 🇨🇦.</p>")
|
||||
+ if templ_7745c5c3_Err != nil {
|
||||
+ return templ_7745c5c3_Err
|
||||
+ }
|
||||
+ if anubis.EnableMascot {
|
||||
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 11, "<p>Mascot design by <a href=\"https://bsky.app/profile/celphase.bsky.social\">CELPHASE</a>.</p>")
|
||||
+ if templ_7745c5c3_Err != nil {
|
||||
+ return templ_7745c5c3_Err
|
||||
+ }
|
||||
+ }
|
||||
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 12, "</center></footer></main></body></html>")
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
@@ -154,21 +168,65 @@ func index() templ.Component {
|
||||
templ_7745c5c3_Var7 = templ.NopComponent
|
||||
}
|
||||
ctx = templ.ClearChildren(ctx)
|
||||
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 11, "<div class=\"centered-div\"><p id=\"status\">Loading...</p><script async type=\"module\" src=\"")
|
||||
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 13, "<div class=\"centered-div\">")
|
||||
+ if templ_7745c5c3_Err != nil {
|
||||
+ return templ_7745c5c3_Err
|
||||
+ }
|
||||
+ if anubis.EnableMascot {
|
||||
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 14, "<img id=\"image\" style=\"width:100%;max-width:256px;\" src=\"")
|
||||
+ if templ_7745c5c3_Err != nil {
|
||||
+ return templ_7745c5c3_Err
|
||||
+ }
|
||||
+ var templ_7745c5c3_Var8 string
|
||||
+ templ_7745c5c3_Var8, templ_7745c5c3_Err = templ.JoinStringErrs("/.within.website/x/cmd/anubis/static/img/pensive.webp?cacheBuster=" +
|
||||
+ anubis.Version)
|
||||
+ if templ_7745c5c3_Err != nil {
|
||||
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `index.templ`, Line: 92, Col: 18}
|
||||
+ }
|
||||
+ _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var8))
|
||||
+ if templ_7745c5c3_Err != nil {
|
||||
+ return templ_7745c5c3_Err
|
||||
+ }
|
||||
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 15, "\"> ")
|
||||
+ if templ_7745c5c3_Err != nil {
|
||||
+ return templ_7745c5c3_Err
|
||||
+ }
|
||||
+ }
|
||||
+ if anubis.EnableMascot {
|
||||
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 16, "<img style=\"display:none;\" style=\"width:100%;max-width:256px;\" src=\"")
|
||||
+ if templ_7745c5c3_Err != nil {
|
||||
+ return templ_7745c5c3_Err
|
||||
+ }
|
||||
+ var templ_7745c5c3_Var9 string
|
||||
+ templ_7745c5c3_Var9, templ_7745c5c3_Err = templ.JoinStringErrs("/.within.website/x/cmd/anubis/static/img/happy.webp?cacheBuster=" +
|
||||
+ anubis.Version)
|
||||
+ if templ_7745c5c3_Err != nil {
|
||||
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `index.templ`, Line: 100, Col: 18}
|
||||
+ }
|
||||
+ _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var9))
|
||||
+ if templ_7745c5c3_Err != nil {
|
||||
+ return templ_7745c5c3_Err
|
||||
+ }
|
||||
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 17, "\">")
|
||||
+ if templ_7745c5c3_Err != nil {
|
||||
+ return templ_7745c5c3_Err
|
||||
+ }
|
||||
+ }
|
||||
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 18, "<p id=\"status\">Loading...</p><script async type=\"module\" src=\"")
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
- var templ_7745c5c3_Var8 string
|
||||
- templ_7745c5c3_Var8, templ_7745c5c3_Err = templ.JoinStringErrs(
|
||||
+ var templ_7745c5c3_Var10 string
|
||||
+ templ_7745c5c3_Var10, templ_7745c5c3_Err = templ.JoinStringErrs(
|
||||
"/.within.website/x/cmd/anubis/static/js/main.mjs?cacheBuster=" + anubis.Version)
|
||||
if templ_7745c5c3_Err != nil {
|
||||
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `index.templ`, Line: 86, Col: 84}
|
||||
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `index.templ`, Line: 105, Col: 84}
|
||||
}
|
||||
- _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var8))
|
||||
+ _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var10))
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 12, "\"></script><div id=\"progress\" role=\"progressbar\" aria-labelledby=\"status\"><div class=\"bar-inner\"></div></div><details><summary>Why am I seeing this?</summary><p>You are seeing this because the administrator of this website has set up <a href=\"https://github.com/TecharoHQ/anubis\">Anubis</a> to protect the server against the scourge of <a href=\"https://thelibre.news/foss-infrastructure-is-under-attack-by-ai-companies/\">AI companies aggressively scraping websites</a>. This can and does cause downtime for the websites, which makes their resources inaccessible for everyone.</p><p>Anubis is a compromise. Anubis uses a <a href=\"https://anubis.techaro.lol/docs/design/why-proof-of-work\">Proof-of-Work</a> scheme in the vein of <a href=\"https://en.wikipedia.org/wiki/Hashcash\">Hashcash</a>, a proposed proof-of-work scheme for reducing email spam. The idea is that at individual scales the additional load is ignorable, but at mass scraper levels it adds up and makes scraping much more expensive.</p><p>Ultimately, this is a hack whose real purpose is to give a \"good enough\" placeholder solution so that more time can be spent on fingerprinting and identifying headless browsers (EG: via how they do font rendering) so that the challenge proof of work page doesn't need to be presented to users that are much more likely to be legitimate.</p><p>Please note that Anubis requires the use of modern JavaScript features that plugins like <a href=\"https://jshelter.org/\">JShelter</a> will disable. Please disable JShelter or other such plugins for this domain.</p></details><noscript><p>Sadly, you must enable JavaScript to get past this challenge. This is required because AI companies have changed the social contract around how website hosting works. A no-JS solution is a work-in-progress.</p></noscript><div id=\"testarea\"></div></div>")
|
||||
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 19, "\"></script><div id=\"progress\" role=\"progressbar\" aria-labelledby=\"status\"><div class=\"bar-inner\"></div></div><details><summary>Why am I seeing this?</summary><p>You are seeing this because the administrator of this website has set up <a href=\"https://github.com/TecharoHQ/anubis\">Anubis</a> to protect the server against the scourge of <a href=\"https://thelibre.news/foss-infrastructure-is-under-attack-by-ai-companies/\">AI companies aggressively scraping websites</a>. This can and does cause downtime for the websites, which makes their resources inaccessible for everyone.</p><p>Anubis is a compromise. Anubis uses a <a href=\"https://anubis.techaro.lol/docs/design/why-proof-of-work\">Proof-of-Work</a> scheme in the vein of <a href=\"https://en.wikipedia.org/wiki/Hashcash\">Hashcash</a>, a proposed proof-of-work scheme for reducing email spam. The idea is that at individual scales the additional load is ignorable, but at mass scraper levels it adds up and makes scraping much more expensive.</p><p>Ultimately, this is a hack whose real purpose is to give a \"good enough\" placeholder solution so that more time can be spent on fingerprinting and identifying headless browsers (EG: via how they do font rendering) so that the challenge proof of work page doesn't need to be presented to users that are much more likely to be legitimate.</p><p>Please note that Anubis requires the use of modern JavaScript features that plugins like <a href=\"https://jshelter.org/\">JShelter</a> will disable. Please disable JShelter or other such plugins for this domain.</p></details><noscript><p>Sadly, you must enable JavaScript to get past this challenge. This is required because AI companies have changed the social contract around how website hosting works. A no-JS solution is a work-in-progress.</p></noscript><div id=\"testarea\"></div></div>")
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
@@ -192,62 +250,85 @@ func errorPage(message string, mail string) templ.Component {
|
||||
}()
|
||||
}
|
||||
ctx = templ.InitializeContext(ctx)
|
||||
- templ_7745c5c3_Var9 := templ.GetChildren(ctx)
|
||||
- if templ_7745c5c3_Var9 == nil {
|
||||
- templ_7745c5c3_Var9 = templ.NopComponent
|
||||
+ templ_7745c5c3_Var11 := templ.GetChildren(ctx)
|
||||
+ if templ_7745c5c3_Var11 == nil {
|
||||
+ templ_7745c5c3_Var11 = templ.NopComponent
|
||||
}
|
||||
ctx = templ.ClearChildren(ctx)
|
||||
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 13, "<div class=\"centered-div\"><p>")
|
||||
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 20, "<div class=\"centered-div\">")
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
- var templ_7745c5c3_Var10 string
|
||||
- templ_7745c5c3_Var10, templ_7745c5c3_Err = templ.JoinStringErrs(message)
|
||||
+ if anubis.EnableMascot {
|
||||
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 21, "<img id=\"image\" alt=\"Sad Anubis\" style=\"width:100%;max-width:256px;\" src=\"")
|
||||
+ if templ_7745c5c3_Err != nil {
|
||||
+ return templ_7745c5c3_Err
|
||||
+ }
|
||||
+ var templ_7745c5c3_Var12 string
|
||||
+ templ_7745c5c3_Var12, templ_7745c5c3_Err = templ.JoinStringErrs("/.within.website/x/cmd/anubis/static/img/reject.webp?cacheBuster=" + anubis.Version)
|
||||
+ if templ_7745c5c3_Err != nil {
|
||||
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `index.templ`, Line: 146, Col: 102}
|
||||
+ }
|
||||
+ _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var12))
|
||||
+ if templ_7745c5c3_Err != nil {
|
||||
+ return templ_7745c5c3_Err
|
||||
+ }
|
||||
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 22, "\">")
|
||||
+ if templ_7745c5c3_Err != nil {
|
||||
+ return templ_7745c5c3_Err
|
||||
+ }
|
||||
+ }
|
||||
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 23, "<p>")
|
||||
if templ_7745c5c3_Err != nil {
|
||||
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `index.templ`, Line: 122, Col: 16}
|
||||
+ return templ_7745c5c3_Err
|
||||
}
|
||||
- _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var10))
|
||||
+ var templ_7745c5c3_Var13 string
|
||||
+ templ_7745c5c3_Var13, templ_7745c5c3_Err = templ.JoinStringErrs(message)
|
||||
+ if templ_7745c5c3_Err != nil {
|
||||
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `index.templ`, Line: 149, Col: 16}
|
||||
+ }
|
||||
+ _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var13))
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 14, ".</p><button onClick=\"window.location.reload();\">Try again</button> ")
|
||||
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 24, ".</p><button onClick=\"window.location.reload();\">Try again</button> ")
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
if mail != "" {
|
||||
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 15, "<p><a href=\"/\">Go home</a> or if you believe you should not be blocked, please contact the webmaster at <a href=\"")
|
||||
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 25, "<p><a href=\"/\">Go home</a> or if you believe you should not be blocked, please contact the webmaster at <a href=\"")
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
- var templ_7745c5c3_Var11 templ.SafeURL = "mailto:" + templ.SafeURL(mail)
|
||||
- _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(string(templ_7745c5c3_Var11)))
|
||||
+ var templ_7745c5c3_Var14 templ.SafeURL = "mailto:" + templ.SafeURL(mail)
|
||||
+ _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(string(templ_7745c5c3_Var14)))
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 16, "\">")
|
||||
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 26, "\">")
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
- var templ_7745c5c3_Var12 string
|
||||
- templ_7745c5c3_Var12, templ_7745c5c3_Err = templ.JoinStringErrs(mail)
|
||||
+ var templ_7745c5c3_Var15 string
|
||||
+ templ_7745c5c3_Var15, templ_7745c5c3_Err = templ.JoinStringErrs(mail)
|
||||
if templ_7745c5c3_Err != nil {
|
||||
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `index.templ`, Line: 126, Col: 9}
|
||||
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `index.templ`, Line: 153, Col: 9}
|
||||
}
|
||||
- _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var12))
|
||||
+ _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var15))
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 17, "</a></p>")
|
||||
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 27, "</a></p>")
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
} else {
|
||||
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 18, "<p><a href=\"/\">Go home</a></p>")
|
||||
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 28, "<p><a href=\"/\">Go home</a></p>")
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
}
|
||||
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 19, "</div>")
|
||||
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 29, "</div>")
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
@@ -271,26 +352,50 @@ func bench() templ.Component {
|
||||
}()
|
||||
}
|
||||
ctx = templ.InitializeContext(ctx)
|
||||
- templ_7745c5c3_Var13 := templ.GetChildren(ctx)
|
||||
- if templ_7745c5c3_Var13 == nil {
|
||||
- templ_7745c5c3_Var13 = templ.NopComponent
|
||||
+ templ_7745c5c3_Var16 := templ.GetChildren(ctx)
|
||||
+ if templ_7745c5c3_Var16 == nil {
|
||||
+ templ_7745c5c3_Var16 = templ.NopComponent
|
||||
}
|
||||
ctx = templ.ClearChildren(ctx)
|
||||
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 20, "<div style=\"height:20rem;display:flex\"><table style=\"margin-top:1rem;display:grid;grid-template:auto 1fr/auto auto;gap:0 0.5rem\"><thead style=\"border-bottom:1px solid black;padding:0.25rem 0;display:grid;grid-template:1fr/subgrid;grid-column:1/-1\"><tr id=\"table-header\" style=\"display:contents\"><th style=\"width:4.5rem\">Time</th><th style=\"width:4rem\">Iters</th></tr><tr id=\"table-header-compare\" style=\"display:none\"><th style=\"width:4.5rem\">Time A</th><th style=\"width:4rem\">Iters A</th><th style=\"width:4.5rem\">Time B</th><th style=\"width:4rem\">Iters B</th></tr></thead> <tbody id=\"results\" style=\"padding-top:0.25rem;display:grid;grid-template-columns:subgrid;grid-auto-rows:min-content;grid-column:1/-1;row-gap:0.25rem;overflow-y:auto;font-variant-numeric:tabular-nums\"></tbody></table><div class=\"centered-div\"><p id=\"status\" style=\"max-width:256px\">Loading...</p><script async type=\"module\" src=\"")
|
||||
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 30, "<div style=\"height:20rem;display:flex\"><table style=\"margin-top:1rem;display:grid;grid-template:auto 1fr/auto auto;gap:0 0.5rem\"><thead style=\"border-bottom:1px solid black;padding:0.25rem 0;display:grid;grid-template:1fr/subgrid;grid-column:1/-1\"><tr id=\"table-header\" style=\"display:contents\"><th style=\"width:4.5rem\">Time</th><th style=\"width:4rem\">Iters</th></tr><tr id=\"table-header-compare\" style=\"display:none\"><th style=\"width:4.5rem\">Time A</th><th style=\"width:4rem\">Iters A</th><th style=\"width:4.5rem\">Time B</th><th style=\"width:4rem\">Iters B</th></tr></thead> <tbody id=\"results\" style=\"padding-top:0.25rem;display:grid;grid-template-columns:subgrid;grid-auto-rows:min-content;grid-column:1/-1;row-gap:0.25rem;overflow-y:auto;font-variant-numeric:tabular-nums\"></tbody></table><div class=\"centered-div\">")
|
||||
+ if templ_7745c5c3_Err != nil {
|
||||
+ return templ_7745c5c3_Err
|
||||
+ }
|
||||
+ if anubis.EnableMascot {
|
||||
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 31, "<img id=\"image\" style=\"width:100%;max-width:256px;\" src=\"")
|
||||
+ if templ_7745c5c3_Err != nil {
|
||||
+ return templ_7745c5c3_Err
|
||||
+ }
|
||||
+ var templ_7745c5c3_Var17 string
|
||||
+ templ_7745c5c3_Var17, templ_7745c5c3_Err = templ.JoinStringErrs("/.within.website/x/cmd/anubis/static/img/pensive.webp?cacheBuster=" +
|
||||
+ anubis.Version)
|
||||
+ if templ_7745c5c3_Err != nil {
|
||||
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `index.templ`, Line: 185, Col: 22}
|
||||
+ }
|
||||
+ _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var17))
|
||||
+ if templ_7745c5c3_Err != nil {
|
||||
+ return templ_7745c5c3_Err
|
||||
+ }
|
||||
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 32, "\">")
|
||||
+ if templ_7745c5c3_Err != nil {
|
||||
+ return templ_7745c5c3_Err
|
||||
+ }
|
||||
+ }
|
||||
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 33, "<p id=\"status\" style=\"max-width:256px\">Loading...</p><script async type=\"module\" src=\"")
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
- var templ_7745c5c3_Var14 string
|
||||
- templ_7745c5c3_Var14, templ_7745c5c3_Err = templ.JoinStringErrs(
|
||||
+ var templ_7745c5c3_Var18 string
|
||||
+ templ_7745c5c3_Var18, templ_7745c5c3_Err = templ.JoinStringErrs(
|
||||
"/.within.website/x/cmd/anubis/static/js/bench.mjs?cacheBuster=" + anubis.Version)
|
||||
if templ_7745c5c3_Err != nil {
|
||||
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `index.templ`, Line: 155, Col: 89}
|
||||
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `index.templ`, Line: 190, Col: 89}
|
||||
}
|
||||
- _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var14))
|
||||
+ _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var18))
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 21, "\"></script><div id=\"sparkline\"></div><noscript><p>Running the benchmark tool requires JavaScript to be enabled.</p></noscript></div></div><form id=\"controls\" style=\"position:fixed;top:0.5rem;right:0.5rem\"><div style=\"display:flex;justify-content:end\"><label for=\"difficulty-input\" style=\"margin-right:0.5rem\">Difficulty:</label> <input id=\"difficulty-input\" type=\"number\" name=\"difficulty\" style=\"width:3rem\"></div><div style=\"margin-top:0.25rem;display:flex;justify-content:end\"><label for=\"algorithm-select\" style=\"margin-right:0.5rem\">Algorithm:</label> <select id=\"algorithm-select\" name=\"algorithm\"></select></div><div style=\"margin-top:0.25rem;display:flex;justify-content:end\"><label for=\"compare-select\" style=\"margin-right:0.5rem\">Compare:</label> <select id=\"compare-select\" name=\"compare\"><option value=\"NONE\">-</option></select></div></form>")
|
||||
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 34, "\"></script><div id=\"sparkline\"></div><noscript><p>Running the benchmark tool requires JavaScript to be enabled.</p></noscript></div></div><form id=\"controls\" style=\"position:fixed;top:0.5rem;right:0.5rem\"><div style=\"display:flex;justify-content:end\"><label for=\"difficulty-input\" style=\"margin-right:0.5rem\">Difficulty:</label> <input id=\"difficulty-input\" type=\"number\" name=\"difficulty\" style=\"width:3rem\"></div><div style=\"margin-top:0.25rem;display:flex;justify-content:end\"><label for=\"algorithm-select\" style=\"margin-right:0.5rem\">Algorithm:</label> <select id=\"algorithm-select\" name=\"algorithm\"></select></div><div style=\"margin-top:0.25rem;display:flex;justify-content:end\"><label for=\"compare-select\" style=\"margin-right:0.5rem\">Compare:</label> <select id=\"compare-select\" name=\"compare\"><option value=\"NONE\">-</option></select></div></form>")
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
diff --git a/web/js/main.mjs b/web/js/main.mjs
|
||||
index a093c74..6888f8e 100644
|
||||
--- a/web/js/main.mjs
|
||||
+++ b/web/js/main.mjs
|
||||
@@ -81,6 +81,7 @@ function showContinueBar(hash, nonce, t0, t1) {
|
||||
const title = document.getElementById('title');
|
||||
const progress = document.getElementById('progress');
|
||||
const anubisVersion = JSON.parse(document.getElementById('anubis_version').textContent);
|
||||
+ const enableMascot = JSON.parse(document.getElementById('enable_mascot').textContent);
|
||||
const details = document.querySelector('details');
|
||||
let userReadDetails = false;
|
||||
|
||||
@@ -95,7 +96,7 @@ function showContinueBar(hash, nonce, t0, t1) {
|
||||
const ohNoes = ({ titleMsg, statusMsg, imageSrc }) => {
|
||||
title.innerHTML = titleMsg;
|
||||
status.innerHTML = statusMsg;
|
||||
- image.src = imageSrc;
|
||||
+ image.src = imageSrc || undefined;
|
||||
progress.style.display = "none";
|
||||
};
|
||||
|
||||
@@ -103,7 +104,7 @@ function showContinueBar(hash, nonce, t0, t1) {
|
||||
ohNoes({
|
||||
titleMsg: "Your context is not secure!",
|
||||
statusMsg: `Try connecting over HTTPS or let the admin know to set up HTTPS. For more information, see <a href="https://developer.mozilla.org/en-US/docs/Web/Security/Secure_Contexts#when_is_a_context_considered_secure">MDN</a>.`,
|
||||
- imageSrc: imageURL("reject", anubisVersion),
|
||||
+ ...(enableMascot && { imageSrc: imageURL("reject", anubisVersion) }),
|
||||
});
|
||||
return;
|
||||
}
|
||||
@@ -128,7 +129,7 @@ function showContinueBar(hash, nonce, t0, t1) {
|
||||
ohNoes({
|
||||
titleMsg: `Missing feature ${name}`,
|
||||
statusMsg: msg,
|
||||
- imageSrc: imageURL("reject", anubisVersion),
|
||||
+ ...(enableMascot && { imageSrc: imageURL("reject", anubisVersion) }),
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -142,7 +143,7 @@ function showContinueBar(hash, nonce, t0, t1) {
|
||||
ohNoes({
|
||||
titleMsg: "Internal error!",
|
||||
statusMsg: `Failed to fetch challenge config: ${err.message}`,
|
||||
- imageSrc: imageURL("reject", anubisVersion),
|
||||
+ ...(enableMascot && { imageSrc: imageURL("reject", anubisVersion) }),
|
||||
});
|
||||
throw err;
|
||||
});
|
||||
@@ -152,7 +153,7 @@ function showContinueBar(hash, nonce, t0, t1) {
|
||||
ohNoes({
|
||||
titleMsg: "Challenge error!",
|
||||
statusMsg: `Failed to resolve check algorithm. You may want to reload the page.`,
|
||||
- imageSrc: imageURL("reject", anubisVersion),
|
||||
+ ...(enableMascot && { imageSrc: imageURL("reject", anubisVersion) }),
|
||||
});
|
||||
return;
|
||||
}
|
||||
@@ -210,7 +211,9 @@ function showContinueBar(hash, nonce, t0, t1) {
|
||||
|
||||
title.innerHTML = "Success!";
|
||||
status.innerHTML = `Done! Took ${t1 - t0}ms, ${nonce} iterations`;
|
||||
- image.src = imageURL("happy", anubisVersion);
|
||||
+ if (enableMascot) {
|
||||
+ image.src = imageURL("happy", anubisVersion);
|
||||
+ }
|
||||
progress.style.display = "none";
|
||||
|
||||
if (userReadDetails) {
|
||||
@@ -265,7 +268,7 @@ function showContinueBar(hash, nonce, t0, t1) {
|
||||
ohNoes({
|
||||
titleMsg: "Calculation error!",
|
||||
statusMsg: `Failed to calculate challenge: ${err.message}`,
|
||||
- imageSrc: imageURL("reject", anubisVersion),
|
||||
+ ...(enableMascot && { imageSrc: imageURL("reject", anubisVersion) })
|
||||
});
|
||||
}
|
||||
})();
|
||||
\ No newline at end of file
|
||||
--
|
||||
2.49.0
|
||||
|
|
@ -1,203 +0,0 @@
|
|||
From b10b01f6ff70ab6d40d8cf90da8057212441d678 Mon Sep 17 00:00:00 2001
|
||||
From: Fijxu <fijxu@nadeko.net>
|
||||
Date: Tue, 8 Apr 2025 02:07:27 -0400
|
||||
Subject: [PATCH 2/2] remove images from captcha
|
||||
|
||||
---
|
||||
web/index.templ | 25 -------------------------
|
||||
web/index_templ.go | 10 +++++-----
|
||||
web/js/main.mjs | 13 +------------
|
||||
3 files changed, 6 insertions(+), 42 deletions(-)
|
||||
|
||||
diff --git a/web/index.templ b/web/index.templ
|
||||
index 01d12b6..4e4d8c6 100644
|
||||
--- a/web/index.templ
|
||||
+++ b/web/index.templ
|
||||
@@ -71,7 +71,6 @@ templ base(title string, body templ.Component, ogTags map[string]string) {
|
||||
href="https://techaro.lol"
|
||||
>Techaro</a>. Made with ❤️ in 🇨🇦.
|
||||
</p>
|
||||
- <p>Mascot design by <a href="https://bsky.app/profile/celphase.bsky.social">CELPHASE</a>.</p>
|
||||
</center>
|
||||
</footer>
|
||||
</main>
|
||||
@@ -81,18 +80,6 @@ templ base(title string, body templ.Component, ogTags map[string]string) {
|
||||
|
||||
templ index() {
|
||||
<div class="centered-div">
|
||||
- <img
|
||||
- id="image"
|
||||
- style="width:100%;max-width:256px;"
|
||||
- src={ "/.within.website/x/cmd/anubis/static/img/pensive.webp?cacheBuster=" +
|
||||
- anubis.Version }
|
||||
- />
|
||||
- <img
|
||||
- style="display:none;"
|
||||
- style="width:100%;max-width:256px;"
|
||||
- src={ "/.within.website/x/cmd/anubis/static/img/happy.webp?cacheBuster=" +
|
||||
- anubis.Version }
|
||||
- />
|
||||
<p id="status">Loading...</p>
|
||||
<script async type="module" src={
|
||||
"/.within.website/x/cmd/anubis/static/js/main.mjs?cacheBuster=" + anubis.Version }></script>
|
||||
@@ -131,12 +118,6 @@ templ index() {
|
||||
|
||||
templ errorPage(message string, mail string) {
|
||||
<div class="centered-div">
|
||||
- <img
|
||||
- id="image"
|
||||
- alt="Sad Anubis"
|
||||
- style="width:100%;max-width:256px;"
|
||||
- src={ "/.within.website/x/cmd/anubis/static/img/reject.webp?cacheBuster=" + anubis.Version }
|
||||
- />
|
||||
<p>{ message }.</p>
|
||||
<button onClick="window.location.reload();">Try again</button>
|
||||
if mail != "" {
|
||||
@@ -168,12 +149,6 @@ templ bench() {
|
||||
style="padding-top:0.25rem;display:grid;grid-template-columns:subgrid;grid-auto-rows:min-content;grid-column:1/-1;row-gap:0.25rem;overflow-y:auto;font-variant-numeric:tabular-nums"></tbody>
|
||||
</table>
|
||||
<div class="centered-div">
|
||||
- <img
|
||||
- id="image"
|
||||
- style="width:100%;max-width:256px;"
|
||||
- src={ "/.within.website/x/cmd/anubis/static/img/pensive.webp?cacheBuster=" +
|
||||
- anubis.Version }
|
||||
- />
|
||||
<p id="status" style="max-width:256px">Loading...</p>
|
||||
<script async type="module" src={
|
||||
"/.within.website/x/cmd/anubis/static/js/bench.mjs?cacheBuster=" + anubis.Version }></script>
|
||||
diff --git a/web/index_templ.go b/web/index_templ.go
|
||||
index e4cece2..bfbec96 100644
|
||||
--- a/web/index_templ.go
|
||||
+++ b/web/index_templ.go
|
||||
@@ -125,7 +125,7 @@ func base(title string, body templ.Component, ogTags map[string]string) templ.Co
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 10, "<footer><center><p>Protected by <a href=\"https://github.com/TecharoHQ/anubis\">Anubis</a> from <a href=\"https://techaro.lol\">Techaro</a>. Made with ❤️ in 🇨🇦.</p><p>Mascot design by <a href=\"https://bsky.app/profile/celphase.bsky.social\">CELPHASE</a>.</p></center></footer></main></body></html>")
|
||||
+ templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 10, "<footer><center><p>Protected by <a href=\"https://github.com/TecharoHQ/anubis\">Anubis</a> from <a href=\"https://techaro.lol\">Techaro</a>. Made with ❤️ in 🇨🇦.</p></center></footer></main></body></html>")
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
@@ -162,7 +162,7 @@ func index() templ.Component {
|
||||
templ_7745c5c3_Var8, templ_7745c5c3_Err = templ.JoinStringErrs(
|
||||
"/.within.website/x/cmd/anubis/static/js/main.mjs?cacheBuster=" + anubis.Version)
|
||||
if templ_7745c5c3_Err != nil {
|
||||
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `index.templ`, Line: 86, Col: 84}
|
||||
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `index.templ`, Line: 85, Col: 84}
|
||||
}
|
||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var8))
|
||||
if templ_7745c5c3_Err != nil {
|
||||
@@ -204,7 +204,7 @@ func errorPage(message string, mail string) templ.Component {
|
||||
var templ_7745c5c3_Var10 string
|
||||
templ_7745c5c3_Var10, templ_7745c5c3_Err = templ.JoinStringErrs(message)
|
||||
if templ_7745c5c3_Err != nil {
|
||||
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `index.templ`, Line: 122, Col: 16}
|
||||
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `index.templ`, Line: 121, Col: 16}
|
||||
}
|
||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var10))
|
||||
if templ_7745c5c3_Err != nil {
|
||||
@@ -231,7 +231,7 @@ func errorPage(message string, mail string) templ.Component {
|
||||
var templ_7745c5c3_Var12 string
|
||||
templ_7745c5c3_Var12, templ_7745c5c3_Err = templ.JoinStringErrs(mail)
|
||||
if templ_7745c5c3_Err != nil {
|
||||
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `index.templ`, Line: 126, Col: 9}
|
||||
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `index.templ`, Line: 125, Col: 9}
|
||||
}
|
||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var12))
|
||||
if templ_7745c5c3_Err != nil {
|
||||
@@ -284,7 +284,7 @@ func bench() templ.Component {
|
||||
templ_7745c5c3_Var14, templ_7745c5c3_Err = templ.JoinStringErrs(
|
||||
"/.within.website/x/cmd/anubis/static/js/bench.mjs?cacheBuster=" + anubis.Version)
|
||||
if templ_7745c5c3_Err != nil {
|
||||
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `index.templ`, Line: 155, Col: 89}
|
||||
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `index.templ`, Line: 154, Col: 89}
|
||||
}
|
||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var14))
|
||||
if templ_7745c5c3_Err != nil {
|
||||
diff --git a/web/js/main.mjs b/web/js/main.mjs
|
||||
index a093c74..94f6458 100644
|
||||
--- a/web/js/main.mjs
|
||||
+++ b/web/js/main.mjs
|
||||
@@ -14,9 +14,6 @@ const u = (url = "", params = {}) => {
|
||||
return result.toString();
|
||||
};
|
||||
|
||||
-const imageURL = (mood, cacheBuster) =>
|
||||
- u(`/.within.website/x/cmd/anubis/static/img/${mood}.webp`, { cacheBuster });
|
||||
-
|
||||
const dependencies = [
|
||||
{
|
||||
name: "WebCrypto",
|
||||
@@ -77,7 +74,6 @@ function showContinueBar(hash, nonce, t0, t1) {
|
||||
|
||||
(async () => {
|
||||
const status = document.getElementById('status');
|
||||
- const image = document.getElementById('image');
|
||||
const title = document.getElementById('title');
|
||||
const progress = document.getElementById('progress');
|
||||
const anubisVersion = JSON.parse(document.getElementById('anubis_version').textContent);
|
||||
@@ -92,10 +88,9 @@ function showContinueBar(hash, nonce, t0, t1) {
|
||||
});
|
||||
}
|
||||
|
||||
- const ohNoes = ({ titleMsg, statusMsg, imageSrc }) => {
|
||||
+ const ohNoes = ({ titleMsg, statusMsg }) => {
|
||||
title.innerHTML = titleMsg;
|
||||
status.innerHTML = statusMsg;
|
||||
- image.src = imageSrc;
|
||||
progress.style.display = "none";
|
||||
};
|
||||
|
||||
@@ -103,7 +98,6 @@ function showContinueBar(hash, nonce, t0, t1) {
|
||||
ohNoes({
|
||||
titleMsg: "Your context is not secure!",
|
||||
statusMsg: `Try connecting over HTTPS or let the admin know to set up HTTPS. For more information, see <a href="https://developer.mozilla.org/en-US/docs/Web/Security/Secure_Contexts#when_is_a_context_considered_secure">MDN</a>.`,
|
||||
- imageSrc: imageURL("reject", anubisVersion),
|
||||
});
|
||||
return;
|
||||
}
|
||||
@@ -128,7 +122,6 @@ function showContinueBar(hash, nonce, t0, t1) {
|
||||
ohNoes({
|
||||
titleMsg: `Missing feature ${name}`,
|
||||
statusMsg: msg,
|
||||
- imageSrc: imageURL("reject", anubisVersion),
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -142,7 +135,6 @@ function showContinueBar(hash, nonce, t0, t1) {
|
||||
ohNoes({
|
||||
titleMsg: "Internal error!",
|
||||
statusMsg: `Failed to fetch challenge config: ${err.message}`,
|
||||
- imageSrc: imageURL("reject", anubisVersion),
|
||||
});
|
||||
throw err;
|
||||
});
|
||||
@@ -152,7 +144,6 @@ function showContinueBar(hash, nonce, t0, t1) {
|
||||
ohNoes({
|
||||
titleMsg: "Challenge error!",
|
||||
statusMsg: `Failed to resolve check algorithm. You may want to reload the page.`,
|
||||
- imageSrc: imageURL("reject", anubisVersion),
|
||||
});
|
||||
return;
|
||||
}
|
||||
@@ -210,7 +201,6 @@ function showContinueBar(hash, nonce, t0, t1) {
|
||||
|
||||
title.innerHTML = "Success!";
|
||||
status.innerHTML = `Done! Took ${t1 - t0}ms, ${nonce} iterations`;
|
||||
- image.src = imageURL("happy", anubisVersion);
|
||||
progress.style.display = "none";
|
||||
|
||||
if (userReadDetails) {
|
||||
@@ -265,7 +255,6 @@ function showContinueBar(hash, nonce, t0, t1) {
|
||||
ohNoes({
|
||||
titleMsg: "Calculation error!",
|
||||
statusMsg: `Failed to calculate challenge: ${err.message}`,
|
||||
- imageSrc: imageURL("reject", anubisVersion),
|
||||
});
|
||||
}
|
||||
})();
|
||||
\ No newline at end of file
|
||||
--
|
||||
2.49.0
|
||||
|
Loading…
Add table
Reference in a new issue