Compare commits

5 Commits

Author SHA1 Message Date
33053b4a92 secure: 更新nextjs...
All checks were successful
Deploy to K3s / deploy (push) Successful in 3m34s
2026-01-02 23:55:15 +08:00
1c518b44cc chore: 移除自动迁移...
All checks were successful
Deploy to K3s / deploy (push) Successful in 11s
2025-12-27 14:32:01 +08:00
cd80375cc5 chore: ..
Some checks failed
Deploy to K3s / deploy (push) Failing after 5m6s
2025-12-27 14:26:20 +08:00
c23e822cd6 chore: 尝试用job迁移数据库
Some checks failed
Deploy to K3s / deploy (push) Failing after 35s
2025-12-27 14:22:09 +08:00
375d12ab0f lint: 移除前端未使用的import
Some checks failed
Deploy to K3s / deploy (push) Failing after 2m4s
2025-12-27 14:15:05 +08:00
5 changed files with 564 additions and 320 deletions

View File

@@ -54,55 +54,6 @@ jobs:
-t localhost:5000/frontend:${IMAGE_TAG} .
docker push localhost:5000/frontend:${IMAGE_TAG}
- name: Run database migrations with temporary container
run: |
echo "Running database migrations using backend image: localhost:5000/backend:${IMAGE_TAG}"
echo "Waiting for PostgreSQL service to be ready..."
kubectl wait --for=condition=ready pod -l app=postgres --timeout=30s
# 获取密码等敏感信息
DB_PASSWORD=$(kubectl get secret backend-secret -o jsonpath='{.data.DATABASE_PASSWORD}' | base64 -d)
ALIYUN_ACCESS_KEY_ID=$(kubectl get secret backend-secret -o jsonpath='{.data.ALIYUN_ACCESS_KEY_ID}' | base64 -d)
ALIYUN_ACCESS_KEY_SECRET=$(kubectl get secret backend-secret -o jsonpath='{.data.ALIYUN_ACCESS_KEY_SECRET}' | base64 -d)
ALIYUN_OSS_STS_ROLE_ARN=$(kubectl get secret backend-secret -o jsonpath='{.data.ALIYUN_OSS_STS_ROLE_ARN}' | base64 -d)
JWT_SECRET=$(kubectl get secret backend-secret -o jsonpath='{.data.JWT_SECRET}' | base64 -d)
WEBAUTHN_RP_ID=$(kubectl get secret backend-secret -o jsonpath='{.data.WEBAUTHN_RP_ID}' | base64 -d)
WEBAUTHN_ORIGIN=$(kubectl get secret backend-secret -o jsonpath='{.data.WEBAUTHN_ORIGIN}' | base64 -d)
WEBAUTHN_RP_NAME=$(kubectl get secret backend-secret -o jsonpath='{.data.WEBAUTHN_RP_NAME}' | base64 -d)
# 检查是否成功获取了密码
if [ -z "$DB_PASSWORD" ]; then
echo "Error: Could not retrieve DATABASE_PASSWORD from backend-secret."
exit 1
fi
docker run --rm \
-e NODE_ENV=production \
-e DATABASE_HOST=postgres-service \
-e DATABASE_PORT=5432 \
-e DATABASE_NAME=tone_page \
-e DATABASE_USERNAME=tone_page \
-e DATABASE_PASSWORD="$DB_PASSWORD" \
-e JWT_SECRET="$JWT_SECRET" \
-e JWT_EXPIRES_IN=1d \
-e ALIYUN_ACCESS_KEY_ID="$ALIYUN_ACCESS_KEY_ID" \
-e ALIYUN_ACCESS_KEY_SECRET="$ALIYUN_ACCESS_KEY_SECRET" \
-e ALIYUN_OSS_STS_ROLE_ARN="$ALIYUN_OSS_STS_ROLE_ARN" \
-e WEBAUTHN_RP_ID="$WEBAUTHN_RP_ID" \
-e WEBAUTHN_ORIGIN="$WEBAUTHN_ORIGIN" \
-e WEBAUTHN_RP_NAME="$WEBAUTHN_RP_NAME" \
localhost:5000/backend:${IMAGE_TAG} \
pnpm run migration:run
# 检查上一步命令是否成功
if [ $? -ne 0 ]; then
echo "Database migration failed!"
exit 1
fi
echo "Database migrations completed successfully."
- name: Deploy to K3s
run: |
cd /workspace/tone/tonePage/apps/deploy

View File

@@ -1,4 +1,3 @@
import { base62 } from "@/lib/utils";
import { BlogContent } from "./BlogContent";
import { BlogAPI } from "@/lib/api/server";
import { handleAPIError } from "@/lib/api/common";

View File

@@ -39,8 +39,8 @@
"drawer": "^0.0.2",
"highlight.js": "^11.11.1",
"input-otp": "^1.4.2",
"lucide-react": "^0.503.0",
"next": "15.3.1",
"lucide-react": "^0.562.0",
"next": "16.1.1",
"next-themes": "^0.4.6",
"pagination": "^0.4.6",
"popover": "^2.4.1",
@@ -54,22 +54,22 @@
"remark-gfm": "^4.0.1",
"select": "^1.1.2",
"sonner": "^2.0.7",
"swr": "^2.3.7",
"swr": "^2.3.8",
"tailwind-merge": "^3.4.0",
"textarea": "^0.3.0",
"vaul": "^1.1.2",
"zod": "^3.25.76",
"zod": "^4.3.4",
"zustand": "^5.0.9"
},
"devDependencies": {
"@eslint/eslintrc": "^3.3.3",
"@tanstack/react-table": "^8.21.3",
"@types/node": "^20.19.26",
"@types/node": "^25.0.3",
"@types/react": "^19.2.7",
"@types/react-dom": "^19.2.3",
"@types/webappsec-credential-management": "^0.6.9",
"eslint": "^9.39.1",
"eslint-config-next": "15.3.1",
"eslint": "^9.39.2",
"eslint-config-next": "16.1.1",
"tailwindcss": "^4.1.18",
"tw-animate-css": "^1.4.0",
"typescript": "^5.9.3"

File diff suppressed because it is too large Load Diff

View File

@@ -1,7 +1,11 @@
{
"compilerOptions": {
"target": "ES2017",
"lib": ["dom", "dom.iterable", "esnext"],
"lib": [
"dom",
"dom.iterable",
"esnext"
],
"allowJs": true,
"skipLibCheck": true,
"strict": true,
@@ -11,7 +15,7 @@
"moduleResolution": "bundler",
"resolveJsonModule": true,
"isolatedModules": true,
"jsx": "preserve",
"jsx": "react-jsx",
"incremental": true,
"plugins": [
{
@@ -19,9 +23,19 @@
}
],
"paths": {
"@/*": ["./*"]
"@/*": [
"./*"
]
}
},
"include": ["next-env.d.ts", "**/*.ts", "**/*.tsx", ".next/types/**/*.ts"],
"exclude": ["node_modules"]
"include": [
"next-env.d.ts",
"**/*.ts",
"**/*.tsx",
".next/types/**/*.ts",
".next/dev/types/**/*.ts"
],
"exclude": [
"node_modules"
]
}