Commit Graph

68 Commits

Author SHA1 Message Date
Olcan
b1ba89b3c9 improve sandboxing status message, update README, remove dead code from a previous change to build_sandbox.sh (#346) 2025-05-14 11:23:06 -07:00
Olcan
41d321b85f fall back to ~/.env if .env is not found in current directory or any ancestors (#338) 2025-05-13 15:36:34 -07:00
Olcan
bed75851e9 fix debugging with seatbelt, including in strict profile (#300) 2025-05-09 08:44:40 -07:00
Taylor Mullen
4cf345d0a3 Add bundling support.
- This can now be invoked with `npm run bundle`, it creates a `bundle/` folder that has:
  - gemini.js
  - sandbox-macos-minimal.sb
  - sandbox-macos-strict.sb
  - shell.json
  - shell.md

- This doesn't include any sort of automation for auto bundling pieces. It's just the root capability which we can weave into other locations.

Fixes https://b.corp.google.com/issues/411432723
2025-05-08 23:36:42 -07:00
Olcan
12f082673e use seatbelt on macos, with two profiles: minimal (default) which only restricts writes, and strict, which is deny-by-default and only allows specific operations (#283) 2025-05-07 20:03:29 -07:00
cornmander
a292a92704 Create simple script for setting up a dev environment. (#277) 2025-05-07 16:21:16 -04:00
Olcan
096939e2d0 make sandbox build quiet by default but allow VERBOSE=1 option. enable caching by default but allow disabling via BUILD_SANDBOX_FLAGS="--no-cache" (#278) 2025-05-07 11:00:48 -07:00
Brandon Keiji
ac5013e51f fix: build image with --no-cache (#275) 2025-05-07 08:18:04 -07:00
Brandon Keiji
6e8967cdca fix(sandbox): consolidate dev and prod sandbox (#273) 2025-05-07 07:23:13 -07:00
Olcan
6ed8a3c6cb fix sandbox prod build w/ custom Dockerfile (#255) 2025-05-03 10:07:51 -07:00
Olcan
aeac4f0e20 custom sandboxing via sandbox.Dockerfile and sandbox.bashrc in project settings (#249) 2025-05-02 14:07:40 -07:00
Olcan
5f78298a5d pass PATH and PYTHONPATH into sandbox, let sandbox scripts recognize user settings for sandbox (#247) 2025-05-02 12:04:22 -07:00
Olcan
cbbcabe35f remove start_sandbox.sh script (#238) 2025-05-01 09:16:33 -07:00
Olcan
eb8d720053 drop the "RE" from REBUILD_SANDBOX (#218) 2025-04-29 14:45:11 -07:00
Olcan
0e531576fb SANDBOX_SET_UID_GID option for systems where this is necessary (should be only rootful docker on linux w/o userns-remap configured) (#210)
* SANDBOX_SET_UID_GID option for systems where this is necessary (should be only rootful docker on linux w/o userns-remap configured)

* Merge remote-tracking branch 'origin/main' into sandbox_uid_gid
2025-04-29 08:43:24 -07:00
Brandon Keiji
15463d1a57 fix: point start.sh to relative path (#209) 2025-04-29 02:44:59 +00:00
Olcan
d1fd9cdf67 enable servers in sandbox to listen on localhost (127.0.0.1) instead of 0.0.0.0, ensuring servers can be container/host-agnostic (#207)
* enable servers in sandbox to listen on localhost (127.0.0.1) instead of 0.0.0.0, ensuring servers can be container/host-agnostic

* Merge remote-tracking branch 'origin/main' into sandbox_localhost_works
2025-04-28 18:40:24 -07:00
Olcan
15ba0623ee SANDBOX_PORTS env var (#204) 2025-04-28 15:44:17 -07:00
Olcan
03a40f9904 switch to shell tool, deprecating terminal (#203)
* switch to shell tool, deprecating terminal

* Merge remote-tracking branch 'origin/main' into deprecate_terminal
2025-04-28 15:05:36 -07:00
Olcan
b7987bcf12 env flags SANDBOX_{MOUNTS,ENV}, improved debugging through sandbox that should now work in all scenarios (#201)
* env flags SANDBOX_{MOUNTS,ENV}, improved debugging through sandbox that should now work in all scenarios

* Merge remote-tracking branch 'origin/main' into sandbox_flags_improved_debugging
2025-04-28 12:44:34 -07:00
Brandon Keiji
4b7f3f3328 refactor: remove node_modules reference in start command (#198) 2025-04-28 09:26:46 -07:00
Olcan
48c78a5645 rename dev image with -dev suffix (#195) 2025-04-28 08:52:18 -07:00
Olcan
db2b02080c hop into sandbox (#186) 2025-04-26 21:27:36 -07:00
Olcan
a38c975e40 do not clean before package build (#175) 2025-04-25 13:01:40 -07:00
Olcan
2835ae0b9d detect missing sandbox image and provide useful error message (#174) 2025-04-25 12:38:38 -07:00
Olcan
1841d02541 instant (dev) sandbox (#171)
* instant (dev) sandbox

* leave Dockerfile as is to pass deploy test

* fix comma

* fix prod build

* do not use "images exists" which docker does not support

* separate dev-mode flag

* Merge remote-tracking branch 'origin/main' into instant_sandbox
2025-04-25 10:58:23 -07:00
Olcan
ede2c1db22 pass model env var to sandbox (#167) 2025-04-25 15:28:14 +00:00
Olcan
fd546cd158 shell bones (#160)
* shell bones

* Merge remote-tracking branch 'origin/main' into shell_bones

* add line break

* another line break

* drop the log to avoid breaking terminals

* rename tool to be consistent with terminal

* fix build
2025-04-24 18:03:33 -07:00
Brandon Keiji
58e43a3d28 infra: automate continuous deployment (#157) 2025-04-24 14:36:58 -07:00
Brandon Keiji
50d5885d99 feat: add flag to customize package version during pre-release staging (#155) 2025-04-24 13:02:49 -07:00
Olcan
211e8f005f in sandboxed run scripts, allow .env to be an in any ancestor directory, same as in findEnvFile; also prep for sanboxing with global command (#147) 2025-04-24 08:58:47 -07:00
Seth Troisi
f6f8265424 Pass GEMINI_API_KEY env variable to sandbox 2025-04-23 18:22:58 -07:00
Brandon Keiji
6ba8e0b078 fix: revert pointing npm start to .bin (#144) 2025-04-24 01:21:07 +00:00
Brandon Keiji
8318f20038 feat: add react dev tools (#143) 2025-04-23 18:16:15 -07:00
Seth Troisi
b31bce078c Add generic container run command for npm start 2025-04-23 18:07:29 -07:00
Seth Troisi
5c6f018b8d Support GEMINI_CODE_SANDBOX=0/false as no SANDBOXing 2025-04-23 16:33:19 -07:00
Brandon Keiji
de3ad73c10 fix: use process.env.CLI_VERSION to avoid conflicts with NODE_ENV (#139) 2025-04-23 15:49:18 -07:00
Seth Troisi
7a48412b21 Add docker equivilant for --authfile 2025-04-23 15:46:51 -07:00
Brandon Keiji
9ccdc66eba feat: add CLI version number to footer (#134) 2025-04-23 15:00:40 -07:00
Seth Troisi
ccc28d175b Default TMPDIR to /tmp/ for sandbox (#133) 2025-04-23 14:36:15 -07:00
Olcan
efdff51bec fix .env check (#123) 2025-04-22 14:31:02 -07:00
Olcan
530ab91807 Refactor_sandbox_command (#121) 2025-04-22 13:51:50 -07:00
Olcan
69fe55cb21 quiet sandbox build (#111) 2025-04-21 23:26:53 -07:00
Brandon Keiji
448e308604 fix: point npmrc to dogfood artifact registry (#108) 2025-04-21 23:11:51 -07:00
Brandon Keiji
2ac4a3de58 fix: support node globals in scripts (#109) 2025-04-22 06:10:25 +00:00
Benjamin Bastian
cccaf1d1f2 Update sandbox script to not require term variables (#105)
If `nounset` is active, it'll require that TERM and COLORTERM is set in the
environment. It's not necessary that these variables are set and it should be
passed to the sandbox. This change just causes the TERM and COLORTERM to be set
to an empty string if they are unset.
2025-04-21 22:59:49 -07:00
Olcan
8c1f2bea46 improved (full color) sandbox, mount /tmp to display build warnings, display sandbox name in footer (#96) 2025-04-21 14:43:43 -07:00
Seth Troisi
508e768443 Fix Docker Build permission issue (#95)
During docker build `npm install` running as node was exiting with 243 (EACCES) from trying to install the tgz files because `npm pack` created the files with 400 permissions on my system.
2025-04-21 14:35:03 -07:00
Olcan
8d3f28591a sandbox.sh utility to easily log into or execute commands in a sandbox, set hostname and SANDBOX env var to container name (#92) 2025-04-21 13:52:51 -07:00
Olcan
035a42f94c enable debugging through sandbox (#88) 2025-04-21 12:39:58 -07:00