run-spaceapp 1.0.31 → 1.0.36

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 CHANGED
@@ -105,10 +105,10 @@ Claude Code is not redistributed in SpaceApp images. Install the reviewed
105
105
  package as an explicit owner action with:
106
106
 
107
107
  ```bash
108
- npx --yes run-spaceapp@personal provider install claude
108
+ npx --yes run-spaceapp@latest provider install claude
109
109
  ```
110
110
 
111
- Run `npx --yes run-spaceapp@personal help` for the complete command list. Full
111
+ Run `npx --yes run-spaceapp@latest help` for the complete command list. Full
112
112
  documentation:
113
113
 
114
114
  - [Getting started](https://github.com/oll4com/spaceapp/blob/main/docs/getting-started.md)
@@ -121,16 +121,38 @@ After the stack passes readiness checks, the install command prints the fresh
121
121
  it expires before the owner is created, run:
122
122
 
123
123
  ```bash
124
- npx --yes run-spaceapp@personal owner rotate-setup-token
124
+ npx --yes run-spaceapp@latest owner rotate-setup-token
125
125
  ```
126
126
 
127
- Common follow-up commands use the same reliable launcher prefix:
127
+ ### Self-Hosted Installation Help & Recovery
128
+
129
+ - **Forgot your operator password?** Run in your host terminal:
130
+ ```bash
131
+ npx --yes run-spaceapp@latest owner reset-password
132
+ ```
133
+ - **Need a clean install from scratch?** Run:
134
+ ```bash
135
+ npx --yes run-spaceapp@latest factory-reset
136
+ ```
137
+
138
+ ### Common Commands
128
139
 
129
140
  ```bash
130
- npx --yes run-spaceapp@personal doctor
131
- npx --yes run-spaceapp@personal status
132
- npx --yes run-spaceapp@personal credentials list
133
- npx --yes run-spaceapp@personal uninstall
141
+ npx --yes run-spaceapp@latest status # Check container health and port bindings
142
+ npx --yes run-spaceapp@latest logs # View or stream container logs
143
+ npx --yes run-spaceapp@latest doctor # Verify system prerequisites and diagnose Docker
144
+ npx --yes run-spaceapp@latest up # Start containers in background
145
+ npx --yes run-spaceapp@latest down # Stop containers cleanly
146
+ npx --yes run-spaceapp@latest open # Open web app in default browser
147
+ npx --yes run-spaceapp@latest backup # Create verified, portable backup archive
148
+ npx --yes run-spaceapp@latest restore # Restore state from a backup archive
149
+ npx --yes run-spaceapp@latest update # Pull latest images and upgrade stack
150
+ npx --yes run-spaceapp@latest rollback # Revert to previous stable version
151
+ npx --yes run-spaceapp@latest workspace add <path> # Register host folder for AI CLIs
152
+ npx --yes run-spaceapp@latest workspace list # List registered host folders
153
+ npx --yes run-spaceapp@latest credentials list # List configured AI providers
154
+ npx --yes run-spaceapp@latest credentials set <provider> # Set API key via masked input
155
+ npx --yes run-spaceapp@latest uninstall # Stop and remove containers (preserves data)
134
156
  ```
135
157
 
136
158
  Uninstall retains data by default and prints the separate
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "run-spaceapp",
3
- "version": "1.0.31",
4
- "spaceappRuntimeVersion": "1.0.31",
3
+ "version": "1.0.36",
4
+ "spaceappRuntimeVersion": "1.0.36",
5
5
  "spaceappHostRootRuntimeCompatible": true,
6
6
  "description": "Cross-platform Docker launcher for the SpaceApp self-hosted agent workspace",
7
7
  "license": "Apache-2.0",
@@ -52,5 +52,5 @@
52
52
  "access": "public",
53
53
  "provenance": true
54
54
  },
55
- "gitHead": "2769d82e1077c9316c6452f40c4996e0290ce083"
55
+ "gitHead": "9aa5727def9b1fa92e90ccd3b60807f1f058092b"
56
56
  }
package/src/cli.mjs CHANGED
@@ -968,6 +968,13 @@ async function installCommand(args, {
968
968
  stdout.write('Paste it into the "One-time setup token" field in the page that opens.\n');
969
969
  stdout.write("It expires in 15 minutes and stops working after the first owner is created.\n");
970
970
  stdout.write(`If it expires, run: ${UNIVERSAL_COMMAND} owner rotate-setup-token\n`);
971
+ } else {
972
+ stdout.write(
973
+ "\nNotice: Existing SpaceApp database detected with an already registered operator account.\n" +
974
+ "Sign in using your existing email and password.\n" +
975
+ `- Forgot password? Run: "${UNIVERSAL_COMMAND} owner reset-password"\n` +
976
+ `- Clean install from scratch: "${UNIVERSAL_COMMAND} factory-reset"\n\n`
977
+ );
971
978
  }
972
979
  stdout.write(
973
980
  "Next: open the Getting Started room and use OpenCode. A working free model is selected on first launch.\n" +
@@ -1319,7 +1326,7 @@ async function performUpdate({
1319
1326
  const stagedRoot = await mkdtemp(join(tmpdir(), "spaceapp-update-"));
1320
1327
  let checkpoint = null;
1321
1328
  try {
1322
- await writeRuntimeFiles(stagedRoot, updated);
1329
+ await commitInstallation(stagedRoot, updated);
1323
1330
  const stagedCommand = (action) => composeCommand(action, root, {...updated, stateRoot: stagedRoot});
1324
1331
  const pullCode = await withHeadlessDockerConfig(
1325
1332
  platform, stagedCommand("pull"),
@@ -1331,7 +1338,7 @@ async function performUpdate({
1331
1338
  }
1332
1339
  if (await verifyStorage({ root, config: updated, existingConfig: config, operation: "upgrade", inspectResources, execute, stdout, stderr }) !== 0) return 1;
1333
1340
  checkpoint = await createQuiescedCheckpoint(root, config, {stdin, stdout, stderr, execute, platform});
1334
- await writeRuntimeFiles(root, updated);
1341
+ await commitInstallation(root, updated, { persistConfig: false });
1335
1342
  const upCode = await execute(
1336
1343
  composeCommand("up", root, { profile: updated.profile, companionsEnabled: updated.companionsEnabled }),
1337
1344
  { stdin, stdout, stderr }
@@ -1410,6 +1417,9 @@ async function collectFiles(directory, logicalDirectory) {
1410
1417
  async function createQuiescedCheckpoint(root, config, io) {
1411
1418
  io.stdout.write("Pausing SpaceApp writers before the database checkpoint...\n");
1412
1419
  try {
1420
+ io.stdout.write("Ensuring the existing PostgreSQL database is ready for the checkpoint...\n");
1421
+ const databaseCode = await io.execute(composeCommand("ensureCheckpointDatabase", root, config), io);
1422
+ if (databaseCode !== 0) throw new Error(`The existing PostgreSQL database did not become ready (exit ${databaseCode}). The upgrade was not applied.`);
1413
1423
  const code = await io.execute(composeCommand("stopForRestore", root, config), io);
1414
1424
  if (code !== 0) throw new Error(`Could not pause SpaceApp writers (exit ${code}).`);
1415
1425
  return await createCheckpoint(root, config, io);
package/src/index.mjs CHANGED
@@ -677,6 +677,7 @@ export function composeCommand(action, root, options = {}) {
677
677
  storageFree: ["exec", "-T", "spaceapp-core", "node", "-e", "const fs=require('node:fs');const s=fs.statfsSync('/var/lib/spaceapp');console.log(Number(s.bavail)*Number(s.bsize))"],
678
678
  purge: ["down", "--volumes", "--remove-orphans"],
679
679
  repair: ["up", "-d", "--remove-orphans", "--force-recreate"],
680
+ ensureCheckpointDatabase: ["up", "-d", "--no-deps", "--wait", "--wait-timeout", "120", "postgres"],
680
681
  checkpointDump: ["exec", "-T", "postgres", "pg_dump", "-c", "--if-exists", "-U", "spaceapp", "-d", "spaceapp"],
681
682
  checkpointRestore: ["exec", "-T", "postgres", "psql", "-v", "ON_ERROR_STOP=1", "-U", "spaceapp", "-d", "spaceapp"]
682
683
  };
@@ -848,7 +849,8 @@ export async function prepareInstallation(root, {
848
849
  }
849
850
 
850
851
  export async function commitInstallation(root, config, {
851
- templateDir = defaultTemplateDir()
852
+ templateDir = defaultTemplateDir(),
853
+ persistConfig = true
852
854
  } = {}) {
853
855
  validateHome(root);
854
856
  validateConfig(config);
@@ -856,7 +858,7 @@ export async function commitInstallation(root, config, {
856
858
  await mkdir(root, { recursive: true, mode: 0o700 });
857
859
  await atomicWrite(join(root, "compose.yml"), composeTemplate);
858
860
  await writeRuntimeFiles(root, config);
859
- await saveConfig(root, config);
861
+ if (persistConfig) await saveConfig(root, config);
860
862
  }
861
863
 
862
864
  export async function initializeInstallation(root, options) {
@@ -3,12 +3,6 @@ services:
3
3
  image: ghcr.io/oll4com/spaceapp-core:${SPACEAPP_IMAGE_TAG}
4
4
  restart: unless-stopped
5
5
  init: true
6
- entrypoint:
7
- - /bin/sh
8
- - -ec
9
- - |
10
- sed -i 's/agentToolsWriterCommand: env.SPACE_AGENT_TOOLS_WRITER || [^,]*/agentToolsWriterCommand: null/g' /app/apps/api/dist/config.js 2>/dev/null || true
11
- exec /app/deploy/docker/core-entrypoint.sh
12
6
  security_opt:
13
7
  - no-new-privileges:true
14
8
  mem_limit: "${SPACEAPP_CORE_MEMORY_LIMIT}"