reports!!!! and PoW!!!!!!!

this has taken quite a while (8 ish hours) but reports and proof of work challenges are completely implemented

the proof of work challenges are bit iffy and could be gpu accelerated which is bad, so i plan to eventually switch to something memory hard like argon2id

references used for pow:
https://dev.to/ratmd/simple-proof-of-work-in-javascript-3kgm
https://anubis.techaro.lol/docs/design/how-anubis-works
https://anubis.techaro.lol/docs/design/why-proof-of-work

as well as some other posts or repos found when searching
This commit is contained in:
2026-11-20 21:31:37 -05:00
parent ee03411154
commit 5c2427b096
14 changed files with 470 additions and 15 deletions
+1
View File
@@ -5,6 +5,7 @@
<a href="/tos">tos</a>
<a href="/privacy">privacy</a>
<a href="/faq">faq</a>
<a href="/report">report</a>
<a href="https://git.whoswhip.dev/whoswhip/minibin">src</a>
</div>
</div>
+50
View File
@@ -0,0 +1,50 @@
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>report | minibin</title>
<link rel="stylesheet" href="/css/main.css" />
<script defer src="/js/report.js"></script>
{{if .Qt}}
<style>
:root {
--qt-url: url("{{.Qt}}");
}
</style>
{{end}}
</head>
<body>
{{template "site-header"}}
<main>
<noscript class="noscript">
Javascript is required when reporting to compute a proof-of-work challenge. Without solving the challenge you cannot submit a report.
</noscript>
<form
method="post"
id="report-form"
data-challenge-difficulty="{{.Challenge.Difficulty}}"
data-challenge-expires-at="{{.Challenge.ExpiresAt}}"
data-challenge-data="{{.Challenge.Data}}"
>
<input id="pow-result" type="hidden" name="pow_result">
<input id="pow-nonce" type="hidden" name="pow_nonce">
<input type="hidden" name="pow_challenge_id" value="{{.Challenge.Id}}">
<label class="muted" for="upload_id">upload id</label>
<input type="text" name="upload_id" required>
<label class="muted" for="report_reason">reason</label>
<select class="full-dropdown" id="report-reason" name="report_reason">
{{range .ReportOptions}}
<option value="{{.}}">{{.}}</option>
{{end}}
<option value="test">test</option>
</select>
<div class="submit-container">
<button id="submit-btn" type="submit" class="btn loading" disabled>submit</button>
<span id="pow-label">computing proof of work</span>
</div>
</form>
</main>
</body>
</html>
+23
View File
@@ -0,0 +1,23 @@
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>{{.Title}} | minibin</title>
<link rel="stylesheet" href="/css/main.css" />
{{if .Qt}}
<style>
:root {
--qt-url: url("{{.Qt}}");
}
</style>
{{end}}
</head>
<body>
{{template "site-header"}}
<main>
<h2>{{.Title}}</h2>
<p>{{.Message}}</p>
</main>
</body>
</html>