fix(strm): respect deployment umask for local directories - #2931
fix(strm): respect deployment umask for local directories#2931StromKuo wants to merge 2 commits into
Conversation
- add private and shared permission modes for local STRM files - repair shared-mode directory and file permissions during generation - add permission handling tests Co-authored-by: Codex <267193182+codex@users.noreply.github.com>
|
Could you explain why this should be handled by an application-level I understand that What is the reason for preferring this over leaving filesystem permission policy to the deployment environment? |
|
Just to clarify why I’m asking: my concern is mainly about minimizing the filesystem-related attack surface and keeping permission policy outside the application where possible. I understand that explicitly managing permissions in the application is common, and that umask alone cannot repair permissions on existing files/directories. |
Thanks for clarifying. I share the goal of minimizing the filesystem-related attack surface and keeping permission policy in the deployment environment. The motivation for this PR comes from a concrete issue in the current STRM implementation: local STRM directories are created through In my NAS deployment, OpenList and Plex share a bind-mounted directory but run under different UIDs without a common group. As a result, Plex cannot access newly generated STRM directories. STRM files themselves are created with the normal I agree that the current implementation is too broad because it forces I plan to revise the PR by removing the application-level private/shared permission mode and all automatic chmod operations. Instead, the STRM directory creation path will respect the deployment's umask rather than hardcoding Would this direction better fit the project's security and permission model? |
|
Yes, that direction addresses my concern. Letting newly created STRM directories respect the deployment's I'll take another look once the PR is updated. |
- remove application-level permission modes and chmod operations - create local STRM directories with umask-controlled permissions - preserve existing permissions and test the behavior Co-authored-by: Codex <267193182+codex@users.noreply.github.com>
jyxjjj
left a comment
There was a problem hiding this comment.
The implementation now looks good to me. One remaining suggestion before merge: could you update the PR title and description to reflect the revised approach?
The current title/body still describe the removed private/shared permission mode, fixed 0755/0644 permissions, and permission repair for existing files/directories.
The final implementation instead makes newly created STRM directories respect the deployment umask, preserves existing permissions, and does not introduce a new permission-related config/API.
A title such as fix(strm): respect deployment umask for local directories would better match the current change.
|
I’ve updated the PR title and description to match the revised implementation. I only adjusted the now-outdated permission-mode/ |
|
Thanks for updating the title and description. They now accurately reflect the revised implementation. |
umaskchmodSummary / 摘要
OpenList currently creates local STRM directories with
0700permissions. When Plex or another media server runs under a different UID, it cannot traverse these directories and read the generated STRM files.This PR changes local STRM directory creation to respect the deployment's
umaskinstead of using the hardcoded0700mode:0777beforeumaskis applied.chmod/chownor ACLs if needed.OpenList 目前使用
0700权限创建本地 STRM 目录。当 Plex 或其他媒体服务器以不同 UID 运行时,它无法遍历这些目录并读取生成的 STRM 文件。本次 PR 将本地 STRM 目录创建方式改为遵循部署环境的
umask,而不是使用硬编码的0700:0777创建,再由umask决定最终权限。chmod/chown或 ACL 处理。/ 此 PR 包含破坏性变更。
/ 此 PR 修改了公开 API、配置、存储格式或迁移行为。
/ 此 PR 需要关联仓库同步修改。
Related repository PRs / 关联仓库 PR:
Testing / 测试
go test ./...,但其他驱动、internal/net和pkg/aria2/rpc中仍存在无关的既有失败。Checklist / 检查清单
/ 我已阅读 CONTRIBUTING。
/ 我确认这次贡献符合仓库许可证、贡献规范和行为准则。
gofmt,go fmt, orprettierwhere applicable./ 我已按适用情况使用
gofmt、go fmt或prettier格式化变更代码。/ 我已在适用情况下请求相关维护者审查。
AI Disclosure / AI 使用声明
/ 此 PR 包含 AI 辅助内容。
Tools used / 使用工具:
Usage scope / 使用范围:
Code generation / 代码生成
Refactoring / 重构
Documentation / 文档
Tests / 测试
Translation / 翻译
Review assistance / 审查辅助
I have reviewed and validated all AI-assisted content included in this PR.
/ 我已审核并验证所有包含在此 PR 中的 AI 辅助内容。
I have ensured that all AI-assisted commits include
Co-Authored-Byattribution./ 我已确保所有 AI 辅助提交都包含
Co-Authored-By归属信息。I can reproduce all AI-assisted content included in this PR without any AI tools.
/ 我可以在没有任何 AI 工具的情况下重现此 PR 中包含的所有 AI 辅助内容。