feat!: Urutau 2.0.0, ultralight probes and a single analysis hub
Each server runs an ultralight probe (scratch image, ~7 MiB RSS) that tails the logs, ships raw lines to the hub over HTTPS with an on-disk spool, and applies enforce decisions locally. The hub keeps one node per probe (primary node = the 1.x data dir, unchanged), does all analysis and serves the UI. Peer federation is removed. 'urutau import' brings 1.x data dirs in with hash and count verification. UI: probes page, host qualified incidents, IPs never wrap, egress heatmap labels, live and replay globes no longer auto-rotate, replay repeat, live traffic metrics. BREAKING CHANGE: URUTAU_PEERS, URUTAU_PEER_* and /api/v1/peer/* are gone; log path variables move from the hub to the probe. See docs/migration-2.0.md. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
23a7a5963a
commit
8546d14cef
130 files changed
+9396
-3311
No files matched your search
@@ -16,6 +16,14 @@
|
||||
var PER_PAGE = 25;
|
||||
var AUTHOR_KEY = 'urutau.author';
|
||||
|
||||
// Ticket ids are per host (each probe keeps its own INC-n sequence): shown and linked as host/INC-n.
|
||||
function splitId(it) {
|
||||
var id = String(it.id || ''), host = it.host ? String(it.host) : '', i = id.lastIndexOf('/');
|
||||
if (i > 0) { host = id.slice(0, i); id = id.slice(i + 1); }
|
||||
return { host: host, num: id, full: host ? host + '/' + id : id };
|
||||
}
|
||||
function idSegs(it) { var q = splitId(it); return q.host ? [q.host, q.num] : [q.num]; }
|
||||
|
||||
function boot() {
|
||||
var U = window.Urutau;
|
||||
if (!U || !U.registerPage) return false;
|
||||
@@ -305,9 +313,9 @@
|
||||
el('span', { class: 'inc-mrow' }, el('strong', { class: 'inc-title', title: String(it.title || it.id) }, head),
|
||||
(it.tags && it.tags.length) ? el('span', { class: 'inc-rtags' }, tagChips(it.tags.slice(0, 1))) : null),
|
||||
auto ? el('span', { class: 'inc-sub mono', title: String(it.workload) }, String(it.workload)) : null);
|
||||
return el('a', { class: 'inc-row', href: U.href('incidents', [String(it.id)]), title: full },
|
||||
return el('a', { class: 'inc-row', href: U.href('incidents', idSegs(it)), title: full },
|
||||
dot(it.severity),
|
||||
el('span', { class: 'inc-id mono' }, String(it.id)),
|
||||
el('span', { class: 'inc-id mono', title: splitId(it).full }, splitId(it).full),
|
||||
titleLine,
|
||||
el('span', { class: 'inc-st' }, statusBadge(it.status)),
|
||||
el('span', { class: 'inc-who' }, it.assignee ? String(it.assignee) : '—'),
|
||||
@@ -401,7 +409,7 @@
|
||||
U.apiSend('POST', '/api/v1/incidents', { title: ttl, detail: detail.value.trim(), severity: sev.value, host: hostIn.value.trim(), tags: parseTags(tg.value), author: authorName() }).then(function (r) {
|
||||
close();
|
||||
pollBadge();
|
||||
if (r && r.id) location.hash = U.href('incidents', [String(r.id)]); else if (view && view.update) view.update();
|
||||
if (r && r.id) location.hash = U.href('incidents', idSegs(r.host || !hostIn.value.trim() ? r : { id: r.id, host: hostIn.value.trim() })); else if (view && view.update) view.update();
|
||||
}, function () {
|
||||
ok.disabled = false;
|
||||
err.textContent = t('inc.err.create');
|
||||
@@ -414,14 +422,14 @@
|
||||
}
|
||||
|
||||
// ------------------------------------------------------------ one ticket
|
||||
function detailView(host, id) {
|
||||
function detailView(host, id, idHost) {
|
||||
var seq = 0, on = true, tk = null, busy = false;
|
||||
var box = el('div', { class: 'inc-detail' });
|
||||
host.appendChild(el('a', { class: 'inc-back', href: U.href('incidents') }, '← ' + t('inc.back')));
|
||||
host.appendChild(box);
|
||||
var errBox = el('p', { class: 'inc-err', role: 'alert', hidden: true });
|
||||
|
||||
function url(suffix) { return '/api/v1/incidents/' + encodeURIComponent(id) + (suffix || ''); }
|
||||
function url(suffix) { return '/api/v1/incidents/' + encodeURIComponent(id) + (suffix || '') + (idHost ? '?host=' + encodeURIComponent(idHost) : ''); }
|
||||
function send(method, suffix, body, errKey, okKey) {
|
||||
if (busy) return;
|
||||
busy = true; box.classList.add('busy');
|
||||
@@ -480,7 +488,7 @@
|
||||
quick(t('inc.quick.fp'), 'false_positive', 'fp'), quick(t('inc.quick.tp'), 'true_positive', 'tp'), quick(t('inc.quick.resolve'), 'resolved', 'ok'));
|
||||
var meta = el('span', { class: 'inc-hint inc-metaline' }, t('inc.meta', { a: x.created_at ? U.fmt.ago(x.created_at) : '-', b: x.updated_at ? U.fmt.ago(x.updated_at) : '-', n: nf(x.count) }));
|
||||
return el('header', { class: 'inc-head' },
|
||||
el('div', { class: 'inc-h1' }, dot(x.severity), el('span', { class: 'inc-id mono' }, String(x.id)), title, q),
|
||||
el('div', { class: 'inc-h1' }, dot(x.severity), el('span', { class: 'inc-id mono' }, splitId(x).full), title, q),
|
||||
el('div', { class: 'inc-h2' }, sevBadge(x.severity), statusBadge(x.status), x.suppress ? el('span', { class: 'chip' }, t('eg.suppressed.chip')) : null, tagChips(x.tags), meta));
|
||||
}
|
||||
|
||||
@@ -709,8 +717,10 @@
|
||||
if (view) { view.destroy(); view = null; }
|
||||
clear(root);
|
||||
var seg = ctx && ctx.params && ctx.params.segments ? ctx.params.segments : [];
|
||||
var id = seg[0] ? String(seg[0]).slice(0, 64) : '';
|
||||
view = id ? detailView(root, id) : listView(root);
|
||||
var id = seg[0] ? String(seg[0]).slice(0, 64) : '', idHost = '';
|
||||
if (seg[1]) { idHost = id.slice(0, 64); id = String(seg[1]).slice(0, 64); }
|
||||
else if (id.indexOf('/') > 0) { idHost = id.slice(0, id.lastIndexOf('/')); id = id.slice(id.lastIndexOf('/') + 1); }
|
||||
view = id ? detailView(root, id, idHost) : listView(root);
|
||||
}
|
||||
|
||||
U.registerPage({
|
||||
|
||||
Reference in new issue
Block a user