new: grid plugin now reports brain.json info
This commit is contained in:
parent
f153f15e9f
commit
078ab63249
@ -8,6 +8,7 @@ import os
|
|||||||
import logging
|
import logging
|
||||||
import requests
|
import requests
|
||||||
import glob
|
import glob
|
||||||
|
import json
|
||||||
import subprocess
|
import subprocess
|
||||||
import pwnagotchi
|
import pwnagotchi
|
||||||
import pwnagotchi.utils as utils
|
import pwnagotchi.utils as utils
|
||||||
@ -37,6 +38,13 @@ def get_api_token(last_session, keys):
|
|||||||
# sign the identity string to prove we own both keys
|
# sign the identity string to prove we own both keys
|
||||||
_, signature_b64 = keys.sign(identity)
|
_, signature_b64 = keys.sign(identity)
|
||||||
|
|
||||||
|
brain = {}
|
||||||
|
try:
|
||||||
|
with open('/root/brain.json') as fp:
|
||||||
|
brain = json.load(fp)
|
||||||
|
except:
|
||||||
|
pass
|
||||||
|
|
||||||
api_address = 'https://api.pwnagotchi.ai/api/v1/unit/enroll'
|
api_address = 'https://api.pwnagotchi.ai/api/v1/unit/enroll'
|
||||||
enrollment = {
|
enrollment = {
|
||||||
'identity': identity,
|
'identity': identity,
|
||||||
@ -53,7 +61,8 @@ def get_api_token(last_session, keys):
|
|||||||
'associated': last_session.associated,
|
'associated': last_session.associated,
|
||||||
'handshakes': last_session.handshakes,
|
'handshakes': last_session.handshakes,
|
||||||
'peers': last_session.peers,
|
'peers': last_session.peers,
|
||||||
'uname': subprocess.getoutput("uname -a")
|
'uname': subprocess.getoutput("uname -a"),
|
||||||
|
'brain': brain
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user