[Bug] App passwords that start with "+" or "-0" are changed in the .env file
维护者通常 1 天内回复
评估
调研方向
The bug is in agent/utils/env/env.go where Marshal and MarshalWithOrder write values with %d after strconv.Atoi parses them. Read those functions and change the logic so strings with a leading '+' or '-0' are emitted quoted. Done means the app .env shows PANEL_DB_ROOT_PASSWORD='+123456' unaltered.
由索引模型根据 Issue 内容生成。
描述
1Panel Version
Current dev-v2 (commit c4b76a8).
Problem Description
When you install an app or edit its parameters, 1Panel rewrites values that look like signed integers in the app's .env file. For example, the password +123456 is written as PANEL_DB_ROOT_PASSWORD=123456, and -0123 is written as -123. 1Panel still stores and shows the original value, but the container starts with the changed one, so you cannot log in with the password you entered.
This is the same problem as #4949, where values with a leading 0 lost their zeros. That case is fixed, but values with a leading + or with -0 still change.
Steps to Reproduce
- Install MySQL (or another app with a password parameter) from the app store.
- Set the root password to
+123456. - Open the app's
.envfile under/opt/1panel/apps/mysql/<name>/.env.
The expected correct result
PANEL_DB_ROOT_PASSWORD='+123456'
Related log output
PANEL_DB_ROOT_PASSWORD=123456
Additional Information
The cause is in agent/utils/env/env.go. Marshal and MarshalWithOrder write a value unquoted with %d whenever strconv.Atoi parses it, and Atoi accepts +123456 and -0123.
- 主要语言
- Go
- 星标
- 37.3k
- 派生
- 3.4k
- 平均合并
- 10 小时 31 分钟
- 30 天内合并 PR
- 80
环境准备
- 没有 Dockerfile 或 Docker Compose 文件
- 有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
1Panel-dev/1Panel 的其他 Issue
-
Consider switching the panel terminal to PTY (pseudo-terminal) so that the panel terminal can still be used when the SSH service is disabled!可能已有人在做 @wanghe-fit2cloud 于 2 天前认领。 未关闭type: feature-request
1Panel-dev/1Panel#14178 · 2 条评论 · 已指派 1 人 ·
维护者通常 1 天内回复
-
[Feature] Why can’t the Referer field in the header be left empty when configuring custom WAF rules?可能已有人在做 @wanghe-fit2cloud 于 2 天前认领。 未关闭type: feature-request
1Panel-dev/1Panel#14176 · 1 条评论 · 已指派 1 人 ·
维护者通常 1 天内回复
-
[Feature] Can CAS be integrated into 1Panel’s authentication system?可能已有人在做 @wanghe-fit2cloud 于 2 天前认领。 未关闭type: feature-request
1Panel-dev/1Panel#14174 · 1 条评论 · 已指派 1 人 ·
维护者通常 1 天内回复
-
[Bug] MySQL backup fails with “illegal characters” when the password contains special characters可能已有人在做 @wanghe-fit2cloud 于 2 天前认领。 未关闭type: optimization
1Panel-dev/1Panel#14172 · 1 条评论 · 已指派 1 人 ·
维护者通常 1 天内回复
-
[Feature] Keep WAF supplemental rules updated and add CVE-2026-109618 / CVE-2026-109619可能已有人在做 @wanghe-fit2cloud 于 3 天前认领。 未关闭type: feature-request
1Panel-dev/1Panel#14171 · 1 条评论 · 已指派 1 人 ·
维护者通常 1 天内回复
查看 1Panel-dev/1Panel 的全部 Issue
相似的 Issue
-
难度 2/5 1-3 小时 新手友好度 82/100
eugenioenko/ttt#1206 ·
维护者通常 1 天内回复
-
t:urlDecodeUni does not map U+3002 and U+FF61 to a dot, unlike ModSecurity可能已有人在做 @fzipi 今天认领。 未关闭bug
难度 2/5 1-3 小时 新手友好度 78/100
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 76/100
peasant-labs/peasant#738 ·
维护者通常 1 天内回复
-
Duplicate review still bridges two books through a bundle whose first part has a colon subtitle可能已有人在做 @vavallee 今天认领。 未关闭area:library-scan bug priority:low
难度 2/5 1-3 小时 新手友好度 83/100
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 72/100
维护者通常 1 天内回复