diff --git a/orochi/templates/base.html b/orochi/templates/base.html
index f14b1a52..d4aa82c5 100644
--- a/orochi/templates/base.html
+++ b/orochi/templates/base.html
@@ -202,7 +202,7 @@
$("#tasks_running").html(data.running);
}
)
- }, 30000);
+ }, 5000);
// ABOUT
$(document).on("click", "#about", function () {
diff --git a/orochi/templates/website/partial_plugins.html b/orochi/templates/website/partial_plugins.html
index 2f764956..c683f29e 100644
--- a/orochi/templates/website/partial_plugins.html
+++ b/orochi/templates/website/partial_plugins.html
@@ -1,8 +1,9 @@
-{% for plugin in results %}
+{% for plugin, comment in results %}
-
-{% endfor %}
\ No newline at end of file
+{% endfor %}
diff --git a/orochi/website/admin.py b/orochi/website/admin.py
index f170e527..9e876000 100644
--- a/orochi/website/admin.py
+++ b/orochi/website/admin.py
@@ -121,7 +121,7 @@ class PluginAdmin(FileFormAdmin):
form = PluginEditAdminForm
add_form = PluginCreateAdminForm
- list_display = ("name", "operating_system", "disabled")
+ list_display = ("name", "comment", "operating_system", "disabled")
list_filter = (
"disabled",
"operating_system",
diff --git a/orochi/website/forms.py b/orochi/website/forms.py
index 4b7d25d0..8ef1c953 100644
--- a/orochi/website/forms.py
+++ b/orochi/website/forms.py
@@ -149,6 +149,7 @@ class Meta:
model = Plugin
fields = [
"plugin",
+ "comment",
"operating_system",
"disabled",
"local_dump",
@@ -173,6 +174,7 @@ class Meta:
model = Plugin
fields = [
"disabled",
+ "comment",
"local_dump",
"vt_check",
"clamav_check",
diff --git a/orochi/website/management/commands/plugins_sync.py b/orochi/website/management/commands/plugins_sync.py
index ddcb2184..3ecbba84 100644
--- a/orochi/website/management/commands/plugins_sync.py
+++ b/orochi/website/management/commands/plugins_sync.py
@@ -5,7 +5,7 @@
from volatility3.framework import contexts
from orochi.website.models import (
- RESULT_STATUS_DISABLED,
+ RESULT_STATUS_NOT_STARTED,
Dump,
Plugin,
Result,
@@ -47,7 +47,7 @@ def handle(self, *args, **kwargs):
)
# Create new plugin, take os from name
- for plugin in available_plugins:
+ for plugin, plugin_class in available_plugins.items():
if plugin not in installed_plugins:
if plugin.startswith("linux"):
plugin = Plugin(name=plugin, operating_system="Linux")
@@ -57,6 +57,7 @@ def handle(self, *args, **kwargs):
plugin = Plugin(name=plugin, operating_system="Mac")
else:
plugin = Plugin(name=plugin, operating_system="Other")
+ plugin.comment = plugin_class.__doc__
plugin.save()
self.stdout.write(self.style.SUCCESS("Plugin {} added!".format(plugin)))
@@ -67,7 +68,7 @@ def handle(self, *args, **kwargs):
dump=dump, plugin=plugin
)
if created:
- up.result = RESULT_STATUS_DISABLED
+ up.result = RESULT_STATUS_NOT_STARTED
up.save()
self.stdout.write(
self.style.SUCCESS("Plugin {} added to old dumps!".format(plugin))
@@ -75,6 +76,9 @@ def handle(self, *args, **kwargs):
else:
plugin = Plugin.objects.get(name=plugin)
+ if not plugin.comment:
+ plugin.comment = plugin_class.__doc__
+ plugin.save()
# Add new plugin to user
for user in get_user_model().objects.all():
diff --git a/orochi/website/migrations/0049_plugin_comment_alter_result_result.py b/orochi/website/migrations/0049_plugin_comment_alter_result_result.py
new file mode 100644
index 00000000..120abf52
--- /dev/null
+++ b/orochi/website/migrations/0049_plugin_comment_alter_result_result.py
@@ -0,0 +1,34 @@
+# Generated by Django 5.0.2 on 2024-02-07 13:39
+
+from django.db import migrations, models
+
+
+class Migration(migrations.Migration):
+
+ dependencies = [
+ ("website", "0048_dump_description"),
+ ]
+
+ operations = [
+ migrations.AddField(
+ model_name="plugin",
+ name="comment",
+ field=models.TextField(blank=True, null=True),
+ ),
+ migrations.AlterField(
+ model_name="result",
+ name="result",
+ field=models.PositiveSmallIntegerField(
+ choices=[
+ (0, "Not Started"),
+ (1, "Running"),
+ (2, "Empty"),
+ (3, "Success"),
+ (4, "Unsatisfied"),
+ (5, "Error"),
+ (6, "Disabled"),
+ ],
+ default=0,
+ ),
+ ),
+ ]
diff --git a/orochi/website/migrations/0049_create_superuser.py b/orochi/website/migrations/0050_create_superuser.py
similarity index 92%
rename from orochi/website/migrations/0049_create_superuser.py
rename to orochi/website/migrations/0050_create_superuser.py
index 0e562ad3..ebb03dfc 100644
--- a/orochi/website/migrations/0049_create_superuser.py
+++ b/orochi/website/migrations/0050_create_superuser.py
@@ -19,7 +19,7 @@ def generate_superuser(app, schema_editor):
class Migration(migrations.Migration):
dependencies = [
- ("website", "0048_dump_description"),
+ ("website", "0049_plugin_comment_alter_result_result"),
("ya", "0005_auto_20210618_0947"),
]
diff --git a/orochi/website/models.py b/orochi/website/models.py
index d0b7bc2c..89c0d65d 100644
--- a/orochi/website/models.py
+++ b/orochi/website/models.py
@@ -38,13 +38,15 @@
(DUMP_STATUS_ERROR, "Error"),
)
-RESULT_STATUS_RUNNING = 0
-RESULT_STATUS_EMPTY = 1
-RESULT_STATUS_SUCCESS = 2
-RESULT_STATUS_UNSATISFIED = 3
-RESULT_STATUS_ERROR = 4
-RESULT_STATUS_DISABLED = 5
+RESULT_STATUS_NOT_STARTED = 0
+RESULT_STATUS_RUNNING = 1
+RESULT_STATUS_EMPTY = 2
+RESULT_STATUS_SUCCESS = 3
+RESULT_STATUS_UNSATISFIED = 4
+RESULT_STATUS_ERROR = 5
+RESULT_STATUS_DISABLED = 6
RESULT = (
+ (RESULT_STATUS_NOT_STARTED, "Not Started"),
(RESULT_STATUS_RUNNING, "Running"),
(RESULT_STATUS_EMPTY, "Empty"),
(RESULT_STATUS_SUCCESS, "Success"),
@@ -172,6 +174,7 @@ class Plugin(models.Model):
choices=OPERATING_SYSTEM, default="Linux", max_length=10
)
disabled = models.BooleanField(default=False)
+ comment = models.TextField(blank=True, null=True)
local_dump = models.BooleanField(default=False)
vt_check = models.BooleanField(default=False)
clamav_check = models.BooleanField(default=False)
@@ -330,7 +333,7 @@ def new_plugin(sender, instance, created, **kwargs):
for dump in Dump.objects.all():
if instance.operating_system in [dump.operating_system, "Other"]:
up, created = Result.objects.get_or_create(dump=dump, plugin=instance)
- up.result = RESULT_STATUS_DISABLED
+ up.result = RESULT_STATUS_NOT_STARTED
up.save()
# Add new plugin to user
diff --git a/orochi/website/views.py b/orochi/website/views.py
index 2389f892..e54990f1 100644
--- a/orochi/website/views.py
+++ b/orochi/website/views.py
@@ -56,6 +56,7 @@
from orochi.website.models import (
RESULT_STATUS_DISABLED,
RESULT_STATUS_EMPTY,
+ RESULT_STATUS_NOT_STARTED,
RESULT_STATUS_RUNNING,
RESULT_STATUS_SUCCESS,
SERVICE_MISP,
@@ -144,7 +145,7 @@ def plugins(request):
Result.objects.filter(dump__index__in=indexes)
.order_by("plugin__name")
.distinct()
- .values_list("plugin__name", flat=True)
+ .values_list("plugin__name", "plugin__comment")
)
return render(request, "website/partial_plugins.html", {"results": results})
raise Http404("404")
@@ -464,7 +465,9 @@ def analysis(request):
if plugin.name.lower() not in PLUGIN_WITH_CHILDREN:
columns = []
for res in results:
- if res.result == RESULT_STATUS_RUNNING and columns == []:
+ if res.result == RESULT_STATUS_NOT_STARTED and columns == []:
+ columns = ["Not started"]
+ elif res.result == RESULT_STATUS_RUNNING and columns == []:
columns = ["Loading"]
elif res.result == RESULT_STATUS_EMPTY and columns == []:
columns = ["Empty"]
@@ -486,7 +489,7 @@ def analysis(request):
except elasticsearch.NotFoundError:
continue
elif res.result != RESULT_STATUS_DISABLED and columns == []:
- columns = ["Error"]
+ columns = ["Disabled"]
return render(
request,
"website/partial_analysis.html",