'networks to api.pwnagotchi.ai ' import os import logging import time import glob import pwnagotchi.grid as grid import pwnagotchi.utils as utils from pwnagotchi.ui.components import LabeledValue from pwnagotchi.ui.view import BLACK import pwnagotchi.ui.fonts as fonts from pwnagotchi.utils import WifiInfo, extract_from_pcap OPTIONS = dict() REPORT = utils.StatusFile('/root/.api-report.json', data_format='json') UNREAD_MESSAGES = 0 TOTAL_MESSAGES = 0 def on_loaded(): logging.info("grid plugin loaded.") def parse_pcap(filename): logging.info("grid: parsing %s ..." % filename) net_id = os.path.basename(filename).replace('.pcap', '') if '_' in net_id:
__author__ = '*****@*****.**' __version__ = '1.0.0' __name__ = 'api' __license__ = 'GPL3' __description__ = 'This plugin signals the unit cryptographic identity to api.pwnagotchi.ai' import os import logging import requests import glob import subprocess import pwnagotchi import pwnagotchi.utils as utils OPTIONS = dict() AUTH = utils.StatusFile('/root/.api-enrollment.json', data_format='json') REPORT = utils.StatusFile('/root/.api-report.json', data_format='json') def on_loaded(): logging.info("api plugin loaded.") def get_api_token(log, keys): global AUTH if AUTH.newer_then_minutes( 25) and AUTH.data is not None and 'token' in AUTH.data: return AUTH.data['token'] if AUTH.data is None: