diff --git a/config-example.yml b/config-example.yml index fb72cb6..c5b751a 100644 --- a/config-example.yml +++ b/config-example.yml @@ -59,14 +59,22 @@ spot-providers: enabled: true host: "hrd.wa9pie.net" port: 8000 + # Prompt the cluster node gives when asking for a callsign to log in. Varies between cluster node software. login_prompt: "login: " + # Callsign Spothole will use to log into this cluster. Ensure the SSID (e.g. -99) is different to any personal + # connection you might make to this cluster node. + login_callsign: "N0CALL-99" - class: "DXCluster" name: "W3LPL Cluster" enabled: false host: "w3lpl.net" port: 7373 + # Prompt the cluster node gives when asking for a callsign to log in. Varies between cluster node software. login_prompt: "Please enter your call: " + # Callsign Spothole will use to log into this cluster. Ensure the SSID (e.g. -99) is different to any personal + # connection you might make to this cluster node. + login_callsign: "N0CALL-99" - class: "RBN" name: "RBN CW/RTTY" diff --git a/spotproviders/dxcluster.py b/spotproviders/dxcluster.py index 173829c..cf41983 100644 --- a/spotproviders/dxcluster.py +++ b/spotproviders/dxcluster.py @@ -7,12 +7,11 @@ from time import sleep import pytz import telnetlib3 -from core.config import SERVER_OWNER_CALLSIGN from data.spot import Spot from spotproviders.spot_provider import SpotProvider -# Spot provider for a DX Cluster. Hostname port and login_prompt provided as parameters. +# Spot provider for a DX Cluster. Hostname, port, login_prompt and login_callsign are provided in config. class DXCluster(SpotProvider): # Note the callsign pattern deliberately excludes calls ending in "-#", which are from RBN and can be enabled by # default on some clusters. If you want RBN spots, there is a separate provider for that. @@ -28,6 +27,7 @@ class DXCluster(SpotProvider): self.hostname = provider_config["host"] self.port = provider_config["port"] self.login_prompt = provider_config["login_prompt"] + self.login_callsign = provider_config["login_callsign"] self.telnet = None self.thread = Thread(target=self.handle) self.thread.daemon = True @@ -50,7 +50,7 @@ class DXCluster(SpotProvider): logging.info("DX Cluster " + self.hostname + " connecting...") self.telnet = telnetlib3.Telnet(self.hostname, self.port) self.telnet.read_until(self.login_prompt.encode("latin-1")) - self.telnet.write((SERVER_OWNER_CALLSIGN + "\n").encode("latin-1")) + self.telnet.write((self.login_callsign + "\n").encode("latin-1")) connected = True logging.info("DX Cluster " + self.hostname + " connected.") except Exception as e: