Skip to content

Commit ecf9c56

Browse files
[fix] Proxy headers of GitHub & Lark API
[optimize] upgrade to Node.js 24 & other latest Upstream packages/actions
1 parent 6a44cda commit ecf9c56

7 files changed

Lines changed: 1416 additions & 1362 deletions

File tree

.github/workflows/deploy-production.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ jobs:
1515
packages: write
1616
contents: read
1717
steps:
18-
- uses: actions/checkout@v5
18+
- uses: actions/checkout@v6
1919

2020
- name: Inject Environment variables
2121
run: |
@@ -24,18 +24,18 @@ jobs:
2424
EOF
2525
cp .env.local .env.personal.local
2626
27-
- uses: docker/login-action@v3.5.0
27+
- uses: docker/login-action@v3.6.0
2828
with:
2929
registry: ghcr.io
3030
username: ${{ github.actor }}
3131
password: ${{ github.token }}
3232

33-
- uses: docker/metadata-action@v5.8.0
33+
- uses: docker/metadata-action@v5.10.0
3434
id: meta
3535
with:
3636
images: ghcr.io/${{ github.repository }}
3737

38-
- uses: docker/build-push-action@v6
38+
- uses: docker/build-push-action@v6.18.0
3939
id: push
4040
with:
4141
context: .

.github/workflows/main.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ jobs:
1111
VERCEL_PROJECT_ID: ${{ secrets.VERCEL_PROJECT_ID }}
1212
runs-on: ubuntu-latest
1313
steps:
14-
- uses: actions/checkout@v4
14+
- uses: actions/checkout@v6
1515
if: ${{ env.VERCEL_TOKEN && env.VERCEL_ORG_ID && env.VERCEL_PROJECT_ID }}
1616
with:
1717
submodules: recursive
@@ -31,7 +31,7 @@ jobs:
3131
vercel-args: ${{ github.ref == 'refs/heads/main' && '--prod' || '' }}
3232

3333
- name: Lark notification
34-
uses: foxundermoon/feishu-action@v2
34+
uses: Open-Source-Bazaar/feishu-action@v3
3535
with:
3636
url: ${{ secrets.LARK_CHATBOT_HOOK_URL }}
3737
msg_type: post

package.json

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
"description": "React project scaffold based on TypeScript, Next.js, Bootstrap & Workbox.",
55
"private": true,
66
"engines": {
7-
"node": "22.x"
7+
"node": ">=22"
88
},
99
"dependencies": {
1010
"@emotion/cache": "^11.14.0",
@@ -13,12 +13,12 @@
1313
"@emotion/styled": "^11.14.1",
1414
"@giscus/react": "^3.1.0",
1515
"@koa/bodyparser": "^6.0.0",
16-
"@mui/lab": "^7.0.1-beta.20",
17-
"@mui/material": "^7.3.6",
18-
"@mui/material-nextjs": "^7.3.6",
16+
"@mui/lab": "^7.0.1-beta.21",
17+
"@mui/material": "^7.3.7",
18+
"@mui/material-nextjs": "^7.3.7",
1919
"@passwordless-id/webauthn": "^2.3.1",
20-
"@sentry/nextjs": "^10.32.1",
21-
"file-type": "^21.2.0",
20+
"@sentry/nextjs": "^10.35.0",
21+
"file-type": "^21.3.0",
2222
"idb-keyval": "^6.2.2",
2323
"jsonwebtoken": "^9.0.3",
2424
"koa": "^3.1.1",
@@ -30,11 +30,11 @@
3030
"mobx": "^6.15.0",
3131
"mobx-github": "^0.6.2",
3232
"mobx-i18n": "^0.7.2",
33-
"mobx-lark": "^2.6.3",
33+
"mobx-lark": "^2.6.4",
3434
"mobx-react": "^9.2.1",
3535
"mobx-react-helper": "^0.5.1",
3636
"mobx-restful": "^2.1.4",
37-
"next": "^16.1.1",
37+
"next": "^16.1.4",
3838
"next-pwa": "~5.6.0",
3939
"next-ssr-middleware": "^1.1.0",
4040
"react": "^19.2.3",
@@ -43,25 +43,25 @@
4343
"webpack": "^5.104.1"
4444
},
4545
"devDependencies": {
46-
"@babel/plugin-proposal-decorators": "^7.28.0",
47-
"@babel/plugin-transform-typescript": "^7.28.5",
46+
"@babel/plugin-proposal-decorators": "^7.28.6",
47+
"@babel/plugin-transform-typescript": "^7.28.6",
4848
"@babel/preset-react": "^7.28.5",
49-
"@cspell/eslint-plugin": "^9.4.0",
49+
"@cspell/eslint-plugin": "^9.6.0",
5050
"@eslint/js": "^9.39.2",
5151
"@idea2app/data-server": "^1.0.0-rc.9",
52-
"@next/eslint-plugin-next": "^16.1.1",
53-
"@stylistic/eslint-plugin": "^5.6.1",
52+
"@next/eslint-plugin-next": "^16.1.4",
53+
"@stylistic/eslint-plugin": "^5.7.0",
5454
"@tailwindcss/postcss": "^4.1.18",
5555
"@tailwindcss/typography": "^0.5.19",
5656
"@types/eslint-config-prettier": "^6.11.3",
5757
"@types/jsonwebtoken": "^9.0.10",
5858
"@types/koa": "^3.0.1",
5959
"@types/lodash.debounce": "^4.0.9",
6060
"@types/next-pwa": "^5.6.9",
61-
"@types/node": "^22.19.3",
62-
"@types/react": "^19.2.7",
61+
"@types/node": "^24.10.9",
62+
"@types/react": "^19.2.8",
6363
"eslint": "^9.39.2",
64-
"eslint-config-next": "^16.1.1",
64+
"eslint-config-next": "^16.1.4",
6565
"eslint-config-prettier": "^10.1.8",
6666
"eslint-plugin-react": "^7.37.5",
6767
"eslint-plugin-simple-import-sort": "^12.1.1",
@@ -71,12 +71,12 @@
7171
"jiti": "^2.6.1",
7272
"lint-staged": "^16.2.7",
7373
"postcss": "^8.5.6",
74-
"prettier": "^3.7.4",
75-
"prettier-plugin-css-order": "^2.1.2",
74+
"prettier": "^3.8.0",
75+
"prettier-plugin-css-order": "^2.2.0",
7676
"prettier-plugin-tailwindcss": "^0.7.2",
7777
"tailwindcss": "^4.1.18",
7878
"typescript": "~5.9.3",
79-
"typescript-eslint": "^8.50.1"
79+
"typescript-eslint": "^8.53.1"
8080
},
8181
"resolutions": {
8282
"mobx-github": "$mobx-github",

pages/api/GitHub/[...slug].ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
import { createKoaRouter, withKoaRouter } from 'next-ssr-middleware';
22

3-
import { safeAPI } from '../core';
3+
import { safeAPI, verifyJWT } from '../core';
44
import { proxyGitHubAll } from './core';
55

66
export const config = { api: { bodyParser: false } };
77

88
const router = createKoaRouter(import.meta.url);
99

10-
router.get('/{*slug}', safeAPI, proxyGitHubAll);
10+
router.get('/{*slug}', safeAPI, proxyGitHubAll).all('/{*slug}', safeAPI, verifyJWT, proxyGitHubAll);
1111

1212
export default withKoaRouter(router);

pages/api/GitHub/core.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import { ProxyBaseURL, VERCEL } from '../../../models/configuration';
77
export const proxyGithub = async <T>({
88
method,
99
url,
10-
headers: { host, ...headers },
10+
headers: { host, authorization, 'content-length': _, ...headers },
1111
request,
1212
}: Context) => {
1313
const path = url!.slice(`/api/GitHub/`.length),

pages/api/Lark/core.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ export const lark = new LarkApp(LarkAppMeta);
88
export const proxyLark = async <T extends LarkData>({
99
method,
1010
url,
11-
headers: { host, authorization, ...headers },
11+
headers: { host, authorization, 'content-length': _, ...headers },
1212
request,
1313
}: Context) => {
1414
await lark.getAccessToken();

0 commit comments

Comments
 (0)