mirror of
https://github.com/TecharoHQ/anubis.git
synced 2026-04-16 21:34:59 +00:00
Compare commits
4 Commits
Xe/fix-doc
...
Xe/metrics
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
92baa1dcfb | ||
|
|
a5bb6d2751 | ||
|
|
1e298f5d0e | ||
|
|
a4770956a8 |
@@ -13,10 +13,12 @@ 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,6 +576,7 @@ 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,6 +51,11 @@ 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,6 +21,20 @@ 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"},
|
||||||
|
|||||||
0
run/openrc/anubis.initd
Normal file → Executable file
0
run/openrc/anubis.initd
Normal file → Executable file
Reference in New Issue
Block a user