Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

[Bug] App passwords that start with "+" or "-0" are changed in the .env file

オープン
#14,179 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

@RaphaelFakhri がすでに取り組んでいます。

2026年10月24日 から。

  • #14180 @RaphaelFakhri による — オープン

評価

難易度
2/5
見積もり時間
1〜3時間
初心者へのやさしさ
30/100
issue の種類
バグ
明瞭さ
明確に書かれている
活発さ
活発
技術スタック
go
領域
backend

調査の方向性

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
  1. Install MySQL (or another app with a password parameter) from the app store.
  2. Set the root password to +123456.
  3. Open the app's .env file 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分
マージ済み PR(30日)
80

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

1Panel-dev/1Panel のほかの issue

1Panel-dev/1Panel の issue をすべて見る

似ている issue

Go の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。