Skip to content

Commit

Permalink
整合部分页面
Browse files Browse the repository at this point in the history
  • Loading branch information
MarSeventh committed Sep 14, 2024
1 parent 6b05688 commit dac430b
Show file tree
Hide file tree
Showing 46 changed files with 88 additions and 76 deletions.
12 changes: 8 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -250,7 +250,11 @@ API格式:
环境变量增加`ALLOWED_DOMAINS`,多个允许的域名用英文`,`分割,如:`域名.xyz,域名.cloudns.be,域名.pp.ua`
#### 3.1.7页面自定义(DIY接口)
#### 3.1.7白名单模式
环境变量增加`WhiteList_Mode`,设置为`true`即可开启白名单模式,仅设置为白名单的图片可被访问。
#### 3.1.8页面自定义(DIY接口)
环境变量增加`USER_CONFIG`,JSON格式,具体字段用途及内容规范见下表。
Expand Down Expand Up @@ -282,11 +286,11 @@ API格式:
> }
> ```
#### 3.1.8远端遥测
#### 3.1.9远端遥测
便于开发者进行bug的捕捉和定位,但是**过程中可能收集到访问链接、域名等信息**,如您不愿意泄露类似信息给项目开发者,可在环境变量中添加`disable_telemetry`为`true`来退出遥测。
#### 3.1.9随机图API
#### 3.1.10随机图API
| 接口名称 | /random |
| ------------ | ------------------------------------------------------------ |
Expand All @@ -311,7 +315,7 @@ API格式:
> }
> ```
#### 3.1.10注意!!!
#### 3.1.11注意!!!
**修改环境变量方式**:
Expand Down
31 changes: 0 additions & 31 deletions block-img.html

This file was deleted.

1 change: 1 addition & 0 deletions css/673.825c4eaf.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions css/680.8a82d8fe.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Binary file added css/680.8a82d8fe.css.gz
Binary file not shown.
1 change: 1 addition & 0 deletions css/866.18f4011e.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions css/950.72f74158.css

Large diffs are not rendered by default.

Binary file added css/950.72f74158.css.gz
Binary file not shown.
14 changes: 7 additions & 7 deletions functions/file/[id].js
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,11 @@ export async function onRequest(context) { // Contents of context object
return domainPattern.test(refererUrl.hostname);
});
if (!isAllowed) {
return Response.redirect(new URL("/block-img.html", request.url).href, 302); // Ensure URL is correctly formed
return Response.redirect(new URL("/blockimg", request.url).href, 302); // Ensure URL is correctly formed
}
}
} catch (e) {
return Response.redirect(new URL("/block-img.html", request.url).href, 302); // Ensure URL is correctly formed
return Response.redirect(new URL("/blockimg", request.url).href, 302); // Ensure URL is correctly formed
}
}
// 检查是否配置了 KV 数据库
Expand Down Expand Up @@ -101,22 +101,22 @@ export async function onRequest(context) { // Contents of context object
console.log("Referer")
console.log(request.headers.get('Referer'))
if (typeof request.headers.get('Referer') == "undefined" || request.headers.get('Referer') == null || request.headers.get('Referer') == "") {
return Response.redirect(url.origin + "/block-img.html", 302)
return Response.redirect(url.origin + "/blockimg", 302)
} else {
return Response.redirect("https://static-res.pages.dev/teleimage/img-block-compressed.png", 302)
return new Response('Error: Image Blocked', { status: 404 });
}

} else if (record.metadata.Label == "adult") {
if (typeof request.headers.get('Referer') == "undefined" || request.headers.get('Referer') == null || request.headers.get('Referer') == "") {
return Response.redirect(url.origin + "/block-img.html", 302)
return Response.redirect(url.origin + "/blockimg", 302)
} else {
return Response.redirect("https://static-res.pages.dev/teleimage/img-block-compressed.png", 302)
return new Response('Error: Image Blocked', { status: 404 });
}
}
//check if the env variables WhiteList_Mode are set
if (env.WhiteList_Mode == "true") {
//if the env variables WhiteList_Mode are set, redirect to the image
return Response.redirect(url.origin + "/whitelist-on.html", 302);
return Response.redirect(url.origin + "/whiteliston", 302);
} else {
//if the env variables WhiteList_Mode are not set, redirect to the image
return newRes;
Expand Down
Binary file added img/404.8ed11fb3.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added img/background.ea1b7ee7.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion index.html
Original file line number Diff line number Diff line change
@@ -1 +1 @@
<!doctype html><html lang=""><head><meta charset="utf-8"><meta http-equiv="X-UA-Compatible" content="IE=edge"><meta name="viewport" content="width=device-width,initial-scale=1"><link rel="icon" href="/logo.png"><title>Sanyue ImgHub</title><script defer="defer" src="/js/app.4e19a760.js"></script><link href="/css/app.def7ef9b.css" rel="stylesheet"></head><body><noscript><strong>We're sorry but sanyue_imghub doesn't work properly without JavaScript enabled. Please enable it to continue.</strong></noscript><div id="app"></div></body></html>
<!doctype html><html lang=""><head><meta charset="utf-8"><meta http-equiv="X-UA-Compatible" content="IE=edge"><meta name="viewport" content="width=device-width,initial-scale=1"><link rel="icon" href="/logo.png"><title>Sanyue ImgHub</title><script defer="defer" src="/js/app.40c62b88.js"></script><link href="/css/app.def7ef9b.css" rel="stylesheet"></head><body><noscript><strong>We're sorry but sanyue_imghub doesn't work properly without JavaScript enabled. Please enable it to continue.</strong></noscript><div id="app"></div></body></html>
Binary file modified index.html.gz
Binary file not shown.
2 changes: 2 additions & 0 deletions js/522.d8c7634a.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Binary file added js/522.d8c7634a.js.gz
Binary file not shown.
1 change: 1 addition & 0 deletions js/522.d8c7634a.js.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Binary file added js/522.d8c7634a.js.map.gz
Binary file not shown.
2 changes: 2 additions & 0 deletions js/569.537082ba.js

Large diffs are not rendered by default.

Binary file added js/569.537082ba.js.gz
Binary file not shown.
1 change: 1 addition & 0 deletions js/569.537082ba.js.map

Large diffs are not rendered by default.

Binary file added js/569.537082ba.js.map.gz
Binary file not shown.
2 changes: 2 additions & 0 deletions js/673.d0c18f73.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Binary file added js/673.d0c18f73.js.gz
Binary file not shown.
1 change: 1 addition & 0 deletions js/673.d0c18f73.js.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Binary file added js/673.d0c18f73.js.map.gz
Binary file not shown.
Loading

0 comments on commit dac430b

Please sign in to comment.