mirror of
https://github.com/TecharoHQ/anubis.git
synced 2026-04-23 00:26:42 +00:00
Compare commits
1 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 1f9dda9d42 |
@@ -13,12 +13,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|||||||
|
|
||||||
<!-- This changes the project to: -->
|
<!-- This changes the project to: -->
|
||||||
|
|
||||||
- Expose WEIGHT rule matches as Prometheus metrics.
|
|
||||||
- Allow more OCI registry clients [based on feedback](https://github.com/TecharoHQ/anubis/pull/1253#issuecomment-3506744184).
|
- Allow more OCI registry clients [based on feedback](https://github.com/TecharoHQ/anubis/pull/1253#issuecomment-3506744184).
|
||||||
- Expose services directory in the embedded `(data)` filesystem.
|
- Expose services directory in the embedded `(data)` filesystem.
|
||||||
- Add Ukrainian locale ([#1044](https://github.com/TecharoHQ/anubis/pull/1044)).
|
- Add Ukrainian locale ([#1044](https://github.com/TecharoHQ/anubis/pull/1044))
|
||||||
- Allow Renovate as an OCI registry client.
|
- Allow Renovate as an OCI registry client
|
||||||
- Properly handle 4in6 addresses so that IP matching works with those addresses.
|
|
||||||
|
|
||||||
## v1.23.1: Lyse Hext - Echo 1
|
## v1.23.1: Lyse Hext - Echo 1
|
||||||
|
|
||||||
|
|||||||
@@ -576,7 +576,6 @@ func (s *Server) check(r *http.Request, lg *slog.Logger) (policy.CheckResult, *p
|
|||||||
return cr("bot/"+b.Name, b.Action, weight), &b, nil
|
return cr("bot/"+b.Name, b.Action, weight), &b, nil
|
||||||
case config.RuleWeigh:
|
case config.RuleWeigh:
|
||||||
lg.Debug("adjusting weight", "name", b.Name, "delta", b.Weight.Adjust)
|
lg.Debug("adjusting weight", "name", b.Name, "delta", b.Weight.Adjust)
|
||||||
policy.Applications.WithLabelValues("bot/"+b.Name, "WEIGH").Add(1)
|
|
||||||
weight += b.Weight.Adjust
|
weight += b.Weight.Adjust
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -51,11 +51,6 @@ func (rac *RemoteAddrChecker) Check(r *http.Request) (bool, error) {
|
|||||||
return false, fmt.Errorf("%w: %s is not an IP address: %w", ErrMisconfiguration, host, err)
|
return false, fmt.Errorf("%w: %s is not an IP address: %w", ErrMisconfiguration, host, err)
|
||||||
}
|
}
|
||||||
|
|
||||||
// Convert IPv4-mapped IPv6 addresses to IPv4
|
|
||||||
if addr.Is6() && addr.Is4In6() {
|
|
||||||
addr = addr.Unmap()
|
|
||||||
}
|
|
||||||
|
|
||||||
return rac.prefixTable.Contains(addr), nil
|
return rac.prefixTable.Contains(addr), nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -21,20 +21,6 @@ func TestRemoteAddrChecker(t *testing.T) {
|
|||||||
ok: true,
|
ok: true,
|
||||||
err: nil,
|
err: nil,
|
||||||
},
|
},
|
||||||
{
|
|
||||||
name: "match_ipv4_in_ipv6",
|
|
||||||
cidrs: []string{"0.0.0.0/0"},
|
|
||||||
ip: "::ffff:1.1.1.1",
|
|
||||||
ok: true,
|
|
||||||
err: nil,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: "match_ipv4_in_ipv6_hex",
|
|
||||||
cidrs: []string{"0.0.0.0/0"},
|
|
||||||
ip: "::ffff:101:101",
|
|
||||||
ok: true,
|
|
||||||
err: nil,
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
name: "match_ipv6",
|
name: "match_ipv6",
|
||||||
cidrs: []string{"::/0"},
|
cidrs: []string{"::/0"},
|
||||||
|
|||||||
Executable → Regular
Reference in New Issue
Block a user