Closed gorootde closed 4 months ago
I'll check this, to clarify are you running this with docker or directly with Deno?
Plain deno
I investigated a little bit and found the root cause:
disk_space_primitives.ts#fetchFileList()
uses walk()
to build a list of all files in the space. A symlinked directory is resolved to the target path of the symlink. That leads to the fullPath
not being inside the space directory.
In the end fixing this would lead to changing the safePath
function to accept target paths of all symlinks in the space directory as well. Also almost all SB code assumes that all files are located inside the space path.
Ok I'm always a bit scared to do this, but I just replaced the walk
call with a custom version that walks symlinks, but preservers their paths. I tested it and for me it seems to work, can you check too? I hope this doesn't regress other features but let's hear if people scream.
When creating a symlink pointing to a folder containing
.md
files, that is located outside of my space directory, SB does not discover these files. Not even when running the reindex command manually.