From c355807e9ea5b0a970d466370f37b4aee11bac62 Mon Sep 17 00:00:00 2001 From: ZacharyZcR Date: Sun, 22 Feb 2026 12:11:46 +0800 Subject: [PATCH] feat: add Simplified Chinese (zh-Hans) i18n support - Add zh-Hans locale to docusaurus.config.ts with locale dropdown - Translate all 25 documentation pages (17 root + 8 install subdocs) - Translate navbar, footer, sidebar labels, and homepage component strings - Internationalize homepage components with and translate() - Fix duplicate sidebar translation keys in API sidebar - API docs (auto-generated) intentionally excluded from translation --- docs/api/sidebar.ts | 6 + docusaurus.config.ts | 10 +- i18n/zh-Hans/code.json | 389 ++++++++++++++++++ .../current.json | 42 ++ .../current/contributing.md | 51 +++ .../current/docker.md | 25 ++ .../current/environment-variables.md | 9 + .../current/features.md | 88 ++++ .../current/install.md | 26 ++ .../current/install/connector/android.md | 24 ++ .../current/install/connector/ios.md | 24 ++ .../current/install/connector/linux.md | 76 ++++ .../current/install/connector/macos.md | 50 +++ .../current/install/connector/windows.md | 45 ++ .../current/install/server/docker.md | 100 +++++ .../current/install/server/manual.md | 114 +++++ .../current/install/server/proxmox.md | 19 + .../current/json-import.md | 366 ++++++++++++++++ .../current/oidc.md | 222 ++++++++++ .../current/opkssh.md | 62 +++ .../current/privacy-policy.md | 68 +++ .../current/rbac.md | 42 ++ .../current/reverse-proxy.md | 76 ++++ .../current/security.md | 88 ++++ .../current/server-stats.md | 34 ++ .../current/ssl.md | 89 ++++ .../current/totp.md | 114 +++++ .../current/translations.md | 14 + .../current/tunnels.md | 104 +++++ .../docusaurus-theme-classic/footer.json | 42 ++ .../docusaurus-theme-classic/navbar.json | 18 + src/components/homepage/index.tsx | 73 ++-- src/pages/index.tsx | 15 +- 33 files changed, 2497 insertions(+), 28 deletions(-) create mode 100644 i18n/zh-Hans/code.json create mode 100644 i18n/zh-Hans/docusaurus-plugin-content-docs/current.json create mode 100644 i18n/zh-Hans/docusaurus-plugin-content-docs/current/contributing.md create mode 100644 i18n/zh-Hans/docusaurus-plugin-content-docs/current/docker.md create mode 100644 i18n/zh-Hans/docusaurus-plugin-content-docs/current/environment-variables.md create mode 100644 i18n/zh-Hans/docusaurus-plugin-content-docs/current/features.md create mode 100644 i18n/zh-Hans/docusaurus-plugin-content-docs/current/install.md create mode 100644 i18n/zh-Hans/docusaurus-plugin-content-docs/current/install/connector/android.md create mode 100644 i18n/zh-Hans/docusaurus-plugin-content-docs/current/install/connector/ios.md create mode 100644 i18n/zh-Hans/docusaurus-plugin-content-docs/current/install/connector/linux.md create mode 100644 i18n/zh-Hans/docusaurus-plugin-content-docs/current/install/connector/macos.md create mode 100644 i18n/zh-Hans/docusaurus-plugin-content-docs/current/install/connector/windows.md create mode 100644 i18n/zh-Hans/docusaurus-plugin-content-docs/current/install/server/docker.md create mode 100644 i18n/zh-Hans/docusaurus-plugin-content-docs/current/install/server/manual.md create mode 100644 i18n/zh-Hans/docusaurus-plugin-content-docs/current/install/server/proxmox.md create mode 100644 i18n/zh-Hans/docusaurus-plugin-content-docs/current/json-import.md create mode 100644 i18n/zh-Hans/docusaurus-plugin-content-docs/current/oidc.md create mode 100644 i18n/zh-Hans/docusaurus-plugin-content-docs/current/opkssh.md create mode 100644 i18n/zh-Hans/docusaurus-plugin-content-docs/current/privacy-policy.md create mode 100644 i18n/zh-Hans/docusaurus-plugin-content-docs/current/rbac.md create mode 100644 i18n/zh-Hans/docusaurus-plugin-content-docs/current/reverse-proxy.md create mode 100644 i18n/zh-Hans/docusaurus-plugin-content-docs/current/security.md create mode 100644 i18n/zh-Hans/docusaurus-plugin-content-docs/current/server-stats.md create mode 100644 i18n/zh-Hans/docusaurus-plugin-content-docs/current/ssl.md create mode 100644 i18n/zh-Hans/docusaurus-plugin-content-docs/current/totp.md create mode 100644 i18n/zh-Hans/docusaurus-plugin-content-docs/current/translations.md create mode 100644 i18n/zh-Hans/docusaurus-plugin-content-docs/current/tunnels.md create mode 100644 i18n/zh-Hans/docusaurus-theme-classic/footer.json create mode 100644 i18n/zh-Hans/docusaurus-theme-classic/navbar.json diff --git a/docs/api/sidebar.ts b/docs/api/sidebar.ts index 7f9fe27..d7fbb77 100644 --- a/docs/api/sidebar.ts +++ b/docs/api/sidebar.ts @@ -315,6 +315,7 @@ const sidebar: SidebarsConfig = { id: 'api/get-command-history', label: 'Get command history', className: 'api-method get', + key: 'terminal-get-command-history', }, { type: 'doc', @@ -543,12 +544,14 @@ const sidebar: SidebarsConfig = { id: 'api/verify-totp-and-complete-connection', label: 'Verify TOTP and complete connection', className: 'api-method post', + key: 'docker-verify-totp', }, { type: 'doc', id: 'api/keep-ssh-session-alive', label: 'Keep SSH session alive', className: 'api-method post', + key: 'docker-keep-alive', }, { type: 'doc', @@ -759,6 +762,7 @@ const sidebar: SidebarsConfig = { id: 'api/verify-totp-and-complete-connection', label: 'Verify TOTP and complete connection', className: 'api-method post', + key: 'filemanager-verify-totp', }, { type: 'doc', @@ -777,6 +781,7 @@ const sidebar: SidebarsConfig = { id: 'api/keep-ssh-session-alive', label: 'Keep SSH session alive', className: 'api-method post', + key: 'filemanager-keep-alive', }, { type: 'doc', @@ -981,6 +986,7 @@ const sidebar: SidebarsConfig = { id: 'api/get-command-history', label: 'Get command history', className: 'api-method get', + key: 'ssh-get-command-history', }, { type: 'doc', diff --git a/docusaurus.config.ts b/docusaurus.config.ts index ef5eea0..2c1bd0e 100644 --- a/docusaurus.config.ts +++ b/docusaurus.config.ts @@ -20,7 +20,11 @@ const config: Config = { i18n: { defaultLocale: 'en', - locales: ['en'], + locales: ['en', 'zh-Hans'], + localeConfigs: { + en: { label: 'English' }, + 'zh-Hans': { label: '简体中文' }, + }, }, plugins: [ @@ -85,6 +89,10 @@ const config: Config = { position: 'left', label: 'API', }, + { + type: 'localeDropdown', + position: 'right', + }, ], }, footer: { diff --git a/i18n/zh-Hans/code.json b/i18n/zh-Hans/code.json new file mode 100644 index 0000000..a703c60 --- /dev/null +++ b/i18n/zh-Hans/code.json @@ -0,0 +1,389 @@ +{ + "theme.docs.DocCard.categoryDescription.plurals": { + "message": "{count} 个项目", + "description": "The default description for a category card in the generated index about how many items this category includes" + }, + "theme.ErrorPageContent.title": { + "message": "页面已崩溃。", + "description": "The title of the fallback page when the page crashed" + }, + "theme.BackToTopButton.buttonAriaLabel": { + "message": "回到顶部", + "description": "The ARIA label for the back to top button" + }, + "theme.blog.archive.title": { + "message": "历史博文", + "description": "The page & hero title of the blog archive page" + }, + "theme.blog.archive.description": { + "message": "历史博文", + "description": "The page & hero description of the blog archive page" + }, + "theme.blog.paginator.navAriaLabel": { + "message": "博文列表分页导航", + "description": "The ARIA label for the blog pagination" + }, + "theme.blog.paginator.newerEntries": { + "message": "较新的博文", + "description": "The label used to navigate to the newer blog posts page (previous page)" + }, + "theme.blog.paginator.olderEntries": { + "message": "较旧的博文", + "description": "The label used to navigate to the older blog posts page (next page)" + }, + "theme.blog.post.paginator.navAriaLabel": { + "message": "博文分页导航", + "description": "The ARIA label for the blog posts pagination" + }, + "theme.blog.post.paginator.newerPost": { + "message": "较新一篇", + "description": "The blog post button label to navigate to the newer/previous post" + }, + "theme.blog.post.paginator.olderPost": { + "message": "较旧一篇", + "description": "The blog post button label to navigate to the older/next post" + }, + "theme.tags.tagsPageLink": { + "message": "查看所有标签", + "description": "The label of the link targeting the tag list page" + }, + "theme.colorToggle.ariaLabel.mode.system": { + "message": "system mode", + "description": "The name for the system color mode" + }, + "theme.colorToggle.ariaLabel.mode.light": { + "message": "浅色模式", + "description": "The name for the light color mode" + }, + "theme.colorToggle.ariaLabel.mode.dark": { + "message": "暗黑模式", + "description": "The name for the dark color mode" + }, + "theme.colorToggle.ariaLabel": { + "message": "切换浅色/暗黑模式(当前为{mode})", + "description": "The ARIA label for the color mode toggle" + }, + "theme.docs.breadcrumbs.navAriaLabel": { + "message": "页面路径", + "description": "The ARIA label for the breadcrumbs" + }, + "theme.docs.paginator.navAriaLabel": { + "message": "文件选项卡", + "description": "The ARIA label for the docs pagination" + }, + "theme.docs.paginator.previous": { + "message": "上一页", + "description": "The label used to navigate to the previous doc" + }, + "theme.docs.paginator.next": { + "message": "下一页", + "description": "The label used to navigate to the next doc" + }, + "theme.docs.tagDocListPageTitle.nDocsTagged": { + "message": "{count} 篇文档带有标签", + "description": "Pluralized label for \"{count} docs tagged\". Use as much plural forms (separated by \"|\") as your language support (see https://www.unicode.org/cldr/cldr-aux/charts/34/supplemental/language_plural_rules.html)" + }, + "theme.docs.tagDocListPageTitle": { + "message": "{nDocsTagged}「{tagName}」", + "description": "The title of the page for a docs tag" + }, + "theme.docs.versionBadge.label": { + "message": "版本:{versionLabel}" + }, + "theme.docs.versions.unreleasedVersionLabel": { + "message": "此为 {siteTitle} {versionLabel} 版尚未发行的文档。", + "description": "The label used to tell the user that he's browsing an unreleased doc version" + }, + "theme.docs.versions.unmaintainedVersionLabel": { + "message": "此为 {siteTitle} {versionLabel} 版的文档,现已不再积极维护。", + "description": "The label used to tell the user that he's browsing an unmaintained doc version" + }, + "theme.docs.versions.latestVersionSuggestionLabel": { + "message": "最新的文档请参阅 {latestVersionLink} ({versionLabel})。", + "description": "The label used to tell the user to check the latest version" + }, + "theme.docs.versions.latestVersionLinkLabel": { + "message": "最新版本", + "description": "The label used for the latest version suggestion link label" + }, + "theme.common.editThisPage": { + "message": "编辑此页", + "description": "The link label to edit the current page" + }, + "theme.common.headingLinkTitle": { + "message": "{heading}的直接链接", + "description": "Title for link to heading" + }, + "theme.lastUpdated.atDate": { + "message": "于 {date} ", + "description": "The words used to describe on which date a page has been last updated" + }, + "theme.lastUpdated.byUser": { + "message": "由 {user} ", + "description": "The words used to describe by who the page has been last updated" + }, + "theme.lastUpdated.lastUpdatedAtBy": { + "message": "最后{byUser}{atDate}更新", + "description": "The sentence used to display when a page has been last updated, and by who" + }, + "theme.navbar.mobileVersionsDropdown.label": { + "message": "选择版本", + "description": "The label for the navbar versions dropdown on mobile view" + }, + "theme.NotFound.title": { + "message": "找不到页面", + "description": "The title of the 404 page" + }, + "theme.tags.tagsListLabel": { + "message": "标签:", + "description": "The label alongside a tag list" + }, + "theme.admonition.caution": { + "message": "警告", + "description": "The default label used for the Caution admonition (:::caution)" + }, + "theme.admonition.danger": { + "message": "危险", + "description": "The default label used for the Danger admonition (:::danger)" + }, + "theme.admonition.info": { + "message": "信息", + "description": "The default label used for the Info admonition (:::info)" + }, + "theme.admonition.note": { + "message": "备注", + "description": "The default label used for the Note admonition (:::note)" + }, + "theme.admonition.tip": { + "message": "提示", + "description": "The default label used for the Tip admonition (:::tip)" + }, + "theme.admonition.warning": { + "message": "注意", + "description": "The default label used for the Warning admonition (:::warning)" + }, + "theme.AnnouncementBar.closeButtonAriaLabel": { + "message": "关闭", + "description": "The ARIA label for close button of announcement bar" + }, + "theme.blog.sidebar.navAriaLabel": { + "message": "最近博文导航", + "description": "The ARIA label for recent posts in the blog sidebar" + }, + "theme.DocSidebarItem.expandCategoryAriaLabel": { + "message": "展开侧边栏分类 '{label}'", + "description": "The ARIA label to expand the sidebar category" + }, + "theme.DocSidebarItem.collapseCategoryAriaLabel": { + "message": "折叠侧边栏分类 '{label}'", + "description": "The ARIA label to collapse the sidebar category" + }, + "theme.IconExternalLink.ariaLabel": { + "message": "(opens in new tab)", + "description": "The ARIA label for the external link icon" + }, + "theme.NavBar.navAriaLabel": { + "message": "主导航", + "description": "The ARIA label for the main navigation" + }, + "theme.NotFound.p1": { + "message": "我们找不到您要找的页面。", + "description": "The first paragraph of the 404 page" + }, + "theme.NotFound.p2": { + "message": "请联系原始链接来源网站的所有者,并告知他们链接已损坏。", + "description": "The 2nd paragraph of the 404 page" + }, + "theme.navbar.mobileLanguageDropdown.label": { + "message": "选择语言", + "description": "The label for the mobile language switcher dropdown" + }, + "theme.TOCCollapsible.toggleButtonLabel": { + "message": "本页总览", + "description": "The label used by the button on the collapsible TOC component" + }, + "theme.blog.post.readMore": { + "message": "阅读更多", + "description": "The label used in blog post item excerpts to link to full blog posts" + }, + "theme.blog.post.readMoreLabel": { + "message": "阅读 {title} 的全文", + "description": "The ARIA label for the link to full blog posts from excerpts" + }, + "theme.blog.post.readingTime.plurals": { + "message": "阅读需 {readingTime} 分钟", + "description": "Pluralized label for \"{readingTime} min read\". Use as much plural forms (separated by \"|\") as your language support (see https://www.unicode.org/cldr/cldr-aux/charts/34/supplemental/language_plural_rules.html)" + }, + "theme.CodeBlock.copy": { + "message": "复制", + "description": "The copy button label on code blocks" + }, + "theme.CodeBlock.copied": { + "message": "复制成功", + "description": "The copied button label on code blocks" + }, + "theme.CodeBlock.copyButtonAriaLabel": { + "message": "复制代码到剪贴板", + "description": "The ARIA label for copy code blocks button" + }, + "theme.CodeBlock.wordWrapToggle": { + "message": "切换自动换行", + "description": "The title attribute for toggle word wrapping button of code block lines" + }, + "theme.docs.breadcrumbs.home": { + "message": "主页面", + "description": "The ARIA label for the home page in the breadcrumbs" + }, + "theme.docs.sidebar.collapseButtonTitle": { + "message": "收起侧边栏", + "description": "The title attribute for collapse button of doc sidebar" + }, + "theme.docs.sidebar.collapseButtonAriaLabel": { + "message": "收起侧边栏", + "description": "The title attribute for collapse button of doc sidebar" + }, + "theme.docs.sidebar.navAriaLabel": { + "message": "文档侧边栏", + "description": "The ARIA label for the sidebar navigation" + }, + "theme.docs.sidebar.closeSidebarButtonAriaLabel": { + "message": "关闭导航栏", + "description": "The ARIA label for close button of mobile sidebar" + }, + "theme.navbar.mobileSidebarSecondaryMenu.backButtonLabel": { + "message": "← 回到主菜单", + "description": "The label of the back button to return to main menu, inside the mobile navbar sidebar secondary menu (notably used to display the docs sidebar)" + }, + "theme.docs.sidebar.toggleSidebarButtonAriaLabel": { + "message": "切换导航栏", + "description": "The ARIA label for hamburger menu button of mobile navigation" + }, + "theme.navbar.mobileDropdown.collapseButton.expandAriaLabel": { + "message": "Expand the dropdown", + "description": "The ARIA label of the button to expand the mobile dropdown navbar item" + }, + "theme.navbar.mobileDropdown.collapseButton.collapseAriaLabel": { + "message": "Collapse the dropdown", + "description": "The ARIA label of the button to collapse the mobile dropdown navbar item" + }, + "theme.docs.sidebar.expandButtonTitle": { + "message": "展开侧边栏", + "description": "The ARIA label and title attribute for expand button of doc sidebar" + }, + "theme.docs.sidebar.expandButtonAriaLabel": { + "message": "展开侧边栏", + "description": "The ARIA label and title attribute for expand button of doc sidebar" + }, + "theme.blog.post.plurals": { + "message": "{count} 篇博文", + "description": "Pluralized label for \"{count} posts\". Use as much plural forms (separated by \"|\") as your language support (see https://www.unicode.org/cldr/cldr-aux/charts/34/supplemental/language_plural_rules.html)" + }, + "theme.blog.tagTitle": { + "message": "{nPosts} 含有标签「{tagName}」", + "description": "The title of the page for a blog tag" + }, + "theme.blog.author.pageTitle": { + "message": "{authorName} - {nPosts}", + "description": "The title of the page for a blog author" + }, + "theme.blog.authorsList.pageTitle": { + "message": "作者", + "description": "The title of the authors page" + }, + "theme.blog.authorsList.viewAll": { + "message": "查看所有作者", + "description": "The label of the link targeting the blog authors page" + }, + "theme.blog.author.noPosts": { + "message": "该作者尚未撰写任何文章。", + "description": "The text for authors with 0 blog post" + }, + "theme.contentVisibility.unlistedBanner.title": { + "message": "未列出页", + "description": "The unlisted content banner title" + }, + "theme.contentVisibility.unlistedBanner.message": { + "message": "此页面未列出。搜索引擎不会对其索引,只有拥有直接链接的用户才能访问。", + "description": "The unlisted content banner message" + }, + "theme.contentVisibility.draftBanner.title": { + "message": "草稿页", + "description": "The draft content banner title" + }, + "theme.contentVisibility.draftBanner.message": { + "message": "此页面是草稿,仅在开发环境中可见,不会包含在正式版本中。", + "description": "The draft content banner message" + }, + "theme.ErrorPageContent.tryAgain": { + "message": "重试", + "description": "The label of the button to try again rendering when the React error boundary captures an error" + }, + "theme.common.skipToMainContent": { + "message": "跳到主要内容", + "description": "The skip to content label used for accessibility, allowing to rapidly navigate to main content with keyboard tab/enter navigation" + }, + "theme.tags.tagsPageTitle": { + "message": "标签", + "description": "The title of the tag list page" + }, + "homepage.tagline": { + "message": "SSH 服务器管理工具", + "description": "The homepage tagline" + }, + "homepage.installButton": { + "message": "安装", + "description": "The homepage install button label" + }, + "homepage.title": { + "message": "首页", + "description": "The homepage title" + }, + "homepage.features.sshTerminal.title": { + "message": "SSH 终端访问" + }, + "homepage.features.sshTerminal.description": { + "message": "功能完善的终端,支持分屏(最多 4 个面板)和标签页系统。可自定义主题、字体和配置。" + }, + "homepage.features.fileManager.title": { + "message": "远程文件管理" + }, + "homepage.features.fileManager.description": { + "message": "管理远程服务器上的文件,支持代码、图片、音频和视频。无缝上传、下载、重命名、删除和移动文件。" + }, + "homepage.features.docker.title": { + "message": "Docker 管理" + }, + "homepage.features.docker.description": { + "message": "控制容器的启动、停止、暂停和删除。查看统计信息并通过 docker exec 终端管理容器。" + }, + "homepage.features.tunnels.title": { + "message": "SSH 隧道管理" + }, + "homepage.features.tunnels.description": { + "message": "创建和管理 SSH 隧道,具备自动重连和健康监控功能,安全访问远程服务。" + }, + "homepage.features.hostManager.title": { + "message": "主机与凭据管理" + }, + "homepage.features.hostManager.description": { + "message": "使用标签、文件夹和可复用凭据保存和组织 SSH 连接。自动化 SSH 密钥部署到多台服务器。" + }, + "homepage.features.serverMonitoring.title": { + "message": "服务器监控" + }, + "homepage.features.serverMonitoring.description": { + "message": "监控已连接服务器的 CPU、内存、磁盘使用率、网络活动、运行时间和系统信息。" + }, + "homepage.features.rbac.title": { + "message": "基于角色的访问控制" + }, + "homepage.features.rbac.description": { + "message": "创建角色并在用户间共享主机。通过 OIDC、双因素认证和用户会话系统管理权限。" + }, + "homepage.features.multiPlatform.title": { + "message": "多平台支持" + }, + "homepage.features.multiPlatform.description": { + "message": "提供 Web 应用、桌面应用(Windows、macOS、Linux)和移动应用,界面现代化。" + } +} diff --git a/i18n/zh-Hans/docusaurus-plugin-content-docs/current.json b/i18n/zh-Hans/docusaurus-plugin-content-docs/current.json new file mode 100644 index 0000000..4894930 --- /dev/null +++ b/i18n/zh-Hans/docusaurus-plugin-content-docs/current.json @@ -0,0 +1,42 @@ +{ + "sidebar.docsSidebar.category.Installation": { + "message": "安装", + "description": "The label for category Installation in sidebar docsSidebar" + }, + "sidebar.docsSidebar.category.Server": { + "message": "服务端", + "description": "The label for category Server in sidebar docsSidebar" + }, + "sidebar.docsSidebar.category.Connector": { + "message": "连接器", + "description": "The label for category Connector in sidebar docsSidebar" + }, + "sidebar.docsSidebar.category.Setup": { + "message": "配置", + "description": "The label for category Setup in sidebar docsSidebar" + }, + "sidebar.docsSidebar.category.Features": { + "message": "功能", + "description": "The label for category Features in sidebar docsSidebar" + }, + "sidebar.docsSidebar.category.Authentication": { + "message": "认证", + "description": "The label for category Authentication in sidebar docsSidebar" + }, + "sidebar.docsSidebar.category.Networking": { + "message": "网络", + "description": "The label for category Networking in sidebar docsSidebar" + }, + "sidebar.docsSidebar.category.Data": { + "message": "数据", + "description": "The label for category Data in sidebar docsSidebar" + }, + "sidebar.docsSidebar.doc.Contributing": { + "message": "贡献指南", + "description": "The label for the doc item Contributing in sidebar docsSidebar" + }, + "sidebar.docsSidebar.doc.Translations": { + "message": "翻译", + "description": "The label for the doc item Translations in sidebar docsSidebar" + } +} diff --git a/i18n/zh-Hans/docusaurus-plugin-content-docs/current/contributing.md b/i18n/zh-Hans/docusaurus-plugin-content-docs/current/contributing.md new file mode 100644 index 0000000..6a3f4b9 --- /dev/null +++ b/i18n/zh-Hans/docusaurus-plugin-content-docs/current/contributing.md @@ -0,0 +1,51 @@ +# 贡献指南 + +## 前置要求 + +- [Node.js](https://nodejs.org/en/download/)(使用 v24 构建) +- [NPM](https://docs.npmjs.com/downloading-and-installing-node-js-and-npm) +- [Git](https://git-scm.com/downloads) + +## 安装 + +1. 克隆仓库: + ```sh + git clone https://github.com/Termix-SSH/Docs + ``` +2. 安装依赖: + ```sh + npm install + ``` + +## 运行开发服务器 + +执行以下命令: + +```sh +npm run docs:dev +``` + +这将启动前端开发服务器。你可以通过访问 `http://localhost:5173/` 来查看文档。 + +## 贡献流程 + +1. **Fork 仓库**:点击[仓库页面](https://github.com/Termix-SSH/Termix)右上角的 "Fork" 按钮。 +2. **创建新分支**: + ```sh + git checkout -b feature/my-new-feature + ``` +3. **进行修改**:实现你的功能、修复或改进。 +4. **提交更改**: + ```sh + git commit -m "Feature request my new feature" + ``` +5. **推送到你的 Fork**: + ```sh + git push origin feature/my-feature-request + ``` +6. **创建 Pull Request**:前往原始仓库,创建一个带有清晰描述的 PR。 + +## 支持 + +如果你需要帮助或想要为 Termix 提交功能请求,请访问 [Issues](https://github.com/Termix-SSH/Support/issues) 页面,登录后点击 `New Issue`。 +请尽可能详细地描述你的问题,最好使用英文。你也可以加入 [Discord](https://discord.gg/jVQGdvHDrf) 服务器并访问支持频道,不过响应时间可能较长。 diff --git a/i18n/zh-Hans/docusaurus-plugin-content-docs/current/docker.md b/i18n/zh-Hans/docusaurus-plugin-content-docs/current/docker.md new file mode 100644 index 0000000..fcaf1ac --- /dev/null +++ b/i18n/zh-Hans/docusaurus-plugin-content-docs/current/docker.md @@ -0,0 +1,25 @@ +# Docker + +与其他替代方案不同,Termix 不使用 Docker socket,这与 Termix 整体的设计理念一致。它通过 SSH 执行命令来获取信息,这也使得你的配置过程更加简单。 + +## 配置 Docker + +如果系统上已安装 Docker 且在 `$PATH` 中可用,并且当前用户有权限运行 docker,那么 Termix 的 Docker 集成大概率已经可以正常工作。 + +如果系统上安装了 `sudo`,但用户没有在不使用 sudo 的情况下运行 Docker 的权限,你会遇到错误,因为 Termix 不会以 sudo 方式执行任何 Docker 命令。要解决这个问题,请将你的用户添加到 docker 用户组: + +```bash +sudo usermod -aG docker $USER +``` + +你的用户现在已加入 Docker 用户组,应该可以正常连接了! + +## 故障排查 + +- 确保用户可以在不报错、不被提示输入任何密码的情况下运行 `docker --version` +- 尝试通过终端或文件管理器会话确认你的凭据是否正确 + +## 支持 + +如果你需要帮助或想要为 Termix 提交功能请求,请访问 [Issues](https://github.com/Termix-SSH/Support/issues) 页面,登录后点击 `New Issue`。 +请尽可能详细地描述你的问题,最好使用英文。你也可以加入 [Discord](https://discord.gg/jVQGdvHDrf) 服务器并访问支持频道,不过响应时间可能较长。 diff --git a/i18n/zh-Hans/docusaurus-plugin-content-docs/current/environment-variables.md b/i18n/zh-Hans/docusaurus-plugin-content-docs/current/environment-variables.md new file mode 100644 index 0000000..83c85fe --- /dev/null +++ b/i18n/zh-Hans/docusaurus-plugin-content-docs/current/environment-variables.md @@ -0,0 +1,9 @@ +# 环境变量 + +| 配置名称 | 变量 | 默认值 | 说明 | +|----------------|------------------|---------|--------------------------------------------------------------------------------------------------------------------------------------------| +| 端口 | `PORT` | `8080` | 前端 Web 应用的端口。无需暴露额外端口。端口不得在受限范围 `30001–30005` 内。 | +| 启用 SSL | `Enable_SSL` | `false` | 参阅 [SSL](/ssl) 了解如何启用 SSL 加密的更多信息。 | +| OIDC Client ID | `OIDC_CLIENT_ID` | `none` | 参阅 [OIDC](/oidc#环境变量) 了解如何通过环境变量覆盖 OIDC 配置的更多信息。 | +| Vite Base Path | `VITE_BASE_PATH` | `/` | 参阅[反向代理](/reverse-proxy#更改基础路径)了解如何更改 Termix 基础路径的更多信息。 | +| PUID/PGID | `PUID` / `PGID` | `1000` | 将容器内部用户映射到宿主机上的用户 | diff --git a/i18n/zh-Hans/docusaurus-plugin-content-docs/current/features.md b/i18n/zh-Hans/docusaurus-plugin-content-docs/current/features.md new file mode 100644 index 0000000..35b8560 --- /dev/null +++ b/i18n/zh-Hans/docusaurus-plugin-content-docs/current/features.md @@ -0,0 +1,88 @@ +# 功能 + +Termix 部分功能的使用说明。 + +## 管理员设置 + +使用管理员账户登录后,点击左下角的用户名,然后点击 `Admin Settings`。 + +## TOTP + +参阅 [TOTP 文档](https://docs.termix.site/totp)。 + +## OIDC + +OIDC 必须在创建本地账户后,在管理员设置中进行配置。目前尚不支持通过环境变量创建。参阅 [OIDC](https://docs.termix.site/oidc) 了解更多。 + +## 主机管理 + +登录后,点击左上角的 `Host Manager` 按钮来添加 SSH 主机和凭据。在这里你可以创建和自定义主机。 + +## 凭据部署 + +在 `Host Manager` 的 `Add Credential` 标签页中创建一个凭据,选择 SSH 密钥作为认证类型。然后返回 `Credential Viewer` 标签页,点击目标凭据上的绿色箭头图标,按照屏幕上的步骤操作。 + +## SOCKS5 + +在 `Host Manager` 中创建主机时,在 Terminal 标签页底部配置 SOCKS5。 + +## RBAC + +参阅 [RBAC](https://docs.termix.site/rbac) 获取详细的操作步骤列表。 + +## 分屏 + +点击顶部标签栏中某个标签上的 `<|>` 图标(位于关闭按钮旁边),这将在分屏标签中打开 `SSH Tool Sidebar`。按照屏幕上的步骤操作。 + +## SSH 工具 / 命令历史 / 代码片段 / 分屏 + +点击右上角的 `Hammer` 图标,将打开一个包含上述所有功能标签页的侧边栏。 + +## 服务器状态 + +在 `Host Manager` 中配置主机时启用 Server Stats,然后从 `Left Sidebar` 连接到该主机时选择 `Server Details` 选项。参阅[服务器状态](https://docs.termix.site/server-stats)了解更多。 + +## 导出/导入 + +前往 `Admin Settings`,进入 `Database` 标签页。 + +## SSH 终端 + +在 `Host Manager` 中配置主机时启用 Terminal,然后从 `Left Sidebar` 点击 `>_` 图标。 + +## SSH 隧道 + +在 `Host Manager` 中配置主机时设置隧道,然后从 `Left Sidebar` 连接到该主机时选择 `Server Details` 选项。参阅[隧道](https://docs.termix.site/tunnels)了解更多。 + +## SSH 文件管理器 + +在 `Host Manager` 中配置主机时启用 File Manager,然后从 `Left Sidebar` 连接到该主机时选择 `File Manager` 选项。文件管理器仅适用于常见的 Linux 系主机。 + +## Docker 管理 + +在 `Host Manager` 中配置主机时启用 Docker,然后从 `Left Sidebar` 连接到该主机时选择 `Docker` 选项。 + +## 命令面板 + +双击 `Left Shift` 打开。可在用户资料中禁用。 + +## 自定义仪表盘 + +使用仪表盘右上角的 `Gear` 图标进行配置。 + +## 网络拓扑图 + +在仪表盘中启用 Network Graph。使用 Network Graph 上的箭头进行自定义。 + +## 快速连接 + +点击右上角 `Hammer` 旁边的 `Lightning` 图标,输入连接信息后即可连接。 + +## SSL 证书生成 + +参阅 [SSL](https://docs.termix.site/ssl)。 + +## 支持 + +如果你需要帮助或想要为 Termix 提交功能请求,请访问 [Issues](https://github.com/Termix-SSH/Support/issues) 页面,登录后点击 `New Issue`。 +请尽可能详细地描述你的问题,最好使用英文。你也可以加入 [Discord](https://discord.gg/jVQGdvHDrf) 服务器并访问支持频道,不过响应时间可能较长。 diff --git a/i18n/zh-Hans/docusaurus-plugin-content-docs/current/install.md b/i18n/zh-Hans/docusaurus-plugin-content-docs/current/install.md new file mode 100644 index 0000000..d1eccd0 --- /dev/null +++ b/i18n/zh-Hans/docusaurus-plugin-content-docs/current/install.md @@ -0,0 +1,26 @@ +# 安装 + +选择最适合你的平台和使用场景的安装方式。 + +## 服务端 + +用于运行 Termix 后端服务和 Web 前端应用: + +- **[Docker](./install/server/docker.md)** - 使用 Docker 启动 Termix 服务端的最简方式。 +- **[手动安装](./install/server/manual.md)** - 从源码构建和编译 Termix,适用于自定义部署。 +- **[Proxmox](./install/server/proxmox.md)** - 通过 Proxmox VE Helper-Scripts 以容器形式安装到 Proxmox。 + +## 连接器 + +将 Termix 作为客户端/连接器应用运行,连接到服务端(需要先完成上述任一服务端安装): + +- **[Windows](./install/connector/windows.md)** - 下载 Windows 便携版可执行文件或安装程序。 +- **[Linux](./install/connector/linux.md)** - 下载 Linux 便携版可执行文件或安装程序。 +- **[macOS](./install/connector/macos.md)** - 下载 macOS 便携版可执行文件或通过 App Store 安装。 +- **[iOS](./install/connector/ios.md)** - 从 Apple App Store 下载 iOS 移动应用或通过 `.ipa` 安装。 +- **[Android](./install/connector/android.md)** - 从 Google Play Store 下载 Android 移动应用或通过 `.apk` 安装。 + +## 支持 + +如果你需要帮助或想要为 Termix 提交功能请求,请访问 [Issues](https://github.com/Termix-SSH/Support/issues) 页面,登录后点击 `New Issue`。 +请尽可能详细地描述你的问题,最好使用英文。你也可以加入 [Discord](https://discord.gg/jVQGdvHDrf) 服务器并访问支持频道,不过响应时间可能较长。 diff --git a/i18n/zh-Hans/docusaurus-plugin-content-docs/current/install/connector/android.md b/i18n/zh-Hans/docusaurus-plugin-content-docs/current/install/connector/android.md new file mode 100644 index 0000000..c51b3af --- /dev/null +++ b/i18n/zh-Hans/docusaurus-plugin-content-docs/current/install/connector/android.md @@ -0,0 +1,24 @@ +# Android + +[GitHub 仓库](https://github.com/Termix-SSH/Mobile) + +## 安装方式 + +### Google Play Store(推荐) + +使用你的 Android 设备,访问[此链接](https://play.google.com/store/apps/details?id=com.karmaa.termix)或在 Google Play Store 中搜索 `Termix - SSH Companion`。你可以像安装其他应用一样通过 Play Store 安装并打开它。 + +安装并打开后,按照屏幕上的引导连接到你已有的 Termix 实例。如果你喜欢这个应用,请考虑留下真实的评价,这样可以帮助应用在搜索结果中获得更高的排名。 + +### GitHub Releases + +在你的 Android 设备上点击[此链接](https://github.com/Termix-SSH/Mobile/releases/latest/download/termix_android.apk)下载最新版本。要下载特定版本,请访问 [GitHub releases](https://github.com/Termix-SSH/Mobile/releases)。 + +如果你已经熟悉如何安装 APK,安装过程和你预期的完全一样。如果你不熟悉,请参考这份[指南](https://www.lifewire.com/install-apk-on-android-4177185)。 + +安装并打开后,按照屏幕上的引导连接到你已有的 Termix 实例。 + +## 支持 + +如果你需要帮助或想要为 Termix 提交功能请求,请访问 [Issues](https://github.com/Termix-SSH/Support/issues) 页面,登录后点击 `New Issue`。 +请尽可能详细地描述你的问题,最好使用英文。你也可以加入 [Discord](https://discord.gg/jVQGdvHDrf) 服务器并访问支持频道,不过响应时间可能较长。 diff --git a/i18n/zh-Hans/docusaurus-plugin-content-docs/current/install/connector/ios.md b/i18n/zh-Hans/docusaurus-plugin-content-docs/current/install/connector/ios.md new file mode 100644 index 0000000..c52bfc8 --- /dev/null +++ b/i18n/zh-Hans/docusaurus-plugin-content-docs/current/install/connector/ios.md @@ -0,0 +1,24 @@ +# iOS + +[GitHub 仓库](https://github.com/Termix-SSH/Mobile) + +## 安装方式 + +### Apple App Store(推荐) + +使用你的 Apple 设备,访问[此链接](https://apps.apple.com/us/app/termix-ssh-companion/id6752672071)或在 Apple App Store 中搜索 `Termix - SSH Companion`。你可以像安装其他应用一样通过 App Store 安装并打开它。 + +安装并打开后,按照屏幕上的引导连接到你已有的 Termix 实例。如果你喜欢这个应用,请考虑留下真实的评价,这样可以帮助应用在搜索结果中获得更高的排名。 + +### GitHub Releases + +在你的 Apple 设备上点击[此链接](https://github.com/Termix-SSH/Mobile/releases/latest/download/termix_ios.ipa)下载最新版本。要下载特定版本,请访问 [GitHub releases](https://github.com/Termix-SSH/Mobile/releases)。 + +下载后你可以按照常规方式侧载该应用。推荐使用 [AltStore](https://faq.altstore.io/) 进行侧载。 + +安装并打开后,按照屏幕上的引导连接到你已有的 Termix 实例。 + +## 支持 + +如果你需要帮助或想要为 Termix 提交功能请求,请访问 [Issues](https://github.com/Termix-SSH/Support/issues) 页面,登录后点击 `New Issue`。 +请尽可能详细地描述你的问题,最好使用英文。你也可以加入 [Discord](https://discord.gg/jVQGdvHDrf) 服务器并访问支持频道,不过响应时间可能较长。 diff --git a/i18n/zh-Hans/docusaurus-plugin-content-docs/current/install/connector/linux.md b/i18n/zh-Hans/docusaurus-plugin-content-docs/current/install/connector/linux.md new file mode 100644 index 0000000..66e5875 --- /dev/null +++ b/i18n/zh-Hans/docusaurus-plugin-content-docs/current/install/connector/linux.md @@ -0,0 +1,76 @@ +# Linux + +## 安装方式 + +### Flatpak(推荐) + +通过 [Flatpak](https://flatpak.org/) 安装: + +```bash +wget https://github.com/Termix-SSH/Termix/releases/latest/download/termix_linux_flatpak.flatpak +flatpak install --user termix_linux_flatpak.flatpak +``` + +**启动:** + +```bash +flatpak run com.karmaa.termix +``` + +**更新:** + +```bash +flatpak update com.karmaa.termix +``` + +**卸载:** + +```bash +flatpak uninstall com.karmaa.termix +``` + +> Termix 目前未上架 Flatpak 官方仓库,未来可能会上架。 + +### GitHub Releases + +点击下方对应你的设备架构和安装类型的下载链接。 + +| 架构 | 类型 | 下载链接 | +| ------ | -------- | ------------------------------------------------------------------------------------------------------------------- | +| x64 | AppImage | [下载](https://github.com/Termix-SSH/Termix/releases/latest/download/termix_linux_x64_appimage.AppImage) | +| x64 | DEB | [下载](https://github.com/Termix-SSH/Termix/releases/latest/download/termix_linux_x64_deb.deb) | +| x64 | 便携版 | [下载](https://github.com/Termix-SSH/Termix/releases/latest/download/termix_linux_x64_portable.tar.gz) | +| arm64 | AppImage | [下载](https://github.com/Termix-SSH/Termix/releases/latest/download/termix_linux_arm64_appimage.AppImage) | +| arm64 | DEB | [下载](https://github.com/Termix-SSH/Termix/releases/latest/download/termix_linux_arm64_deb.deb) | +| arm64 | 便携版 | [下载](https://github.com/Termix-SSH/Termix/releases/latest/download/termix_linux_arm64_portable.tar.gz) | +| armv7l | AppImage | [下载](https://github.com/Termix-SSH/Termix/releases/latest/download/termix_linux_armv7l_appimage.AppImage) | +| armv7l | DEB | [下载](https://github.com/Termix-SSH/Termix/releases/latest/download/termix_linux_armv7l_deb.deb) | +| armv7l | 便携版 | [下载](https://github.com/Termix-SSH/Termix/releases/latest/download/termix_linux_armv7l_portable.tar.gz) | + +如果你使用的是可执行文件版本的 Termix,请在可执行文件所在目录运行以下命令来设置正确的权限: + +``` +chmod +x termix +sudo chown root:root chrome-sandbox +sudo chmod 4755 chrome-sandbox +``` + +启动应用,运行: + +`./termix --no-sandbox` + +请勿使用 `sudo` 启动。 + +### AUR + +可以在[这里](https://aur.archlinux.org/packages/termix-bin)找到。版本可能不是最新的。 + +安装命令示例: +```bash +yay -S termix-bin +``` + +## 支持 + +如果你需要帮助或想要为 Termix 提交功能请求,请访问 [Issues](https://github.com/Termix-SSH/Support/issues) 页面,登录后点击 `New Issue`。 +请尽可能详细地描述你的问题,最好使用英文。你也可以加入 [Discord](https://discord.gg/jVQGdvHDrf) 服务器并访问支持频道,不过响应时间可能较长。 diff --git a/i18n/zh-Hans/docusaurus-plugin-content-docs/current/install/connector/macos.md b/i18n/zh-Hans/docusaurus-plugin-content-docs/current/install/connector/macos.md new file mode 100644 index 0000000..506d62c --- /dev/null +++ b/i18n/zh-Hans/docusaurus-plugin-content-docs/current/install/connector/macos.md @@ -0,0 +1,50 @@ +# macOS + +## 安装方式 + +### Apple App Store(推荐) + +使用你的 Apple 设备,访问[此链接](https://apps.apple.com/us/app/termix-ssh-companion/id6752672071)或在 Apple App Store 中搜索 `Termix - SSH Companion`。你可以像安装其他应用一样通过 App Store 安装并打开它。 + +安装并打开后,按照屏幕上的引导连接到你已有的 Termix 实例。如果你喜欢这个应用,请考虑留下真实的评价,这样可以帮助应用在搜索结果中获得更高的排名。 + +由于 Apple 需要对应用商店中的应用进行人工审核,Termix 更新后可能需要几天时间才能在 App Store 上下载到新版本。无论更新是否已可供下载,都会显示 `Update Required` 界面。 + +### Homebrew + +通过 [Homebrew](https://brew.sh/) 安装: + +```bash +brew tap Termix-SSH/Termix https://github.com/Termix-SSH/Termix.git +brew install --cask termix +``` + +**更新:** + +```bash +brew update +brew upgrade --cask termix +``` + +**卸载:** + +```bash +brew uninstall --cask termix +``` + +> Termix 目前未上架 Homebrew 官方仓库,未来可能会上架。 + +### GitHub Releases + +点击下方对应你的设备架构和安装类型的下载链接。 + +| 架构 | 类型 | 下载链接 | +| --------- | ---- | ------------------------------------------------------------------------------------------------------------ | +| Universal | DMG | [下载](https://github.com/Termix-SSH/Termix/releases/latest/download/termix_macos_universal_dmg.dmg) | +| x64 | DMG | [下载](https://github.com/Termix-SSH/Termix/releases/latest/download/termix_macos_x64_dmg.dmg) | +| arm64 | DMG | [下载](https://github.com/Termix-SSH/Termix/releases/latest/download/termix_macos_arm64_dmg.dmg) | + +## 支持 + +如果你需要帮助或想要为 Termix 提交功能请求,请访问 [Issues](https://github.com/Termix-SSH/Support/issues) 页面,登录后点击 `New Issue`。 +请尽可能详细地描述你的问题,最好使用英文。你也可以加入 [Discord](https://discord.gg/jVQGdvHDrf) 服务器并访问支持频道,不过响应时间可能较长。 diff --git a/i18n/zh-Hans/docusaurus-plugin-content-docs/current/install/connector/windows.md b/i18n/zh-Hans/docusaurus-plugin-content-docs/current/install/connector/windows.md new file mode 100644 index 0000000..3ee6644 --- /dev/null +++ b/i18n/zh-Hans/docusaurus-plugin-content-docs/current/install/connector/windows.md @@ -0,0 +1,45 @@ +# Windows + +## 安装方式 + +### Chocolatey(推荐) + +通过 [Chocolatey](https://community.chocolatey.org/packages/termix-ssh/) 安装: + +```powershell +choco install termix-ssh +``` + +**更新:** + +```powershell +choco upgrade termix-ssh +``` + +**卸载:** + +```powershell +choco uninstall termix-ssh +``` + +所有命令都会提示你授权运行安装脚本,该脚本会下载并安装 `.msi` 文件。 + +由于 Chocolatey 需要对应用商店中的应用进行人工审核,Termix 更新后可能需要几天时间才能在 Chocolatey 上下载到新版本。无论更新是否已可供下载,都会显示 `Update Required` 界面。 + +### GitHub Releases + +点击下方对应你的设备架构和安装类型的下载链接。 + +| 架构 | 类型 | 下载链接 | +| ---- | -------- | -------------------------------------------------------------------------------------------------------------- | +| x64 | NSIS | [下载](https://github.com/Termix-SSH/Termix/releases/latest/download/termix_windows_x64_nsis.exe) | +| x64 | MSI | [下载](https://github.com/Termix-SSH/Termix/releases/latest/download/termix_windows_x64_msi.msi) | +| x64 | 便携版 | [下载](https://github.com/Termix-SSH/Termix/releases/latest/download/termix_windows_x64_portable.zip) | +| ia32 | NSIS | [下载](https://github.com/Termix-SSH/Termix/releases/latest/download/termix_windows_ia32_nsis.exe) | +| ia32 | MSI | [下载](https://github.com/Termix-SSH/Termix/releases/latest/download/termix_windows_ia32_msi.msi) | +| ia32 | 便携版 | [下载](https://github.com/Termix-SSH/Termix/releases/latest/download/termix_windows_ia32_portable.zip) | + +## 支持 + +如果你需要帮助或想要为 Termix 提交功能请求,请访问 [Issues](https://github.com/Termix-SSH/Support/issues) 页面,登录后点击 `New Issue`。 +请尽可能详细地描述你的问题,最好使用英文。你也可以加入 [Discord](https://discord.gg/jVQGdvHDrf) 服务器并访问支持频道,不过响应时间可能较长。 diff --git a/i18n/zh-Hans/docusaurus-plugin-content-docs/current/install/server/docker.md b/i18n/zh-Hans/docusaurus-plugin-content-docs/current/install/server/docker.md new file mode 100644 index 0000000..1a33563 --- /dev/null +++ b/i18n/zh-Hans/docusaurus-plugin-content-docs/current/install/server/docker.md @@ -0,0 +1,100 @@ +# Docker + +使用 Docker 是启动 Termix 服务端最简单的方式。 + +## Docker Run 安装 + +```bash +# Step 1: Create the volume +docker volume create termix-data + +# Step 2: Run the container +docker run -d \ + --name termix \ + --restart unless-stopped \ + -p 8080:8080 \ + -v termix-data:/app/data \ + -e PORT=8080 \ + ghcr.io/lukegus/termix:latest +``` + +## Docker Compose 安装 + +如果需要更完善的配置,可以使用 Docker Compose: + +```yaml +services: + termix: + image: ghcr.io/lukegus/termix:latest + container_name: termix + restart: unless-stopped + ports: + - '8080:8080' + volumes: + - termix-data:/app/data + environment: + PORT: '8080' + +volumes: + termix-data: + driver: local +``` + +运行以下命令启动容器: + +```bash +docker-compose up -d +``` + +## Docker Hub 镜像 + +除了 GHCR,你也可以使用 Docker Hub 镜像: + +```bash +docker run -d \ + --name termix \ + --restart unless-stopped \ + -p 8080:8080 \ + -v termix-data:/app/data \ + -e PORT=8080 \ + bugattiguy527/termix:latest +``` + +或使用 Docker Compose: + +```yaml +services: + termix: + image: bugattiguy527/termix:latest + container_name: termix + restart: unless-stopped + ports: + - '8080:8080' + volumes: + - termix-data:/app/data + environment: + PORT: '8080' + +volumes: + termix-data: + driver: local +``` + +## 指定版本 + +要下载特定版本的 Docker 镜像,可以访问 [GitHub](https://github.com/users/LukeGus/packages/container/package/termix),将 Docker 标签替换为表格中列出的任意一项。 + +你也可以将 docker run/compose 中的 `:latest` 替换为 `:version.x.x.x`,并将 `x.x.x` 改为你想安装的版本号。所有版本列表请参见[此处](https://github.com/Termix-SSH/Termix/releases)。 + +## 环境变量 + +参见[文档](/environment-variables)。 + +## 使用 + +安装完成后,可以通过 `http://localhost:8080`(或你配置的其他端口)访问 Termix。 + +## 支持 + +如果你需要帮助或想要为 Termix 提交功能请求,请访问 [Issues](https://github.com/Termix-SSH/Support/issues) 页面,登录后点击 `New Issue`。 +请尽可能详细地描述你的问题,最好使用英文。你也可以加入 [Discord](https://discord.gg/jVQGdvHDrf) 服务器并访问支持频道,不过响应时间可能较长。 diff --git a/i18n/zh-Hans/docusaurus-plugin-content-docs/current/install/server/manual.md b/i18n/zh-Hans/docusaurus-plugin-content-docs/current/install/server/manual.md new file mode 100644 index 0000000..4a01a43 --- /dev/null +++ b/i18n/zh-Hans/docusaurus-plugin-content-docs/current/install/server/manual.md @@ -0,0 +1,114 @@ +# 手动安装 + +如果你更倾向于从源码手动编译 Termix,请按照以下步骤操作。 + +## 前置要求 + +- Git +- Node.js(v18 或更高版本) +- NPM +- Docker +- Docker Compose +- OpenSSL(使用 https 时需要将其添加到 `PATH` 环境变量中) + +## 安装步骤 + +1. 克隆仓库: + +```bash +git clone https://github.com/Termix-SSH/Termix.git +cd Termix +``` + +2. 安装依赖并构建项目: + +```bash +npm install +npm run build +``` + +3. 启动应用: + +```bash +npm run preview +``` + +:::tip +在生产环境中,建议通过 Nginx 运行网站。Nginx 配置文件位于仓库的 Docker 目录中。 +::: + +4. 启动后端服务: + +```bash +npm run dev:backend +``` + +## 从源码构建 + +如果你想从源码构建 Termix 并创建自己的 Docker 镜像,请按照以下步骤操作: + +### 构建步骤 + +1. 克隆仓库: + +```bash +git clone https://github.com/Termix-SSH/Termix.git +cd Termix +``` + +2. 安装依赖: + +```bash +npm install +``` + +3. 构建前端: + +```bash +npm run build +``` + +4. 构建 Docker 镜像: + +```bash +docker build -t termix:latest -f docker/Dockerfile . +``` + +5. 创建 Docker Compose 文件以使用你构建的镜像: + +```yaml +services: + termix: + image: termix:latest + container_name: termix + restart: unless-stopped + ports: + - '8080:8080' + volumes: + - termix-data:/app/data + environment: + PORT: '8080' + +volumes: + termix-data: + driver: local +``` + +6. 启动容器: + +```bash +docker-compose up -d +``` + +## 环境变量 + +参见[文档](/environment-variables)。 + +## 使用 + +编译并运行后,可以通过 `http://localhost:8080`(或你配置的其他端口)访问 Termix。 + +## 支持 + +如果你需要帮助或想要为 Termix 提交功能请求,请访问 [Issues](https://github.com/Termix-SSH/Support/issues) 页面,登录后点击 `New Issue`。 +请尽可能详细地描述你的问题,最好使用英文。你也可以加入 [Discord](https://discord.gg/jVQGdvHDrf) 服务器并访问支持频道,不过响应时间可能较长。 diff --git a/i18n/zh-Hans/docusaurus-plugin-content-docs/current/install/server/proxmox.md b/i18n/zh-Hans/docusaurus-plugin-content-docs/current/install/server/proxmox.md new file mode 100644 index 0000000..be44997 --- /dev/null +++ b/i18n/zh-Hans/docusaurus-plugin-content-docs/current/install/server/proxmox.md @@ -0,0 +1,19 @@ +# Proxmox + +## Proxmox VE Helper-Scripts + +[链接](https://community-scripts.github.io/ProxmoxVE/scripts?id=termix) + +**安装/更新:** +```bash +bash -c "$(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main/ct/termix.sh)" +``` + +## 环境变量 + +参见[文档](/environment-variables)。 + +## 支持 + +如果你需要帮助或想要为 Termix 提交功能请求,请访问 [Issues](https://github.com/Termix-SSH/Support/issues) 页面,登录后点击 `New Issue`。 +请尽可能详细地描述你的问题,最好使用英文。你也可以加入 [Discord](https://discord.gg/jVQGdvHDrf) 服务器并访问支持频道,不过响应时间可能较长。 diff --git a/i18n/zh-Hans/docusaurus-plugin-content-docs/current/json-import.md b/i18n/zh-Hans/docusaurus-plugin-content-docs/current/json-import.md new file mode 100644 index 0000000..4bae432 --- /dev/null +++ b/i18n/zh-Hans/docusaurus-plugin-content-docs/current/json-import.md @@ -0,0 +1,366 @@ +# JSON 导入格式 + +使用本指南创建 JSON 文件,以批量导入 SSH 主机。 + +## 必填字段 + +- **`ip`** - 主机 IP 地址(string) +- **`port`** - SSH 端口(number,1-65535) +- **`username`** - SSH 用户名(string) +- **`authType`** - 认证类型:`"password"`、`"key"`、`"credential"` 或 `"none"` + +## 认证字段 + +### 密码认证 + +- **`password`** - 当 authType 为 "password" 时必填(string) + +### 密钥认证 + +- **`key`** - SSH 私钥内容(string)- 当 authType 为 "key" 时必填 +- **`keyPassword`** - 可选的密钥口令(string) +- **`keyType`** - 密钥类型(string):`"auto"`(默认)、`"ssh-rsa"`、`"ssh-ed25519"`、`"ecdsa-sha2-nistp256"`、`"ecdsa-sha2-nistp384"`、`"ecdsa-sha2-nistp521"`、`"ssh-dss"`、`"ssh-rsa-sha2-256"`、`"ssh-rsa-sha2-512"` + +### 凭据认证 + +- **`credentialId`** - 已有凭据的 ID(number)- 当 `authType` 为 `"credential"` 时必填 + - 注意:在导入引用凭据的主机之前,必须先在 Termix 中创建凭据。可在凭据查看器中的 `ID:` 文本处找到对应 ID。 +- **`overrideCredentialUsername`** - 覆盖凭据中的用户名(boolean,默认:false)- 仅在使用凭据认证时生效。启用后,将使用主机中指定的用户名而非凭据中的用户名。 + +### 无认证 + +- 无需额外字段。适用于使用证书认证的主机,或认证由外部处理的场景。 + +## 组织字段 + +- **`name`** - 显示名称(string,未提供时自动生成为 `username@ip`) +- **`folder`** - 组织文件夹(string,默认:"Default") +- **`tags`** - 标签字符串数组(array,默认:[]) +- **`pin`** - 置顶到主机列表顶部(boolean,默认:false) +- **`notes`** - 关于主机的备注(string,可选) + +## 功能开关 + +- **`enableTerminal`** - 启用终端访问(boolean,默认:true) +- **`enableTunnel`** - 启用 SSH 隧道(boolean,默认:true) +- **`enableFileManager`** - 启用文件管理器访问(boolean,默认:true) +- **`enableDocker`** - 启用 Docker 集成(boolean,默认:false) +- **`defaultPath`** - 文件管理器的默认目录路径(string,默认:"/") + +## 隧道配置 + +为此主机配置 SSH 端口转发隧道: + +- **`tunnelConnections`** - 隧道对象数组(array,默认:[]) + - **`sourcePort`** - Termix 服务器上的本地端口(number,1-65535) + - **`endpointPort`** - 目标服务器上的远程端口(number,1-65535) + - **`endpointHost`** - 目标主机名称(string)- 必须匹配已有主机的名称或 `username@ip` 格式 + - **`maxRetries`** - 失败时的重试次数(number,0-100,默认:3) + - **`retryInterval`** - 重试间隔秒数(number,1-3600,默认:10) + - **`autoStart`** - Termix 启动时自动开启隧道(boolean,默认:false) + +## 高级配置 + +### SOCKS5 代理配置 + +为 SSH 连接配置 SOCKS 代理(单个代理或代理链): + +- **`useSocks5`** - 启用 SOCKS5 代理(boolean,默认:false) +- **`socks5Host`** - SOCKS5 代理主机地址(string)- 用于单代理模式 +- **`socks5Port`** - SOCKS5 代理端口(number,1-65535,默认:1080)- 用于单代理模式 +- **`socks5Username`** - SOCKS5 代理用户名(string,可选)- 用于单代理模式 +- **`socks5Password`** - SOCKS5 代理密码(string,可选)- 用于单代理模式 +- **`socks5ProxyChain`** - 代理链节点数组(array,默认:[])- 用于代理链模式 + - **`host`** - 代理服务器主机名或 IP(string) + - **`port`** - 代理服务器端口(number,1-65535) + - **`type`** - 代理协议版本:`4` 表示 SOCKS4,`5` 表示 SOCKS5(number) + - **`username`** - 代理认证用户名(string,可选) + - **`password`** - 代理认证密码(string,可选) + +**注意:** 请选择单代理模式(使用 `socks5Host`、`socks5Port` 等)或代理链模式(使用 `socks5ProxyChain`)其中之一。如果 `socks5ProxyChain` 中有条目,将优先使用代理链而非单代理设置。 + +### 统计配置 + +配置主机监控和统计数据收集: + +- **`statsConfig`** - 统计配置对象 + - **`enabledWidgets`** - 已启用的组件类型数组(array,默认:["cpu", "memory", "disk", "network", "uptime", "system", "login_stats"]) + - 可用组件:`"cpu"`、`"memory"`、`"disk"`、`"network"`、`"uptime"`、`"processes"`、`"system"`、`"login_stats"` + - **`statusCheckEnabled`** - 启用定期状态检查(boolean,默认:true) + - **`statusCheckInterval`** - 状态检查间隔秒数(number,5-3600,默认:30) + - **`metricsEnabled`** - 启用指标收集(boolean,默认:true) + - **`metricsInterval`** - 指标收集间隔秒数(number,5-3600,默认:30) + +### 跳板主机(堡垒机/代理主机) + +配置通过中间服务器的多跳 SSH 连接: + +- **`jumpHosts`** - 跳板主机对象数组(array,默认:[]) + - **`hostId`** - 用作跳板主机的已有 Termix 主机 ID(number) + - 可在主机查看器中的 `ID:` 文本处找到对应 ID。 + +### 快捷操作 + +使用已保存的代码片段配置一键命令: + +- **`quickActions`** - 快捷操作对象数组(array,默认:[]) + - **`name`** - 操作的显示名称(string) + - **`snippetId`** - 要执行的已有代码片段 ID(number) + - 注意:在导入引用代码片段的主机之前,必须先在 Termix 中创建代码片段。可在 SSH 工具栏中的 `ID:` 文本处找到对应 ID。 + +### 终端配置 + +自定义终端外观和行为: + +- **`terminalConfig`** - 终端配置对象(可选) + - **`cursorBlink`** - 启用光标闪烁(boolean,默认:true) + - **`cursorStyle`** - 光标样式:`"block"`、`"underline"` 或 `"bar"`(string,默认:"block") + - **`fontSize`** - 字体大小,单位像素(number,8-24,默认:14) + - **`fontFamily`** - 字体族名称(string,默认:"monospace") + - **`letterSpacing`** - 字间距,单位像素(number,-2 到 10,默认:0) + - **`lineHeight`** - 行高倍数(number,1.0-2.0,默认:1.0) + - **`theme`** - 颜色主题名称(string,默认:"termixDark") + - **`scrollback`** - 回滚缓冲区大小,单位行(number,1000-100000,默认:10000) + - **`bellStyle`** - 响铃通知样式:`"none"`、`"sound"`、`"visual"` 或 `"both"`(string,默认:"none") + - **`rightClickSelectsWord`** - 右键选择单词(boolean,默认:false) + - **`fastScrollModifier`** - 快速滚动修饰键:`"alt"`、`"ctrl"` 或 `"shift"`(string,默认:"alt") + - **`fastScrollSensitivity`** - 快速滚动灵敏度(number,1-10,默认:5) + - **`minimumContrastRatio`** - 文本最低对比度(number,1-21,默认:1) + - **`backspaceMode`** - 退格键模式:`"normal"` 或 `"control-h"`(string,默认:"normal") + - **`agentForwarding`** - 启用 SSH agent 转发(boolean,默认:false) + - **`environmentVariables`** - 环境变量对象数组(array,默认:[]) + - **`key`** - 变量名(string) + - **`value`** - 变量值(string) + - **`startupSnippetId`** - 终端启动时运行的代码片段 ID(number,可为 null) + - **`autoMosh`** - 可用时自动使用 Mosh(boolean,默认:false) + - **`moshCommand`** - 自定义 Mosh 命令(string,默认:"mosh") + - **`sudoPasswordAutoFill`** - 自动填充 sudo 密码(boolean,默认:false) + - **`sudoPassword`** - 用于 sudo 自动填充的密码(string,可选) + +### 高级 SSH 设置 + +- **`forceKeyboardInteractive`** - 强制使用键盘交互认证(boolean,默认:false) + +## JSON 结构示例 + +### 基本结构 + +导入文件必须是包含 `"hosts"` 数组的 JSON 对象,或者文件本身直接是主机对象的数组。 + +```json +{ + "hosts": [ + { + "name": "Web Server - Production", + "ip": "192.168.1.100", + "port": 22, + "username": "admin", + "authType": "password", + "password": "your_secure_password_here", + "folder": "Production", + "tags": ["web", "production", "nginx"], + "pin": true, + "notes": "Main production web server running Nginx. Contact ops@company.com for access.", + "enableTerminal": true, + "enableTunnel": false, + "enableFileManager": true, + "enableDocker": false, + "defaultPath": "/var/www" + }, + { + "name": "Database Server", + "ip": "192.168.1.101", + "port": 22, + "username": "dbadmin", + "authType": "key", + "key": "-----BEGIN OPENSSH PRIVATE KEY-----\nYour SSH private key content here\n-----END OPENSSH PRIVATE KEY-----", + "keyPassword": "optional_key_passphrase", + "keyType": "ssh-ed25519", + "folder": "Production", + "tags": ["database", "production", "postgresql"], + "pin": false, + "notes": "PostgreSQL production database. Requires VPN access.", + "enableTerminal": true, + "enableTunnel": true, + "enableFileManager": false, + "enableDocker": false, + "tunnelConnections": [ + { + "sourcePort": 5432, + "endpointPort": 5432, + "endpointHost": "Web Server - Production", + "maxRetries": 3, + "retryInterval": 10, + "autoStart": true + } + ], + "statsConfig": { + "enabledWidgets": ["cpu", "memory", "disk", "network", "uptime"], + "statusCheckEnabled": true, + "statusCheckInterval": 30, + "metricsEnabled": true, + "metricsInterval": 30 + } + }, + { + "name": "Development Server", + "ip": "192.168.1.102", + "port": 2222, + "username": "developer", + "authType": "credential", + "credentialId": 1, + "overrideCredentialUsername": false, + "folder": "Development", + "tags": ["dev", "testing"], + "pin": false, + "notes": "Development environment for testing new features.", + "enableTerminal": true, + "enableTunnel": false, + "enableFileManager": true, + "enableDocker": true, + "defaultPath": "/home/developer" + }, + { + "name": "Private Network Server", + "ip": "10.0.0.50", + "port": 22, + "username": "sysadmin", + "authType": "password", + "password": "secure_password", + "folder": "Infrastructure", + "tags": ["bastion", "jump-host"], + "notes": "Jump host for accessing internal network servers.", + "enableTerminal": true, + "enableTunnel": true, + "enableFileManager": true, + "jumpHosts": [ + { + "hostId": 1 + } + ], + "quickActions": [ + { + "name": "System Update", + "snippetId": 5 + }, + { + "name": "Check Disk Space", + "snippetId": 12 + } + ] + }, + { + "name": "Certificate-Based Server", + "ip": "192.168.1.200", + "port": 22, + "username": "certuser", + "authType": "none", + "folder": "Secure Hosts", + "tags": ["cert-auth", "secure"], + "notes": "Uses certificate-based authentication. Cert must be installed in SSH agent.", + "enableTerminal": true, + "enableTunnel": false, + "enableFileManager": false, + "forceKeyboardInteractive": false + }, + { + "name": "Server Behind Single Proxy", + "ip": "10.10.10.100", + "port": 22, + "username": "proxyuser", + "authType": "password", + "password": "secure_password", + "folder": "Proxied Hosts", + "tags": ["proxy", "socks5"], + "notes": "Accessible through corporate SOCKS5 proxy.", + "useSocks5": true, + "socks5Host": "proxy.example.com", + "socks5Port": 1080, + "socks5Username": "proxyauth", + "socks5Password": "proxypass" + }, + { + "name": "Server Behind Proxy Chain", + "ip": "172.16.0.50", + "port": 22, + "username": "chainuser", + "authType": "key", + "key": "-----BEGIN OPENSSH PRIVATE KEY-----\nYour SSH private key content here\n-----END OPENSSH PRIVATE KEY-----", + "folder": "Proxied Hosts", + "tags": ["proxy-chain", "multi-hop"], + "notes": "Requires multi-hop proxy chain to access.", + "useSocks5": true, + "socks5ProxyChain": [ + { + "host": "proxy1.example.com", + "port": 1080, + "type": 5, + "username": "proxy1user", + "password": "proxy1pass" + }, + { + "host": "proxy2.internal.net", + "port": 1080, + "type": 5, + "username": "proxy2user", + "password": "proxy2pass" + }, + { + "host": "proxy3.secure.local", + "port": 9050, + "type": 4 + } + ] + }, + { + "name": "Customized Terminal Server", + "ip": "192.168.1.150", + "port": 22, + "username": "devops", + "authType": "password", + "password": "terminal_password", + "folder": "Development", + "tags": ["custom", "terminal"], + "notes": "Server with custom terminal configuration and startup scripts.", + "enableTerminal": true, + "terminalConfig": { + "cursorBlink": true, + "cursorStyle": "bar", + "fontSize": 16, + "fontFamily": "jetbrainsMono", + "letterSpacing": 0.5, + "lineHeight": 1.2, + "theme": "monokai", + "scrollback": 50000, + "bellStyle": "visual", + "rightClickSelectsWord": true, + "fastScrollModifier": "ctrl", + "fastScrollSensitivity": 7, + "minimumContrastRatio": 4, + "backspaceMode": "normal", + "agentForwarding": true, + "environmentVariables": [ + { + "key": "NODE_ENV", + "value": "development" + }, + { + "key": "API_URL", + "value": "https://api.dev.example.com" + } + ], + "startupSnippetId": 3, + "autoMosh": true, + "moshCommand": "mosh --server=/usr/local/bin/mosh-server", + "sudoPasswordAutoFill": true, + "sudoPassword": "sudo_password_here" + } + } + ] +} +``` + +## 支持 + +如果你需要帮助或想要为 Termix 提交功能请求,请访问 [Issues](https://github.com/Termix-SSH/Support/issues) 页面,登录后点击 `New Issue`。 +请尽可能详细地描述你的问题,最好使用英文。你也可以加入 [Discord](https://discord.gg/jVQGdvHDrf) 服务器并访问支持频道,不过响应时间可能较长。 diff --git a/i18n/zh-Hans/docusaurus-plugin-content-docs/current/oidc.md b/i18n/zh-Hans/docusaurus-plugin-content-docs/current/oidc.md new file mode 100644 index 0000000..8bdffcd --- /dev/null +++ b/i18n/zh-Hans/docusaurus-plugin-content-docs/current/oidc.md @@ -0,0 +1,222 @@ +# OIDC (OpenID Connect) + +本指南介绍如何在 Termix 的管理设置中配置 OpenID Connect (OIDC) 身份认证,以启用外部身份提供商认证。 + +## 概述 + +OIDC 允许用户通过外部身份提供商(如 Google、Microsoft、Okta、Auth0 等)进行认证,而无需使用本地账户。这提供了更强的安全性、单点登录能力以及集中化的用户管理。 + +## 前提条件 + +在配置 OIDC 之前,你需要: + +1. **管理员权限**:你必须是 Termix 的管理员 +2. **OIDC 提供商账户**:一个兼容 OIDC 的身份提供商账户 +3. **应用注册**:在你的 OIDC 提供商中注册一个应用 + +## 访问 OIDC 设置 + +1. 在 Termix 中进入 **Admin Settings** +2. 点击 **OIDC** 选项卡 +3. 你将看到包含所有必填字段的 OIDC 配置表单 + +## 必填配置字段 + +### 1. Client ID + +- **用途**:你的应用在 OIDC 提供商中的唯一标识符 +- **获取方式**:在 OIDC 提供商中注册应用时提供 +- **示例**:`myapp-client-id-12345` + +### 2. Client Secret + +- **用途**:用于向 OIDC 提供商验证你的应用身份的密钥 +- **获取方式**:在 OIDC 提供商中注册应用时提供 +- **示例**:`myapp-secret-key-abcdef123456` + +### 3. Authorization URL + +- **用途**:用户被重定向以进行认证的端点 +- **格式**:由 OIDC 提供商提供的 HTTPS URL +- **示例**:`https://your-provider.com/application/o/authorize/` + +### 4. Issuer URL + +- **用途**:标识你的 OIDC 提供商的基础 URL +- **格式**:唯一标识你的提供商的 HTTPS URL +- **示例**:`https://your-provider.com/application/o/termix/` + +### 5. Token URL + +- **用途**:你的应用用授权码交换访问令牌的端点 +- **格式**:由 OIDC 提供商提供的 HTTPS URL +- **示例**:`https://your-provider.com/application/o/token/` + +## 可选配置字段 + +### 6. User Identifier Path + +- **用途**:从 ID token 中提取唯一用户标识符的 JSON 路径 +- **默认值**:`sub`(标准 OIDC 字段) +- **常用值**:`sub`、`user_id`、`id`、`email` +- **示例**:如果你的 ID token 为 `{"user": {"id": "12345"}}`,则使用 `user.id` + +### 7. Display Name Path + +- **用途**:从 ID token 中提取用户显示名称的 JSON 路径 +- **默认值**:`name`(标准 OIDC 字段) +- **常用值**:`name`、`display_name`、`full_name`、`username` +- **示例**:如果你的 ID token 为 `{"profile": {"display_name": "John Doe"}}`,则使用 `profile.display_name` + +### 8. Scopes + +- **用途**:向 OIDC 提供商请求的权限范围 +- **默认值**:`openid email profile` +- **常用 scope**: + - `openid`:OIDC 认证必需 + - `email`:访问用户的电子邮箱地址 + - `profile`:访问基本个人资料信息 + - `groups`:访问用户组成员信息(如果支持) +- **示例**:`openid email profile groups` + +### 9. Override User Info URL + +- **用途**:当你遇到 `Failed to get user information` 错误时,用于覆盖自动生成的 User Info URL +- **常用值**:`https://your-provider.com/application/o/userinfo/` + +## 分步配置指南 + +### 步骤 1:注册你的应用 + +1. 登录你的 OIDC 提供商管理控制台 +2. 创建一个新的应用或客户端 +3. 将应用类型设置为 "Web Application" 或 "Public Client" +4. 记下 Client ID 和 Client Secret + +### 步骤 2:获取提供商 URL + +1. 在你的 OIDC 提供商中,找到 discovery 端点 +2. 记下 Authorization URL、Token URL 和 Issuer URL + +### 步骤 3:配置 Termix + +1. 打开 Termix Admin Settings → OIDC 选项卡 +2. 使用从提供商获取的信息填写所有必填字段 +3. 根据你的提供商的 token 结构调整可选字段 +4. 点击 "Save Configuration" + +### 步骤 4:测试配置 + +1. 登出 +2. 你应该能看到使用 OIDC 提供商登录的选项 +3. 认证流程应该会重定向到你的提供商然后返回 + +## 常见 OIDC 提供商 + +### Google + +- **Authorization URL**: `https://accounts.google.com/o/oauth2/v2/auth` +- **Token URL**: `https://oauth2.googleapis.com/token` +- **Issuer URL**: `https://accounts.google.com` +- **Scopes**: `openid email profile` + +### Microsoft (Azure AD) + +- **Authorization URL**: `https://login.microsoftonline.com/{tenant-id}/oauth2/v2.0/authorize` +- **Token URL**: `https://login.microsoftonline.com/{tenant-id}/oauth2/v2.0/token` +- **Issuer URL**: `https://login.microsoftonline.com/{tenant-id}/v2.0` +- **Scopes**: `openid email profile` + +### Auth0 + +- **Authorization URL**: `https://{your-domain}.auth0.com/authorize` +- **Token URL**: `https://{your-domain}.auth0.com/oauth/token` +- **Issuer URL**: `https://{your-domain}.auth0.com/` +- **Scopes**: `openid email profile` + +### Okta + +- **Authorization URL**: `https://{your-domain}.okta.com/oauth2/v1/authorize` +- **Token URL**: `https://{your-domain}.okta.com/oauth2/v1/token` +- **Issuer URL**: `https://{your-domain}.okta.com/oauth2/default` +- **Scopes**: `openid email profile` + +### Keycloak + +- **Authorization URL**: `https://{your-keycloak.domain}/realms/{your_realm_name}/protocol/openid-connect/auth` +- **Token URL**: `https://{your-keycloak.domain}/realms/{your_realm_name}/protocol/openid-connect/token` +- **Issuer URL**: `https://{your-keycloak-domain}/realms/{your_realm_name}` +- **Valid redirect URIs**: `https://termix.{your-domain}/users/oidc/callback` +- **Scopes**: `openid email profile` + +### Authelia + +- **Authorization URL**: `https://authelia.{your-domain}/api/oidc/authorization` +- **Token URL**: `https://authelia.{your-domain}/api/oidc/token` +- **Issuer URL**: `https://authelia.{your-domain}` +- **Scopes**: `openid email profile` +- **Authelia 配置**: + +```yaml +identity_providers: + oidc: + claims_policies: + legacy: + id_token: ['email', 'email_verified', 'preferred_username', 'name'] + + authorization_policies: + termix: + default_policy: deny + rules: + - policy: one_factor + subject: group:termix + + clients: + - client_id: termix + client_secret: client_secret_here + public: false + authorization_policy: termix + consent_mode: implicit + claims_policy: legacy + grant_types: + - authorization_code + response_types: + - code + scopes: + - openid + - profile + - email + redirect_uris: + - https://termix.{your-domain}/users/oidc/callback + token_endpoint_auth_method: client_secret_post +``` + +## 高级配置 + +### 环境变量 +设置环境变量将优先于数据库中存储的配置。 + +| 变量 | 必填 | 默认值 | +|----------|----------|---------| +| OIDC_CLIENT_ID | 是 | - | +| OIDC_CLIENT_SECRET | 是 | - | +| OIDC_ISSUER_URL | 是 | - | +| OIDC_AUTHORIZATION_URL | 是 | - | +| OIDC_TOKEN_URL | 是 | - | +| OIDC_USERINFO_URL | 否 | "" | +| OIDC_IDENTIFIER_PATH | 否 | "sub" | +| OIDC_NAME_PATH | 否 | "name" | +| OIDC_SCOPES | 否 | "openid email profile" | + +### 关联本地/OIDC 账户 + +使用管理员账户访问 `Admin Settings`,点击 OIDC 主机上的蓝色链条图标,然后输入本地账户的用户名。可以通过已关联的本地账户上的橙色链条图标来移除关联。 + +### 多 OIDC 提供商 + +目前,Termix 一次只支持一个 OIDC 提供商。如需切换提供商,请使用新提供商的详细信息更新配置。 + +## 支持 + +如果你需要帮助或想要为 Termix 提交功能请求,请访问 [Issues](https://github.com/Termix-SSH/Support/issues) 页面,登录后点击 `New Issue`。 +请尽可能详细地描述你的问题,最好使用英文。你也可以加入 [Discord](https://discord.gg/jVQGdvHDrf) 服务器并访问支持频道,不过响应时间可能较长。 diff --git a/i18n/zh-Hans/docusaurus-plugin-content-docs/current/opkssh.md b/i18n/zh-Hans/docusaurus-plugin-content-docs/current/opkssh.md new file mode 100644 index 0000000..307dc4f --- /dev/null +++ b/i18n/zh-Hans/docusaurus-plugin-content-docs/current/opkssh.md @@ -0,0 +1,62 @@ +# OPKSSH (OpenPubkey SSH) + +请访问 [OPKSSH on GitHub](https://github.com/openpubkey/opkssh) 了解 OPKSSH 的安装与文档。 + +目前,Termix 仅支持在终端、文件管理器和 Docker 管理器中使用 OPKSSH。 + +## 配置 + +如果你还没有安装,请使用上面的链接在所有 SSH 服务器上安装 OPKSSH。Termix 会自动在你的实例中安装 OPKSSH。 + +**第 1 步:** +在主机管理器中创建一个 SSH 主机,将认证类型设置为 OPKSSH。 + +**第 2 步:** +在该主机上启动一个 SSH 终端连接。连接时会弹出一个对话框,告诉你 OPKSSH 配置文件的生成路径。 + +**第 3 步:** +编辑生成的 `config.yml` 文件。配置文件位置取决于你的部署方式: +- **开发环境/手动编译**:`db/data/.opk/config.yml` +- **Docker**:`/app/data/.opk/config.yml`(挂载卷) + +```yaml +providers: + - alias: google + issuer: https://accounts.google.com + client_id: YOUR_CLIENT_ID + client_secret: YOUR_CLIENT_SECRET + scopes: openid email profile + access_type: offline + prompt: consent + redirect_uris: + - http://localhost:5173/ssh/opkssh-callback # Development/Manual Compile + - http://localhost:8080/ssh/opkssh-callback # Docker (or your mapped port) +``` + +`remote_redirect_uris` 字段告诉 OPKSSH 在发送给身份提供商的 OAuth 授权请求中包含哪个 URL。它必须与你的 Termix 实例的公开 URL + `/ssh/opkssh-callback` 匹配。Termix 会自动将浏览器的 OAuth 回调代理到 OPKSSH 的内部监听器,你无需暴露任何 OPKSSH 内部端口。 + +有关提供商 issuer URL 和其他配置,请参阅 [OPKSSH config docs](https://github.com/openpubkey/opkssh/blob/main/docs/config.md)。 + +**第 4 步:** +在你的身份提供商(Google、GitHub、Microsoft 等)中配置 OAuth 凭据。 + +**Authorized JavaScript Origins:** +- 开发环境/手动编译:`http://localhost:5173` +- Docker:`http://localhost:8080`(或你映射的端口) +- 反向代理:`https://termix.yourdomain.com` + +**Authorized Redirect URIs:** +将与你的部署方式匹配的 Termix 回调 URL 添加到 OAuth 提供商: + +- 开发环境/手动编译:`http://localhost:5173/ssh/opkssh-callback` +- Docker:`http://localhost:8080/ssh/opkssh-callback`(或你映射的端口) +- 反向代理:`https://termix.yourdomain.com/ssh/opkssh-callback` + +这些必须与 `config.yml` 中的 `redirect_uris` 条目一致。 + +将 OAuth 提供商中的 Client ID 和 Client Secret 复制到你的 `config.yml` 中。 + +## 支持 + +如果你需要帮助或想要为 Termix 提交功能请求,请访问 [Issues](https://github.com/Termix-SSH/Support/issues) 页面,登录后点击 `New Issue`。 +请尽可能详细地描述你的问题,最好使用英文。你也可以加入 [Discord](https://discord.gg/jVQGdvHDrf) 服务器并访问支持频道,不过响应时间可能较长。 diff --git a/i18n/zh-Hans/docusaurus-plugin-content-docs/current/privacy-policy.md b/i18n/zh-Hans/docusaurus-plugin-content-docs/current/privacy-policy.md new file mode 100644 index 0000000..2d250f6 --- /dev/null +++ b/i18n/zh-Hans/docusaurus-plugin-content-docs/current/privacy-policy.md @@ -0,0 +1,68 @@ +本隐私政策适用于由 Luke Gustafson(以下简称"服务提供商")创建的 Termix - SSH Companion 移动应用程序(以下简称"应用程序"),该应用程序作为开源服务提供。此服务按"原样"提供使用。 + +**信息收集与使用** + +当你下载和使用本应用程序时,应用程序会收集相关信息。这些信息可能包括: + +- 你的设备 Internet 协议地址(如 IP 地址) +- 你访问的应用程序页面、访问时间和日期、在这些页面上花费的时间 +- 使用应用程序的时长 +- 你在移动设备上使用的操作系统 + +本应用程序不会收集你移动设备的精确位置信息。 + +本应用程序会收集你设备的位置信息,这有助于服务提供商确定你的大致地理位置,并通过以下方式加以利用: + +- 地理定位服务:服务提供商利用位置数据提供个性化内容、相关推荐和基于位置的服务等功能。 +- 分析与改进:汇总的匿名位置数据帮助服务提供商分析用户行为、识别趋势,并改进应用程序的整体性能和功能。 +- 第三方服务:服务提供商可能会定期向外部服务传输匿名位置数据。这些服务协助其增强应用程序并优化服务内容。 + +服务提供商可能会不时使用你提供的信息与你联系,以向你提供重要信息、必要通知和营销推广。 + +为了获得更好的体验,在使用本应用程序时,服务提供商可能会要求你提供某些个人身份信息。服务提供商请求的信息将由其保留,并按本隐私政策所述方式使用。 + +**第三方访问** + +仅汇总的匿名数据会定期传输至外部服务,以帮助服务提供商改进应用程序及其服务。服务提供商可能会按本隐私声明中描述的方式与第三方共享你的信息。 + +请注意,本应用程序使用的第三方服务有其自己的关于数据处理的隐私政策。以下是本应用程序使用的第三方服务提供商的隐私政策链接: + +- [Expo](https://expo.io/privacy) + +服务提供商可能会在以下情况下披露用户提供的和自动收集的信息: + +- 法律要求时,例如遵守传票或类似的法律程序; +- 当其善意地认为披露对于保护其权利、保护你或他人的安全、调查欺诈行为或响应政府请求是必要的; +- 与其受信任的服务提供商共享,这些服务提供商代表其工作,不会独立使用我们向其披露的信息,并已同意遵守本隐私声明中规定的规则。 + +**退出权利** + +你可以通过卸载应用程序轻松停止所有信息收集。你可以使用移动设备上的标准卸载流程,或通过移动应用商店或网络进行卸载。 + +**数据保留政策** + +服务提供商将在你使用应用程序期间及之后的合理时间内保留用户提供的数据。如果你希望删除通过应用程序提供的用户数据,请通过 mail@termix.site 联系服务提供商,他们将在合理时间内予以回复。 + +**儿童** + +服务提供商不会通过本应用程序故意向 13 岁以下的儿童征集数据或向其进行营销。 + +本应用程序不面向 13 岁以下的任何人。服务提供商不会故意收集 13 岁以下儿童的个人身份信息。如果服务提供商发现 13 岁以下的儿童提供了个人信息,将立即从服务器中删除该信息。如果你是家长或监护人,并且知悉你的孩子向我们提供了个人信息,请联系服务提供商(mail@termix.site),以便其采取必要措施。 + +**安全** + +服务提供商高度重视你的信息保密性。服务提供商提供物理、电子和程序性保障措施,以保护其处理和维护的信息。 + +**变更** + +本隐私政策可能会因任何原因不时更新。服务提供商将通过在本页面发布新的隐私政策来通知你任何变更。建议你定期查阅本隐私政策以了解任何变更,因为继续使用即视为同意所有变更。 + +本隐私政策自 2025-09-30 起生效。 + +**你的同意** + +使用本应用程序即表示你同意按照本隐私政策(包括我们日后的修订)处理你的信息。 + +**联系我们** + +如果你在使用本应用程序时对隐私有任何疑问,或对相关做法有任何问题,请通过电子邮件 mail@termix.site 联系服务提供商。 diff --git a/i18n/zh-Hans/docusaurus-plugin-content-docs/current/rbac.md b/i18n/zh-Hans/docusaurus-plugin-content-docs/current/rbac.md new file mode 100644 index 0000000..a635846 --- /dev/null +++ b/i18n/zh-Hans/docusaurus-plugin-content-docs/current/rbac.md @@ -0,0 +1,42 @@ +# RBAC(基于角色的访问控制) + +RBAC 即基于角色的访问控制(Role Based Access Control)。Termix 通过以下工作流程实现该功能: + +1. 管理员创建角色 +2. 管理员将用户分配到角色(管理员默认分配 "admin" 角色,普通用户分配 "user" 角色) +3. 用户可以编辑主机并选择将该主机共享给某个用户或某个角色 +4. 用户设置共享权限级别(目前仅支持只读权限) +5. 用户设置共享的过期时间(以小时为单位) + +:::warning +要共享主机,该主机**必须**使用凭据作为认证方式(而非密码、无认证、SSH 密钥等)。这是因为你的 SSH 主机数据是使用你的用户密码加密的,共享该主机会降低安全性。使用凭据的方式不仅开发更简便,对用户来说也更安全。 +::: + +## 步骤 1: + +使用管理员账户(如初始用户),登录后点击左下角带有你的用户名的按钮,进入 Admin Settings。 + +然后,访问 `Roles` 选项卡。在那里,你可以点击右上角的 `Create Role` 来创建所需数量的角色。 + +在此菜单中,你还可以编辑或删除角色。 + +## 步骤 2: + +在同一个 Admin Settings 面板中,访问 `User` 选项卡。 + +然后,点击蓝色的编辑图标。向下滚动到 `Role Management` 部分,分配所需的角色。 + +你也可以在此菜单中移除角色。 + +## 步骤 3/4/5: + +无论是管理员还是普通用户,访问 Host Manager 并编辑一个主机。 + +然后,访问 `Sharing` 选项卡。在那里,你可以将主机共享给特定用户并设置持续时间,也可以将主机共享给整个角色。 + +在此菜单中,你还可以设置权限级别(目前仅有一种可用)和持续时间。在下方的表格中,你可以管理所有已共享的用户/角色。 + +## 支持 + +如果你需要帮助或想要为 Termix 提交功能请求,请访问 [Issues](https://github.com/Termix-SSH/Support/issues) 页面,登录后点击 `New Issue`。 +请尽可能详细地描述你的问题,最好使用英文。你也可以加入 [Discord](https://discord.gg/jVQGdvHDrf) 服务器并访问支持频道,不过响应时间可能较长。 diff --git a/i18n/zh-Hans/docusaurus-plugin-content-docs/current/reverse-proxy.md b/i18n/zh-Hans/docusaurus-plugin-content-docs/current/reverse-proxy.md new file mode 100644 index 0000000..3b73c08 --- /dev/null +++ b/i18n/zh-Hans/docusaurus-plugin-content-docs/current/reverse-proxy.md @@ -0,0 +1,76 @@ +# 反向代理 + +部分反向代理可能需要进行一些配置更改才能支持 Termix。 + +## NGINX + +在 `nginx.conf` 中,你需要通过以下方式"升级"连接以支持 WebSocket: + +``` +proxy_set_header Connection 'upgrade'; +``` + +例如: + +``` +location / { + proxy_pass http://localhost:8080; + + proxy_set_header Host $host; + proxy_set_header X-Real-IP $remote_addr; + + proxy_http_version 1.1; + proxy_set_header Upgrade $http_upgrade; + proxy_set_header Connection "upgrade"; +} +``` + +## Traefik + +如果你使用 Docker,在 `docker-compose.yml` 中添加以下 labels,根据需要填写: + +``` +labels: + - "traefik.enable=true" + + - "traefik.http.routers.termix.entrypoints=http" + - "traefik.http.routers.termix.rule=Host(`termix.local.domain.com`) || Host(`termix.domain.com`)" + - "traefik.http.middlewares.termix-https-redirect.redirectscheme.scheme=https" + - "traefik.http.routers.termix.middlewares=termix-https-redirect" + + - "traefik.http.routers.termix-secure.entrypoints=https" + - "traefik.http.routers.termix-secure.rule=Host(`termix.local.domain.com`) || Host(`termix.domain.com`)" + - "traefik.http.routers.termix-secure.tls=true" + - "traefik.http.routers.termix-secure.tls.certresolver=cloudflare" + - "traefik.http.routers.termix-secure.service=termix" + + - "traefik.http.services.termix.loadbalancer.server.port=8080" + + - "traefik.docker.network=proxy" +``` + +## Caddy + +Caddy 原生支持 WebSocket,因此不需要额外配置。 + +``` +termix.domain.com { + reverse_proxy localhost:8080 +} +``` + +## 更改基础路径 + +使用 `VITE_BASE_PATH` 环境变量来配置基础路径。 + +**示例:** +```bash +VITE_BASE_PATH=/termix/ + +http://localhost:8080/termixx +``` + +## 支持 + +如果你需要帮助或想要为 Termix 提交功能请求,请访问 [Issues](https://github.com/Termix-SSH/Support/issues) 页面,登录后点击 `New Issue`。 +请尽可能详细地描述你的问题,最好使用英文。你也可以加入 [Discord](https://discord.gg/jVQGdvHDrf) 服务器并访问支持频道,不过响应时间可能较长。 diff --git a/i18n/zh-Hans/docusaurus-plugin-content-docs/current/security.md b/i18n/zh-Hans/docusaurus-plugin-content-docs/current/security.md new file mode 100644 index 0000000..cc226a4 --- /dev/null +++ b/i18n/zh-Hans/docusaurus-plugin-content-docs/current/security.md @@ -0,0 +1,88 @@ +# 安全 + +请将任何安全漏洞报告至 [GitHub Security](https://github.com/Termix-SSH/Termix/security/advisories)。 + +## 身份认证 + +### 基于密码的登录 + +- **密码哈希**:用户密码不会以明文形式存储在数据库中。它们在存入 `users` 表之前使用 `bcrypt` 进行哈希处理。 +- **登录流程**:登录时,提供的密码会被发送到后端,与存储的哈希值进行比对。 +- **密码重置**:提供了密码重置选项。需要生成一个由服务器记录的临时代码,用户必须提供该代码以证明所有权,然后才能设置新密码。在未登录状态下重置密码将导致所有用户加密数据被删除,因为加密密钥是从密码派生的。 + +### OIDC(外部提供商) + +- Termix 支持通过兼容 OIDC 的外部提供商(如 Google、Okta、Authentik)进行认证。 +- 配置后,用户将被重定向到外部提供商进行认证。认证成功后,Termix 中将创建一个会话。 +- OIDC client secret 在数据库中是加密存储的。 + +### 双因素认证 (TOTP) + +- 用户可以启用基于时间的一次性密码 (TOTP) 作为第二认证因素。 +- 启用后,在密码登录成功后,用户还必须提供身份验证器应用中的有效 TOTP 验证码。 +- TOTP 密钥在 `users` 表中是加密存储的。 + +### 速率限制 + +- 为防止暴力破解攻击,登录尝试按 IP 地址和用户名进行速率限制。 +- 超过速率限制将导致临时锁定。锁定持续 10 分钟。 + +## 会话管理 + +- 认证成功后,将生成一个 JSON Web Token (JWT) 并使用系统级的 `JWT_SECRET` 进行签名。该密钥存储在自动生成的 `.env` 文件中。 +- 此 JWT 被发送到客户端(存储在 cookie 中),并且必须包含在后续的 API 请求中。 +- 后端会为每个受中间件保护的 API 请求验证 JWT 签名和过期时间。 +- 所有已登录设备都会创建会话,这些会话在 `sessions` 数据库表中被追踪,并可在 Admin Settings 中使其失效。重启 Termix 也会清除 `sessions` 表。 + +## 数据加密 + +部分参考了 [Nextcloud](https://docs.nextcloud.com/server/21/admin_manual/configuration_files/encryption_details.html) 的设计。 + +### 概述 + +数据加密由两个主要部分组成: + +1. **数据库文件加密**:整个 SQLite 数据库文件在磁盘上是加密的。 +2. **字段级加密**:数据库中特定的敏感字段使用用户专属密钥单独加密。 + +### 数据库文件加密 + +- 整个 `db.sqlite` 数据库文件使用 AES-256-GCM 加密。 +- 此加密由后端的 `DatabaseFileEncryption` 类处理。 +- 加密密钥(`DATABASE_KEY`)存储在应用的 `.env` 文件中。 +- 应用启动时,数据库文件被解密到内存中。之后会定期重新加密并保存回磁盘。 + +### 字段级加密 + +- **用户专属密钥**:每个用户都有自己的数据加密密钥 (DEK)。该 DEK 用于加密敏感数据。 +- **KEK/DEK 架构**: + 1. 用户的密码通过 PBKDF2 派生出密钥加密密钥 (KEK)。 + 2. 该 KEK 用于加密用户的 DEK。 + 3. 加密后的 DEK 存储在数据库中。 + 4. 用户登录时,其密码解锁 KEK,KEK 再解密 DEK。DEK 在会话期间安全地保存在内存中。 +- **字段加密**:敏感字段(在 `field-crypto.ts` 中定义)使用用户的 DEK 通过 AES-256-GCM 加密。每个特定字段通过 HKDF 派生唯一密钥,结合用户的 DEK、随机盐值、记录 ID 和字段名称。 + +### 密钥 + +- **`JWT_SECRET`**:用于签署 JWT 的系统级密钥。存储在 `.env` 文件中。 +- **`DATABASE_KEY`**:用于整个数据库文件加密的系统级密钥。存储在 `.env` 文件中。 +- **密钥加密密钥 (KEK)**:在运行时从用户密码派生。不进行存储。 +- **数据加密密钥 (DEK)**:每用户一个的密钥,由 KEK 加密后存储在数据库中。仅在用户登录时保存在内存中。 + +## API 安全 + +- 所有后端 API 路由(除了登录/注册等公开路由外)都受保护,需要有效的 JWT。 +- 管理路由需要具有管理员权限的用户的 JWT。 +- CORS 已启用,但默认配置非常宽松。建议在反向代理后运行应用,以便实施更严格的 CORS 策略。 + +## 已知缺陷 + +- **密码传输**:登录/注册时,用户的密码通过 HTTP 请求体发送。传输的安全性完全依赖于部署环境使用 TLS (HTTPS)。提供了 [SSL](https://docs.termix.site/ssl) 工具来解决此问题,强烈建议在生产环境中使用 HTTPS。 +- **`.env` 文件安全**:`JWT_SECRET` 和 `DATABASE_KEY` 存储在应用数据目录中的 `.env` 文件内。对该文件的文件系统访问权限可能危及数据库文件和所有会话的安全。 +- **内存中的数据**:由于数据库被解密并保存在内存中,能够转储应用进程内存的攻击者可能访问到敏感数据。 +- **数据导出**:数据导出功能会解密用户数据并以未加密的 SQLite 文件形式提供。该导出文件高度敏感,必须安全存储。 + +## 支持 + +如果你需要帮助或想要为 Termix 提交功能请求,请访问 [Issues](https://github.com/Termix-SSH/Support/issues) 页面,登录后点击 `New Issue`。 +请尽可能详细地描述你的问题,最好使用英文。你也可以加入 [Discord](https://discord.gg/jVQGdvHDrf) 服务器并访问支持频道,不过响应时间可能较长。 diff --git a/i18n/zh-Hans/docusaurus-plugin-content-docs/current/server-stats.md b/i18n/zh-Hans/docusaurus-plugin-content-docs/current/server-stats.md new file mode 100644 index 0000000..7aa7eb6 --- /dev/null +++ b/i18n/zh-Hans/docusaurus-plugin-content-docs/current/server-stats.md @@ -0,0 +1,34 @@ +# 服务器统计 + +指标收集脚本**仅适用于基于 Linux 的操作系统**。 + +该服务依赖于大多数现代 Linux 发行版(如 Debian、Ubuntu、CentOS、Fedora、Arch 等)上标准的命令和虚拟文件系统(`/proc`)。它**不**兼容 Windows、macOS 或 FreeBSD 等其他 UNIX 变体,因为这些系统使用不同的命令和系统接口来收集指标,需要大量修改才能适配。 + +## 命令 + +为使服务能够收集所有可用指标,远程服务器上的已认证用户必须有权限执行以下命令。这些都是大多数 Linux 系统上标准的非特权工具。 + +| 指标类别 | 命令 | 用途 | +| --------------- | --------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------- | +| **CPU** | `cat /proc/stat` | 读取 CPU 时间统计信息(用户态、系统态、空闲等)以计算使用率。 | +| | `cat /proc/loadavg` | 读取 1 分钟、5 分钟和 15 分钟的系统平均负载。 | +| | `nproc` or `grep -c ^processor /proc/cpuinfo` | 确定可用的 CPU 核心数。 | +| **内存** | `cat /proc/meminfo` | 读取详细的内存统计信息(总量、空闲、可用、缓冲区、缓存)以计算使用情况。 | +| **磁盘** | `df -h -P /` | 获取根文件系统(`/`)的人类可读磁盘使用情况。 | +| | `df -B1 -P /` | 以字节为单位获取根文件系统的磁盘使用情况,用于计算百分比。 | +| **网络** | `ip -o addr show` | 列出网络接口及其关联的 IP 地址。 | +| | `ip -o link show` | 列出网络接口及其运行状态(如 UP/DOWN)。 | +| **运行时间** | `cat /proc/uptime` | 读取系统运行时间(以秒为单位)。 | +| **进程** | `ps aux --sort=-%cpu \| head -n 11` | 列出按 CPU 使用率排序的前 10 个进程。 | +| | `ps aux \| wc -l` | 统计正在运行的进程总数。 | +| | `ps aux \| grep -c ' R '` | 统计处于"运行中"状态的进程数。 | +| **系统信息** | `hostname` | 获取系统的主机名。 | +| | `uname -r` | 获取内核版本号。 | +| | `cat /etc/os-release` | 读取操作系统发行版的名称(如 "Ubuntu 22.04.1 LTS")。 | +| **登录统计** | `last -n 20 -F -w` | 显示最近 20 次成功的用户登录记录。 | +| | `grep 'Failed password' /var/log/auth.log` or `grep 'authentication failure' /var/log/secure` | 读取常见系统日志文件以查找最近 10 次失败的登录尝试。访问权限可能受限。 | + +## 支持 + +如果你需要帮助或想要为 Termix 提交功能请求,请访问 [Issues](https://github.com/Termix-SSH/Support/issues) 页面,登录后点击 `New Issue`。 +请尽可能详细地描述你的问题,最好使用英文。你也可以加入 [Discord](https://discord.gg/jVQGdvHDrf) 服务器并访问支持频道,不过响应时间可能较长。 diff --git a/i18n/zh-Hans/docusaurus-plugin-content-docs/current/ssl.md b/i18n/zh-Hans/docusaurus-plugin-content-docs/current/ssl.md new file mode 100644 index 0000000..73ae963 --- /dev/null +++ b/i18n/zh-Hans/docusaurus-plugin-content-docs/current/ssl.md @@ -0,0 +1,89 @@ +# SSL + +## 快速开始 + +:::warning +如下所示使用自签名证书会导致浏览器显示安全警告。请自行承担风险。 +::: + +### SSL 配置变量 + +| 变量 | 默认值 | 描述 | +| --------------- | -------------------------- | --------------------------------------------- | +| `ENABLE_SSL` | `false` | 启用/禁用 SSL/TLS 加密 | +| `SSL_PORT` | `8443` | HTTPS 连接端口 | +| `SSL_DOMAIN` | `localhost` | SSL 证书的域名 | +| `SSL_CERT_PATH` | `/app/data/ssl/termix.crt` | SSL 证书文件路径(强烈建议使用默认值) | +| `SSL_KEY_PATH` | `/app/data/ssl/termix.key` | SSL 私钥文件路径(强烈建议使用默认值) | + +### 安全变量 + +| 变量 | 默认值 | 描述 | +| -------------- | ------------ | ------------------------- | +| `JWT_SECRET` | 自动生成 | JWT 令牌签名密钥 | +| `DATABASE_KEY` | 自动生成 | 数据库加密密钥 | + +### 示例 .env 文件 + +```env +# SSL/TLS Configuration +ENABLE_SSL=true +SSL_PORT=8443 +SSL_DOMAIN=termix.example.com +PORT=8080 + +# Security Keys (auto-generated by setup script, I do not recommend you overwrite them) +JWT_SECRET=your-64-character-hex-string +DATABASE_KEY=your-64-character-hex-string +``` + +使用自动配置时,SSL 证书有效期为 1 年,到期后会自动重新生成。 + +## 手动 SSL 配置 + +### 1. 生成 SSL 证书 + +#### 自签名证书(开发环境) + +```bash +# Create SSL directory +mkdir -p ./db/data/ssl + +# Generate private key +openssl genrsa -out ./db/data/ssl/termix.key 2048 + +# Generate certificate +openssl req -new -x509 -key ./db/data/ssl/termix.key -out ./db/data/ssl/termix.crt -days 365 \ + -subj "/C=US/ST=State/L=City/O=Termix/OU=IT Department/CN=localhost" \ + -addext "subjectAltName=DNS:localhost,DNS:127.0.0.1,IP:127.0.0.1" + +# Set proper permissions +chmod 600 ./db/data/ssl/termix.key +chmod 644 ./db/data/ssl/termix.crt +``` + +#### Let's Encrypt 证书(生产环境) + +```bash +# Install certbot +sudo apt-get install certbot + +# Generate certificate +sudo certbot certonly --standalone -d your-domain.com + +# Copy certificates to Termix data directory +sudo cp /etc/letsencrypt/live/your-domain.com/fullchain.pem ./db/data/ssl/termix.crt +sudo cp /etc/letsencrypt/live/your-domain.com/privkey.pem ./db/data/ssl/termix.key + +# Set proper permissions +sudo chown $USER:$USER ./db/data/ssl/termix.* +chmod 600 ./db/data/ssl/termix.key +chmod 644 ./db/data/ssl/termix.crt +``` + +然后设置上述环境变量以启用 SSL。 + +## 支持 + +如果你需要帮助或想要为 Termix 提交功能请求,请访问 [Issues](https://github.com/Termix-SSH/Support/issues) 页面,登录后点击 `New Issue`。 +请尽可能详细地描述你的问题,最好使用英文。你也可以加入 [Discord](https://discord.gg/jVQGdvHDrf) 服务器并访问支持频道,不过响应时间可能较长。 diff --git a/i18n/zh-Hans/docusaurus-plugin-content-docs/current/totp.md b/i18n/zh-Hans/docusaurus-plugin-content-docs/current/totp.md new file mode 100644 index 0000000..4acacda --- /dev/null +++ b/i18n/zh-Hans/docusaurus-plugin-content-docs/current/totp.md @@ -0,0 +1,114 @@ +# TOTP(双因素认证) + +## 概述 + +双因素认证 (2FA) 通过要求密码和由身份验证器应用生成的基于时间的一次性密码 (TOTP) 来为你的账户增加额外的安全层。本指南将引导你在 Termix 中设置、管理和使用双因素认证。 + +## 前提条件 + +在设置双因素认证之前,请确保你具备: + +- 一部安装了身份验证器应用的智能手机或设备 +- 一个本地用户名和密码账户,TOTP 无法与 OIDC 配合使用。 + +## 推荐的身份验证器应用 + +- **Google Authenticator** (iOS/Android) +- **Microsoft Authenticator** (iOS/Android) +- **Authy** (iOS/Android/Desktop) +- **1Password** (iOS/Android/Desktop) +- **Bitwarden** (iOS/Android/Desktop) + +## 设置双因素认证 + +### 步骤 1:开始设置 + +1. 进入 **Profile & Security** 部分 +2. 点击 **Security** 选项卡 +3. 点击 **"Enable Two-Factor Authentication"** + +### 步骤 2:扫描二维码 + +1. Termix 将显示一个二维码 +2. 打开你的身份验证器应用并扫描该二维码 +3. 你也可以手动输入二维码下方显示的密钥 + +### 步骤 3:验证设置 + +1. 你的身份验证器应用将生成一个 6 位数的验证码 +2. 在验证字段中输入该验证码 +3. 点击 **"Verify and Enable"** + +### 步骤 4:保存备用码 + +1. 验证成功后,你将收到备用码 +2. 下载或复制这些备用码 +3. 每个备用码只能使用一次 +4. 点击 **"Complete Setup"** 完成设置 + +## 使用双因素认证 + +### 日常登录 + +1. 像往常一样输入你的用户名和密码 +2. 当系统提示时,打开你的身份验证器应用 +3. 输入应用中显示的 6 位数验证码 + +### 验证码生成 + +- TOTP 验证码每 30 秒刷新一次 +- 每个验证码的有效时间有限 +- 如果验证码过期,等待下一个验证码出现即可 + +## 管理双因素认证设置 + +### 查看状态 + +- 在用户个人资料中查看 **Security** 选项卡 +- 状态将显示为 "Enabled" 并带有绿色盾牌图标 + +### 禁用双因素认证 + +1. 进入 **Security** 选项卡 +2. 点击 **"Disable 2FA"** +3. 输入以下任一项: + - 你的账户密码,或 + - 身份验证器应用中的有效 TOTP 验证码 +4. 点击 **"Disable Two-Factor Authentication"** + +### 管理备用码 + +#### 生成新的备用码 + +如果你丢失了现有的备用码: + +1. 进入 **Security** 选项卡 +2. 点击 **"Backup Codes"** +3. 输入你的密码或 TOTP 验证码 +4. 点击 **"Generate New Backup Codes"** +5. 保存新的备用码 + +#### 下载备用码 + +1. 点击备用码旁边的 **"Download"** 按钮 +2. 将下载一个包含所有备用码的文本文件 +3. 将此文件存储在安全的位置 + +## 备用码 + +### 什么是备用码? + +备用码是一次性使用的验证码,允许你在以下情况下访问账户: + +- 丢失了身份验证器设备 +- 无法访问身份验证器应用 + +### 使用备用码 + +1. 登录时,当系统提示输入 TOTP 验证码时 +2. 输入一个备用码来代替常规的 TOTP 验证码 + +## 支持 + +如果你需要帮助或想要为 Termix 提交功能请求,请访问 [Issues](https://github.com/Termix-SSH/Support/issues) 页面,登录后点击 `New Issue`。 +请尽可能详细地描述你的问题,最好使用英文。你也可以加入 [Discord](https://discord.gg/jVQGdvHDrf) 服务器并访问支持频道,不过响应时间可能较长。 diff --git a/i18n/zh-Hans/docusaurus-plugin-content-docs/current/translations.md b/i18n/zh-Hans/docusaurus-plugin-content-docs/current/translations.md new file mode 100644 index 0000000..f4fae52 --- /dev/null +++ b/i18n/zh-Hans/docusaurus-plugin-content-docs/current/translations.md @@ -0,0 +1,14 @@ +# 翻译 + +Termix 使用 Crowdin 来管理翻译。大部分文本通过 Google Translate 批量自动翻译。不过,志愿者可以修正不准确的翻译。 + +请不要直接在 GitHub 上创建 PR 来更新翻译,因为所有翻译均由 Crowdin 管理。 + +## 志愿参与 + +[点击这里](https://crowdin.com/project/termix-ssh)访问 Termix 的 Crowdin 项目。如果你不熟悉 Crowdin 的使用方法,请查看[这篇指南](https://support.crowdin.com/for-translators/)。 + +## 支持 + +如果你需要帮助或想要为 Termix 提交功能请求,请访问 [Issues](https://github.com/Termix-SSH/Support/issues) 页面,登录后点击 `New Issue`。 +请尽可能详细地描述你的问题,最好使用英文。你也可以加入 [Discord](https://discord.gg/jVQGdvHDrf) 服务器并访问支持频道,不过响应时间可能较长。 diff --git a/i18n/zh-Hans/docusaurus-plugin-content-docs/current/tunnels.md b/i18n/zh-Hans/docusaurus-plugin-content-docs/current/tunnels.md new file mode 100644 index 0000000..9bf8dab --- /dev/null +++ b/i18n/zh-Hans/docusaurus-plugin-content-docs/current/tunnels.md @@ -0,0 +1,104 @@ +# SSH 隧道 + +## 理解 SSH 隧道 + +SSH 隧道在本地计算机和远程服务器之间建立连接,使端口上的流量能够安全地双向传输。 + +隧道可以是本地隧道(将本地端口转发到远程)或远程隧道(将远程端口转发到本地)。 + +## 服务器要求 + +### 必需的 SSH 服务器设置 + +为使 SSH 隧道正常工作,目标 SSH 服务器必须在 `/etc/ssh/sshd_config` 中配置以下设置: + +```bash +# Allow port forwarding +AllowTcpForwarding yes + +# Bind remote ports (required for reverse tunnels) +GatewayPorts yes + +# Allow root login (if using root user) +PermitRootLogin yes + +# Allow public key authentication +PubkeyAuthentication yes + +# Allow password authentication (if using passwords) +PasswordAuthentication yes +``` + +修改完成后,重启 SSH 服务: + +```bash +sudo systemctl restart sshd +``` + +### 安装 sshpass + +如果使用密码认证,需要在本地和远程系统上安装 `sshpass`: + +**Debian/Ubuntu:** + +```bash +sudo apt install sshpass +``` + +**CentOS/RHEL/Fedora:** + +```bash +sudo yum install sshpass +# or +sudo dnf install sshpass +``` + +**macOS:** + +```bash +brew install hudochenkov/sshpass/sshpass +``` + +## 配置 + +在主机管理器中添加/编辑主机时,导航到隧道选项卡。在选项卡底部,点击 `Add Tunnel Connection`。 + +### 字段说明: + +**隧道类型:** +- Local (-L):将源主机(你当前添加/编辑的主机)的端口转发到远程目标 +```bash +[ Source ] +localhost:8080 + | + | + v +[ Endpoint ] + | + v +127.0.0.1:8080 +``` +- Remote (-R):将远程目标的端口转发到源主机(你当前添加/编辑的主机) +```bash +[ Endpoint ] +localhost:8080 + | + | + v +[ Source ] + | + v +127.0.0.1:8080 +``` + +**端口:** +- Source:在源主机上被转发/接收的端口(取决于隧道类型) +- Endpoint:在目标主机上被转发/接收的端口(取决于隧道类型) + +**目标 SSH 配置:** +- 在此选择定义远程目标的主机,流量将被转发到该主机或从该主机接收(取决于隧道类型) + +## 支持 + +如果你需要帮助或想要为 Termix 提交功能请求,请访问 [Issues](https://github.com/Termix-SSH/Support/issues) 页面,登录后点击 `New Issue`。 +请尽可能详细地描述你的问题,最好使用英文。你也可以加入 [Discord](https://discord.gg/jVQGdvHDrf) 服务器并访问支持频道,不过响应时间可能较长。 diff --git a/i18n/zh-Hans/docusaurus-theme-classic/footer.json b/i18n/zh-Hans/docusaurus-theme-classic/footer.json new file mode 100644 index 0000000..3acc130 --- /dev/null +++ b/i18n/zh-Hans/docusaurus-theme-classic/footer.json @@ -0,0 +1,42 @@ +{ + "link.title.GitHub": { + "message": "GitHub", + "description": "The title of the footer links column with title=GitHub in the footer" + }, + "link.title.Support": { + "message": "支持", + "description": "The title of the footer links column with title=Support in the footer" + }, + "link.item.label.Termix": { + "message": "Termix", + "description": "The label of footer link with label=Termix linking to https://github.com/Termix-SSH/Termix" + }, + "link.item.label.Mobile": { + "message": "Mobile", + "description": "The label of footer link with label=Mobile linking to https://github.com/Termix-SSH/Mobile" + }, + "link.item.label.Docs": { + "message": "文档", + "description": "The label of footer link with label=Docs linking to https://github.com/Termix-SSH/Docs" + }, + "link.item.label.Support": { + "message": "支持", + "description": "The label of footer link with label=Support linking to https://github.com/Termix-SSH/Support" + }, + "link.item.label.Request Feature": { + "message": "功能请求", + "description": "The label of footer link with label=Request Feature linking to https://github.com/Termix-SSH/Support/issues/new?template=feature_request.yml" + }, + "link.item.label.Report Bug": { + "message": "报告 Bug", + "description": "The label of footer link with label=Report Bug linking to https://github.com/Termix-SSH/Support/issues/new?template=bug_report.yml" + }, + "link.item.label.eMail": { + "message": "邮箱", + "description": "The label of footer link with label=eMail linking to mailto:mail@termix.site" + }, + "copyright": { + "message": "Copyright © 2026 Luke Gustafson. Termix 基于 Apache License 2.0 许可证开源。", + "description": "The footer copyright" + } +} diff --git a/i18n/zh-Hans/docusaurus-theme-classic/navbar.json b/i18n/zh-Hans/docusaurus-theme-classic/navbar.json new file mode 100644 index 0000000..8bd2c17 --- /dev/null +++ b/i18n/zh-Hans/docusaurus-theme-classic/navbar.json @@ -0,0 +1,18 @@ +{ + "title": { + "message": "Termix", + "description": "The title in the navbar" + }, + "logo.alt": { + "message": "Termix Logo", + "description": "The alt text of navbar logo" + }, + "item.label.Docs": { + "message": "文档", + "description": "Navbar item with label Docs" + }, + "item.label.API": { + "message": "API", + "description": "Navbar item with label API" + } +} diff --git a/src/components/homepage/index.tsx b/src/components/homepage/index.tsx index 42d3135..c23b7c6 100644 --- a/src/components/homepage/index.tsx +++ b/src/components/homepage/index.tsx @@ -1,5 +1,6 @@ import type { ReactNode } from 'react'; import clsx from 'clsx'; +import Translate, { translate } from '@docusaurus/Translate'; import Heading from '@theme/Heading'; import styles from './styles.module.css'; @@ -11,75 +12,99 @@ type FeatureItem = { const FeatureList: FeatureItem[] = [ { - title: 'SSH Terminal Access', + title: translate({ + id: 'homepage.features.sshTerminal.title', + message: 'SSH Terminal Access', + }), description: ( - <> + Full-featured terminal with split-screen support (up to 4 panels) and tab system. Customize with themes, fonts, and configurations. - + ), }, { - title: 'Remote File Manager', + title: translate({ + id: 'homepage.features.fileManager.title', + message: 'Remote File Manager', + }), description: ( - <> + Manage files on remote servers with support for code, images, audio, and video. Upload, download, rename, delete, and move files seamlessly. - + ), }, { - title: 'Docker Management', + title: translate({ + id: 'homepage.features.docker.title', + message: 'Docker Management', + }), description: ( - <> + Control containers with start, stop, pause, and remove. View stats and access docker exec terminals for container management. - + ), }, { - title: 'SSH Tunnel Management', + title: translate({ + id: 'homepage.features.tunnels.title', + message: 'SSH Tunnel Management', + }), description: ( - <> + Create and manage SSH tunnels with automatic reconnection and health monitoring for secure access to remote services. - + ), }, { - title: 'Host & Credentials Manager', + title: translate({ + id: 'homepage.features.hostManager.title', + message: 'Host & Credentials Manager', + }), description: ( - <> + Save and organize SSH connections with tags, folders, and reusable credentials. Automate SSH key deployment across servers. - + ), }, { - title: 'Server Monitoring', + title: translate({ + id: 'homepage.features.serverMonitoring.title', + message: 'Server Monitoring', + }), description: ( - <> + Monitor CPU, memory, disk usage, network activity, uptime, and system information on connected servers. - + ), }, { - title: 'Role-Based Access Control', + title: translate({ + id: 'homepage.features.rbac.title', + message: 'Role-Based Access Control', + }), description: ( - <> + Create roles and share hosts across users. Manage permissions with OIDC, 2FA support, and a user session system. - + ), }, { - title: 'Multi-Platform Support', + title: translate({ + id: 'homepage.features.multiPlatform.title', + message: 'Multi-Platform Support', + }), description: ( - <> + Available as a web app, desktop application (Windows, macOS, Linux), and mobile app with a modern interface. - + ), }, ]; diff --git a/src/pages/index.tsx b/src/pages/index.tsx index a1e9171..db85cb5 100644 --- a/src/pages/index.tsx +++ b/src/pages/index.tsx @@ -2,6 +2,7 @@ import type { ReactNode } from 'react'; import clsx from 'clsx'; import Link from '@docusaurus/Link'; import useDocusaurusContext from '@docusaurus/useDocusaurusContext'; +import Translate, { translate } from '@docusaurus/Translate'; import Layout from '@theme/Layout'; import Homepage from '../components/homepage'; import Heading from '@theme/Heading'; @@ -16,10 +17,16 @@ function HomepageHeader() { {siteConfig.title} -

{siteConfig.tagline}

+

+ + SSH server manager + +

- Install + + Install +
@@ -29,7 +36,9 @@ function HomepageHeader() { export default function Home(): ReactNode { return ( - +