mirror of
https://github.com/lush2020/edgetunnel.git
synced 2026-03-21 17:12:33 +08:00
enhance 401 page for deno
This commit is contained in:
28
apps/deno-vless/src/deno/401.html
Normal file
28
apps/deno-vless/src/deno/401.html
Normal file
@@ -0,0 +1,28 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title>401</title>
|
||||
</head>
|
||||
|
||||
|
||||
<body>
|
||||
<h1>not set valid UUID in Environment Variables.</h1>
|
||||
<h2>Please use tool to generate UUID or use this one <span style="color: blue;" id="uuidSpan"></span></h2>
|
||||
<h3>Please refer to <a
|
||||
href="https://github.com/zizifn/edgetunnel/blob/main/doc/edge-tunnel-deno.md#%E6%B5%81%E7%A8%8B%E6%BC%94%E7%A4%BA">deno
|
||||
deploy guide</a>
|
||||
</h3>
|
||||
|
||||
<h3>Or maybe check below GIF</h3>
|
||||
<img src="https://raw.githubusercontent.com/zizifn/edgetunnel/main/doc/deno-deploy2.gif" alt="guide" srcset="">
|
||||
<script>
|
||||
let uuid = URL.createObjectURL(new Blob([])).substr(-36);
|
||||
document.getElementById('uuidSpan').textContent = uuid
|
||||
</script>
|
||||
</body>
|
||||
|
||||
</html>
|
||||
@@ -11,7 +11,10 @@ if (!isVaildUser) {
|
||||
|
||||
const handler = async (req: Request): Promise<Response> => {
|
||||
if (!isVaildUser) {
|
||||
return new Response(`not set valid UUID in Environment Variables`, {
|
||||
const index401 = await Deno.readFile(
|
||||
`${Deno.cwd()}/apps/deno-vless/src/deno/401.html`
|
||||
);
|
||||
return new Response(index401, {
|
||||
status: 401,
|
||||
headers: {
|
||||
'content-type': 'text/html; charset=utf-8',
|
||||
|
||||
Reference in New Issue
Block a user