mercury-agent 0.4.12 → 0.4.14
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -44,9 +44,13 @@ type MercuryExt = {
|
|
|
44
44
|
): void;
|
|
45
45
|
};
|
|
46
46
|
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
47
|
+
const gwsEnv = {
|
|
48
|
+
credentialEnvVar: "MERCURY_GWS_CREDENTIALS_JSON",
|
|
49
|
+
env: {
|
|
50
|
+
credentials: "MERCURY_GWS_CREDENTIALS_JSON",
|
|
51
|
+
legacyCredentialsFile: "MERCURY_GOOGLE_WORKSPACE_CLI_CREDENTIALS_FILE",
|
|
52
|
+
},
|
|
53
|
+
};
|
|
50
54
|
|
|
51
55
|
/** Path where credentials are materialized inside the inner container's own /tmp. */
|
|
52
56
|
const CREDENTIALS_FILE = "/tmp/gws-credentials.json";
|
|
@@ -30,9 +30,13 @@ type MercuryExt = {
|
|
|
30
30
|
}): void;
|
|
31
31
|
};
|
|
32
32
|
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
33
|
+
const yahooEnv = {
|
|
34
|
+
credentialEnvVar: "MERCURY_YAHOO_APP_PASSWORD",
|
|
35
|
+
env: {
|
|
36
|
+
email: "MERCURY_YAHOO_EMAIL",
|
|
37
|
+
appPassword: "MERCURY_YAHOO_APP_PASSWORD",
|
|
38
|
+
},
|
|
39
|
+
};
|
|
36
40
|
|
|
37
41
|
export default function (mercury: MercuryExt) {
|
|
38
42
|
mercury.cli({
|
package/package.json
CHANGED
|
@@ -385,6 +385,22 @@ const PACKAGE_ROOT = path.join(__dirname, "../..");
|
|
|
385
385
|
/** Exit code 137 = SIGKILL (128 + 9), typically from OOM killer */
|
|
386
386
|
const OOM_EXIT_CODE = 137;
|
|
387
387
|
|
|
388
|
+
let _isDockerDesktop: boolean | undefined;
|
|
389
|
+
function isDockerDesktop(): boolean {
|
|
390
|
+
if (_isDockerDesktop !== undefined) return _isDockerDesktop;
|
|
391
|
+
try {
|
|
392
|
+
const info = execFileSync("docker", ["info", "--format", "{{.Name}}"], {
|
|
393
|
+
encoding: "utf8",
|
|
394
|
+
timeout: 10_000,
|
|
395
|
+
stdio: ["pipe", "pipe", "pipe"],
|
|
396
|
+
}).trim();
|
|
397
|
+
_isDockerDesktop = info === "docker-desktop";
|
|
398
|
+
} catch {
|
|
399
|
+
_isDockerDesktop = false;
|
|
400
|
+
}
|
|
401
|
+
return _isDockerDesktop;
|
|
402
|
+
}
|
|
403
|
+
|
|
388
404
|
export class AgentContainerRunner {
|
|
389
405
|
// Inner containers now run detached (no long-lived `docker` child process to
|
|
390
406
|
// hold a handle to), so we track only the container name — termination is by
|
|
@@ -934,7 +950,7 @@ export class AgentContainerRunner {
|
|
|
934
950
|
"-e",
|
|
935
951
|
"CONTAINER_RUNTIME=runsc",
|
|
936
952
|
);
|
|
937
|
-
} else if (this.config.containerBwrapDockerCompat) {
|
|
953
|
+
} else if (this.config.containerBwrapDockerCompat || isDockerDesktop()) {
|
|
938
954
|
// runc + bwrap: bubblewrap needs extra namespace syscalls that Docker's default
|
|
939
955
|
// seccomp/caps/AppArmor block. seccomp=unconfined allows unshare; apparmor=unconfined
|
|
940
956
|
// allows mount(MS_SLAVE); SYS_ADMIN grants the mount capability. Bwrap remains active
|