Add more settings to example config

This commit is contained in:
Mark Veidemanis 2022-07-21 13:49:38 +01:00
parent 4df8afef1c
commit b9fda0d654
Signed by: m
GPG Key ID: 5ACFCEED46C0904F
3 changed files with 6 additions and 9 deletions

View File

@ -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 = ""

View File

@ -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

View File

@ -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")