@rubytech/taskmaster 1.0.9 → 1.0.10
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/dist/build-info.json +3 -3
- package/dist/cli/provision-cli.js +7 -5
- package/package.json +1 -1
- package/scripts/install.sh +14 -6
package/dist/build-info.json
CHANGED
|
@@ -55,7 +55,7 @@ async function runProvision(opts) {
|
|
|
55
55
|
}
|
|
56
56
|
else if (isLinux) {
|
|
57
57
|
await installAvahi();
|
|
58
|
-
await setHostname();
|
|
58
|
+
await setHostname(port);
|
|
59
59
|
await restartAvahi();
|
|
60
60
|
}
|
|
61
61
|
else {
|
|
@@ -66,13 +66,14 @@ async function runProvision(opts) {
|
|
|
66
66
|
// Step 7: Install daemon
|
|
67
67
|
console.log("[7/7] Installing gateway daemon...");
|
|
68
68
|
await runDaemonInstall({ port, force: true });
|
|
69
|
+
const hostname = port === DEFAULT_GATEWAY_PORT ? "taskmaster" : `taskmaster-${port}`;
|
|
69
70
|
console.log("");
|
|
70
71
|
console.log("Provision complete!");
|
|
71
72
|
console.log("");
|
|
72
73
|
console.log(` Config: ${resolveConfigPath()}`);
|
|
73
74
|
console.log(` Workspace: ${workspace}`);
|
|
74
75
|
console.log(` Port: ${port}`);
|
|
75
|
-
console.log(` URL: http
|
|
76
|
+
console.log(` URL: http://${hostname}.local:${port}/setup`);
|
|
76
77
|
console.log("");
|
|
77
78
|
console.log("Next: open the URL above in a browser to complete setup.");
|
|
78
79
|
console.log("");
|
|
@@ -167,10 +168,11 @@ async function installAvahi() {
|
|
|
167
168
|
// ---------------------------------------------------------------------------
|
|
168
169
|
// Step 5: Set hostname (Linux only)
|
|
169
170
|
// ---------------------------------------------------------------------------
|
|
170
|
-
async function setHostname() {
|
|
171
|
-
|
|
171
|
+
async function setHostname(port) {
|
|
172
|
+
const hostname = port === DEFAULT_GATEWAY_PORT ? "taskmaster" : `taskmaster-${port}`;
|
|
173
|
+
console.log(`[5/7] Setting hostname to '${hostname}'...`);
|
|
172
174
|
try {
|
|
173
|
-
await runCommandWithTimeout(["sudo", "hostnamectl", "set-hostname",
|
|
175
|
+
await runCommandWithTimeout(["sudo", "hostnamectl", "set-hostname", hostname], {
|
|
174
176
|
timeoutMs: 10_000,
|
|
175
177
|
});
|
|
176
178
|
console.log(" hostname set");
|
package/package.json
CHANGED
package/scripts/install.sh
CHANGED
|
@@ -135,19 +135,27 @@ if [ "$(id -u)" = "0" ] && [ "$REAL_USER" != "root" ]; then
|
|
|
135
135
|
&& echo " avahi-daemon installed" \
|
|
136
136
|
|| echo " avahi-daemon install failed (continuing)"
|
|
137
137
|
|
|
138
|
-
# Hostname
|
|
139
|
-
|
|
140
|
-
|
|
138
|
+
# Hostname — include port to avoid conflicts with other instances on the network
|
|
139
|
+
if [ "$MDNS_PORT" = "18789" ]; then
|
|
140
|
+
TM_HOSTNAME="taskmaster"
|
|
141
|
+
else
|
|
142
|
+
TM_HOSTNAME="taskmaster-${MDNS_PORT}"
|
|
143
|
+
fi
|
|
144
|
+
hostnamectl set-hostname "$TM_HOSTNAME" 2>/dev/null \
|
|
145
|
+
&& echo " hostname set to '${TM_HOSTNAME}'" \
|
|
141
146
|
|| echo " hostname set failed (continuing)"
|
|
142
147
|
|
|
143
148
|
# Ensure /etc/hosts resolves the new hostname (sudo warns otherwise)
|
|
144
|
-
if ! grep -q "
|
|
145
|
-
echo "127.0.0.1
|
|
149
|
+
if ! grep -q "$TM_HOSTNAME" /etc/hosts 2>/dev/null; then
|
|
150
|
+
echo "127.0.0.1 $TM_HOSTNAME" >> /etc/hosts
|
|
146
151
|
fi
|
|
147
152
|
|
|
153
|
+
# Remove stale avahi service file from previous installs (conflicts with gateway Bonjour)
|
|
154
|
+
rm -f /etc/avahi/services/taskmaster.service
|
|
155
|
+
|
|
148
156
|
# Restart avahi so it picks up the new hostname
|
|
149
157
|
systemctl restart avahi-daemon 2>/dev/null || true
|
|
150
|
-
echo " mDNS ready
|
|
158
|
+
echo " mDNS: ${TM_HOSTNAME}.local ready"
|
|
151
159
|
|
|
152
160
|
# Enable user services so systemctl --user works after logout
|
|
153
161
|
REAL_UID=$(id -u "$REAL_USER")
|