mirror of
https://github.com/juanfont/headscale.git
synced 2026-11-19 11:57:07 +09:00
hscontrol: log refused registrations
The client only retries, so the log is the operator's one sign.
This commit is contained in:
1 parent
7a3d2e88fe
commit
2765031898
1 file changed
+10
@@ -1060,6 +1060,16 @@ func (ns *noiseServer) RegistrationHandler(
|
||||
|
||||
resp, err := ns.headscale.handleRegister(req.Context(), registerRequest, ns.machineKey)
|
||||
if err != nil {
|
||||
// The client only retries, so this is the operator's one sign of a refused node.
|
||||
e := log.Warn().Err(err).
|
||||
Str(zf.MachineKey, ns.machineKey.ShortString()).
|
||||
Str(zf.NodeKey, registerRequest.NodeKey.ShortString())
|
||||
if registerRequest.Hostinfo != nil {
|
||||
e = e.Str(zf.Hostname, registerRequest.Hostinfo.Hostname)
|
||||
}
|
||||
|
||||
e.Msg("registration refused")
|
||||
|
||||
if httpErr, ok := errors.AsType[HTTPError](err); ok {
|
||||
// Keep permanent errors in HTTP 200 so controlclient surfaces RegisterResponse.Error.
|
||||
if httpErr.Code == http.StatusServiceUnavailable {
|
||||
|
||||
Reference in new issue
Block a user