]> git.ipfire.org Git - thirdparty/knot-resolver.git/commitdiff
datamodel: management: warning that the unix-socket is not located in rundir
authorAleš Mrázek <ales.mrazek@nic.cz>
Fri, 28 Feb 2025 09:14:22 +0000 (10:14 +0100)
committerAleš Mrázek <ales.mrazek@nic.cz>
Fri, 28 Feb 2025 09:14:22 +0000 (10:14 +0100)
python/knot_resolver/datamodel/config_schema.py

index 410e94d7c9c3520d4f577d77d5ec319ed72f83b6..713c4a3e2c3210f69f4692b76d1e99bef6fee0de 100644 (file)
@@ -184,6 +184,14 @@ class KresConfig(ConfigSchema):
         return obj.dns64
 
     def _validate(self) -> None:
+        # warn about '/management/unix-socket' not located in '/rundir'
+        if self.management.unix_socket and self.management.unix_socket.to_path().parent != self.rundir.to_path():
+            logger.warning(
+                f"The management API unix-socket '{self.management.unix_socket}'"
+                f" is not located in the resolver's rundir '{self.rundir}'."
+                " This can lead to permissions issues."
+            )
+
         # enforce max-workers config
         workers_max = _workers_max_count()
         if int(self.workers) > workers_max: