aiohttp ignores symlinks, trame server options
Is your feature request related to a problem? Please describe.
I use uv with symlinks to manage my python environments on an hpc cluster, links are useful for us since we have multiple mounted drives. After a lot of testing I found that the symlink venv structure was the reason my trame apps almost always gave a 404 error. If I installed with the default hardlinks the app worked fine.
Describe the solution you'd like
Ideally, since aiohttp already has an option to turn on symlinks, "follow_symlinks = True", exposing it as a server.start kwarg makes sense to me.
Describe alternatives you've considered The following monkey patch is my current solution.
# Patch aiohttp to follow symlinks
import aiohttp.web
original_static = aiohttp.web.static
def patched_static(prefix, path, **kwargs):
kwargs['follow_symlinks'] = True
print(f"Registering static route with symlink support: {prefix} -> {path}")
return original_static(prefix, path, **kwargs)
aiohttp.web.static = patched_static
server.start()
Additional context
N/A
Thanks for sharing your workaround. We'll see how to best enable such option.
Should be fixed in https://github.com/Kitware/trame-server/releases/tag/v3.7.0 when you use the --follow-symlinks arg.
Please report back if that works for you.