-
Notifications
You must be signed in to change notification settings - Fork 53.9k
fix: docker重新部署时,.env设置里的通知变量$content_jso… (#1739) #1741
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
512cae7
e1f00f4
c51e807
ee3c7c4
3270d4d
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -1671,14 +1671,14 @@ def apply_simple_updates( | |
|
|
||
| @staticmethod | ||
| def _parse_imported_env_content(content: str) -> List[Dict[str, str]]: | ||
| """Parse raw `.env` text into update items using current dotenv semantics.""" | ||
| """Parse raw `.env` text into update items without expanding app templates.""" | ||
| normalized_content = content.replace("\ufeff", "") | ||
| if not normalized_content.strip(): | ||
| raise ConfigImportError("未识别到有效 .env 配置") | ||
|
|
||
| from dotenv import dotenv_values | ||
|
|
||
| parsed = dotenv_values(stream=io.StringIO(normalized_content)) | ||
| parsed = dotenv_values(stream=io.StringIO(normalized_content), interpolate=False) | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
When an imported/exported Useful? React with 👍 / 👎. |
||
| updates: List[Dict[str, str]] = [] | ||
| for key, value in parsed.items(): | ||
| if key is None: | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When a user saves the valid braced
string.Templateform, this line persists it as$${content_json}in the raw.env. The Settings export/import path exports that raw value, butSystemConfigService._parse_imported_env_contentstill parses imports withdotenv_values(stream=...)interpolation enabled, which turns$${content_json}into$(or$<env value>) beforeConfigManagercan unescape it. In the export-then-import/restore flow, the restored webhook template becomes invalid instead of${content_json}; parse imported env content withinterpolate=Falseor use an import-safe escape for the braced form.Useful? React with 👍 / 👎.