From 649665190aed3492821d6360985a29b2a20402db Mon Sep 17 00:00:00 2001 From: Runxi Yu Date: Sun, 23 Mar 2025 13:29:40 +0800 Subject: Better HTML/CSS --- tmpl.go | 328 ++++++++++++++++++++++++++++++++++++++++++++++------------------ 1 file changed, 235 insertions(+), 93 deletions(-) (limited to 'tmpl.go') diff --git a/tmpl.go b/tmpl.go index c41782f..484b2a5 100644 --- a/tmpl.go +++ b/tmpl.go @@ -15,10 +15,134 @@ func init() { var err error tmpl, err = template.New("powxy").Parse(` - + -Proof of Work Challenge - -
-

Proof of Work Challenge

-
-

This site is protected by Powxy{{ if .Global.Version }} {{ .Global.Version }}{{ end }}.

-

You must complete this proof of work challenge before you could access this site.

-{{- if .Message }} -

{{ .Message }}

-{{- end }} -

Select an nonce shorter than or equal to 32 bytes, such that when it is appended to the decoded form of the following base64 string, and a SHA-256 hash is taken as a whole, the first {{ .Global.NeedBits }} bits of the SHA-256 hash are zeros. Within one octet, higher bits are considered to be in front of lower bits.

-

{{ .UnsignedTokenBase64 }}

-
-

-Encode your selected nonce in base64 and submit it below. -

-

-Please note that if your submission is successful, you will be given a cookie that will allow you to access this site for a period of time without having to complete the challenge again. By pressing the submit button, you agree to be given cookies for this purpose. -

- - -
-

-
-Offline solver program -
` + html.EscapeString(solverProgram) + `
-
-

-Powxy is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License, version 3, as published by the Free Software Foundation. Powxy is distributed in the hope that it will be useful, but without any warranty; without even the implied warranty of merchantability or fitness for a particular purpose. See the GNU Affero General Public License for more details. You may wish to view the source code. -

- - + solve_pow(); + }); + + `) if err != nil { -- cgit v1.2.3