Sb_space_ignore

I can’t get SB_SPACE_IGNORE to do anything (either edge or v2). I have set it to “private/*”, but the silverbullet instance happily serves files under the space/private directory

Did you by chance sync the space fully before you set the environment variable?

And if you just mean “is able to read” by serve, then yeah, it will only stop SB from knowing they exist, it can still read/write to them.

What’s the intended use case for SB_SPACE_IGNORE? I had assumed SilverBullet would avoid both reading from and writing to such paths, yet that doesn’t seem to be the case.

@zef, could you please share your thoughts on this?

The original use case was: “I have way too many files to sync, allow me to exclude some” and that’s what it does. It’s fairly similar to having a .gitignore file. Files matching SB_SPACE_IGNORE do not appear in internal file listings, so they’re effectively hidden. I would indeed imagine that if you forcefully reading or writing to specific files, that’s not blocked, that wasn’t really a consideration.

I wouldn’t oppose to a PR that would somehow block reads and writes, though. I don’t think that would affect any existing users of this feature. The implementation lives here: silverbullet/lib/spaces/filtered_space_primitives.ts at main · silverbulletmd/silverbullet · GitHub as you can see, the only place this filter is applied is in fetchFileList right now, it could also be checked on read and write.