Add upload call block list

This commit is contained in:
xss 2023-01-22 20:03:56 +11:00
parent 05b838e6de
commit 2b599e363d
2 changed files with 29 additions and 2 deletions

View File

@ -295,6 +295,10 @@ def telemetry_filter(telemetry):
if parse_sondemonitor_version(telemetry["software_version"]) < (6,2,8,4): if parse_sondemonitor_version(telemetry["software_version"]) < (6,2,8,4):
return (False,f"SondeMonitor version is out of date and doesn't handle DFM radiosondes correctly. Please update to 6.2.8.4 or later") return (False,f"SondeMonitor version is out of date and doesn't handle DFM radiosondes correctly. Please update to 6.2.8.4 or later")
# block callsigns
if telemetry["uploader_callsign"] in ["M00ON-5", "LEKUKU", "BS144"]:
return (False, "Something is wrong with the data your station is uploading, please contact us so we can resolve what is going on. support@sondehub.org")
if "dev" in telemetry: if "dev" in telemetry:
return (False, "All checks passed however payload contained dev flag so will not be uploaded to the database") return (False, "All checks passed however payload contained dev flag so will not be uploaded to the database")

View File

@ -3,7 +3,30 @@ import json
import base64 import base64
import gzip import gzip
import uuid import uuid
body = {"software_name": "SondeHubUploader", "software_version": "1.0.0", "uploader_callsign": "SIMON2-14", "uploader_position": [53.23764, 7.74426, 7.0], "uploader_antenna": "5/8-Wave-J-Pole", "time_received": "2023-01-20T22:48:43.208780Z", "datetime": "2023-01-20T22:48:41.000000Z", "manufacturer": "Vaisala", "type": "RS41", "serial": "U1440085", "frame": 1759, "lat": 53.706667, "lon": 7.146944, "alt": 1295.7, "vel_v": 5.5, "vel_h": 6.2, "heading": 222.0, "sats": 10, "batt": 2.9, "frequency": 404.1, "rssi": 70.9} body = [{
"dev":True,
"software_name": "SondeHubUploader",
"software_version": "1.0.0",
"uploader_callsign": "a",
"uploader_position": [53.23764, 7.74426, 7.0],
"uploader_antenna": "5/8-Wave-J-Pole",
"time_received": "2023-01-22T22:48:43.208780Z",
"datetime": "2023-01-22T22:48:41.000000Z",
"manufacturer": "Vaisala",
"type": "RS41",
"serial": "U1440085",
"frame": 1759,
"lat": 53.706667,
"lon": 7.146944,
"alt": 1295.7,
"vel_v": 5.5,
"vel_h": 6.2,
"heading": 222.0,
"sats": 10,
"batt": 2.9,
"frequency": 404.1,
"rssi": 70.9
}]
compressed = BytesIO() compressed = BytesIO()
with gzip.GzipFile(fileobj=compressed, mode='w') as f: with gzip.GzipFile(fileobj=compressed, mode='w') as f: