diff --git a/README.md b/README.md index 4c0ba15..2476a24 100644 --- a/README.md +++ b/README.md @@ -31,10 +31,17 @@ - **Internationalization**: Supports 19 languages and regional settings worldwide ## Screenshots -**NoteWizard Quick Start** -> Tips: software is continuously updated to enhance performance and user experience. Listed features are for reference only and may evolve with technological advancements and user needs. -![NoteWizard Quick Start](./docs/Quick_Start/QuickStart_enUS.webp) +#### Edit mode +![NoteWizard Edit mode](./docs/Quick_Start/en-US/Edit-mode.jpg) +#### Read mode +![NoteWizard Read mode](./docs/Quick_Start/en-US/Read-mode.jpg) +#### General +![NoteWizard General](./docs/Quick_Start/en-US/General.jpg) +#### Security +![NoteWizard Security](./docs/Quick_Start/en-US/Security.jpg) +#### AI configuration +![NoteWizard AI configuration](./docs/Quick_Start/en-US/AI-Config.jpg) ## Supported Platforms diff --git a/README_CN.md b/README_CN.md index b7b138a..e668be6 100644 --- a/README_CN.md +++ b/README_CN.md @@ -29,9 +29,16 @@ - **国际化**:支持全球19种语言及地区设置 ## 界面预览 -**NoteWizard 快速上手** -> 提示: 本软件持续更新,以优化性能和用户体验。列出的功能仅供参考,可能随技术进步和需求变化而调整。 -![NoteWizard 快速上手](./docs/Quick_Start/QuickStart_zhCN.webp) +#### 编辑模式 +![NoteWizard 编辑模式](./docs/Quick_Start/zh-CN/Edit-mode.jpg) +#### 只读模式 +![NoteWizard 只读模式](./docs/Quick_Start/zh-CN/Read-mode.jpg) +#### 首选项通用 +![NoteWizard 首选项通用](./docs/Quick_Start/zh-CN/General.jpg) +#### 首选项安全 +![NoteWizard 首选项安全](./docs/Quick_Start/zh-CN/Security.jpg) +#### 首选项AI配置 +![NoteWizard AI辅助写作](./docs/Quick_Start/zh-CN/AI-Config.jpg) ## 支持平台 diff --git a/docs/Quick_Start/QuickStart_enUS.webp b/docs/Quick_Start/QuickStart_enUS.webp deleted file mode 100644 index 573ed80..0000000 Binary files a/docs/Quick_Start/QuickStart_enUS.webp and /dev/null differ diff --git a/docs/Quick_Start/QuickStart_zhCN.webp b/docs/Quick_Start/QuickStart_zhCN.webp deleted file mode 100644 index 573ed80..0000000 Binary files a/docs/Quick_Start/QuickStart_zhCN.webp and /dev/null differ diff --git a/docs/Quick_Start/en-US/AI-Config.jpg b/docs/Quick_Start/en-US/AI-Config.jpg new file mode 100644 index 0000000..773e5df Binary files /dev/null and b/docs/Quick_Start/en-US/AI-Config.jpg differ diff --git a/docs/Quick_Start/en-US/Edit-mode.jpg b/docs/Quick_Start/en-US/Edit-mode.jpg new file mode 100644 index 0000000..4088e9c Binary files /dev/null and b/docs/Quick_Start/en-US/Edit-mode.jpg differ diff --git a/docs/Quick_Start/en-US/General.jpg b/docs/Quick_Start/en-US/General.jpg new file mode 100644 index 0000000..ba2c4b4 Binary files /dev/null and b/docs/Quick_Start/en-US/General.jpg differ diff --git a/docs/Quick_Start/en-US/Read-mode.jpg b/docs/Quick_Start/en-US/Read-mode.jpg new file mode 100644 index 0000000..9f08d9a Binary files /dev/null and b/docs/Quick_Start/en-US/Read-mode.jpg differ diff --git a/docs/Quick_Start/en-US/Security.jpg b/docs/Quick_Start/en-US/Security.jpg new file mode 100644 index 0000000..fbd1230 Binary files /dev/null and b/docs/Quick_Start/en-US/Security.jpg differ diff --git a/docs/Quick_Start/zh-CN/AI-Config.jpg b/docs/Quick_Start/zh-CN/AI-Config.jpg new file mode 100644 index 0000000..f60c4b8 Binary files /dev/null and b/docs/Quick_Start/zh-CN/AI-Config.jpg differ diff --git a/docs/Quick_Start/zh-CN/Edit-mode.jpg b/docs/Quick_Start/zh-CN/Edit-mode.jpg new file mode 100644 index 0000000..9bda99d Binary files /dev/null and b/docs/Quick_Start/zh-CN/Edit-mode.jpg differ diff --git a/docs/Quick_Start/zh-CN/General.jpg b/docs/Quick_Start/zh-CN/General.jpg new file mode 100644 index 0000000..5e748b1 Binary files /dev/null and b/docs/Quick_Start/zh-CN/General.jpg differ diff --git a/docs/Quick_Start/zh-CN/Read-mode.jpg b/docs/Quick_Start/zh-CN/Read-mode.jpg new file mode 100644 index 0000000..152b54b Binary files /dev/null and b/docs/Quick_Start/zh-CN/Read-mode.jpg differ diff --git a/docs/Quick_Start/zh-CN/Security.jpg b/docs/Quick_Start/zh-CN/Security.jpg new file mode 100644 index 0000000..80ed9df Binary files /dev/null and b/docs/Quick_Start/zh-CN/Security.jpg differ diff --git a/package-lock.json b/package-lock.json index b59077a..c6dcd4c 100644 --- a/package-lock.json +++ b/package-lock.json @@ -6093,9 +6093,9 @@ } }, "node_modules/tar": { - "version": "7.5.9", - "resolved": "https://registry.npmjs.org/tar/-/tar-7.5.9.tgz", - "integrity": "sha512-BTLcK0xsDh2+PUe9F6c2TlRp4zOOBMTkoQHQIWSIzI0R7KG46uEwq4OPk2W7bZcprBMsuaeFsqwYr7pjh6CuHg==", + "version": "7.5.10", + "resolved": "https://registry.npmjs.org/tar/-/tar-7.5.10.tgz", + "integrity": "sha512-8mOPs1//5q/rlkNSPcCegA6hiHJYDmSLEI8aMH/CdSQJNWztHC9WHNam5zdQlfpTwB9Xp7IBEsHfV5LKMJGVAw==", "dev": true, "license": "BlueOak-1.0.0", "dependencies": { diff --git a/scripts/sync-terms-of-service.js b/scripts/sync-terms-of-service.js index 5a27f40..abbf33c 100644 --- a/scripts/sync-terms-of-service.js +++ b/scripts/sync-terms-of-service.js @@ -7,6 +7,8 @@ const __dirname = path.dirname(__filename); const repoRoot = path.resolve(__dirname, '..'); const wikiRawUrl = 'https://raw.githubusercontent.com/wiki/jetyu/NoteWizard/T01_Terms-of-Service.md'; +const allowedWikiHost = 'raw.githubusercontent.com'; +const maxTermsSizeBytes = 200 * 1024; const outputPath = path.join(repoRoot, 'src', 'assets', 'terms-of-service', 'local-tos.txt'); @@ -23,7 +25,52 @@ function markdownToText(markdown) { .trim(); } +function validateSourceUrl(rawUrl) { + const url = new URL(rawUrl); + if (url.protocol !== 'https:') { + throw new Error(`Unexpected protocol for terms source: ${url.protocol}`); + } + + if (url.hostname !== allowedWikiHost) { + throw new Error(`Unexpected host for terms source: ${url.hostname}`); + } + + if (!url.pathname.startsWith('/wiki/jetyu/NoteWizard/')) { + throw new Error(`Unexpected path for terms source: ${url.pathname}`); + } +} + +function validateResponse(response) { + const contentType = response.headers.get('content-type') || ''; + if (!/^text\//i.test(contentType)) { + throw new Error(`Unexpected content type for terms source: ${contentType || 'unknown'}`); + } + + const contentLengthHeader = response.headers.get('content-length'); + const contentLength = Number(contentLengthHeader || 0); + if (Number.isFinite(contentLength) && contentLength > maxTermsSizeBytes) { + throw new Error(`Terms source too large: ${contentLength} bytes`); + } +} + +function sanitizeTermsText(text) { + const normalized = text + .replace(/\u0000/g, '') + .replace(/[\u0001-\u0008\u000B\u000C\u000E-\u001F\u007F]/g, ''); + + if (!/terms of service/i.test(normalized)) { + throw new Error('Downloaded terms content failed validation.'); + } + + if (Buffer.byteLength(normalized, 'utf8') > maxTermsSizeBytes) { + throw new Error('Downloaded terms content exceeded size limit after processing.'); + } + + return normalized; +} + async function main() { + validateSourceUrl(wikiRawUrl); await fs.mkdir(path.dirname(outputPath), { recursive: true }); let existing = ''; @@ -36,9 +83,10 @@ async function main() { try { const response = await fetch(wikiRawUrl); if (!response.ok) throw new Error(`HTTP ${response.status}`); + validateResponse(response); const markdown = await response.text(); - const text = markdownToText(markdown) + '\n'; + const text = sanitizeTermsText(markdownToText(markdown)) + '\n'; await fs.writeFile(outputPath, '\ufeff' + text, 'utf8'); console.log(`Synced Terms of Service from wiki: ${wikiRawUrl}`); return; diff --git a/src/assets/changelog/history_cn.md b/src/assets/changelog/history_cn.md index 2542836..28000a9 100644 --- a/src/assets/changelog/history_cn.md +++ b/src/assets/changelog/history_cn.md @@ -1,7 +1,8 @@ ### [1.1.4] - 2026-03-08 #### 修复 - 修复在配置文件缺失情况下导致密钥验证异常的问题。 -- 修复更新加密元数据时可能出现的文件系统竞态条件问题。 +- 修复只读模式状态下笔记不显示只读图标的问题。 +- 修复可能导致数据更新不一致的潜在问题。 #### 优化 - 优化预览界面渲染机制,提升滚动流畅度。 diff --git a/src/assets/changelog/history_en.md b/src/assets/changelog/history_en.md index 54e5636..75f226f 100644 --- a/src/assets/changelog/history_en.md +++ b/src/assets/changelog/history_en.md @@ -1,7 +1,8 @@ ### [1.1.4] - 2026-03-08 #### Fixed - Fixed an issue that caused key verification to fail when the configuration file was missing. -- Fix a potential file system race condition when updating encryption metadata. +- Fixed an issue where the note read-only icon was not displayed in read-only mode. +- Fixed an potential data inconsistency issue. #### Improved - Optimize the preview interface rendering mechanism to improve scrolling smoothness.