forgejo_backup/modules/assetfs
Gusted 0c7612bca4 fix: follow symlinks for local assets (#8596)
- This reverts behavior that was partially unintentionally introduced in forgejo/forgejo#8143, symbolic links were no longer followed (if they escaped the asset folder) for local assets.
- Having symbolic links for user-added files is, to my understanding, a ,common usecase for NixOS and would thus have symbolic links in the asset folders. Avoiding symbolic links is not easy.
- The previous code used `http.Dir`, we cannot use that as it's not of the same type. The equivalent is `os.DirFS`.
- Unit test to prevent this regression from happening again.

Reported-by: bloxx12 (Matrix).
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/8596
Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
Co-authored-by: Gusted <postmaster@gusted.xyz>
Co-committed-by: Gusted <postmaster@gusted.xyz>
2025-07-22 15:02:47 +02:00
..
layered.go fix: follow symlinks for local assets (#8596) 2025-07-22 15:02:47 +02:00
layered_test.go fix: follow symlinks for local assets (#8596) 2025-07-22 15:02:47 +02:00