Переглянути джерело

chore(docs): update documentations

Jacky 1 рік тому
батько
коміт
29f1b7db89

+ 2 - 1
docs/.vitepress/config/en.ts

@@ -38,7 +38,8 @@ export const enConfig: LocaleSpecificConfig<DefaultTheme.Config> = {
             {text: 'Nginx', link: '/guide/config-nginx'},
             {text: 'Open AI', link: '/guide/config-openai'},
             {text: 'Casdoor', link: '/guide/config-casdoor'},
-            {text: 'Logrotate', link: '/guide/config-logrotate'}
+            {text: 'Logrotate', link: '/guide/config-logrotate'},
+            {text: 'Cluster', link: '/guide/config-cluster'}
           ]
         },
         {

+ 2 - 1
docs/.vitepress/config/zh_CN.ts

@@ -43,7 +43,8 @@ export const zhCNConfig: LocaleSpecificConfig<DefaultTheme.Config> = {
             {text: 'Nginx', link: '/zh_CN/guide/config-nginx'},
             {text: 'Open AI', link: '/zh_CN/guide/config-openai'},
             {text: 'Casdoor', link: '/zh_CN/guide/config-casdoor'},
-            {text: 'Logrotate', link: '/zh_CN/guide/config-logrotate'}
+            {text: 'Logrotate', link: '/zh_CN/guide/config-logrotate'},
+            {text: '集群', link: '/zh_CN/guide/config-cluster'}
           ]
         },
         {

+ 2 - 1
docs/.vitepress/config/zh_TW.ts

@@ -42,7 +42,8 @@ export const zhTWConfig: LocaleSpecificConfig<DefaultTheme.Config> = {
             {text: 'Nginx', link: '/zh_TW/guide/config-nginx'},
             {text: 'Open AI', link: '/zh_TW/guide/config-openai'},
             {text: 'Casdoor', link: '/zh_TW/guide/config-casdoor'},
-            {text: 'Logrotate', link: '/zh_CN/guide/config-logrotate'}
+            {text: 'Logrotate', link: '/zh_TW/guide/config-logrotate'},
+            {text: '集群', link: '/zh_TW/guide/config-cluster'}
           ]
         },
         {

+ 24 - 0
docs/guide/config-cluster.md

@@ -0,0 +1,24 @@
+# 集群
+From v2.0.0-beta.23, you can define multiple environments in the `cluster` section of the configuration file.
+
+## Node
+- Type: `string`
+- Structure:`Scheme://Host(:Port)?name=ENV_NAME&node_secret=NODE_SECRET&enabled=(true/false)`
+- Example: `http://10.0.0.1:9000?name=node1&node_secret=my-node-secret&enabled=true`
+
+If you have multiple environments to configure, please refer to the following configuration:
+```ini
+[cluster]
+Node = http://10.0.0.1:9000?name=node1&node_secret=my-node-secret&enabled=true
+Node = http://10.0.0.2:9000?name=node2&node_secret=my-node-secret&enabled=false
+Node = http://10.0.0.3?name=node3&node_secret=my-node-secret&enabled=true
+```
+
+By default, Nginx UI will create the predefined environments during the bootstrapping stage.
+You can also find the "Load from Config" button in the environment list in the WebUI to manually update the environments.
+
+In order to avoid conflicts with the environemnts that already exist in the database,
+Nginx UI will check if the `Scheme://Host(:Port)` part is unique.
+If it does not exist, it will be created according to the configuration, otherwise no action will be taken.
+
+Please note that if you delete a node from the configuration file, Nginx UI will not delete the record from the database.

+ 25 - 0
docs/guide/config-server.md

@@ -106,6 +106,7 @@ allows them to set a proxy for github.com to improve accessibility.
 
 ## CertRenewalInterval
 
+- Version:`>= v2.0.0-beta.22`
 - Type: `int`
 - Default value: `7`
 
@@ -114,9 +115,33 @@ By default, Nginx UI will automatically renew the certificate every 7 days.
 
 ## RecursiveNameservers
 
+- Version:`>= v2.0.0-beta.22`
 - Type: `[]string`
 - Example: `8.8.8.8:53,1.1.1.1:53`
 
 This option is used to set the recursive nameservers used by
 Nginx UI in the DNS challenge step of applying for a certificate.
 If this option is not configured, Nginx UI will use the nameservers settings of the operating system.
+
+## SkipInstallation
+
+- Version:`>= v2.0.0-beta.23`
+- Type: `bool`
+- Default value: `false`
+
+You can skip the installation of the Nginx UI server by setting this option to `true`.
+This is useful when you want to deploy Nginx UI to multiple servers with
+a same configuration file or environment variables.
+
+By default, if you enabled the skip installation mode without setting the `JWTSecret` and `NodeSecret` options
+in the server section, Nginx UI will generate a random UUID value for these two options.
+
+Plus, if you don't set the `Email` option also in the server section,
+Nginx UI will not create a system initial acme user, this means you can't apply for an SSL certificate in this server.
+
+## Name
+
+- Version:`>= v2.0.0-beta.23`
+- Type: `string`
+
+Use this option to customize the name of local server to be displayed in the environment indicator.

+ 24 - 0
docs/zh_CN/guide/config-cluster.md

@@ -0,0 +1,24 @@
+# 集群
+
+自 v2.0.0-beta.23 起,您可以在配置文件的 `cluster` 分区中定义多个环境。
+
+## Node
+- 类型: `string`
+- 结构:`Scheme://Host(:Port)?name=环境名称&node_secret=节点密钥&enabled=是否启用`
+- 示例: `http://10.0.0.1:9000?name=node1&node_secret=my-node-secret&enabled=true`
+
+
+如果您需要配置多个环境,请参考下面的配置:
+```ini
+[cluster]
+Node = http://10.0.0.1:9000?name=node1&node_secret=my-node-secret&enabled=true
+Node = http://10.0.0.2:9000?name=node2&node_secret=my-node-secret&enabled=false
+Node = http://10.0.0.3?name=node3&node_secret=my-node-secret&enabled=true
+```
+
+默认情况下,Nginx UI 将在启动阶段执行环境的创建操作,您也可以在 WebUI 中的环境列表中找到「从配置中加载」按钮,手动更新环境。
+
+为了避免与数据库内已经存在的环境冲突,Nginx UI 会检查 `Scheme://Host(:Port)` 部分是否应是否唯一,
+如果不存在,则按照配置进行创建,反之则不会进行任何操作。
+
+注意:如果您删除了配置文件中的某个节点,Nginx UI 不会删除数据库中的记录。

+ 24 - 0
docs/zh_CN/guide/config-server.md

@@ -97,6 +97,7 @@ JWT 是一种用于验证用户身份的标准,它可以在用户登录后生
 
 ## CertRenewalInterval
 
+- 版本:`>= v2.0.0-beta.22`
 - 类型:`int`
 - 默认值: `7`
 
@@ -104,7 +105,30 @@ JWT 是一种用于验证用户身份的标准,它可以在用户登录后生
 
 ## RecursiveNameservers
 
+- 版本:`>= v2.0.0-beta.22`
 - 类型: `[]string`
 - 示例: `8.8.8.8:53,1.1.1.1:53`
 
 此选项用于设置 Nginx UI 在申请证书的 DNS 挑战步骤所使用的递归域名服务器。在不配置此项目的情况下,Nginx UI 使用操作系统的域名服务器设置。
+
+## SkipInstallation
+
+- 版本:`>= v2.0.0-beta.23`
+- 类型:`bool`
+- 默认值:`false`
+
+通过将此选项设置为 `true`,您可以跳过 Nginx UI 服务器的安装。
+当您希望使用相同的配置文件或环境变量将 Nginx UI 部署到多个服务器时,这非常有用。
+
+默认情况下,如果您启用了跳过安装模式,而没有在服务器部分设置 `JWTSecret` 和 `NodeSecret` 选项,
+Nginx UI 将为这两个选项生成一个随机的 UUID 值。
+
+此外,如果您也没有在服务器部分设置 `Email` 选项,
+Nginx UI 将不会创建系统初始的 acme 用户,这意味着您无法在此服务器上申请 SSL 证书。
+
+## Name
+
+- 版本:`>= v2.0.0-beta.23`
+- 类型:`string`
+
+使用此选项自定义本地服务器的名称,以在环境指示器中显示。

+ 26 - 0
docs/zh_TW/guide/config-cluster.md

@@ -0,0 +1,26 @@
+# 集群
+
+自 v2.0.0-beta.23 起,您可以在配置文件的 `cluster` 分區中定義多個環境。
+
+## Node
+
+- 版本:`>= v2.0.0-beta.23`
+- 類型: `string`
+- 結構:`Scheme://Host(:Port)?name=環境名稱&node_secret=節點密鑰&enabled=是否啟用`
+- 範例: `http://10.0.0.1:9000?name=node1&node_secret=my-node-secret&enabled=true`
+
+
+如果您需要配置多個環境,請參考下面的配置:
+```ini
+[cluster]
+Node = http://10.0.0.1:9000?name=node1&node_secret=my-node-secret&enabled=true
+Node = http://10.0.0.2:9000?name=node2&node_secret=my-node-secret&enabled=false
+Node = http://10.0.0.3?name=node3&node_secret=my-node-secret&enabled=true
+```
+
+預設情況下,Nginx UI 將在啟動階段執行環境的創建操作,您也可以在 WebUI 中的環境列表中找到「從配置中加載」按鈕,手動更新環境。
+
+為了避免與資料庫內已經存在的環境衝突,Nginx UI 會檢查 Scheme://Host(:Port) 部分是否應是否唯一,
+如果不存在,則按照配置進行創建,反之則不會進行任何操作。
+
+注意:如果您刪除了配置文件中的某個節點,Nginx UI 不會刪除資料庫中的記錄。

+ 24 - 0
docs/zh_TW/guide/config-server.md

@@ -98,6 +98,7 @@ JWT 是一種用於驗證用戶身份的標準,它可以在用戶登錄後生
 
 ## CertRenewalInterval
 
+- 版本:`>= v2.0.0-beta.22`
 - 類型:`int`
 - 預設值: `7`
 
@@ -105,7 +106,30 @@ JWT 是一種用於驗證用戶身份的標準,它可以在用戶登錄後生
 
 ## RecursiveNameservers
 
+- 版本:`>= v2.0.0-beta.22`
 - 類型: `[]string`
 - 範例: `8.8.8.8:53,1.1.1.1:53`
 
 此選項用於設定 Nginx UI 在申請證書的 DNS 挑戰步驟所使用的遞迴域名伺服器。在不配置此項目的情況下,Nginx UI 使用作業系統的域名伺服器設定。
+
+## SkipInstallation
+
+- 版本:`>= v2.0.0-beta.23`
+- 類型:`bool`
+- 預設值:`false`
+
+透過將此選項設定為 `true`,您可以跳過 Nginx UI 伺服器的安裝。
+當您希望使用相同的配置文件或環境變數將 Nginx UI 部署到多個伺服器時,這非常有用。
+
+預設情況下,如果您啟用了跳過安裝模式,而沒有在伺服器部分設定 `JWTSecret` 和 `NodeSecret` 選項,
+Nginx UI 將為這兩個選項生成一個隨機的 UUID 值。
+
+此外,如果您也沒有在伺服器部分設定 `Email` 選項,
+Nginx UI 將不會創建系統初始的 acme 使用者,這意味著您無法在此伺服器上申請 SSL 證書。
+
+## Name
+
+- 版本:`>= v2.0.0-beta.23`
+- 類型:`string`
+
+使用此選項自定義本地伺服器的名稱,以在環境指示器中顯示。