I’m using Caddy as a simple file server.
The folders it’s sharing are from a Windows file share, mounted on a linux server via an fstab entry.
It works fine, except Windows shortcut files show up as .lnk
When you click to download, you get the actual .lnk file, with .download appended to the file name.
I’d like it to follow the shortcut, not literally serve it.
I don’t know that Caddy has any options available to do this. It would involve some special handling: opening the file, reading the text content, resolving it to a filesystem path, and attempting to find that.
Caddy would also need to translate from the Windows filepath of the link to whatever filesystem it’s actually reading from e.g. the CIFS mount, which the link file might not account for. For example, the link might be a UNC path (e.g. \\host\path\to\file.ext) that doesn’t make any sense to a Linux client that mounted the CIFS share into a different folder (UNC paths like this are a Windows-specific feature). It’s not really feasible without some heavy lifting from external tooling.
The best answer I can give you matches this Stack Overflow link from 2010, which is to delete the .lnk file and create a symbolic link or a junction instead, which is a filesystem based link method any web server can actually understand.
Thanks for the detailed reply.
That’s pretty much what I thought as well, but I was hoping
A soft or hard link would work, but these are changed by end users from time to time, and I don’t think they’d be reliable completing that extra step. Maybe I could rig something up with a file change monitor and a script…
I was really hoping to just have web and windows file sharing from the same set of docs, so they’re always in sync.