diff --git a/sdcard/rootfs/root/pwnagotchi/config.yml b/sdcard/rootfs/root/pwnagotchi/config.yml index 28f2770..5d786c5 100644 --- a/sdcard/rootfs/root/pwnagotchi/config.yml +++ b/sdcard/rootfs/root/pwnagotchi/config.yml @@ -3,7 +3,11 @@ main: # currently implemented: en (default), de, nl, it lang: en # custom plugins path, if null only default plugins with be loaded - plugins: null + custom_plugins: + # which plugins to load and enable + plugins: + - gps + - twitter # monitor interface to use iface: mon0 # command to run to bring the mon interface up in case it's not up already @@ -15,7 +19,9 @@ main: # if true, will not restart the wifi module no_restart: false # access points to ignore - whitelist: [] + whitelist: + - EXAMPLE_NETWORK + - ANOTHER_EXAMPLE_NETWORK # if not null, filter access points by this regular expression filter: null # cryptographic key for identity diff --git a/sdcard/rootfs/root/pwnagotchi/scripts/main.py b/sdcard/rootfs/root/pwnagotchi/scripts/main.py index cba98d5..ac5bacd 100755 --- a/sdcard/rootfs/root/pwnagotchi/scripts/main.py +++ b/sdcard/rootfs/root/pwnagotchi/scripts/main.py @@ -1,5 +1,4 @@ #!/usr/bin/python3 -import os import argparse import time import logging @@ -33,9 +32,9 @@ args = parser.parse_args() config = utils.load_config(args) utils.setup_logging(args, config) -plugins.load_from_path(plugins.default_path) -if 'plugins' in config['main'] and config['main']['plugins'] is not None: - plugins.load_from_path(config['main']['plugins']) +plugins.load_from_path(plugins.default_path, enabled=config['main']['plugins']) +if 'custom_plugins' in config['main'] and config['main']['custom_plugins'] is not None: + plugins.load_from_path(config['main']['custom_plugins'], enabled=config['main']['plugins']) plugins.on('loaded') diff --git a/sdcard/rootfs/root/pwnagotchi/scripts/pwnagotchi/plugins/__init__.py b/sdcard/rootfs/root/pwnagotchi/scripts/pwnagotchi/plugins/__init__.py index bcb89f8..89afe10 100644 --- a/sdcard/rootfs/root/pwnagotchi/scripts/pwnagotchi/plugins/__init__.py +++ b/sdcard/rootfs/root/pwnagotchi/scripts/pwnagotchi/plugins/__init__.py @@ -27,14 +27,13 @@ def load_from_file(filename): return plugin_name, instance -def load_from_path(path): +def load_from_path(path, enabled=()): global loaded - for filename in glob.glob(os.path.join(path, "*.py")): name, plugin = load_from_file(filename) if name in loaded: raise Exception("plugin %s already loaded from %s" % (name, plugin.__file__)) - elif not plugin.__enabled__: + elif name not in enabled: # print("plugin %s is not enabled" % name) pass else: diff --git a/sdcard/rootfs/root/pwnagotchi/scripts/pwnagotchi/plugins/default/example.py b/sdcard/rootfs/root/pwnagotchi/scripts/pwnagotchi/plugins/default/example.py index 4166e4a..b425d6e 100644 --- a/sdcard/rootfs/root/pwnagotchi/scripts/pwnagotchi/plugins/default/example.py +++ b/sdcard/rootfs/root/pwnagotchi/scripts/pwnagotchi/plugins/default/example.py @@ -3,7 +3,6 @@ __version__ = '1.0.0' __name__ = 'hello_world' __license__ = 'GPL3' __description__ = 'An example plugin for pwnagotchi that implements all the available callbacks.' -__enabled__ = False # IMPORTANT: set this to True to enable your plugin. import logging diff --git a/sdcard/rootfs/root/pwnagotchi/scripts/pwnagotchi/plugins/default/gps.py b/sdcard/rootfs/root/pwnagotchi/scripts/pwnagotchi/plugins/default/gps.py index cd292ea..f7aa56e 100644 --- a/sdcard/rootfs/root/pwnagotchi/scripts/pwnagotchi/plugins/default/gps.py +++ b/sdcard/rootfs/root/pwnagotchi/scripts/pwnagotchi/plugins/default/gps.py @@ -3,7 +3,6 @@ __version__ = '1.0.0' __name__ = 'gps' __license__ = 'GPL3' __description__ = 'Save GPS coordinates whenever an handshake is captured.' -__enabled__ = True # set to false if you just don't use GPS import logging import json diff --git a/sdcard/rootfs/root/pwnagotchi/scripts/pwnagotchi/plugins/default/memtemp.py b/sdcard/rootfs/root/pwnagotchi/scripts/pwnagotchi/plugins/default/memtemp.py index 2b1fc3d..4ef823b 100644 --- a/sdcard/rootfs/root/pwnagotchi/scripts/pwnagotchi/plugins/default/memtemp.py +++ b/sdcard/rootfs/root/pwnagotchi/scripts/pwnagotchi/plugins/default/memtemp.py @@ -7,7 +7,6 @@ __version__ = '1.0.0' __name__ = 'memtemp' __license__ = 'GPL3' __description__ = 'A plugin that will add a memory and temperature indicator' -__enabled__ = False import struct diff --git a/sdcard/rootfs/root/pwnagotchi/scripts/pwnagotchi/plugins/default/twitter.py b/sdcard/rootfs/root/pwnagotchi/scripts/pwnagotchi/plugins/default/twitter.py index 0c7d8d9..03aa251 100644 --- a/sdcard/rootfs/root/pwnagotchi/scripts/pwnagotchi/plugins/default/twitter.py +++ b/sdcard/rootfs/root/pwnagotchi/scripts/pwnagotchi/plugins/default/twitter.py @@ -3,7 +3,6 @@ __version__ = '1.0.0' __name__ = 'twitter' __license__ = 'GPL3' __description__ = 'This plugin creates tweets about the recent activity of pwnagotchi' -__enabled__ = True import logging from pwnagotchi.voice import Voice diff --git a/sdcard/rootfs/root/pwnagotchi/scripts/pwnagotchi/plugins/default/ups_lite.py b/sdcard/rootfs/root/pwnagotchi/scripts/pwnagotchi/plugins/default/ups_lite.py index 7ddcecd..d9a37d2 100644 --- a/sdcard/rootfs/root/pwnagotchi/scripts/pwnagotchi/plugins/default/ups_lite.py +++ b/sdcard/rootfs/root/pwnagotchi/scripts/pwnagotchi/plugins/default/ups_lite.py @@ -12,7 +12,6 @@ __version__ = '1.0.0' __name__ = 'ups_lite' __license__ = 'GPL3' __description__ = 'A plugin that will add a voltage indicator for the UPS Lite v1.1' -__enabled__ = False import struct