Y
HN Search
Hacker News Search
new
|
comments
|
top
|
jobs
notamy
searching PlanetScale…
1.
▲
2.
▲
3.
▲
4.
▲
5.
▲
6.
▲
36 ms
·
391.
▲
by
notamy
4y ago
(2021)
392.
▲
by
notamy
4y ago
https://archive.ph/nCwNe
393.
▲
by
notamy
4y ago
> What's so bad about symlinks though? I am not smart and will regularly forget the syntax to ln(1)
394.
▲
by
notamy
4y ago
I cut releases as I find bugs and commit fixes.
395.
▲
by
notamy
4y ago
Aww, thank you!
396.
▲
by
notamy
4y ago
> If you could find a way to somehow intercept without requiring aliasing, this would be amazing. I figured out while testing that `boxxy sh` works as expected, so I would imagine you can wrap any shell in it since it’s just a mount name
397.
▲
by
notamy
4y ago
Absolutely a good idea! I'll have to see what's doable.
398.
▲
by
notamy
4y ago
> Is there an infinite recursion in /tmp? No! The directory in /tmp outside of the "box" is completely empty; the remount of / is only seen within the mount namespace.
399.
▲
by
notamy
4y ago
As far as I'm aware, yes! You should be able to nest namespaces and mounts.
400.
▲
by
notamy
4y ago
TIL! I guess I'll find a better example.
401.
▲
by
notamy
4y ago
The man page + Google! There's very few good examples of it, and I've accepted that I'm just not familiar enough with that specific problem space.
402.
▲
by
notamy
4y ago
It sadly can't. Regex paths are hard due to the way it's implemented; if it was intercepting syscalls via ptrace then regex would be a lot more viable, but since this is just a glorified collection of bind mounts in the end, I
403.
▲
by
notamy
4y ago
It is, but I find many programs ignore ~/.config 3:
404.
▲
by
notamy
4y ago
TIL! Thanks :D
405.
▲
by
notamy
4y ago
Interesting! That makes perfect sense, I just don't think I'm smart enough to use ptrace properly right now :P
406.
▲
by
notamy
4y ago
It could, you would just have to then run the installer itself under boxxy and write the rules for it.
407.
▲
by
notamy
4y ago
Instead of chrooting to somewhere else, replicating your filesystem, ..., this switches into a new mount namespace and uses bind mounts to shadow the files/directories that are intended to be redirected. This way your entire filesystem
408.
▲
by
notamy
4y ago
*she, but thanks! (:
409.
▲
by
notamy
4y ago
Yes, absolutely! Good points to be aware of; I should find a way to add some warnings about this to the README. (earlier less-relevant comment was deleted)
410.
▲
by
notamy
4y ago
Thanks :D <3
411.
▲
by
notamy
4y ago
That is an excellent idea! Something like could definitely be worth adding. It's why there's a "remount rootfs as ro" flag; that way anything not specified in rules is ro and misbehaving programs will explode.
412.
▲
by
notamy
4y ago
> Is there any way this could support macOS? I don't use macOS often-enough to know for sure, but a quick search suggests that bind-mounts (or similar) are more complicated on macOS. Not against the idea tho! Edit: > and would ma
413.
▲
by
notamy
4y ago
> This seems like a great idea, thank you for sharing. Thanks :D > Are you aware of any notable caveats to using Boxxy, given the mount-based implementation? System configuration to allow mount namespaces, tools might have to understa
414.
▲
by
notamy
4y ago
It creates a new mount namespace, and bind-mounts your ENTIRE filesystem into it, before chrooting, so that it can optionally remount / as ro to prevent applications from writing outside of the desired directories. The namespace is to
415.
▲
by
notamy
4y ago
I actually attempted using ptrace to rewrite syscalls first! It was... horribly painful, and didn't work anywhere near as well as the bind-mount version.
416.
▲
by
notamy
4y ago
I remember it quite well! Just not my particular cup of tea.
417.
▲
by
notamy
4y ago
Only in the latter case; I didn't want to assume how people want things done, and implicitly magical tools break more often than not in my experience. You may also be able to tell I don't have a lot of AWS experience (:
418.
▲
by
notamy
4y ago
No! I just thought it was a cute name ("put things in a box"), and it wasn't a common repo name on GitHub.
419.
▲
Show HN: boxxy – Control where Linux programs put files, without symlinks
(github.com)
384 points
by
notamy
4y ago
|
239 comments
420.
▲
by
notamy
4y ago
> It seems to remember which commands I use often in which folders and in which order. I'm not sure if that's how it's implemented. Sure feels that way though. Check ~/.local/share/fish/fish_history!
More ›