diff --git a/.github/ISSUE_TEMPLATE/bug_report.md b/.github/ISSUE_TEMPLATE/bug_report.md deleted file mode 100644 index 31bd8acde..000000000 --- a/.github/ISSUE_TEMPLATE/bug_report.md +++ /dev/null @@ -1,10 +0,0 @@ ---- -name: Bug report -about: Create a report to help us improve -title: "[Bug] " -labels: bug -assignees: '' - ---- - - diff --git a/.github/ISSUE_TEMPLATE/feature_request.md b/.github/ISSUE_TEMPLATE/feature_request.md deleted file mode 100644 index 8be61c0fe..000000000 --- a/.github/ISSUE_TEMPLATE/feature_request.md +++ /dev/null @@ -1,10 +0,0 @@ ---- -name: Feature request -about: Suggest an idea for this project -title: "[Feature request] " -labels: enhancement -assignees: '' - ---- - - diff --git a/.github/ISSUE_TEMPLATE/need-help.md b/.github/ISSUE_TEMPLATE/need-help.md deleted file mode 100644 index 7579a9111..000000000 --- a/.github/ISSUE_TEMPLATE/need-help.md +++ /dev/null @@ -1,10 +0,0 @@ ---- -name: Need Help -about: Create a issue to find help -title: "[Help] " -labels: help wanted -assignees: '' - ---- - - diff --git a/.github/workflows/deploy-cloudflare.yml b/.github/workflows/deploy-cloudflare.yml deleted file mode 100644 index 2f4e16533..000000000 --- a/.github/workflows/deploy-cloudflare.yml +++ /dev/null @@ -1,271 +0,0 @@ -name: 🚀 Deploy cloud-mail to Cloudflare Workers - -on: - push: - branches: [ main ] - paths: - - "mail-worker/**" - - "mail-vue/**" - workflow_dispatch: - -jobs: - Deploy-cloud-mail: - name: 🏗️ Build and Deploy - runs-on: ubuntu-latest - - env: - NAME: ${{ secrets.NAME || vars.NAME || 'cloud-mail' }} - CUSTOM_DOMAIN: ${{ secrets.CUSTOM_DOMAIN || vars.CUSTOM_DOMAIN }} - DOMAIN: ${{ secrets.DOMAIN || vars.DOMAIN }} - ADMIN: ${{ secrets.ADMIN || vars.ADMIN }} - JWT_SECRET: ${{ secrets.JWT_SECRET || vars.JWT_SECRET }} - CLOUDFLARE_API_TOKEN: ${{ secrets.CLOUDFLARE_API_TOKEN || vars.CLOUDFLARE_API_TOKEN }} - CLOUDFLARE_ACCOUNT_ID: ${{ secrets.CLOUDFLARE_ACCOUNT_ID || vars.CLOUDFLARE_ACCOUNT_ID }} - D1_DATABASE_ID: ${{ secrets.D1_DATABASE_ID || vars.D1_DATABASE_ID }} - KV_NAMESPACE_ID: ${{ secrets.KV_NAMESPACE_ID || vars.KV_NAMESPACE_ID }} - R2_BUCKET_NAME: ${{ secrets.R2_BUCKET_NAME || vars.R2_BUCKET_NAME }} - PROJECT_LINK: ${{ secrets.PROJECT_LINK || vars.PROJECT_LINK }} - AI_MODEL: ${{ secrets.AI_MODEL || vars.AI_MODEL || '@cf/meta/llama-3.1-8b-instruct' }} - CLOUDFLARE_EMAIL: ${{ secrets.CF_EMAIL || vars.CF_EMAIL || false }} - ANALYSIS_CACHE: ${{ secrets.ANALYSIS_CACHE || vars.ANALYSIS_CACHE || false }} - LINUXDO_CLIENT_ID: ${{ secrets.LINUXDO_CLIENT_ID || vars.LINUXDO_CLIENT_ID }} - LINUXDO_CLIENT_SECRET: ${{ secrets.LINUXDO_CLIENT_SECRET || vars.LINUXDO_CLIENT_SECRET }} - LINUXDO_CALLBACK_URL: ${{ secrets.LINUXDO_CALLBACK_URL || vars.LINUXDO_CALLBACK_URL }} - LINUXDO_SWITCH: ${{ secrets.LINUXDO_SWITCH || vars.LINUXDO_SWITCH }} - - - outputs: - worker_url: ${{ steps.deploy.outputs.worker_url }} - - - steps: - - name: 🚚 检出代码仓库 / Checkout repository - uses: actions/checkout@v4 - - - name: ⚙ 设置 pnpm / Set up pnpm - uses: pnpm/action-setup@v4.1.0 - with: - version: 9 - - - name: ⚙ 设置 Node.js / Set up Node.js - uses: actions/setup-node@v4 - with: - node-version: "22" - cache: "pnpm" - cache-dependency-path: "./mail-worker/pnpm-lock.yaml" - - - name: 📦 安装依赖 / Install dependencies - run: pnpm install --frozen-lockfile - working-directory: ./mail-worker - - - name: 📡 禁用 Wrangler 遥测 / Disable wrangler telemetry - working-directory: ./mail-worker - run: pnpm wrangler telemetry disable - - - name: 🛠️ 设置环境 / Set up environment - working-directory: ./mail-worker - run: | - - echo "🔐 Starting environment setup..." - - if [ -z "$JWT_SECRET" ] || grep -q '[?%#/\\]' <<< "$JWT_SECRET"; then - echo "❌ JWT_SECRET variable is empty or contains invalid characters (?, %, #, /, \\)." - exit 1 - fi - - if ! jq -e 'type == "array"' <<< "$DOMAIN" ; then - echo "❌ DOMAIN variable must be a JSON array (e.g., [\"example.com\"])." - exit 1 - fi - - if [ -z "$ADMIN" ]; then - echo "❌ ADMIN variable cannot be empty." - exit 1 - fi - - if [ -z "$CLOUDFLARE_ACCOUNT_ID" ]; then - echo "❌ CLOUDFLARE_ACCOUNT_ID variable cannot be empty." - exit 1 - fi - - if [ -z "$CLOUDFLARE_API_TOKEN" ]; then - echo "❌ CLOUDFLARE_API_TOKEN variable cannot be empty." - exit 1 - fi - - if [ -z "$CUSTOM_DOMAIN" ]; then - echo "::warning:: CUSTOM_DOMAIN variable is not set." - fi - - CONFIG_FILE="wrangler-action.toml" - - if [ -z "$R2_BUCKET_NAME" ]; then - sed -i '/\[\[r2_buckets\]\]/,/^$/d' "$CONFIG_FILE" - fi - - if [ -z "$PROJECT_LINK" ]; then - sed -i '/^project_link = /d' "$CONFIG_FILE" - fi - - if [ -z "$LINUXDO_CLIENT_ID" ] || [ -z "$LINUXDO_CLIENT_SECRET" ]; then - sed -i '/^linuxdo_client_id = /,/^linuxdo_switch = /d' "$CONFIG_FILE" - fi - - if [ -z "$CUSTOM_DOMAIN" ]; then - sed -i '/\[\[routes\]\]/,/^$/d' "$CONFIG_FILE" - fi - - if [ "$(printf '%s' "$CLOUDFLARE_EMAIL" | tr '[:upper:]' '[:lower:]')" = "true" ]; then - cat >> "$CONFIG_FILE" <<'EOF' - - [[send_email]] - name = "email" - EOF - fi - - sed -i "s|\${NAME}|${NAME}|g" "$CONFIG_FILE" - sed -i "s|\${CUSTOM_DOMAIN}|${CUSTOM_DOMAIN}|g" "$CONFIG_FILE" - sed -i "s|\"\${DOMAIN}\"|${DOMAIN}|g" "$CONFIG_FILE" - sed -i "s|\${ADMIN}|${ADMIN}|g" "$CONFIG_FILE" - sed -i "s|\${JWT_SECRET}|${JWT_SECRET}|g" "$CONFIG_FILE" - sed -i "s|\${R2_BUCKET_NAME}|${R2_BUCKET_NAME}|g" "$CONFIG_FILE" - sed -i "s|\${PROJECT_LINK}|${PROJECT_LINK}|g" "$CONFIG_FILE" - sed -i "s|\${ANALYSIS_CACHE}|${ANALYSIS_CACHE}|g" "$CONFIG_FILE" - sed -i "s|\${AI_MODEL}|${AI_MODEL}|g" "$CONFIG_FILE" - sed -i "s|\${LINUXDO_CLIENT_ID}|${LINUXDO_CLIENT_ID}|g" "$CONFIG_FILE" - sed -i "s|\${LINUXDO_CLIENT_SECRET}|${LINUXDO_CLIENT_SECRET}|g" "$CONFIG_FILE" - sed -i "s|\${LINUXDO_CALLBACK_URL}|${LINUXDO_CALLBACK_URL}|g" "$CONFIG_FILE" - sed -i "s|\${LINUXDO_SWITCH}|${LINUXDO_SWITCH}|g" "$CONFIG_FILE" - - echo "✅ Environment setup completed." - - - name: ⚡ 设置KV数据库 / Set up KV database - working-directory: ./mail-worker - run: | - - CONFIG_FILE="wrangler-action.toml" - - if [ -n "$KV_NAMESPACE_ID" ]; then - sed -i "s|\${KV_NAMESPACE_ID}|${KV_NAMESPACE_ID}|g" "$CONFIG_FILE" - echo "✅ Using the database from environment variables." - exit 0 - fi - - echo "🔍 Checking if the database exists..." - - set +e - KV_LIST=$(pnpm wrangler kv namespace list 2>&1) - STATUS=$? - set -e - - if [ $STATUS -ne 0 ]; then - echo "$KV_LIST" - exit 1 - fi - - if echo "$KV_LIST" | jq -e ".[] | select(.title == \"$NAME\")" >/dev/null; then - echo "✅ Database $NAME already exists." - KV_ID=$(echo "$KV_LIST" | jq -r ".[] | select(.title == \"$NAME\") | .id") - echo "KV_NAMESPACE_ID: $KV_ID" - else - echo "⚠️ Database $NAME does not exist. Starting creation..." - pnpm wrangler kv namespace create $NAME - KV_LIST=$(pnpm wrangler kv namespace list) - KV_ID=$(echo "$KV_LIST" | jq -r ".[] | select(.title == \"$NAME\") | .id") - fi - - sed -i "s|\${KV_NAMESPACE_ID}|$KV_ID|g" "$CONFIG_FILE" - echo "✅ Setup completed." - - - name: 🐬 设置D1数据库 / Set up D1 database - working-directory: ./mail-worker - run: | - - CONFIG_FILE="wrangler-action.toml" - - if [ -n "$D1_DATABASE_ID" ]; then - sed -i "s|\${D1_DATABASE_ID}|${D1_DATABASE_ID}|g" "$CONFIG_FILE" - echo "✅ Using the database from environment variables." - exit 0 - fi - - echo "🔍 Checking if the database exists..." - - set +e - DB_LIST=$(pnpm wrangler d1 list --json 2>&1) - STATUS=$? - set -e - - if [ $STATUS -ne 0 ]; then - echo "$DB_LIST" - exit 1 - fi - - if echo "$DB_LIST" | jq -e ".[] | select(.name == \"$NAME\")" >/dev/null; then - echo "✅ Database $NAME already exists." - D1_ID=$(echo "$DB_LIST" | jq -r ".[] | select(.name == \"$NAME\") | .uuid") - echo "D1_DATABASE_ID: $D1_ID" - else - echo "⚠️ Database $NAME does not exist. Starting creation..." - pnpm wrangler d1 create $NAME - DB_LIST=$(pnpm wrangler d1 list --json) - D1_ID=$(echo "$DB_LIST" | jq -r ".[] | select(.name == \"$NAME\") | .uuid") - fi - - sed -i "s|\${D1_DATABASE_ID}|$D1_ID|g" "$CONFIG_FILE" - echo "✅ Setup completed." - - - name: 🚀 开始部署 / Start deployment - id: deploy - working-directory: ./mail-worker - run: | - echo "🚀 Starting deployment..." - pnpm wrangler deploy -c wrangler-action.toml 2>&1 \ - | tee deploy.log \ - | grep -v "https://.*\.workers\.dev" \ - | sed -E 's/env\.domain .*/env.domain (***)/' \ - || true - - DEPLOY_EXIT_CODE=${PIPESTATUS[0]} - if [ $DEPLOY_EXIT_CODE -ne 0 ]; then - exit 1 - fi - - WORKER_URL=$(grep -o "https://.*\.workers\.dev" deploy.log || echo "") - - if [ -n "$WORKER_URL" ]; then - echo "::add-mask::$WORKER_URL" - fi - - echo "worker_url=$WORKER_URL" >> $GITHUB_OUTPUT - echo "✅ Setup completed." - - - name: ♻️ 初始化数据库 / Initialize database - run: | - echo "🛠️ Starting database initialization..." - sleep 15 - - WORKER_URL="${CUSTOM_DOMAIN:+https://$CUSTOM_DOMAIN}" - WORKER_URL="${WORKER_URL:-${{ steps.deploy.outputs.worker_url }}}" - - if [ -z "$WORKER_URL" ]; then - echo "❌ Preview URL not available. Please set CUSTOM_DOMAIN." - exit 1 - fi - - HTTP_CODE=$(curl -sL -w "%{http_code}" -o response.txt "$WORKER_URL/api/init/${JWT_SECRET}") - RESPONSE_BODY=$(cat response.txt) - - if [ "$RESPONSE_BODY" = "success" ]; then - echo "✅ Setup completed." - else - echo "❌ Failed. HTTP: $HTTP_CODE, Response: $RESPONSE_BODY" - exit 1 - fi - - - name: 🗑️ 删除运行记录 / Delete workflow runs - uses: GitRML/delete-workflow-runs@main - continue-on-error: true - with: - retain_days: '1' - keep_minimum_runs: '0' diff --git a/.gitignore b/.gitignore index 868603305..f32141512 100644 --- a/.gitignore +++ b/.gitignore @@ -9,7 +9,6 @@ lerna-debug.log* node_modules dist-ssr *.local -dist .vscode/* !.vscode/extensions.json @@ -24,4 +23,4 @@ dist mail-vue/node_modules mail-vue/dist .wrangler -.venv +.venv \ No newline at end of file diff --git a/LICENSE b/LICENSE index 52c484e0e..615caf2e0 100644 --- a/LICENSE +++ b/LICENSE @@ -1,6 +1,6 @@ The MIT License (MIT) -Copyright (c) 2025 eoao +Copyright (c) 2025 LaziestRen Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in diff --git a/README-en.md b/README-en.md deleted file mode 100644 index da7163e27..000000000 --- a/README-en.md +++ /dev/null @@ -1,148 +0,0 @@ -
-
-
A simple, responsive email service designed to run on Cloudflare Workers 🎉
-- 简体中文 | English -
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-## License
-
-This project is licensed under the [MIT](LICENSE) license.
-
-## Communication
-
-[Telegram](https://t.me/cloud_mail_tg)
diff --git a/README.md b/README.md
index b0a57649c..bb1df1a8d 100644
--- a/README.md
+++ b/README.md
@@ -1,90 +1,73 @@
-
-
基于 Cloudflare 的简约响应式邮箱服务,支持邮件发送、附件收发 🎉
-- 简体中文 | English -
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
-
## 许可证
diff --git a/demo/demo1.png b/demo/demo1.png
new file mode 100644
index 000000000..cc48cde17
Binary files /dev/null and b/demo/demo1.png differ
diff --git a/demo/demo2.png b/demo/demo2.png
new file mode 100644
index 000000000..559bb48f6
Binary files /dev/null and b/demo/demo2.png differ
diff --git a/demo/demo3.png b/demo/demo3.png
new file mode 100644
index 000000000..91f7c03f7
Binary files /dev/null and b/demo/demo3.png differ
diff --git a/demo/demo4.png b/demo/demo4.png
new file mode 100644
index 000000000..cffc4af02
Binary files /dev/null and b/demo/demo4.png differ
diff --git a/demo/demo5.png b/demo/demo5.png
new file mode 100644
index 000000000..3a004cc51
Binary files /dev/null and b/demo/demo5.png differ
diff --git a/demo/demo6.png b/demo/demo6.png
new file mode 100644
index 000000000..28eaa4deb
Binary files /dev/null and b/demo/demo6.png differ
diff --git a/demo/demo7.png b/demo/demo7.png
new file mode 100644
index 000000000..adbe283fd
Binary files /dev/null and b/demo/demo7.png differ
diff --git a/demo/demo8.png b/demo/demo8.png
new file mode 100644
index 000000000..618c69173
Binary files /dev/null and b/demo/demo8.png differ
diff --git a/demo/logo.png b/demo/logo.png
new file mode 100644
index 000000000..0a6f4f2e4
Binary files /dev/null and b/demo/logo.png differ
diff --git a/doc/demo/demo1.png b/doc/demo/demo1.png
deleted file mode 100644
index bc8a7fc56..000000000
Binary files a/doc/demo/demo1.png and /dev/null differ
diff --git a/doc/demo/demo2.png b/doc/demo/demo2.png
deleted file mode 100644
index f295f5384..000000000
Binary files a/doc/demo/demo2.png and /dev/null differ
diff --git a/doc/demo/demo3.png b/doc/demo/demo3.png
deleted file mode 100644
index d5d22a53f..000000000
Binary files a/doc/demo/demo3.png and /dev/null differ
diff --git a/doc/demo/demo4.png b/doc/demo/demo4.png
deleted file mode 100644
index 565c29703..000000000
Binary files a/doc/demo/demo4.png and /dev/null differ
diff --git a/doc/demo/logo.png b/doc/demo/logo.png
deleted file mode 100644
index 0cf037865..000000000
Binary files a/doc/demo/logo.png and /dev/null differ
diff --git a/doc/github-action.md b/doc/github-action.md
deleted file mode 100644
index c6f72152e..000000000
--- a/doc/github-action.md
+++ /dev/null
@@ -1,38 +0,0 @@
-## Github Action 部署
-
-**配置 Github 仓库**
-
-1. Fork 或克隆仓库 [https://github.com/eoao/cloud-mail](https://github.com/eoao/cloud-mail)
-2. 进入您的 GitHub 仓库设置
-3. 转到 Settings → Secrets and variables → Actions → New Repository secrets
-4. 添加以下 Secrets:
-
-| Secret 名称 | 必需 | 用途 |
-| ----------------------- | :--: | ----------------------------------------------------- |
-| `CLOUDFLARE_API_TOKEN` | ✅ | Cloudflare API 令牌(需要 Workers 和相关资源权限) |
-| `CLOUDFLARE_ACCOUNT_ID` | ✅ | Cloudflare 账户 ID |
-| `D1_DATABASE_ID` | ✅ | 您的 D1 数据库的 ID |
-| `KV_NAMESPACE_ID` | ✅ | 您的 KV 命名空间的 ID |
-| `R2_BUCKET_NAME` | ✅ | 您的 R2 存储桶的名称 |
-| `DOMAIN` | ✅ | 您要用于邮件服务的域名(例如 `["xx.xx"],多域名用,分隔`) |
-| `ADMIN` | ✅ | 您的管理员邮箱地址(例如 `admin@example.com`) |
-| `JWT_SECRET` | ✅ | 用于生成和验证 JWT 的随机长字符串 |
-| `INIT_URL` | ❌ | (可选)部署后用于初始化数据库的 Worker URL(格式参考下述手动初始化) |
-
----
-
-**获取 Cloudflare API 令牌**
-
-1. 访问 [Cloudflare Dashboard](https://dash.cloudflare.com/profile/api-tokens)
-2. 创建新的 API 令牌
-3. 选择"编辑 Cloudflare Workers"模板,并参照下表添加相应权限
- 
-4. 保存令牌并复制到 GitHub Secrets 中的 `CLOUDFLARE_API_TOKEN`
-
-**获取 Cloudflare 账户 ID**
-1. 账户 ID 可以在 Cloudflare 仪表盘的账户设置中找到。
-2. 复制到 GitHub Secrets 中的 `CLOUDFLARE_ACCOUNT_ID`
-
-**运行工作流**
-1. 然后在Action页面手动运行工作流,后续同步上游后会自动部署到 Cloudflare Workers。如未配置 `INIT_URL`,则需要手动访问 `https://你的项目域名/api/init/你的jwt_secret` 进行数据库初始化。
-2. 自动同步上游可使用bot或者手动点击Sync Upstream按钮。
\ No newline at end of file
diff --git a/doc/images/support.png b/doc/images/support.png
deleted file mode 100644
index c84921b0d..000000000
Binary files a/doc/images/support.png and /dev/null differ
diff --git a/mail-vue/.env.dev b/mail-vue/.env.dev
index 01f7ae85a..50ecbd86e 100644
--- a/mail-vue/.env.dev
+++ b/mail-vue/.env.dev
@@ -1,4 +1,3 @@
NODE_ENV = 'dev'
VITE_APP_TITLE = '开发环境'
-VITE_BASE_URL = 'http://127.0.0.1:8787/api'
-VITE_PWA_NAME = 'Cloud Mail'
+VITE_BASE_URL = 'http://127.0.0.1:8787/api'
\ No newline at end of file
diff --git a/mail-vue/.env.release b/mail-vue/.env.release
index f88f5116d..f42cf37b0 100644
--- a/mail-vue/.env.release
+++ b/mail-vue/.env.release
@@ -1,5 +1,3 @@
NODE_ENV = 'release'
VITE_APP_TITLE = '发布环境'
-VITE_BASE_URL = '/api'
-VITE_PWA_NAME = 'Cloud Mail'
-VITE_OUT_DIR = ../mail-worker/dist
+VITE_BASE_URL = '/api'
\ No newline at end of file
diff --git a/mail-vue/.env.remote b/mail-vue/.env.remote
index 4bd905cfb..fa20983e2 100644
--- a/mail-vue/.env.remote
+++ b/mail-vue/.env.remote
@@ -1,4 +1,3 @@
NODE_ENV = 'remote'
VITE_APP_TITLE = '远程环境'
-VITE_BASE_URL = 'https://skymail.ink/api'
-VITE_PWA_NAME = 'Cloud Mail'
+VITE_BASE_URL = 'xxxxxx'
\ No newline at end of file
diff --git a/mail-vue/index.html b/mail-vue/index.html
index 185aff1a5..7e6bf5b21 100644
--- a/mail-vue/index.html
+++ b/mail-vue/index.html
@@ -1,139 +1,96 @@
-
-
-
-
-