forgejo-aneksajo/modules/assetfs
forgejo-backport-action 4819d4a29a [v12.0/forgejo] fix: follow symlinks for local assets (#8610)
**Backport:** https://codeberg.org/forgejo/forgejo/pulls/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).
Co-authored-by: Gusted <postmaster@gusted.xyz>
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/8610
Reviewed-by: Gusted <gusted@noreply.codeberg.org>
Co-authored-by: forgejo-backport-action <forgejo-backport-action@noreply.codeberg.org>
Co-committed-by: forgejo-backport-action <forgejo-backport-action@noreply.codeberg.org>
2025-07-22 18:41:03 +02:00
..
layered.go [v12.0/forgejo] fix: follow symlinks for local assets (#8610) 2025-07-22 18:41:03 +02:00
layered_test.go [v12.0/forgejo] fix: follow symlinks for local assets (#8610) 2025-07-22 18:41:03 +02:00