Skip to content

Commit 57ce1f7

Browse files
committed
📝 补充相关文档
1 parent 1830c73 commit 57ce1f7

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

website/docs/appendices/config.mdx

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,7 @@ export CUSTOM_CONFIG='config in environment variables'
8585

8686
:::caution 注意
8787
NoneBot 不会自发读取未被定义的配置项的环境变量,如果需要读取某一环境变量需要在 dotenv 配置文件中进行声明。
88+
如果希望 Nonebot 在启动时读取所有的系统环境变量,需要配置环境变量 `ENV_GREEDY_LOAD=true`
8889
:::
8990

9091
### dotenv 配置文件
@@ -630,3 +631,14 @@ nonebot.init(session_expire_timeout=120)
630631

631632
</TabItem>
632633
</Tabs>
634+
635+
### Env Greedy Load
636+
637+
- **类型**: `bool`
638+
- **默认值**: `False`
639+
640+
是否读取系统中的所有环境变量,默认关闭。
641+
642+
未启用时,Nonebot仅会读取在 dotenv 配置文件中声明过的环境变量。
643+
644+
如果你的 Nonebot 在 Docker 中运行,可以考虑启用。

0 commit comments

Comments
 (0)