@justin0713/opspilot 1.0.4 → 1.0.5

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 +23 -11
  2. package/package.json +1 -1
package/bin/opspilot.js CHANGED
@@ -101,11 +101,12 @@ function parseArgs(argv) {
101
101
  function cmdStart(flags) {
102
102
  checkDocker();
103
103
 
104
- const cfg = loadConfig();
105
- const token = flags.token || cfg.token || '';
106
- const url = flags['cloud-url'] || cfg.cloudUrl || '';
107
- const port = flags.port || cfg.port || '5000';
108
- const data = flags['data-dir'] || cfg.dataDir || 'opspilot-data';
104
+ const cfg = loadConfig();
105
+ const token = flags.token || cfg.token || '';
106
+ const url = flags['cloud-url'] || cfg.cloudUrl || '';
107
+ const port = flags.port || cfg.port || '5000';
108
+ const data = flags['data-dir'] || cfg.dataDir || 'opspilot-data';
109
+ const adminPass = flags['admin-password'] || '';
109
110
 
110
111
  if (!token) {
111
112
  die(
@@ -136,6 +137,9 @@ function cmdStart(flags) {
136
137
  const isAbsolute = path.isAbsolute(data);
137
138
  const volArg = `${data}:/app/data`;
138
139
 
140
+ // Admin password env (first-run only — ignored if users.json already exists in volume)
141
+ const adminEnv = adminPass ? `-e SHELLSHADOW_INITIAL_ADMIN_PASSWORD=${adminPass} ` : '';
142
+
139
143
  log(`Starting OpsPilot Local on port ${port} ...`);
140
144
  run(
141
145
  `docker run -d ` +
@@ -144,6 +148,7 @@ function cmdStart(flags) {
144
148
  `-e OPSPILOT_CLOUD_URL=${url || 'https://teams.codetop.net'} ` +
145
149
  `-e OPSPILOT_CLOUD_TOKEN=${token} ` +
146
150
  `-e OPSPILOT_PORT=5000 ` +
151
+ adminEnv +
147
152
  `-v ${volArg} ` +
148
153
  `--restart unless-stopped ` +
149
154
  `${IMAGE}`
@@ -151,8 +156,14 @@ function cmdStart(flags) {
151
156
 
152
157
  console.log('');
153
158
  ok(`OpsPilot Local is running!`);
154
- console.log(`${BOLD} URL :${RESET} http://localhost:${port}`);
155
- console.log(`${BOLD} Data:${RESET} ${isAbsolute ? data : `docker volume '${data}'`}`);
159
+ console.log(`${BOLD} URL :${RESET} http://localhost:${port}`);
160
+ console.log(`${BOLD} Username :${RESET} admin`);
161
+ if (adminPass) {
162
+ console.log(`${BOLD} Password :${RESET} ${adminPass} ${YELLOW}← change this after first login${RESET}`);
163
+ } else {
164
+ console.log(`${BOLD} Password :${RESET} ${YELLOW}check logs → opspilot logs | grep SECURITY${RESET}`);
165
+ }
166
+ console.log(`${BOLD} Data :${RESET} ${isAbsolute ? data : `docker volume '${data}'`}`);
156
167
  console.log('');
157
168
  console.log(` ${CYAN}opspilot logs -f${RESET} — tail live logs`);
158
169
  console.log(` ${CYAN}opspilot stop${RESET} — stop the server`);
@@ -234,10 +245,11 @@ ${BOLD}Commands:${RESET}
234
245
  ${CYAN}config${RESET} Show saved local config
235
246
 
236
247
  ${BOLD}Start options:${RESET}
237
- --token <token> License token from OpsPilot Cloud ${YELLOW}(required)${RESET}
238
- --cloud-url <url> Cloud server URL [default: https://teams.codetop.net]
239
- --port <port> Local port [default: 5000]
240
- --data-dir <path> Host data path or Docker volume name [default: opspilot-data]
248
+ --token <token> License token from OpsPilot Cloud ${YELLOW}(required)${RESET}
249
+ --admin-password <password> Set admin password on first run ${YELLOW}(recommended)${RESET}
250
+ --cloud-url <url> Cloud server URL [default: https://teams.codetop.net]
251
+ --port <port> Local port [default: 5000]
252
+ --data-dir <path> Host data path or Docker volume name [default: opspilot-data]
241
253
 
242
254
  ${BOLD}Examples:${RESET}
243
255
  npx @justin0713/opspilot start --token eyJ...
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@justin0713/opspilot",
3
- "version": "1.0.4",
3
+ "version": "1.0.5",
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",