Use octal file modes in the Redis and Valkey modules
Maintainer thường phản hồi trong vòng 1 ngày
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 2/5
- Thời gian dự kiến
- 1-3 giờ
- Mức phù hợp với người mới
- 79/100
- Loại issue
- Lỗi
- Độ rõ ràng
- Đặc tả rõ ràng
- Mức độ hoạt động
- Sôi nổi
- Công nghệ
- docker, node.js, typescript
Hướng nghiên cứu
Đọc packages/modules/redis/src/redis-container.ts và packages/modules/valkey/src/valkey-container.ts, tập trung vào các giá trị mode của withCopyFilesToContainer. Kiểm tra cách FileToCopy.mode được ghi tài liệu hoặc sử dụng, sau đó chạy các bài kiểm thử liên quan của hai module Redis và Valkey. Công việc hoàn tất khi tệp dữ liệu dùng 0o644 và tập lệnh import dùng 0o755 trong cả hai module.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
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.
- Ngôn ngữ chính
- TypeScript
- Star
- 2.6k
- Fork
- 274
- Merge trung bình
- 1 ngày 14 giờ
- Pull request đã merge (30 ngày)
- 44
Chuẩn bị môi trường
Khởi chạy dev container của dự án ngay trên trình duyệt, bằng tài khoản GitHub của bạn.
- Có Dockerfile hoặc tệp Docker Compose
- Không có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của testcontainers/testcontainers-node
-
enhancement minor
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 74/100
testcontainers/testcontainers-node#1539 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
enhancement minor
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
testcontainers/testcontainers-node#1533 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
enhancement minor
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 77/100
testcontainers/testcontainers-node#1531 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
enhancement minor
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
testcontainers/testcontainers-node#1529 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
enhancement minor
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
testcontainers/testcontainers-node#1528 ·
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của testcontainers/testcontainers-node
Issue tương tự
-
priority:high
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 65/100
immich-app/immich#32426 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
documentation good first issue hacktoberfest help wanted
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
libredb/libredb-studio#1756 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
state:triage-needed
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 62/100
Maintainer thường phản hồi trong vòng 1 ngày