AutoGPT is the vision of accessible AI for everyone, to use and to build on. Our mission is to provide the tools, so that you can focus on what matters.
Adding Allowlisted Plugins via env
riensenc5b81b5e10d8
diff --git a/.env.template b/.env.templateindex 855cb91ffd..b10e4799fa 100644--- a/.env.template+++ b/.env.template@@ -175,3 +175,10 @@ TW_CONSUMER_KEY=TW_CONSUMER_SECRET=TW_ACCESS_TOKEN=TW_ACCESS_TOKEN_SECRET=++################################################################################+### ALLOWLISTED PLUGINS+################################################################################++#ALLOWLISTED_PLUGINS - Sets the listed plugins that are allowed (Example: plugin1,plugin2,plugin3)+ALLOWLISTED_PLUGINS=\ No newline at end of filediff --git a/README.md b/README.mdindex ad6d199417..fb3b7df6ff 100644--- a/README.md+++ b/README.md@@ -264,7 +264,11 @@ Drop the repo's zipfile in the plugins folder.-If you add the plugins class name to the whitelist in the config.py you will not be prompted otherwise you'll be warned before loading the plugin.+If you add the plugins class name to the `ALLOWLISTED_PLUGINS` in the `.env` you will not be prompted otherwise you'll be warned before loading the plugin:++```+ALLOWLISTED_PLUGINS=example-plugin1,example-plugin2,example-plugin3+```## Setting Your Cache Typediff --git a/autogpt/config/config.py b/autogpt/config/config.pyindex af1bcf0db0..2fadcabaa0 100644--- a/autogpt/config/config.py+++ b/autogpt/config/config.py@@ -116,7 +116,13 @@ class Config(metaclass=Singleton):self.plugins_dir = os.getenv("PLUGINS_DIR", "plugins")self.plugins: List[AutoGPTPluginTemplate] = []self.plugins_openai = []- self.plugins_whitelist = []++ plugins_allowlist = os.getenv("ALLOWLISTED_PLUGINS")+ if plugins_allowlist:+ plugins_allowlist=plugins_allowlist.split(",")+ self.plugins_whitelist = plugins_allowlist+ else:+ self.plugins_whitelist = []self.plugins_blacklist = []def get_azure_deployment_id_for_model(self, model: str) -> str: