From b9fda0d654175d9fbb1a7e0153020848a2d61447 Mon Sep 17 00:00:00 2001 From: Mark Veidemanis Date: Thu, 21 Jul 2022 13:49:38 +0100 Subject: [PATCH] Add more settings to example config --- app/local_settings.example.py | 6 +++++- core/lib/opensearch.py | 7 +------ core/ui/views/drilldown.py | 2 -- 3 files changed, 6 insertions(+), 9 deletions(-) diff --git a/app/local_settings.example.py b/app/local_settings.example.py index 713fd6e..a73bffd 100644 --- a/app/local_settings.example.py +++ b/app/local_settings.example.py @@ -8,7 +8,9 @@ OPENSEARCH_PASSWORD = "hunter2" OPENSEARCH_INDEX_MAIN = "main" OPENSEARCH_INDEX_META = "meta" -OPENSEARCH_MAIN_SEARCH_FIELDS = ["msg"] +OPENSEARCH_MAIN_SEARCH_FIELDS = ["msg", "nick", "host", "ident"] +OPENSEARCH_MAIN_SIZES = ["5", "10", "15", "20", "50", "100", "200"] +OPENSEARCH_MAIN_TIMESCALES = ["minute", "hour", "day", "week", "month", "6months"] OPENSEARCH_BLACKLISTED = { "msg": ["example.com"], @@ -32,3 +34,5 @@ STRIPE_PUBLIC_API_KEY_TEST = "pk_test_xxx" STRIPE_API_KEY_PROD = "sk_prod_xxx" STRIPE_PUBLIC_API_KEY_PROD = "pk_prod_xxx" + +STRIPE_ENDPOINT_SECRET = "" diff --git a/core/lib/opensearch.py b/core/lib/opensearch.py index 85c11e1..95ee575 100644 --- a/core/lib/opensearch.py +++ b/core/lib/opensearch.py @@ -1,10 +1,6 @@ -import pprint - from django.conf import settings from opensearchpy import OpenSearch -pp = pprint.PrettyPrinter(indent=4) - def initialise_opensearch(): auth = (settings.OPENSEARCH_USERNAME, settings.OPENSEARCH_PASSWORD) @@ -62,9 +58,8 @@ def construct_query(query, fields, size): def filter_blacklisted(user, response): - pp.pprint(response["hits"]["hits"]) - print("LEN", len(response["hits"]["hits"])) response["redacted"] = 0 + response["exemption"] = None # For every hit from ES for item in list(response["hits"]["hits"]): # For every blacklisted type diff --git a/core/ui/views/drilldown.py b/core/ui/views/drilldown.py index ca46b6b..b0d4144 100644 --- a/core/ui/views/drilldown.py +++ b/core/ui/views/drilldown.py @@ -35,8 +35,6 @@ class Drilldown(LoginRequiredMixin, View): size = request.POST["size"] if "query" in request.POST: query = request.POST["query"] - # field = results.POST["field"] - # print("FIELD ", field) results = run_main_query(client, request.user, query, fields, size) if not results: return render(request, "denied.html")