Use octal file modes in the Redis and Valkey modules
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 79/100
- Issue type
- Bug
- Clarity
- Clearly specified
- Activity status
- Active
- Tech stack
- docker, node.js, typescript
Research direction
Read packages/modules/redis/src/redis-container.ts and packages/modules/valkey/src/valkey-container.ts, focusing on the withCopyFilesToContainer mode values. Check how FileToCopy.mode is documented or used, then run the relevant Redis and Valkey module tests. Done when the data file uses 0o644 and the import script uses 0o755 in both modules.
Written by the indexing model from the issue text.
Description
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.tspackages/modules/valkey/src/valkey-container.ts
Notes
FileToCopy.modeandContentToCopy.modeare typednumberwith no JSDoc. A one-line comment saying the value is an octal permission (0o644) would help prevent this.- The
statoutput was reproduced onmain(aa60a746, 12.2.0) withGenericContainerand the samemodevalues. The non-root case is from reading the permission bits, not run.
Dependencies
- Nothing blocks this. It can start now.
- Coordinate with #1525: the
execcall in the same two files sits a few lines below the modes. Change both in one pull request.
- Dominant language
- TypeScript
- Stars
- 2.6k
- Forks
- 274
- Avg merge
- 1d 14h
- Merged PRs (30d)
- 44
Getting set up
Starts the project's dev container in your browser, under your own GitHub account.
- Ships a Dockerfile or Docker Compose file
- No pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from testcontainers/testcontainers-node
-
enhancement minor
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
testcontainers/testcontainers-node#1539 ·
Maintainers usually reply within 1 day
-
enhancement minor
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
testcontainers/testcontainers-node#1533 ·
Maintainers usually reply within 1 day
-
enhancement minor
Difficulty 2/5 1-3 hours Newbie friendliness 77/100
testcontainers/testcontainers-node#1531 ·
Maintainers usually reply within 1 day
-
enhancement minor
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
testcontainers/testcontainers-node#1529 ·
Maintainers usually reply within 1 day
-
enhancement minor
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
testcontainers/testcontainers-node#1528 ·
Maintainers usually reply within 1 day
All issues in testcontainers/testcontainers-node
Similar issues
-
useFragment does not require `variables` when the fragment's variables type has required fieldsOpen
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
apollographql/apollo-client#13493 ·
Maintainers usually reply within 1 day
-
Custom hosts written as trailing-dot FQDNs (`host.local.`) aren't detected as local backendsPossibly taken @roboomp claimed this today. Openbug prio:p2 providers triaged
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
can1357/oh-my-pi#15798 · 3 comments ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 62/100
code-yeongyu/oh-my-openagent#10172 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
PDFCraftTool/pdfcraft#189 ·
-
Add the Yahoo chart API duplicate last-day row (yfinance#573) to incidents.md (about 1 hour)Possibly taken A pull request linked to this issue is open or already merged. Opendata docs good first issue
Difficulty 1/5 Under an hour Newbie friendliness 80/100
pacocartones/market-data-sanity-checker#160 ·
Maintainers usually reply within 1 day