├── log └── .empty ├── uploads └── .empty ├── utilities ├── _data │ └── .empty └── log │ └── .empty ├── pyproject.toml ├── .dockerignore ├── events ├── templates │ └── events │ │ ├── query-chart.html │ │ ├── markdown_template.html │ │ ├── edit-global-context.html │ │ └── query-table.html ├── __init__.py ├── test │ └── __init__.py ├── migrations │ ├── __init__.py │ ├── 0003_alter_query_user.py │ ├── 0004_remove_event_modified_alter_event_id_and_more.py │ └── 0002_initial.py ├── templatetags │ ├── __init__.py │ ├── settings.py │ └── query.py ├── management │ └── commands │ │ ├── __init__.py │ │ ├── gen-secret-key.py │ │ └── create-queries.py ├── search_commands │ ├── test │ │ ├── __init__.py │ │ ├── test_decorators.py │ │ ├── test_send_email.py │ │ ├── test_echo.py │ │ ├── test_resolve.py │ │ └── test_set.py │ ├── qs │ │ ├── test │ │ │ ├── __init__.py │ │ │ ├── test_exists.py │ │ │ ├── test_count.py │ │ │ ├── test_last.py │ │ │ ├── test_first.py │ │ │ ├── test_delete.py │ │ │ ├── test_explain.py │ │ │ └── test_latest.py │ │ ├── __init__.py │ │ ├── sql.py │ │ ├── last.py │ │ ├── count.py │ │ ├── first.py │ │ ├── exists.py │ │ ├── reverse.py │ │ ├── using.py │ │ ├── latest.py │ │ ├── earliest.py │ │ ├── delete.py │ │ ├── defer.py │ │ ├── only.py │ │ ├── limit.py │ │ ├── distinct.py │ │ ├── dates.py │ │ ├── order_by.py │ │ ├── aggregate.py │ │ ├── explain.py │ │ ├── filter.py │ │ ├── exclude.py │ │ ├── annotate.py │ │ ├── having.py │ │ ├── group_by.py │ │ ├── values.py │ │ ├── datetimes.py │ │ ├── update.py │ │ └── alias.py │ ├── stats │ │ ├── __init__.py │ │ ├── main.py │ │ └── avg.py │ ├── __init__.py │ ├── decorators.py │ ├── resolve.py │ ├── rename.py │ ├── head.py │ ├── value_list.py │ ├── set.py │ ├── echo.py │ ├── send_email.py │ ├── replace.py │ ├── events_to_context.py │ ├── drop_fields.py │ ├── ensure_list.py │ ├── distinct.py │ ├── mark_timestamp.py │ ├── util.py │ ├── sort.py │ ├── autocast.py │ ├── eval.py │ ├── run_query.py │ ├── rex.py │ └── merge.py ├── parsers │ ├── __init__.py │ ├── test │ │ └── test_apache.py │ └── apache.py ├── tests.py ├── context_processors.py ├── permissions.py ├── apps.py ├── urls.py ├── validators.py ├── signals.py ├── forms.py └── admin.py ├── users ├── __init__.py ├── migrations │ └── __init__.py ├── tests.py ├── templates │ └── users │ │ └── edit_user_profile.html ├── urls.py ├── apps.py ├── forms.py ├── admin.py ├── models.py ├── views.py └── signals.py ├── delve ├── __init__.py ├── asgi.py ├── wsgi.py └── urls.py ├── templates ├── registration │ └── login.html ├── project │ └── base.html └── project-base.html ├── requirements.txt ├── doc ├── user │ ├── index.md │ ├── FAQ.md │ ├── Usage_Tips.md │ └── Using_the_Web_UI.md └── admin │ ├── index.md │ ├── User_and_Group_Management.md │ └── Security.md ├── .env.example ├── Dockerfile ├── manage.py ├── frontend └── js │ └── fl-chart.js ├── .github ├── workflows │ └── container-build.yml └── copilot-instructions.md ├── package.json ├── webpack.config.js └── docker-compose.yaml /log/.empty: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /uploads/.empty: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /utilities/_data/.empty: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /utilities/log/.empty: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /pyproject.toml: -------------------------------------------------------------------------------- 1 | # Deps are managed via requirements.txt. Don't add runtime deps here. 2 | -------------------------------------------------------------------------------- /.dockerignore: -------------------------------------------------------------------------------- 1 | .git 2 | .venv/ 3 | __pycache__/ 4 | *.pyc 5 | *.log 6 | node_modules/ 7 | dist/ 8 | build/ 9 | frontend/.cache/ 10 | *.zip 11 | -------------------------------------------------------------------------------- /events/templates/events/query-chart.html: -------------------------------------------------------------------------------- 1 |
2 |
3 | {{ results|json_script }} 4 |
5 | -------------------------------------------------------------------------------- /events/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright (C) 2025 All rights reserved. 2 | # This file is part of the Delve project, which is licensed under the GNU Affero General Public License v3.0 (AGPL-3.0). 3 | # See the LICENSE file in the root of this repository for details. 4 | 5 | -------------------------------------------------------------------------------- /users/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright (C) 2025 All rights reserved. 2 | # This file is part of the Delve project, which is licensed under the GNU Affero General Public License v3.0 (AGPL-3.0). 3 | # See the LICENSE file in the root of this repository for details. 4 | 5 | -------------------------------------------------------------------------------- /events/test/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright (C) 2025 All rights reserved. 2 | # This file is part of the Delve project, which is licensed under the GNU Affero General Public License v3.0 (AGPL-3.0). 3 | # See the LICENSE file in the root of this repository for details. 4 | 5 | -------------------------------------------------------------------------------- /events/migrations/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright (C) 2025 All rights reserved. 2 | # This file is part of the Delve project, which is licensed under the GNU Affero General Public License v3.0 (AGPL-3.0). 3 | # See the LICENSE file in the root of this repository for details. 4 | 5 | -------------------------------------------------------------------------------- /events/templatetags/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright (C) 2025 All rights reserved. 2 | # This file is part of the Delve project, which is licensed under the GNU Affero General Public License v3.0 (AGPL-3.0). 3 | # See the LICENSE file in the root of this repository for details. 4 | 5 | -------------------------------------------------------------------------------- /users/migrations/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright (C) 2025 All rights reserved. 2 | # This file is part of the Delve project, which is licensed under the GNU Affero General Public License v3.0 (AGPL-3.0). 3 | # See the LICENSE file in the root of this repository for details. 4 | 5 | -------------------------------------------------------------------------------- /events/management/commands/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright (C) 2025 All rights reserved. 2 | # This file is part of the Delve project, which is licensed under the GNU Affero General Public License v3.0 (AGPL-3.0). 3 | # See the LICENSE file in the root of this repository for details. 4 | 5 | -------------------------------------------------------------------------------- /events/search_commands/test/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright (C) 2025 All rights reserved. 2 | # This file is part of the Delve project, which is licensed under the GNU Affero General Public License v3.0 (AGPL-3.0). 3 | # See the LICENSE file in the root of this repository for details. 4 | 5 | -------------------------------------------------------------------------------- /delve/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright (C) 2025 All rights reserved. 2 | # This file is part of the Delve project, which is licensed under the GNU Affero General Public License v3.0 (AGPL-3.0). 3 | # See the LICENSE file in the root of this repository for details. 4 | 5 | __version__ = "0.8.2-dev" -------------------------------------------------------------------------------- /events/search_commands/qs/test/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright (C) 2025 All rights reserved. 2 | # This file is part of the Delve project, which is licensed under the GNU Affero General Public License v3.0 (AGPL-3.0). 3 | # See the LICENSE file in the root of this repository for details. 4 | 5 | -------------------------------------------------------------------------------- /events/search_commands/stats/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright (C) 2025 All rights reserved. 2 | # This file is part of the Delve project, which is licensed under the GNU Affero General Public License v3.0 (AGPL-3.0). 3 | # See the LICENSE file in the root of this repository for details. 4 | 5 | from .main import stats -------------------------------------------------------------------------------- /templates/registration/login.html: -------------------------------------------------------------------------------- 1 | {% extends "project/base.html" %} 2 | 3 | {% block title %}Login - Delve{% endblock %} 4 | 5 | {% block content %} 6 |

Log In

7 |
8 | {% csrf_token %} 9 | {{ form }} 10 | 11 |
12 | {% endblock %} -------------------------------------------------------------------------------- /events/parsers/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright (C) 2025 All rights reserved. 2 | # This file is part of the Delve project, which is licensed under the GNU Affero General Public License v3.0 (AGPL-3.0). 3 | # See the LICENSE file in the root of this repository for details. 4 | 5 | from .apache import apache 6 | # from .csv import csv 7 | -------------------------------------------------------------------------------- /users/tests.py: -------------------------------------------------------------------------------- 1 | # Copyright (C) 2025 All rights reserved. 2 | # This file is part of the Delve project, which is licensed under the GNU Affero General Public License v3.0 (AGPL-3.0). 3 | # See the LICENSE file in the root of this repository for details. 4 | 5 | from django.test import TestCase 6 | 7 | # Create your tests here. 8 | -------------------------------------------------------------------------------- /events/tests.py: -------------------------------------------------------------------------------- 1 | # Copyright (C) 2025 All rights reserved. 2 | # This file is part of the Delve project, which is licensed under the GNU Affero General Public License v3.0 (AGPL-3.0). 3 | # See the LICENSE file in the root of this repository for details. 4 | 5 | from django.test import TestCase 6 | 7 | # Create your tests here. 8 | -------------------------------------------------------------------------------- /events/templates/events/markdown_template.html: -------------------------------------------------------------------------------- 1 | {% extends 'events/base.html' %} 2 | {% load static %} 3 | {% load settings %} 4 | {% load django_bootstrap5 %} 5 | 6 | {% block title %}Markdown Content{% endblock title %} 7 | 8 | {% block content %} 9 |
10 | {{ content | safe }} 11 |
12 | {% endblock content %} 13 | -------------------------------------------------------------------------------- /events/context_processors.py: -------------------------------------------------------------------------------- 1 | # Copyright (C) 2025 All rights reserved. 2 | # This file is part of the Delve project, which is licensed under the GNU Affero General Public License v3.0 (AGPL-3.0). 3 | # See the LICENSE file in the root of this repository for details. 4 | 5 | from django.conf import settings 6 | 7 | def settings_context(request): 8 | return {'settings': settings} 9 | -------------------------------------------------------------------------------- /events/templates/events/edit-global-context.html: -------------------------------------------------------------------------------- 1 | {% extends "events/base.html" %} 2 | 3 | {% block title %}Global Context{% endblock %} 4 | 5 | {% block content %} 6 |

Global Context for: {{ request.user.username }}

7 |
8 | {% csrf_token %} 9 | {{ global_context_form }} 10 | 11 |
12 | {% endblock %} 13 | -------------------------------------------------------------------------------- /requirements.txt: -------------------------------------------------------------------------------- 1 | requests 2 | django 3 | djangorestframework 4 | markdown 5 | django-debug-toolbar 6 | cherrypy 7 | whitenoise 8 | croniter 9 | django-q2 10 | rich 11 | python-dateutil 12 | jinja2 13 | django_bootstrap5 14 | pydantic 15 | xmltodict 16 | python-json-logger 17 | django_extensions 18 | records 19 | psutil 20 | pygments 21 | uuid_utils 22 | psycopg2-binary 23 | pywin32 ; sys_platform == 'win32' 24 | -------------------------------------------------------------------------------- /users/templates/users/edit_user_profile.html: -------------------------------------------------------------------------------- 1 | {% extends "events/base.html" %} 2 | {% load django_bootstrap5 %} 3 | 4 | {% block title %}Edit Profile{% endblock %} 5 | 6 | {% block content %} 7 |

User Profile: {{ request.user.username }}

8 |
9 | {% csrf_token %} 10 | {% bootstrap_form user_profile_form %} 11 | 12 |
13 | {% endblock %} 14 | -------------------------------------------------------------------------------- /users/urls.py: -------------------------------------------------------------------------------- 1 | # Copyright (C) 2025 All rights reserved. 2 | # This file is part of the Delve project, which is licensed under the GNU Affero General Public License v3.0 (AGPL-3.0). 3 | # See the LICENSE file in the root of this repository for details. 4 | 5 | from django.urls import path 6 | 7 | from .views import ( 8 | edit_user_profile, 9 | ) 10 | 11 | 12 | urlpatterns = [ 13 | path("profile/", edit_user_profile, name="profile"), 14 | ] 15 | -------------------------------------------------------------------------------- /events/templatetags/settings.py: -------------------------------------------------------------------------------- 1 | # Copyright (C) 2025 All rights reserved. 2 | # This file is part of the Delve project, which is licensed under the GNU Affero General Public License v3.0 (AGPL-3.0). 3 | # See the LICENSE file in the root of this repository for details. 4 | 5 | from django import template 6 | from django.conf import settings 7 | 8 | register = template.Library() 9 | 10 | # settings value 11 | @register.simple_tag 12 | def settings(name): 13 | return getattr(settings, name, "") 14 | -------------------------------------------------------------------------------- /events/permissions.py: -------------------------------------------------------------------------------- 1 | # Copyright (C) 2025 All rights reserved. 2 | # This file is part of the Delve project, which is licensed under the GNU Affero General Public License v3.0 (AGPL-3.0). 3 | # See the LICENSE file in the root of this repository for details. 4 | 5 | from rest_framework import permissions 6 | 7 | class IsOwner(permissions.BasePermission): 8 | def has_object_permission(self, request, view, obj): 9 | # only allow for the owner of the object. 10 | return obj.user == request.user 11 | -------------------------------------------------------------------------------- /users/apps.py: -------------------------------------------------------------------------------- 1 | # Copyright (C) 2025 All rights reserved. 2 | # This file is part of the Delve project, which is licensed under the GNU Affero General Public License v3.0 (AGPL-3.0). 3 | # See the LICENSE file in the root of this repository for details. 4 | 5 | from django.apps import AppConfig 6 | 7 | 8 | class UsersConfig(AppConfig): 9 | default_auto_field = 'django.db.models.BigAutoField' 10 | name = 'users' 11 | 12 | def ready(self): 13 | from .signals import ( 14 | create_profile, 15 | ) -------------------------------------------------------------------------------- /users/forms.py: -------------------------------------------------------------------------------- 1 | # Copyright (C) 2025 All rights reserved. 2 | # This file is part of the Delve project, which is licensed under the GNU Affero General Public License v3.0 (AGPL-3.0). 3 | # See the LICENSE file in the root of this repository for details. 4 | 5 | from django import forms 6 | 7 | from .models import ( 8 | UserProfile, 9 | ) 10 | 11 | class UserProfileForm(forms.ModelForm): 12 | class Meta: 13 | model = UserProfile 14 | fields = [ 15 | 'theme', 16 | 'mode', 17 | ] 18 | 19 | -------------------------------------------------------------------------------- /events/apps.py: -------------------------------------------------------------------------------- 1 | # Copyright (C) 2025 All rights reserved. 2 | # This file is part of the Delve project, which is licensed under the GNU Affero General Public License v3.0 (AGPL-3.0). 3 | # See the LICENSE file in the root of this repository for details. 4 | 5 | from django.apps import AppConfig 6 | 7 | 8 | class EventsConfig(AppConfig): 9 | default_auto_field = 'django.db.models.BigAutoField' 10 | name = 'events' 11 | 12 | def ready(self): 13 | from .signals import ( 14 | validate_global_context, 15 | create_global_context, 16 | ) -------------------------------------------------------------------------------- /users/admin.py: -------------------------------------------------------------------------------- 1 | # Copyright (C) 2025 All rights reserved. 2 | # This file is part of the Delve project, which is licensed under the GNU Affero General Public License v3.0 (AGPL-3.0). 3 | # See the LICENSE file in the root of this repository for details. 4 | 5 | from django.contrib import admin 6 | from django.contrib.auth.admin import UserAdmin 7 | from django.contrib.auth.models import Permission 8 | from .models import ( 9 | User, 10 | UserProfile, 11 | ) 12 | 13 | admin.site.register(User, UserAdmin) 14 | admin.site.register(UserProfile) 15 | admin.site.register(Permission) 16 | -------------------------------------------------------------------------------- /doc/user/index.md: -------------------------------------------------------------------------------- 1 | # Delve User Manual 2 | 3 | ## Introduction 4 | Welcome to the Delve User Manual. This guide is intended for end-users who will be using Delve for their daily tasks. 5 | 6 | ## Table of Contents 7 | 8 | 1. [Getting Started](/doc/user/Getting_Started.md) 9 | 2. [Using the Web UI](/doc/user/Using_the_Web_UI.md) 10 | 3. [Ingesting Data](/doc/user/Ingesting_Data.md) 11 | 4. [Searching, Filtering and More](/doc/user/Searching_Filtering_and_More.md) 12 | 5. [Application Development](/doc/user/App_Developer_Guide.md) 13 | 6. [Usage Tips](/doc/user/Usage_Tips.md) 14 | 7. [FAQ](/doc/user/FAQ.md) 15 | -------------------------------------------------------------------------------- /events/templates/events/query-table.html: -------------------------------------------------------------------------------- 1 | {% load query %} 2 |
3 | 4 | 5 | 6 | {% for field in fields %} 7 | 8 | {% endfor %} 9 | 10 | 11 | {% for result in results %} 12 | 13 | {% for field in fields %} 14 | 15 | {% endfor %} 16 | 17 | {% endfor %} 18 |
{{ field }}
{{ result|lookup:field }}
19 |
20 | -------------------------------------------------------------------------------- /delve/asgi.py: -------------------------------------------------------------------------------- 1 | # Copyright (C) 2025 All rights reserved. 2 | # This file is part of the Delve project, which is licensed under the GNU Affero General Public License v3.0 (AGPL-3.0). 3 | # See the LICENSE file in the root of this repository for details. 4 | 5 | """ 6 | ASGI config for Delve project. 7 | 8 | It exposes the ASGI callable as a module-level variable named ``application``. 9 | 10 | For more information on this file, see 11 | https://docs.djangoproject.com/en/5.0/howto/deployment/asgi/ 12 | """ 13 | 14 | import os 15 | 16 | from django.core.asgi import get_asgi_application 17 | 18 | os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'delve.settings') 19 | 20 | application = get_asgi_application() 21 | -------------------------------------------------------------------------------- /delve/wsgi.py: -------------------------------------------------------------------------------- 1 | # Copyright (C) 2025 All rights reserved. 2 | # This file is part of the Delve project, which is licensed under the GNU Affero General Public License v3.0 (AGPL-3.0). 3 | # See the LICENSE file in the root of this repository for details. 4 | 5 | """ 6 | WSGI config for Delve project. 7 | 8 | It exposes the WSGI callable as a module-level variable named ``application``. 9 | 10 | For more information on this file, see 11 | https://docs.djangoproject.com/en/5.0/howto/deployment/wsgi/ 12 | """ 13 | 14 | import os 15 | 16 | from django.core.wsgi import get_wsgi_application 17 | 18 | os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'delve.settings') 19 | 20 | application = get_wsgi_application() 21 | -------------------------------------------------------------------------------- /events/management/commands/gen-secret-key.py: -------------------------------------------------------------------------------- 1 | # Copyright (C) 2025 All rights reserved. 2 | # This file is part of the Delve project, which is licensed under the GNU Affero General Public License v3.0 (AGPL-3.0). 3 | # See the LICENSE file in the root of this repository for details. 4 | 5 | import logging 6 | 7 | from django.core.management.utils import get_random_secret_key 8 | from django.core.management.base import BaseCommand, CommandError 9 | from django.conf import settings 10 | 11 | class Command(BaseCommand): 12 | help = "Use cherrypy to serve the web app" 13 | 14 | def add_arguments(self, parser): 15 | ... 16 | 17 | def handle(self, *args, **options): 18 | self.stdout.write(f"{get_random_secret_key()}\n") 19 | self.stdout.flush() 20 | -------------------------------------------------------------------------------- /events/parsers/test/test_apache.py: -------------------------------------------------------------------------------- 1 | # Copyright (C) 2025 All rights reserved. 2 | # This file is part of the Delve project, which is licensed under the GNU Affero General Public License v3.0 (AGPL-3.0). 3 | # See the LICENSE file in the root of this repository for details. 4 | 5 | import unittest 6 | from src.home.events.parsers.apache import apache 7 | 8 | class TestApacheParser(unittest.TestCase): 9 | def test_apache_parser_valid_line(self): 10 | sample_line = '127.0.0.1 - frank [10/Oct/2000:13:55:36 -0700] "GET /apache_pb.gif HTTP/1.0" 200 2326' 11 | result = apache(sample_line) 12 | self.assertEqual(result["host"], "127.0.0.1") 13 | self.assertEqual(result["time"], "[10/Oct/2000:13:55:36 -0700]") 14 | self.assertEqual(result["request"], "GET /apache_pb.gif HTTP/1.0") 15 | self.assertEqual(result["status"], "200") 16 | self.assertEqual(result["size"], "2326") 17 | 18 | if __name__ == '__main__': 19 | unittest.main() -------------------------------------------------------------------------------- /events/migrations/0003_alter_query_user.py: -------------------------------------------------------------------------------- 1 | # Copyright (C) 2025 All rights reserved. 2 | # This file is part of the Delve project, which is licensed under the GNU Affero General Public License v3.0 (AGPL-3.0). 3 | # See the LICENSE file in the root of this repository for details. 4 | 5 | # Generated by Django 5.1.6 on 2025-02-12 20:45 6 | 7 | import django.db.models.deletion 8 | from django.conf import settings 9 | from django.db import migrations, models 10 | 11 | 12 | class Migration(migrations.Migration): 13 | 14 | dependencies = [ 15 | ('events', '0002_initial'), 16 | migrations.swappable_dependency(settings.AUTH_USER_MODEL), 17 | ] 18 | 19 | operations = [ 20 | migrations.AlterField( 21 | model_name='query', 22 | name='user', 23 | field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='queries', to=settings.AUTH_USER_MODEL), 24 | ), 25 | ] 26 | -------------------------------------------------------------------------------- /.env.example: -------------------------------------------------------------------------------- 1 | # Example .env file for Delve Docker Compose 2 | # Copy to .env and fill in values 3 | 4 | 5 | # Required for security and database access 6 | DELVE_SECRET_KEY= 7 | DELVE_DATABASE_ENGINE=postgresql # Options: postgresql, mysql, sqlite3 8 | DELVE_DATABASE_NAME=delve 9 | DELVE_DATABASE_USER=delve 10 | DELVE_DATABASE_PASSWORD= 11 | DELVE_DATABASE_HOST=db 12 | DELVE_DATABASE_PORT=5432 13 | 14 | # Optional (defaults provided in settings.py) 15 | DELVE_DEBUG=False 16 | DELVE_ALLOWED_HOSTS=web,localhost,127.0.0.1 17 | DELVE_INTERNAL_IPS=127.0.0.1 18 | DELVE_STATIC_URL=/static/ 19 | DELVE_STATIC_ROOT=/app/staticfiles 20 | DELVE_LOG_LEVEL=INFO 21 | DELVE_MEDIA_ROOT=/app/uploads/ 22 | DELVE_MEDIA_URL=/uploads/ 23 | DELVE_SERVER_HOST=0.0.0.0 24 | DELVE_SERVER_PORT=8000 25 | DELVE_Q_CLUSTER_NAME=DjangORM 26 | DELVE_Q_CLUSTER_WORKERS=2 27 | DELVE_Q_CLUSTER_ORM=default 28 | DELVE_DATABASE_NAME=delve 29 | DELVE_DATABASE_HOST=db 30 | DELVE_DATABASE_PORT=5432 31 | # Add other DELVE_* variables as needed 32 | -------------------------------------------------------------------------------- /Dockerfile: -------------------------------------------------------------------------------- 1 | # Stage 1: Frontend build 2 | FROM node:24-bookworm-slim AS frontend 3 | WORKDIR /app 4 | COPY package.json ./ 5 | COPY webpack.config.js ./ 6 | COPY frontend ./frontend 7 | # Install git (needed for npm install) 8 | RUN apt-get update && apt-get install -y git && rm -rf /var/lib/apt/lists/* 9 | RUN npm install 10 | RUN npx webpack --config webpack.config.js 11 | 12 | # Stage 2: Python builder 13 | FROM python:3.13.7-slim-bookworm AS builder 14 | WORKDIR /app 15 | COPY requirements.txt . 16 | RUN python -m pip install --upgrade pip && pip install -r requirements.txt 17 | COPY . . 18 | COPY --from=frontend /app/staticfiles ./staticfiles 19 | RUN python manage.py collectstatic --no-input 20 | 21 | # Stage 3: Runtime 22 | FROM python:3.13.7-slim-bookworm 23 | ENV PYTHONDONTWRITEBYTECODE=1 PYTHONUNBUFFERED=1 24 | RUN useradd -m appuser 25 | WORKDIR /app 26 | COPY --from=builder /usr/local /usr/local 27 | COPY --from=builder /app /app 28 | RUN mkdir -p /app/log \ 29 | && chown -R appuser:appuser /app 30 | USER appuser 31 | EXPOSE 8000 32 | CMD ["python", "manage.py", "serve"] -------------------------------------------------------------------------------- /manage.py: -------------------------------------------------------------------------------- 1 | # Copyright (C) 2025 All rights reserved. 2 | # This file is part of the Delve project, which is licensed under the GNU Affero General Public License v3.0 (AGPL-3.0). 3 | # See the LICENSE file in the root of this repository for details. 4 | 5 | #!/usr/bin/env python 6 | """Django's command-line utility for administrative tasks.""" 7 | import os 8 | import sys 9 | 10 | from delve import __version__ 11 | 12 | 13 | def main(): 14 | """Run administrative tasks.""" 15 | os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'delve.settings') 16 | try: 17 | from django.core.management import execute_from_command_line 18 | except ImportError as exc: 19 | raise ImportError( 20 | "Couldn't import Django. Are you sure it's installed and " 21 | "available on your PYTHONPATH environment variable? Did you " 22 | "forget to activate a virtual environment?" 23 | ) from exc 24 | if sys.argv[1] in ('version', '--version'): 25 | print(__version__) 26 | sys.exit(0) 27 | execute_from_command_line(sys.argv) 28 | 29 | 30 | if __name__ == '__main__': 31 | main() 32 | -------------------------------------------------------------------------------- /events/search_commands/qs/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright (C) 2025 All rights reserved. 2 | # This file is part of the Delve project, which is licensed under the GNU Affero General Public License v3.0 (AGPL-3.0). 3 | # See the LICENSE file in the root of this repository for details. 4 | 5 | from .aggregate import aggregate 6 | from .alias import alias 7 | from .annotate import annotate 8 | from .count import count 9 | from .dates import dates 10 | from .datetimes import datetimes 11 | from .defer import defer 12 | from .delete import delete 13 | from .distinct import distinct 14 | from .earliest import earliest 15 | from .exclude import exclude 16 | from .exists import exists 17 | from .explain import explain 18 | from .filter import filter 19 | from .first import first 20 | from .last import last 21 | from .latest import latest 22 | from .only import only 23 | from .order_by import order_by 24 | from .reverse import reverse 25 | from .select_related import select_related 26 | from .update import update 27 | from .using import using 28 | from .values import values 29 | from .group_by import group_by 30 | from .having import having 31 | from .limit import limit 32 | from .sql import sql 33 | -------------------------------------------------------------------------------- /events/parsers/apache.py: -------------------------------------------------------------------------------- 1 | # Copyright (C) 2025 All rights reserved. 2 | # This file is part of the Delve project, which is licensed under the GNU Affero General Public License v3.0 (AGPL-3.0). 3 | # See the LICENSE file in the root of this repository for details. 4 | 5 | """Module for parsing Apache HTTP server access logs.""" 6 | 7 | import re 8 | from typing import Dict 9 | 10 | HOST = r'^(?P.*?)' 11 | SPACE = r'\s' 12 | IDENTITY = r'\S+' 13 | USER = r'\S+' 14 | TIME = r'(?P