mirror of
https://github.com/dreamhunter2333/cloudflare_temp_email.git
synced 2026-09-10 18:07:00 +08:00
Compare commits
4
Commits
v1.0.2
..
840496c48f
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
840496c48f | ||
|
|
9843b35f54 | ||
|
|
bfd66f5019 | ||
|
|
0bc31360b0 |
@@ -1,6 +1,11 @@
|
||||
<!-- markdownlint-disable-file MD004 MD024 MD034 MD036 -->
|
||||
# CHANGE LOG
|
||||
|
||||
## v1.0.3
|
||||
|
||||
- fix: 修复 github actions 部署问题
|
||||
- feat: telegram /new 不指定域名时, 使用随机地址
|
||||
|
||||
## v1.0.2
|
||||
|
||||
- fix: 修复 oauth2 登录失败的问题
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "cloudflare_temp_email",
|
||||
"version": "1.0.2",
|
||||
"version": "1.0.3",
|
||||
"private": true,
|
||||
"type": "module",
|
||||
"scripts": {
|
||||
@@ -24,15 +24,15 @@
|
||||
"@vueuse/core": "^12.8.2",
|
||||
"@wangeditor/editor": "^5.1.23",
|
||||
"@wangeditor/editor-for-vue": "^5.1.12",
|
||||
"axios": "^1.10.0",
|
||||
"axios": "^1.11.0",
|
||||
"jszip": "^3.10.1",
|
||||
"mail-parser-wasm": "^0.2.1",
|
||||
"naive-ui": "^2.42.0",
|
||||
"postal-mime": "^2.4.4",
|
||||
"vooks": "^0.2.12",
|
||||
"vue": "^3.5.17",
|
||||
"vue": "^3.5.18",
|
||||
"vue-clipboard3": "^2.0.0",
|
||||
"vue-i18n": "^11.1.10",
|
||||
"vue-i18n": "^11.1.11",
|
||||
"vue-router": "^4.5.1"
|
||||
},
|
||||
"devDependencies": {
|
||||
@@ -42,12 +42,12 @@
|
||||
"unplugin-auto-import": "^19.3.0",
|
||||
"unplugin-vue-components": "^28.8.0",
|
||||
"vite": "^6.3.5",
|
||||
"vite-plugin-pwa": "^1.0.1",
|
||||
"vite-plugin-pwa": "^1.0.2",
|
||||
"vite-plugin-top-level-await": "^1.6.0",
|
||||
"vite-plugin-wasm": "^3.5.0",
|
||||
"workbox-build": "^7.3.0",
|
||||
"workbox-window": "^7.3.0",
|
||||
"wrangler": "^4.25.0"
|
||||
"wrangler": "^4.28.1"
|
||||
},
|
||||
"packageManager": "pnpm@10.10.0+sha512.d615db246fe70f25dcfea6d8d73dee782ce23e2245e3c4f6f888249fb568149318637dca73c2c5c8ef2a4ca0d5657fb9567188bfab47f566d1ee6ce987815c39"
|
||||
}
|
||||
|
||||
Generated
+479
-510
File diff suppressed because it is too large
Load Diff
+2
-2
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "temp-email-pages",
|
||||
"version": "1.0.2",
|
||||
"version": "1.0.3",
|
||||
"description": "",
|
||||
"main": "index.js",
|
||||
"scripts": {
|
||||
@@ -11,7 +11,7 @@
|
||||
"author": "",
|
||||
"license": "ISC",
|
||||
"devDependencies": {
|
||||
"wrangler": "^4.25.0"
|
||||
"wrangler": "^4.28.1"
|
||||
},
|
||||
"packageManager": "pnpm@10.10.0+sha512.d615db246fe70f25dcfea6d8d73dee782ce23e2245e3c4f6f888249fb568149318637dca73c2c5c8ef2a4ca0d5657fb9567188bfab47f566d1ee6ce987815c39"
|
||||
}
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
{
|
||||
"name": "temp-mail-docs",
|
||||
"private": true,
|
||||
"version": "1.0.2",
|
||||
"version": "1.0.3",
|
||||
"type": "module",
|
||||
"devDependencies": {
|
||||
"@types/node": "^24.0.15",
|
||||
"vitepress": "^1.6.3",
|
||||
"wrangler": "^4.25.0"
|
||||
"@types/node": "^24.2.0",
|
||||
"vitepress": "^1.6.4",
|
||||
"wrangler": "^4.28.1"
|
||||
},
|
||||
"scripts": {
|
||||
"dev": "vitepress dev docs",
|
||||
|
||||
Generated
+360
-348
File diff suppressed because it is too large
Load Diff
+10
-10
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "cloudflare_temp_email",
|
||||
"version": "1.0.2",
|
||||
"version": "1.0.3",
|
||||
"private": true,
|
||||
"type": "module",
|
||||
"scripts": {
|
||||
@@ -11,26 +11,26 @@
|
||||
"build": "wrangler deploy --dry-run --outdir dist --minify"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@cloudflare/workers-types": "^4.20250719.0",
|
||||
"@cloudflare/workers-types": "^4.20250807.0",
|
||||
"@eslint/js": "9.18.0",
|
||||
"@simplewebauthn/types": "10.0.0",
|
||||
"@types/node": "^22.16.5",
|
||||
"@types/node": "^22.17.0",
|
||||
"eslint": "9.18.0",
|
||||
"globals": "^15.15.0",
|
||||
"typescript-eslint": "^8.37.0",
|
||||
"wrangler": "^4.25.0"
|
||||
"typescript-eslint": "^8.39.0",
|
||||
"wrangler": "^4.28.1"
|
||||
},
|
||||
"dependencies": {
|
||||
"@aws-sdk/client-s3": "^3.848.0",
|
||||
"@aws-sdk/s3-request-presigner": "^3.848.0",
|
||||
"@aws-sdk/client-s3": "^3.863.0",
|
||||
"@aws-sdk/s3-request-presigner": "^3.863.0",
|
||||
"@simplewebauthn/server": "10.0.1",
|
||||
"hono": "^4.8.5",
|
||||
"hono": "^4.9.0",
|
||||
"jsonpath-plus": "^10.3.0",
|
||||
"mimetext": "^3.0.27",
|
||||
"postal-mime": "^2.4.4",
|
||||
"resend": "^4.7.0",
|
||||
"resend": "^4.8.0",
|
||||
"telegraf": "4.16.3",
|
||||
"worker-mailer": "^1.1.4"
|
||||
"worker-mailer": "^1.1.5"
|
||||
},
|
||||
"pnpm": {
|
||||
"patchedDependencies": {
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
diff --git a/lib/core/network/client.js b/lib/core/network/client.js
|
||||
index 25fbbbb47c7f88e83ae26f629e5ae1a0c141725c..209d4a6bf05352f44eeb082eb327581d698de5ce 100644
|
||||
index 25fbbbb47c7f88e83ae26f629e5ae1a0c141725c..ab82c5391596ee2ed8dbe4128f3ba57a8cc998ca 100644
|
||||
--- a/lib/core/network/client.js
|
||||
+++ b/lib/core/network/client.js
|
||||
@@ -1,18 +1,18 @@
|
||||
@@ -37,7 +37,17 @@ index 25fbbbb47c7f88e83ae26f629e5ae1a0c141725c..209d4a6bf05352f44eeb082eb327581d
|
||||
const path = __importStar(require("path"));
|
||||
const node_fetch_1 = __importDefault(require("node-fetch"));
|
||||
const check_1 = require("../helpers/check");
|
||||
@@ -61,10 +61,10 @@ const DEFAULT_OPTIONS = {
|
||||
@@ -39,7 +39,8 @@ const multipart_stream_1 = __importDefault(require("./multipart-stream"));
|
||||
const error_1 = __importDefault(require("./error"));
|
||||
const url_1 = require("url");
|
||||
// eslint-disable-next-line @typescript-eslint/no-var-requires
|
||||
-const debug = require('debug')('telegraf:client');
|
||||
+// const debug = require('debug')('telegraf:client');
|
||||
+const debug = (msg) => console.debug(`[telegraf:client] ${msg}`);
|
||||
const { isStream } = multipart_stream_1.default;
|
||||
const WEBHOOK_REPLY_METHOD_ALLOWLIST = new Set([
|
||||
'answerCallbackQuery',
|
||||
@@ -61,10 +62,10 @@ const DEFAULT_OPTIONS = {
|
||||
apiRoot: 'https://api.telegram.org',
|
||||
apiMode: 'bot',
|
||||
webhookReply: true,
|
||||
@@ -52,7 +62,7 @@ index 25fbbbb47c7f88e83ae26f629e5ae1a0c141725c..209d4a6bf05352f44eeb082eb327581d
|
||||
attachmentAgent: undefined,
|
||||
testEnv: false,
|
||||
};
|
||||
@@ -112,9 +112,9 @@ async function buildFormDataConfig(payload, agent) {
|
||||
@@ -112,9 +113,9 @@ async function buildFormDataConfig(payload, agent) {
|
||||
}
|
||||
const boundary = crypto.randomBytes(32).toString('hex');
|
||||
const formData = new multipart_stream_1.default(boundary);
|
||||
@@ -65,7 +75,7 @@ index 25fbbbb47c7f88e83ae26f629e5ae1a0c141725c..209d4a6bf05352f44eeb082eb327581d
|
||||
return {
|
||||
method: 'POST',
|
||||
compress: true,
|
||||
@@ -205,14 +205,15 @@ async function attachFormMedia(form, media, id, agent) {
|
||||
@@ -205,14 +206,15 @@ async function attachFormMedia(form, media, id, agent) {
|
||||
if ('source' in media && media.source) {
|
||||
let mediaSource = media.source;
|
||||
if (typeof media.source === 'string') {
|
||||
|
||||
Generated
+734
-731
File diff suppressed because it is too large
Load Diff
@@ -108,9 +108,9 @@ export const newAddress = async (
|
||||
}
|
||||
// check domain
|
||||
const allowDomains = checkAllowDomains ? await getAllowDomains(c) : getDomains(c);
|
||||
// if domain is not set, use the first domain
|
||||
// if domain is not set, use the random domain
|
||||
if (!domain && allowDomains.length > 0) {
|
||||
domain = allowDomains[0];
|
||||
domain = allowDomains[Math.floor(Math.random() * allowDomains.length)];
|
||||
}
|
||||
// check domain is valid
|
||||
if (!domain || !allowDomains.includes(domain)) {
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
export const CONSTANTS = {
|
||||
VERSION: 'v' + '1.0.2',
|
||||
VERSION: 'v' + '1.0.3',
|
||||
|
||||
// DB Version
|
||||
DB_VERSION_KEY: 'db_version',
|
||||
|
||||
@@ -51,6 +51,14 @@ export const jwtListToAddressData = async (
|
||||
for (const jwt of jwtList) {
|
||||
try {
|
||||
const { address, address_id } = await Jwt.verify(jwt, c.env.JWT_SECRET, "HS256");
|
||||
const name = await c.env.DB.prepare(
|
||||
`SELECT name FROM address WHERE id = ? `
|
||||
).bind(address_id).first("name");
|
||||
if (!name) {
|
||||
addressList.push("无效地址");
|
||||
invalidJwtList.push(jwt);
|
||||
continue;
|
||||
}
|
||||
addressList.push(address as string);
|
||||
addressIdMap[address as string] = address_id as number;
|
||||
} catch (e) {
|
||||
@@ -75,7 +83,7 @@ export const bindTelegramAddress = async (
|
||||
return address as string;
|
||||
}
|
||||
if (jwtList.length >= getIntValue(c.env.TG_MAX_ADDRESS, 5)) {
|
||||
throw Error("绑定地址数量已达上限");
|
||||
throw Error("绑定地址数量已达上限, 请先 /cleaninvalidaddress");
|
||||
}
|
||||
await c.env.KV.put(`${CONSTANTS.TG_KV_PREFIX}:${userId}`, JSON.stringify([...jwtList, jwt]));
|
||||
// for mail push to telegram
|
||||
|
||||
@@ -41,8 +41,8 @@ const COMMANDS = [
|
||||
description: "查看邮件, 请输入 /mails <邮箱地址>, 不输入地址默认查看第一个地址"
|
||||
},
|
||||
{
|
||||
command: "cleaninvalidadress",
|
||||
description: "清理无效地址, 请输入 /cleaninvalidadress"
|
||||
command: "cleaninvalidaddress",
|
||||
description: "清理无效地址, 请输入 /cleaninvalidaddress"
|
||||
},
|
||||
]
|
||||
|
||||
@@ -159,7 +159,7 @@ export function newTelegramBot(c: Context<HonoCustomType>, token: string): Teleg
|
||||
}
|
||||
try {
|
||||
// @ts-ignore
|
||||
const address = ctx?.message?.text.slice("/unbind".length).trim();
|
||||
const address = ctx?.message?.text.slice("/delete".length).trim();
|
||||
if (!address) {
|
||||
return await ctx.reply("请输入地址");
|
||||
}
|
||||
@@ -186,7 +186,7 @@ export function newTelegramBot(c: Context<HonoCustomType>, token: string): Teleg
|
||||
}
|
||||
});
|
||||
|
||||
bot.command("cleaninvalidadress", async (ctx: TgContext) => {
|
||||
bot.command("cleaninvalidaddress", async (ctx: TgContext) => {
|
||||
const userId = ctx?.message?.from?.id;
|
||||
if (!userId) {
|
||||
return await ctx.reply("无法获取用户信息");
|
||||
|
||||
Reference in New Issue
Block a user