@justin0713/opspilot 1.0.9 → 1.1.0

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.
Files changed (2) hide show
  1. package/bin/opspilot.js +11 -5
  2. package/package.json +1 -1
package/bin/opspilot.js CHANGED
@@ -214,17 +214,18 @@ function cmdStart(flags) {
214
214
  // Detect first run: credentials file doesn't exist yet
215
215
  const isFirstRun = !fs.existsSync(CREDENTIALS_FILE);
216
216
  let setupMount = '';
217
+ let firstRunPassword = '';
217
218
 
218
219
  if (isFirstRun) {
219
- const password = generatePassword();
220
+ firstRunPassword = generatePassword();
220
221
 
221
222
  // 1. Write to host temp file (chmod 600) — never passed as CLI arg or env var
222
223
  fs.mkdirSync(CONFIG_DIR, { recursive: true });
223
- fs.writeFileSync(SETUP_TOKEN_FILE, password);
224
+ fs.writeFileSync(SETUP_TOKEN_FILE, firstRunPassword);
224
225
  try { fs.chmodSync(SETUP_TOKEN_FILE, 0o600); } catch (_) {}
225
226
 
226
227
  // 2. Save to credentials file (chmod 600) for `opspilot password` command
227
- writeCredentials(password);
228
+ writeCredentials(firstRunPassword);
228
229
 
229
230
  // 3. Mount into container read-only — entrypoint reads & deletes it
230
231
  setupMount = `-v "${SETUP_TOKEN_FILE}:/app/.setup_token:ro" `;
@@ -255,11 +256,16 @@ function cmdStart(flags) {
255
256
  console.log(`${BOLD} URL :${RESET} http://localhost:${port}`);
256
257
  console.log(`${BOLD} Username :${RESET} admin`);
257
258
  if (isFirstRun) {
258
- console.log(`${BOLD} Password :${RESET} run ${CYAN}opspilot password${RESET} to reveal`);
259
+ console.log(`${BOLD} Password :${RESET} ${BOLD}${firstRunPassword}${RESET}`);
259
260
  }
260
261
  console.log(`${BOLD} Data :${RESET} ${path.isAbsolute(data) ? data : `docker volume '${data}'`}`);
262
+ if (isFirstRun) {
263
+ console.log('');
264
+ console.log(`${YELLOW} Change your password in Settings after first login.${RESET}`);
265
+ console.log(` Password also saved at: ${CREDENTIALS_FILE}`);
266
+ console.log(` (run ${CYAN}opspilot password --clear${RESET} after you've changed it)`);
267
+ }
261
268
  console.log('');
262
- console.log(` ${CYAN}opspilot password${RESET} — show first-run admin password`);
263
269
  console.log(` ${CYAN}opspilot logs -f${RESET} — tail live logs`);
264
270
  console.log(` ${CYAN}opspilot stop${RESET} — stop the server`);
265
271
  console.log(` ${CYAN}opspilot update${RESET} — upgrade to latest`);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@justin0713/opspilot",
3
- "version": "1.0.9",
3
+ "version": "1.1.0",
4
4
  "description": "CLI installer for OpsPilot Local — self-hosted SSH operations platform",
5
5
  "license": "MIT",
6
6
  "homepage": "https://github.com/Albert0977/ShellShare#readme",