mirror of
https://github.com/agessaman/MeshCore.git
synced 2026-07-10 20:21:38 +00:00
e85893c4db
Implement JWT-authenticated remote serial command execution over MQTT with comprehensive security measures: - JWT verification with Ed25519 signatures for command authentication - Nonce tracking for replay attack prevention - Rate limiting per public key - Command blacklist (get wifi.pwd, set mqtt.admin) - ACL-based authorization using existing admin list - Deferred command processing to avoid callback stack overflow - Memory-pressure degraded mode: auto-disable one analyzer server when heap drops below 60KB, with IATA-based geographic preference Also includes: - Git commit hash injection in version string via build script - Graceful settings migration for new preference fields - CLI commands: mqtt.remote, mqtt.useacl, mqtt.admin Co-authored-by: Cursor <cursoragent@cursor.com>
17 lines
469 B
Python
17 lines
469 B
Python
Import("env")
|
|
import subprocess
|
|
|
|
def get_git_hash():
|
|
try:
|
|
result = subprocess.run(
|
|
["git", "rev-parse", "--short", "HEAD"],
|
|
capture_output=True, text=True, check=True
|
|
)
|
|
return result.stdout.strip()
|
|
except (subprocess.CalledProcessError, FileNotFoundError):
|
|
return "unknown"
|
|
|
|
git_hash = get_git_hash()
|
|
env.Append(CPPDEFINES=[("GIT_COMMIT_HASH", f'\\"{git_hash}\\"')])
|
|
print(f"Git commit hash: {git_hash}")
|