Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
873219416f |
No files matched your search
@@ -6,6 +6,13 @@ Format based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/); versio
|
|||||||
|
|
||||||
## [Unreleased]
|
## [Unreleased]
|
||||||
|
|
||||||
|
## [1.4.7] - 2026-11-15
|
||||||
|
|
||||||
|
### Fixed
|
||||||
|
|
||||||
|
- The unban file now defaults to `unban.log` next to `--enforce-log` (the default was lost, so the Unban button reported the file as not writable).
|
||||||
|
- Second firewall: the 24 h rules also count from the persistent day counters, so they work when the event registry does not cover the whole day (after a reset or upgrade).
|
||||||
|
|
||||||
## [1.4.6] - 2026-11-15
|
## [1.4.6] - 2026-11-15
|
||||||
|
|
||||||
### Added
|
### Added
|
||||||
|
|||||||
@@ -6,6 +6,13 @@ Formato baseado no [Keep a Changelog](https://keepachangelog.com/pt-BR/1.1.0/);
|
|||||||
|
|
||||||
## [Unreleased]
|
## [Unreleased]
|
||||||
|
|
||||||
|
## [1.4.7] - 2026-11-15
|
||||||
|
|
||||||
|
### Corrigido
|
||||||
|
|
||||||
|
- O arquivo de desban agora tem como padrão `unban.log` ao lado de `--enforce-log` (o padrão se perdia, e o botão Desbanir dizia que o arquivo não era gravável).
|
||||||
|
- Segundo firewall: as regras de 24 h também contam pelos contadores diários persistentes, então funcionam quando o registro de eventos não cobre o dia inteiro (após um reset ou atualização).
|
||||||
|
|
||||||
## [1.4.6] - 2026-11-15
|
## [1.4.6] - 2026-11-15
|
||||||
|
|
||||||
### Adicionado
|
### Adicionado
|
||||||
|
|||||||
+12
-1
@@ -35,7 +35,7 @@ func newEnforce(c Config, st *store.Store, peers []fed.Peer, en enricher, ready
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
e := enforce.New(enforce.Config{
|
e := enforce.New(enforce.Config{
|
||||||
Mode: mode, Path: c.EnforceLog, UnbanPath: c.EnforceUnbanLog, StatePath: filepath.Join(c.DataDir, "enforce.json"), Host: c.Name,
|
Mode: mode, Path: c.EnforceLog, UnbanPath: unbanLogPath(c), StatePath: filepath.Join(c.DataDir, "enforce.json"), Host: c.Name,
|
||||||
Threshold: c.EnforceThreshold, MaxPerMin: c.EnforceMaxPerMin, Share: strings.EqualFold(c.EnforceShare, "on"),
|
Threshold: c.EnforceThreshold, MaxPerMin: c.EnforceMaxPerMin, Share: strings.EqualFold(c.EnforceShare, "on"),
|
||||||
Trusted: trusted, PeerHosts: hosts, InfraHosts: hosts, Resolve: resolveHost,
|
Trusted: trusted, PeerHosts: hosts, InfraHosts: hosts, Resolve: resolveHost,
|
||||||
Crawler: func(ip string, uas []string) bool { v := st.FCrDNS(ip, uas); return v != nil && *v },
|
Crawler: func(ip string, uas []string) bool { v := st.FCrDNS(ip, uas); return v != nil && *v },
|
||||||
@@ -192,3 +192,14 @@ func cloudflareClients(path string) (cf, total int) {
|
|||||||
}
|
}
|
||||||
return cf, total
|
return cf, total
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// unbanLogPath is --enforce-unban-log, or unban.log next to --enforce-log.
|
||||||
|
func unbanLogPath(c Config) string {
|
||||||
|
if c.EnforceUnbanLog != "" {
|
||||||
|
return c.EnforceUnbanLog
|
||||||
|
}
|
||||||
|
if c.EnforceLog == "" {
|
||||||
|
return ""
|
||||||
|
}
|
||||||
|
return filepath.Join(filepath.Dir(c.EnforceLog), "unban.log")
|
||||||
|
}
|
||||||
@@ -279,3 +279,12 @@ func TestSourceDegradedWindow(t *testing.T) {
|
|||||||
t.Fatal("window must recover")
|
t.Fatal("window must recover")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func TestUnbanLogPathDefault(t *testing.T) {
|
||||||
|
if got := unbanLogPath(Config{EnforceLog: "/logs/enforce/decisions.log"}); got != "/logs/enforce/unban.log" {
|
||||||
|
t.Fatalf("default unban log = %q", got)
|
||||||
|
}
|
||||||
|
if got := unbanLogPath(Config{EnforceLog: "/a/d.log", EnforceUnbanLog: "/b/u.log"}); got != "/b/u.log" {
|
||||||
|
t.Fatalf("explicit unban log = %q", got)
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -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 = "1.4.6"
|
var Version = "1.4.7"
|
||||||
Reference in new issue
Block a user