Self-hosted, Self-Improving, Federated Everything App — dev management, agent orchestration, persistent mind, digital twin, second brain, and creative pipeline from a single dashboard over Tailscale to port the user into the OS
JavaScript ai-agentsdashboarddeveloper-toolsdigital-twinquantified-selfsecond-brainself-hostedtailscale
fix: add logging to announce flow for debugging peer registration
Adam Eivy3deb64a3aebd
diff --git a/server/routes/instances.js b/server/routes/instances.jsindex 371d0431b0..254d90d545 100644--- a/server/routes/instances.js+++ b/server/routes/instances.js@@ -61,7 +61,9 @@ router.put('/self', asyncHandler(async (req, res) => {router.post('/peers/announce', asyncHandler(async (req, res) => {const data = announceSchema.parse(req.body);// Derive caller IP from req.ip, stripping ::ffff: prefix for IPv4-mapped addresses- const address = req.ip?.replace(/^::ffff:/, '') ?? req.socket.remoteAddress?.replace(/^::ffff:/, '');+ const rawIp = req.ip || req.socket.remoteAddress || '';+ const address = rawIp.replace(/^::ffff:/, '');+ console.log(`🌐 Announce received from ${data.name || 'unknown'} (raw IP: ${rawIp}, resolved: ${address}, port: ${data.port})`);if (!address) throw new ServerError('Could not determine caller IP', { status: 400 });const result = await instances.handleAnnounce({diff --git a/server/services/instances.js b/server/services/instances.jsindex ea6deac49c..0915639ea6 100644--- a/server/services/instances.js+++ b/server/services/instances.js@@ -257,7 +257,7 @@ async function announceSelf(address, port) {const controller = new AbortController();const timeout = setTimeout(() => controller.abort(), PROBE_TIMEOUT_MS);try {- await fetch(url, {+ const res = await fetch(url, {method: 'POST',headers: { 'Content-Type': 'application/json' },body: JSON.stringify({@@ -267,8 +267,13 @@ async function announceSelf(address, port) {}),signal: controller.signal});- } catch {- // Fire-and-forget — peer may be offline or not running PortOS+ if (res.ok) {+ console.log(`🌐 Announced self to ${address}:${port}`);+ } else {+ console.log(`🌐 Announce to ${address}:${port} failed: HTTP ${res.status}`);+ }+ } catch (err) {+ console.log(`🌐 Announce to ${address}:${port} unreachable: ${err.message}`);} finally {clearTimeout(timeout);}