run-spaceapp 0.1.5 → 0.1.6
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.
- package/README.md +6 -4
- package/package.json +2 -2
- package/src/cli.mjs +2 -0
- package/src/prerequisites.mjs +42 -0
package/README.md
CHANGED
|
@@ -24,10 +24,12 @@ The launcher requires Node.js 20.11 or newer, 4 CPUs, 8 GB RAM, and 15 GiB free
|
|
|
24
24
|
disk. If Docker is missing, `spaceapp install` automatically installs it from
|
|
25
25
|
official Docker sources on Windows, macOS, Ubuntu, Debian, Fedora, RHEL, and
|
|
26
26
|
CentOS, starts it, and waits for Engine and Compose readiness before pulling
|
|
27
|
-
images.
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
command
|
|
27
|
+
images. Windows prefers Windows Package Manager's hash-pinned Docker Desktop
|
|
28
|
+
manifest and retains a signed direct-download fallback. Docker Desktop license
|
|
29
|
+
acceptance and Linux `docker` group membership require confirmation inside the
|
|
30
|
+
same command. On Windows, approve any UAC prompt required by WSL2 or Docker
|
|
31
|
+
Desktop. If Windows requests one restart, rerun the same command afterward and
|
|
32
|
+
installation continues safely.
|
|
31
33
|
|
|
32
34
|
The launcher selects the `light` profile below 12 GiB RAM and the `standard`
|
|
33
35
|
profile otherwise; override this with `--profile light` or
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "run-spaceapp",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.6",
|
|
4
4
|
"description": "Cross-platform Docker launcher for the SpaceApp self-hosted agent workspace",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"type": "module",
|
|
@@ -45,5 +45,5 @@
|
|
|
45
45
|
"access": "public",
|
|
46
46
|
"provenance": true
|
|
47
47
|
},
|
|
48
|
-
"gitHead": "
|
|
48
|
+
"gitHead": "81bf4f16666f75cec5b499df28115df3c28e36b8"
|
|
49
49
|
}
|
package/src/cli.mjs
CHANGED
|
@@ -35,6 +35,7 @@ const trustedCommands = new Set([
|
|
|
35
35
|
"sg",
|
|
36
36
|
"spctl",
|
|
37
37
|
"sudo",
|
|
38
|
+
"winget.exe",
|
|
38
39
|
"wsl.exe",
|
|
39
40
|
"xdg-open"
|
|
40
41
|
]);
|
|
@@ -583,6 +584,7 @@ function spawnTrustedCommand(spec, options) {
|
|
|
583
584
|
case "sg": return spawn("sg", args, options);
|
|
584
585
|
case "spctl": return spawn("spctl", args, options);
|
|
585
586
|
case "sudo": return spawn("sudo", args, options);
|
|
587
|
+
case "winget.exe": return spawn("winget.exe", args, options);
|
|
586
588
|
case "wsl.exe": return spawn("wsl.exe", args, options);
|
|
587
589
|
case "xdg-open": return spawn("xdg-open", args, options);
|
|
588
590
|
default: throw new Error("SpaceApp refused to execute an untrusted command.");
|
package/src/prerequisites.mjs
CHANGED
|
@@ -19,6 +19,19 @@ const MAC_DOCKER_DOWNLOADS = Object.freeze({
|
|
|
19
19
|
x64: "https://desktop.docker.com/mac/main/amd64/Docker.dmg",
|
|
20
20
|
arm64: "https://desktop.docker.com/mac/main/arm64/Docker.dmg"
|
|
21
21
|
});
|
|
22
|
+
// Sources:
|
|
23
|
+
// https://learn.microsoft.com/windows/package-manager/winget/install
|
|
24
|
+
// https://github.com/microsoft/winget-pkgs/tree/master/manifests/d/Docker/DockerDesktop
|
|
25
|
+
const WINDOWS_DOCKER_WINGET_ARGS = Object.freeze([
|
|
26
|
+
"install",
|
|
27
|
+
"--id", "Docker.DockerDesktop",
|
|
28
|
+
"--exact",
|
|
29
|
+
"--source", "winget",
|
|
30
|
+
"--silent",
|
|
31
|
+
"--accept-package-agreements",
|
|
32
|
+
"--accept-source-agreements",
|
|
33
|
+
"--disable-interactivity"
|
|
34
|
+
]);
|
|
22
35
|
|
|
23
36
|
export function windowsPowerShellArgs(operation) {
|
|
24
37
|
const scripts = {
|
|
@@ -169,6 +182,35 @@ async function ensureWindowsDocker({
|
|
|
169
182
|
}
|
|
170
183
|
}
|
|
171
184
|
|
|
185
|
+
if (!application) {
|
|
186
|
+
const wingetCode = await execute(
|
|
187
|
+
{ command: "winget.exe", args: ["--version"] },
|
|
188
|
+
{ stdin, stdout: null, stderr: null }
|
|
189
|
+
);
|
|
190
|
+
if (wingetCode === 0) {
|
|
191
|
+
stdout.write(
|
|
192
|
+
"Installing Docker Desktop through Windows Package Manager with manifest hash verification...\n"
|
|
193
|
+
);
|
|
194
|
+
const installCode = await execute(
|
|
195
|
+
{ command: "winget.exe", args: [...WINDOWS_DOCKER_WINGET_ARGS] },
|
|
196
|
+
{ stdin, stdout, stderr }
|
|
197
|
+
);
|
|
198
|
+
if (installCode === 0) {
|
|
199
|
+
application = await firstExisting(paths.applications, pathExists);
|
|
200
|
+
if (!application) {
|
|
201
|
+
stderr.write(
|
|
202
|
+
"Windows Package Manager reported success, but Docker Desktop could not be found.\n"
|
|
203
|
+
);
|
|
204
|
+
return { code: 1, reexecuted: false };
|
|
205
|
+
}
|
|
206
|
+
} else {
|
|
207
|
+
stdout.write(
|
|
208
|
+
"Windows Package Manager could not install Docker Desktop; trying Docker's signed direct installer...\n"
|
|
209
|
+
);
|
|
210
|
+
}
|
|
211
|
+
}
|
|
212
|
+
}
|
|
213
|
+
|
|
172
214
|
if (!application) {
|
|
173
215
|
const downloadUrl = WINDOWS_DOCKER_DOWNLOADS[arch];
|
|
174
216
|
if (!downloadUrl) {
|