mirror of
https://github.com/projecthorus/sondehub-infra.git
synced 2025-01-31 07:55:24 +00:00
block changeme callsigns
This commit is contained in:
parent
2a56b3810a
commit
b291a74993
@ -4,6 +4,7 @@ import base64
|
||||
import datetime
|
||||
from email.utils import parsedate
|
||||
|
||||
CALLSIGN_BLOCK_LIST = ["CHANGEME_RDZTTGO"]
|
||||
|
||||
import es
|
||||
|
||||
@ -48,6 +49,8 @@ def lambda_handler(event, context):
|
||||
payload["uploader_position"][2],
|
||||
f"{payload['uploader_position'][0]},{payload['uploader_position'][1]}",
|
||||
)
|
||||
if payload["uploader_callsign"] in CALLSIGN_BLOCK_LIST:
|
||||
return {"statusCode": 403, "body": "callsign blocked or invalid"}
|
||||
index = datetime.datetime.utcnow().strftime("listeners-%Y-%m")
|
||||
payload["ts"] = datetime.datetime.utcnow().isoformat()
|
||||
|
||||
|
@ -36,7 +36,7 @@ payload = {
|
||||
"timeEpoch": 1612051825409,
|
||||
},
|
||||
"body": """
|
||||
{"software_name": "radiosonde_auto_rx", "software_version": "1.5.8-beta2", "uploader_callsign": "LZ3DJ-18", "uploader_position": [null,null,null], "uploader_antenna": "Dipole", "uploader_contact_email": "none@none.com", "mobile": false}
|
||||
{"software_name": "radiosonde_auto_rx", "software_version": "1.5.8-beta2", "uploader_callsign": "CHANGEME_RDZTTGO", "uploader_position": [null,null,null], "uploader_antenna": "Dipole", "uploader_contact_email": "none@none.com", "mobile": false}
|
||||
""",
|
||||
"isBase64Encoded": False,
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user