https://github.com/queer/boxxy Skip to content Toggle navigation Sign up * Product + Actions Automate any workflow + Packages Host and manage packages + Security Find and fix vulnerabilities + Codespaces Instant dev environments + Copilot Write better code with AI + Code review Manage code changes + Issues Plan and track work + Discussions Collaborate outside of code + Explore + All features + Documentation + GitHub Skills + Blog * Solutions + For + Enterprise + Teams + Startups + Education + By Solution + CI/CD & Automation + DevOps + DevSecOps + Case Studies + Customer Stories + Resources * Open Source + GitHub Sponsors Fund open source developers + The ReadME Project GitHub community articles + Repositories + Topics + Trending + Collections * Pricing [ ] * # In this repository All GitHub | Jump to | * No suggested jump to results * # In this repository All GitHub | Jump to | * # In this user All GitHub | Jump to | * # In this repository All GitHub | Jump to | Sign in Sign up {{ message }} queer / boxxy Public * Notifications * Fork 3 * Star 163 boxxy puts bad Linux applications in a box with only their files. License MIT license 163 stars 3 forks Star Notifications * Code * Issues 0 * Pull requests 0 * Actions * Projects 0 * Security * Insights More * Code * Issues * Pull requests * Actions * Projects * Security * Insights queer/boxxy This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository. mistress Switch branches/tags [ ] Branches Tags Could not load branches Nothing to show {{ refName }} default View all branches Could not load tags Nothing to show {{ refName }} default View all tags Name already in use A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch? Cancel Create 1 branch 13 tags Code * Local * Codespaces * Clone HTTPS GitHub CLI [https://github.com/q] Use Git or checkout with SVN using the web URL. [gh repo clone queer/] Work fast with our official CLI. Learn more. * Open with GitHub Desktop * Download ZIP Sign In Required Please sign in to use Codespaces. Launching GitHub Desktop If nothing happens, download GitHub Desktop and try again. Launching GitHub Desktop If nothing happens, download GitHub Desktop and try again. Launching Xcode If nothing happens, download Xcode and try again. Launching Visual Studio Code Your codespace will open once ready. There was a problem preparing your codespace, please try again. Latest commit @queer queer doc: Update README ... 33838a3 Feb 9, 2023 doc: Update README 33838a3 Git stats * 53 commits Files Permalink Failed to load latest commit information. Type Name Latest commit message Commit time .github feature: Release actions February 8, 2023 16:22 src feature: issue-url February 9, 2023 14:03 .gitignore feature: Initial commit, it works!!! February 8, 2023 16:13 .pre-commit-config.yaml feature: pre-commit February 9, 2023 09:08 Cargo.lock feature: 0.2.5 February 9, 2023 14:03 Cargo.toml feature: 0.2.5 February 9, 2023 14:03 LICENSE feature: LICENSE February 9, 2023 15:36 README.md doc: Update README February 9, 2023 16:04 install.sh feature: install.sh February 9, 2023 09:22 release.sh chore: Release script February 8, 2023 16:36 View code [ ] boxxy motivation features example usage suggested usage configuration syntax developing how does it work? README.md boxxy boxxy is a tool for boxing up misbehaving Linux applications and forcing them to put their files and directories in the right place, without symlinks! Linux-only! boxxy uses Linux namespaces for its functionality. For example, consider tmux. It wants to put its config in ~ /.tmux.conf. With boxxy, you can put its config in ~/.config/tmux/ tmux.conf instead: # ~/.config/boxxy/boxxy.yaml rules: - name: "redirect tmux config from ~/.tmux.conf to ~/.config/tmux/tmux.conf" target: "~/.tmux.conf" rewrite: "~/.config/tmux/tmux.conf" mode: "file" asciicast motivation I recently had to use the AWS CLI. It wants to save data in ~/.aws, but I don't want it to just clutter up my $HOME however it wants. boxxy lets me force it to puts its data somewhere nice and proper. features * box any program and force it to put its files/directories where you want it to * context-dependent boxing, ie different rules apply in different directories depending on your configuration * minimal overhead * opt-in immutable fs outside of rule rewrites, ie only the files/ directories you specify in rules are writable example usage git:(mistress) | > cat ~/.config/boxxy/boxxy.yaml rules: - name: "Store AWS CLI config in ~/.config/aws" target: "~/.aws" rewrite: "~/.config/aws" git:(mistress) | > boxxy aws configure INFO boxxy > loaded 1 rules INFO boxxy::enclosure > applying rule 'Store AWS CLI config in ~/.config/aws' INFO boxxy::enclosure > redirect: ~/.aws -> ~/.config/aws INFO boxxy::enclosure > boxed "aws" AWS Access Key ID [****************d]: a AWS Secret Access Key [****************c]: b Default region name [b]: c Default output format [a]: d git:(mistress) | > ls ~/.aws git:(mistress) | > ls ~/.config/aws config credentials git:(mistress) | > cat ~/.config/aws/config [default] region = c output = d git:(mistress) | > suggested usage * alias aws="boxxy aws" (repeat for other tools) * use contexts to keep project configs separate on disk * dotfiles! * stop using symlinks!!! configuration The boxxy configuration file lives in ~/.config/boxxy/boxxy.yaml. If none exists, an empty one will be created for you. rules: # The name of the rule. User-friendly name for your reference - name: "redirect aws-cli from ~/.aws to ~/.config/aws" # The target of the rule, ie the file/directory that will be shadowed by the # rewrite. target: "~/.aws" # The rewrite of the rule, ie the file/directory that will be used instead of # the target. rewrite: "~/.config/aws" - name: "use different k8s configs when in ~/Projects/my-cool-startup" target: "~/.kube/config" rewrite: "~/Projects/my-cool-startup/.kube/config" # The context for the rule. Any paths listed in the context are paths where # this rule will apply. If no context is specified, the rule applies # globally. context: - "~/Projects/my-cool-startup" # The mode of this rule, either `directory` or `file`. `directory` is the # default. Must be specified for the correct behaviour when the target is a # file. Required because the target file/directory may not exist yet. mode: "file" # The list of commands that this rule applies to. If no commands are # specified, the rule applies to all programs run with boxxy. only: - "kubectl" syntax rules: - name: "any valid string" # required target: "path" # required rewrite: "path" # required context: # optional - "path" - "path" mode: "directory | file" # optional only: # optional - "binary name" - "binary name" developing 1. set up pre-commit: pre-commit install 2. make sure it builds: cargo build 3. do the thing! 4. test with the command of your choice, ex. cargo run -- ls -lah ~ /.config how does it work? * create temporary directory in /tmp * set up new user/mount namespace * bind-mount / to tmp directory * bind-mount rule mounts rw so that target programs can use them * remount / ro * run! About boxxy puts bad Linux applications in a box with only their files. Resources Readme License MIT license Stars 163 stars Watchers 1 watching Forks 3 forks Releases 13 v0.2.5 Latest Feb 9, 2023 + 12 releases Languages * Rust 98.8% * Shell 1.2% Footer (c) 2023 GitHub, Inc. Footer navigation * Terms * Privacy * Security * Status * Docs * Contact GitHub * Pricing * API * Training * Blog * About You can't perform that action at this time. You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.