change main.py, plugins.html and dev compose for test

*update args send to action.py and remove conditions
*remove condition on plugins template because didn't fit new logic
*higher bad behavior threshold for testing
This commit is contained in:
Jordan Blasenhauer 2024-03-06 14:25:00 +01:00
parent c558145582
commit 582cac654f
3 changed files with 8 additions and 11 deletions

View file

@ -1427,12 +1427,13 @@ def custom_plugin(plugin: str):
try:
# Try to get the custom plugin custom function and call it
method = getattr(actions, plugin)
if request.args:
res = method(app=app, args=request.args.to_dict())
elif request.is_json:
res = method(app=app, args=request.json)
else:
res = method(app=app)
queries = request.args.to_dict()
try:
data = request.json or False
except:
data = {}
res = method(app=app, args=queries, data=data)
except AttributeError:
message = f"The plugin does not have a method, see logs for more details"
except:

View file

@ -21,11 +21,6 @@
</p>
</div>
{% endfor %}
{% if plugins_count_pro > 0 and not is_pro_version %}
<p class="ml-2 mt-0 mb-2 mr-2 text-red-500 font-bold dark:brightness-95 text-sm">
You have pro plugins without active pro version.
</p>
{% endif %}
</div>
<!-- end info -->
<!-- upload layout -->

View file

@ -19,6 +19,7 @@ services:
USE_CLIENT_CACHE: "yes"
USE_GZIP: "yes"
DATASTORE_MEMORY_SIZE: "384m"
BAD_BEHAVIOR_THRESHOLD: "30"
UI_HOST: "http://bw-ui:7000"
labels:
- "bunkerweb.INSTANCE=yes"