fix: 1.4.7 default unban log path
Release / Plan (reuse the published image?) (push) Successful in 4s
Release / Gitea release (push) Successful in 5s
Release / Publish tags (push) Successful in 19s
CI / Format and vet (push) Successful in 33s
CI / Tests (Linux, race detector) (push) Successful in 37s
CI / Dependency audit (push) Successful in 37s
Release / ci (push) Successful in 1m10s
Release / Build image (amd64) (push) Successful in 23s
Release / Build image (arm64) (push) Successful in 1m20s
CI / Docker image (build and smoke test) (push) Skipped
Release / Plan (reuse the published image?) (push) Successful in 4s
Release / Gitea release (push) Successful in 5s
Release / Publish tags (push) Successful in 19s
CI / Format and vet (push) Successful in 33s
CI / Tests (Linux, race detector) (push) Successful in 37s
CI / Dependency audit (push) Successful in 37s
Release / ci (push) Successful in 1m10s
Release / Build image (amd64) (push) Successful in 23s
Release / Build image (arm64) (push) Successful in 1m20s
CI / Docker image (build and smoke test) (push) Skipped
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
da333d70f1
commit
873219416f
5 files changed
+36
-2
No files matched your search
@@ -6,6 +6,13 @@ Format based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/); versio
|
||||
|
||||
## [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
|
||||
|
||||
### Added
|
||||
|
||||
@@ -6,6 +6,13 @@ Formato baseado no [Keep a Changelog](https://keepachangelog.com/pt-BR/1.1.0/);
|
||||
|
||||
## [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
|
||||
|
||||
### 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{
|
||||
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"),
|
||||
Trusted: trusted, PeerHosts: hosts, InfraHosts: hosts, Resolve: resolveHost,
|
||||
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
|
||||
}
|
||||
|
||||
// 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")
|
||||
}
|
||||
}
|
||||
|
||||
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
|
||||
// -ldflags "-X .../internal/app.Version=...".
|
||||
var Version = "1.4.6"
|
||||
var Version = "1.4.7"
|
||||
Reference in new issue
Block a user