Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Nov 13, 2025

macOS disk mapping and Windows file operations generate metadata files (.DS_Store, desktop.ini, Thumbs.db, ._*) that pollute storage when uploaded. This adds an opt-in filter.

Changes

  • New setting: ignore_system_files (boolean, default: false) in global settings
  • Filter function: utils.IsSystemFile() detects .DS_Store, desktop.ini, Thumbs.db, and Apple Double files (._*)
  • Upload path coverage:
    • HTTP: FsStream, FsForm handlers
    • WebDAV: handlePut method
    • FTP: both buffered and streaming upload modes
    • S3: PutObject method
    • SFTP: covered via FTP backend

When enabled, filtered files return 403 with "system file upload ignored".

// Example usage in handler
if setting.GetBool(conf.IgnoreSystemFiles) && utils.IsSystemFile(filename) {
    return errors.New("system file upload ignored")
}

Setting is disabled by default to preserve existing behavior.

Original prompt

This section details on the original issue you should resolve

<issue_title>[Feature] mac系统需要过滤掉apple double文件(._*)</issue_title>
<issue_description>### 请确认以下事项

  • 我已确认阅读并同意 AGPL-3.0 第15条
    本程序不提供任何明示或暗示的担保,使用风险由您自行承担。

  • 我已确认阅读并同意 AGPL-3.0 第16条
    无论何种情况,版权持有人或其他分发者均不对使用本程序所造成的任何损失承担责任。

  • 我确认我的描述清晰,语法礼貌,能帮助开发者快速定位问题,并符合社区规则。

  • 我已确认阅读了OpenList文档

  • 我已确认没有重复的问题或讨论。

  • 我认为此问题必须由OpenList处理,而非第三方。

  • 我已确认此功能尚未被实现。

  • 我已确认此功能是合理的,且有普遍需求,并非我个人需要。

需求描述

mac系统做磁盘映射后,copy文件,所有上传的文件都会在网盘上多出一个._*文件名,而通过其本身的网盘app就不会,需要上传过滤功能

实现思路

钩子+配置文件

附加信息

No response</issue_description>

<agent_instructions>增加一个开关,默认关闭,启用时,在上传功能中将".DS_Store"、"desktop.ini"等常见文件和"._"开头的文件全部忽略。</agent_instructions>

Comments on the Issue (you are @copilot in this section)

@jyxjjj 不认为默认隐藏是合理的,可能有正常文件会用这个方式命名。Who knows. 我们提供了隐藏文件的设置 `/@manage/settings/global` 访问此前端页面进行设置。 @jyxjjj > mac系统做磁盘映射后,copy文件

还是不认为合理,因为这些文件本应该直接删除的。

但是可以给你重新打开等待其他开发者审核。

我的建议是直接删掉,我一直都有加函数自动删。

https://github.com/jyxjjj/jyxjjj/blob/UserConfigs/zshrc.d/31.functions-macos.sh#L7

sudo find / -name '._*' -delete 2>/dev/null &

即使是这样也不会对macOS造成任何影响。

很久以前看到的也不知道是Apple论坛还是哪里原话是

不能因为Apple到处拉屎就让别的开发者解决</comment_new>
<comment_new>@PIKACHUIM
我觉得可以设置一个开关,启用后默认忽略
不过这个是苹果的史山,最好不由openlist解决</comment_new>


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

Copilot AI and others added 3 commits November 13, 2025 05:15
- Added ignore_system_files setting (default: false)
- Created IsSystemFile utility function to detect .DS_Store, desktop.ini, Thumbs.db, and ._* files
- Integrated filtering into HTTP, WebDAV, FTP, and SFTP upload handlers
- When enabled, common system files are rejected during upload

Co-authored-by: jyxjjj <[email protected]>
- Integrated system file filtering into S3 PutObject handler
- S3 uploads now also respect the ignore_system_files setting

Co-authored-by: jyxjjj <[email protected]>
Copilot AI changed the title [WIP] Add filter for Apple Double files in macOS Add optional system file filtering for uploads (.DS_Store, ._* files) Nov 13, 2025
Copilot AI requested a review from jyxjjj November 13, 2025 05:26
Copilot finished work on behalf of jyxjjj November 13, 2025 05:26
@jyxjjj jyxjjj requested a review from ILoveScratch2 November 13, 2025 05:27
@jyxjjj jyxjjj marked this pull request as ready for review November 13, 2025 05:27
@ILoveScratch2 ILoveScratch2 changed the title Add optional system file filtering for uploads (.DS_Store, ._* files) feat(upload): add optional system file filtering for uploads Nov 13, 2025
ILoveScratch2
ILoveScratch2 previously approved these changes Nov 13, 2025
@jyxjjj
Copy link
Member

jyxjjj commented Nov 13, 2025

@ILoveScratch2 再看一眼

@jyxjjj jyxjjj requested a review from KirCute November 13, 2025 08:19
@jyxjjj jyxjjj enabled auto-merge (squash) November 13, 2025 10:35
@jyxjjj jyxjjj merged commit 9de7561 into main Nov 14, 2025
12 checks passed
@jyxjjj jyxjjj deleted the copilot/filter-apple-double-files branch November 14, 2025 06:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Feature] mac系统需要过滤掉apple double文件(._*)

4 participants