Compare commits

...
1 Commits
Author SHA1 Message Date
Lucas RayanandClaude Opus 5.5 19afd221e2 fix: keep probe files across hub restarts; phone filter sheet above the tab bar (2.1.2)
CI / Format and vet (push) Successful in 1m4s
CI / Dependency audit (push) Successful in 33s
CI / Tests (Linux, race detector) (push) Successful in 2m10s
Release / Plan (reuse the published image?) (push) Successful in 5s
Release / ci (push) Skipped
Release / Build hub image (amd64) (push) Skipped
Release / Build probe image (amd64) (push) Skipped
Release / Build hub image (arm64) (push) Skipped
Release / Build probe image (arm64) (push) Skipped
Release / Publish tags (hub) (push) Successful in 16s
Release / Publish tags (probe) (push) Successful in 16s
Release / Gitea release (push) Successful in 5s
The hub kept a probe's resolv.conf and containers.map only in memory, so
after a restart the egress lines replayed on reconnect were judged with
the hub's own resolvers (false dns_bypass, hostinger/INC-8). They are now
saved in the node directory and loaded at start.

Phone: the global filter sheet opens above the bottom tab bar, the tab
bar closes it, and the sticky filter bar no longer covers the More menu.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-16 08:41:28 -03:00
7 changed files with 89 additions and 6 deletions

No files matched your search

+7
View File
@@ -6,6 +6,13 @@ Format based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/); versio
## [Unreleased] ## [Unreleased]
## [2.1.2] - 2026-11-16
### Fixed
- Egress, false `dns_bypass` right after a hub restart: the files a probe sends (`resolv.conf`, `containers.map`) lived only in the hub's memory, so after a restart the egress lines the probe replayed on reconnect were judged before the probe sent them again (Hostinger `coolify-sentinel` → its upstream resolver 153.92.2.6, hostinger/INC-8). The hub now keeps the last copy of each file in the node's data directory (`probe-resolv.conf`, `probe-containers.map`) and loads it at start. Regression test `TestProbeFilesSurviveRestart`.
- Phone layout: the global filter sheet (period and host) opens above the bottom tab bar instead of covering it, tapping the tab bar closes it, and the sticky filter bar no longer sits on top of the "More" menu.
## [2.1.1] - 2026-11-16 ## [2.1.1] - 2026-11-16
### Fixed ### Fixed
+7
View File
@@ -6,6 +6,13 @@ Formato baseado no [Keep a Changelog](https://keepachangelog.com/pt-BR/1.1.0/);
## [Não lançado] ## [Não lançado]
## [2.1.2] - 2026-11-16
### Corrigido
- Saída, `dns_bypass` falso logo após reiniciar o hub: os arquivos que a sonda envia (`resolv.conf`, `containers.map`) ficavam só na memória do hub, então depois de um reinício as linhas de saída que a sonda reenviava ao reconectar eram julgadas antes de ela mandar os arquivos de novo (`coolify-sentinel` da Hostinger → o resolvedor upstream 153.92.2.6, hostinger/INC-8). O hub agora guarda a última cópia de cada arquivo no diretório do nó (`probe-resolv.conf`, `probe-containers.map`) e a carrega na inicialização. Teste de regressão `TestProbeFilesSurviveRestart`.
- Celular: a folha de filtros globais (período e host) abre acima da barra de navegação inferior em vez de cobri-la, tocar na barra a fecha, e a barra de filtros fixa não fica mais por cima do menu "Mais".
## [2.1.1] - 2026-11-16 ## [2.1.1] - 2026-11-16
### Corrigido ### Corrigido
+37
View File
@@ -124,6 +124,7 @@ func (sh *shared) newNode(name string, primary bool, rec hub.Probe) (*Node, erro
sh.wg.Add(1) sh.wg.Add(1)
go func() { defer sh.wg.Done(); n.Enf.Run(sh.ctx) }() go func() { defer sh.wg.Done(); n.Enf.Run(sh.ctx) }()
} }
n.loadProbeFiles()
if !egressOff(c) { if !egressOff(c) {
if err := n.buildEgress(rec.Egress); err != nil { if err := n.buildEgress(rec.Egress); err != nil {
return nil, err return nil, err
@@ -189,6 +190,41 @@ func (n *Node) Close() {
} }
} }
// probeFilePath is where the last copy of a file sent by the probe is kept,
// so that after a hub restart the egress lines replayed by the probe are
// judged with its resolvers and container names before it sends them again.
func (n *Node) probeFilePath(name string) string {
return filepath.Join(n.Dir, "probe-"+name)
}
func (n *Node) loadProbeFiles() {
for _, f := range []struct {
name string
dst *atomic.Pointer[[]byte]
}{{wire.FileContainers, &n.containers}, {wire.FileResolv, &n.resolv}} {
b, err := os.ReadFile(n.probeFilePath(f.name))
if err != nil || len(b) > wire.MaxFileBytes {
continue
}
f.dst.Store(&b)
}
}
func (n *Node) saveProbeFile(name string, data []byte) {
p := n.probeFilePath(name)
if old, err := os.ReadFile(p); err == nil && string(old) == string(data) {
return
}
tmp := p + ".tmp"
if err := os.WriteFile(tmp, data, 0o600); err != nil {
n.sh.log.Warn("probe file not saved", "node", n.name, "file", name, "err", err)
return
}
if err := os.Rename(tmp, p); err != nil {
n.sh.log.Warn("probe file not saved", "node", n.name, "file", name, "err", err)
}
}
func (n *Node) buildEgress(eg hub.Egress) error { func (n *Node) buildEgress(eg hub.Egress) error {
eng, err := newEgressEngine(n.sh.c, n.St, eg, n.Primary) eng, err := newEgressEngine(n.sh.c, n.St, eg, n.Primary)
if err != nil { if err != nil {
@@ -263,6 +299,7 @@ func (n *Node) Apply(b wire.Batch) (int, int) {
default: default:
continue continue
} }
n.saveProbeFile(f.Name, data)
if e := n.egr.Load(); e != nil { if e := n.egr.Load(); e != nil {
if f.Name == wire.FileContainers { if f.Name == wire.FileContainers {
e.SetContainers(data) e.SetContainers(data)
+29
View File
@@ -0,0 +1,29 @@
package app
import (
"io"
"log/slog"
"testing"
"git.lucasrguerra.dev.br/ciberfauna/urutau/internal/wire"
)
// The files sent by a probe survive a hub restart: without them the egress
// lines the probe replays right after reconnecting were judged with the hub's
// own resolvers (a dns_bypass false positive on the probe's upstream resolver).
func TestProbeFilesSurviveRestart(t *testing.T) {
dir := t.TempDir()
sh := &shared{log: slog.New(slog.NewTextHandler(io.Discard, nil))}
n := &Node{name: "hostinger", Dir: dir, sh: sh}
n.saveProbeFile(wire.FileResolv, []byte("nameserver 153.92.2.6\n"))
n.saveProbeFile(wire.FileContainers, []byte("172.17.0.2 coolify-sentinel\n"))
n2 := &Node{name: "hostinger", Dir: dir, sh: sh}
n2.loadProbeFiles()
if b := n2.resolv.Load(); b == nil || string(*b) != "nameserver 153.92.2.6\n" {
t.Fatalf("resolv.conf not restored: %v", b)
}
if b := n2.containers.Load(); b == nil || string(*b) != "172.17.0.2 coolify-sentinel\n" {
t.Fatalf("containers.map not restored: %v", b)
}
}
+1 -1
View File
@@ -2,4 +2,4 @@ package app
// Version is the release version (SemVer). Release builds may override it with // Version is the release version (SemVer). Release builds may override it with
// -ldflags "-X .../internal/app.Version=...". // -ldflags "-X .../internal/app.Version=...".
var Version = "2.1.1" var Version = "2.1.2"
+2
View File
@@ -1929,6 +1929,8 @@
} }
// closes whichever filter popover is open (kept under this name: Esc and other pages call it) // closes whichever filter popover is open (kept under this name: Esc and other pages call it)
function closeRangePicker(refocus) { closePop(rp, refocus); closePop(hp, refocus); } function closeRangePicker(refocus) { closePop(rp, refocus); closePop(hp, refocus); }
// the phone sheet sits above the bottom tab bar: using the tab bar closes it
document.addEventListener('click', function (e) { if (e.target.closest && e.target.closest('.tabbar')) closeRangePicker(false); }, true);
function openRangePicker() { function openRangePicker() {
if (!rp.pop) return; if (!rp.pop) return;
rp.open = false; renderRangePicker(); rp.open = false; renderRangePicker();
+6 -5
View File
@@ -411,14 +411,14 @@ aside#detail li { overflow-wrap: anywhere; margin-bottom: 2px; }
.grid.kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s-3); } .grid.kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s-3); }
.stat { padding: var(--s-3); } .stat .v { font-size: 1.5rem; } .stat { padding: var(--s-3); } .stat .v { font-size: 1.5rem; }
.tabbar { .tabbar {
display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); position: fixed; left: 0; right: 0; bottom: 0; z-index: 34; /* above the sticky filter bar (.slice, 32) */
background: var(--rail); border-top: 1px solid var(--rail-line); padding: 4px 4px max(4px, env(safe-area-inset-bottom)); background: var(--rail); border-top: 1px solid var(--rail-line); padding: 4px 4px max(4px, env(safe-area-inset-bottom));
} }
.tab { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; min-height: 56px; border: 0; background: none; color: var(--rail-ink); text-decoration: none; font-size: .75rem; border-radius: var(--radius-sm); cursor: pointer; padding: 4px 2px; } .tab { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; min-height: 56px; border: 0; background: none; color: var(--rail-ink); text-decoration: none; font-size: .75rem; border-radius: var(--radius-sm); cursor: pointer; padding: 4px 2px; }
.tab .nav-ico svg { width: 22px; height: 22px; } .tab .nav-ico svg { width: 22px; height: 22px; }
.tab span:not(.nav-ico):not(.nav-badge) { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } .tab span:not(.nav-ico):not(.nav-badge) { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tab[aria-current="page"], .tab[aria-expanded="true"] { background: var(--rail-active); color: #fff; } .tab[aria-current="page"], .tab[aria-expanded="true"] { background: var(--rail-active); color: #fff; }
.more-sheet { position: fixed; left: 0; right: 0; bottom: 68px; z-index: 31; background: var(--surface-overlay); border-top: 1px solid var(--line-strong); border-radius: 14px 14px 0 0; padding: var(--s-3); box-shadow: var(--shadow); max-height: calc(100dvh - 68px - env(safe-area-inset-top, 0px) - 12px); overflow-y: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; } .more-sheet { position: fixed; left: 0; right: 0; bottom: 68px; z-index: 35; background: var(--surface-overlay); border-top: 1px solid var(--line-strong); border-radius: 14px 14px 0 0; padding: var(--s-3); box-shadow: var(--shadow); max-height: calc(100dvh - 68px - env(safe-area-inset-top, 0px) - 12px); overflow-y: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; }
.more-sheet:not([hidden]) { display: block; } .more-sheet:not([hidden]) { display: block; }
.more-sheet a { display: flex; align-items: center; gap: var(--s-3); min-height: 48px; padding: 8px var(--s-3); color: var(--ink); text-decoration: none; border-radius: var(--radius-sm); } .more-sheet a { display: flex; align-items: center; gap: var(--s-3); min-height: 48px; padding: 8px var(--s-3); color: var(--ink); text-decoration: none; border-radius: var(--radius-sm); }
.more-sheet a[aria-current="page"] { background: var(--accent-soft); } .more-sheet a[aria-current="page"] { background: var(--accent-soft); }
@@ -788,9 +788,10 @@ html, body { overflow-x: clip; }
.slice-ctl:has(#domain:not([hidden])) { flex-wrap: wrap; } .slice-ctl:has(#domain:not([hidden])) { flex-wrap: wrap; }
.fb-link { min-height: 44px; } .fb-link { min-height: 44px; }
.fb-copy span { display: none; } .fb-copy span { display: none; }
.fb-pop { position: fixed; left: 0; right: 0; bottom: 0; top: auto; width: auto; z-index: 61; border-radius: 16px 16px 0 0; border-bottom: 0; max-height: 88dvh; overflow-y: auto; overscroll-behavior: contain; /* the sheet opens just above the bottom tab bar (65 px + safe area), never over it */
padding: var(--s-3) var(--s-4) max(var(--s-4), env(safe-area-inset-bottom)); } .fb-pop { position: fixed; left: 0; right: 0; bottom: calc(65px + env(safe-area-inset-bottom, 0px)); top: auto; width: auto; z-index: 61; border-radius: 16px 16px 0 0; border-bottom: 0; max-height: calc(100dvh - 65px - env(safe-area-inset-bottom, 0px) - var(--topbar-h) - 8px); overflow-y: auto; overscroll-behavior: contain;
.fb-pop-host { width: auto; padding: var(--s-3) var(--s-4) max(var(--s-4), env(safe-area-inset-bottom)); gap: var(--s-2); } padding: var(--s-3) var(--s-4) var(--s-4); }
.fb-pop-host { width: auto; padding: var(--s-3) var(--s-4) var(--s-4); gap: var(--s-2); }
.fb-head { display: flex; align-items: center; justify-content: space-between; gap: var(--s-2); } .fb-head { display: flex; align-items: center; justify-content: space-between; gap: var(--s-2); }
.fb-head h2 { margin: 0; font: 700 1rem var(--font-display); color: var(--heading); } .fb-head h2 { margin: 0; font: 700 1rem var(--font-display); color: var(--heading); }
.fb-x { width: 44px; min-height: 44px; } .fb-x { width: 44px; min-height: 44px; }