From bed8442002559c4d462f194f3758d1a595983386 Mon Sep 17 00:00:00 2001 From: multiflexi Date: Tue, 3 Oct 2023 12:26:38 +0200 Subject: [PATCH 1/5] update dependencies for publishers --- docker/Dockerfile.publishers | 8 +++--- src/publishers/managers/auth_manager.py | 23 +++++++++++---- src/publishers/requirements.txt | 38 ++++++++----------------- 3 files changed, 34 insertions(+), 35 deletions(-) diff --git a/docker/Dockerfile.publishers b/docker/Dockerfile.publishers index 5ee5a7ead..c4f50e78c 100644 --- a/docker/Dockerfile.publishers +++ b/docker/Dockerfile.publishers @@ -1,4 +1,4 @@ -FROM python:3.9-alpine3.17 AS build_shared +FROM python:3.12-alpine3.18 AS build_shared WORKDIR /build_shared/ @@ -8,7 +8,7 @@ RUN python -m build -FROM python:3.9-alpine3.17 AS production +FROM python:3.12-alpine3.18 AS production WORKDIR /app/ @@ -25,9 +25,9 @@ RUN pip install --no-cache-dir ./custom_packages/taranis_ng_shared-*.whl && rm - COPY ./src/publishers/requirements.txt /app/requirements.txt RUN apk add --no-cache \ - swig\ + swig \ libmagic \ - gnupg + gnupg RUN \ apk add --no-cache --virtual .build-deps build-base \ diff --git a/src/publishers/managers/auth_manager.py b/src/publishers/managers/auth_manager.py index c7d94a288..05eebea42 100644 --- a/src/publishers/managers/auth_manager.py +++ b/src/publishers/managers/auth_manager.py @@ -1,11 +1,16 @@ +"""Authentication manager for the API. + +Returns: + _type_: _description_ +""" from functools import wraps from flask import request import os import ssl -api_key = os.getenv('API_KEY') +api_key = os.getenv("API_KEY") -if os.getenv('SSL_VERIFICATION') == "False": +if os.getenv("SSL_VERIFICATION") == "False": try: _create_unverified_https_context = ssl._create_unverified_context except AttributeError: @@ -15,11 +20,19 @@ def api_key_required(fn): + """Check if the API key is valid. + + Args: + fn (function): _description_ + + Returns: + _type_: _description_ + """ + @wraps(fn) def wrapper(*args, **kwargs): - - if not request.headers.has_key('Authorization') or request.headers['Authorization'] != ('Bearer ' + api_key): - return {'error': 'not authorized'}, 401 + if "Authorization" not in request.headers or request.headers["Authorization"] != ("Bearer " + api_key): + return {"error": "not authorized"}, 401 else: return fn(*args, **kwargs) diff --git a/src/publishers/requirements.txt b/src/publishers/requirements.txt index 74fbb9ec9..a2b70805e 100644 --- a/src/publishers/requirements.txt +++ b/src/publishers/requirements.txt @@ -1,29 +1,15 @@ -certifi==2023.5.7 envelope==2.0.2 -Flask==1.1.4 -Flask-Cors==3.0.10 -Flask-RESTful==0.3.7 -gevent==21.8.0 -greenlet==1.1.1 -gunicorn==20.0.4 -httplib2==0.22.0 -idna==2.9 -marshmallow==3.18.0 +Flask==3.0.0 +Flask-Cors==4.0.0 +Flask-RESTful==0.3.10 +gevent==23.9.1 +gunicorn==21.2.0 +marshmallow==3.20.1 marshmallow-enum==1.5.1 oauth2client==4.1.3 -Jinja2==2.11.3 -M2Crypto==0.38.0 -MarkupSafe==1.1.0 -paramiko==3.2.0 -python-dateutil==2.8.1 -python-dotenv==0.10.3 -pytz==2019.3 -requests==2.26.0 -schedule==0.6.0 -six==1.13.0 -tweepy==3.10.0 -urllib3==1.26.7 -Werkzeug==0.16.0 -zope.event==4.4 -zope.interface==5.1.0 -pymisp==2.4.128 \ No newline at end of file +paramiko==3.3.1 +python-dotenv==1.0.0 +requests==2.31.0 +tweepy==4.14.0 +urllib3==2.0.6 +pymisp==2.4.128 From 2b85d7fa817fc9eeb546e4e1b7cc9f70c2f9d5a0 Mon Sep 17 00:00:00 2001 From: multiflexi Date: Tue, 3 Oct 2023 12:27:37 +0200 Subject: [PATCH 2/5] update docker readme with Compose V2 --- docker/README.md | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/docker/README.md b/docker/README.md index 571783ca0..18cbeabe4 100644 --- a/docker/README.md +++ b/docker/README.md @@ -37,13 +37,15 @@ entrypoint, and the [gunicorn](https://gunicorn.org/) configuration file. ## Prerequisites - [Docker](https://docs.docker.com/engine/install/) -- [docker-compose](https://docs.docker.com/compose/install/) >= 1.27.0 +- [docker-compose](https://docs.docker.com/compose/install/) >= 1.27.0 (In July 2023, Compose V1 has been deprecated) +or +- [Compose V2](https://docs.docker.com/compose/migrate/), which is part of standard installation of Docker Engine - (Optional) [Vim](https://www.vim.org/) or other text editor - for configuration and development Please note it is important to use the abovementioned version of `docker-compose` or newer, otherwise the build and deploy will fail. -## Quickly build and run Taranis NG using `docker-compose` +## Quickly build and run Taranis NG using `docker-compose` or `docker compose` _First_, you need to clone the source code repository: @@ -66,12 +68,21 @@ _Finally_, either deploy the ready-made images from Docker hub with: docker-compose -f docker/docker-compose.yml pull docker-compose -f docker/docker-compose.yml up --no-build ``` +or +```bash +docker compose -f docker/docker-compose.yml pull +docker compose -f docker/docker-compose.yml up --no-build +``` or, alternatively, build and run the containers with: ```bash TARANIS_NG_TAG=build docker-compose -f docker/docker-compose.yml up --build --pull ``` +or +```bash +TARANIS_NG_TAG=build docker compose -f docker/docker-compose.yml up --build --pull +``` (`--pull` updates the base images) **Voila, Taranis NG is up and running. Visit your instance by navigating to From 490d874a374c6bfc7f40697c6e7db6336fc4aed2 Mon Sep 17 00:00:00 2001 From: multiflexi Date: Tue, 3 Oct 2023 21:02:34 +0200 Subject: [PATCH 3/5] update dependencies for presenters --- docker/Dockerfile.presenters | 54 +--- src/presenters/managers/auth_manager.py | 22 +- src/presenters/presenters/pdf_presenter.py | 97 +++---- src/presenters/requirements.txt | 25 +- src/presenters/templates/images/taranis.svg | 18 ++ .../templates/pdf_body_template.html | 239 --------------- .../templates/pdf_footer_template.html | 32 --- .../templates/pdf_header_template.html | 22 -- src/presenters/templates/pdf_template.html | 272 ++++++++++++++++++ 9 files changed, 370 insertions(+), 411 deletions(-) create mode 100644 src/presenters/templates/images/taranis.svg delete mode 100644 src/presenters/templates/pdf_body_template.html delete mode 100644 src/presenters/templates/pdf_footer_template.html delete mode 100644 src/presenters/templates/pdf_header_template.html create mode 100644 src/presenters/templates/pdf_template.html diff --git a/docker/Dockerfile.presenters b/docker/Dockerfile.presenters index 8f1b61026..27737392e 100644 --- a/docker/Dockerfile.presenters +++ b/docker/Dockerfile.presenters @@ -1,4 +1,4 @@ -FROM python:3.7-alpine3.14 AS build_shared +FROM python:3.12-alpine3.18 AS build_shared WORKDIR /build_shared/ @@ -8,7 +8,7 @@ RUN python -m build -FROM python:3.7-alpine3.14 AS production +FROM python:3.12-alpine3.18 AS production WORKDIR /app/ @@ -20,59 +20,15 @@ RUN \ apk add --no-cache \ libpng \ libjpeg \ - wkhtmltopdf + py3-gobject3 \ + pango # install fonts RUN \ apk add --no-cache \ msttcorefonts-installer \ fontconfig \ - font-noto \ - font-noto-adlam \ - font-noto-adlamunjoined \ - font-noto-arabic \ - font-noto-armenian \ - font-noto-avestan \ - font-noto-bamum \ - font-noto-bengali \ - font-noto-buhid \ - font-noto-carian \ - font-noto-chakma \ - font-noto-cherokee \ - font-noto-cypriot \ - font-noto-deseret \ - font-noto-devanagari \ - font-noto-ethiopic \ - font-noto-extra \ - font-noto-georgian \ - font-noto-glagolitic \ - font-noto-gothic \ - font-noto-gujarati \ - font-noto-gurmukhi \ - font-noto-hebrew \ - font-noto-kannada \ - font-noto-kayahli \ - font-noto-khmer \ - font-noto-lao \ - font-noto-lisu \ - font-noto-malayalam \ - font-noto-mandaic \ - font-noto-myanmar \ - font-noto-nko \ - font-noto-olchiki \ - font-noto-oldturkic \ - font-noto-oriya \ - font-noto-osage \ - font-noto-osmanya \ - font-noto-shavian \ - font-noto-sinhala \ - font-noto-tamil \ - font-noto-telugu \ - font-noto-thaana \ - font-noto-thai \ - font-noto-tibetan \ - font-noto-tifinagh \ - font-noto-vai \ + font-noto-all \ terminus-font \ ttf-opensans \ font-bakoma \ diff --git a/src/presenters/managers/auth_manager.py b/src/presenters/managers/auth_manager.py index c7d94a288..693900e91 100644 --- a/src/presenters/managers/auth_manager.py +++ b/src/presenters/managers/auth_manager.py @@ -1,11 +1,16 @@ +"""Authentication manager for the API. + +Returns: + _type_: _description_ +""" from functools import wraps from flask import request import os import ssl -api_key = os.getenv('API_KEY') +api_key = os.getenv("API_KEY") -if os.getenv('SSL_VERIFICATION') == "False": +if os.getenv("SSL_VERIFICATION") == "False": try: _create_unverified_https_context = ssl._create_unverified_context except AttributeError: @@ -15,11 +20,18 @@ def api_key_required(fn): + """Check if the API key is valid. + + Args: + fn (function): _description_ + Returns: + _type_: _description_ + """ + @wraps(fn) def wrapper(*args, **kwargs): - - if not request.headers.has_key('Authorization') or request.headers['Authorization'] != ('Bearer ' + api_key): - return {'error': 'not authorized'}, 401 + if "Authorization" not in request.headers or request.headers["Authorization"] != ("Bearer " + api_key): + return {"error": "not authorized"}, 401 else: return fn(*args, **kwargs) diff --git a/src/presenters/presenters/pdf_presenter.py b/src/presenters/presenters/pdf_presenter.py index 260340da6..fdad204a1 100644 --- a/src/presenters/presenters/pdf_presenter.py +++ b/src/presenters/presenters/pdf_presenter.py @@ -1,96 +1,97 @@ +"""PDF Presenter. + +Returns: + dict: mime type and base64 encoded data of the generated PDF document +""" import datetime import os import tempfile from base64 import b64encode import jinja2 -import pdfkit +from weasyprint import HTML from .base_presenter import BasePresenter from shared.schema.parameter import Parameter, ParameterType class PDFPresenter(BasePresenter): + """PDF Presenter class. + + Args: + BasePresenter (class): Base presenter class + """ + type = "PDF_PRESENTER" name = "PDF Presenter" description = "Presenter for generating PDF documents" - parameters = [ - Parameter(0, "HEADER_TEMPLATE_PATH", "Header template path", "Path of header template file", - ParameterType.STRING), - Parameter(0, "BODY_TEMPLATE_PATH", "Body template path", "Path of body template file", - ParameterType.STRING), - Parameter(0, "FOOTER_TEMPLATE_PATH", "Footer template path", "Path of footer template file", - ParameterType.STRING) - ] + parameters = [Parameter(0, "PDF_TEMPLATE_PATH", "Template path", "Path of header template file", ParameterType.STRING)] parameters.extend(BasePresenter.parameters) def generate(self, presenter_input): + """Generate PDF document. + + Args: + presenter_input (_type_): Parameters from settings + Returns: + dict: mime type and base64 encoded data of the generated PDF document + """ try: temporary_directory = tempfile.gettempdir() + "/" - output_body_html = temporary_directory + 'pdf_body.html' - output_pdf = temporary_directory + 'pdf_report__' + datetime.datetime.now().strftime( - "%d-%m-%Y_%H:%M") + '.pdf' + output_html = temporary_directory + "pdf_body.html" + output_pdf = temporary_directory + "pdf_report__" + datetime.datetime.now().strftime("%d-%m-%Y_%H:%M") + ".pdf" - pdf_header_template = presenter_input.parameter_values_map['HEADER_TEMPLATE_PATH'] - pdf_footer_template = presenter_input.parameter_values_map['FOOTER_TEMPLATE_PATH'] - head, tail = os.path.split(presenter_input.parameter_values_map['BODY_TEMPLATE_PATH']) + head, tail = os.path.split(presenter_input.parameter_values_map["PDF_TEMPLATE_PATH"]) input_data = BasePresenter.generate_input_data(presenter_input) env = jinja2.Environment(loader=jinja2.FileSystemLoader(head)) env.filters["strfdate"] = BasePresenter._filter_datetime - body = env.get_template(tail) - output_text = body.render(data=input_data) - with open(output_body_html, 'w') as output_file: + pdf = env.get_template(tail) + output_text = pdf.render(data=input_data) + with open(output_html, "w") as output_file: output_file.write(output_text) if not os.path.exists(temporary_directory): os.mkdir(temporary_directory) - options = { - 'dpi': 500, - 'page-size': 'A4', - 'margin-top': '1.55in', - 'margin-right': '0.75in', - 'margin-bottom': '1.55in', - 'margin-left': '0.75in', - 'encoding': "UTF-8", - 'header-html': pdf_header_template, - 'footer-html': pdf_footer_template, - 'custom-header': [ - ('Accept-Encoding', 'gzip') - ], - 'no-outline': None, - 'enable-local-file-access': None - } - - pdfkit.from_file(input=output_body_html, output_path=output_pdf, options=options) - - encoding = 'UTF-8' + # options = { + # 'dpi': 500, + # 'page-size': 'A4', + # 'margin-top': '1.55in', + # 'margin-right': '0.75in', + # 'margin-bottom': '1.55in', + # 'margin-left': '0.75in', + # 'encoding': "UTF-8", + # 'header-html': pdf_header_template, + # 'footer-html': pdf_footer_template, + # 'custom-header': [ + # ('Accept-Encoding', 'gzip') + # ], + # 'no-outline': None, + # 'enable-local-file-access': None + # } + HTML(output_html).write_pdf(output_pdf) + + encoding = "UTF-8" file = output_pdf - with open(file, 'rb') as open_file: + with open(file, "rb") as open_file: byte_content = open_file.read() base64_bytes = b64encode(byte_content) data = base64_bytes.decode(encoding) - presenter_output = { - 'mime_type': 'application/pdf', - 'data': data - } + presenter_output = {"mime_type": "application/pdf", "data": data} - os.remove(output_body_html) + os.remove(output_html) os.remove(file) return presenter_output except Exception as error: BasePresenter.print_exception(self, error) - presenter_output = { - 'mime_type': 'text/plain', - 'data': b64encode(("TEMPLATING ERROR\n"+str(error)).encode()).decode('UTF-8') - } + presenter_output = {"mime_type": "text/plain", "data": b64encode(("TEMPLATING ERROR\n" + str(error)).encode()).decode("UTF-8")} return presenter_output diff --git a/src/presenters/requirements.txt b/src/presenters/requirements.txt index 7d4b125d3..bebd77dd8 100644 --- a/src/presenters/requirements.txt +++ b/src/presenters/requirements.txt @@ -1,17 +1,10 @@ -Flask==1.1.4 -Flask-Cors==3.0.10 -Flask-RESTful==0.3.7 -gevent==21.8.0 -greenlet==1.1.1 -gunicorn==20.0.4 -Jinja2==2.11.3 -MarkupSafe==1.1.0 -marshmallow==3.18.0 +Flask==3.0.0 +Flask-Cors==4.0.0 +Flask-RESTful==0.3.10 +gevent==23.9.1 +gunicorn==21.2.0 +Jinja2==3.1.2 +marshmallow==3.20.1 marshmallow-enum==1.5.1 -pdfkit==0.6.1 -PyJWT==1.7.1 -python-dotenv==0.10.5 -pytz==2019.3 -PyYAML==6.0.1 -six==1.14.0 -Werkzeug==0.16.0 +python-dotenv==1.0.0 +weasyprint==60.1 diff --git a/src/presenters/templates/images/taranis.svg b/src/presenters/templates/images/taranis.svg new file mode 100644 index 000000000..4833b8767 --- /dev/null +++ b/src/presenters/templates/images/taranis.svg @@ -0,0 +1,18 @@ + diff --git a/src/presenters/templates/pdf_body_template.html b/src/presenters/templates/pdf_body_template.html deleted file mode 100644 index 888292da2..000000000 --- a/src/presenters/templates/pdf_body_template.html +++ /dev/null @@ -1,239 +0,0 @@ - - - - - - - - - - - -
- - {% for report_item in data.report_items %} - - - - - - - - - - - - - - - - - - - -
CONFIDENTIALITY, DISTRIBUTION, SEVERITY
-
Confidentiality
-
-
- -
-
-
- -
-
-
- -
-
-
- -
-
-
- -
-
-
TLP
-
- {% if report_item.attrs.tlp == 'CLEAR' or report_item.attrs.tlp == 'WHITE' %} - TLP:CLEAR - {% endif %} - {% if report_item.attrs.tlp == 'GREEN' %} - TLP:GREEN - {% endif %} - {% if report_item.attrs.tlp == 'AMBER' %} - TLP:AMBER - {% endif %} - {% if report_item.attrs.tlp == 'AMBER+STRICT' %} - TLP:AMBER+STRICT - {% endif %} - {% if report_item.attrs.tlp == 'RED' %} - TLP:RED - {% endif %} -
-
CVSS vector
-
-
{{ report_item.attrs.cvss|e }}
-
- -
- - - - - - - - -
DESCRIPTION
- {{ report_item.attrs.description|e }} -
- - - - - - - - -
PUBLISHED
- {{ report_item.attrs.exposure_date }} -
- - - - - - - - -
UPDATED
- {{ report_item.attrs.update_date }} -
- - - - - - - - -
CVE
- {% if report_item.attrs.cve %} - {% for i in report_item.attrs.cve %} -
{{ i|e }}
- {% endfor %} - {% endif %} -
- - - - - - - - -
IMPACT
- {% if report_item.attrs.impact %} - {% for i in report_item.attrs.impact %} -
{{ i|e }}
- {% endfor %} - {% endif %} -
- - - - - - - - -
IOC
- {% if report_item.attrs.ioc %} - {% for i in report_item.attrs.ioc %} -
{{ i|e }}
- {% endfor %} - {% endif %} -
- - - - - - - - -
AFFECTED SYSTEMS
- {% if report_item.attrs.affected_systems %} - {% for i in report_item.attrs.affected_systems %} -
{{ i|e }}
- {% endfor %} - {% endif %} -
- - - - - - - - -
RECOMMENDATIONS
- {{ report_item.attrs.recommendations }} -
- - - - - - - - -
LINKS
-
    - {% if report_item.attrs.links %} - {% for i in report_item.attrs.links %} -
    {{ i|e }}
    - {% endfor %} - {% endif %} -
-
- {% endfor %} -
- - diff --git a/src/presenters/templates/pdf_footer_template.html b/src/presenters/templates/pdf_footer_template.html deleted file mode 100644 index b2a8997e5..000000000 --- a/src/presenters/templates/pdf_footer_template.html +++ /dev/null @@ -1,32 +0,0 @@ - - - - - - - - - -
-
- - - - - - - - - - - - - - - - -
-
- - - diff --git a/src/presenters/templates/pdf_header_template.html b/src/presenters/templates/pdf_header_template.html deleted file mode 100644 index 76c3109bd..000000000 --- a/src/presenters/templates/pdf_header_template.html +++ /dev/null @@ -1,22 +0,0 @@ - - - - - - - - - -
- - - - - - -
VULNERABILITY REPORTNo: SW1234-ER/2
-
-
- - - diff --git a/src/presenters/templates/pdf_template.html b/src/presenters/templates/pdf_template.html new file mode 100644 index 000000000..7ece10ac0 --- /dev/null +++ b/src/presenters/templates/pdf_template.html @@ -0,0 +1,272 @@ + + + + + + + + + + + +
+ + + + + + +
VULNERABILITY REPORTNo: SW1234-ER/2
+
+
+ {# Taranis SVG #} + +
+ + {% for report_item in data.report_items %} + + + + + + + + + + + + + + + + + + + + + +
+ CONFIDENTIALITY, DISTRIBUTION, SEVERITY
+
Confidentiality
+
+
+ +
+
+
+ +
+
+
+ +
+
+
+ +
+
+
+ +
+
+
TLP
+
+ {% if report_item.attrs.tlp == 'CLEAR' or report_item.attrs.tlp == 'WHITE' %} + TLP:CLEAR + {% endif %} + {% if report_item.attrs.tlp == 'GREEN' %} + TLP:GREEN + {% endif %} + {% if report_item.attrs.tlp == 'AMBER' %} + TLP:AMBER + {% endif %} + {% if report_item.attrs.tlp == 'AMBER+STRICT' %} + TLP:AMBER+STRICT + {% endif %} + {% if report_item.attrs.tlp == 'RED' %} + TLP:RED + {% endif %} +
+
CVSS vector
+
+
{{ report_item.attrs.cvss|e }}
+
+ +
+ + + + + + + + +
DESCRIPTION
+ {{ report_item.attrs.description|e }} +
+ + + + + + + + +
PUBLISHED
+ {{ report_item.attrs.exposure_date }} +
+ + + + + + + + +
UPDATED
+ {{ report_item.attrs.update_date }} +
+ + + + + + + + +
CVE
+ {% if report_item.attrs.cve %} + {% for i in report_item.attrs.cve %} +
{{ i|e }}
+ {% endfor %} + {% endif %} +
+ + + + + + + + +
IMPACT
+ {% if report_item.attrs.impact %} + {% for i in report_item.attrs.impact %} +
{{ i|e }}
+ {% endfor %} + {% endif %} +
+ + + + + + + + +
IOC
+ {% if report_item.attrs.ioc %} + {% for i in report_item.attrs.ioc %} +
{{ i|e }}
+ {% endfor %} + {% endif %} +
+ + + + + + + + +
AFFECTED SYSTEMS
+ {% if report_item.attrs.affected_systems %} + {% for i in report_item.attrs.affected_systems %} +
{{ i|e }}
+ {% endfor %} + {% endif %} +
+ + + + + + + + +
RECOMMENDATIONS
+ {{ report_item.attrs.recommendations }} +
+ + + + + + + + +
LINKS
+
    + {% if report_item.attrs.links %} + {% for i in report_item.attrs.links %} +
    {{ i|e }}
    + {% endfor %} + {% endif %} +
+
+ {% endfor %} +
+
+
+ + + + + + + + + + + + + + + + +
+
+ + + From d9ee34cfe5ade2803049251b13d187172be7760c Mon Sep 17 00:00:00 2001 From: multiflexi Date: Thu, 5 Oct 2023 11:36:02 +0200 Subject: [PATCH 4/5] update dependencies for collectors --- docker/Dockerfile.collectors | 4 +-- src/collectors/requirements.txt | 46 +++++++++++++-------------------- 2 files changed, 20 insertions(+), 30 deletions(-) diff --git a/docker/Dockerfile.collectors b/docker/Dockerfile.collectors index a77621c42..76eca2d6d 100644 --- a/docker/Dockerfile.collectors +++ b/docker/Dockerfile.collectors @@ -1,4 +1,4 @@ -FROM python:3.7-alpine3.14 AS build_shared +FROM python:3.12-alpine3.18 AS build_shared WORKDIR /build_shared/ @@ -8,7 +8,7 @@ RUN python -m build -FROM python:3.7-alpine3.14 AS production +FROM python:3.11-alpine3.18 AS production WORKDIR /app/ diff --git a/src/collectors/requirements.txt b/src/collectors/requirements.txt index 4352be63b..4e274f626 100644 --- a/src/collectors/requirements.txt +++ b/src/collectors/requirements.txt @@ -1,30 +1,20 @@ -beautifulsoup4==4.8.1 -bleach==4.1.0 -certifi==2021.10.8 -feedparser==5.2.1 -Flask==1.1.4 -Flask-Cors==3.0.10 -Flask-RESTful==0.3.7 -gevent==21.8.0 -greenlet==1.1.1 -gunicorn==20.0.4 -lxml==4.6.5 -marshmallow==3.18.0 +aiohttp==3.8.5 +beautifulsoup4==4.12.2 +bleach==6.0.0 +dateparser==1.1.8 +feedparser==6.0.10 +Flask==3.0.0 +Flask-Cors==4.0.0 +Flask-RESTful==0.3.10 +gevent==23.9.1 +gunicorn==21.2.0 +marshmallow==3.20.1 marshmallow-enum==1.5.1 -Jinja2==2.11.3 -MarkupSafe==1.1.0 -pyslack==0.5.0 PySocks==1.7.1 -python-dateutil==2.8.1 -python-dotenv==0.10.5 -pytz==2019.3 -requests==2.26.0 -schedule==0.6.0 -selenium==4.0.0 -six==1.14.0 -slackclient==1.0.7 -soupsieve==1.9.5 -tweepy==3.8.0 -Werkzeug==0.16.0 -zipp==3.1.0 -dateparser==1.1.1 +python-dateutil==2.8.2 +python-dotenv==1.0.0 +requests==2.31.0 +schedule==1.2.1 +selenium==4.13.0 +slackclient==1.3.2 +tweepy==4.14.0 From 31f92e9271c938a086c46dcbbb20832070813721 Mon Sep 17 00:00:00 2001 From: multiflexi Date: Thu, 5 Oct 2023 11:36:49 +0200 Subject: [PATCH 5/5] update dependencies for bots --- docker/Dockerfile.bots | 4 ++-- src/bots/requirements.txt | 35 +++++++++++------------------------ 2 files changed, 13 insertions(+), 26 deletions(-) diff --git a/docker/Dockerfile.bots b/docker/Dockerfile.bots index fc2ec693c..a989a105c 100644 --- a/docker/Dockerfile.bots +++ b/docker/Dockerfile.bots @@ -1,4 +1,4 @@ -FROM python:3.7-alpine3.14 AS build_shared +FROM python:3.12-alpine3.18 AS build_shared WORKDIR /build_shared/ @@ -8,7 +8,7 @@ RUN python -m build -FROM python:3.7-alpine3.14 AS production +FROM python:3.12-alpine3.18 AS production WORKDIR /app/ diff --git a/src/bots/requirements.txt b/src/bots/requirements.txt index 4139b7a7e..bc21d0327 100644 --- a/src/bots/requirements.txt +++ b/src/bots/requirements.txt @@ -1,26 +1,13 @@ -certifi==2019.11.28 -Flask==1.1.4 -Flask-Cors==3.0.10 -Flask-RESTful==0.3.7 -gevent==21.8.0 -greenlet==1.1.1 -gunicorn==20.0.4 -idna==2.8 -marshmallow==3.18.0 +Flask==3.0.0 +Flask-Cors==4.0.0 +Flask-RESTful==0.3.10 +gevent==23.9.1 +gunicorn==21.2.0 +marshmallow==3.20.1 marshmallow-enum==1.5.1 -Jinja2==2.11.3 -MarkupSafe==1.1.0 -oauthlib==3.1.0 +oauthlib==3.2.2 PySocks==1.7.1 -python-dateutil==2.8.1 -python-dotenv==0.10.5 -pytz==2019.3 -requests==2.26.0 -requests-oauthlib==1.3.0 -schedule==0.6.0 -six==1.14.0 -sseclient-py==1.7 -tweepy==3.8.0 -urllib3==1.26.7 -Werkzeug==0.16.0 -zipp==3.1.0 +python-dotenv==1.0.0 +requests==2.31.0 +schedule==1.2.1 +sseclient-py==1.8.0