From e43b6933ac8a708c0cd1637749decd8db6d7ad19 Mon Sep 17 00:00:00 2001 From: Keshav Priyadarshi Date: Wed, 18 Jun 2025 11:18:53 +0530 Subject: [PATCH 01/20] Prevent deletion of scheduled jobs when result_ttl < interval Signed-off-by: Keshav Priyadarshi --- vulnerabilities/schedules.py | 2 -- 1 file changed, 2 deletions(-) diff --git a/vulnerabilities/schedules.py b/vulnerabilities/schedules.py index 1c34bd759..687dafc7a 100644 --- a/vulnerabilities/schedules.py +++ b/vulnerabilities/schedules.py @@ -14,7 +14,6 @@ from redis.exceptions import ConnectionError from vulnerabilities.tasks import enqueue_pipeline -from vulnerablecode.settings import VULNERABLECODE_PIPELINE_TIMEOUT log = logging.getLogger(__name__) scheduler = django_rq.get_scheduler() @@ -36,7 +35,6 @@ def schedule_execution(pipeline_schedule, execute_now=False): func=enqueue_pipeline, args=[pipeline_schedule.pipeline_id], interval=interval_in_seconds, - result_ttl=f"{VULNERABLECODE_PIPELINE_TIMEOUT}h", repeat=None, ) return job._id From 6bd10775837cc806ef10e893dfe043e01c998b6e Mon Sep 17 00:00:00 2001 From: Keshav Priyadarshi Date: Wed, 18 Jun 2025 15:16:25 +0530 Subject: [PATCH 02/20] Rename schedule ui to Pipeline Dashboard Signed-off-by: Keshav Priyadarshi --- vulnerabilities/templates/navbar.html | 4 ++-- .../{pipeline_schedule_list.html => pipeline_dashboard.html} | 4 ++-- vulnerabilities/templates/pipeline_run_list.html | 2 +- vulnerabilities/views.py | 2 +- vulnerablecode/urls.py | 4 ++-- 5 files changed, 8 insertions(+), 8 deletions(-) rename vulnerabilities/templates/{pipeline_schedule_list.html => pipeline_dashboard.html} (98%) diff --git a/vulnerabilities/templates/navbar.html b/vulnerabilities/templates/navbar.html index 51b796ae4..b7a7fba0a 100644 --- a/vulnerabilities/templates/navbar.html +++ b/vulnerabilities/templates/navbar.html @@ -20,8 +20,8 @@ {% endif %} -
-
- {{ form.captcha }} -
+
+ {{ form.captcha }}
diff --git a/vulnerabilities/templates/api_user_creation_form.html b/vulnerabilities/templates/api_user_creation_form.html index 4c596f094..5a913f5ae 100644 --- a/vulnerabilities/templates/api_user_creation_form.html +++ b/vulnerabilities/templates/api_user_creation_form.html @@ -26,11 +26,13 @@
{% endif %}
-

- VulnerableCode API key request -

-
+
+

VulnerableCode API Key Request

+
+
+ +

You need an API key to access the VulnerableCode JSON REST API. Please check the live OpenAPI documentation @@ -41,17 +43,34 @@


- - {% csrf_token %} - {% for field in form %} -
- -
- {{ field }} -
+
+
+ + {% csrf_token %} +
+
+
- {% endfor %} - - +
+
+
+ +
+
+
+
+ +
+
+
+ {{ form.captcha }} +
+ + +
+
{% endblock %} diff --git a/vulnerablecode/settings.py b/vulnerablecode/settings.py index 735e01a82..3111c9523 100644 --- a/vulnerablecode/settings.py +++ b/vulnerablecode/settings.py @@ -83,21 +83,10 @@ "drf_spectacular", # required for Django collectstatic discovery "drf_spectacular_sidecar", - "django_recaptcha", "django_rq", "django_altcha", ) -if env.str("RECAPTCHA_PUBLIC_KEY", None): - RECAPTCHA_PUBLIC_KEY = env.str("RECAPTCHA_PUBLIC_KEY") - -if env.str("RECAPTCHA_PRIVATE_KEY", None): - RECAPTCHA_PRIVATE_KEY = env.str("RECAPTCHA_PRIVATE_KEY") - -SILENCED_SYSTEM_CHECKS = ["django_recaptcha.recaptcha_test_key_error"] -SILENCED_SYSTEM_CHECKS = ["django_recaptcha.recaptcha_test_key_error"] -RECAPTCHA_DOMAIN = env.str("RECAPTCHA_DOMAIN", "www.recaptcha.net") - MIDDLEWARE = ( "django.middleware.security.SecurityMiddleware", From e1a028fc690a3ce00244db418659b459a97e2c03 Mon Sep 17 00:00:00 2001 From: Keshav Priyadarshi Date: Tue, 24 Jun 2025 21:52:41 +0530 Subject: [PATCH 07/20] Add top navigation button to pipeline dashboard Signed-off-by: Keshav Priyadarshi --- vulnerabilities/forms.py | 12 ++++++++++-- .../templates/pipeline_run_details.html | 14 ++++++++------ vulnerabilities/templates/pipeline_run_list.html | 5 ++++- 3 files changed, 22 insertions(+), 9 deletions(-) diff --git a/vulnerabilities/forms.py b/vulnerabilities/forms.py index d980a5d9d..7ee348354 100644 --- a/vulnerabilities/forms.py +++ b/vulnerabilities/forms.py @@ -46,7 +46,11 @@ class AdvisorySearchForm(forms.Form): class ApiUserCreationForm(forms.ModelForm): """Support a simplified creation for API-only users directly from the UI.""" - captcha = AltchaField(floating=True) + captcha = AltchaField( + floating=True, + hidefooter=True, + hidelogo=True, + ) class Meta: model = ApiUser @@ -105,4 +109,8 @@ class PipelineSchedulePackageForm(forms.Form): class AdminLoginForm(AdminAuthenticationForm): - captcha = AltchaField(floating=True) + captcha = AltchaField( + floating=True, + hidefooter=True, + hidelogo=True, + ) diff --git a/vulnerabilities/templates/pipeline_run_details.html b/vulnerabilities/templates/pipeline_run_details.html index 6ebf92807..8dcaba959 100644 --- a/vulnerabilities/templates/pipeline_run_details.html +++ b/vulnerabilities/templates/pipeline_run_details.html @@ -34,8 +34,10 @@ {% endblock %} {% block content %} -
+ + Back to All Runs +

{{ pipeline_name }} Run Log


@@ -181,12 +183,12 @@

Log Output

{% endif %} - - - Back to All Runs - + {% if run.run_output or run.log %} + + Back to All Runs + + {% endif %} -
{% endblock %} diff --git a/vulnerabilities/templates/pipeline_run_list.html b/vulnerabilities/templates/pipeline_run_list.html index 522e78cd6..f11eca0b8 100644 --- a/vulnerabilities/templates/pipeline_run_list.html +++ b/vulnerabilities/templates/pipeline_run_list.html @@ -34,6 +34,7 @@
+ Back to Dashboard

{{ pipeline_name }} Runs


@@ -109,7 +110,9 @@

{{ pipeline_name }} Runs

{% endfor %} - Back to Dashboard + {% if run_list|length > 10 %} + Back to Dashboard + {% endif %}
{% if is_paginated %}