From ab5243b402ef3372a27f11f9f5e776ea14b6633c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tobias=20Alm=C3=A9n?= <78877636+almenscorner@users.noreply.github.com> Date: Mon, 3 Jun 2024 10:29:43 +0200 Subject: [PATCH 1/6] Bump version to 2.1.2 --- app/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/__init__.py b/app/__init__.py index c476367..97b6198 100644 --- a/app/__init__.py +++ b/app/__init__.py @@ -20,7 +20,7 @@ task_track_started=True, ), ) -app.config["APP_VERSION"] = "2.1.0" +app.config["APP_VERSION"] = "2.1.2" app.config["APISPEC_SWAGGER_UI_URL"] = "/apidocs" app.config["APISPEC_TITLE"] = "IntuneCD Monitor API Docs" From 913eb764d20613a85db026325ebbee7f2ea1aca3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tobias=20Alm=C3=A9n?= <78877636+almenscorner@users.noreply.github.com> Date: Thu, 5 Sep 2024 08:11:27 +0200 Subject: [PATCH 2/6] bump intunecd version --- requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements.txt b/requirements.txt index e8f9b46..e7705f8 100644 --- a/requirements.txt +++ b/requirements.txt @@ -28,7 +28,7 @@ Werkzeug==3.0.1 wsproto==1.2.0 python-dateutil==2.9.0.post0 azure-storage-blob==12.19.0 -IntuneCD==2.3.3 +IntuneCD==2.3.6 flask-migrate==4.0.7 gitpython==3.1.42 azure-identity==1.15.0 From 773783273bd72b70b26707d9264a8beafcc7fe59 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tobias=20Alm=C3=A9n?= <78877636+almenscorner@users.noreply.github.com> Date: Thu, 5 Sep 2024 08:11:46 +0200 Subject: [PATCH 3/6] bump version --- app/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/__init__.py b/app/__init__.py index 97b6198..0b9da61 100644 --- a/app/__init__.py +++ b/app/__init__.py @@ -20,7 +20,7 @@ task_track_started=True, ), ) -app.config["APP_VERSION"] = "2.1.2" +app.config["APP_VERSION"] = "2.1.3" app.config["APISPEC_SWAGGER_UI_URL"] = "/apidocs" app.config["APISPEC_TITLE"] = "IntuneCD Monitor API Docs" From 40c8a9420480afdf47d55d1d5193b3233cafebd0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tobias=20Alm=C3=A9n?= <78877636+almenscorner@users.noreply.github.com> Date: Thu, 5 Sep 2024 08:14:28 +0200 Subject: [PATCH 4/6] bump msal version --- requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements.txt b/requirements.txt index e7705f8..6e951b2 100644 --- a/requirements.txt +++ b/requirements.txt @@ -17,7 +17,7 @@ h11==0.14.0 idna==3.6 Jinja2==3.1.3 MarkupSafe==2.1.5 -msal==1.27.0 +msal==1.30.0 pycparser==2.21 PyJWT==2.8.0 requests==2.31.0 From fafc5db42ca55e4b1f7be189a2c8511f0ff727f5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tobias=20Alm=C3=A9n?= <78877636+almenscorner@users.noreply.github.com> Date: Thu, 5 Sep 2024 12:42:50 +0200 Subject: [PATCH 5/6] change timeout for backup run --- app/run_intunecd.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/run_intunecd.py b/app/run_intunecd.py index ca9fb74..6e0b7df 100644 --- a/app/run_intunecd.py +++ b/app/run_intunecd.py @@ -319,7 +319,7 @@ def run_intunecd_update(TENANT_ID) -> dict: } -@shared_task(time_limit=3600, soft_time_limit=3000) +@shared_task(time_limit=7200, soft_time_limit=6600) def run_intunecd_backup(TENANT_ID, NEW_BRANCH=None) -> dict: """Runs the IntuneCD-startbackup command for the specified tenant. From e9b199ad2c6018dea40042ff6ee53a57bbe8f7cb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tobias=20Alm=C3=A9n?= <78877636+almenscorner@users.noreply.github.com> Date: Thu, 5 Sep 2024 15:24:54 +0200 Subject: [PATCH 6/6] add documentation max length config option --- app/app_config.py | 6 ++++++ app/run_intunecd.py | 5 +++++ 2 files changed, 11 insertions(+) diff --git a/app/app_config.py b/app/app_config.py index a549e09..d31b9e6 100644 --- a/app/app_config.py +++ b/app/app_config.py @@ -88,6 +88,12 @@ else: PERMANENT_SESSION_LIFETIME = timedelta(hours=3) +DOCUMENTATION_MAX_LENGTH = os.getenv("DOCUMENTATION_MAX_LENGTH") +if DOCUMENTATION_MAX_LENGTH: + DOCUMENTATION_MAX_LENGTH = int(DOCUMENTATION_MAX_LENGTH) +else: + DOCUMENTATION_MAX_LENGTH = None + SQLALCHEMY_DATABASE_URI = "mssql+pyodbc:///?odbc_connect=%s" % params SQLALCHEMY_ENGINE_OPTIONS = {"pool_pre_ping": True} AUTHORITY = f"https://login.microsoftonline.com/{AZURE_TENANT_ID}" diff --git a/app/run_intunecd.py b/app/run_intunecd.py index 6e0b7df..7eea13d 100644 --- a/app/run_intunecd.py +++ b/app/run_intunecd.py @@ -117,6 +117,7 @@ def create_documentation(PATH, TENANT) -> None: PATH (str): path to the repository TENANT (object): tenant object """ + cmd = [ "IntuneCD-startdocumentation", "-c", @@ -127,6 +128,10 @@ def create_documentation(PATH, TENANT) -> None: "-t", TENANT.name, ] + + if app_config.DOCUMENTATION_MAX_LENGTH: + cmd += ["-m", app_config.DOCUMENTATION_MAX_LENGTH] + cmd = " ".join(cmd) emit_message("Creating documentation...", "running", "backup", TENANT.id, socket)