@xcanwin/manyoyo 3.9.3 → 3.9.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/web/{static → frontend}/app.html +2 -2
- package/lib/web/{static → frontend}/login.html +2 -2
- package/lib/web/server.js +8 -8
- package/package.json +7 -5
- /package/lib/web/{static → frontend}/app.css +0 -0
- /package/lib/web/{static → frontend}/app.js +0 -0
- /package/lib/web/{static → frontend}/login.css +0 -0
- /package/lib/web/{static → frontend}/login.js +0 -0
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
<meta charset="utf-8" />
|
|
5
5
|
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
|
6
6
|
<title>MANYOYO Web</title>
|
|
7
|
-
<link rel="stylesheet" href="/app/
|
|
7
|
+
<link rel="stylesheet" href="/app/frontend/app.css" />
|
|
8
8
|
</head>
|
|
9
9
|
<body>
|
|
10
10
|
<div class="app">
|
|
@@ -35,6 +35,6 @@
|
|
|
35
35
|
</main>
|
|
36
36
|
</div>
|
|
37
37
|
|
|
38
|
-
<script src="/app/
|
|
38
|
+
<script src="/app/frontend/app.js"></script>
|
|
39
39
|
</body>
|
|
40
40
|
</html>
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
<meta charset="utf-8" />
|
|
5
5
|
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
|
6
6
|
<title>MANYOYO Web Login</title>
|
|
7
|
-
<link rel="stylesheet" href="/auth/
|
|
7
|
+
<link rel="stylesheet" href="/auth/frontend/login.css" />
|
|
8
8
|
</head>
|
|
9
9
|
<body>
|
|
10
10
|
<form class="card" id="loginForm">
|
|
@@ -17,6 +17,6 @@
|
|
|
17
17
|
<button type="submit">登录</button>
|
|
18
18
|
<div class="error" id="error"></div>
|
|
19
19
|
</form>
|
|
20
|
-
<script src="/auth/
|
|
20
|
+
<script src="/auth/frontend/login.js"></script>
|
|
21
21
|
</body>
|
|
22
22
|
</html>
|
package/lib/web/server.js
CHANGED
|
@@ -11,7 +11,7 @@ const WEB_HISTORY_MAX_MESSAGES = 500;
|
|
|
11
11
|
const WEB_OUTPUT_MAX_CHARS = 16000;
|
|
12
12
|
const WEB_AUTH_COOKIE_NAME = 'manyoyo_web_auth';
|
|
13
13
|
const WEB_AUTH_TTL_SECONDS = 12 * 60 * 60;
|
|
14
|
-
const
|
|
14
|
+
const FRONTEND_DIR = path.join(__dirname, 'frontend');
|
|
15
15
|
|
|
16
16
|
const MIME_TYPES = {
|
|
17
17
|
'.css': 'text/css; charset=utf-8',
|
|
@@ -339,7 +339,7 @@ function resolveStaticAsset(name) {
|
|
|
339
339
|
if (!isSafeStaticAssetName(name)) {
|
|
340
340
|
return null;
|
|
341
341
|
}
|
|
342
|
-
const fullPath = path.join(
|
|
342
|
+
const fullPath = path.join(FRONTEND_DIR, name);
|
|
343
343
|
return fs.existsSync(fullPath) ? fullPath : null;
|
|
344
344
|
}
|
|
345
345
|
|
|
@@ -374,9 +374,9 @@ async function handleWebAuthRoutes(req, res, pathname, ctx, state) {
|
|
|
374
374
|
return true;
|
|
375
375
|
}
|
|
376
376
|
|
|
377
|
-
const
|
|
378
|
-
if (req.method === 'GET' &&
|
|
379
|
-
const assetName =
|
|
377
|
+
const authFrontendMatch = pathname.match(/^\/auth\/frontend\/([A-Za-z0-9._-]+)$/);
|
|
378
|
+
if (req.method === 'GET' && authFrontendMatch) {
|
|
379
|
+
const assetName = authFrontendMatch[1];
|
|
380
380
|
if (!(assetName === 'login.css' || assetName === 'login.js')) {
|
|
381
381
|
sendHtml(res, 404, '<h1>404 Not Found</h1>');
|
|
382
382
|
return true;
|
|
@@ -621,9 +621,9 @@ async function startWebServer(options) {
|
|
|
621
621
|
return;
|
|
622
622
|
}
|
|
623
623
|
|
|
624
|
-
const
|
|
625
|
-
if (req.method === 'GET' &&
|
|
626
|
-
const assetName =
|
|
624
|
+
const appFrontendMatch = pathname.match(/^\/app\/frontend\/([A-Za-z0-9._-]+)$/);
|
|
625
|
+
if (req.method === 'GET' && appFrontendMatch) {
|
|
626
|
+
const assetName = appFrontendMatch[1];
|
|
627
627
|
if (!(assetName === 'app.css' || assetName === 'app.js')) {
|
|
628
628
|
sendHtml(res, 404, '<h1>404 Not Found</h1>');
|
|
629
629
|
return;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@xcanwin/manyoyo",
|
|
3
|
-
"version": "3.9.
|
|
3
|
+
"version": "3.9.6",
|
|
4
4
|
"imageVersion": "1.7.3",
|
|
5
5
|
"description": "AI Agent CLI Security Sandbox for Docker and Podman",
|
|
6
6
|
"keywords": [
|
|
@@ -33,9 +33,9 @@
|
|
|
33
33
|
"test": "jest --coverage",
|
|
34
34
|
"test:unit": "jest test/",
|
|
35
35
|
"lint": "echo 'Lint check passed'",
|
|
36
|
-
"docs:dev": "vitepress dev docs --host --port 5173",
|
|
36
|
+
"docs:dev": "vitepress dev docs --host 127.0.0.1 --port 5173",
|
|
37
37
|
"docs:build": "vitepress build docs",
|
|
38
|
-
"docs:preview": "vitepress preview docs --host --port 4173"
|
|
38
|
+
"docs:preview": "vitepress preview docs --host 127.0.0.1 --port 4173"
|
|
39
39
|
},
|
|
40
40
|
"homepage": "https://xcanwin.github.io/manyoyo/",
|
|
41
41
|
"bugs": {
|
|
@@ -58,10 +58,12 @@
|
|
|
58
58
|
},
|
|
59
59
|
"devDependencies": {
|
|
60
60
|
"jest": "^29.7.0",
|
|
61
|
-
"vitepress": "^
|
|
61
|
+
"vitepress": "^2.0.0-alpha.16"
|
|
62
62
|
},
|
|
63
63
|
"jest": {
|
|
64
|
-
"testMatch": [
|
|
64
|
+
"testMatch": [
|
|
65
|
+
"**/test/**/*.test.js"
|
|
66
|
+
],
|
|
65
67
|
"testEnvironment": "node"
|
|
66
68
|
}
|
|
67
69
|
}
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|