From 9b91f0f42e53cbf5530318f2cb94d1a61eab9f4a Mon Sep 17 00:00:00 2001 From: MHSanaei Date: Tue, 7 Jul 2026 23:07:14 +0200 Subject: [PATCH] docs: vendor the documentation site into the monorepo Fold the standalone 3x-ui-docs project (Next.js 16 + Fumadocs, deployed to docs.sanaei.dev) into docs/ so the panel and its documentation share a single source of truth, the way sing-box keeps its docs in-tree. The old repo becomes redundant and can be retired. - Import the full site under docs/ (app, components, content, lib, public, scripts, config). The self-contained pnpm project sits alongside the existing engineering notes with no filename collisions. - Re-point "Edit on GitHub" links from MHSanaei/3x-ui-docs to this repo's docs/content/docs path (docs/lib/shared.ts, docs/app/.../page.tsx). - Add docs-ci.yml and docs-deploy.yml under .github/workflows/, scoped to docs/** and run with working-directory: docs, since GitHub only runs workflows from the repo-root .github/. deploy-static.yml's GitHub Pages publish (CNAME docs.sanaei.dev) carries over unchanged. Follow-up (outside this commit): attach the docs.sanaei.dev custom domain to this repository's Pages (or set the Vercel project's root directory to docs), confirm the site is live from the monorepo, then delete MHSanaei/3x-ui-docs. --- .github/workflows/docs-ci.yml | 46 + .github/workflows/docs-deploy.yml | 67 + docs/.gitattributes | 2 + docs/.gitignore | 31 + docs/.prettierignore | 10 + docs/.prettierrc.json | 7 + docs/CONTRIBUTING.md | 34 + docs/LICENSE | 674 ++ docs/README.md | 133 + docs/app/[lang]/(home)/layout.tsx | 28 + docs/app/[lang]/(home)/page.tsx | 143 + docs/app/[lang]/docs/[[...slug]]/page.tsx | 80 + docs/app/[lang]/docs/layout.tsx | 12 + docs/app/[lang]/layout.tsx | 30 + docs/app/api/search/route.ts | 22 + docs/app/global.css | 32 + docs/app/layout.tsx | 31 + docs/app/llms-full.txt/route.ts | 10 + docs/app/llms.mdx/docs/[[...slug]]/route.ts | 23 + docs/app/llms.txt/route.ts | 8 + docs/app/og/docs/[...slug]/route.tsx | 29 + docs/app/robots.ts | 12 + docs/app/sitemap.ts | 33 + docs/components/home/features.tsx | 49 + docs/components/home/github-stats.tsx | 67 + docs/components/home/install-command.tsx | 56 + docs/components/home/language-switcher.tsx | 45 + docs/components/icons.tsx | 17 + docs/components/logo.tsx | 15 + docs/components/mdx.tsx | 47 + docs/components/mdx/mermaid.tsx | 44 + docs/components/openapi-page.tsx | 6 + docs/components/search-dialog.tsx | 56 + docs/components/tools/api-request-builder.tsx | 76 + .../tools/firewall-rules-generator.tsx | 71 + .../tools/install-command-builder.tsx | 87 + docs/components/tools/outbound-generator.tsx | 277 + docs/components/tools/protocol-wizard.tsx | 79 + .../tools/reality-config-generator.tsx | 152 + .../tools/reverse-proxy-generator.tsx | 69 + docs/components/tools/routing-builder.tsx | 203 + .../components/tools/share-link-inspector.tsx | 82 + docs/components/tools/shared/copy-button.tsx | 46 + docs/components/tools/shared/fields.tsx | 99 + docs/components/tools/shared/output-block.tsx | 31 + .../components/tools/subscription-builder.tsx | 209 + .../tools/telegram-setup-helper.tsx | 114 + docs/components/tools/tool-frame.tsx | 44 + docs/content/docs/en/config/clients.mdx | 67 + docs/content/docs/en/config/inbounds.mdx | 97 + docs/content/docs/en/config/meta.json | 14 + docs/content/docs/en/config/panel.mdx | 77 + docs/content/docs/en/config/reality.mdx | 135 + docs/content/docs/en/config/share-links.mdx | 82 + .../docs/en/config/ssl-certificates.mdx | 181 + docs/content/docs/en/config/subscription.mdx | 86 + docs/content/docs/en/config/transports.mdx | 199 + docs/content/docs/en/guide/first-login.mdx | 124 + docs/content/docs/en/guide/index.mdx | 71 + docs/content/docs/en/guide/installation.mdx | 148 + docs/content/docs/en/guide/meta.json | 5 + .../docs/en/guide/update-uninstall.mdx | 99 + docs/content/docs/en/help/contributing.mdx | 64 + docs/content/docs/en/help/faq.mdx | 47 + docs/content/docs/en/help/meta.json | 5 + docs/content/docs/en/help/migration.mdx | 52 + docs/content/docs/en/help/troubleshooting.mdx | 42 + docs/content/docs/en/index.mdx | 54 + docs/content/docs/en/meta.json | 3 + .../docs/en/operations/backup-restore.mdx | 57 + docs/content/docs/en/operations/meta.json | 12 + .../content/docs/en/operations/multi-node.mdx | 97 + .../docs/en/operations/outbounds-routing.mdx | 157 + .../docs/en/operations/reverse-proxy.mdx | 51 + docs/content/docs/en/operations/security.mdx | 66 + .../docs/en/operations/telegram-bot.mdx | 112 + .../docs/en/reference/api/api-tokens.mdx | 79 + .../docs/en/reference/api/authentication.mdx | 74 + docs/content/docs/en/reference/api/backup.mdx | 37 + .../content/docs/en/reference/api/clients.mdx | 627 + docs/content/docs/en/reference/api/hosts.mdx | 108 + .../docs/en/reference/api/inbounds.mdx | 242 + docs/content/docs/en/reference/api/index.mdx | 40 + docs/content/docs/en/reference/api/meta.json | 19 + docs/content/docs/en/reference/api/nodes.mdx | 183 + docs/content/docs/en/reference/api/server.mdx | 381 + .../docs/en/reference/api/settings.mdx | 122 + .../en/reference/api/subscription-server.mdx | 72 + .../docs/en/reference/api/websocket.mdx | 46 + .../docs/en/reference/api/xray-settings.mdx | 257 + docs/content/docs/en/reference/database.mdx | 64 + docs/content/docs/en/reference/env-vars.mdx | 84 + docs/content/docs/en/reference/meta.json | 5 + .../docs/en/reference/ports-firewall.mdx | 36 + docs/content/docs/fa/config/clients.mdx | 67 + docs/content/docs/fa/config/inbounds.mdx | 97 + docs/content/docs/fa/config/meta.json | 14 + docs/content/docs/fa/config/panel.mdx | 77 + docs/content/docs/fa/config/reality.mdx | 135 + docs/content/docs/fa/config/share-links.mdx | 81 + .../docs/fa/config/ssl-certificates.mdx | 179 + docs/content/docs/fa/config/subscription.mdx | 86 + docs/content/docs/fa/config/transports.mdx | 201 + docs/content/docs/fa/guide/first-login.mdx | 126 + docs/content/docs/fa/guide/index.mdx | 73 + docs/content/docs/fa/guide/installation.mdx | 150 + docs/content/docs/fa/guide/meta.json | 5 + .../docs/fa/guide/update-uninstall.mdx | 99 + docs/content/docs/fa/help/contributing.mdx | 64 + docs/content/docs/fa/help/faq.mdx | 47 + docs/content/docs/fa/help/meta.json | 5 + docs/content/docs/fa/help/migration.mdx | 51 + docs/content/docs/fa/help/troubleshooting.mdx | 42 + docs/content/docs/fa/index.mdx | 54 + docs/content/docs/fa/meta.json | 3 + .../docs/fa/operations/backup-restore.mdx | 57 + docs/content/docs/fa/operations/meta.json | 12 + .../content/docs/fa/operations/multi-node.mdx | 86 + .../docs/fa/operations/outbounds-routing.mdx | 156 + .../docs/fa/operations/reverse-proxy.mdx | 51 + docs/content/docs/fa/operations/security.mdx | 53 + .../docs/fa/operations/telegram-bot.mdx | 112 + .../docs/fa/reference/api/api-tokens.mdx | 80 + .../docs/fa/reference/api/authentication.mdx | 75 + docs/content/docs/fa/reference/api/backup.mdx | 37 + .../content/docs/fa/reference/api/clients.mdx | 628 + docs/content/docs/fa/reference/api/hosts.mdx | 108 + .../docs/fa/reference/api/inbounds.mdx | 242 + docs/content/docs/fa/reference/api/index.mdx | 40 + docs/content/docs/fa/reference/api/meta.json | 19 + docs/content/docs/fa/reference/api/nodes.mdx | 183 + docs/content/docs/fa/reference/api/server.mdx | 381 + .../docs/fa/reference/api/settings.mdx | 122 + .../fa/reference/api/subscription-server.mdx | 73 + .../docs/fa/reference/api/websocket.mdx | 46 + .../docs/fa/reference/api/xray-settings.mdx | 257 + docs/content/docs/fa/reference/database.mdx | 65 + docs/content/docs/fa/reference/env-vars.mdx | 85 + docs/content/docs/fa/reference/meta.json | 5 + .../docs/fa/reference/ports-firewall.mdx | 36 + docs/content/docs/ru/config/clients.mdx | 72 + docs/content/docs/ru/config/inbounds.mdx | 100 + docs/content/docs/ru/config/meta.json | 14 + docs/content/docs/ru/config/panel.mdx | 77 + docs/content/docs/ru/config/reality.mdx | 142 + docs/content/docs/ru/config/share-links.mdx | 82 + .../docs/ru/config/ssl-certificates.mdx | 181 + docs/content/docs/ru/config/subscription.mdx | 90 + docs/content/docs/ru/config/transports.mdx | 205 + docs/content/docs/ru/guide/first-login.mdx | 130 + docs/content/docs/ru/guide/index.mdx | 71 + docs/content/docs/ru/guide/installation.mdx | 151 + docs/content/docs/ru/guide/meta.json | 5 + .../docs/ru/guide/update-uninstall.mdx | 101 + docs/content/docs/ru/help/contributing.mdx | 69 + docs/content/docs/ru/help/faq.mdx | 47 + docs/content/docs/ru/help/meta.json | 5 + docs/content/docs/ru/help/migration.mdx | 52 + docs/content/docs/ru/help/troubleshooting.mdx | 42 + docs/content/docs/ru/index.mdx | 54 + docs/content/docs/ru/meta.json | 3 + .../docs/ru/operations/backup-restore.mdx | 61 + docs/content/docs/ru/operations/meta.json | 12 + .../content/docs/ru/operations/multi-node.mdx | 102 + .../docs/ru/operations/outbounds-routing.mdx | 169 + .../docs/ru/operations/reverse-proxy.mdx | 52 + docs/content/docs/ru/operations/security.mdx | 66 + .../docs/ru/operations/telegram-bot.mdx | 120 + .../docs/ru/reference/api/api-tokens.mdx | 80 + .../docs/ru/reference/api/authentication.mdx | 75 + docs/content/docs/ru/reference/api/backup.mdx | 37 + .../content/docs/ru/reference/api/clients.mdx | 628 + docs/content/docs/ru/reference/api/hosts.mdx | 109 + .../docs/ru/reference/api/inbounds.mdx | 242 + docs/content/docs/ru/reference/api/index.mdx | 40 + docs/content/docs/ru/reference/api/meta.json | 19 + docs/content/docs/ru/reference/api/nodes.mdx | 183 + docs/content/docs/ru/reference/api/server.mdx | 382 + .../docs/ru/reference/api/settings.mdx | 122 + .../ru/reference/api/subscription-server.mdx | 73 + .../docs/ru/reference/api/websocket.mdx | 46 + .../docs/ru/reference/api/xray-settings.mdx | 258 + docs/content/docs/ru/reference/database.mdx | 64 + docs/content/docs/ru/reference/env-vars.mdx | 86 + docs/content/docs/ru/reference/meta.json | 5 + .../docs/ru/reference/ports-firewall.mdx | 36 + docs/content/docs/zh/config/clients.mdx | 64 + docs/content/docs/zh/config/inbounds.mdx | 90 + docs/content/docs/zh/config/meta.json | 14 + docs/content/docs/zh/config/panel.mdx | 73 + docs/content/docs/zh/config/reality.mdx | 120 + docs/content/docs/zh/config/share-links.mdx | 75 + .../docs/zh/config/ssl-certificates.mdx | 180 + docs/content/docs/zh/config/subscription.mdx | 66 + docs/content/docs/zh/config/transports.mdx | 184 + docs/content/docs/zh/guide/first-login.mdx | 107 + docs/content/docs/zh/guide/index.mdx | 56 + docs/content/docs/zh/guide/installation.mdx | 146 + docs/content/docs/zh/guide/meta.json | 5 + .../docs/zh/guide/update-uninstall.mdx | 98 + docs/content/docs/zh/help/contributing.mdx | 62 + docs/content/docs/zh/help/faq.mdx | 45 + docs/content/docs/zh/help/meta.json | 5 + docs/content/docs/zh/help/migration.mdx | 47 + docs/content/docs/zh/help/troubleshooting.mdx | 42 + docs/content/docs/zh/index.mdx | 51 + docs/content/docs/zh/meta.json | 3 + .../docs/zh/operations/backup-restore.mdx | 54 + docs/content/docs/zh/operations/meta.json | 12 + .../content/docs/zh/operations/multi-node.mdx | 79 + .../docs/zh/operations/outbounds-routing.mdx | 147 + .../docs/zh/operations/reverse-proxy.mdx | 44 + docs/content/docs/zh/operations/security.mdx | 62 + .../docs/zh/operations/telegram-bot.mdx | 110 + .../docs/zh/reference/api/api-tokens.mdx | 75 + .../docs/zh/reference/api/authentication.mdx | 72 + docs/content/docs/zh/reference/api/backup.mdx | 35 + .../content/docs/zh/reference/api/clients.mdx | 511 + docs/content/docs/zh/reference/api/hosts.mdx | 108 + .../docs/zh/reference/api/inbounds.mdx | 186 + docs/content/docs/zh/reference/api/index.mdx | 37 + docs/content/docs/zh/reference/api/meta.json | 19 + docs/content/docs/zh/reference/api/nodes.mdx | 182 + docs/content/docs/zh/reference/api/server.mdx | 381 + .../docs/zh/reference/api/settings.mdx | 101 + .../zh/reference/api/subscription-server.mdx | 59 + .../docs/zh/reference/api/websocket.mdx | 44 + .../docs/zh/reference/api/xray-settings.mdx | 257 + docs/content/docs/zh/reference/database.mdx | 62 + docs/content/docs/zh/reference/env-vars.mdx | 82 + docs/content/docs/zh/reference/meta.json | 5 + .../docs/zh/reference/ports-firewall.mdx | 35 + docs/eslint.config.mjs | 21 + docs/lib/cn.ts | 1 + docs/lib/github-stats.ts | 72 + docs/lib/i18n-ui.ts | 11 + docs/lib/i18n.ts | 29 + docs/lib/layout.shared.tsx | 60 + docs/lib/openapi.ts | 7 + docs/lib/shared.ts | 40 + docs/lib/site-i18n.ts | 236 + docs/lib/source.ts | 42 + docs/lib/xray/api-client.test.ts | 67 + docs/lib/xray/api-client.ts | 49 + docs/lib/xray/base64.test.ts | 33 + docs/lib/xray/base64.ts | 42 + docs/lib/xray/firewall.test.ts | 38 + docs/lib/xray/firewall.ts | 65 + docs/lib/xray/install.test.ts | 69 + docs/lib/xray/install.ts | 74 + docs/lib/xray/links.test.ts | 137 + docs/lib/xray/links.ts | 202 + docs/lib/xray/outbounds.test.ts | 198 + docs/lib/xray/outbounds.ts | 229 + docs/lib/xray/protocols.test.ts | 35 + docs/lib/xray/protocols.ts | 87 + docs/lib/xray/reality.test.ts | 83 + docs/lib/xray/reality.ts | 114 + docs/lib/xray/reverse-proxy.test.ts | 43 + docs/lib/xray/reverse-proxy.ts | 68 + docs/lib/xray/routing.test.ts | 127 + docs/lib/xray/routing.ts | 137 + docs/lib/xray/subscription.test.ts | 161 + docs/lib/xray/subscription.ts | 249 + docs/lib/xray/telegram.test.ts | 99 + docs/lib/xray/telegram.ts | 115 + docs/next.config.mjs | 21 + docs/package.json | 52 + docs/pnpm-lock.yaml | 8881 ++++++++++++++ docs/pnpm-workspace.yaml | 11 + docs/postcss.config.mjs | 7 + docs/proxy.ts | 13 + docs/public/CNAME | 1 + docs/public/favicon.png | Bin 0 -> 82914 bytes docs/public/icon.png | Bin 0 -> 271518 bytes docs/public/logo-dark.png | Bin 0 -> 231347 bytes docs/public/logo-light.png | Bin 0 -> 229932 bytes docs/public/openapi.json | 10103 ++++++++++++++++ docs/scripts/gen-openapi.ts | 32 + docs/source.config.ts | 30 + docs/tsconfig.json | 36 + docs/vercel.json | 6 + docs/vitest.config.ts | 11 + 283 files changed, 44179 insertions(+) create mode 100644 .github/workflows/docs-ci.yml create mode 100644 .github/workflows/docs-deploy.yml create mode 100644 docs/.gitattributes create mode 100644 docs/.gitignore create mode 100644 docs/.prettierignore create mode 100644 docs/.prettierrc.json create mode 100644 docs/CONTRIBUTING.md create mode 100644 docs/LICENSE create mode 100644 docs/README.md create mode 100644 docs/app/[lang]/(home)/layout.tsx create mode 100644 docs/app/[lang]/(home)/page.tsx create mode 100644 docs/app/[lang]/docs/[[...slug]]/page.tsx create mode 100644 docs/app/[lang]/docs/layout.tsx create mode 100644 docs/app/[lang]/layout.tsx create mode 100644 docs/app/api/search/route.ts create mode 100644 docs/app/global.css create mode 100644 docs/app/layout.tsx create mode 100644 docs/app/llms-full.txt/route.ts create mode 100644 docs/app/llms.mdx/docs/[[...slug]]/route.ts create mode 100644 docs/app/llms.txt/route.ts create mode 100644 docs/app/og/docs/[...slug]/route.tsx create mode 100644 docs/app/robots.ts create mode 100644 docs/app/sitemap.ts create mode 100644 docs/components/home/features.tsx create mode 100644 docs/components/home/github-stats.tsx create mode 100644 docs/components/home/install-command.tsx create mode 100644 docs/components/home/language-switcher.tsx create mode 100644 docs/components/icons.tsx create mode 100644 docs/components/logo.tsx create mode 100644 docs/components/mdx.tsx create mode 100644 docs/components/mdx/mermaid.tsx create mode 100644 docs/components/openapi-page.tsx create mode 100644 docs/components/search-dialog.tsx create mode 100644 docs/components/tools/api-request-builder.tsx create mode 100644 docs/components/tools/firewall-rules-generator.tsx create mode 100644 docs/components/tools/install-command-builder.tsx create mode 100644 docs/components/tools/outbound-generator.tsx create mode 100644 docs/components/tools/protocol-wizard.tsx create mode 100644 docs/components/tools/reality-config-generator.tsx create mode 100644 docs/components/tools/reverse-proxy-generator.tsx create mode 100644 docs/components/tools/routing-builder.tsx create mode 100644 docs/components/tools/share-link-inspector.tsx create mode 100644 docs/components/tools/shared/copy-button.tsx create mode 100644 docs/components/tools/shared/fields.tsx create mode 100644 docs/components/tools/shared/output-block.tsx create mode 100644 docs/components/tools/subscription-builder.tsx create mode 100644 docs/components/tools/telegram-setup-helper.tsx create mode 100644 docs/components/tools/tool-frame.tsx create mode 100644 docs/content/docs/en/config/clients.mdx create mode 100644 docs/content/docs/en/config/inbounds.mdx create mode 100644 docs/content/docs/en/config/meta.json create mode 100644 docs/content/docs/en/config/panel.mdx create mode 100644 docs/content/docs/en/config/reality.mdx create mode 100644 docs/content/docs/en/config/share-links.mdx create mode 100644 docs/content/docs/en/config/ssl-certificates.mdx create mode 100644 docs/content/docs/en/config/subscription.mdx create mode 100644 docs/content/docs/en/config/transports.mdx create mode 100644 docs/content/docs/en/guide/first-login.mdx create mode 100644 docs/content/docs/en/guide/index.mdx create mode 100644 docs/content/docs/en/guide/installation.mdx create mode 100644 docs/content/docs/en/guide/meta.json create mode 100644 docs/content/docs/en/guide/update-uninstall.mdx create mode 100644 docs/content/docs/en/help/contributing.mdx create mode 100644 docs/content/docs/en/help/faq.mdx create mode 100644 docs/content/docs/en/help/meta.json create mode 100644 docs/content/docs/en/help/migration.mdx create mode 100644 docs/content/docs/en/help/troubleshooting.mdx create mode 100644 docs/content/docs/en/index.mdx create mode 100644 docs/content/docs/en/meta.json create mode 100644 docs/content/docs/en/operations/backup-restore.mdx create mode 100644 docs/content/docs/en/operations/meta.json create mode 100644 docs/content/docs/en/operations/multi-node.mdx create mode 100644 docs/content/docs/en/operations/outbounds-routing.mdx create mode 100644 docs/content/docs/en/operations/reverse-proxy.mdx create mode 100644 docs/content/docs/en/operations/security.mdx create mode 100644 docs/content/docs/en/operations/telegram-bot.mdx create mode 100644 docs/content/docs/en/reference/api/api-tokens.mdx create mode 100644 docs/content/docs/en/reference/api/authentication.mdx create mode 100644 docs/content/docs/en/reference/api/backup.mdx create mode 100644 docs/content/docs/en/reference/api/clients.mdx create mode 100644 docs/content/docs/en/reference/api/hosts.mdx create mode 100644 docs/content/docs/en/reference/api/inbounds.mdx create mode 100644 docs/content/docs/en/reference/api/index.mdx create mode 100644 docs/content/docs/en/reference/api/meta.json create mode 100644 docs/content/docs/en/reference/api/nodes.mdx create mode 100644 docs/content/docs/en/reference/api/server.mdx create mode 100644 docs/content/docs/en/reference/api/settings.mdx create mode 100644 docs/content/docs/en/reference/api/subscription-server.mdx create mode 100644 docs/content/docs/en/reference/api/websocket.mdx create mode 100644 docs/content/docs/en/reference/api/xray-settings.mdx create mode 100644 docs/content/docs/en/reference/database.mdx create mode 100644 docs/content/docs/en/reference/env-vars.mdx create mode 100644 docs/content/docs/en/reference/meta.json create mode 100644 docs/content/docs/en/reference/ports-firewall.mdx create mode 100644 docs/content/docs/fa/config/clients.mdx create mode 100644 docs/content/docs/fa/config/inbounds.mdx create mode 100644 docs/content/docs/fa/config/meta.json create mode 100644 docs/content/docs/fa/config/panel.mdx create mode 100644 docs/content/docs/fa/config/reality.mdx create mode 100644 docs/content/docs/fa/config/share-links.mdx create mode 100644 docs/content/docs/fa/config/ssl-certificates.mdx create mode 100644 docs/content/docs/fa/config/subscription.mdx create mode 100644 docs/content/docs/fa/config/transports.mdx create mode 100644 docs/content/docs/fa/guide/first-login.mdx create mode 100644 docs/content/docs/fa/guide/index.mdx create mode 100644 docs/content/docs/fa/guide/installation.mdx create mode 100644 docs/content/docs/fa/guide/meta.json create mode 100644 docs/content/docs/fa/guide/update-uninstall.mdx create mode 100644 docs/content/docs/fa/help/contributing.mdx create mode 100644 docs/content/docs/fa/help/faq.mdx create mode 100644 docs/content/docs/fa/help/meta.json create mode 100644 docs/content/docs/fa/help/migration.mdx create mode 100644 docs/content/docs/fa/help/troubleshooting.mdx create mode 100644 docs/content/docs/fa/index.mdx create mode 100644 docs/content/docs/fa/meta.json create mode 100644 docs/content/docs/fa/operations/backup-restore.mdx create mode 100644 docs/content/docs/fa/operations/meta.json create mode 100644 docs/content/docs/fa/operations/multi-node.mdx create mode 100644 docs/content/docs/fa/operations/outbounds-routing.mdx create mode 100644 docs/content/docs/fa/operations/reverse-proxy.mdx create mode 100644 docs/content/docs/fa/operations/security.mdx create mode 100644 docs/content/docs/fa/operations/telegram-bot.mdx create mode 100644 docs/content/docs/fa/reference/api/api-tokens.mdx create mode 100644 docs/content/docs/fa/reference/api/authentication.mdx create mode 100644 docs/content/docs/fa/reference/api/backup.mdx create mode 100644 docs/content/docs/fa/reference/api/clients.mdx create mode 100644 docs/content/docs/fa/reference/api/hosts.mdx create mode 100644 docs/content/docs/fa/reference/api/inbounds.mdx create mode 100644 docs/content/docs/fa/reference/api/index.mdx create mode 100644 docs/content/docs/fa/reference/api/meta.json create mode 100644 docs/content/docs/fa/reference/api/nodes.mdx create mode 100644 docs/content/docs/fa/reference/api/server.mdx create mode 100644 docs/content/docs/fa/reference/api/settings.mdx create mode 100644 docs/content/docs/fa/reference/api/subscription-server.mdx create mode 100644 docs/content/docs/fa/reference/api/websocket.mdx create mode 100644 docs/content/docs/fa/reference/api/xray-settings.mdx create mode 100644 docs/content/docs/fa/reference/database.mdx create mode 100644 docs/content/docs/fa/reference/env-vars.mdx create mode 100644 docs/content/docs/fa/reference/meta.json create mode 100644 docs/content/docs/fa/reference/ports-firewall.mdx create mode 100644 docs/content/docs/ru/config/clients.mdx create mode 100644 docs/content/docs/ru/config/inbounds.mdx create mode 100644 docs/content/docs/ru/config/meta.json create mode 100644 docs/content/docs/ru/config/panel.mdx create mode 100644 docs/content/docs/ru/config/reality.mdx create mode 100644 docs/content/docs/ru/config/share-links.mdx create mode 100644 docs/content/docs/ru/config/ssl-certificates.mdx create mode 100644 docs/content/docs/ru/config/subscription.mdx create mode 100644 docs/content/docs/ru/config/transports.mdx create mode 100644 docs/content/docs/ru/guide/first-login.mdx create mode 100644 docs/content/docs/ru/guide/index.mdx create mode 100644 docs/content/docs/ru/guide/installation.mdx create mode 100644 docs/content/docs/ru/guide/meta.json create mode 100644 docs/content/docs/ru/guide/update-uninstall.mdx create mode 100644 docs/content/docs/ru/help/contributing.mdx create mode 100644 docs/content/docs/ru/help/faq.mdx create mode 100644 docs/content/docs/ru/help/meta.json create mode 100644 docs/content/docs/ru/help/migration.mdx create mode 100644 docs/content/docs/ru/help/troubleshooting.mdx create mode 100644 docs/content/docs/ru/index.mdx create mode 100644 docs/content/docs/ru/meta.json create mode 100644 docs/content/docs/ru/operations/backup-restore.mdx create mode 100644 docs/content/docs/ru/operations/meta.json create mode 100644 docs/content/docs/ru/operations/multi-node.mdx create mode 100644 docs/content/docs/ru/operations/outbounds-routing.mdx create mode 100644 docs/content/docs/ru/operations/reverse-proxy.mdx create mode 100644 docs/content/docs/ru/operations/security.mdx create mode 100644 docs/content/docs/ru/operations/telegram-bot.mdx create mode 100644 docs/content/docs/ru/reference/api/api-tokens.mdx create mode 100644 docs/content/docs/ru/reference/api/authentication.mdx create mode 100644 docs/content/docs/ru/reference/api/backup.mdx create mode 100644 docs/content/docs/ru/reference/api/clients.mdx create mode 100644 docs/content/docs/ru/reference/api/hosts.mdx create mode 100644 docs/content/docs/ru/reference/api/inbounds.mdx create mode 100644 docs/content/docs/ru/reference/api/index.mdx create mode 100644 docs/content/docs/ru/reference/api/meta.json create mode 100644 docs/content/docs/ru/reference/api/nodes.mdx create mode 100644 docs/content/docs/ru/reference/api/server.mdx create mode 100644 docs/content/docs/ru/reference/api/settings.mdx create mode 100644 docs/content/docs/ru/reference/api/subscription-server.mdx create mode 100644 docs/content/docs/ru/reference/api/websocket.mdx create mode 100644 docs/content/docs/ru/reference/api/xray-settings.mdx create mode 100644 docs/content/docs/ru/reference/database.mdx create mode 100644 docs/content/docs/ru/reference/env-vars.mdx create mode 100644 docs/content/docs/ru/reference/meta.json create mode 100644 docs/content/docs/ru/reference/ports-firewall.mdx create mode 100644 docs/content/docs/zh/config/clients.mdx create mode 100644 docs/content/docs/zh/config/inbounds.mdx create mode 100644 docs/content/docs/zh/config/meta.json create mode 100644 docs/content/docs/zh/config/panel.mdx create mode 100644 docs/content/docs/zh/config/reality.mdx create mode 100644 docs/content/docs/zh/config/share-links.mdx create mode 100644 docs/content/docs/zh/config/ssl-certificates.mdx create mode 100644 docs/content/docs/zh/config/subscription.mdx create mode 100644 docs/content/docs/zh/config/transports.mdx create mode 100644 docs/content/docs/zh/guide/first-login.mdx create mode 100644 docs/content/docs/zh/guide/index.mdx create mode 100644 docs/content/docs/zh/guide/installation.mdx create mode 100644 docs/content/docs/zh/guide/meta.json create mode 100644 docs/content/docs/zh/guide/update-uninstall.mdx create mode 100644 docs/content/docs/zh/help/contributing.mdx create mode 100644 docs/content/docs/zh/help/faq.mdx create mode 100644 docs/content/docs/zh/help/meta.json create mode 100644 docs/content/docs/zh/help/migration.mdx create mode 100644 docs/content/docs/zh/help/troubleshooting.mdx create mode 100644 docs/content/docs/zh/index.mdx create mode 100644 docs/content/docs/zh/meta.json create mode 100644 docs/content/docs/zh/operations/backup-restore.mdx create mode 100644 docs/content/docs/zh/operations/meta.json create mode 100644 docs/content/docs/zh/operations/multi-node.mdx create mode 100644 docs/content/docs/zh/operations/outbounds-routing.mdx create mode 100644 docs/content/docs/zh/operations/reverse-proxy.mdx create mode 100644 docs/content/docs/zh/operations/security.mdx create mode 100644 docs/content/docs/zh/operations/telegram-bot.mdx create mode 100644 docs/content/docs/zh/reference/api/api-tokens.mdx create mode 100644 docs/content/docs/zh/reference/api/authentication.mdx create mode 100644 docs/content/docs/zh/reference/api/backup.mdx create mode 100644 docs/content/docs/zh/reference/api/clients.mdx create mode 100644 docs/content/docs/zh/reference/api/hosts.mdx create mode 100644 docs/content/docs/zh/reference/api/inbounds.mdx create mode 100644 docs/content/docs/zh/reference/api/index.mdx create mode 100644 docs/content/docs/zh/reference/api/meta.json create mode 100644 docs/content/docs/zh/reference/api/nodes.mdx create mode 100644 docs/content/docs/zh/reference/api/server.mdx create mode 100644 docs/content/docs/zh/reference/api/settings.mdx create mode 100644 docs/content/docs/zh/reference/api/subscription-server.mdx create mode 100644 docs/content/docs/zh/reference/api/websocket.mdx create mode 100644 docs/content/docs/zh/reference/api/xray-settings.mdx create mode 100644 docs/content/docs/zh/reference/database.mdx create mode 100644 docs/content/docs/zh/reference/env-vars.mdx create mode 100644 docs/content/docs/zh/reference/meta.json create mode 100644 docs/content/docs/zh/reference/ports-firewall.mdx create mode 100644 docs/eslint.config.mjs create mode 100644 docs/lib/cn.ts create mode 100644 docs/lib/github-stats.ts create mode 100644 docs/lib/i18n-ui.ts create mode 100644 docs/lib/i18n.ts create mode 100644 docs/lib/layout.shared.tsx create mode 100644 docs/lib/openapi.ts create mode 100644 docs/lib/shared.ts create mode 100644 docs/lib/site-i18n.ts create mode 100644 docs/lib/source.ts create mode 100644 docs/lib/xray/api-client.test.ts create mode 100644 docs/lib/xray/api-client.ts create mode 100644 docs/lib/xray/base64.test.ts create mode 100644 docs/lib/xray/base64.ts create mode 100644 docs/lib/xray/firewall.test.ts create mode 100644 docs/lib/xray/firewall.ts create mode 100644 docs/lib/xray/install.test.ts create mode 100644 docs/lib/xray/install.ts create mode 100644 docs/lib/xray/links.test.ts create mode 100644 docs/lib/xray/links.ts create mode 100644 docs/lib/xray/outbounds.test.ts create mode 100644 docs/lib/xray/outbounds.ts create mode 100644 docs/lib/xray/protocols.test.ts create mode 100644 docs/lib/xray/protocols.ts create mode 100644 docs/lib/xray/reality.test.ts create mode 100644 docs/lib/xray/reality.ts create mode 100644 docs/lib/xray/reverse-proxy.test.ts create mode 100644 docs/lib/xray/reverse-proxy.ts create mode 100644 docs/lib/xray/routing.test.ts create mode 100644 docs/lib/xray/routing.ts create mode 100644 docs/lib/xray/subscription.test.ts create mode 100644 docs/lib/xray/subscription.ts create mode 100644 docs/lib/xray/telegram.test.ts create mode 100644 docs/lib/xray/telegram.ts create mode 100644 docs/next.config.mjs create mode 100644 docs/package.json create mode 100644 docs/pnpm-lock.yaml create mode 100644 docs/pnpm-workspace.yaml create mode 100644 docs/postcss.config.mjs create mode 100644 docs/proxy.ts create mode 100644 docs/public/CNAME create mode 100644 docs/public/favicon.png create mode 100644 docs/public/icon.png create mode 100644 docs/public/logo-dark.png create mode 100644 docs/public/logo-light.png create mode 100644 docs/public/openapi.json create mode 100644 docs/scripts/gen-openapi.ts create mode 100644 docs/source.config.ts create mode 100644 docs/tsconfig.json create mode 100644 docs/vercel.json create mode 100644 docs/vitest.config.ts diff --git a/.github/workflows/docs-ci.yml b/.github/workflows/docs-ci.yml new file mode 100644 index 000000000..7a11d25de --- /dev/null +++ b/.github/workflows/docs-ci.yml @@ -0,0 +1,46 @@ +name: Docs CI + +on: + push: + branches: [main] + paths: + - 'docs/**' + - '.github/workflows/docs-ci.yml' + pull_request: + paths: + - 'docs/**' + - '.github/workflows/docs-ci.yml' + +defaults: + run: + working-directory: docs + +jobs: + build: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v7 + + - uses: pnpm/action-setup@v6 + with: + version: 11 + + - uses: actions/setup-node@v6 + with: + node-version: 22 + cache: pnpm + cache-dependency-path: docs/pnpm-lock.yaml + + - run: pnpm install --frozen-lockfile + + - name: Typecheck + run: pnpm typecheck + + - name: Lint + run: pnpm lint + + - name: Test + run: pnpm test + + - name: Build + run: pnpm build diff --git a/.github/workflows/docs-deploy.yml b/.github/workflows/docs-deploy.yml new file mode 100644 index 000000000..130b3c932 --- /dev/null +++ b/.github/workflows/docs-deploy.yml @@ -0,0 +1,67 @@ +name: Docs Deploy (GitHub Pages) + +# Static-export deploy of docs/ to GitHub Pages. Pages must be enabled in repo +# settings (Source: GitHub Actions) and the docs.sanaei.dev custom domain +# attached to this repository. The site URL defaults to the production domain in +# docs/lib/shared.ts, so NEXT_PUBLIC_SITE_URL is optional. +on: + push: + branches: [main] + paths: + - 'docs/**' + - '.github/workflows/docs-deploy.yml' + workflow_dispatch: + +permissions: + contents: read + pages: write + id-token: write + +concurrency: + group: pages + cancel-in-progress: true + +defaults: + run: + working-directory: docs + +jobs: + build: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v7 + - uses: pnpm/action-setup@v6 + with: + version: 11 + - uses: actions/setup-node@v6 + with: + node-version: 22 + cache: pnpm + cache-dependency-path: docs/pnpm-lock.yaml + - run: pnpm install --frozen-lockfile + - name: Build (static export) + env: + DEPLOY_TARGET: static + NEXT_PUBLIC_SITE_URL: ${{ vars.NEXT_PUBLIC_SITE_URL }} + run: pnpm build + - name: Mirror default locale (en) to the site root + # hideLocale makes most English links unprefixed (/, /docs/...), but the + # language switcher still targets /en/... . The export emits pages only + # under /en/, and there is no i18n middleware on a static host — so copy + # the English build to the root (data files included) while KEEPING /en/ + # in place. That way both /docs/... and /en/docs/... resolve. Other + # locales stay under /fa, /ru, /zh. + run: cp -a out/en/. out/ + - uses: actions/upload-pages-artifact@v5 + with: + path: docs/out + + deploy: + needs: build + runs-on: ubuntu-latest + environment: + name: github-pages + url: ${{ steps.deployment.outputs.page_url }} + steps: + - id: deployment + uses: actions/deploy-pages@v5 diff --git a/docs/.gitattributes b/docs/.gitattributes new file mode 100644 index 000000000..dfe077042 --- /dev/null +++ b/docs/.gitattributes @@ -0,0 +1,2 @@ +# Auto detect text files and perform LF normalization +* text=auto diff --git a/docs/.gitignore b/docs/.gitignore new file mode 100644 index 000000000..5cb46f80d --- /dev/null +++ b/docs/.gitignore @@ -0,0 +1,31 @@ +# deps +/node_modules + +# generated content +.source + +# test & build +/coverage +/.next/ +/out/ +/build +*.tsbuildinfo + +# misc +.DS_Store +*.pem +/.pnp +.pnp.js +npm-debug.log* +yarn-debug.log* +yarn-error.log* + +# others +.env*.local +.vercel +next-env.d.ts +# npm (this project uses pnpm) +package-lock.json + +# claude code (local settings/plans; keep shared project instructions) +/.claude/* diff --git a/docs/.prettierignore b/docs/.prettierignore new file mode 100644 index 000000000..dc38002d5 --- /dev/null +++ b/docs/.prettierignore @@ -0,0 +1,10 @@ +node_modules +.next +.source +out +pnpm-lock.yaml +public/openapi.json +# Don't let Prettier reflow MDX prose — it merges headings into paragraphs and +# collapses lists inside JSX components (Steps/Callout). Author MDX by hand. +content/**/*.mdx +content/docs/**/reference/api diff --git a/docs/.prettierrc.json b/docs/.prettierrc.json new file mode 100644 index 000000000..4cbc711cd --- /dev/null +++ b/docs/.prettierrc.json @@ -0,0 +1,7 @@ +{ + "semi": true, + "singleQuote": true, + "trailingComma": "all", + "printWidth": 100, + "tabWidth": 2 +} diff --git a/docs/CONTRIBUTING.md b/docs/CONTRIBUTING.md new file mode 100644 index 000000000..342b58e1f --- /dev/null +++ b/docs/CONTRIBUTING.md @@ -0,0 +1,34 @@ +# Contributing to 3x-ui-docs + +Thanks for helping improve the 3x-ui documentation and product site! + +## Prerequisites + +This project uses **[pnpm](https://pnpm.io)** (not npm — `package-lock.json` is +gitignored). Install dependencies and start the dev server: + +```bash +pnpm install +pnpm dev # http://localhost:3000 +``` + +## Scripts + +| Script | Description | +| ---------------- | ----------------------------------------------------- | +| `pnpm dev` | Start the dev server | +| `pnpm build` | Production build | +| `pnpm start` | Serve the production build | +| `pnpm typecheck` | Generate MDX/route types and run `tsc --noEmit` | +| `pnpm lint` | ESLint (flat config) | +| `pnpm format` | Format with Prettier | +| `pnpm test` | Run unit tests (Vitest) for `lib/xray/*` pure logic | +| `pnpm gen:api` | Generate the API reference from `public/openapi.json` | + +Before opening a pull request, please run `pnpm typecheck`, `pnpm lint`, and +`pnpm test` — these are the same checks that CI runs on every PR. + +## License + +By contributing, you agree that your contributions will be licensed under the +project's [GPL-3.0](./LICENSE) license. diff --git a/docs/LICENSE b/docs/LICENSE new file mode 100644 index 000000000..f288702d2 --- /dev/null +++ b/docs/LICENSE @@ -0,0 +1,674 @@ + GNU GENERAL PUBLIC LICENSE + Version 3, 29 June 2007 + + Copyright (C) 2007 Free Software Foundation, Inc. + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + Preamble + + The GNU General Public License is a free, copyleft license for +software and other kinds of works. + + The licenses for most software and other practical works are designed +to take away your freedom to share and change the works. By contrast, +the GNU General Public License is intended to guarantee your freedom to +share and change all versions of a program--to make sure it remains free +software for all its users. We, the Free Software Foundation, use the +GNU General Public License for most of our software; it applies also to +any other work released this way by its authors. You can apply it to +your programs, too. + + When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +them if you wish), that you receive source code or can get it if you +want it, that you can change the software or use pieces of it in new +free programs, and that you know you can do these things. + + To protect your rights, we need to prevent others from denying you +these rights or asking you to surrender the rights. Therefore, you have +certain responsibilities if you distribute copies of the software, or if +you modify it: responsibilities to respect the freedom of others. + + For example, if you distribute copies of such a program, whether +gratis or for a fee, you must pass on to the recipients the same +freedoms that you received. You must make sure that they, too, receive +or can get the source code. And you must show them these terms so they +know their rights. + + Developers that use the GNU GPL protect your rights with two steps: +(1) assert copyright on the software, and (2) offer you this License +giving you legal permission to copy, distribute and/or modify it. + + For the developers' and authors' protection, the GPL clearly explains +that there is no warranty for this free software. For both users' and +authors' sake, the GPL requires that modified versions be marked as +changed, so that their problems will not be attributed erroneously to +authors of previous versions. + + Some devices are designed to deny users access to install or run +modified versions of the software inside them, although the manufacturer +can do so. This is fundamentally incompatible with the aim of +protecting users' freedom to change the software. The systematic +pattern of such abuse occurs in the area of products for individuals to +use, which is precisely where it is most unacceptable. Therefore, we +have designed this version of the GPL to prohibit the practice for those +products. If such problems arise substantially in other domains, we +stand ready to extend this provision to those domains in future versions +of the GPL, as needed to protect the freedom of users. + + Finally, every program is threatened constantly by software patents. +States should not allow patents to restrict development and use of +software on general-purpose computers, but in those that do, we wish to +avoid the special danger that patents applied to a free program could +make it effectively proprietary. To prevent this, the GPL assures that +patents cannot be used to render the program non-free. + + The precise terms and conditions for copying, distribution and +modification follow. + + TERMS AND CONDITIONS + + 0. Definitions. + + "This License" refers to version 3 of the GNU General Public License. + + "Copyright" also means copyright-like laws that apply to other kinds of +works, such as semiconductor masks. + + "The Program" refers to any copyrightable work licensed under this +License. Each licensee is addressed as "you". "Licensees" and +"recipients" may be individuals or organizations. + + To "modify" a work means to copy from or adapt all or part of the work +in a fashion requiring copyright permission, other than the making of an +exact copy. The resulting work is called a "modified version" of the +earlier work or a work "based on" the earlier work. + + A "covered work" means either the unmodified Program or a work based +on the Program. + + To "propagate" a work means to do anything with it that, without +permission, would make you directly or secondarily liable for +infringement under applicable copyright law, except executing it on a +computer or modifying a private copy. Propagation includes copying, +distribution (with or without modification), making available to the +public, and in some countries other activities as well. + + To "convey" a work means any kind of propagation that enables other +parties to make or receive copies. Mere interaction with a user through +a computer network, with no transfer of a copy, is not conveying. + + An interactive user interface displays "Appropriate Legal Notices" +to the extent that it includes a convenient and prominently visible +feature that (1) displays an appropriate copyright notice, and (2) +tells the user that there is no warranty for the work (except to the +extent that warranties are provided), that licensees may convey the +work under this License, and how to view a copy of this License. If +the interface presents a list of user commands or options, such as a +menu, a prominent item in the list meets this criterion. + + 1. Source Code. + + The "source code" for a work means the preferred form of the work +for making modifications to it. "Object code" means any non-source +form of a work. + + A "Standard Interface" means an interface that either is an official +standard defined by a recognized standards body, or, in the case of +interfaces specified for a particular programming language, one that +is widely used among developers working in that language. + + The "System Libraries" of an executable work include anything, other +than the work as a whole, that (a) is included in the normal form of +packaging a Major Component, but which is not part of that Major +Component, and (b) serves only to enable use of the work with that +Major Component, or to implement a Standard Interface for which an +implementation is available to the public in source code form. A +"Major Component", in this context, means a major essential component +(kernel, window system, and so on) of the specific operating system +(if any) on which the executable work runs, or a compiler used to +produce the work, or an object code interpreter used to run it. + + The "Corresponding Source" for a work in object code form means all +the source code needed to generate, install, and (for an executable +work) run the object code and to modify the work, including scripts to +control those activities. However, it does not include the work's +System Libraries, or general-purpose tools or generally available free +programs which are used unmodified in performing those activities but +which are not part of the work. For example, Corresponding Source +includes interface definition files associated with source files for +the work, and the source code for shared libraries and dynamically +linked subprograms that the work is specifically designed to require, +such as by intimate data communication or control flow between those +subprograms and other parts of the work. + + The Corresponding Source need not include anything that users +can regenerate automatically from other parts of the Corresponding +Source. + + The Corresponding Source for a work in source code form is that +same work. + + 2. Basic Permissions. + + All rights granted under this License are granted for the term of +copyright on the Program, and are irrevocable provided the stated +conditions are met. This License explicitly affirms your unlimited +permission to run the unmodified Program. The output from running a +covered work is covered by this License only if the output, given its +content, constitutes a covered work. This License acknowledges your +rights of fair use or other equivalent, as provided by copyright law. + + You may make, run and propagate covered works that you do not +convey, without conditions so long as your license otherwise remains +in force. You may convey covered works to others for the sole purpose +of having them make modifications exclusively for you, or provide you +with facilities for running those works, provided that you comply with +the terms of this License in conveying all material for which you do +not control copyright. Those thus making or running the covered works +for you must do so exclusively on your behalf, under your direction +and control, on terms that prohibit them from making any copies of +your copyrighted material outside their relationship with you. + + Conveying under any other circumstances is permitted solely under +the conditions stated below. Sublicensing is not allowed; section 10 +makes it unnecessary. + + 3. Protecting Users' Legal Rights From Anti-Circumvention Law. + + No covered work shall be deemed part of an effective technological +measure under any applicable law fulfilling obligations under article +11 of the WIPO copyright treaty adopted on 20 December 1996, or +similar laws prohibiting or restricting circumvention of such +measures. + + When you convey a covered work, you waive any legal power to forbid +circumvention of technological measures to the extent such circumvention +is effected by exercising rights under this License with respect to +the covered work, and you disclaim any intention to limit operation or +modification of the work as a means of enforcing, against the work's +users, your or third parties' legal rights to forbid circumvention of +technological measures. + + 4. Conveying Verbatim Copies. + + You may convey verbatim copies of the Program's source code as you +receive it, in any medium, provided that you conspicuously and +appropriately publish on each copy an appropriate copyright notice; +keep intact all notices stating that this License and any +non-permissive terms added in accord with section 7 apply to the code; +keep intact all notices of the absence of any warranty; and give all +recipients a copy of this License along with the Program. + + You may charge any price or no price for each copy that you convey, +and you may offer support or warranty protection for a fee. + + 5. Conveying Modified Source Versions. + + You may convey a work based on the Program, or the modifications to +produce it from the Program, in the form of source code under the +terms of section 4, provided that you also meet all of these conditions: + + a) The work must carry prominent notices stating that you modified + it, and giving a relevant date. + + b) The work must carry prominent notices stating that it is + released under this License and any conditions added under section + 7. This requirement modifies the requirement in section 4 to + "keep intact all notices". + + c) You must license the entire work, as a whole, under this + License to anyone who comes into possession of a copy. This + License will therefore apply, along with any applicable section 7 + additional terms, to the whole of the work, and all its parts, + regardless of how they are packaged. This License gives no + permission to license the work in any other way, but it does not + invalidate such permission if you have separately received it. + + d) If the work has interactive user interfaces, each must display + Appropriate Legal Notices; however, if the Program has interactive + interfaces that do not display Appropriate Legal Notices, your + work need not make them do so. + + A compilation of a covered work with other separate and independent +works, which are not by their nature extensions of the covered work, +and which are not combined with it such as to form a larger program, +in or on a volume of a storage or distribution medium, is called an +"aggregate" if the compilation and its resulting copyright are not +used to limit the access or legal rights of the compilation's users +beyond what the individual works permit. Inclusion of a covered work +in an aggregate does not cause this License to apply to the other +parts of the aggregate. + + 6. Conveying Non-Source Forms. + + You may convey a covered work in object code form under the terms +of sections 4 and 5, provided that you also convey the +machine-readable Corresponding Source under the terms of this License, +in one of these ways: + + a) Convey the object code in, or embodied in, a physical product + (including a physical distribution medium), accompanied by the + Corresponding Source fixed on a durable physical medium + customarily used for software interchange. + + b) Convey the object code in, or embodied in, a physical product + (including a physical distribution medium), accompanied by a + written offer, valid for at least three years and valid for as + long as you offer spare parts or customer support for that product + model, to give anyone who possesses the object code either (1) a + copy of the Corresponding Source for all the software in the + product that is covered by this License, on a durable physical + medium customarily used for software interchange, for a price no + more than your reasonable cost of physically performing this + conveying of source, or (2) access to copy the + Corresponding Source from a network server at no charge. + + c) Convey individual copies of the object code with a copy of the + written offer to provide the Corresponding Source. This + alternative is allowed only occasionally and noncommercially, and + only if you received the object code with such an offer, in accord + with subsection 6b. + + d) Convey the object code by offering access from a designated + place (gratis or for a charge), and offer equivalent access to the + Corresponding Source in the same way through the same place at no + further charge. You need not require recipients to copy the + Corresponding Source along with the object code. If the place to + copy the object code is a network server, the Corresponding Source + may be on a different server (operated by you or a third party) + that supports equivalent copying facilities, provided you maintain + clear directions next to the object code saying where to find the + Corresponding Source. Regardless of what server hosts the + Corresponding Source, you remain obligated to ensure that it is + available for as long as needed to satisfy these requirements. + + e) Convey the object code using peer-to-peer transmission, provided + you inform other peers where the object code and Corresponding + Source of the work are being offered to the general public at no + charge under subsection 6d. + + A separable portion of the object code, whose source code is excluded +from the Corresponding Source as a System Library, need not be +included in conveying the object code work. + + A "User Product" is either (1) a "consumer product", which means any +tangible personal property which is normally used for personal, family, +or household purposes, or (2) anything designed or sold for incorporation +into a dwelling. In determining whether a product is a consumer product, +doubtful cases shall be resolved in favor of coverage. For a particular +product received by a particular user, "normally used" refers to a +typical or common use of that class of product, regardless of the status +of the particular user or of the way in which the particular user +actually uses, or expects or is expected to use, the product. A product +is a consumer product regardless of whether the product has substantial +commercial, industrial or non-consumer uses, unless such uses represent +the only significant mode of use of the product. + + "Installation Information" for a User Product means any methods, +procedures, authorization keys, or other information required to install +and execute modified versions of a covered work in that User Product from +a modified version of its Corresponding Source. The information must +suffice to ensure that the continued functioning of the modified object +code is in no case prevented or interfered with solely because +modification has been made. + + If you convey an object code work under this section in, or with, or +specifically for use in, a User Product, and the conveying occurs as +part of a transaction in which the right of possession and use of the +User Product is transferred to the recipient in perpetuity or for a +fixed term (regardless of how the transaction is characterized), the +Corresponding Source conveyed under this section must be accompanied +by the Installation Information. But this requirement does not apply +if neither you nor any third party retains the ability to install +modified object code on the User Product (for example, the work has +been installed in ROM). + + The requirement to provide Installation Information does not include a +requirement to continue to provide support service, warranty, or updates +for a work that has been modified or installed by the recipient, or for +the User Product in which it has been modified or installed. Access to a +network may be denied when the modification itself materially and +adversely affects the operation of the network or violates the rules and +protocols for communication across the network. + + Corresponding Source conveyed, and Installation Information provided, +in accord with this section must be in a format that is publicly +documented (and with an implementation available to the public in +source code form), and must require no special password or key for +unpacking, reading or copying. + + 7. Additional Terms. + + "Additional permissions" are terms that supplement the terms of this +License by making exceptions from one or more of its conditions. +Additional permissions that are applicable to the entire Program shall +be treated as though they were included in this License, to the extent +that they are valid under applicable law. If additional permissions +apply only to part of the Program, that part may be used separately +under those permissions, but the entire Program remains governed by +this License without regard to the additional permissions. + + When you convey a copy of a covered work, you may at your option +remove any additional permissions from that copy, or from any part of +it. (Additional permissions may be written to require their own +removal in certain cases when you modify the work.) You may place +additional permissions on material, added by you to a covered work, +for which you have or can give appropriate copyright permission. + + Notwithstanding any other provision of this License, for material you +add to a covered work, you may (if authorized by the copyright holders of +that material) supplement the terms of this License with terms: + + a) Disclaiming warranty or limiting liability differently from the + terms of sections 15 and 16 of this License; or + + b) Requiring preservation of specified reasonable legal notices or + author attributions in that material or in the Appropriate Legal + Notices displayed by works containing it; or + + c) Prohibiting misrepresentation of the origin of that material, or + requiring that modified versions of such material be marked in + reasonable ways as different from the original version; or + + d) Limiting the use for publicity purposes of names of licensors or + authors of the material; or + + e) Declining to grant rights under trademark law for use of some + trade names, trademarks, or service marks; or + + f) Requiring indemnification of licensors and authors of that + material by anyone who conveys the material (or modified versions of + it) with contractual assumptions of liability to the recipient, for + any liability that these contractual assumptions directly impose on + those licensors and authors. + + All other non-permissive additional terms are considered "further +restrictions" within the meaning of section 10. If the Program as you +received it, or any part of it, contains a notice stating that it is +governed by this License along with a term that is a further +restriction, you may remove that term. If a license document contains +a further restriction but permits relicensing or conveying under this +License, you may add to a covered work material governed by the terms +of that license document, provided that the further restriction does +not survive such relicensing or conveying. + + If you add terms to a covered work in accord with this section, you +must place, in the relevant source files, a statement of the +additional terms that apply to those files, or a notice indicating +where to find the applicable terms. + + Additional terms, permissive or non-permissive, may be stated in the +form of a separately written license, or stated as exceptions; +the above requirements apply either way. + + 8. Termination. + + You may not propagate or modify a covered work except as expressly +provided under this License. Any attempt otherwise to propagate or +modify it is void, and will automatically terminate your rights under +this License (including any patent licenses granted under the third +paragraph of section 11). + + However, if you cease all violation of this License, then your +license from a particular copyright holder is reinstated (a) +provisionally, unless and until the copyright holder explicitly and +finally terminates your license, and (b) permanently, if the copyright +holder fails to notify you of the violation by some reasonable means +prior to 60 days after the cessation. + + Moreover, your license from a particular copyright holder is +reinstated permanently if the copyright holder notifies you of the +violation by some reasonable means, this is the first time you have +received notice of violation of this License (for any work) from that +copyright holder, and you cure the violation prior to 30 days after +your receipt of the notice. + + Termination of your rights under this section does not terminate the +licenses of parties who have received copies or rights from you under +this License. If your rights have been terminated and not permanently +reinstated, you do not qualify to receive new licenses for the same +material under section 10. + + 9. Acceptance Not Required for Having Copies. + + You are not required to accept this License in order to receive or +run a copy of the Program. Ancillary propagation of a covered work +occurring solely as a consequence of using peer-to-peer transmission +to receive a copy likewise does not require acceptance. However, +nothing other than this License grants you permission to propagate or +modify any covered work. These actions infringe copyright if you do +not accept this License. Therefore, by modifying or propagating a +covered work, you indicate your acceptance of this License to do so. + + 10. Automatic Licensing of Downstream Recipients. + + Each time you convey a covered work, the recipient automatically +receives a license from the original licensors, to run, modify and +propagate that work, subject to this License. You are not responsible +for enforcing compliance by third parties with this License. + + An "entity transaction" is a transaction transferring control of an +organization, or substantially all assets of one, or subdividing an +organization, or merging organizations. If propagation of a covered +work results from an entity transaction, each party to that +transaction who receives a copy of the work also receives whatever +licenses to the work the party's predecessor in interest had or could +give under the previous paragraph, plus a right to possession of the +Corresponding Source of the work from the predecessor in interest, if +the predecessor has it or can get it with reasonable efforts. + + You may not impose any further restrictions on the exercise of the +rights granted or affirmed under this License. For example, you may +not impose a license fee, royalty, or other charge for exercise of +rights granted under this License, and you may not initiate litigation +(including a cross-claim or counterclaim in a lawsuit) alleging that +any patent claim is infringed by making, using, selling, offering for +sale, or importing the Program or any portion of it. + + 11. Patents. + + A "contributor" is a copyright holder who authorizes use under this +License of the Program or a work on which the Program is based. The +work thus licensed is called the contributor's "contributor version". + + A contributor's "essential patent claims" are all patent claims +owned or controlled by the contributor, whether already acquired or +hereafter acquired, that would be infringed by some manner, permitted +by this License, of making, using, or selling its contributor version, +but do not include claims that would be infringed only as a +consequence of further modification of the contributor version. For +purposes of this definition, "control" includes the right to grant +patent sublicenses in a manner consistent with the requirements of +this License. + + Each contributor grants you a non-exclusive, worldwide, royalty-free +patent license under the contributor's essential patent claims, to +make, use, sell, offer for sale, import and otherwise run, modify and +propagate the contents of its contributor version. + + In the following three paragraphs, a "patent license" is any express +agreement or commitment, however denominated, not to enforce a patent +(such as an express permission to practice a patent or covenant not to +sue for patent infringement). To "grant" such a patent license to a +party means to make such an agreement or commitment not to enforce a +patent against the party. + + If you convey a covered work, knowingly relying on a patent license, +and the Corresponding Source of the work is not available for anyone +to copy, free of charge and under the terms of this License, through a +publicly available network server or other readily accessible means, +then you must either (1) cause the Corresponding Source to be so +available, or (2) arrange to deprive yourself of the benefit of the +patent license for this particular work, or (3) arrange, in a manner +consistent with the requirements of this License, to extend the patent +license to downstream recipients. "Knowingly relying" means you have +actual knowledge that, but for the patent license, your conveying the +covered work in a country, or your recipient's use of the covered work +in a country, would infringe one or more identifiable patents in that +country that you have reason to believe are valid. + + If, pursuant to or in connection with a single transaction or +arrangement, you convey, or propagate by procuring conveyance of, a +covered work, and grant a patent license to some of the parties +receiving the covered work authorizing them to use, propagate, modify +or convey a specific copy of the covered work, then the patent license +you grant is automatically extended to all recipients of the covered +work and works based on it. + + A patent license is "discriminatory" if it does not include within +the scope of its coverage, prohibits the exercise of, or is +conditioned on the non-exercise of one or more of the rights that are +specifically granted under this License. You may not convey a covered +work if you are a party to an arrangement with a third party that is +in the business of distributing software, under which you make payment +to the third party based on the extent of your activity of conveying +the work, and under which the third party grants, to any of the +parties who would receive the covered work from you, a discriminatory +patent license (a) in connection with copies of the covered work +conveyed by you (or copies made from those copies), or (b) primarily +for and in connection with specific products or compilations that +contain the covered work, unless you entered into that arrangement, +or that patent license was granted, prior to 28 March 2007. + + Nothing in this License shall be construed as excluding or limiting +any implied license or other defenses to infringement that may +otherwise be available to you under applicable patent law. + + 12. No Surrender of Others' Freedom. + + If conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot convey a +covered work so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you may +not convey it at all. For example, if you agree to terms that obligate you +to collect a royalty for further conveying from those to whom you convey +the Program, the only way you could satisfy both those terms and this +License would be to refrain entirely from conveying the Program. + + 13. Use with the GNU Affero General Public License. + + Notwithstanding any other provision of this License, you have +permission to link or combine any covered work with a work licensed +under version 3 of the GNU Affero General Public License into a single +combined work, and to convey the resulting work. The terms of this +License will continue to apply to the part which is the covered work, +but the special requirements of the GNU Affero General Public License, +section 13, concerning interaction through a network will apply to the +combination as such. + + 14. Revised Versions of this License. + + The Free Software Foundation may publish revised and/or new versions of +the GNU General Public License from time to time. Such new versions will +be similar in spirit to the present version, but may differ in detail to +address new problems or concerns. + + Each version is given a distinguishing version number. If the +Program specifies that a certain numbered version of the GNU General +Public License "or any later version" applies to it, you have the +option of following the terms and conditions either of that numbered +version or of any later version published by the Free Software +Foundation. If the Program does not specify a version number of the +GNU General Public License, you may choose any version ever published +by the Free Software Foundation. + + If the Program specifies that a proxy can decide which future +versions of the GNU General Public License can be used, that proxy's +public statement of acceptance of a version permanently authorizes you +to choose that version for the Program. + + Later license versions may give you additional or different +permissions. However, no additional obligations are imposed on any +author or copyright holder as a result of your choosing to follow a +later version. + + 15. Disclaimer of Warranty. + + THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY +APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT +HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY +OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, +THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM +IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF +ALL NECESSARY SERVICING, REPAIR OR CORRECTION. + + 16. Limitation of Liability. + + IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS +THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY +GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE +USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF +DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD +PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), +EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF +SUCH DAMAGES. + + 17. Interpretation of Sections 15 and 16. + + If the disclaimer of warranty and limitation of liability provided +above cannot be given local legal effect according to their terms, +reviewing courts shall apply local law that most closely approximates +an absolute waiver of all civil liability in connection with the +Program, unless a warranty or assumption of liability accompanies a +copy of the Program in return for a fee. + + END OF TERMS AND CONDITIONS + + How to Apply These Terms to Your New Programs + + If you develop a new program, and you want it to be of the greatest +possible use to the public, the best way to achieve this is to make it +free software which everyone can redistribute and change under these terms. + + To do so, attach the following notices to the program. It is safest +to attach them to the start of each source file to most effectively +state the exclusion of warranty; and each file should have at least +the "copyright" line and a pointer to where the full notice is found. + + + Copyright (C) + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . + +Also add information on how to contact you by electronic and paper mail. + + If the program does terminal interaction, make it output a short +notice like this when it starts in an interactive mode: + + Copyright (C) + This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. + This is free software, and you are welcome to redistribute it + under certain conditions; type `show c' for details. + +The hypothetical commands `show w' and `show c' should show the appropriate +parts of the General Public License. Of course, your program's commands +might be different; for a GUI interface, you would use an "about box". + + You should also get your employer (if you work as a programmer) or school, +if any, to sign a "copyright disclaimer" for the program, if necessary. +For more information on this, and how to apply and follow the GNU GPL, see +. + + The GNU General Public License does not permit incorporating your program +into proprietary programs. If your program is a subroutine library, you +may consider it more useful to permit linking proprietary applications with +the library. If this is what you want to do, use the GNU Lesser General +Public License instead of this License. But first, please read +. diff --git a/docs/README.md b/docs/README.md new file mode 100644 index 000000000..536da19ab --- /dev/null +++ b/docs/README.md @@ -0,0 +1,133 @@ +

+ + + + 3x-ui + + +

+ +

3x-ui Documentation

+ +

+ The official documentation and product site for + 3x-ui — + an advanced web panel for managing Xray-core servers. +

+ +

+ Live site + CI + License: GPL-3.0 + Next.js 16 + Fumadocs 16 +

+ +

+ Read the docs → +

+ +--- + +## Overview + +This directory (`docs/` in the [3x-ui](https://github.com/MHSanaei/3x-ui) monorepo) contains +the source for [docs.sanaei.dev](https://docs.sanaei.dev) — a static-first documentation and +marketing site built with [Fumadocs](https://fumadocs.dev) on Next.js. It has **no backend, +no database, and no auth**: every page is prerendered and every tool runs entirely in the +browser. + +## What's inside + +The documentation walks you through 3x-ui from first install to day-to-day operation: + +- **Getting Started** — installation, first login, and updating or uninstalling the panel. +- **Configuration** — the panel, inbounds, REALITY, transports, clients, subscriptions, and share links. +- **Operations** — reverse proxy, multi-node setups, outbounds & routing, backup/restore, the Telegram bot, and security. +- **Reference** — environment variables, the database, ports & firewall, and the HTTP API. +- **Help** — troubleshooting, FAQ, migration, and how to contribute. + +## Interactive tools + +The site ships with in-browser helpers that generate configuration for you — **no data +ever leaves your browser**: + +| Tool | What it does | +| ---------------------------- | ------------------------------------------------------- | +| **REALITY Config Generator** | Build a valid REALITY inbound configuration. | +| **Share Link Inspector** | Decode and inspect `vless://` / `vmess://` share links. | +| **Install Command Builder** | Assemble the right install command for your setup. | +| **Reverse Proxy Generator** | Generate reverse-proxy configs (Nginx / Caddy). | +| **Protocol Wizard** | Pick and configure the right protocol for your needs. | +| **Firewall Rules Generator** | Produce firewall rules for your ports. | + +## Tech stack + +| Layer | Technology | +| ---------- | ---------------------------------------------------------- | +| Framework | [Next.js 16](https://nextjs.org) (App Router) · React 19 | +| Docs | [Fumadocs](https://fumadocs.dev) (`-ui` / `-core` / `-mdx`) | +| Styling | [Tailwind CSS v4](https://tailwindcss.com) | +| Search | [Orama](https://orama.com) static index | +| Language | TypeScript (strict) | +| Tests | [Vitest](https://vitest.dev) for the pure `lib/xray` logic | +| Tooling | pnpm · ESLint 9 · Prettier | + +## Quick start + +This project uses **[pnpm](https://pnpm.io)** (npm lockfiles are gitignored). Run everything +from the `docs/` directory: + +```bash +cd docs +pnpm install +pnpm dev # http://localhost:3000 +``` + +Useful scripts: + +| Script | Description | +| ---------------- | -------------------------------------------- | +| `pnpm dev` | Start the dev server | +| `pnpm build` | Production build (also typechecks) | +| `pnpm typecheck` | Generate MDX/route types and `tsc --noEmit` | +| `pnpm lint` | Run ESLint | +| `pnpm test` | Run unit tests (Vitest) | + +See [`CONTRIBUTING.md`](./CONTRIBUTING.md) for the full list and project conventions. + +## Project structure + +``` +app/ # Next.js App Router — layouts, home, docs, OG images, search, llms.txt +components/ # React components — interactive tools, home sections, MDX bindings +content/docs/ # MDX documentation, one folder per locale (en · fa · ru · zh) +lib/ # source config, i18n, GitHub stats, and the unit-tested lib/xray logic +public/ # static assets — logos, favicon, openapi.json, CNAME +scripts/ # build-time scripts (API reference generation) +source.config.ts # Fumadocs MDX schema & collection config +next.config.mjs # Next.js config (static-export gating) +proxy.ts # i18n middleware +``` + +## Internationalization + +Documentation is authored in **English**. Persian (`fa`, RTL), Russian (`ru`), and +Chinese (`zh`) locales are wired up; untranslated pages fall back to English so they +never 404. English URLs are unprefixed; other locales live under `/fa`, `/ru`, `/zh`. + +## Deployment + +The site builds for two targets: + +- **Vercel / Node** — `pnpm build` (static search index + prerendered OG images). +- **GitHub Pages (static export)** — `DEPLOY_TARGET=static pnpm build` → `out/`. + +## Contributing + +Contributions are welcome! Setup, scripts, and project conventions live in +[`CONTRIBUTING.md`](./CONTRIBUTING.md). + +## License + +Licensed under [GPL-3.0](./LICENSE). diff --git a/docs/app/[lang]/(home)/layout.tsx b/docs/app/[lang]/(home)/layout.tsx new file mode 100644 index 000000000..17af0d723 --- /dev/null +++ b/docs/app/[lang]/(home)/layout.tsx @@ -0,0 +1,28 @@ +import { HomeLayout } from 'fumadocs-ui/layouts/home'; +import { baseOptions } from '@/lib/layout.shared'; +import { HomeLanguageSwitcher } from '@/components/home/language-switcher'; + +export default async function Layout({ params, children }: LayoutProps<'/[lang]'>) { + const { lang } = await params; + const options = baseOptions(lang); + return ( + , + }, + ]} + > + {children} + + ); +} diff --git a/docs/app/[lang]/(home)/page.tsx b/docs/app/[lang]/(home)/page.tsx new file mode 100644 index 000000000..acdc43c4d --- /dev/null +++ b/docs/app/[lang]/(home)/page.tsx @@ -0,0 +1,143 @@ +import Link from 'next/link'; +import { ArrowRight, BookOpen, Heart } from 'lucide-react'; +import { GitHubIcon, TelegramIcon } from '@/components/icons'; +import { Logo } from '@/components/logo'; +import { Features } from '@/components/home/features'; +import { GitHubStatsRow } from '@/components/home/github-stats'; +import { InstallCommand } from '@/components/home/install-command'; +import { getGitHubStats } from '@/lib/github-stats'; +import { i18n } from '@/lib/i18n'; +import { appName, productRepoUrl, deepWikiUrl, telegramChannelUrl, donateUrl } from '@/lib/shared'; +import { getSiteMessages, type SiteMessages } from '@/lib/site-i18n'; + +export function generateStaticParams() { + return i18n.languages.map((lang) => ({ lang })); +} + +const INSTALL_COMMAND = + 'bash <(curl -Ls https://raw.githubusercontent.com/mhsanaei/3x-ui/master/install.sh)'; + +export default async function HomePage({ params }: PageProps<'/[lang]'>) { + const { lang } = await params; + const prefix = lang === 'en' ? '' : `/${lang}`; + const m = getSiteMessages(lang); + const stats = await getGitHubStats(); + + return ( +
+ {/* Hero */} +
+
+
+ +

+ + {appName} + +

+

{m.tagline}

+ +
+ + {m.getStarted} + + + + + {m.viewOnGitHub} + +
+ + + + {/* Build-time stats as the initial render; refreshed live on the client. */} + +
+
+ + + +
+
+ ); +} + +function Footer({ prefix, m }: { prefix: string; m: SiteMessages }) { + return ( + + ); +} diff --git a/docs/app/[lang]/docs/[[...slug]]/page.tsx b/docs/app/[lang]/docs/[[...slug]]/page.tsx new file mode 100644 index 000000000..5b307a52b --- /dev/null +++ b/docs/app/[lang]/docs/[[...slug]]/page.tsx @@ -0,0 +1,80 @@ +import { getPageImage, getPageMarkdownUrl, source } from '@/lib/source'; +import { + DocsBody, + DocsDescription, + DocsPage, + DocsTitle, + MarkdownCopyButton, + ViewOptionsPopover, +} from 'fumadocs-ui/layouts/docs/page'; +import { notFound } from 'next/navigation'; +import { getMDXComponents } from '@/components/mdx'; +import { OpenAPIPage as BaseOpenAPIPage } from '@/components/openapi-page'; +import { openapi } from '@/lib/openapi'; +import type { Metadata } from 'next'; +import type { ComponentProps } from 'react'; +import { createRelativeLink } from 'fumadocs-ui/mdx'; +import { gitConfig } from '@/lib/shared'; + +export default async function Page(props: PageProps<'/[lang]/docs/[[...slug]]'>) { + const { lang, slug } = await props.params; + const page = source.getPage(slug, lang); + if (!page) notFound(); + + const MDX = page.data.body; + const markdownUrl = getPageMarkdownUrl(page).url; + const editUrl = `https://github.com/${gitConfig.user}/${gitConfig.repo}/blob/${gitConfig.branch}/${gitConfig.docsDir}/${page.path}`; + + // Generated API reference pages carry `_openapi` metadata. Preload the spec + // on the server (highlighting included) so the client OpenAPIPage doesn't have + // to load it at render time. + const isOpenAPI = Boolean((page.data as { _openapi?: unknown })._openapi); + const extraComponents: Record = {}; + if (isOpenAPI) { + const preloaded = await openapi.preloadOpenAPIPage(page); + function PreloadedOpenAPIPage(p: ComponentProps) { + return ; + } + extraComponents.OpenAPIPage = PreloadedOpenAPIPage; + } + + return ( + + {page.data.title} + {page.data.description} +
+ + +
+ + + +
+ ); +} + +export async function generateStaticParams() { + return source.generateParams(); +} + +export async function generateMetadata( + props: PageProps<'/[lang]/docs/[[...slug]]'>, +): Promise { + const { lang, slug } = await props.params; + const page = source.getPage(slug, lang); + if (!page) notFound(); + + return { + title: page.data.title, + description: page.data.description, + openGraph: { + images: getPageImage(page).url, + }, + }; +} diff --git a/docs/app/[lang]/docs/layout.tsx b/docs/app/[lang]/docs/layout.tsx new file mode 100644 index 000000000..139507dc8 --- /dev/null +++ b/docs/app/[lang]/docs/layout.tsx @@ -0,0 +1,12 @@ +import { source } from '@/lib/source'; +import { DocsLayout } from 'fumadocs-ui/layouts/docs'; +import { baseOptions } from '@/lib/layout.shared'; + +export default async function Layout({ params, children }: LayoutProps<'/[lang]/docs'>) { + const { lang } = await params; + return ( + + {children} + + ); +} diff --git a/docs/app/[lang]/layout.tsx b/docs/app/[lang]/layout.tsx new file mode 100644 index 000000000..a15f4a69d --- /dev/null +++ b/docs/app/[lang]/layout.tsx @@ -0,0 +1,30 @@ +import '../global.css'; +import { RootProvider } from 'fumadocs-ui/provider/next'; +import { Inter, Vazirmatn } from 'next/font/google'; +import { i18n, localeDirection } from '@/lib/i18n'; +import { provider } from '@/lib/i18n-ui'; +import SearchDialog from '@/components/search-dialog'; + +const inter = Inter({ subsets: ['latin'], display: 'swap' }); +// Persian UI font; covers Arabic + Latin glyphs so mixed content renders well. +const vazirmatn = Vazirmatn({ subsets: ['arabic'], display: 'swap' }); + +export function generateStaticParams() { + return i18n.languages.map((lang) => ({ lang })); +} + +export default async function LangLayout({ params, children }: LayoutProps<'/[lang]'>) { + const { lang } = await params; + const dir = localeDirection(lang); + const fontClassName = lang === 'fa' ? vazirmatn.className : inter.className; + + return ( + + + + {children} + + + + ); +} diff --git a/docs/app/api/search/route.ts b/docs/app/api/search/route.ts new file mode 100644 index 000000000..37876e753 --- /dev/null +++ b/docs/app/api/search/route.ts @@ -0,0 +1,22 @@ +import { source } from '@/lib/source'; +import { createFromSource } from 'fumadocs-core/search/server'; + +// Required for `output: 'export'` — the search index is fully static. +export const revalidate = false; +export const dynamic = 'force-static'; + +// Static search index: works under both SSR/Vercel and static export +// (`output: 'export'`). The client loads this prebuilt index and searches +// in-browser (see the `type: 'static'` search option in app/[lang]/layout.tsx). +// All locales currently hold English (fallback) content, and Orama has no +// Persian tokenizer, so map every locale to the English tokenizer. When real +// translations land, switch ru -> 'russian', zh -> 'mandarin' (with +// @orama/tokenizers), etc. See https://docs.orama.com/open-source/supported-languages +export const { staticGET: GET } = createFromSource(source, { + localeMap: { + en: 'english', + fa: 'english', + ru: 'english', + zh: 'english', + }, +}); diff --git a/docs/app/global.css b/docs/app/global.css new file mode 100644 index 000000000..4f4081c28 --- /dev/null +++ b/docs/app/global.css @@ -0,0 +1,32 @@ +@import 'tailwindcss'; +@import 'fumadocs-ui/css/neutral.css'; +@import 'fumadocs-ui/css/preset.css'; + +/* 3x-ui brand: cyan / turquoise accent (matches the panel logo). */ +:root { + --color-fd-primary: hsl(190, 95%, 39%); + --color-fd-primary-foreground: hsl(0, 0%, 100%); + --color-fd-ring: hsl(190, 95%, 39%); +} + +.dark { + --color-fd-primary: hsl(187, 90%, 55%); + --color-fd-primary-foreground: hsl(190, 80%, 8%); + --color-fd-ring: hsl(187, 90%, 55%); +} + +/* Expose the brand color as Tailwind utilities (bg-brand, text-brand, ...). */ +@theme { + --color-brand: hsl(190, 95%, 39%); + --color-brand-foreground: hsl(0, 0%, 100%); +} + +html { + scrollbar-gutter: stable; +} + +/* In RTL the scroll-lock padding must be applied to the logical inline-end. */ +html > body[data-scroll-locked] { + margin-inline-end: 0px !important; + --removed-body-scroll-bar-size: 0px !important; +} diff --git a/docs/app/layout.tsx b/docs/app/layout.tsx new file mode 100644 index 000000000..ac909ddef --- /dev/null +++ b/docs/app/layout.tsx @@ -0,0 +1,31 @@ +import type { Metadata } from 'next'; +import type { ReactNode } from 'react'; +import { appName, appTagline, siteUrl } from '@/lib/shared'; + +// Global SEO defaults. The real / live in `app/[lang]/layout.tsx` +// so we can set `lang`/`dir` per locale (RTL for fa); this root layout is a +// pass-through that only carries site-wide metadata. +export const metadata: Metadata = { + metadataBase: new URL(siteUrl), + title: { + default: `${appName} — ${appTagline}`, + template: `%s — ${appName}`, + }, + description: appTagline, + applicationName: appName, + openGraph: { + siteName: appName, + type: 'website', + }, + twitter: { + card: 'summary_large_image', + }, + icons: { + icon: '/favicon.png', + apple: '/icon.png', + }, +}; + +export default function RootLayout({ children }: { children: ReactNode }) { + return children; +} diff --git a/docs/app/llms-full.txt/route.ts b/docs/app/llms-full.txt/route.ts new file mode 100644 index 000000000..d494d2cbb --- /dev/null +++ b/docs/app/llms-full.txt/route.ts @@ -0,0 +1,10 @@ +import { getLLMText, source } from '@/lib/source'; + +export const revalidate = false; + +export async function GET() { + const scan = source.getPages().map(getLLMText); + const scanned = await Promise.all(scan); + + return new Response(scanned.join('\n\n')); +} diff --git a/docs/app/llms.mdx/docs/[[...slug]]/route.ts b/docs/app/llms.mdx/docs/[[...slug]]/route.ts new file mode 100644 index 000000000..250181a70 --- /dev/null +++ b/docs/app/llms.mdx/docs/[[...slug]]/route.ts @@ -0,0 +1,23 @@ +import { getLLMText, getPageMarkdownUrl, source } from '@/lib/source'; +import { notFound } from 'next/navigation'; + +export const revalidate = false; + +export async function GET(_req: Request, { params }: RouteContext<'/llms.mdx/docs/[[...slug]]'>) { + const { slug } = await params; + const page = source.getPage(slug?.slice(0, -1)); + if (!page) notFound(); + + return new Response(await getLLMText(page), { + headers: { + 'Content-Type': 'text/markdown', + }, + }); +} + +export function generateStaticParams() { + return source.getPages().map((page) => ({ + lang: page.locale, + slug: getPageMarkdownUrl(page).segments, + })); +} diff --git a/docs/app/llms.txt/route.ts b/docs/app/llms.txt/route.ts new file mode 100644 index 000000000..fc80cb652 --- /dev/null +++ b/docs/app/llms.txt/route.ts @@ -0,0 +1,8 @@ +import { source } from '@/lib/source'; +import { llms } from 'fumadocs-core/source'; + +export const revalidate = false; + +export function GET() { + return new Response(llms(source).index()); +} diff --git a/docs/app/og/docs/[...slug]/route.tsx b/docs/app/og/docs/[...slug]/route.tsx new file mode 100644 index 000000000..79c92248d --- /dev/null +++ b/docs/app/og/docs/[...slug]/route.tsx @@ -0,0 +1,29 @@ +import { getPageImage, source } from '@/lib/source'; +import { notFound } from 'next/navigation'; +import { ImageResponse } from 'next/og'; +import { generate as DefaultImage } from 'fumadocs-ui/og'; +import { appName } from '@/lib/shared'; + +export const dynamic = 'force-static'; +export const revalidate = false; + +export async function GET(_req: Request, { params }: RouteContext<'/og/docs/[...slug]'>) { + const { slug } = await params; + const page = source.getPage(slug.slice(0, -1)); + if (!page) notFound(); + + return new ImageResponse( + , + { + width: 1200, + height: 630, + }, + ); +} + +export function generateStaticParams() { + return source.getPages().map((page) => ({ + lang: page.locale, + slug: getPageImage(page).segments, + })); +} diff --git a/docs/app/robots.ts b/docs/app/robots.ts new file mode 100644 index 000000000..1a80988c0 --- /dev/null +++ b/docs/app/robots.ts @@ -0,0 +1,12 @@ +import type { MetadataRoute } from 'next'; +import { siteUrl } from '@/lib/shared'; + +// Required for `output: 'export'`. +export const dynamic = 'force-static'; + +export default function robots(): MetadataRoute.Robots { + return { + rules: { userAgent: '*', allow: '/' }, + sitemap: `${siteUrl}/sitemap.xml`, + }; +} diff --git a/docs/app/sitemap.ts b/docs/app/sitemap.ts new file mode 100644 index 000000000..f33e5fe81 --- /dev/null +++ b/docs/app/sitemap.ts @@ -0,0 +1,33 @@ +import type { MetadataRoute } from 'next'; +import { source } from '@/lib/source'; +import { i18n } from '@/lib/i18n'; +import { siteUrl } from '@/lib/shared'; + +// Required for `output: 'export'`. +export const dynamic = 'force-static'; + +// Locale home pages + the canonical (English) docs pages. Other locales +// currently fall back to English content, so we don't list them separately +// to avoid duplicate-content entries until real translations exist. +export default function sitemap(): MetadataRoute.Sitemap { + const entries: MetadataRoute.Sitemap = []; + + for (const lang of i18n.languages) { + const prefix = lang === 'en' ? '' : `/${lang}`; + entries.push({ + url: `${siteUrl}${prefix}` || siteUrl, + changeFrequency: 'weekly', + priority: 1, + }); + } + + for (const page of source.getPages('en')) { + entries.push({ + url: `${siteUrl}${page.url}`, + changeFrequency: 'weekly', + priority: 0.8, + }); + } + + return entries; +} diff --git a/docs/components/home/features.tsx b/docs/components/home/features.tsx new file mode 100644 index 000000000..b08fcff77 --- /dev/null +++ b/docs/components/home/features.tsx @@ -0,0 +1,49 @@ +import { + Boxes, + Network, + Send, + ShieldCheck, + TerminalSquare, + Users, + type LucideIcon, +} from 'lucide-react'; + +// Icons map by position to the localized feature items in lib/site-i18n.ts +// (Every major protocol, REALITY, Clients, Multi-node, Telegram, Self-hosted). +const ICONS: LucideIcon[] = [Boxes, ShieldCheck, Users, Network, Send, TerminalSquare]; + +export function Features({ + heading, + subtitle, + items, +}: { + heading: string; + subtitle: string; + items: { title: string; description: string }[]; +}) { + return ( +
+
+

{heading}

+

{subtitle}

+
+
+ {items.map(({ title, description }, i) => { + const Icon = ICONS[i] ?? Boxes; + return ( +
+
+ +
+

{title}

+

{description}

+
+ ); + })} +
+
+ ); +} diff --git a/docs/components/home/github-stats.tsx b/docs/components/home/github-stats.tsx new file mode 100644 index 000000000..9192123b1 --- /dev/null +++ b/docs/components/home/github-stats.tsx @@ -0,0 +1,67 @@ +'use client'; + +import { useEffect, useState } from 'react'; +import { GitFork, Star, Tag } from 'lucide-react'; +import { fetchGitHubStats, formatCount, type GitHubStats } from '@/lib/github-stats'; + +/** + * Stars / forks / latest-release row. Renders the build-time numbers + * immediately (no layout shift, works without JS), then swaps in live ones + * from the GitHub API after hydration. + */ +export function GitHubStatsRow({ + initial, + labels, +}: { + initial: GitHubStats; + labels: { stars: string; forks: string; latest: string }; +}) { + const [stats, setStats] = useState(initial); + + useEffect(() => { + let cancelled = false; + // Plain fetch, no custom headers — keeps the request preflight-free. + void fetchGitHubStats().then((live) => { + if (cancelled || !live) return; + setStats((prev) => ({ ...live, latestVersion: live.latestVersion || prev.latestVersion })); + }); + return () => { + cancelled = true; + }; + }, []); + + return ( +
+ } label={labels.stars}> + {formatCount(stats.stars)} + + } label={labels.forks}> + {formatCount(stats.forks)} + + } label={labels.latest}> + {stats.latestVersion} + +
+ ); +} + +function Stat({ + icon, + label, + children, +}: { + icon: React.ReactNode; + label: string; + children: React.ReactNode; +}) { + return ( +
+ {icon} +
{label}
+
+ {children}{' '} + {label} +
+
+ ); +} diff --git a/docs/components/home/install-command.tsx b/docs/components/home/install-command.tsx new file mode 100644 index 000000000..b99418d4a --- /dev/null +++ b/docs/components/home/install-command.tsx @@ -0,0 +1,56 @@ +'use client'; + +import { useState } from 'react'; +import { Check, Copy } from 'lucide-react'; +import { cn } from '@/lib/cn'; + +export function InstallCommand({ + command, + className, + copyLabel = 'Copy install command', + copiedLabel = 'Copied', +}: { + command: string; + className?: string; + copyLabel?: string; + copiedLabel?: string; +}) { + const [copied, setCopied] = useState(false); + + async function copy() { + try { + await navigator.clipboard.writeText(command); + setCopied(true); + setTimeout(() => setCopied(false), 2000); + } catch { + // Clipboard unavailable (insecure context) — silently ignore. + } + } + + return ( +
+ $ + {/* Commands are always LTR, even on RTL pages. */} + + {command} + + +
+ ); +} diff --git a/docs/components/home/language-switcher.tsx b/docs/components/home/language-switcher.tsx new file mode 100644 index 000000000..dbc6e1d33 --- /dev/null +++ b/docs/components/home/language-switcher.tsx @@ -0,0 +1,45 @@ +import Link from 'next/link'; +import { Languages } from 'lucide-react'; +import { i18n, locales } from '@/lib/i18n'; +import { cn } from '@/lib/cn'; + +// Home-navbar language switcher. +// +// fumadocs' built-in popover switcher (`LanguageSelect`) has its item clicks +// swallowed when it is nested inside HomeLayout's Radix `NavigationMenu` — the +// dropdown opens but selecting a locale never fires `onChange`/`router.push`. +// The docs sidebar isn't wrapped in a NavigationMenu, so the built-in one works +// there and is kept. Here we use a native `
` toggle + real `` +// anchors, which navigate reliably inside the navbar (like the other nav links). +// +// The home navbar only renders on the landing page, so the targets are simply +// each locale's home (`/`, `/fa`, `/ru`, `/zh`). +export function HomeLanguageSwitcher({ current }: { current: string }) { + return ( +
+ + + +
+

Choose a language

+ {locales.map(({ locale, name }) => ( + + {name} + + ))} +
+
+ ); +} diff --git a/docs/components/icons.tsx b/docs/components/icons.tsx new file mode 100644 index 000000000..38dd3b009 --- /dev/null +++ b/docs/components/icons.tsx @@ -0,0 +1,17 @@ +// Brand icons that are not part of lucide-react. + +export function GitHubIcon({ className }: { className?: string }) { + return ( + + + + ); +} + +export function TelegramIcon({ className }: { className?: string }) { + return ( + + + + ); +} diff --git a/docs/components/logo.tsx b/docs/components/logo.tsx new file mode 100644 index 000000000..d33f7f506 --- /dev/null +++ b/docs/components/logo.tsx @@ -0,0 +1,15 @@ +import { cn } from '@/lib/cn'; + +// Official 3x-ui logo (media/3x-ui-{light,dark}.png from the upstream repo). +// Theme-aware via Tailwind's `dark:` variant. Pass a height class (e.g. `h-6`); +// width scales automatically (the artwork is 2:1). +export function Logo({ className }: { className?: string }) { + return ( + <> + {/* eslint-disable-next-line @next/next/no-img-element */} + 3x-ui + {/* eslint-disable-next-line @next/next/no-img-element */} + 3x-ui + + ); +} diff --git a/docs/components/mdx.tsx b/docs/components/mdx.tsx new file mode 100644 index 000000000..d2c272e33 --- /dev/null +++ b/docs/components/mdx.tsx @@ -0,0 +1,47 @@ +import defaultMdxComponents from 'fumadocs-ui/mdx'; +import { Tab, Tabs } from 'fumadocs-ui/components/tabs'; +import { Step, Steps } from 'fumadocs-ui/components/steps'; +import { Mermaid } from '@/components/mdx/mermaid'; +import { RealityConfigGenerator } from '@/components/tools/reality-config-generator'; +import { ShareLinkInspector } from '@/components/tools/share-link-inspector'; +import { InstallCommandBuilder } from '@/components/tools/install-command-builder'; +import { ReverseProxyGenerator } from '@/components/tools/reverse-proxy-generator'; +import { ProtocolWizard } from '@/components/tools/protocol-wizard'; +import { FirewallRulesGenerator } from '@/components/tools/firewall-rules-generator'; +import { OutboundGenerator } from '@/components/tools/outbound-generator'; +import { RoutingBuilder } from '@/components/tools/routing-builder'; +import { SubscriptionBuilder } from '@/components/tools/subscription-builder'; +import { TelegramSetupHelper } from '@/components/tools/telegram-setup-helper'; +import { ApiRequestBuilder } from '@/components/tools/api-request-builder'; +import { OpenAPIPage } from '@/components/openapi-page'; +import type { MDXComponents } from 'mdx/types'; + +export function getMDXComponents(components?: MDXComponents) { + return { + ...defaultMdxComponents, + Tab, + Tabs, + Step, + Steps, + Mermaid, + RealityConfigGenerator, + ShareLinkInspector, + InstallCommandBuilder, + ReverseProxyGenerator, + ProtocolWizard, + FirewallRulesGenerator, + OutboundGenerator, + RoutingBuilder, + SubscriptionBuilder, + TelegramSetupHelper, + ApiRequestBuilder, + OpenAPIPage, + ...components, + } satisfies MDXComponents; +} + +export const useMDXComponents = getMDXComponents; + +declare global { + type MDXProvidedComponents = ReturnType; +} diff --git a/docs/components/mdx/mermaid.tsx b/docs/components/mdx/mermaid.tsx new file mode 100644 index 000000000..31d76515b --- /dev/null +++ b/docs/components/mdx/mermaid.tsx @@ -0,0 +1,44 @@ +'use client'; + +import { useEffect, useId, useState } from 'react'; +import { useTheme } from 'next-themes'; + +// Client-side, theme-aware Mermaid renderer. Mermaid is imported dynamically so +// it stays out of the initial bundle and only loads on pages that use a diagram. +export function Mermaid({ chart }: { chart: string }) { + const rawId = useId(); + const id = `mmd-${rawId.replace(/[^a-zA-Z0-9]/g, '')}`; + const { resolvedTheme } = useTheme(); + const [svg, setSvg] = useState(''); + + useEffect(() => { + let active = true; + void (async () => { + const mermaid = (await import('mermaid')).default; + mermaid.initialize({ + startOnLoad: false, + securityLevel: 'strict', + theme: resolvedTheme === 'dark' ? 'dark' : 'default', + fontFamily: 'inherit', + }); + try { + const { svg } = await mermaid.render(id, chart.trim()); + if (active) setSvg(svg); + } catch { + if (active) setSvg(''); + } + })(); + return () => { + active = false; + }; + }, [chart, resolvedTheme, id]); + + return ( +
+ ); +} diff --git a/docs/components/openapi-page.tsx b/docs/components/openapi-page.tsx new file mode 100644 index 000000000..9fd00af82 --- /dev/null +++ b/docs/components/openapi-page.tsx @@ -0,0 +1,6 @@ +'use client'; + +import { createOpenAPIPage } from 'fumadocs-openapi/ui'; + +// The component used by the generated API reference MDX pages. +export const OpenAPIPage = createOpenAPIPage(); diff --git a/docs/components/search-dialog.tsx b/docs/components/search-dialog.tsx new file mode 100644 index 000000000..1d197844f --- /dev/null +++ b/docs/components/search-dialog.tsx @@ -0,0 +1,56 @@ +'use client'; + +import { create } from '@orama/orama'; +import { useDocsSearch } from 'fumadocs-core/search/client'; +import { oramaStaticClient } from 'fumadocs-core/search/client/orama-static'; +import { + SearchDialog, + SearchDialogClose, + SearchDialogContent, + SearchDialogHeader, + SearchDialogIcon, + SearchDialogInput, + SearchDialogList, + SearchDialogOverlay, +} from 'fumadocs-ui/components/dialog/search'; +import { useI18n } from 'fumadocs-ui/contexts/i18n'; +import { useMemo } from 'react'; + +interface SharedProps { + open: boolean; + onOpenChange: (open: boolean) => void; +} + +// The static search index is keyed by locale code (en/fa/ru/zh). Fumadocs' +// default static dialog feeds those codes to Orama as a tokenizer language, but +// Orama only accepts full names ("english") and throws on "en" — which silently +// breaks search entirely. All docs content is English (other locales fall back +// to it), so re-create the dialog — the documented escape hatch for custom Orama +// setups — with an initOrama that always builds an English index. +export default function SearchDialogClient(props: SharedProps) { + const { locale } = useI18n(); + const client = useMemo( + () => + oramaStaticClient({ + from: '/api/search', + locale, + initOrama: () => create({ schema: { _: 'string' }, language: 'english' }), + }), + [locale], + ); + const { search, setSearch, query } = useDocsSearch({ client }); + + return ( + + + + + + + + + + + + ); +} diff --git a/docs/components/tools/api-request-builder.tsx b/docs/components/tools/api-request-builder.tsx new file mode 100644 index 000000000..de0b878f6 --- /dev/null +++ b/docs/components/tools/api-request-builder.tsx @@ -0,0 +1,76 @@ +'use client'; + +import { useId, useState } from 'react'; +import { buildCurl, buildFetchSnippet, type ApiRequestInput, type HttpMethod } from '@/lib/xray/api-client'; +import { ToolFrame } from './tool-frame'; +import { TextField, SelectField } from './shared/fields'; +import { OutputBlock } from './shared/output-block'; + +const METHODS: readonly HttpMethod[] = ['GET', 'POST', 'PUT', 'DELETE']; + +export function ApiRequestBuilder() { + const [baseUrl, setBaseUrl] = useState('https://panel.example.com:2053'); + const [token, setToken] = useState(''); + const [path, setPath] = useState('/panel/api/inbounds/list'); + const [method, setMethod] = useState('GET'); + const [body, setBody] = useState(''); + const bodyId = useId(); + + const showBody = method === 'POST' || method === 'PUT'; + const input: ApiRequestInput = { baseUrl, token: token || '', path, method, body }; + + function reset() { + setBaseUrl('https://panel.example.com:2053'); + setToken(''); + setPath('/panel/api/inbounds/list'); + setMethod('GET'); + setBody(''); + } + + return ( + +
+ + + + setMethod(v as HttpMethod)} + options={METHODS} + /> +
+ + {showBody ? ( +
+ +