@insapp-dev/inslog 0.0.0-stage → 0.1.0
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/LICENSE +26 -0
- package/README.md +66 -2
- package/config/database.example.json +5 -0
- package/config/locale.example.json +3 -0
- package/locales/en.json +476 -0
- package/locales/zh-CN.json +1 -0
- package/next-env.d.ts +7 -0
- package/next.config.ts +10 -0
- package/package.json +62 -4
- package/public/apple-touch-icon.png +0 -0
- package/public/favicon.ico +0 -0
- package/public/icon-color.png +0 -0
- package/public/icon-color.svg +5 -0
- package/public/icon-dark.svg +5 -0
- package/public/icon.svg +5 -0
- package/scripts/_db.mjs +67 -0
- package/scripts/export-backup.mjs +104 -0
- package/scripts/release.sh +70 -0
- package/scripts/seed-demo.mjs +184 -0
- package/scripts/test-connection.mjs +26 -0
- package/src/app/api/auth/logout/route.ts +9 -0
- package/src/app/api/auth/passkey/add-request/route.ts +35 -0
- package/src/app/api/auth/passkey/login/options/route.ts +40 -0
- package/src/app/api/auth/passkey/login/verify/route.ts +58 -0
- package/src/app/api/auth/passkey/register/options/route.ts +46 -0
- package/src/app/api/auth/passkey/register/verify/route.ts +63 -0
- package/src/app/api/auth/passkey/remove-request/route.ts +44 -0
- package/src/app/api/auth/recovery/route.ts +45 -0
- package/src/app/api/auth/totp/disable/route.ts +42 -0
- package/src/app/api/auth/totp/enable/route.ts +75 -0
- package/src/app/api/auth/totp/login/route.ts +47 -0
- package/src/app/api/auth/totp/setup/route.ts +20 -0
- package/src/app/api/setup/complete/route.ts +27 -0
- package/src/app/api/setup/email/route.ts +41 -0
- package/src/app/api/upload/local/route.ts +73 -0
- package/src/app/api/upload/route.ts +73 -0
- package/src/app/api/upload/s3/route.ts +73 -0
- package/src/app/confirm/[token]/page.tsx +181 -0
- package/src/app/globals.css +952 -0
- package/src/app/layout.tsx +107 -0
- package/src/app/login/login-form.tsx +325 -0
- package/src/app/login/page.tsx +76 -0
- package/src/app/not-found.tsx +26 -0
- package/src/app/page.tsx +179 -0
- package/src/app/posts/[slug]/page.tsx +100 -0
- package/src/app/robots.txt/route.ts +25 -0
- package/src/app/rss.xml/route.ts +60 -0
- package/src/app/search/page.tsx +94 -0
- package/src/app/settings/actions.ts +92 -0
- package/src/app/settings/image-field.tsx +143 -0
- package/src/app/settings/language-actions.ts +28 -0
- package/src/app/settings/language-select.tsx +56 -0
- package/src/app/settings/page.tsx +97 -0
- package/src/app/settings/passkey-manager.tsx +194 -0
- package/src/app/settings/site-form.tsx +323 -0
- package/src/app/settings/theme-toggle.tsx +51 -0
- package/src/app/settings/totp-manager.tsx +239 -0
- package/src/app/setup/auth-config-panel.tsx +132 -0
- package/src/app/setup/config-actions.ts +90 -0
- package/src/app/setup/page.tsx +80 -0
- package/src/app/setup/secrets-actions.ts +49 -0
- package/src/app/setup/setup-data.ts +133 -0
- package/src/app/setup/setup-wizard.tsx +338 -0
- package/src/app/sitemap.xml/route.ts +46 -0
- package/src/app/uploads/[...path]/route.ts +64 -0
- package/src/app/write/actions.ts +85 -0
- package/src/app/write/page.tsx +48 -0
- package/src/app/write/write-client.tsx +254 -0
- package/src/components/BlockEditor.tsx +102 -0
- package/src/components/PostBody.tsx +51 -0
- package/src/components/SiteFooter.tsx +41 -0
- package/src/components/WriteFab.tsx +38 -0
- package/src/components/i18n-provider.tsx +22 -0
- package/src/components/install-hint.tsx +31 -0
- package/src/components/service-config-fields.tsx +110 -0
- package/src/lib/auth.ts +41 -0
- package/src/lib/change-request.ts +184 -0
- package/src/lib/config-keys.ts +300 -0
- package/src/lib/credentials.ts +171 -0
- package/src/lib/env-config.ts +39 -0
- package/src/lib/env-store.ts +72 -0
- package/src/lib/i18n-core.ts +27 -0
- package/src/lib/i18n.ts +72 -0
- package/src/lib/image-compress.ts +59 -0
- package/src/lib/mail.ts +121 -0
- package/src/lib/mongodb.ts +236 -0
- package/src/lib/passkey.ts +73 -0
- package/src/lib/pending.ts +142 -0
- package/src/lib/post-utils.ts +56 -0
- package/src/lib/posts.ts +283 -0
- package/src/lib/rate-limit.ts +91 -0
- package/src/lib/recovery-hints.ts +16 -0
- package/src/lib/safe-path.ts +0 -0
- package/src/lib/secret-box.ts +46 -0
- package/src/lib/service-config.ts +25 -0
- package/src/lib/service-features.ts +72 -0
- package/src/lib/session-constants.ts +5 -0
- package/src/lib/session.ts +51 -0
- package/src/lib/settings-file.ts +120 -0
- package/src/lib/settings.ts +199 -0
- package/src/lib/site-url.ts +15 -0
- package/src/lib/slug.ts +53 -0
- package/src/lib/storage.ts +226 -0
- package/src/lib/time.ts +15 -0
- package/src/lib/totp.ts +88 -0
- package/src/lib/types.ts +72 -0
- package/src/lib/upload-client.ts +83 -0
- package/src/lib/xml.ts +12 -0
- package/src/proxy.ts +24 -0
- package/tsconfig.json +41 -0
package/next.config.ts
ADDED
package/package.json
CHANGED
|
@@ -1,6 +1,64 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@insapp-dev/inslog",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"
|
|
5
|
-
"
|
|
6
|
-
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "一个基于 Node.js + Next.js 的 Blog APP:让作者专注于写作,让读者专注于阅读。",
|
|
5
|
+
"license": "MIT",
|
|
6
|
+
"repository": {
|
|
7
|
+
"type": "git",
|
|
8
|
+
"url": "https://github.com/daveswong/inslog.git"
|
|
9
|
+
},
|
|
10
|
+
"homepage": "https://inslog.insapp.tech",
|
|
11
|
+
"files": [
|
|
12
|
+
"README.md",
|
|
13
|
+
"LICENSE",
|
|
14
|
+
"package.json",
|
|
15
|
+
"next.config.ts",
|
|
16
|
+
"next-env.d.ts",
|
|
17
|
+
"tsconfig.json",
|
|
18
|
+
"src/",
|
|
19
|
+
"public/",
|
|
20
|
+
"config/*.example.json",
|
|
21
|
+
"locales/",
|
|
22
|
+
"scripts/"
|
|
23
|
+
],
|
|
24
|
+
"scripts": {
|
|
25
|
+
"dev": "next dev",
|
|
26
|
+
"build": "next build",
|
|
27
|
+
"start": "next start",
|
|
28
|
+
"backup": "node scripts/export-backup.mjs",
|
|
29
|
+
"release": "bash scripts/release.sh"
|
|
30
|
+
},
|
|
31
|
+
"dependencies": {
|
|
32
|
+
"@aws-sdk/client-s3": "^3.1177.0",
|
|
33
|
+
"@aws-sdk/s3-presigned-post": "^3.1177.0",
|
|
34
|
+
"@blocknote/core": "^0.57.0",
|
|
35
|
+
"@blocknote/mantine": "^0.57.0",
|
|
36
|
+
"@blocknote/react": "^0.57.0",
|
|
37
|
+
"@mantine/core": "^9.8.1",
|
|
38
|
+
"@mantine/hooks": "^9.8.1",
|
|
39
|
+
"@simplewebauthn/browser": "^13.3.0",
|
|
40
|
+
"@simplewebauthn/server": "^13.3.3",
|
|
41
|
+
"@vercel/blob": "^2.9.0",
|
|
42
|
+
"bootstrap": "5.3.9",
|
|
43
|
+
"jose": "^6.2.18",
|
|
44
|
+
"mongodb": "^7.9.1",
|
|
45
|
+
"next": "16.4.6",
|
|
46
|
+
"nodemailer": "^10.6.1",
|
|
47
|
+
"otpauth": "^9.6.0",
|
|
48
|
+
"pinyin-pro": "^3.29.5",
|
|
49
|
+
"qrcode": "^1.5.4",
|
|
50
|
+
"react": "19.3.1",
|
|
51
|
+
"react-dom": "19.3.1"
|
|
52
|
+
},
|
|
53
|
+
"devDependencies": {
|
|
54
|
+
"@types/node": "22.15.30",
|
|
55
|
+
"@types/nodemailer": "^8.0.2",
|
|
56
|
+
"@types/qrcode": "^1.5.6",
|
|
57
|
+
"@types/react": "19.3.0",
|
|
58
|
+
"@types/react-dom": "19.1.9",
|
|
59
|
+
"typescript": "5.9.3"
|
|
60
|
+
},
|
|
61
|
+
"engines": {
|
|
62
|
+
"node": ">=20.9.0"
|
|
63
|
+
}
|
|
64
|
+
}
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512" width="512" height="512" role="img" aria-label="ins 连笔字标">
|
|
2
|
+
<defs><linearGradient id="g" x1="1" y1="0" x2="0" y2="1"><stop offset="0" stop-color="#A766C6"/><stop offset="0.48" stop-color="#E0778F"/><stop offset="1" stop-color="#F5A471"/></linearGradient></defs>
|
|
3
|
+
<rect x="16" y="16" width="480" height="480" rx="112" fill="url(#g)"/>
|
|
4
|
+
<path fill-rule="evenodd" fill="#FFFFFF" d="M 322.35 433.95 C 319.28 434.09 317.37 433.95 314.16 433.54 C 310.95 433.13 306.31 432.31 303.10 431.49 C 299.89 430.68 297.98 430.06 294.91 428.63 C 291.84 427.19 287.06 424.40 284.67 422.89 C 282.28 421.39 281.29 420.33 280.57 419.62 C 279.86 418.90 280.78 419.00 280.37 418.59 C 279.96 418.18 279.48 418.53 278.12 417.16 C 276.75 415.80 273.99 412.96 272.18 410.40 C 270.37 407.84 268.15 403.71 267.26 401.80 C 266.38 399.89 267.13 399.75 266.85 398.94 C 266.58 398.12 266.10 398.59 265.62 396.89 C 265.15 395.18 264.33 391.56 263.99 388.70 C 263.65 385.83 263.51 382.55 263.58 379.69 C 263.65 376.82 263.99 374.09 264.40 371.49 C 264.81 368.90 265.28 366.78 266.03 364.12 C 266.78 361.46 267.60 358.59 268.90 355.52 C 270.20 352.45 273.00 347.54 273.82 345.69 C 274.63 343.85 272.72 346.58 273.82 344.46 C 274.91 342.35 278.46 336.68 280.37 333.00 C 282.28 329.31 284.26 324.33 285.28 322.35 C 286.31 320.37 286.31 321.53 286.51 321.12 C 286.72 320.71 285.76 321.73 286.51 319.89 C 287.26 318.05 289.99 312.72 291.02 310.06 C 292.04 307.40 292.45 306.51 292.66 303.92 C 292.86 301.32 292.76 296.65 292.25 294.50 C 291.73 292.35 290.91 291.94 289.58 291.02 C 288.25 290.10 285.83 289.31 284.26 288.97 C 282.69 288.63 281.67 288.76 280.16 288.97 C 278.66 289.17 277.16 289.52 275.25 290.20 C 273.34 290.88 271.70 291.29 268.70 293.06 C 265.69 294.84 260.40 298.42 257.23 300.85 C 254.05 303.27 250.98 306.27 249.65 307.60 C 248.32 308.94 251.70 305.83 249.24 308.83 C 246.78 311.84 239.62 319.34 234.91 325.62 C 230.20 331.90 223.78 342.76 220.98 346.51 C 218.18 350.27 218.46 347.81 218.12 348.15 C 217.77 348.49 218.87 348.22 218.94 348.56 C 219.00 348.90 220.37 347.06 218.53 350.20 C 216.68 353.34 209.92 364.26 207.88 367.40 C 205.83 370.54 207.26 367.33 206.24 369.04 C 205.22 370.74 202.69 376.14 201.73 377.64 C 200.78 379.14 200.78 377.64 200.51 378.05 C 200.23 378.46 200.98 378.46 200.10 380.10 C 199.21 381.73 196.61 385.90 195.18 387.88 C 193.75 389.86 192.31 390.81 191.49 391.97 C 190.68 393.13 190.81 394.16 190.27 394.84 C 189.72 395.52 188.56 395.66 188.22 396.07 C 187.88 396.48 188.49 396.89 188.22 397.30 C 187.95 397.71 187.13 397.84 186.58 398.53 C 186.03 399.21 186.34 399.72 184.94 401.39 C 183.54 403.06 181.29 405.86 178.18 408.56 C 175.08 411.26 168.63 416.14 166.31 417.57 C 163.99 419.00 164.63 416.99 164.26 417.16 C 163.88 417.33 164.33 418.18 164.05 418.59 C 163.78 419.00 164.50 418.70 162.62 419.62 C 160.74 420.54 156.82 422.83 152.79 424.12 C 148.76 425.42 142.55 426.85 138.46 427.40 C 134.36 427.95 131.29 427.60 128.22 427.40 C 125.15 427.19 122.48 426.65 120.03 426.17 C 117.57 425.69 116.00 425.35 113.47 424.53 C 110.95 423.71 107.88 422.62 104.87 421.26 C 101.87 419.89 98.18 417.98 95.45 416.34 C 92.72 414.70 89.99 412.25 88.49 411.43 C 86.99 410.61 87.40 411.70 86.44 411.43 C 85.49 411.15 83.88 410.44 82.76 409.79 C 81.63 409.14 80.81 409.07 79.69 407.54 C 78.56 406.00 76.61 402.55 76.00 400.57 C 75.39 398.59 75.66 397.23 76.00 395.66 C 76.34 394.09 76.99 392.62 78.05 391.15 C 79.11 389.69 81.22 387.77 82.35 386.85 C 83.47 385.93 84.02 386.27 84.81 385.62 C 85.59 384.98 86.14 386.96 87.06 382.96 C 87.98 378.97 89.65 365.56 90.33 361.67 C 91.02 357.77 90.74 362.55 91.15 359.62 C 91.56 356.68 91.77 351.43 92.79 344.05 C 93.82 336.68 96.14 321.53 97.30 315.39 C 98.46 309.24 98.46 310.33 99.75 307.19 C 101.05 304.05 92.25 314.91 105.08 296.55 C 117.91 278.18 163.65 215.18 176.75 197.02 C 189.86 178.87 182.28 189.38 183.71 187.60 C 185.15 185.83 185.08 186.72 185.35 186.38 C 185.62 186.03 183.85 187.81 185.35 185.56 C 186.85 183.30 192.11 175.86 194.36 172.86 C 196.61 169.86 195.04 172.72 198.87 167.54 C 202.69 162.35 213.75 146.51 217.30 141.73 C 220.85 136.96 219.34 139.96 220.16 138.87 C 220.98 137.77 220.78 137.09 222.21 135.18 C 223.65 133.27 227.67 128.83 228.76 127.40 C 229.86 125.97 228.56 126.78 228.76 126.58 C 228.97 126.38 229.72 126.58 229.99 126.17 C 230.27 125.76 229.72 125.28 230.40 124.12 C 231.09 122.96 232.52 121.12 234.09 119.21 C 235.66 117.30 238.46 114.43 239.82 112.66 C 241.19 110.88 241.53 109.45 242.28 108.56 C 243.03 107.67 243.92 107.88 244.33 107.33 C 244.74 106.78 243.92 106.65 244.74 105.28 C 245.56 103.92 248.22 100.37 249.24 99.14 C 250.27 97.91 250.47 98.46 250.88 97.91 C 251.29 97.37 249.99 98.25 251.70 95.86 C 253.41 93.47 259.04 86.14 261.12 83.58 C 263.20 81.02 262.86 81.43 264.19 80.51 C 265.52 79.58 267.67 78.46 269.11 78.05 C 270.54 77.64 271.70 77.91 272.79 78.05 C 273.88 78.18 274.40 78.15 275.66 78.87 C 276.92 79.58 279.31 81.29 280.37 82.35 C 281.43 83.41 281.60 84.19 282.01 85.22 C 282.42 86.24 282.76 87.06 282.83 88.49 C 282.89 89.92 287.95 79.69 282.42 93.82 C 276.89 107.95 263.30 139.55 249.65 173.27 C 236.00 206.99 209.24 274.57 200.51 296.14 C 191.77 317.71 198.18 300.37 197.23 302.69 C 196.27 305.01 197.37 303.65 194.77 310.06 C 192.18 316.48 184.12 335.73 181.67 341.19 C 179.21 346.65 180.23 342.35 180.03 342.83 C 179.82 343.30 180.85 342.96 180.44 344.05 C 180.03 345.15 178.73 346.72 177.57 349.38 C 176.41 352.04 174.74 357.54 173.47 360.03 C 172.21 362.52 171.80 362.86 169.99 364.33 C 168.18 365.80 164.26 368.01 162.62 368.83 C 160.98 369.65 160.64 369.31 160.16 369.24 C 159.69 369.17 159.86 368.32 159.75 368.42 C 159.65 368.53 159.82 369.45 159.55 369.86 C 159.28 370.27 159.99 369.89 158.12 370.88 C 156.24 371.87 150.61 374.77 148.29 375.80 C 145.97 376.82 144.94 376.68 144.19 377.02 C 143.44 377.37 144.67 377.30 143.78 377.84 C 142.89 378.39 139.89 379.89 138.87 380.30 C 137.84 380.71 138.18 380.03 137.64 380.30 C 137.09 380.57 136.55 381.53 135.59 381.94 C 134.63 382.35 132.59 382.48 131.90 382.76 C 131.22 383.03 132.31 383.17 131.49 383.58 C 130.68 383.99 128.42 384.46 126.99 385.22 C 125.56 385.97 125.35 386.85 122.89 388.08 C 120.44 389.31 114.09 391.70 112.25 392.59 C 110.40 393.47 112.11 393.27 111.84 393.41 C 111.56 393.54 110.95 393.20 110.61 393.41 C 110.27 393.61 110.47 394.23 109.79 394.63 C 109.11 395.04 107.16 395.28 106.51 395.86 C 105.86 396.44 105.69 397.37 105.90 398.12 C 106.10 398.87 106.89 399.79 107.74 400.37 C 108.59 400.95 110.27 401.19 111.02 401.60 C 111.77 402.01 111.56 402.55 112.25 402.83 C 112.93 403.10 114.23 402.96 115.11 403.24 C 116.00 403.51 115.32 403.92 117.57 404.46 C 119.82 405.01 125.56 406.17 128.63 406.51 C 131.70 406.85 132.38 407.26 136.00 406.51 C 139.62 405.76 146.10 403.92 150.33 402.01 C 154.57 400.10 158.08 397.67 161.39 395.04 C 164.70 392.42 167.77 388.94 170.20 386.24 C 172.62 383.54 173.20 382.83 175.93 378.87 C 178.66 374.91 183.92 366.92 186.58 362.48 C 189.24 358.05 188.01 358.73 191.90 352.25 C 195.80 345.76 204.87 331.29 209.92 323.58 C 214.98 315.86 218.32 311.09 222.21 305.97 C 226.10 300.85 229.34 296.99 233.27 292.86 C 237.19 288.73 242.38 284.02 245.76 281.19 C 249.14 278.35 250.95 277.43 253.54 275.86 C 256.14 274.29 258.80 272.93 261.32 271.77 C 263.85 270.61 266.38 269.65 268.70 268.90 C 271.02 268.15 272.11 267.60 275.25 267.26 C 278.39 266.92 283.92 266.51 287.54 266.85 C 291.15 267.19 294.57 268.49 296.96 269.31 C 299.34 270.13 300.57 271.02 301.87 271.77 C 303.17 272.52 303.41 272.55 304.74 273.82 C 306.07 275.08 308.39 277.26 309.86 279.34 C 311.32 281.43 312.72 284.46 313.54 286.31 C 314.36 288.15 314.43 288.97 314.77 290.40 C 315.11 291.84 315.45 292.52 315.59 294.91 C 315.73 297.30 315.93 301.32 315.59 304.74 C 315.25 308.15 314.36 312.25 313.54 315.39 C 312.72 318.53 312.79 318.94 310.68 323.58 C 308.56 328.22 303.03 339.21 300.85 343.24 C 298.66 347.26 299.28 344.67 297.57 347.74 C 295.86 350.81 292.25 358.05 290.61 361.67 C 288.97 365.28 288.49 366.44 287.74 369.45 C 286.99 372.45 286.51 377.91 286.10 379.69 C 285.69 381.46 285.28 379.96 285.28 380.10 C 285.28 380.23 285.97 379.14 286.10 380.51 C 286.24 381.87 285.90 386.31 286.10 388.29 C 286.31 390.27 286.85 391.09 287.33 392.38 C 287.81 393.68 287.71 394.12 288.97 396.07 C 290.23 398.01 293.71 402.72 294.91 404.05 C 296.10 405.39 295.73 403.71 296.14 404.05 C 296.55 404.40 296.96 405.83 297.37 406.10 C 297.77 406.38 297.71 405.35 298.59 405.69 C 299.48 406.03 301.26 407.47 302.69 408.15 C 304.12 408.83 304.87 409.24 307.19 409.79 C 309.52 410.33 313.88 411.15 316.61 411.43 C 319.34 411.70 320.23 411.97 323.58 411.43 C 326.92 410.88 333.34 409.24 336.68 408.15 C 340.03 407.06 341.12 406.38 343.65 404.87 C 346.17 403.37 349.41 401.43 351.84 399.14 C 354.26 396.85 356.72 393.65 358.18 391.15 C 359.65 388.66 360.30 386.31 360.64 384.19 C 360.98 382.08 360.71 380.37 360.23 378.46 C 359.75 376.55 360.51 376.41 357.77 372.72 C 355.04 369.04 346.65 359.96 343.85 356.34 C 341.05 352.72 341.94 353.41 340.98 351.02 C 340.03 348.63 338.66 345.76 338.12 342.01 C 337.57 338.25 337.64 331.56 337.71 328.49 C 337.77 325.42 337.91 325.76 338.53 323.58 C 339.14 321.39 340.44 317.64 341.39 315.39 C 342.35 313.13 342.62 312.52 344.26 310.06 C 345.90 307.60 349.62 302.66 351.22 300.64 C 352.83 298.63 353.10 298.56 353.88 297.98 C 354.67 297.40 355.56 297.47 355.93 297.16 C 356.31 296.85 355.32 296.96 356.14 296.14 C 356.96 295.32 359.11 293.51 360.85 292.25 C 362.59 290.98 363.58 290.13 366.58 288.56 C 369.58 286.99 375.32 284.19 378.87 282.83 C 382.42 281.46 385.08 280.98 387.88 280.37 C 390.68 279.75 392.38 279.41 395.66 279.14 C 398.94 278.87 404.05 278.66 407.54 278.73 C 411.02 278.80 412.93 278.80 416.55 279.55 C 420.16 280.30 426.34 281.97 429.24 283.24 C 432.14 284.50 432.89 285.86 433.95 287.13 C 435.01 288.39 435.25 289.52 435.59 290.81 C 435.93 292.11 436.20 293.41 436.00 294.91 C 435.80 296.41 435.15 298.49 434.36 299.82 C 433.58 301.15 432.35 302.18 431.29 302.89 C 430.23 303.61 429.17 303.92 428.01 304.12 C 426.85 304.33 425.97 304.53 424.33 304.12 C 422.69 303.71 420.23 302.28 418.18 301.67 C 416.14 301.05 414.84 300.71 412.04 300.44 C 409.24 300.16 404.60 299.89 401.39 300.03 C 398.18 300.16 395.25 300.71 392.79 301.26 C 390.33 301.80 389.45 302.01 386.65 303.30 C 383.85 304.60 378.90 307.09 376.00 309.04 C 373.10 310.98 371.05 313.10 369.24 314.98 C 367.43 316.85 366.51 317.91 365.15 320.30 C 363.78 322.69 361.80 326.72 361.05 329.31 C 360.30 331.90 360.51 333.82 360.64 335.86 C 360.78 337.91 361.26 339.82 361.87 341.60 C 362.48 343.37 361.73 342.96 364.33 346.51 C 366.92 350.06 374.70 359.14 377.43 362.89 C 380.16 366.65 379.82 366.85 380.71 369.04 C 381.60 371.22 382.35 373.34 382.76 376.00 C 383.17 378.66 383.24 382.69 383.17 385.01 C 383.10 387.33 382.83 388.01 382.35 389.92 C 381.87 391.84 381.05 394.57 380.30 396.48 C 379.55 398.39 378.46 400.51 377.84 401.39 C 377.23 402.28 376.82 401.46 376.61 401.80 C 376.41 402.14 377.16 402.35 376.61 403.44 C 376.07 404.53 375.28 406.07 373.34 408.35 C 371.39 410.64 367.98 414.53 364.94 417.16 C 361.90 419.79 357.77 422.42 355.11 424.12 C 352.45 425.83 351.43 426.31 348.97 427.40 C 346.51 428.49 343.10 429.79 340.37 430.68 C 337.64 431.56 335.59 432.18 332.59 432.72 C 329.58 433.27 325.42 433.82 322.35 433.95 Z M 135.39 351.84 C 136.89 351.56 137.57 351.36 138.87 350.40 C 140.16 349.45 141.97 347.84 143.17 346.10 C 144.36 344.36 145.28 342.21 146.03 339.96 C 146.78 337.71 147.47 334.50 147.67 332.59 C 147.88 330.68 147.67 329.86 147.26 328.49 C 146.85 327.13 146.07 325.52 145.22 324.40 C 144.36 323.27 143.41 322.45 142.14 321.73 C 140.88 321.02 139.41 320.16 137.64 320.10 C 135.86 320.03 133.44 320.27 131.49 321.32 C 129.55 322.38 127.50 323.47 125.97 326.44 C 124.43 329.41 122.83 335.80 122.28 339.14 C 121.73 342.48 122.35 345.01 122.69 346.51 C 123.03 348.01 123.95 347.57 124.33 348.15 C 124.70 348.73 124.02 349.34 124.94 349.99 C 125.86 350.64 128.12 351.73 129.86 352.04 C 131.60 352.35 133.88 352.11 135.39 351.84 Z M 366.78 353.88 C 367.02 353.92 368.05 353.58 368.01 353.47 C 367.98 353.37 366.78 353.20 366.58 353.27 C 366.38 353.34 366.55 353.85 366.78 353.88 Z"/>
|
|
5
|
+
</svg>
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512" width="512" height="512" role="img" aria-label="ins 连笔字标">
|
|
2
|
+
|
|
3
|
+
<rect x="16" y="16" width="480" height="480" rx="112" fill="#3A3740"/>
|
|
4
|
+
<path fill-rule="evenodd" fill="#FFFFFF" d="M 322.35 433.95 C 319.28 434.09 317.37 433.95 314.16 433.54 C 310.95 433.13 306.31 432.31 303.10 431.49 C 299.89 430.68 297.98 430.06 294.91 428.63 C 291.84 427.19 287.06 424.40 284.67 422.89 C 282.28 421.39 281.29 420.33 280.57 419.62 C 279.86 418.90 280.78 419.00 280.37 418.59 C 279.96 418.18 279.48 418.53 278.12 417.16 C 276.75 415.80 273.99 412.96 272.18 410.40 C 270.37 407.84 268.15 403.71 267.26 401.80 C 266.38 399.89 267.13 399.75 266.85 398.94 C 266.58 398.12 266.10 398.59 265.62 396.89 C 265.15 395.18 264.33 391.56 263.99 388.70 C 263.65 385.83 263.51 382.55 263.58 379.69 C 263.65 376.82 263.99 374.09 264.40 371.49 C 264.81 368.90 265.28 366.78 266.03 364.12 C 266.78 361.46 267.60 358.59 268.90 355.52 C 270.20 352.45 273.00 347.54 273.82 345.69 C 274.63 343.85 272.72 346.58 273.82 344.46 C 274.91 342.35 278.46 336.68 280.37 333.00 C 282.28 329.31 284.26 324.33 285.28 322.35 C 286.31 320.37 286.31 321.53 286.51 321.12 C 286.72 320.71 285.76 321.73 286.51 319.89 C 287.26 318.05 289.99 312.72 291.02 310.06 C 292.04 307.40 292.45 306.51 292.66 303.92 C 292.86 301.32 292.76 296.65 292.25 294.50 C 291.73 292.35 290.91 291.94 289.58 291.02 C 288.25 290.10 285.83 289.31 284.26 288.97 C 282.69 288.63 281.67 288.76 280.16 288.97 C 278.66 289.17 277.16 289.52 275.25 290.20 C 273.34 290.88 271.70 291.29 268.70 293.06 C 265.69 294.84 260.40 298.42 257.23 300.85 C 254.05 303.27 250.98 306.27 249.65 307.60 C 248.32 308.94 251.70 305.83 249.24 308.83 C 246.78 311.84 239.62 319.34 234.91 325.62 C 230.20 331.90 223.78 342.76 220.98 346.51 C 218.18 350.27 218.46 347.81 218.12 348.15 C 217.77 348.49 218.87 348.22 218.94 348.56 C 219.00 348.90 220.37 347.06 218.53 350.20 C 216.68 353.34 209.92 364.26 207.88 367.40 C 205.83 370.54 207.26 367.33 206.24 369.04 C 205.22 370.74 202.69 376.14 201.73 377.64 C 200.78 379.14 200.78 377.64 200.51 378.05 C 200.23 378.46 200.98 378.46 200.10 380.10 C 199.21 381.73 196.61 385.90 195.18 387.88 C 193.75 389.86 192.31 390.81 191.49 391.97 C 190.68 393.13 190.81 394.16 190.27 394.84 C 189.72 395.52 188.56 395.66 188.22 396.07 C 187.88 396.48 188.49 396.89 188.22 397.30 C 187.95 397.71 187.13 397.84 186.58 398.53 C 186.03 399.21 186.34 399.72 184.94 401.39 C 183.54 403.06 181.29 405.86 178.18 408.56 C 175.08 411.26 168.63 416.14 166.31 417.57 C 163.99 419.00 164.63 416.99 164.26 417.16 C 163.88 417.33 164.33 418.18 164.05 418.59 C 163.78 419.00 164.50 418.70 162.62 419.62 C 160.74 420.54 156.82 422.83 152.79 424.12 C 148.76 425.42 142.55 426.85 138.46 427.40 C 134.36 427.95 131.29 427.60 128.22 427.40 C 125.15 427.19 122.48 426.65 120.03 426.17 C 117.57 425.69 116.00 425.35 113.47 424.53 C 110.95 423.71 107.88 422.62 104.87 421.26 C 101.87 419.89 98.18 417.98 95.45 416.34 C 92.72 414.70 89.99 412.25 88.49 411.43 C 86.99 410.61 87.40 411.70 86.44 411.43 C 85.49 411.15 83.88 410.44 82.76 409.79 C 81.63 409.14 80.81 409.07 79.69 407.54 C 78.56 406.00 76.61 402.55 76.00 400.57 C 75.39 398.59 75.66 397.23 76.00 395.66 C 76.34 394.09 76.99 392.62 78.05 391.15 C 79.11 389.69 81.22 387.77 82.35 386.85 C 83.47 385.93 84.02 386.27 84.81 385.62 C 85.59 384.98 86.14 386.96 87.06 382.96 C 87.98 378.97 89.65 365.56 90.33 361.67 C 91.02 357.77 90.74 362.55 91.15 359.62 C 91.56 356.68 91.77 351.43 92.79 344.05 C 93.82 336.68 96.14 321.53 97.30 315.39 C 98.46 309.24 98.46 310.33 99.75 307.19 C 101.05 304.05 92.25 314.91 105.08 296.55 C 117.91 278.18 163.65 215.18 176.75 197.02 C 189.86 178.87 182.28 189.38 183.71 187.60 C 185.15 185.83 185.08 186.72 185.35 186.38 C 185.62 186.03 183.85 187.81 185.35 185.56 C 186.85 183.30 192.11 175.86 194.36 172.86 C 196.61 169.86 195.04 172.72 198.87 167.54 C 202.69 162.35 213.75 146.51 217.30 141.73 C 220.85 136.96 219.34 139.96 220.16 138.87 C 220.98 137.77 220.78 137.09 222.21 135.18 C 223.65 133.27 227.67 128.83 228.76 127.40 C 229.86 125.97 228.56 126.78 228.76 126.58 C 228.97 126.38 229.72 126.58 229.99 126.17 C 230.27 125.76 229.72 125.28 230.40 124.12 C 231.09 122.96 232.52 121.12 234.09 119.21 C 235.66 117.30 238.46 114.43 239.82 112.66 C 241.19 110.88 241.53 109.45 242.28 108.56 C 243.03 107.67 243.92 107.88 244.33 107.33 C 244.74 106.78 243.92 106.65 244.74 105.28 C 245.56 103.92 248.22 100.37 249.24 99.14 C 250.27 97.91 250.47 98.46 250.88 97.91 C 251.29 97.37 249.99 98.25 251.70 95.86 C 253.41 93.47 259.04 86.14 261.12 83.58 C 263.20 81.02 262.86 81.43 264.19 80.51 C 265.52 79.58 267.67 78.46 269.11 78.05 C 270.54 77.64 271.70 77.91 272.79 78.05 C 273.88 78.18 274.40 78.15 275.66 78.87 C 276.92 79.58 279.31 81.29 280.37 82.35 C 281.43 83.41 281.60 84.19 282.01 85.22 C 282.42 86.24 282.76 87.06 282.83 88.49 C 282.89 89.92 287.95 79.69 282.42 93.82 C 276.89 107.95 263.30 139.55 249.65 173.27 C 236.00 206.99 209.24 274.57 200.51 296.14 C 191.77 317.71 198.18 300.37 197.23 302.69 C 196.27 305.01 197.37 303.65 194.77 310.06 C 192.18 316.48 184.12 335.73 181.67 341.19 C 179.21 346.65 180.23 342.35 180.03 342.83 C 179.82 343.30 180.85 342.96 180.44 344.05 C 180.03 345.15 178.73 346.72 177.57 349.38 C 176.41 352.04 174.74 357.54 173.47 360.03 C 172.21 362.52 171.80 362.86 169.99 364.33 C 168.18 365.80 164.26 368.01 162.62 368.83 C 160.98 369.65 160.64 369.31 160.16 369.24 C 159.69 369.17 159.86 368.32 159.75 368.42 C 159.65 368.53 159.82 369.45 159.55 369.86 C 159.28 370.27 159.99 369.89 158.12 370.88 C 156.24 371.87 150.61 374.77 148.29 375.80 C 145.97 376.82 144.94 376.68 144.19 377.02 C 143.44 377.37 144.67 377.30 143.78 377.84 C 142.89 378.39 139.89 379.89 138.87 380.30 C 137.84 380.71 138.18 380.03 137.64 380.30 C 137.09 380.57 136.55 381.53 135.59 381.94 C 134.63 382.35 132.59 382.48 131.90 382.76 C 131.22 383.03 132.31 383.17 131.49 383.58 C 130.68 383.99 128.42 384.46 126.99 385.22 C 125.56 385.97 125.35 386.85 122.89 388.08 C 120.44 389.31 114.09 391.70 112.25 392.59 C 110.40 393.47 112.11 393.27 111.84 393.41 C 111.56 393.54 110.95 393.20 110.61 393.41 C 110.27 393.61 110.47 394.23 109.79 394.63 C 109.11 395.04 107.16 395.28 106.51 395.86 C 105.86 396.44 105.69 397.37 105.90 398.12 C 106.10 398.87 106.89 399.79 107.74 400.37 C 108.59 400.95 110.27 401.19 111.02 401.60 C 111.77 402.01 111.56 402.55 112.25 402.83 C 112.93 403.10 114.23 402.96 115.11 403.24 C 116.00 403.51 115.32 403.92 117.57 404.46 C 119.82 405.01 125.56 406.17 128.63 406.51 C 131.70 406.85 132.38 407.26 136.00 406.51 C 139.62 405.76 146.10 403.92 150.33 402.01 C 154.57 400.10 158.08 397.67 161.39 395.04 C 164.70 392.42 167.77 388.94 170.20 386.24 C 172.62 383.54 173.20 382.83 175.93 378.87 C 178.66 374.91 183.92 366.92 186.58 362.48 C 189.24 358.05 188.01 358.73 191.90 352.25 C 195.80 345.76 204.87 331.29 209.92 323.58 C 214.98 315.86 218.32 311.09 222.21 305.97 C 226.10 300.85 229.34 296.99 233.27 292.86 C 237.19 288.73 242.38 284.02 245.76 281.19 C 249.14 278.35 250.95 277.43 253.54 275.86 C 256.14 274.29 258.80 272.93 261.32 271.77 C 263.85 270.61 266.38 269.65 268.70 268.90 C 271.02 268.15 272.11 267.60 275.25 267.26 C 278.39 266.92 283.92 266.51 287.54 266.85 C 291.15 267.19 294.57 268.49 296.96 269.31 C 299.34 270.13 300.57 271.02 301.87 271.77 C 303.17 272.52 303.41 272.55 304.74 273.82 C 306.07 275.08 308.39 277.26 309.86 279.34 C 311.32 281.43 312.72 284.46 313.54 286.31 C 314.36 288.15 314.43 288.97 314.77 290.40 C 315.11 291.84 315.45 292.52 315.59 294.91 C 315.73 297.30 315.93 301.32 315.59 304.74 C 315.25 308.15 314.36 312.25 313.54 315.39 C 312.72 318.53 312.79 318.94 310.68 323.58 C 308.56 328.22 303.03 339.21 300.85 343.24 C 298.66 347.26 299.28 344.67 297.57 347.74 C 295.86 350.81 292.25 358.05 290.61 361.67 C 288.97 365.28 288.49 366.44 287.74 369.45 C 286.99 372.45 286.51 377.91 286.10 379.69 C 285.69 381.46 285.28 379.96 285.28 380.10 C 285.28 380.23 285.97 379.14 286.10 380.51 C 286.24 381.87 285.90 386.31 286.10 388.29 C 286.31 390.27 286.85 391.09 287.33 392.38 C 287.81 393.68 287.71 394.12 288.97 396.07 C 290.23 398.01 293.71 402.72 294.91 404.05 C 296.10 405.39 295.73 403.71 296.14 404.05 C 296.55 404.40 296.96 405.83 297.37 406.10 C 297.77 406.38 297.71 405.35 298.59 405.69 C 299.48 406.03 301.26 407.47 302.69 408.15 C 304.12 408.83 304.87 409.24 307.19 409.79 C 309.52 410.33 313.88 411.15 316.61 411.43 C 319.34 411.70 320.23 411.97 323.58 411.43 C 326.92 410.88 333.34 409.24 336.68 408.15 C 340.03 407.06 341.12 406.38 343.65 404.87 C 346.17 403.37 349.41 401.43 351.84 399.14 C 354.26 396.85 356.72 393.65 358.18 391.15 C 359.65 388.66 360.30 386.31 360.64 384.19 C 360.98 382.08 360.71 380.37 360.23 378.46 C 359.75 376.55 360.51 376.41 357.77 372.72 C 355.04 369.04 346.65 359.96 343.85 356.34 C 341.05 352.72 341.94 353.41 340.98 351.02 C 340.03 348.63 338.66 345.76 338.12 342.01 C 337.57 338.25 337.64 331.56 337.71 328.49 C 337.77 325.42 337.91 325.76 338.53 323.58 C 339.14 321.39 340.44 317.64 341.39 315.39 C 342.35 313.13 342.62 312.52 344.26 310.06 C 345.90 307.60 349.62 302.66 351.22 300.64 C 352.83 298.63 353.10 298.56 353.88 297.98 C 354.67 297.40 355.56 297.47 355.93 297.16 C 356.31 296.85 355.32 296.96 356.14 296.14 C 356.96 295.32 359.11 293.51 360.85 292.25 C 362.59 290.98 363.58 290.13 366.58 288.56 C 369.58 286.99 375.32 284.19 378.87 282.83 C 382.42 281.46 385.08 280.98 387.88 280.37 C 390.68 279.75 392.38 279.41 395.66 279.14 C 398.94 278.87 404.05 278.66 407.54 278.73 C 411.02 278.80 412.93 278.80 416.55 279.55 C 420.16 280.30 426.34 281.97 429.24 283.24 C 432.14 284.50 432.89 285.86 433.95 287.13 C 435.01 288.39 435.25 289.52 435.59 290.81 C 435.93 292.11 436.20 293.41 436.00 294.91 C 435.80 296.41 435.15 298.49 434.36 299.82 C 433.58 301.15 432.35 302.18 431.29 302.89 C 430.23 303.61 429.17 303.92 428.01 304.12 C 426.85 304.33 425.97 304.53 424.33 304.12 C 422.69 303.71 420.23 302.28 418.18 301.67 C 416.14 301.05 414.84 300.71 412.04 300.44 C 409.24 300.16 404.60 299.89 401.39 300.03 C 398.18 300.16 395.25 300.71 392.79 301.26 C 390.33 301.80 389.45 302.01 386.65 303.30 C 383.85 304.60 378.90 307.09 376.00 309.04 C 373.10 310.98 371.05 313.10 369.24 314.98 C 367.43 316.85 366.51 317.91 365.15 320.30 C 363.78 322.69 361.80 326.72 361.05 329.31 C 360.30 331.90 360.51 333.82 360.64 335.86 C 360.78 337.91 361.26 339.82 361.87 341.60 C 362.48 343.37 361.73 342.96 364.33 346.51 C 366.92 350.06 374.70 359.14 377.43 362.89 C 380.16 366.65 379.82 366.85 380.71 369.04 C 381.60 371.22 382.35 373.34 382.76 376.00 C 383.17 378.66 383.24 382.69 383.17 385.01 C 383.10 387.33 382.83 388.01 382.35 389.92 C 381.87 391.84 381.05 394.57 380.30 396.48 C 379.55 398.39 378.46 400.51 377.84 401.39 C 377.23 402.28 376.82 401.46 376.61 401.80 C 376.41 402.14 377.16 402.35 376.61 403.44 C 376.07 404.53 375.28 406.07 373.34 408.35 C 371.39 410.64 367.98 414.53 364.94 417.16 C 361.90 419.79 357.77 422.42 355.11 424.12 C 352.45 425.83 351.43 426.31 348.97 427.40 C 346.51 428.49 343.10 429.79 340.37 430.68 C 337.64 431.56 335.59 432.18 332.59 432.72 C 329.58 433.27 325.42 433.82 322.35 433.95 Z M 135.39 351.84 C 136.89 351.56 137.57 351.36 138.87 350.40 C 140.16 349.45 141.97 347.84 143.17 346.10 C 144.36 344.36 145.28 342.21 146.03 339.96 C 146.78 337.71 147.47 334.50 147.67 332.59 C 147.88 330.68 147.67 329.86 147.26 328.49 C 146.85 327.13 146.07 325.52 145.22 324.40 C 144.36 323.27 143.41 322.45 142.14 321.73 C 140.88 321.02 139.41 320.16 137.64 320.10 C 135.86 320.03 133.44 320.27 131.49 321.32 C 129.55 322.38 127.50 323.47 125.97 326.44 C 124.43 329.41 122.83 335.80 122.28 339.14 C 121.73 342.48 122.35 345.01 122.69 346.51 C 123.03 348.01 123.95 347.57 124.33 348.15 C 124.70 348.73 124.02 349.34 124.94 349.99 C 125.86 350.64 128.12 351.73 129.86 352.04 C 131.60 352.35 133.88 352.11 135.39 351.84 Z M 366.78 353.88 C 367.02 353.92 368.05 353.58 368.01 353.47 C 367.98 353.37 366.78 353.20 366.58 353.27 C 366.38 353.34 366.55 353.85 366.78 353.88 Z"/>
|
|
5
|
+
</svg>
|
package/public/icon.svg
ADDED
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512" width="512" height="512" role="img" aria-label="ins 连笔字标">
|
|
2
|
+
|
|
3
|
+
<rect x="16" y="16" width="480" height="480" rx="112" fill="#FFFFFF" stroke="#B2AFA9" stroke-width="3"/>
|
|
4
|
+
<path fill-rule="evenodd" fill="#3A3740" d="M 322.35 433.95 C 319.28 434.09 317.37 433.95 314.16 433.54 C 310.95 433.13 306.31 432.31 303.10 431.49 C 299.89 430.68 297.98 430.06 294.91 428.63 C 291.84 427.19 287.06 424.40 284.67 422.89 C 282.28 421.39 281.29 420.33 280.57 419.62 C 279.86 418.90 280.78 419.00 280.37 418.59 C 279.96 418.18 279.48 418.53 278.12 417.16 C 276.75 415.80 273.99 412.96 272.18 410.40 C 270.37 407.84 268.15 403.71 267.26 401.80 C 266.38 399.89 267.13 399.75 266.85 398.94 C 266.58 398.12 266.10 398.59 265.62 396.89 C 265.15 395.18 264.33 391.56 263.99 388.70 C 263.65 385.83 263.51 382.55 263.58 379.69 C 263.65 376.82 263.99 374.09 264.40 371.49 C 264.81 368.90 265.28 366.78 266.03 364.12 C 266.78 361.46 267.60 358.59 268.90 355.52 C 270.20 352.45 273.00 347.54 273.82 345.69 C 274.63 343.85 272.72 346.58 273.82 344.46 C 274.91 342.35 278.46 336.68 280.37 333.00 C 282.28 329.31 284.26 324.33 285.28 322.35 C 286.31 320.37 286.31 321.53 286.51 321.12 C 286.72 320.71 285.76 321.73 286.51 319.89 C 287.26 318.05 289.99 312.72 291.02 310.06 C 292.04 307.40 292.45 306.51 292.66 303.92 C 292.86 301.32 292.76 296.65 292.25 294.50 C 291.73 292.35 290.91 291.94 289.58 291.02 C 288.25 290.10 285.83 289.31 284.26 288.97 C 282.69 288.63 281.67 288.76 280.16 288.97 C 278.66 289.17 277.16 289.52 275.25 290.20 C 273.34 290.88 271.70 291.29 268.70 293.06 C 265.69 294.84 260.40 298.42 257.23 300.85 C 254.05 303.27 250.98 306.27 249.65 307.60 C 248.32 308.94 251.70 305.83 249.24 308.83 C 246.78 311.84 239.62 319.34 234.91 325.62 C 230.20 331.90 223.78 342.76 220.98 346.51 C 218.18 350.27 218.46 347.81 218.12 348.15 C 217.77 348.49 218.87 348.22 218.94 348.56 C 219.00 348.90 220.37 347.06 218.53 350.20 C 216.68 353.34 209.92 364.26 207.88 367.40 C 205.83 370.54 207.26 367.33 206.24 369.04 C 205.22 370.74 202.69 376.14 201.73 377.64 C 200.78 379.14 200.78 377.64 200.51 378.05 C 200.23 378.46 200.98 378.46 200.10 380.10 C 199.21 381.73 196.61 385.90 195.18 387.88 C 193.75 389.86 192.31 390.81 191.49 391.97 C 190.68 393.13 190.81 394.16 190.27 394.84 C 189.72 395.52 188.56 395.66 188.22 396.07 C 187.88 396.48 188.49 396.89 188.22 397.30 C 187.95 397.71 187.13 397.84 186.58 398.53 C 186.03 399.21 186.34 399.72 184.94 401.39 C 183.54 403.06 181.29 405.86 178.18 408.56 C 175.08 411.26 168.63 416.14 166.31 417.57 C 163.99 419.00 164.63 416.99 164.26 417.16 C 163.88 417.33 164.33 418.18 164.05 418.59 C 163.78 419.00 164.50 418.70 162.62 419.62 C 160.74 420.54 156.82 422.83 152.79 424.12 C 148.76 425.42 142.55 426.85 138.46 427.40 C 134.36 427.95 131.29 427.60 128.22 427.40 C 125.15 427.19 122.48 426.65 120.03 426.17 C 117.57 425.69 116.00 425.35 113.47 424.53 C 110.95 423.71 107.88 422.62 104.87 421.26 C 101.87 419.89 98.18 417.98 95.45 416.34 C 92.72 414.70 89.99 412.25 88.49 411.43 C 86.99 410.61 87.40 411.70 86.44 411.43 C 85.49 411.15 83.88 410.44 82.76 409.79 C 81.63 409.14 80.81 409.07 79.69 407.54 C 78.56 406.00 76.61 402.55 76.00 400.57 C 75.39 398.59 75.66 397.23 76.00 395.66 C 76.34 394.09 76.99 392.62 78.05 391.15 C 79.11 389.69 81.22 387.77 82.35 386.85 C 83.47 385.93 84.02 386.27 84.81 385.62 C 85.59 384.98 86.14 386.96 87.06 382.96 C 87.98 378.97 89.65 365.56 90.33 361.67 C 91.02 357.77 90.74 362.55 91.15 359.62 C 91.56 356.68 91.77 351.43 92.79 344.05 C 93.82 336.68 96.14 321.53 97.30 315.39 C 98.46 309.24 98.46 310.33 99.75 307.19 C 101.05 304.05 92.25 314.91 105.08 296.55 C 117.91 278.18 163.65 215.18 176.75 197.02 C 189.86 178.87 182.28 189.38 183.71 187.60 C 185.15 185.83 185.08 186.72 185.35 186.38 C 185.62 186.03 183.85 187.81 185.35 185.56 C 186.85 183.30 192.11 175.86 194.36 172.86 C 196.61 169.86 195.04 172.72 198.87 167.54 C 202.69 162.35 213.75 146.51 217.30 141.73 C 220.85 136.96 219.34 139.96 220.16 138.87 C 220.98 137.77 220.78 137.09 222.21 135.18 C 223.65 133.27 227.67 128.83 228.76 127.40 C 229.86 125.97 228.56 126.78 228.76 126.58 C 228.97 126.38 229.72 126.58 229.99 126.17 C 230.27 125.76 229.72 125.28 230.40 124.12 C 231.09 122.96 232.52 121.12 234.09 119.21 C 235.66 117.30 238.46 114.43 239.82 112.66 C 241.19 110.88 241.53 109.45 242.28 108.56 C 243.03 107.67 243.92 107.88 244.33 107.33 C 244.74 106.78 243.92 106.65 244.74 105.28 C 245.56 103.92 248.22 100.37 249.24 99.14 C 250.27 97.91 250.47 98.46 250.88 97.91 C 251.29 97.37 249.99 98.25 251.70 95.86 C 253.41 93.47 259.04 86.14 261.12 83.58 C 263.20 81.02 262.86 81.43 264.19 80.51 C 265.52 79.58 267.67 78.46 269.11 78.05 C 270.54 77.64 271.70 77.91 272.79 78.05 C 273.88 78.18 274.40 78.15 275.66 78.87 C 276.92 79.58 279.31 81.29 280.37 82.35 C 281.43 83.41 281.60 84.19 282.01 85.22 C 282.42 86.24 282.76 87.06 282.83 88.49 C 282.89 89.92 287.95 79.69 282.42 93.82 C 276.89 107.95 263.30 139.55 249.65 173.27 C 236.00 206.99 209.24 274.57 200.51 296.14 C 191.77 317.71 198.18 300.37 197.23 302.69 C 196.27 305.01 197.37 303.65 194.77 310.06 C 192.18 316.48 184.12 335.73 181.67 341.19 C 179.21 346.65 180.23 342.35 180.03 342.83 C 179.82 343.30 180.85 342.96 180.44 344.05 C 180.03 345.15 178.73 346.72 177.57 349.38 C 176.41 352.04 174.74 357.54 173.47 360.03 C 172.21 362.52 171.80 362.86 169.99 364.33 C 168.18 365.80 164.26 368.01 162.62 368.83 C 160.98 369.65 160.64 369.31 160.16 369.24 C 159.69 369.17 159.86 368.32 159.75 368.42 C 159.65 368.53 159.82 369.45 159.55 369.86 C 159.28 370.27 159.99 369.89 158.12 370.88 C 156.24 371.87 150.61 374.77 148.29 375.80 C 145.97 376.82 144.94 376.68 144.19 377.02 C 143.44 377.37 144.67 377.30 143.78 377.84 C 142.89 378.39 139.89 379.89 138.87 380.30 C 137.84 380.71 138.18 380.03 137.64 380.30 C 137.09 380.57 136.55 381.53 135.59 381.94 C 134.63 382.35 132.59 382.48 131.90 382.76 C 131.22 383.03 132.31 383.17 131.49 383.58 C 130.68 383.99 128.42 384.46 126.99 385.22 C 125.56 385.97 125.35 386.85 122.89 388.08 C 120.44 389.31 114.09 391.70 112.25 392.59 C 110.40 393.47 112.11 393.27 111.84 393.41 C 111.56 393.54 110.95 393.20 110.61 393.41 C 110.27 393.61 110.47 394.23 109.79 394.63 C 109.11 395.04 107.16 395.28 106.51 395.86 C 105.86 396.44 105.69 397.37 105.90 398.12 C 106.10 398.87 106.89 399.79 107.74 400.37 C 108.59 400.95 110.27 401.19 111.02 401.60 C 111.77 402.01 111.56 402.55 112.25 402.83 C 112.93 403.10 114.23 402.96 115.11 403.24 C 116.00 403.51 115.32 403.92 117.57 404.46 C 119.82 405.01 125.56 406.17 128.63 406.51 C 131.70 406.85 132.38 407.26 136.00 406.51 C 139.62 405.76 146.10 403.92 150.33 402.01 C 154.57 400.10 158.08 397.67 161.39 395.04 C 164.70 392.42 167.77 388.94 170.20 386.24 C 172.62 383.54 173.20 382.83 175.93 378.87 C 178.66 374.91 183.92 366.92 186.58 362.48 C 189.24 358.05 188.01 358.73 191.90 352.25 C 195.80 345.76 204.87 331.29 209.92 323.58 C 214.98 315.86 218.32 311.09 222.21 305.97 C 226.10 300.85 229.34 296.99 233.27 292.86 C 237.19 288.73 242.38 284.02 245.76 281.19 C 249.14 278.35 250.95 277.43 253.54 275.86 C 256.14 274.29 258.80 272.93 261.32 271.77 C 263.85 270.61 266.38 269.65 268.70 268.90 C 271.02 268.15 272.11 267.60 275.25 267.26 C 278.39 266.92 283.92 266.51 287.54 266.85 C 291.15 267.19 294.57 268.49 296.96 269.31 C 299.34 270.13 300.57 271.02 301.87 271.77 C 303.17 272.52 303.41 272.55 304.74 273.82 C 306.07 275.08 308.39 277.26 309.86 279.34 C 311.32 281.43 312.72 284.46 313.54 286.31 C 314.36 288.15 314.43 288.97 314.77 290.40 C 315.11 291.84 315.45 292.52 315.59 294.91 C 315.73 297.30 315.93 301.32 315.59 304.74 C 315.25 308.15 314.36 312.25 313.54 315.39 C 312.72 318.53 312.79 318.94 310.68 323.58 C 308.56 328.22 303.03 339.21 300.85 343.24 C 298.66 347.26 299.28 344.67 297.57 347.74 C 295.86 350.81 292.25 358.05 290.61 361.67 C 288.97 365.28 288.49 366.44 287.74 369.45 C 286.99 372.45 286.51 377.91 286.10 379.69 C 285.69 381.46 285.28 379.96 285.28 380.10 C 285.28 380.23 285.97 379.14 286.10 380.51 C 286.24 381.87 285.90 386.31 286.10 388.29 C 286.31 390.27 286.85 391.09 287.33 392.38 C 287.81 393.68 287.71 394.12 288.97 396.07 C 290.23 398.01 293.71 402.72 294.91 404.05 C 296.10 405.39 295.73 403.71 296.14 404.05 C 296.55 404.40 296.96 405.83 297.37 406.10 C 297.77 406.38 297.71 405.35 298.59 405.69 C 299.48 406.03 301.26 407.47 302.69 408.15 C 304.12 408.83 304.87 409.24 307.19 409.79 C 309.52 410.33 313.88 411.15 316.61 411.43 C 319.34 411.70 320.23 411.97 323.58 411.43 C 326.92 410.88 333.34 409.24 336.68 408.15 C 340.03 407.06 341.12 406.38 343.65 404.87 C 346.17 403.37 349.41 401.43 351.84 399.14 C 354.26 396.85 356.72 393.65 358.18 391.15 C 359.65 388.66 360.30 386.31 360.64 384.19 C 360.98 382.08 360.71 380.37 360.23 378.46 C 359.75 376.55 360.51 376.41 357.77 372.72 C 355.04 369.04 346.65 359.96 343.85 356.34 C 341.05 352.72 341.94 353.41 340.98 351.02 C 340.03 348.63 338.66 345.76 338.12 342.01 C 337.57 338.25 337.64 331.56 337.71 328.49 C 337.77 325.42 337.91 325.76 338.53 323.58 C 339.14 321.39 340.44 317.64 341.39 315.39 C 342.35 313.13 342.62 312.52 344.26 310.06 C 345.90 307.60 349.62 302.66 351.22 300.64 C 352.83 298.63 353.10 298.56 353.88 297.98 C 354.67 297.40 355.56 297.47 355.93 297.16 C 356.31 296.85 355.32 296.96 356.14 296.14 C 356.96 295.32 359.11 293.51 360.85 292.25 C 362.59 290.98 363.58 290.13 366.58 288.56 C 369.58 286.99 375.32 284.19 378.87 282.83 C 382.42 281.46 385.08 280.98 387.88 280.37 C 390.68 279.75 392.38 279.41 395.66 279.14 C 398.94 278.87 404.05 278.66 407.54 278.73 C 411.02 278.80 412.93 278.80 416.55 279.55 C 420.16 280.30 426.34 281.97 429.24 283.24 C 432.14 284.50 432.89 285.86 433.95 287.13 C 435.01 288.39 435.25 289.52 435.59 290.81 C 435.93 292.11 436.20 293.41 436.00 294.91 C 435.80 296.41 435.15 298.49 434.36 299.82 C 433.58 301.15 432.35 302.18 431.29 302.89 C 430.23 303.61 429.17 303.92 428.01 304.12 C 426.85 304.33 425.97 304.53 424.33 304.12 C 422.69 303.71 420.23 302.28 418.18 301.67 C 416.14 301.05 414.84 300.71 412.04 300.44 C 409.24 300.16 404.60 299.89 401.39 300.03 C 398.18 300.16 395.25 300.71 392.79 301.26 C 390.33 301.80 389.45 302.01 386.65 303.30 C 383.85 304.60 378.90 307.09 376.00 309.04 C 373.10 310.98 371.05 313.10 369.24 314.98 C 367.43 316.85 366.51 317.91 365.15 320.30 C 363.78 322.69 361.80 326.72 361.05 329.31 C 360.30 331.90 360.51 333.82 360.64 335.86 C 360.78 337.91 361.26 339.82 361.87 341.60 C 362.48 343.37 361.73 342.96 364.33 346.51 C 366.92 350.06 374.70 359.14 377.43 362.89 C 380.16 366.65 379.82 366.85 380.71 369.04 C 381.60 371.22 382.35 373.34 382.76 376.00 C 383.17 378.66 383.24 382.69 383.17 385.01 C 383.10 387.33 382.83 388.01 382.35 389.92 C 381.87 391.84 381.05 394.57 380.30 396.48 C 379.55 398.39 378.46 400.51 377.84 401.39 C 377.23 402.28 376.82 401.46 376.61 401.80 C 376.41 402.14 377.16 402.35 376.61 403.44 C 376.07 404.53 375.28 406.07 373.34 408.35 C 371.39 410.64 367.98 414.53 364.94 417.16 C 361.90 419.79 357.77 422.42 355.11 424.12 C 352.45 425.83 351.43 426.31 348.97 427.40 C 346.51 428.49 343.10 429.79 340.37 430.68 C 337.64 431.56 335.59 432.18 332.59 432.72 C 329.58 433.27 325.42 433.82 322.35 433.95 Z M 135.39 351.84 C 136.89 351.56 137.57 351.36 138.87 350.40 C 140.16 349.45 141.97 347.84 143.17 346.10 C 144.36 344.36 145.28 342.21 146.03 339.96 C 146.78 337.71 147.47 334.50 147.67 332.59 C 147.88 330.68 147.67 329.86 147.26 328.49 C 146.85 327.13 146.07 325.52 145.22 324.40 C 144.36 323.27 143.41 322.45 142.14 321.73 C 140.88 321.02 139.41 320.16 137.64 320.10 C 135.86 320.03 133.44 320.27 131.49 321.32 C 129.55 322.38 127.50 323.47 125.97 326.44 C 124.43 329.41 122.83 335.80 122.28 339.14 C 121.73 342.48 122.35 345.01 122.69 346.51 C 123.03 348.01 123.95 347.57 124.33 348.15 C 124.70 348.73 124.02 349.34 124.94 349.99 C 125.86 350.64 128.12 351.73 129.86 352.04 C 131.60 352.35 133.88 352.11 135.39 351.84 Z M 366.78 353.88 C 367.02 353.92 368.05 353.58 368.01 353.47 C 367.98 353.37 366.78 353.20 366.58 353.27 C 366.38 353.34 366.55 353.85 366.78 353.88 Z"/>
|
|
5
|
+
</svg>
|
package/scripts/_db.mjs
ADDED
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
// 脚本共用:解析数据库连接串。
|
|
2
|
+
//
|
|
3
|
+
// 顺序和程序本身一致:进程环境变量 → .env → .env.local → config/database.json。
|
|
4
|
+
// 这样本地只需要维护一个 .env,config/database.json 变成可选项。
|
|
5
|
+
import { existsSync, readFileSync } from "node:fs";
|
|
6
|
+
import { join } from "node:path";
|
|
7
|
+
|
|
8
|
+
const ROOT = join(import.meta.dirname, "..");
|
|
9
|
+
|
|
10
|
+
function parseEnv(text) {
|
|
11
|
+
const out = {};
|
|
12
|
+
for (const raw of text.split("\n")) {
|
|
13
|
+
const line = raw.trim();
|
|
14
|
+
if (!line || line.startsWith("#")) continue;
|
|
15
|
+
const body = line.startsWith("export ") ? line.slice(7).trim() : line;
|
|
16
|
+
const eq = body.indexOf("=");
|
|
17
|
+
if (eq <= 0) continue;
|
|
18
|
+
const key = body.slice(0, eq).trim();
|
|
19
|
+
let value = body.slice(eq + 1).trim();
|
|
20
|
+
if (!/^["']/.test(value)) {
|
|
21
|
+
const hash = value.indexOf(" #");
|
|
22
|
+
if (hash >= 0) value = value.slice(0, hash).trim();
|
|
23
|
+
}
|
|
24
|
+
if (
|
|
25
|
+
(value.startsWith('"') && value.endsWith('"') && value.length > 1) ||
|
|
26
|
+
(value.startsWith("'") && value.endsWith("'") && value.length > 1)
|
|
27
|
+
) {
|
|
28
|
+
value = value.slice(1, -1);
|
|
29
|
+
}
|
|
30
|
+
out[key] = value;
|
|
31
|
+
}
|
|
32
|
+
return out;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
function fileEnv(name) {
|
|
36
|
+
const path = join(ROOT, name);
|
|
37
|
+
if (!existsSync(path)) return {};
|
|
38
|
+
try {
|
|
39
|
+
return parseEnv(readFileSync(path, "utf8"));
|
|
40
|
+
} catch {
|
|
41
|
+
return {};
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
/** 返回 { uri, dbName },找不到就抛错 */
|
|
46
|
+
export function resolveDb() {
|
|
47
|
+
const fromEnv = process.env.MONGODB_URI;
|
|
48
|
+
const files = { ...fileEnv(".env"), ...fileEnv(".env.local") };
|
|
49
|
+
const uri = fromEnv || files.MONGODB_URI;
|
|
50
|
+
if (uri) {
|
|
51
|
+
return {
|
|
52
|
+
uri,
|
|
53
|
+
dbName: process.env.MONGODB_DB_NAME || files.MONGODB_DB_NAME || "inslog",
|
|
54
|
+
};
|
|
55
|
+
}
|
|
56
|
+
const cfgPath = join(ROOT, "config", "database.json");
|
|
57
|
+
if (existsSync(cfgPath)) {
|
|
58
|
+
const cfg = JSON.parse(readFileSync(cfgPath, "utf8"));
|
|
59
|
+
return {
|
|
60
|
+
uri: cfg.uri,
|
|
61
|
+
dbName: process.env.MONGODB_DB_NAME || cfg.dbName || "inslog",
|
|
62
|
+
};
|
|
63
|
+
}
|
|
64
|
+
throw new Error(
|
|
65
|
+
"找不到数据库配置:请在 .env 里填 MONGODB_URI,或填写 config/database.json"
|
|
66
|
+
);
|
|
67
|
+
}
|
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
// 整站备份:导出文章 JSON + 每篇 Markdown + 站点设置 / 标签。
|
|
2
|
+
// 刻意不导出 auth / passkeys / pending_changes —— 那是凭据,不该出现在备份文件里。
|
|
3
|
+
import { mkdirSync, writeFileSync } from "node:fs";
|
|
4
|
+
import { join } from "node:path";
|
|
5
|
+
import { MongoClient } from "mongodb";
|
|
6
|
+
import { resolveDb } from "./_db.mjs";
|
|
7
|
+
|
|
8
|
+
const { uri, dbName } = resolveDb();
|
|
9
|
+
|
|
10
|
+
const client = new MongoClient(uri);
|
|
11
|
+
await client.connect();
|
|
12
|
+
const db = client.db(dbName);
|
|
13
|
+
|
|
14
|
+
const [posts, tags, settings] = await Promise.all([
|
|
15
|
+
db.collection("posts").find({}).sort({ createdAt: 1 }).toArray(),
|
|
16
|
+
db.collection("tags").find({}).sort({ name: 1 }).toArray(),
|
|
17
|
+
db.collection("settings").findOne({ _id: "site" }),
|
|
18
|
+
]);
|
|
19
|
+
|
|
20
|
+
const stamp = new Date().toISOString().replace(/[:.]/g, "-").slice(0, 16);
|
|
21
|
+
const outDir = join("backups", stamp);
|
|
22
|
+
mkdirSync(join(outDir, "posts"), { recursive: true });
|
|
23
|
+
|
|
24
|
+
writeFileSync(join(outDir, "posts.json"), JSON.stringify(posts, null, 2));
|
|
25
|
+
writeFileSync(join(outDir, "tags.json"), JSON.stringify(tags, null, 2));
|
|
26
|
+
writeFileSync(join(outDir, "settings.json"), JSON.stringify(settings ?? {}, null, 2));
|
|
27
|
+
|
|
28
|
+
/** BlockNote 块 → 粗略 Markdown。目标是能读,不是 1:1 还原富文本。 */
|
|
29
|
+
function blockText(block) {
|
|
30
|
+
if (typeof block.content === "string") return block.content;
|
|
31
|
+
if (!Array.isArray(block.content)) return "";
|
|
32
|
+
return block.content
|
|
33
|
+
.map((c) => {
|
|
34
|
+
if (!c || typeof c !== "object") return "";
|
|
35
|
+
let text = String(c.text ?? "");
|
|
36
|
+
if (c.styles) {
|
|
37
|
+
if (c.styles.bold) text = `**${text}**`;
|
|
38
|
+
if (c.styles.italic) text = `*${text}*`;
|
|
39
|
+
if (c.styles.code) text = `\`${text}\``;
|
|
40
|
+
}
|
|
41
|
+
return text;
|
|
42
|
+
})
|
|
43
|
+
.join("");
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
function blocksToMarkdown(blocks, depth = 0) {
|
|
47
|
+
const lines = [];
|
|
48
|
+
for (const block of blocks ?? []) {
|
|
49
|
+
const text = blockText(block);
|
|
50
|
+
const type = block.type ?? "paragraph";
|
|
51
|
+
if (type === "heading") {
|
|
52
|
+
const level = Math.min(6, Math.max(1, Number(block.props?.level ?? 1)));
|
|
53
|
+
lines.push(`${"#".repeat(level)} ${text}`);
|
|
54
|
+
} else if (type === "bulletListItem") {
|
|
55
|
+
lines.push(`${" ".repeat(depth)}- ${text}`);
|
|
56
|
+
} else if (type === "numberedListItem") {
|
|
57
|
+
lines.push(`${" ".repeat(depth)}1. ${text}`);
|
|
58
|
+
} else if (type === "codeBlock") {
|
|
59
|
+
lines.push("```", text, "```");
|
|
60
|
+
} else if (type === "quote") {
|
|
61
|
+
lines.push(`> ${text}`);
|
|
62
|
+
} else if (type === "divider") {
|
|
63
|
+
lines.push("---");
|
|
64
|
+
} else if (type === "image") {
|
|
65
|
+
lines.push(``);
|
|
66
|
+
} else if (type === "file") {
|
|
67
|
+
lines.push(`[📎 ${block.props?.name ?? "文件"}](${block.props?.url ?? ""})`);
|
|
68
|
+
} else if (type === "audio") {
|
|
69
|
+
lines.push(`[🔊 ${block.props?.name ?? "音频"}](${block.props?.url ?? ""})`);
|
|
70
|
+
} else if (type === "video") {
|
|
71
|
+
lines.push(`[🎬 ${block.props?.name ?? "视频"}](${block.props?.url ?? ""})`);
|
|
72
|
+
} else {
|
|
73
|
+
lines.push(text);
|
|
74
|
+
}
|
|
75
|
+
if (Array.isArray(block.children) && block.children.length) {
|
|
76
|
+
lines.push(...blocksToMarkdown(block.children, depth + 1));
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
return lines.join("\n");
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
for (const post of posts) {
|
|
83
|
+
const front = [
|
|
84
|
+
"---",
|
|
85
|
+
`title: ${JSON.stringify(post.title)}`,
|
|
86
|
+
`slug: ${post.slug}`,
|
|
87
|
+
`visibility: ${post.visibility}`,
|
|
88
|
+
`tags: ${JSON.stringify(post.tags ?? [])}`,
|
|
89
|
+
`date: ${(post.publishedAt ?? post.createdAt).toISOString()}`,
|
|
90
|
+
"---",
|
|
91
|
+
"",
|
|
92
|
+
].join("\n");
|
|
93
|
+
|
|
94
|
+
const file = `${post.slug}.md`.replace(/[^a-zA-Z0-9._-]/g, "-");
|
|
95
|
+
// 文件/音视频都在正文块里,blocksToMarkdown 会一并转出来
|
|
96
|
+
writeFileSync(
|
|
97
|
+
join(outDir, "posts", file),
|
|
98
|
+
front + blocksToMarkdown(post.blocks) + "\n"
|
|
99
|
+
);
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
await client.close();
|
|
103
|
+
console.log(`已备份 ${posts.length} 篇文章到 ${outDir}`);
|
|
104
|
+
console.log("凭据集合(auth / passkeys / pending_changes)未导出。");
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
#!/usr/bin/env bash
|
|
2
|
+
#
|
|
3
|
+
# 把 nightly 的内容发布到 main。
|
|
4
|
+
#
|
|
5
|
+
# npm run release
|
|
6
|
+
#
|
|
7
|
+
# 分支模型(2026-11-27 定):
|
|
8
|
+
# nightly —— 开发分支,改动都在这儿做,测通了才发
|
|
9
|
+
# main —— 发布分支,用户部署的就是它
|
|
10
|
+
#
|
|
11
|
+
# 所以这个脚本只做一件事:force push nightly 到 main。
|
|
12
|
+
# 不打 tag,也不建 GitHub Release——版本记录就落在 commit 历史里。
|
|
13
|
+
#
|
|
14
|
+
# 前提:nightly 上的改动已经 commit 并 push 完毕。
|
|
15
|
+
# 脚本不会替你提交——没推完就发布,等于把半成品发出去。
|
|
16
|
+
|
|
17
|
+
set -euo pipefail
|
|
18
|
+
|
|
19
|
+
REPO_SLUG="daveswong/inslog"
|
|
20
|
+
DEV_BRANCH="nightly"
|
|
21
|
+
PUBLISH_BRANCH="main"
|
|
22
|
+
|
|
23
|
+
cd "$(dirname "$0")/.."
|
|
24
|
+
|
|
25
|
+
# 推送加重试。
|
|
26
|
+
# 走代理时 git 的连接偶尔会失败(CONNECT tunnel failed / 502),
|
|
27
|
+
# 而 curl 同样的地址是好的——像是 TLS 指纹被中间设备区别对待。
|
|
28
|
+
# 这种抖动重试一次通常就好,不用因此中断发布。
|
|
29
|
+
git_push() {
|
|
30
|
+
local max=5 attempt=1
|
|
31
|
+
while true; do
|
|
32
|
+
if git "$@"; then
|
|
33
|
+
return 0
|
|
34
|
+
fi
|
|
35
|
+
if [ "${attempt}" -ge "${max}" ]; then
|
|
36
|
+
echo "推送失败,重试 ${max} 次仍不通。检查网络或代理设置。" >&2
|
|
37
|
+
return 1
|
|
38
|
+
fi
|
|
39
|
+
echo " 推送没成功,第 ${attempt} 次重试…" >&2
|
|
40
|
+
attempt=$((attempt + 1))
|
|
41
|
+
sleep 3
|
|
42
|
+
done
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
if ! git diff --quiet || ! git diff --cached --quiet; then
|
|
46
|
+
echo "工作区还有没提交的改动,先提交或 stash 再发布。" >&2
|
|
47
|
+
exit 1
|
|
48
|
+
fi
|
|
49
|
+
|
|
50
|
+
if [ "$(git branch --show-current)" != "${DEV_BRANCH}" ]; then
|
|
51
|
+
echo "请先切到 ${DEV_BRANCH} 分支再发布(改动都在那儿做)。" >&2
|
|
52
|
+
exit 1
|
|
53
|
+
fi
|
|
54
|
+
|
|
55
|
+
echo "==> 检查 ${DEV_BRANCH} 是否已推到远端"
|
|
56
|
+
remote_dev="$(git_push ls-remote origin "refs/heads/${DEV_BRANCH}" | cut -f1)"
|
|
57
|
+
local_head="$(git rev-parse HEAD)"
|
|
58
|
+
if [ "${remote_dev}" != "${local_head}" ]; then
|
|
59
|
+
echo "${DEV_BRANCH} 还没推到远端。先执行:git push origin ${DEV_BRANCH}" >&2
|
|
60
|
+
exit 1
|
|
61
|
+
fi
|
|
62
|
+
|
|
63
|
+
echo "==> 发布 ${DEV_BRANCH} → ${PUBLISH_BRANCH}"
|
|
64
|
+
git_push push origin "HEAD:${PUBLISH_BRANCH}" --force
|
|
65
|
+
|
|
66
|
+
echo
|
|
67
|
+
echo "✅ 发布完成:"
|
|
68
|
+
echo " ${PUBLISH_BRANCH} ← ${DEV_BRANCH}"
|
|
69
|
+
echo
|
|
70
|
+
echo " 用户部署的是 ${PUBLISH_BRANCH};下次改动继续在 ${DEV_BRANCH} 上做。"
|
|
@@ -0,0 +1,184 @@
|
|
|
1
|
+
// 演示数据:为 inslog 演示站灌入几篇与项目本身相关的文章
|
|
2
|
+
// 用法:node scripts/_seed-test.mjs(重复执行会先清空旧的演示数据)
|
|
3
|
+
import { MongoClient } from "mongodb";
|
|
4
|
+
import { resolveDb } from "./_db.mjs";
|
|
5
|
+
|
|
6
|
+
const { uri, dbName } = resolveDb();
|
|
7
|
+
const client = new MongoClient(uri);
|
|
8
|
+
await client.connect();
|
|
9
|
+
const db = client.db(dbName);
|
|
10
|
+
|
|
11
|
+
const text = (t) => ({ type: "text", text: t, styles: {} });
|
|
12
|
+
const p = (t) => ({ type: "paragraph", content: [text(t)], children: [] });
|
|
13
|
+
const h = (level, t) => ({
|
|
14
|
+
type: "heading",
|
|
15
|
+
props: { level },
|
|
16
|
+
content: [text(t)],
|
|
17
|
+
children: [],
|
|
18
|
+
});
|
|
19
|
+
const ul = (items) => ({
|
|
20
|
+
type: "bulletListItem",
|
|
21
|
+
content: [text(items[0])],
|
|
22
|
+
children: items.slice(1).map((it) => ({
|
|
23
|
+
type: "bulletListItem",
|
|
24
|
+
content: [text(it)],
|
|
25
|
+
children: [],
|
|
26
|
+
})),
|
|
27
|
+
});
|
|
28
|
+
const ol = (items) => ({
|
|
29
|
+
type: "numberedListItem",
|
|
30
|
+
content: [text(items[0])],
|
|
31
|
+
children: items.slice(1).map((it) => ({
|
|
32
|
+
type: "numberedListItem",
|
|
33
|
+
content: [text(it)],
|
|
34
|
+
children: [],
|
|
35
|
+
})),
|
|
36
|
+
});
|
|
37
|
+
const quote = (t) => ({ type: "quote", content: [text(t)], children: [] });
|
|
38
|
+
const code = (t) => ({ type: "codeBlock", props: {}, content: [text(t)], children: [] });
|
|
39
|
+
const divider = () => ({ type: "divider", children: [] });
|
|
40
|
+
|
|
41
|
+
/** 把块数组压成纯文本,供搜索用 */
|
|
42
|
+
const plain = (blocks) =>
|
|
43
|
+
blocks
|
|
44
|
+
.map((b) => (b.content ?? []).map((c) => c.text ?? "").join("") + (b.children?.map((c) => (c.content ?? []).map((x) => x.text ?? "").join("")).join(" ") ?? ""))
|
|
45
|
+
.join(" ");
|
|
46
|
+
|
|
47
|
+
const posts = [
|
|
48
|
+
{
|
|
49
|
+
slug: "why-inslog",
|
|
50
|
+
title: "为什么写一个只给自己用的博客程序",
|
|
51
|
+
tags: ["编程", "工具"],
|
|
52
|
+
visibility: "public",
|
|
53
|
+
publishedAt: new Date("2026-11-20T13:00:00Z"),
|
|
54
|
+
createdAt: new Date("2026-11-20T13:00:00Z"),
|
|
55
|
+
blocks: [
|
|
56
|
+
p("现在的博客系统大多在解决「平台」的问题:多用户、评论、主题市场、插件生态。我要的只是一个安静的地方,把编程和电路上踩过的坑记下来。"),
|
|
57
|
+
h(2, "几条硬性约束"),
|
|
58
|
+
ul([
|
|
59
|
+
"文章只按时间排列,不做分类分区",
|
|
60
|
+
"列表只有日期和标题,不要摘要、不要封面图",
|
|
61
|
+
"页面上不留任何抢走注意力的装饰",
|
|
62
|
+
]),
|
|
63
|
+
h(2, "于是有了 inslog"),
|
|
64
|
+
p("Next.js 写页面,MongoDB 存文章,BlockNote 做所见即所得编辑器。单用户,登录只保护「写文章」和「设置」两件事,其余全部公开可读。"),
|
|
65
|
+
p("所有文章的内容就是一棵块树,和编辑器里看到的完全一致,不用再维护一套 Markdown 转换。"),
|
|
66
|
+
quote("博客首先是写给自己的,其次才是写给别人看的。"),
|
|
67
|
+
p("所以这个程序不追求功能齐全,只追求写起来没有阻力、读起来没有干扰。"),
|
|
68
|
+
],
|
|
69
|
+
},
|
|
70
|
+
{
|
|
71
|
+
slug: "stack-notes",
|
|
72
|
+
title: "技术选型笔记:Next.js、MongoDB 与 BlockNote",
|
|
73
|
+
tags: ["编程"],
|
|
74
|
+
visibility: "public",
|
|
75
|
+
publishedAt: new Date("2026-09-10T09:30:00Z"),
|
|
76
|
+
createdAt: new Date("2026-09-10T09:30:00Z"),
|
|
77
|
+
blocks: [
|
|
78
|
+
p("记录一下这套组合选下来的理由,以及各自承担的边界。"),
|
|
79
|
+
h(2, "页面与渲染"),
|
|
80
|
+
p("用 App Router,首页和详情页都按需动态渲染:文章随时会改,状态标签又依赖当前时间,静态预渲染反而会留下过期结果。"),
|
|
81
|
+
h(2, "一篇文章就是一条文档"),
|
|
82
|
+
p("正文直接用编辑器产出的块数组落库,同时保存一份纯文本用于搜索,避免查询时反复解析块结构。"),
|
|
83
|
+
code(
|
|
84
|
+
[
|
|
85
|
+
"type PostDoc = {",
|
|
86
|
+
" slug: string;",
|
|
87
|
+
" title: string;",
|
|
88
|
+
" blocks: Block[];",
|
|
89
|
+
" plainText: string;",
|
|
90
|
+
" tags: string[];",
|
|
91
|
+
" visibility: \"public\" | \"private\" | \"draft\";",
|
|
92
|
+
" publishedAt: Date | null;",
|
|
93
|
+
"};",
|
|
94
|
+
].join("\n")
|
|
95
|
+
),
|
|
96
|
+
h(3, "标签不用单独维护"),
|
|
97
|
+
p("标签只存在两个地方:文章上的引用,和一份标签表。保存文章时顺手清理没有任何引用的标签,界面上就不会出现空标签。"),
|
|
98
|
+
divider(),
|
|
99
|
+
p("整套体系里没有后台管理界面,写作页就是唯一的管理入口。"),
|
|
100
|
+
],
|
|
101
|
+
},
|
|
102
|
+
{
|
|
103
|
+
slug: "visibility",
|
|
104
|
+
title: "公开、私有、草稿:三态可见性怎么用",
|
|
105
|
+
tags: ["工具"],
|
|
106
|
+
visibility: "public",
|
|
107
|
+
publishedAt: new Date("2026-05-01T15:00:00Z"),
|
|
108
|
+
createdAt: new Date("2026-05-01T15:00:00Z"),
|
|
109
|
+
blocks: [
|
|
110
|
+
p("写东西的节奏不总是「写完了就发」。所以每篇文章有一个可见性状态,在写作页底部选择。"),
|
|
111
|
+
ol([
|
|
112
|
+
"公开:任何人访问都能看到,出现在首页时间线里",
|
|
113
|
+
"私有:只有登录后的自己能看到,适合放调试记录和私人笔记",
|
|
114
|
+
"草稿:还没写完,同样只有自己能看到,列表里会标上 draft",
|
|
115
|
+
]),
|
|
116
|
+
h(2, "访客看到的世界"),
|
|
117
|
+
p("未登录访问时,列表和详情都只包含公开文章;私有和草稿直接访问会当作不存在,不会返回任何内容。"),
|
|
118
|
+
p("登录之后,三态文章混在同一条时间线里,靠标题前的英文小标签区分,不需要额外的管理列表。"),
|
|
119
|
+
quote("状态是给作者看的,不是给读者看的。"),
|
|
120
|
+
],
|
|
121
|
+
},
|
|
122
|
+
{
|
|
123
|
+
slug: "private-notes",
|
|
124
|
+
title: "私人笔记:手头这块板子的调试记录",
|
|
125
|
+
blocks: [
|
|
126
|
+
p("内层板还在冒烟测试,记录先放这里,等稳定了再整理成公开文章。"),
|
|
127
|
+
ul(["上电时序要再确认一遍", "去耦电容位置待调整"]),
|
|
128
|
+
],
|
|
129
|
+
tags: ["电路"],
|
|
130
|
+
visibility: "private",
|
|
131
|
+
publishedAt: new Date("2026-11-22T11:00:00Z"),
|
|
132
|
+
createdAt: new Date("2026-11-22T11:00:00Z"),
|
|
133
|
+
},
|
|
134
|
+
{
|
|
135
|
+
slug: "draft-upload",
|
|
136
|
+
title: "还没写完:图片上传与 Vercel Blob",
|
|
137
|
+
blocks: [
|
|
138
|
+
p("计划把编辑器里的图片上传接到 Vercel Blob,文章只存 URL。"),
|
|
139
|
+
p("这里留一个草稿,用来验证草稿不会出现在访客的列表里。"),
|
|
140
|
+
],
|
|
141
|
+
tags: [],
|
|
142
|
+
visibility: "draft",
|
|
143
|
+
publishedAt: null,
|
|
144
|
+
createdAt: new Date("2026-11-23T16:00:00Z"),
|
|
145
|
+
},
|
|
146
|
+
].map((post) => ({
|
|
147
|
+
...post,
|
|
148
|
+
plainText: plain(post.blocks),
|
|
149
|
+
updatedAt: post.publishedAt ?? post.createdAt,
|
|
150
|
+
}));
|
|
151
|
+
|
|
152
|
+
// 清掉旧的演示数据,避免重复
|
|
153
|
+
await db.collection("posts").deleteMany({ slug: { $in: posts.map((p) => p.slug) } });
|
|
154
|
+
await db.collection("posts").insertMany(posts);
|
|
155
|
+
|
|
156
|
+
await db.collection("tags").deleteMany({});
|
|
157
|
+
await db.collection("tags").insertMany(
|
|
158
|
+
[...new Set(posts.flatMap((p) => p.tags))].map((name) => ({ name, createdAt: new Date() }))
|
|
159
|
+
);
|
|
160
|
+
|
|
161
|
+
await db.collection("settings").updateOne(
|
|
162
|
+
{ _id: "site" },
|
|
163
|
+
{
|
|
164
|
+
$set: {
|
|
165
|
+
_id: "site",
|
|
166
|
+
siteName: "inslog",
|
|
167
|
+
description: "一个人写的博客程序,记录编程与电路上的折腾。",
|
|
168
|
+
author: "",
|
|
169
|
+
seoTitle: "",
|
|
170
|
+
seoDescription: "",
|
|
171
|
+
seoKeywords: "",
|
|
172
|
+
social: {},
|
|
173
|
+
favicon: "",
|
|
174
|
+
ogImage: "",
|
|
175
|
+
footerText: "",
|
|
176
|
+
postsPerPage: 5,
|
|
177
|
+
updatedAt: new Date(),
|
|
178
|
+
},
|
|
179
|
+
},
|
|
180
|
+
{ upsert: true }
|
|
181
|
+
);
|
|
182
|
+
|
|
183
|
+
console.log(`演示数据就绪:${posts.length} 篇`);
|
|
184
|
+
await client.close();
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
// 只读连通测试:ping + 列出集合名,不写入任何数据
|
|
2
|
+
import { MongoClient } from "mongodb";
|
|
3
|
+
import { resolveDb } from "./_db.mjs";
|
|
4
|
+
|
|
5
|
+
const config = resolveDb();
|
|
6
|
+
|
|
7
|
+
const client = new MongoClient(config.uri, { serverSelectionTimeoutMS: 15000 });
|
|
8
|
+
|
|
9
|
+
try {
|
|
10
|
+
await client.connect();
|
|
11
|
+
// ping 只验证连通性,不写数据
|
|
12
|
+
const ping = await client.db(config.dbName).command({ ping: 1 });
|
|
13
|
+
console.log("连接成功:", ping.ok === 1 ? "OK" : "异常");
|
|
14
|
+
|
|
15
|
+
// 列出已有集合(只读)
|
|
16
|
+
const collections = await client.db(config.dbName).listCollections().toArray();
|
|
17
|
+
const names = collections.map((c) => c.name);
|
|
18
|
+
console.log(`数据库 ${config.dbName} 的集合数:${names.length}`);
|
|
19
|
+
if (names.length) console.log("集合:", names.join(", "));
|
|
20
|
+
else console.log("(空库,尚无集合)");
|
|
21
|
+
} catch (err) {
|
|
22
|
+
console.error("连接失败:", err.message);
|
|
23
|
+
process.exitCode = 1;
|
|
24
|
+
} finally {
|
|
25
|
+
await client.close();
|
|
26
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
// 退出登录:清掉会话 cookie 后回到首页(表单直接 POST,不需要前端 JS)
|
|
2
|
+
import { NextResponse } from "next/server";
|
|
3
|
+
import { SESSION_COOKIE } from "@/lib/session";
|
|
4
|
+
|
|
5
|
+
export async function POST(req: Request) {
|
|
6
|
+
const res = NextResponse.redirect(new URL("/", req.url), 303);
|
|
7
|
+
res.cookies.delete(SESSION_COOKIE);
|
|
8
|
+
return res;
|
|
9
|
+
}
|