Hacktoberfest 2026: los issues que los mantenedores marcaron para octubre, abiertos y aptos para principiantes. Explorar issues de Hacktoberfest

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

Abierto
#14,179 0 comentarios 0 reacciones 0 asignados Ver en GitHub

Los mantenedores suelen responder en 1 día

@RaphaelFakhri ya está trabajando en esto.

Desde el 24/10/2026.

  • #14180 de @RaphaelFakhri — abierto

Evaluación

Dificultad
2/5
Tiempo estimado
1-3 horas
Aptitud para principiantes
30/100
Tipo de issue
Error
Claridad
Bien especificado
Estado de actividad
Activo
Stack tecnológico
go
Área
backend

Línea de trabajo

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.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

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.

Lenguaje dominante
Go
Estrellas
37.3k
Forks
3.4k
Merge medio
10 h 31 min
PR fusionados (30 d)
80

Preparar el entorno

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de 1Panel-dev/1Panel

Todos los issues de 1Panel-dev/1Panel

Issues similares

Más issues de Go

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.