Keep computers' browser sessions across restarts and recreates

Each computer's Chrome profile now lives on the data volume
(DATA_DIR/computer-browsers/<id>, mounted at ~/.cobble-browser) and
Chrome is pointed at it with --user-data-dir. The sandbox image resets
its own profile's preferences to session-only cookies on every boot,
which signed every site out whenever Chrome exited. New profiles are
seeded with the image's preferences minus that rule, stale Singleton
links are removed before each provision, and existing computers are
recreated once (skipped while a job runs on them).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
This commit is contained in:
2026-10-25 15:26:18 +01:00
co-authored by Claude Opus 5.5
parent 380d3ebb2f
commit b9c5311fde
12 changed files with 276 additions and 26 deletions
+17 -5
View File
@@ -98,9 +98,10 @@ export const AppData = {
/**
* Only a computer's workspace (`ComputerWorkspaceDir` in its
* container) is kept, at `DATA_DIR/<ComputerDataDir>/<id>`, owned by
* the sandbox's user. It stays when the computer is deleted. The rest
* of its home (`ComputerHomeDir`: dotfiles, browser profile, the env
* files) lives in the container and goes with it. Every bot works in
* the sandbox's user, plus its browser profile
* (`ComputerBrowserDataDir`). Both stay when the computer is deleted.
* The rest of its home (`ComputerHomeDir`: dotfiles, the env files)
* lives in the container and goes with it. Every bot works in
* `bots/<bot id>` there, a user's work in `bots/<bot id>/users/<user
* id>`, and a workspace's bots share `workspaces/<workspace id>`
* (`computerRunDirs`).
@@ -108,6 +109,16 @@ export const AppData = {
ComputerDataDir: "computers",
ComputerHomeDir: "/home/gem",
ComputerWorkspaceDir: "/home/gem/workspace",
/**
* A computer's browser profile (cookies, logins, site permissions) is
* kept at `DATA_DIR/<ComputerBrowserDataDir>/<id>`, outside its
* workspace, and mounted at `ComputerBrowserProfileDir`, which Chrome
* is pointed at with `--user-data-dir`. The image's own profile
* (`~/.config/browser`) can't be kept: every boot resets its
* preferences to session-only cookies.
*/
ComputerBrowserDataDir: "computer-browsers",
ComputerBrowserProfileDir: "/home/gem/.cobble-browser",
/**
* Written at the root of a computer's workspace once it uses that
* layout, so an older computer's whole home is told apart and moved
@@ -121,9 +132,10 @@ export const AppData = {
ComputerOldHomeSuffix: "-home-",
/**
* Recorded in a container's `metadata.layout` once it mounts only the
* workspace.
* workspace and the browser profile. A container with another value
* is recreated (`migrateComputerLayout`).
*/
ComputerWorkspaceLayout: "workspace",
ComputerWorkspaceLayout: "workspace-browser",
ComputerUserUid: 1000,
ComputerUserGid: 1000,
/**