File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 22import signal
33import socket
44import threading
5+ import hashlib
56
67from werkzeug .serving import run_simple
78from werkzeug .debug import DebuggedApplication
@@ -46,7 +47,10 @@ def __init__(
4647
4748 def _register_zeroconf (self ):
4849 if self .labthing :
49- print (f"Registering zeroconf { self .labthing .safe_title } ._labthing._tcp.local." )
50+ host = f"{ self .labthing .safe_title } ._labthing._tcp.local."
51+ if len (host ) > 63 :
52+ host = f"{ hashlib .sha1 (host .encode ()).hexdigest ()} ._labthing._tcp.local."
53+ print (f"Registering zeroconf { host } " )
5054 # Get list of host addresses
5155 mdns_addresses = {
5256 socket .inet_aton (i )
@@ -57,7 +61,7 @@ def _register_zeroconf(self):
5761 self .service_infos .append (
5862 ServiceInfo (
5963 "_labthing._tcp.local." ,
60- f" { self . labthing . safe_title } ._labthing._tcp.local." ,
64+ host ,
6165 port = self .port ,
6266 properties = {
6367 "path" : self .labthing .url_prefix ,
You can’t perform that action at this time.
0 commit comments