Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(server): prevent feedback loop during library scan #7944

Merged
merged 4 commits into from Mar 15, 2024

Conversation

mertalev
Copy link
Contributor

Description

We don't handle the case where the library path contains the thumbs or encoded-videos folders, leading to a nasty feedback loop. This adds that check during the scan.

Fixes #7864

Copy link

cloudflare-pages bot commented Mar 14, 2024

Deploying immich with  Cloudflare Pages  Cloudflare Pages

Latest commit: be4f864
Status: ✅  Deploy successful!
Preview URL: https://64ce50ae.immich.pages.dev
Branch Preview URL: https://fix-server-library-scan-recu.immich.pages.dev

View logs

@mertalev mertalev requested a review from etnoy March 14, 2024 08:05
Copy link
Contributor

@etnoy etnoy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. It won't be foolproof due to docker mounts but it'll catch most issues

@bo0tzz
Copy link
Member

bo0tzz commented Mar 14, 2024

Should we try to cover this case in validateImportPath so it is surfaced to the admin? I think it would also be worth adding a WARN log in the skip clause so it is clear what is happening.

@etnoy
Copy link
Contributor

etnoy commented Mar 14, 2024

Should we try to cover this case in validateImportPath so it is surfaced to the admin? I think it would also be worth adding a WARN log in the skip clause so it is clear what is happening.

Great suggestion.

Copy link
Contributor

@jrasm91 jrasm91 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Honestly, nothing inside of the media dir should be picked up by external libraries imo.

@mertalev
Copy link
Contributor Author

I was thinking of if someone has a folder in /usr/src/app/upload/external or something. Or should we just require that you mount it somewhere else?

@jrasm91
Copy link
Contributor

jrasm91 commented Mar 14, 2024

I was thinking of if someone has a folder in /usr/src/app/upload/external or something. Or should we just require that you mount it somewhere else?

I think that would be fine. Storing an external folder inside of the immich-controlled "upload" folder just seems like a bad idea.

@alextran1502 alextran1502 enabled auto-merge (squash) March 15, 2024 20:03
@mertalev mertalev force-pushed the fix/server-library-scan-recursion branch from 6d9e90e to be4f864 Compare March 15, 2024 21:57
@alextran1502 alextran1502 merged commit a9438a9 into main Mar 15, 2024
24 checks passed
@alextran1502 alextran1502 deleted the fix/server-library-scan-recursion branch March 15, 2024 22:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Huge amount of photos discovered (1M instead of 30k)
5 participants