Lurker News

Comments (239) 44 threads

Earlier comments
yesco1 reply#
I'd been meaning to make something like this for ages but never had the patience to figure out the namespace API, great work!
notamy#
Thanks :D <3
OJFord3 replies#
> suggested usage

> alias aws="boxxy aws" (repeat for other tools)
If you could find a way to somehow intercept without requiring aliasing, this would be amazing.
Also, as it is, isn't it problematic that programs might call others (outside of your shell, not respecting its aliasing).
A neat semi-solution (still worse than transparent interception if somehow possible) would be to have a boxxy-run script sym-linkable from ~/whatever/bin/aws (say) that basically just executes `boxxy "$(basename "$0")"`. So you could just symlink the same script with the name of whatever command you wanted to 'boxx'.

chungy1 reply#
I mean, you can just run "boxxy aws" if you don't want to make an alias. That's your solution for "intercept without requiring aliasing"

As the program intercepts file APIs for all processes launched under it, it should handle subprocesses just fine.

OJFord#
No I mean as in if I run foobar, which itself happens to call aws under the hood.

Now I need both boxxy foobar and boxxy aws configured for the same ~/.aws redirection.

alerighi#
Perhaps a better solution would have been not using the Linux namespaces but using LD_PRELOAD to preload a shared library to intercept all the FS-related API and normalize the path. Of course more complex and would only function for dynamically linked executables, but would have not required to launch the executable with a proxy and would also be more stable, not relying on not so stable features such as Linux namespaces.
notamy#
> 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 namespace.
> Also, as it is, isn't it problematic that programs might call others (outside of your shell, not respecting its aliasing).
Nope! Any spawned processes live inside the same mount namespace and see the same pretend view of the world.

__turbobrew__1 reply#
Can you use boxxy on itself if you dont want the config file at ~/.config/boxxy/boxxy.yaml ?
etu#
I would assume that it follows the XDG spec and that you can specify XDG_CONFIG_HOME to place the file somewhere else.
gnull3 replies#
Chromium doesn't respect XDG config, it always creates ~/Downloads directory on startup. It was so annoying, I hope this tool helps me fix it.
gnull#
I'm not using default settings, I changed XDG downloads setting in ~/.config/user-dirs.dirs.
forgotpwd161 reply#
Maybe change download location in chrome://settings/downloads to where you want?
gnull#
I did. It still creates an empty ~/Downloads on each startup.
gnull#
Update: the tool didn't help. It complains about being unable to run some SUID executable that Chromium calls. I'll have to keep removing the Downloads by hand then after each use of Chromium.

Load more comments