From ae03420b9e573217d6f03a78b76b25a1040577e3 Mon Sep 17 00:00:00 2001 From: moonrailgun Date: Tue, 27 Jun 2023 15:31:04 +0800 Subject: [PATCH] docs: add usage about environment var with space --- website/docs/deployment/environment.md | 12 ++++++++++++ .../current/deployment/environment.md | 13 +++++++++++++ 2 files changed, 25 insertions(+) diff --git a/website/docs/deployment/environment.md b/website/docs/deployment/environment.md index 9c1870fe..1bd54ae0 100644 --- a/website/docs/deployment/environment.md +++ b/website/docs/deployment/environment.md @@ -38,6 +38,18 @@ title: Environment Variable - If it is started by `docker-compose`, you can directly edit `docker-compose.env`, and use `docker compose up -d` directly after the modification to take effect +### About the use of environment variables with spaces + +If your environment variable value contains spaces, in order for the system to recognize that this is a complete string instead of treating spaces as separators. You need to wrap a double quotes around the outside. + +For example: + +```bash +SMTP_SENDER="\"Tailchat\" example@163.com" # If there are repeated double quotes, they need to be escaped with an escape character +``` + + +------------- :::caution Some environment variable modifications may need to clear the cache to take effect diff --git a/website/i18n/zh-Hans/docusaurus-plugin-content-docs/current/deployment/environment.md b/website/i18n/zh-Hans/docusaurus-plugin-content-docs/current/deployment/environment.md index 207f25a3..1b75b4f1 100644 --- a/website/i18n/zh-Hans/docusaurus-plugin-content-docs/current/deployment/environment.md +++ b/website/i18n/zh-Hans/docusaurus-plugin-content-docs/current/deployment/environment.md @@ -38,6 +38,19 @@ title: 环境变量 - 如果是 `docker-compose` 启动,可以直接编辑 `docker-compose.env`, 改动后直接使用 `docker compose up -d` 即可生效 + +### 关于带空格的环境变量的使用 + +如果你的环境变量值包含空格,为了让系统能够识别这是一个完整的字符串而不是把空格视为分隔符。你需要在外部包一层双引号。 + +如下: + +```bash +SMTP_SENDER="\"Tailchat\" example@163.com" # 如果有重复的双引号需要使用转义符对其进行转义 +``` + +----------- + :::caution 部分环境变量修改可能需要清理缓存后才能生效 :::