mirror of
https://github.com/SpudGunMan/meshing-around.git
synced 2026-05-01 11:02:17 +02:00
enhance
This commit is contained in:
14
README.md
14
README.md
@@ -99,9 +99,17 @@ enabled = False
|
||||
[general]
|
||||
DadJokes = False
|
||||
StoreForward = False
|
||||
|
||||
# detect and report the closest to the bot
|
||||
SentryEnabled = False
|
||||
```
|
||||
Sentry Bot detects anyone comeing close to the bot-node
|
||||
```
|
||||
# detect anyone close to the bot
|
||||
SentryEnabled = True
|
||||
# holdoff time multiplied by minutes(20) of the watchdog
|
||||
SentryChannel = 9
|
||||
# channel to send a message to when the watchdog is triggered
|
||||
SentryHoldoff = 2
|
||||
# list of ignored nodes numbers ex: 2813308004,4258675309
|
||||
sentryIgnoreList =
|
||||
```
|
||||
The BBS has admin and block lists; see the [config.template](config.template)
|
||||
|
||||
|
||||
@@ -43,6 +43,8 @@ URL_TIMEOUT = 10
|
||||
LogMessagesToFile = False
|
||||
# detect anyone close to the bot
|
||||
SentryEnabled = True
|
||||
# radius in meters to detect someone close to the bot
|
||||
SentryRadius = 100
|
||||
# holdoff time multiplied by minutes(20) of the watchdog
|
||||
SentryChannel = 9
|
||||
# channel to send a message to when the watchdog is triggered
|
||||
|
||||
@@ -22,7 +22,6 @@ max_retry_count1 = 4 # max retry count for interface 1
|
||||
max_retry_count2 = 4 # max retry count for interface 2
|
||||
retry_int1 = False
|
||||
retry_int2 = False
|
||||
radius = 100 # radius for sentry alerts in meters
|
||||
|
||||
# Read the config file, if it does not exist, create basic config file
|
||||
config = configparser.ConfigParser()
|
||||
@@ -80,6 +79,7 @@ try:
|
||||
secure_channel = config['general'].getint('SentryChannel', 2) # default 2
|
||||
sentry_holdoff = config['general'].getint('SentryHoldoff', 9) # default 9
|
||||
sentryIgnoreList = config['general'].get('sentryIgnoreList', '').split(',')
|
||||
sentry_radius = config['general'].getint('SentryRadius', 100) # default 100 meters
|
||||
config['general'].get('motd', MOTD)
|
||||
urlTimeoutSeconds = config['general'].getint('URL_TIMEOUT', 10) # default 10 seconds
|
||||
forecastDuration = config['general'].getint('NOAAforecastDuration', 4) # NOAA forcast days
|
||||
|
||||
@@ -307,7 +307,7 @@ def get_closest_nodes(nodeInt=1,returnCount=3):
|
||||
# set radius around BOT position
|
||||
distance = round(geopy.distance.geodesic((latitudeValue, longitudeValue), (latitude, longitude)).m, 2)
|
||||
|
||||
if (distance < radius):
|
||||
if (distance < sentry_radius):
|
||||
if nodeID != myNodeNum1 and myNodeNum2 and str(nodeID) not in sentryIgnoreList:
|
||||
node_list.append({'id': nodeID, 'latitude': latitude, 'longitude': longitude, 'distance': distance})
|
||||
# calculate distance to node and report
|
||||
@@ -342,7 +342,7 @@ def get_closest_nodes(nodeInt=1,returnCount=3):
|
||||
# set radius around BOT position
|
||||
distance = geopy.distance.geodesic((latitudeValue, longitudeValue), (latitude, longitude)).m
|
||||
|
||||
if (distance < radius):
|
||||
if (distance < sentry_radius):
|
||||
if nodeID != myNodeNum1 and myNodeNum2 and str(nodeID) not in sentryIgnoreList:
|
||||
node_list.append({'id': nodeID, 'latitude': latitude, 'longitude': longitude, 'distance': distance})
|
||||
# calculate distance to node and report
|
||||
|
||||
Reference in New Issue
Block a user