Skip to content

Commit

Permalink
chore: update docs
Browse files Browse the repository at this point in the history
  • Loading branch information
0xJacky committed Oct 9, 2024
1 parent 4951f5a commit 96cff98
Show file tree
Hide file tree
Showing 4 changed files with 100 additions and 95 deletions.
19 changes: 10 additions & 9 deletions docs/guide/env.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,15 +26,16 @@ Applicable for version v2.0.0-beta.23 and above.

## Nginx

| Configuration Setting | Environment Variable |
|-----------------------|--------------------------------|
| AccessLogPath | NGINX_UI_NGINX_ACCESS_LOG_PATH |
| ErrorLogPath | NGINX_UI_NGINX_ERROR_LOG_PATH |
| ConfigDir | NGINX_UI_NGINX_CONFIG_DIR |
| PIDPath | NGINX_UI_NGINX_PID_PATH |
| TestConfigCmd | NGINX_UI_NGINX_TEST_CONFIG_CMD |
| ReloadCmd | NGINX_UI_NGINX_RELOAD_CMD |
| RestartCmd | NGINX_UI_NGINX_RESTART_CMD |
| Configuration Setting | Environment Variable |
|-----------------------|-----------------------------------|
| AccessLogPath | NGINX_UI_NGINX_ACCESS_LOG_PATH |
| ErrorLogPath | NGINX_UI_NGINX_ERROR_LOG_PATH |
| ConfigDir | NGINX_UI_NGINX_CONFIG_DIR |
| PIDPath | NGINX_UI_NGINX_PID_PATH |
| TestConfigCmd | NGINX_UI_NGINX_TEST_CONFIG_CMD |
| ReloadCmd | NGINX_UI_NGINX_RELOAD_CMD |
| RestartCmd | NGINX_UI_NGINX_RESTART_CMD |
| LogDirWhiteList | NGINX_UI_NGINX_LOG_DIR_WHITE_LIST |

## OpenAI

Expand Down
87 changes: 44 additions & 43 deletions docs/zh_CN/guide/env.md
Original file line number Diff line number Diff line change
@@ -1,48 +1,50 @@
# 环境变量

适用于 v2.0.0-beta.23 及以上版本

## Server

| Configuration Setting | Environment Variable |
|-------------------------| ------------------------------------- |
| HttpPort | NGINX_UI_SERVER_HTTP_PORT |
| RunMode | NGINX_UI_SERVER_RUN_MODE |
| JwtSecret | NGINX_UI_SERVER_JWT_SECRET |
| HTTPChallengePort | NGINX_UI_SERVER_HTTP_CHALLENGE_PORT |
| StartCmd | NGINX_UI_SERVER_START_CMD |
| Database | NGINX_UI_SERVER_DATABASE |
| CADir | NGINX_UI_SERVER_CA_DIR |
| GithubProxy | NGINX_UI_SERVER_GITHUB_PROXY |
| NodeSecret | NGINX_UI_SERVER_NODE_SECRET |
| Demo | NGINX_UI_SERVER_DEMO |
| PageSize | NGINX_UI_SERVER_PAGE_SIZE |
| HttpHost | NGINX_UI_SERVER_HTTP_HOST |
| CertRenewalInterval | NGINX_UI_SERVER_CERT_RENEWAL_INTERVAL |
| RecursiveNameservers | NGINX_UI_SERVER_RECURSIVE_NAMESERVERS |
| SkipInstallation | NGINX_UI_SERVER_SKIP_INSTALLATION |
| Name | NGINX_UI_SERVER_NAME |
| InsecureSkipVerify | NGINX_UI_SERVER_INSECURE_SKIP_VERIFY |
| Configuration Setting | Environment Variable |
|-----------------------|---------------------------------------|
| HttpPort | NGINX_UI_SERVER_HTTP_PORT |
| RunMode | NGINX_UI_SERVER_RUN_MODE |
| JwtSecret | NGINX_UI_SERVER_JWT_SECRET |
| HTTPChallengePort | NGINX_UI_SERVER_HTTP_CHALLENGE_PORT |
| StartCmd | NGINX_UI_SERVER_START_CMD |
| Database | NGINX_UI_SERVER_DATABASE |
| CADir | NGINX_UI_SERVER_CA_DIR |
| GithubProxy | NGINX_UI_SERVER_GITHUB_PROXY |
| NodeSecret | NGINX_UI_SERVER_NODE_SECRET |
| Demo | NGINX_UI_SERVER_DEMO |
| PageSize | NGINX_UI_SERVER_PAGE_SIZE |
| HttpHost | NGINX_UI_SERVER_HTTP_HOST |
| CertRenewalInterval | NGINX_UI_SERVER_CERT_RENEWAL_INTERVAL |
| RecursiveNameservers | NGINX_UI_SERVER_RECURSIVE_NAMESERVERS |
| SkipInstallation | NGINX_UI_SERVER_SKIP_INSTALLATION |
| Name | NGINX_UI_SERVER_NAME |
| InsecureSkipVerify | NGINX_UI_SERVER_INSECURE_SKIP_VERIFY |

## Nginx

| Configuration Setting | Environment Variable |
| ----------------------------- | ------------------------------------- |
| AccessLogPath | NGINX_UI_NGINX_ACCESS_LOG_PATH |
| ErrorLogPath | NGINX_UI_NGINX_ERROR_LOG_PATH |
| ConfigDir | NGINX_UI_NGINX_CONFIG_DIR |
| PIDPath | NGINX_UI_NGINX_PID_PATH |
| TestConfigCmd | NGINX_UI_NGINX_TEST_CONFIG_CMD |
| ReloadCmd | NGINX_UI_NGINX_RELOAD_CMD |
| RestartCmd | NGINX_UI_NGINX_RESTART_CMD |
| Configuration Setting | Environment Variable |
|-----------------------|-----------------------------------|
| AccessLogPath | NGINX_UI_NGINX_ACCESS_LOG_PATH |
| ErrorLogPath | NGINX_UI_NGINX_ERROR_LOG_PATH |
| ConfigDir | NGINX_UI_NGINX_CONFIG_DIR |
| PIDPath | NGINX_UI_NGINX_PID_PATH |
| TestConfigCmd | NGINX_UI_NGINX_TEST_CONFIG_CMD |
| ReloadCmd | NGINX_UI_NGINX_RELOAD_CMD |
| RestartCmd | NGINX_UI_NGINX_RESTART_CMD |
| LogDirWhiteList | NGINX_UI_NGINX_LOG_DIR_WHITE_LIST |

## OpenAI

| Configuration Setting | Environment Variable |
| ----------------------------- | ------------------------------------- |
| Model | NGINX_UI_OPENAI_MODEL |
| BaseUrl | NGINX_UI_OPENAI_BASE_URL |
| Proxy | NGINX_UI_OPENAI_PROXY |
| Token | NGINX_UI_OPENAI_TOKEN |
| Configuration Setting | Environment Variable |
|-----------------------|--------------------------|
| Model | NGINX_UI_OPENAI_MODEL |
| BaseUrl | NGINX_UI_OPENAI_BASE_URL |
| Proxy | NGINX_UI_OPENAI_PROXY |
| Token | NGINX_UI_OPENAI_TOKEN |

## Casdoor

Expand All @@ -58,17 +60,17 @@

## Logrotate

| Configuration Setting | Environment Variable |
| ----------------------------- | ------------------------------------- |
| Enabled | NGINX_UI_LOGROTATE_ENABLED |
| CMD | NGINX_UI_LOGROTATE_CMD |
| Interval | NGINX_UI_LOGROTATE_INTERVAL |
| Configuration Setting | Environment Variable |
|-----------------------|-----------------------------|
| Enabled | NGINX_UI_LOGROTATE_ENABLED |
| CMD | NGINX_UI_LOGROTATE_CMD |
| Interval | NGINX_UI_LOGROTATE_INTERVAL |

## Auth

| Configuration Setting | Environment Variable |
|-----------------------|-----------------------------|
| IPWhiteList | NGINX_UI_AUTH_IPWhiteList |
| Configuration Setting | Environment Variable |
|-----------------------|---------------------------|
| IPWhiteList | NGINX_UI_AUTH_IPWhiteList |

## Webauthn

Expand All @@ -78,7 +80,6 @@
| RPID | NGINX_UI_WEBAUTHN_RPID |
| RPOrigins | NGINX_UI_WEBAUTHN_RP_ORIGINS |


## 预定义用户

在跳过安装模式下,您可以设置以下环境变量以创建预定义用户:
Expand Down
87 changes: 44 additions & 43 deletions docs/zh_TW/guide/env.md
Original file line number Diff line number Diff line change
@@ -1,48 +1,50 @@
# 環境變量

適用於 v2.0.0-beta.23 及以上版本

## Server

| Configuration Setting | Environment Variable |
|------------------------| ------------------------------------- |
| HttpPort | NGINX_UI_SERVER_HTTP_PORT |
| RunMode | NGINX_UI_SERVER_RUN_MODE |
| JwtSecret | NGINX_UI_SERVER_JWT_SECRET |
| HTTPChallengePort | NGINX_UI_SERVER_HTTP_CHALLENGE_PORT |
| StartCmd | NGINX_UI_SERVER_START_CMD |
| Database | NGINX_UI_SERVER_DATABASE |
| CADir | NGINX_UI_SERVER_CA_DIR |
| GithubProxy | NGINX_UI_SERVER_GITHUB_PROXY |
| NodeSecret | NGINX_UI_SERVER_NODE_SECRET |
| Demo | NGINX_UI_SERVER_DEMO |
| PageSize | NGINX_UI_SERVER_PAGE_SIZE |
| HttpHost | NGINX_UI_SERVER_HTTP_HOST |
| CertRenewalInterval | NGINX_UI_SERVER_CERT_RENEWAL_INTERVAL |
| RecursiveNameservers | NGINX_UI_SERVER_RECURSIVE_NAMESERVERS |
| SkipInstallation | NGINX_UI_SERVER_SKIP_INSTALLATION |
| Name | NGINX_UI_SERVER_NAME |
| InsecureSkipVerify | NGINX_UI_SERVER_INSECURE_SKIP_VERIFY |
| Configuration Setting | Environment Variable |
|-----------------------|---------------------------------------|
| HttpPort | NGINX_UI_SERVER_HTTP_PORT |
| RunMode | NGINX_UI_SERVER_RUN_MODE |
| JwtSecret | NGINX_UI_SERVER_JWT_SECRET |
| HTTPChallengePort | NGINX_UI_SERVER_HTTP_CHALLENGE_PORT |
| StartCmd | NGINX_UI_SERVER_START_CMD |
| Database | NGINX_UI_SERVER_DATABASE |
| CADir | NGINX_UI_SERVER_CA_DIR |
| GithubProxy | NGINX_UI_SERVER_GITHUB_PROXY |
| NodeSecret | NGINX_UI_SERVER_NODE_SECRET |
| Demo | NGINX_UI_SERVER_DEMO |
| PageSize | NGINX_UI_SERVER_PAGE_SIZE |
| HttpHost | NGINX_UI_SERVER_HTTP_HOST |
| CertRenewalInterval | NGINX_UI_SERVER_CERT_RENEWAL_INTERVAL |
| RecursiveNameservers | NGINX_UI_SERVER_RECURSIVE_NAMESERVERS |
| SkipInstallation | NGINX_UI_SERVER_SKIP_INSTALLATION |
| Name | NGINX_UI_SERVER_NAME |
| InsecureSkipVerify | NGINX_UI_SERVER_INSECURE_SKIP_VERIFY |

## Nginx

| Configuration Setting | Environment Variable |
| ----------------------------- | ------------------------------------- |
| AccessLogPath | NGINX_UI_NGINX_ACCESS_LOG_PATH |
| ErrorLogPath | NGINX_UI_NGINX_ERROR_LOG_PATH |
| ConfigDir | NGINX_UI_NGINX_CONFIG_DIR |
| PIDPath | NGINX_UI_NGINX_PID_PATH |
| TestConfigCmd | NGINX_UI_NGINX_TEST_CONFIG_CMD |
| ReloadCmd | NGINX_UI_NGINX_RELOAD_CMD |
| RestartCmd | NGINX_UI_NGINX_RESTART_CMD |
| Configuration Setting | Environment Variable |
|-----------------------|-----------------------------------|
| AccessLogPath | NGINX_UI_NGINX_ACCESS_LOG_PATH |
| ErrorLogPath | NGINX_UI_NGINX_ERROR_LOG_PATH |
| ConfigDir | NGINX_UI_NGINX_CONFIG_DIR |
| PIDPath | NGINX_UI_NGINX_PID_PATH |
| TestConfigCmd | NGINX_UI_NGINX_TEST_CONFIG_CMD |
| ReloadCmd | NGINX_UI_NGINX_RELOAD_CMD |
| RestartCmd | NGINX_UI_NGINX_RESTART_CMD |
| LogDirWhiteList | NGINX_UI_NGINX_LOG_DIR_WHITE_LIST |

## OpenAI

| Configuration Setting | Environment Variable |
| ----------------------------- | ------------------------------------- |
| Model | NGINX_UI_OPENAI_MODEL |
| BaseUrl | NGINX_UI_OPENAI_BASE_URL |
| Proxy | NGINX_UI_OPENAI_PROXY |
| Token | NGINX_UI_OPENAI_TOKEN |
| Configuration Setting | Environment Variable |
|-----------------------|--------------------------|
| Model | NGINX_UI_OPENAI_MODEL |
| BaseUrl | NGINX_UI_OPENAI_BASE_URL |
| Proxy | NGINX_UI_OPENAI_PROXY |
| Token | NGINX_UI_OPENAI_TOKEN |

## Casdoor

Expand All @@ -58,17 +60,17 @@

## Logrotate

| Configuration Setting | Environment Variable |
| ----------------------------- | ------------------------------------- |
| Enabled | NGINX_UI_LOGROTATE_ENABLED |
| CMD | NGINX_UI_LOGROTATE_CMD |
| Interval | NGINX_UI_LOGROTATE_INTERVAL |
| Configuration Setting | Environment Variable |
|-----------------------|-----------------------------|
| Enabled | NGINX_UI_LOGROTATE_ENABLED |
| CMD | NGINX_UI_LOGROTATE_CMD |
| Interval | NGINX_UI_LOGROTATE_INTERVAL |

## Auth

| Configuration Setting | Environment Variable |
|-----------------------|-----------------------------|
| IPWhiteList | NGINX_UI_AUTH_IPWhiteList |
| Configuration Setting | Environment Variable |
|-----------------------|---------------------------|
| IPWhiteList | NGINX_UI_AUTH_IPWhiteList |

## Webauthn

Expand All @@ -78,7 +80,6 @@
| RPID | NGINX_UI_WEBAUTHN_RPID |
| RPOrigins | NGINX_UI_WEBAUTHN_RP_ORIGINS |


## 預定義使用者

在跳過安裝模式下,您可以設置以下環境變量以創建預定義使用者:
Expand Down
2 changes: 2 additions & 0 deletions settings/settings_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ func TestSetup(t *testing.T) {
_ = os.Setenv("NGINX_UI_NGINX_TEST_CONFIG_CMD", "nginx -t")
_ = os.Setenv("NGINX_UI_NGINX_RELOAD_CMD", "nginx -s reload")
_ = os.Setenv("NGINX_UI_NGINX_RESTART_CMD", "nginx -s restart")
_ = os.Setenv("NGINX_UI_NGINX_LOG_DIR_WHITE_LIST", "/var/log/nginx")

_ = os.Setenv("NGINX_UI_OPENAI_MODEL", "davinci")
_ = os.Setenv("NGINX_UI_OPENAI_BASE_URL", "https://api.openai.com")
Expand Down Expand Up @@ -84,6 +85,7 @@ func TestSetup(t *testing.T) {
assert.Equal(t, "nginx -t", NginxSettings.TestConfigCmd)
assert.Equal(t, "nginx -s reload", NginxSettings.ReloadCmd)
assert.Equal(t, "nginx -s stop", NginxSettings.RestartCmd)
assert.Equal(t, []string{"/var/log/nginx"}, NginxSettings.LogDirWhiteList)

assert.Equal(t, "davinci", OpenAISettings.Model)
assert.Equal(t, "https://api.openai.com", OpenAISettings.BaseUrl)
Expand Down

0 comments on commit 96cff98

Please sign in to comment.