Skip to content

Commit a3b885d

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

6 files changed

Lines changed: 1037 additions & 1021 deletions

File tree

.github/workflows/main.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ jobs:
1313
permissions:
1414
contents: write
1515
steps:
16-
- uses: actions/checkout@v5
16+
- uses: actions/checkout@v6
1717
if: ${{ env.VERCEL_TOKEN && env.VERCEL_ORG_ID && env.VERCEL_PROJECT_ID }}
1818

1919
- name: Deploy to Vercel
@@ -29,7 +29,7 @@ jobs:
2929
vercel-args: ${{ github.ref == 'refs/heads/main' && ' --prod' || '' }}
3030

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

package.json

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
"@koa/router": "^15.2.0",
1919
"@mdx-js/loader": "^3.1.1",
2020
"@mdx-js/react": "^3.1.1",
21-
"@next/mdx": "^16.1.1",
21+
"@next/mdx": "^16.1.4",
2222
"core-js": "^3.47.0",
2323
"echarts-jsx": "^0.6.0",
2424
"file-type": "^21.3.0",
@@ -39,7 +39,7 @@
3939
"mobx-restful": "^2.1.4",
4040
"mobx-restful-table": "^2.6.3",
4141
"mobx-strapi": "^0.8.1",
42-
"next": "^16.1.1",
42+
"next": "^16.1.4",
4343
"next-pwa": "^5.6.0",
4444
"next-ssr-middleware": "^1.1.0",
4545
"open-react-map": "^0.9.1",
@@ -53,24 +53,24 @@
5353
"yaml": "^2.8.2"
5454
},
5555
"devDependencies": {
56-
"@babel/plugin-proposal-decorators": "^7.28.0",
57-
"@babel/plugin-transform-typescript": "^7.28.5",
56+
"@babel/plugin-proposal-decorators": "^7.28.6",
57+
"@babel/plugin-transform-typescript": "^7.28.6",
5858
"@babel/preset-react": "^7.28.5",
59-
"@cspell/eslint-plugin": "^9.4.0",
59+
"@cspell/eslint-plugin": "^9.6.0",
6060
"@eslint/js": "^9.39.2",
61-
"@next/eslint-plugin-next": "^16.1.1",
61+
"@next/eslint-plugin-next": "^16.1.4",
6262
"@open-source-bazaar/china-ngo-database": "^0.6.0",
6363
"@softonus/prettier-plugin-duplicate-remover": "^1.1.2",
64-
"@stylistic/eslint-plugin": "^5.6.1",
64+
"@stylistic/eslint-plugin": "^5.7.0",
6565
"@types/eslint-config-prettier": "^6.11.3",
6666
"@types/jsonwebtoken": "^9.0.10",
6767
"@types/koa": "^3.0.1",
6868
"@types/next-pwa": "^5.6.9",
69-
"@types/node": "^22.19.3",
70-
"@types/react": "^19.2.7",
69+
"@types/node": "^24.10.9",
70+
"@types/react": "^19.2.8",
7171
"@types/react-dom": "^19.2.3",
7272
"eslint": "^9.39.2",
73-
"eslint-config-next": "^16.1.1",
73+
"eslint-config-next": "^16.1.4",
7474
"eslint-config-prettier": "^10.1.8",
7575
"eslint-plugin-react": "^7.37.5",
7676
"eslint-plugin-simple-import-sort": "^12.1.1",
@@ -81,11 +81,11 @@
8181
"less-loader": "^12.3.0",
8282
"lint-staged": "^16.2.7",
8383
"next-with-less": "^3.0.1",
84-
"prettier": "^3.7.4",
84+
"prettier": "^3.8.0",
8585
"prettier-plugin-css-order": "^2.2.0",
86-
"sass": "^1.97.1",
86+
"sass": "^1.97.2",
8787
"typescript": "~5.9.3",
88-
"typescript-eslint": "^8.51.0"
88+
"typescript-eslint": "^8.53.1"
8989
},
9090
"resolutions": {
9191
"mobx-react-helper": "$mobx-react-helper",

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: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,6 @@
11
import { Context, Middleware } from 'koa';
22
import { marked } from 'marked';
3-
import {
4-
LarkApp,
5-
LarkData,
6-
normalizeTextArray,
7-
TableCellText,
8-
} from 'mobx-lark';
3+
import { LarkApp, LarkData, normalizeTextArray, TableCellText } from 'mobx-lark';
94

105
import { LarkAppMeta } from '../../../models/configuration';
116

@@ -17,7 +12,7 @@ export const normalizeMarkdownArray = (list: TableCellText[]) =>
1712
export const proxyLark = async <T extends LarkData>({
1813
method,
1914
url,
20-
headers: { host, authorization, ...headers },
15+
headers: { host, authorization, 'content-length': _, ...headers },
2116
request,
2217
}: Context) => {
2318
await lark.getAccessToken();

0 commit comments

Comments
 (0)