fix: config example

This commit is contained in:
Roi Feng
2025-02-19 22:34:57 -05:00
parent e150617430
commit 70cdf7e12f
8 changed files with 0 additions and 0 deletions

View File

@ -0,0 +1,75 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>403 Forbidden</title>
<style>
body {
font-family: Arial, sans-serif;
display: flex;
justify-content: center;
align-items: center;
height: 100vh;
margin: 0;
background-color: #f9f9f9;
}
.container {
text-align: left;
max-width: 600px;
}
.icon svg {
width: 60px;
height: 60px;
stroke: #333;
}
.error-code {
font-size: 100px;
font-weight: bold;
color: #e74c3c;
}
.message {
font-size: 24px;
font-weight: bold;
color: #333;
}
.description {
margin-top: 10px;
color: #666;
}
.verifyBox {
margin-top: 10px;
color: #666;
}
.debug-info {
margin-top: 30px;
font-size: 12px;
color: #666;
}
.footer {
margin-top: 30px;
font-size: 12px;
color: #999;
}
.footer a {
color: red;
text-decoration: none;
}
</style>
</head>
<body>
<div class="container">
<div class="error-code">403</div>
<div class="message">Access Denied (403 Forbidden)</div>
<div class="description">You do not have permission to access this resource.</div>
<div class="debug-info">Node: {{.EdgeTag}}<br>
Your IP: {{.ConnectIP}}<br>
Date: {{.Date}}<br>
</div>
<div class="footer">
Security Powered by <a href="https://github.com/Rayzggz/server_torii">Server Torii</a>
</div>
</div>
</body>
</html>

View File

@ -0,0 +1,103 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>CAPTCHA - ⛩Server Torii</title>
<style>
body {
font-family: Arial, sans-serif;
display: flex;
justify-content: center;
align-items: center;
height: 100vh;
margin: 0;
background-color: #f9f9f9;
}
.container {
text-align: left;
max-width: 600px;
}
.icon svg {
width: 60px;
height: 60px;
stroke: #333;
}
.message {
font-size: 24px;
font-weight: bold;
color: #333;
}
.description {
margin-top: 10px;
color: #666;
}
.verifyBox {
margin-top: 10px;
color: #666;
}
.footer {
margin-top: 30px;
font-size: 12px;
color: #999;
}
.footer a {
color: red;
text-decoration: none;
}
</style>
<script src="https://js.hcaptcha.com/1/api.js" async defer></script>
<script>
function onSubmit(token) {
let reqBody = "h-captcha-response=" + token;
let httpRequest = new XMLHttpRequest();
httpRequest.open("POST", "/torii/captcha", true);
httpRequest.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
httpRequest.send(reqBody);
httpRequest.onreadystatechange = () => {
if (httpRequest.readyState == 4 && httpRequest.status == 200) {
let text = httpRequest.responseText;
switch (text) {
case "good":
window.location.reload();
break;
case "bad":
alert("Bad CAPTCHA, please refresh the page and try again.\n"
+ "您未能通过人机验证,请刷新页面后重试。");
break;
case "timeout":
alert("Verification timeout, please refresh the page and try again.\n"
+ "验证超时,请刷新页面后重试。");
break;
default:
alert("Unexpected error occurred, please refresh the page and try again.\n"
+ "发生了意料之外的错误,请刷新页面后重试。");
}
}
}
}
function checkCaptchaRender() {
const captchaDiv = document.querySelector(".h-captcha");
if (captchaDiv && captchaDiv.children.length > 0) {
} else {
document.getElementById("verifyBox").innerHTML = "Loading CAPTCHA failed, please check your internet connection and try again.<br>"
+ "加载人机验证失败,请检查尝试更换网络环境后重试。";
}
}
setTimeout(checkCaptchaRender, 5000); // 5秒后检查
</script>
</head>
<body>
<div class="container">
<div class="message">Checking that you are not a robot</div>
<div class="message">请完成人机验证</div>
<div class="verifyBox" id="verifyBox"><div class="h-captcha" data-sitekey="" data-callback="onSubmit"></div></div>
<div class="footer">
DDoS Protection Powered by <a href="https://github.com/Rayzggz/server_torii">Server Torii</a>
</div>
</div>
</body>
</html>