@justin0713/opspilot 1.0.1 → 1.0.3
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/bin/opspilot.js +10 -10
- package/package.json +1 -1
package/bin/opspilot.js
CHANGED
|
@@ -100,21 +100,21 @@ function cmdStart(flags) {
|
|
|
100
100
|
checkDocker();
|
|
101
101
|
|
|
102
102
|
const cfg = loadConfig();
|
|
103
|
-
const token = flags.token
|
|
104
|
-
const url = flags['cloud-url'] || cfg.cloudUrl || '
|
|
105
|
-
const port = flags.port
|
|
106
|
-
const data = flags['data-dir']
|
|
103
|
+
const token = flags.token || cfg.token || '';
|
|
104
|
+
const url = flags['cloud-url'] || cfg.cloudUrl || '';
|
|
105
|
+
const port = flags.port || cfg.port || '5000';
|
|
106
|
+
const data = flags['data-dir'] || cfg.dataDir || 'opspilot-data';
|
|
107
107
|
|
|
108
108
|
if (!token) {
|
|
109
109
|
die(
|
|
110
|
-
'License token required.\n' +
|
|
110
|
+
'License token is required.\n' +
|
|
111
111
|
' opspilot start --token <your-license-token>\n' +
|
|
112
|
-
' Get a token
|
|
112
|
+
' Get a token: log in to OpsPilot Cloud → Dashboard → License Tokens → Generate'
|
|
113
113
|
);
|
|
114
114
|
}
|
|
115
115
|
|
|
116
116
|
// Persist for next run
|
|
117
|
-
saveConfig({ token, cloudUrl: url, port, dataDir: data });
|
|
117
|
+
saveConfig({ token, cloudUrl: url || 'https://teams.codetop.net', port, dataDir: data });
|
|
118
118
|
|
|
119
119
|
// Stop existing container if running
|
|
120
120
|
const existing = tryRun(`docker inspect -f "{{.State.Status}}" ${CONTAINER} 2>/dev/null`);
|
|
@@ -132,14 +132,14 @@ function cmdStart(flags) {
|
|
|
132
132
|
|
|
133
133
|
// Volume arg: named volume or host path
|
|
134
134
|
const isAbsolute = path.isAbsolute(data);
|
|
135
|
-
const volArg =
|
|
135
|
+
const volArg = `${data}:/app/data`;
|
|
136
136
|
|
|
137
137
|
log(`Starting OpsPilot Local on port ${port} ...`);
|
|
138
138
|
run(
|
|
139
139
|
`docker run -d ` +
|
|
140
140
|
`--name ${CONTAINER} ` +
|
|
141
141
|
`-p ${port}:5000 ` +
|
|
142
|
-
`-e OPSPILOT_CLOUD_URL=${url} ` +
|
|
142
|
+
`-e OPSPILOT_CLOUD_URL=${url || 'https://teams.codetop.net'} ` +
|
|
143
143
|
`-e OPSPILOT_CLOUD_TOKEN=${token} ` +
|
|
144
144
|
`-e OPSPILOT_PORT=5000 ` +
|
|
145
145
|
`-v ${volArg} ` +
|
|
@@ -232,7 +232,7 @@ ${BOLD}Commands:${RESET}
|
|
|
232
232
|
${CYAN}config${RESET} Show saved local config
|
|
233
233
|
|
|
234
234
|
${BOLD}Start options:${RESET}
|
|
235
|
-
--token <token> License token from OpsPilot Cloud ${YELLOW}(required
|
|
235
|
+
--token <token> License token from OpsPilot Cloud ${YELLOW}(required)${RESET}
|
|
236
236
|
--cloud-url <url> Cloud server URL [default: https://teams.codetop.net]
|
|
237
237
|
--port <port> Local port [default: 5000]
|
|
238
238
|
--data-dir <path> Host data path or Docker volume name [default: opspilot-data]
|
package/package.json
CHANGED