Skip to content

Commit 224abed

Browse files
committed
删除 GitHub Actions 设置邮件接收步骤
1 parent 0cee02e commit 224abed

File tree

4 files changed

+35
-164
lines changed

4 files changed

+35
-164
lines changed

.github/workflows/deploy-cloudflare.yml

Lines changed: 34 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ jobs:
8989
fi
9090
9191
if [ -z "$CUSTOM_DOMAIN" ]; then
92-
echo "::error:: CUSTOM_DOMAIN variable is not set."
92+
echo "::warning:: CUSTOM_DOMAIN variable is not set."
9393
fi
9494
9595
CONFIG_FILE="wrangler-action.toml"
@@ -132,9 +132,18 @@ jobs:
132132
fi
133133
134134
echo "🔍 Checking if the database exists..."
135-
KV_LIST=$(pnpm wrangler kv namespace list)
136135
137-
if echo "$KV_LIST" | jq -e ".[] | select(.title == \"$NAME\")" > /dev/null; then
136+
set +e
137+
KV_LIST=$(pnpm wrangler kv namespace list 2>&1)
138+
STATUS=$?
139+
set -e
140+
141+
if [ $STATUS -ne 0 ]; then
142+
echo "$KV_LIST"
143+
exit 1
144+
fi
145+
146+
if echo "$KV_LIST" | jq -e ".[] | select(.title == \"$NAME\")" >/dev/null; then
138147
echo "✅ Database $NAME already exists."
139148
KV_ID=$(echo "$KV_LIST" | jq -r ".[] | select(.title == \"$NAME\") | .id")
140149
echo "KV_NAMESPACE_ID: $KV_ID"
@@ -161,9 +170,18 @@ jobs:
161170
fi
162171
163172
echo "🔍 Checking if the database exists..."
164-
DB_LIST=$(pnpm wrangler d1 list --json)
165173
166-
if echo "$DB_LIST" | jq -e ".[] | select(.name == \"$NAME\")" > /dev/null; then
174+
set +e
175+
DB_LIST=$(pnpm wrangler d1 list --json 2>&1)
176+
STATUS=$?
177+
set -e
178+
179+
if [ $STATUS -ne 0 ]; then
180+
echo "$DB_LIST"
181+
exit 1
182+
fi
183+
184+
if echo "$DB_LIST" | jq -e ".[] | select(.name == \"$NAME\")" >/dev/null; then
167185
echo "✅ Database $NAME already exists."
168186
D1_ID=$(echo "$DB_LIST" | jq -r ".[] | select(.name == \"$NAME\") | .uuid")
169187
echo "D1_DATABASE_ID: $D1_ID"
@@ -182,7 +200,17 @@ jobs:
182200
working-directory: ./mail-worker
183201
run: |
184202
echo "🚀 Starting deployment..."
185-
pnpm wrangler deploy -c wrangler-action.toml | tee deploy.log | grep -v "https://.*\.workers\.dev" || true
203+
pnpm wrangler deploy -c wrangler-action.toml 2>&1 \
204+
| tee deploy.log \
205+
| grep -v "https://.*\.workers\.dev" \
206+
| sed -E 's/env\.domain .*/env.domain (***)/' \
207+
|| true
208+
209+
DEPLOY_EXIT_CODE=${PIPESTATUS[0]}
210+
if [ $DEPLOY_EXIT_CODE -ne 0 ]; then
211+
exit 1
212+
fi
213+
186214
WORKER_URL=$(grep -o "https://.*\.workers\.dev" deploy.log || echo "")
187215
188216
if [ -n "$WORKER_URL" ]; then
@@ -215,34 +243,6 @@ jobs:
215243
exit 1
216244
fi
217245
218-
- name: 📮 设置邮件接收 / Set up email receiving
219-
run: |
220-
221-
echo "🛠️ Starting email receiving setup..."
222-
223-
WORKER_URL="${CUSTOM_DOMAIN:+https://$CUSTOM_DOMAIN}"
224-
WORKER_URL="${WORKER_URL:-${{ steps.deploy.outputs.worker_url }}}"
225-
226-
HTTP_CODE=$(curl -sL --post301 --post302 --post303 -w "%{http_code}" -o response.txt \
227-
-X POST \
228-
-H "Content-Type: application/json" \
229-
-d "{\"domainList\": $DOMAIN,\"accountId\":\"$CLOUDFLARE_ACCOUNT_ID\",\"token\":\"$CLOUDFLARE_API_TOKEN\",\"workerName\":\"$NAME\"}" \
230-
"$WORKER_URL/api/initForward")
231-
232-
RESPONSE_BODY=$(cat response.txt)
233-
234-
if [ "$RESPONSE_BODY" = "success" ]; then
235-
echo "✅ Setup completed."
236-
exit 0
237-
fi
238-
239-
if [ "$HTTP_CODE" = "200" ] && [ "$RESPONSE_BODY" != "success" ]; then
240-
echo "::error:: Email receiving setup failed: $RESPONSE_BODY"
241-
exit 0
242-
fi
243-
244-
echo "::error:: Email receiving setup failed: $HTTP_CODE $RESPONSE_BODY"
245-
246246
- name: 🗑️ 删除运行记录 / Delete workflow runs
247247
uses: GitRML/delete-workflow-runs@main
248248
continue-on-error: true

mail-vue/src/layout/account/index.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -176,7 +176,7 @@ const addForm = reactive({
176176
})
177177
let skeletonRows = 10
178178
const queryParams = {
179-
size: 10
179+
size: 30
180180
}
181181
182182
const mySelect = ref()

mail-worker/src/api/init-api.js

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,6 @@
11
import app from '../hono/hono';
22
import { dbInit } from '../init/init';
3-
import { initForward } from "../init/forward";
43

54
app.get('/init/:secret', (c) => {
65
return dbInit.init(c);
76
})
8-
9-
app.post('/initForward', async (c) => {
10-
return initForward(c, await c.req.json());
11-
})

mail-worker/src/init/forward.js

Lines changed: 0 additions & 124 deletions
This file was deleted.

0 commit comments

Comments
 (0)