fluxy-bot 0.5.69 → 0.5.70
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/cli.js +11 -9
- package/package.json +1 -1
- package/supervisor/index.ts +9 -5
package/bin/cli.js
CHANGED
|
@@ -152,9 +152,9 @@ function generateLaunchdPlist({ nodePath, dataDir }) {
|
|
|
152
152
|
<key>ThrottleInterval</key>
|
|
153
153
|
<integer>5</integer>
|
|
154
154
|
<key>StandardOutPath</key>
|
|
155
|
-
<string>${LAUNCHD_LOG_DIR}/
|
|
155
|
+
<string>${LAUNCHD_LOG_DIR}/fluxy.log</string>
|
|
156
156
|
<key>StandardErrorPath</key>
|
|
157
|
-
<string>${LAUNCHD_LOG_DIR}/
|
|
157
|
+
<string>${LAUNCHD_LOG_DIR}/fluxy.log</string>
|
|
158
158
|
<key>ProcessType</key>
|
|
159
159
|
<string>Standard</string>
|
|
160
160
|
</dict>
|
|
@@ -545,15 +545,15 @@ function finalMessage(tunnelUrl, relayUrl) {
|
|
|
545
545
|
${c.pink}${c.bold}${link(relayUrl)}${c.reset}`);
|
|
546
546
|
}
|
|
547
547
|
|
|
548
|
-
if (
|
|
548
|
+
if (hasDaemonSupport()) {
|
|
549
549
|
console.log(`
|
|
550
550
|
${c.dim}─────────────────────────────────${c.reset}
|
|
551
551
|
|
|
552
552
|
${c.bold}${c.white}Commands:${c.reset}
|
|
553
|
-
${c.dim}Status${c.reset} ${c.pink}fluxy
|
|
554
|
-
${c.dim}Logs${c.reset} ${c.pink}fluxy
|
|
553
|
+
${c.dim}Status${c.reset} ${c.pink}fluxy status${c.reset}
|
|
554
|
+
${c.dim}Logs${c.reset} ${c.pink}fluxy logs${c.reset}
|
|
555
|
+
${c.dim}Stop${c.reset} ${c.pink}fluxy stop${c.reset}
|
|
555
556
|
${c.dim}Restart${c.reset} ${c.pink}fluxy daemon restart${c.reset}
|
|
556
|
-
${c.dim}Stop${c.reset} ${c.pink}fluxy daemon stop${c.reset}
|
|
557
557
|
${c.dim}Update${c.reset} ${c.pink}fluxy update${c.reset}
|
|
558
558
|
`);
|
|
559
559
|
} else {
|
|
@@ -1222,7 +1222,7 @@ async function daemon(sub) {
|
|
|
1222
1222
|
if (PLATFORM === 'darwin') {
|
|
1223
1223
|
switch (action) {
|
|
1224
1224
|
case 'install': {
|
|
1225
|
-
const dataDir =
|
|
1225
|
+
const dataDir = ROOT; // Uses REPO_ROOT in dev, DATA_DIR (~/.fluxy) in production
|
|
1226
1226
|
if (!fs.existsSync(path.join(dataDir, 'supervisor', 'index.ts'))) {
|
|
1227
1227
|
console.log(`\n ${c.red}✗${c.reset} Run ${c.pink}fluxy init${c.reset} first.\n`);
|
|
1228
1228
|
process.exit(1);
|
|
@@ -1301,12 +1301,12 @@ async function daemon(sub) {
|
|
|
1301
1301
|
console.log(`\n ${c.dim}●${c.reset} Fluxy daemon is stopped.`);
|
|
1302
1302
|
}
|
|
1303
1303
|
console.log(` ${c.dim}Plist:${c.reset} ${LAUNCHD_PLIST_PATH}`);
|
|
1304
|
-
console.log(` ${c.dim}Logs:${c.reset} ${LAUNCHD_LOG_DIR}
|
|
1304
|
+
console.log(` ${c.dim}Logs:${c.reset} ${LAUNCHD_LOG_DIR}/fluxy.log\n`);
|
|
1305
1305
|
break;
|
|
1306
1306
|
}
|
|
1307
1307
|
|
|
1308
1308
|
case 'logs': {
|
|
1309
|
-
const logFile = path.join(LAUNCHD_LOG_DIR, '
|
|
1309
|
+
const logFile = path.join(LAUNCHD_LOG_DIR, 'fluxy.log');
|
|
1310
1310
|
if (!fs.existsSync(logFile)) {
|
|
1311
1311
|
console.log(`\n ${c.dim}No logs found at ${logFile}${c.reset}\n`);
|
|
1312
1312
|
break;
|
|
@@ -1548,6 +1548,8 @@ async function tunnel(sub) {
|
|
|
1548
1548
|
switch (command) {
|
|
1549
1549
|
case 'init': init(); break;
|
|
1550
1550
|
case 'start': start(); break;
|
|
1551
|
+
case 'stop': daemon('stop'); break;
|
|
1552
|
+
case 'logs': daemon('logs'); break;
|
|
1551
1553
|
case 'status': status(); break;
|
|
1552
1554
|
case 'update': update(); break;
|
|
1553
1555
|
case 'daemon': daemon(subcommand); break;
|
package/package.json
CHANGED
package/supervisor/index.ts
CHANGED
|
@@ -914,13 +914,17 @@ export async function startSupervisor() {
|
|
|
914
914
|
}
|
|
915
915
|
|
|
916
916
|
tunnelUrl = newUrl;
|
|
917
|
-
config.tunnelUrl = newUrl;
|
|
918
|
-
saveConfig(config);
|
|
919
917
|
|
|
920
|
-
|
|
918
|
+
// Re-read config from disk — relay token may have been added during onboarding
|
|
919
|
+
const latestCfg = loadConfig();
|
|
920
|
+
latestCfg.tunnelUrl = newUrl;
|
|
921
|
+
saveConfig(latestCfg);
|
|
922
|
+
|
|
923
|
+
if (latestCfg.relay?.token) {
|
|
921
924
|
stopHeartbeat();
|
|
922
|
-
startHeartbeat(
|
|
923
|
-
await updateTunnelUrl(
|
|
925
|
+
startHeartbeat(latestCfg.relay.token, newUrl);
|
|
926
|
+
await updateTunnelUrl(latestCfg.relay.token, newUrl);
|
|
927
|
+
log.ok(`Relay updated with new tunnel URL`);
|
|
924
928
|
}
|
|
925
929
|
log.ok(`Tunnel restored: ${newUrl}`);
|
|
926
930
|
}
|