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

Use octal file modes in the Redis and Valkey modules

Abierto Apto para principiantes
#1,526 0 comentarios 0 reacciones 0 asignados Ver en GitHub

Los mantenedores suelen responder en 1 día

Nadie ha tomado este issue todavía.

Evaluación

Dificultad
2/5
Tiempo estimado
1-3 horas
Aptitud para principiantes
79/100
Tipo de issue
Error
Claridad
Bien especificado
Estado de actividad
Activo
Stack tecnológico
docker, node.js, typescript

Línea de trabajo

Lee packages/modules/redis/src/redis-container.ts y packages/modules/valkey/src/valkey-container.ts, centrándote en los valores de mode de withCopyFilesToContainer. Comprueba cómo está documentado o se usa FileToCopy.mode y, después, ejecuta las pruebas pertinentes de los módulos Redis y Valkey. La tarea estará terminada cuando el archivo de datos use 0o644 y el script de importación use 0o755 en ambos módulos.

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

Descripción

bug patch

What happens

The Redis and Valkey modules pass file modes as decimal numbers where octal was intended:

this.withCopyFilesToContainer([
  { mode: 666, source: this.initialImportScriptFile, target: this.importFilePath },
  { mode: 777, source: path.join(__dirname, "import.sh"), target: "/tmp/import.sh" },
]);

Decimal 666 is octal 1232 and decimal 777 is octal 1411. Copying files with those modes and running stat in the container:

/tmp/mode-decimal-666  1232  --w--wx-wT
/tmp/mode-decimal-777  1411  -r----x--t
/tmp/mode-octal-666     666  -rw-rw-rw-
/tmp/mode-octal-777     777  -rwxrwxrwx

So the import data file is write-only for its owner, and import.sh is read-only for its owner and execute-only for everyone else. withInitialData works today only because exec runs as root (uid 0), which bypasses the permission bits. A non-root exec user could read neither file.

Expected

The modes are written in octal (0o644 for the data file, 0o755 for the script).

Where

  • packages/modules/redis/src/redis-container.ts
  • packages/modules/valkey/src/valkey-container.ts

Notes

  • FileToCopy.mode and ContentToCopy.mode are typed number with no JSDoc. A one-line comment saying the value is an octal permission (0o644) would help prevent this.
  • The stat output was reproduced on main (aa60a746, 12.2.0) with GenericContainer and the same mode values. The non-root case is from reading the permission bits, not run.

Dependencies

  • Nothing blocks this. It can start now.
  • Coordinate with #1525: the exec call in the same two files sits a few lines below the modes. Change both in one pull request.
Lenguaje dominante
TypeScript
Estrellas
2.6k
Forks
274
Merge medio
1 d 14 h
PR fusionados (30 d)
44

Preparar el entorno

Abrir en Codespaces

Inicia el contenedor de desarrollo del proyecto en tu navegador, con tu propia cuenta de GitHub.

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 testcontainers/testcontainers-node

Todos los issues de testcontainers/testcontainers-node

Issues similares

Más issues de TypeScript

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.