Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/uat' into develop
Browse files Browse the repository at this point in the history
  • Loading branch information
petrjasek committed Mar 27, 2024
2 parents ca4db82 + 04a6811 commit 09d0445
Show file tree
Hide file tree
Showing 3 changed files with 39 additions and 22 deletions.
28 changes: 12 additions & 16 deletions server/requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -34,18 +34,16 @@ blinker==1.4
# raven
# sentry-sdk
# superdesk-core
boto3==1.34.43
boto3==1.34.52
# via superdesk-core
botocore==1.34.43
botocore==1.34.52
# via
# boto3
# s3transfer
cachelib==0.9.0
# via flask-caching
cachetools==5.3.2
# via
# flask-oidc-ex
# google-auth
cachetools==5.3.3
# via flask-oidc-ex
celery[redis]==5.2.7
# via
# celery
Expand Down Expand Up @@ -90,7 +88,7 @@ click-repl==0.3.0
# via celery
croniter==0.3.37
# via superdesk-core
cryptography==42.0.3
cryptography==42.0.5
# via
# authlib
# jwcrypto
Expand Down Expand Up @@ -158,7 +156,7 @@ flask-webpack==0.1.0
# via newsroom-core
flask-wtf==0.14.3
# via newsroom-core
future==0.18.3
future==1.0.0
# via python-twitter
google-auth==2.27.0
# via newsroom-core
Expand All @@ -178,7 +176,7 @@ icalendar==4.0.9
# via superdesk-planning
idna==3.6
# via requests
importlib-resources==6.1.1
importlib-resources==6.1.2
# via limits
isodate==0.6.1
# via python3-saml
Expand Down Expand Up @@ -207,7 +205,7 @@ kombu==5.2.4
# superdesk-core
ldap3==2.5.2
# via superdesk-core
limits==3.8.0
limits==3.9.0
# via flask-limiter
lxml==4.6.5
# via
Expand All @@ -225,7 +223,7 @@ mongolock==1.3.4
# via superdesk-core
natsort==8.4.0
# via croniter
newsroom-core @ git+https://github.com/superdesk/newsroom-core.git@develop
newsroom-core @ git+https://github.com/superdesk/newsroom-core.git@hotfix/2.5.1
# via -r requirements.in
oauth2client==4.1.3
# via flask-oidc-ex
Expand Down Expand Up @@ -278,7 +276,7 @@ pyparsing==3.1.1
# via
# httplib2
# pyrtf3
pypdf==4.0.1
pypdf==4.0.2
# via xhtml2pdf
pypng==0.20220715.0
# via qrcode
Expand Down Expand Up @@ -343,9 +341,7 @@ requests==2.31.0
requests-oauthlib==1.3.1
# via python-twitter
rsa==4.9
# via
# google-auth
# oauth2client
# via oauth2client
s3transfer==0.10.0
# via boto3
sentry-sdk[flask]==1.5.12
Expand Down Expand Up @@ -376,7 +372,7 @@ tinycss2==1.2.1
# via
# cssselect2
# svglib
typing-extensions==4.9.0
typing-extensions==4.10.0
# via
# jwcrypto
# limits
Expand Down
29 changes: 27 additions & 2 deletions server/settings.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,16 @@
import os
import pathlib

from flask_babel import lazy_gettext
from newsroom.types import AuthProviderType
from newsroom.web.default_settings import (
ELASTICSEARCH_SETTINGS,
CONTENTAPI_ELASTICSEARCH_SETTINGS,
BLUEPRINTS as DEFAULT_BLUEPRINT,
CORE_APPS as DEFAULT_CORE_APPS,
CELERY_BEAT_SCHEDULE as CELERY_BEAT_SCHEDULE_DEFAULT,
CLIENT_LOCALE_FORMATS,
AUTH_PROVIDERS,
)

SERVER_PATH = pathlib.Path(__file__).resolve().parent
Expand Down Expand Up @@ -96,6 +100,13 @@
},
]

WIRE_AGGS = {
"genre": {"terms": {"field": "genre.name", "size": 50}},
"_subject": {
"terms": {"field": "subject.name", "size": 50}
}, # it's needed for nested groups
}

CORE_APPS = [
app
for app in DEFAULT_CORE_APPS
Expand Down Expand Up @@ -174,12 +185,26 @@
"TIME_FORMAT": "H.mm",
"DATE_FORMAT": "D.M.YYYY",
"DATETIME_FORMAT": "H.mm D.M.YYYY",
"COVERAGE_DATE_FORMAT": "LL",
"COVERAGE_DATE_TIME_FORMAT": "HH.mm d.M.YYYY",
"COVERAGE_DATE_FORMAT": "D.M.YYYY",
"COVERAGE_DATE_TIME_FORMAT": "H.mm D.M.YYYY",

# server formats
"DATE_FORMAT_HEADER": "d.M.yyyy H.mm",
"NOTIFICATION_EMAIL_TIME_FORMAT": "H.mm",
"NOTIFICATION_EMAIL_DATE_FORMAT": "d.M.yyyy",
"NOTIFICATION_EMAIL_DATETIME_FORMAT": "d.M.yyyy klo H.mm",
}

ELASTICSEARCH_TRACK_TOTAL_HITS = (
int(os.environ["ELASTICSEARCH_TRACK_TOTAL_HITS"])
if os.environ.get("ELASTICSEARCH_TRACK_TOTAL_HITS")
else True
)

AUTH_PROVIDERS.append({
"_id": "azure",
"name": lazy_gettext("Azure"),
"auth_type": AuthProviderType.SAML.value,
})

CONTENTAPI_ELASTICSEARCH_SETTINGS["settings"]["analysis"]["analyzer"]["html_field_analyzer"]["filter"] = ["lowercase"]
4 changes: 0 additions & 4 deletions server/stt/filters.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,3 @@ def init_app(app):
app.config['SOURCES'][resource]['projection'].update({
field: 1,
})

app.config['WIRE_AGGS'].update({
field: {'terms': {'field': field, 'size': 50}},
})

0 comments on commit 09d0445

Please sign in to comment.