Skip to content

Commit

Permalink
chore: modify code specification
Browse files Browse the repository at this point in the history
  • Loading branch information
coulsontl committed Nov 9, 2024
1 parent 5a65503 commit 6a204ff
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 8 deletions.
7 changes: 4 additions & 3 deletions docs/self-hosting/environment-variables/basic.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -92,17 +92,18 @@ For specific content, please refer to the [Feature Flags](/docs/self-hosting/adv
`localhost` / `127.0.0.1` refers to the localhost of the container itself. In such cases, please
try using `host.docker.internal` instead of `localhost`.
</Callout>

### `SSRF_ALLOW_PRIVATE_IP_ADDRESS`

- Type: Optional
- Description: Allow to connect private IP address. In a trusted environment, it can be set to true to turn off SSRF protection.
- Default: false
- Example: `true` or `false`
- Default: `0`
- Example: `1` or `0`

### `SSRF_ALLOW_IP_ADDRESS_LIST`

- Type: Optional
- Description: Allow private IP address list, multiple IP addresses are separated by commas. Only when SSRF_ALLOW_PRIVATE_IP_ADDRESS is false, it takes effect.
- Description: Allow private IP address list, multiple IP addresses are separated by commas. Only when `SSRF_ALLOW_PRIVATE_IP_ADDRESS` is `0`, it takes effect.
- Default: -
- Example: `198.18.1.62,224.0.0.3`

Expand Down
7 changes: 4 additions & 3 deletions docs/self-hosting/environment-variables/basic.zh-CN.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -87,17 +87,18 @@ LobeChat 在部署时提供了一些额外的配置项,你可以使用环境
`Docker Desktop``Windows ``macOS `上走的是虚拟机方案,如果是 `localhost` / `127.0.0.1`
是走到自身容器的 `localhost`,此时请尝试用 `host.docker.internal` 替代 `localhost`
</Callout>

### `SSRF_ALLOW_PRIVATE_IP_ADDRESS`

- 类型:可选
- 描述:是否允许连接私有IP地址。在可信环境中可以设置为true来关闭SSRF防护。
- 默认值:false
- 示例:`true` or `false`
- 默认值:`0`
- 示例:`1` or `0`

### `SSRF_ALLOW_IP_ADDRESS_LIST`

- 类型:可选
- 描述:允许连接的私有IP地址列表,多个IP地址时使用逗号分隔。当SSRF_ALLOD_PRIVATE_IP_ADDRESS为FALSE时才会生效
- 描述:允许连接的私有IP地址列表,多个IP地址时使用逗号分隔。`SSRF_ALLOW_PRIVATE_IP_ADDRESS``0` 时才会生效
- 默认值:-
- 示例:`198.18.1.62,224.0.0.3`

Expand Down
3 changes: 1 addition & 2 deletions src/config/app.ts
Original file line number Diff line number Diff line change
Expand Up @@ -76,8 +76,7 @@ export const getAppConfig = () => {
CUSTOM_FONT_URL: process.env.CUSTOM_FONT_URL,
CDN_USE_GLOBAL: process.env.CDN_USE_GLOBAL === '1',

SSRF_ALLOW_PRIVATE_IP_ADDRESS:
process.env.SSRF_ALLOW_PRIVATE_IP_ADDRESS?.toLowerCase() === 'true',
SSRF_ALLOW_PRIVATE_IP_ADDRESS: process.env.SSRF_ALLOW_PRIVATE_IP_ADDRESS === '1',
SSRF_ALLOW_IP_ADDRESS_LIST: process.env.SSRF_ALLOW_IP_ADDRESS_LIST,
},
});
Expand Down

0 comments on commit 6a204ff

Please sign in to comment.