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.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[devbox cloud] require git in home and fs-root dirs to use as devbox project dir (#522)
## Summary
Problem:
When running `devbox cloud shell` (and other commands) if we don't find
a `devbox.json` in the current directory and no `--config` flag is
specified,
then we walk up the directory tree to find a `devbox.json` file. If we
do find one,
we use that directory as the `projectDir`.
This has the danger that we may sync a sensitive directory like a user's
homedir
or the filesystem-root dir (i.e. `/`). The syncing may inadvertently
delete something in the directories
under this sensitive dir.
@Lagoja ran into this since he has a devbox.json in his homedir.
Solution:
This PR protects against this by requiring a `.git` repository to be
present in
the same dir. We presume this would protect against data loss. Without a
`.git`
we display a user error.
## How was it tested?
```
❯ devbox cloud shell
Devbox Cloud
Remote development environments powered by Nix
Error: Found a config (devbox.json) file at /Users/savil, but since it is a sensitive directory we require it to be part of a git repository before we sync it to devbox cloud
```
0 commit comments