mirror of https://github.com/craigerl/aprsd.git
Added config for enable_seen_list
This patch allows the admin to disable the callsign seen list packet tracking feature.
This commit is contained in:
parent
29d97d9f0c
commit
c43652dbea
|
@ -19,6 +19,7 @@ from aprsd import cli_helper, client, packets, plugin, threads
|
||||||
from aprsd.main import cli
|
from aprsd.main import cli
|
||||||
from aprsd.packets import collector as packet_collector
|
from aprsd.packets import collector as packet_collector
|
||||||
from aprsd.packets import log as packet_log
|
from aprsd.packets import log as packet_log
|
||||||
|
from aprsd.packets import seen_list
|
||||||
from aprsd.stats import collector
|
from aprsd.stats import collector
|
||||||
from aprsd.threads import keep_alive, rx
|
from aprsd.threads import keep_alive, rx
|
||||||
from aprsd.threads import stats as stats_thread
|
from aprsd.threads import stats as stats_thread
|
||||||
|
@ -195,6 +196,10 @@ def listen(
|
||||||
keepalive = keep_alive.KeepAliveThread()
|
keepalive = keep_alive.KeepAliveThread()
|
||||||
# keepalive.start()
|
# keepalive.start()
|
||||||
|
|
||||||
|
if not CONF.enable_seen_list:
|
||||||
|
# just deregister the class from the packet collector
|
||||||
|
packet_collector.PacketCollector().unregister(seen_list.SeenList)
|
||||||
|
|
||||||
pm = None
|
pm = None
|
||||||
pm = plugin.PluginManager()
|
pm = plugin.PluginManager()
|
||||||
if load_plugins:
|
if load_plugins:
|
||||||
|
|
|
@ -10,6 +10,8 @@ from aprsd import cli_helper, client
|
||||||
from aprsd import main as aprsd_main
|
from aprsd import main as aprsd_main
|
||||||
from aprsd import packets, plugin, threads, utils
|
from aprsd import packets, plugin, threads, utils
|
||||||
from aprsd.main import cli
|
from aprsd.main import cli
|
||||||
|
from aprsd.packets import collector as packet_collector
|
||||||
|
from aprsd.packets import seen_list
|
||||||
from aprsd.threads import keep_alive, log_monitor, registry, rx
|
from aprsd.threads import keep_alive, log_monitor, registry, rx
|
||||||
from aprsd.threads import stats as stats_thread
|
from aprsd.threads import stats as stats_thread
|
||||||
from aprsd.threads import tx
|
from aprsd.threads import tx
|
||||||
|
@ -108,6 +110,10 @@ def server(ctx, flush):
|
||||||
keepalive = keep_alive.KeepAliveThread()
|
keepalive = keep_alive.KeepAliveThread()
|
||||||
keepalive.start()
|
keepalive.start()
|
||||||
|
|
||||||
|
if not CONF.enable_seen_list:
|
||||||
|
# just deregister the class from the packet collector
|
||||||
|
packet_collector.PacketCollector().unregister(seen_list.SeenList)
|
||||||
|
|
||||||
stats_store_thread = stats_thread.APRSDStatsStoreThread()
|
stats_store_thread = stats_thread.APRSDStatsStoreThread()
|
||||||
stats_store_thread.start()
|
stats_store_thread.start()
|
||||||
|
|
||||||
|
|
|
@ -125,6 +125,12 @@ aprsd_opts = [
|
||||||
default=20,
|
default=20,
|
||||||
help="The maximum number of packets to send in the stats dict for admin ui.",
|
help="The maximum number of packets to send in the stats dict for admin ui.",
|
||||||
),
|
),
|
||||||
|
cfg.BoolOpt(
|
||||||
|
"enable_seen_list",
|
||||||
|
default=True,
|
||||||
|
help="Enable the Callsign seen list tracking feature. This allows aprsd to keep track of "
|
||||||
|
"callsigns that have been seen and when they were last seen.",
|
||||||
|
),
|
||||||
]
|
]
|
||||||
|
|
||||||
watch_list_opts = [
|
watch_list_opts = [
|
||||||
|
|
|
@ -29,6 +29,9 @@ class PacketCollector:
|
||||||
def register(self, monitor: Callable) -> None:
|
def register(self, monitor: Callable) -> None:
|
||||||
self.monitors.append(monitor)
|
self.monitors.append(monitor)
|
||||||
|
|
||||||
|
def unregister(self, monitor: Callable) -> None:
|
||||||
|
self.monitors.remove(monitor)
|
||||||
|
|
||||||
def rx(self, packet: type[core.Packet]) -> None:
|
def rx(self, packet: type[core.Packet]) -> None:
|
||||||
for name in self.monitors:
|
for name in self.monitors:
|
||||||
cls = name()
|
cls = name()
|
||||||
|
|
Loading…
Reference in New Issue