Compare commits

...

7 Commits

7 changed files with 31 additions and 31 deletions

View File

@ -50,7 +50,7 @@ async function getProcesses() {
// 127.0.0.1:19322
async function getNewCaptcha() {
try {
return await fetch("http://startpage.arav.home.arpa/captcha/").then(r => r.text());
return await fetch("http://startpage.arav.home.arpa/captcha/", {method: "POST"}).then(r => r.text());
} catch {
return null;
}
@ -62,7 +62,7 @@ async function solveCaptcha(id, answer) {
body.append('answer', answer);
let result = fetch(`http://startpage.arav.home.arpa/captcha/${id}`, { method: "POST", body: body } );
return await result.then(r => {
return r.status == 200;
return r.status == 202;
});
} catch {
return false;

View File

@ -10,10 +10,10 @@ function getColorScheme() {
}
async function getNewCaptcha() {
const id = await fetch("/captcha/").then(r => r.text());
const id = await fetch("/api/captcha/", { method: "POST"}).then(r => r.text());
g_current_captcha_id = id;
captcha_hidden_field.value = id;
setTimeout(() => { captcha_img.src = `/captcha/${id}/image?style=${getColorScheme()}` }, 600);
setTimeout(() => { captcha_img.src = `/api/captcha/${id}/image?style=${getColorScheme()}` }, 600);
g_captcha_timeout_remain = g_captcha_timeout_seconds;
}
@ -33,13 +33,13 @@ captcha_refresh.addEventListener("click", async e => {
captcha_refresh.disabled = true;
setTimeout(async () => {
captcha_refresh.disabled = false;
await fetch(`/captcha/${g_current_captcha_id}?remove`); }, 3000);
await fetch(`/api/captcha/${g_current_captcha_id}?remove`); }, 3000);
document.getElementsByName("captcha_answer")[0].value = "";
await getNewCaptcha();
});
// Remove unused CAPTCHA on a server.
window.addEventListener("unload", () => fetch(`/captcha/${g_current_captcha_id}?remove`));
window.addEventListener("unload", () => fetch(`/api/captcha/${g_current_captcha_id}?remove`));
setInterval(async () => {
captcha_remain.innerText = --g_captcha_timeout_remain;

View File

@ -123,7 +123,7 @@ block content
a(href='http://upload.arav.i2p') i2p
p I've made a file upload service for ya with a limit of 128MiB per file, keeping it for 36 hours, and overall storage I dedicated for it is 100GiB.
div
+isServiceUp("Gitea", "gitea")
+isServiceUp("Git", "gitea")
p
a(href='https://git.arav.top') git.arav.top
| .

View File

@ -30,7 +30,7 @@ block content
small *Only I can see if set.
span.captcha
input(type='hidden', name='captcha_id' value=captcha_id)
img(src='/captcha/'+captcha_id+'/image', alt="CAPTCHA" width='160' height='40')
img(src='/api/captcha/'+captcha_id+'/image', alt="CAPTCHA" width='160' height='40')
input(type='text' maxlength='6' placeholder='CAPTCHA' name='captcha_answer' required)
small Valid for #[b 10] minutes.
input(type='submit' value='Send a post')

View File

@ -45,7 +45,7 @@ block content
table
tr
td justcaptcha
td 1.1.2 (19 August 2022)
td 2.0.0 (20 October 2022)
td Go
td MIT
td

View File

@ -1,7 +1,7 @@
{
"name": "arav-dwelling",
"description": "Arav's dwelling",
"version": "22.42.0",
"version": "22.42.1",
"author": "Alexander \"Arav\" Andreev <me@arav.top> (https://arav.top)",
"license": "GPLv3",
"homepage": "https://git.arav.top/Arav/Dwelling",