Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added Open WebUI (w/ Docker Desktop) artifacts parsers #987

Merged
merged 4 commits into from
Oct 28, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 19 additions & 0 deletions Modules/Apps/PowerShell_OpenWebUI_Account_Parser.mkape
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
Description: Open WebUI User Account Parser - Extract new user account, passwords, and roles (Docker Desktop).
Category: LiveResponse
Author: DReneau
Version: 1.0
Id: 5dbf2b24-2740-44ea-bca9-5b8dd90c592d
ExportFormat: txt
Processors:
-
Executable: C:\\Windows\\System32\\WindowsPowerShell\\v1.0\\powershell.exe
CommandLine: "$filePath = '%destinationDirectory%\\open-webui_account_data.txt'; try { $dockerInfo = (docker ps --all --filter 'name=webui' --format 'ID: {{.ID}} | Name: {{.Names}} | Image: {{.Image}} | Size: {{.Size}} | Status: {{.Status}} | Command: {{.Command}}' | Out-String).TrimEnd(); if (-not $dockerInfo) { Set-Content -Path $filePath -Value 'Docker Desktop Not Active' -Encoding UTF8; exit } $dockerLogs = docker ps --filter 'name=webui' --format '{{.ID}}' | ForEach-Object { docker logs $_ 2>&1 | ForEach-Object { if ($_ -match 'INFO \\[open_webui.apps.webui.models.auths\\] authenticate_user:') { $_ + [System.Environment]::NewLine } elseif ($_ -match 'name=') { $_ + [System.Environment]::NewLine } } } | Out-String; $output = $dockerInfo + [System.Environment]::NewLine + [System.Environment]::NewLine + $dockerLogs; Set-Content -Path $filePath -Value $output -Encoding UTF8; } catch { Set-Content -Path $filePath -Value 'Docker Desktop Not Active' -Encoding UTF8; exit }"
ExportFormat: txt

# Documentation
# https://docs.openwebui.com/getting-started/logging/
# https://docs.docker.com/reference/cli/docker/container/ls/
# This module combines "docker ps" and "docker Logs" filtering on the Open WebUI container ID from "docker ps."
# User accounts and passwords are then extracted and written to "open-webui_account_data.txt."
# Example:
# .\kape.exe --msource c:\ --mdest k:\Kape\Case_1234\mout --module powershell_openwebui_account_parser
19 changes: 19 additions & 0 deletions Modules/Apps/PowerShell_OpenWebUI_Chat_Parser.mkape
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
Description: Open WebUI Chat History Parser - Extract text-based chat conversations (Docker Desktop).
Category: LiveResponse
Author: DReneau
Version: 1.0
Id: 28a9649a-5871-4f65-9c1e-9da6f3c8a906
ExportFormat: txt
Processors:
-
Executable: C:\\Windows\\System32\\WindowsPowerShell\\v1.0\\powershell.exe
CommandLine: "$filePath = '%destinationDirectory%\\open-webuii_chat_history.txt'; try { $dockerInfo = (docker ps --all --filter 'name=webui' --format 'ID: {{.ID}} | Name: {{.Names}} | Image: {{.Image}} | Size: {{.Size}} | Status: {{.Status}} | Command: {{.Command}}' | Out-String).TrimEnd(); if (-not $dockerInfo) { Set-Content -Path $filePath -Value 'Docker Desktop Not Active' -Encoding UTF8; exit } $dockerLogs = docker ps --filter 'name=webui' --format '{{.ID}}' | ForEach-Object { docker logs $_ 2>&1 | ForEach-Object { if ($_ -match '<chat_history>') { $inChatHistory = $true; [System.Environment]::NewLine + $_ } elseif ($_ -match '</chat_history>') { $inChatHistory = $false; $_ + [System.Environment]::NewLine + [System.Environment]::NewLine } elseif ($inChatHistory) { $_ } } } | Out-String; $output = $dockerInfo + [System.Environment]::NewLine + [System.Environment]::NewLine + $dockerLogs; Set-Content -Path $filePath -Value $output -Encoding UTF8; } catch { Set-Content -Path $filePath -Value 'Docker Desktop Not Active' -Encoding UTF8; exit }"
ExportFormat: txt

# Documentation
# https://docs.docker.com/reference/cli/docker/container/ls/
# This module combines "docker ps" and "docker Logs" filtering on the Open WebUI container ID from "docker ps."
# Open WebUI chat conversations are extracted for all users and written to "open-webui_chat_history.txt."
# Open WebUI chats conversations remain in the logs even after deleting the conversation in the app.
# Example:
# .\kape.exe --msource c:\ --mdest k:\Kape\Case_1234\mout --module powershell_openwebui_chat_parser
19 changes: 19 additions & 0 deletions Modules/Apps/PowerShell_OpenWebUI_Document_Parser.mkape
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
Description: Open WebUI Document Upload Parser - Extract text from uploaded documents (Docker Desktop).
Category: LiveResponse
Author: DReneau
Version: 1.0
Id: 45492e28-2296-48ec-9fd5-762b42bf58bc
ExportFormat: txt
Processors:
-
Executable: C:\\Windows\\System32\\WindowsPowerShell\\v1.0\\powershell.exe
CommandLine: "$filePath = '%destinationDirectory%\\open-webui_uploaded_documents.txt'; try { $dockerInfo = (docker ps --all --filter 'name=webui' --format 'ID: {{.ID}} | Name: {{.Names}} | Image: {{.Image}} | Size: {{.Size}} | Status: {{.Status}} | Command: {{.Command}}' | Out-String).TrimEnd(); if (-not $dockerInfo) { Set-Content -Path $filePath -Value 'Docker Desktop Not Active' -Encoding UTF8; exit } $dockerLogs = docker ps --filter 'name=webui' --format '{{.ID}}' | ForEach-Object { docker logs $_ 2>&1 | ForEach-Object { if ($_ -match 'contexts \\[') { $inBlock = $true; [System.Environment]::NewLine + $_ } elseif ($_ -match '\\]\\}\\]') { $inBlock = $false; $_ + [System.Environment]::NewLine + [System.Environment]::NewLine } elseif ($inBlock) { $_ } } } | Out-String; $output = $dockerInfo + [System.Environment]::NewLine + [System.Environment]::NewLine + $dockerLogs; Set-Content -Path $filePath -Value $output -Encoding UTF8; } catch { Set-Content -Path $filePath -Value 'Docker Desktop Not Active' -Encoding UTF8; exit }"
ExportFormat: txt

# Documentation
# https://docs.docker.com/reference/cli/docker/container/ls/
# This module combines "docker ps" and "docker Logs" filtering on the Open WebUI container ID from "docker ps."
# Text from uploaded documents is then extracted and written to "open-webui_uploaded_documents.txt."
# Open WebUI documents remain in the logs even after deleting the chat conversation in the app.
# Example:
# .\kape.exe --msource c:\ --mdest k:\Kape\Case_1234\mout --module powershell_openwebui_document_parser
29 changes: 29 additions & 0 deletions Modules/Compound/Open-WebUI.mkape
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
Description: Open WebUI Parsers
Category: AI
Author: DReneau
Version: 1.0
Id: 23f770d6-43b7-4657-a7cb-a6d79d772918
ExportFormat: txt
Processors:
-
Executable: PowerShell_OpenWebUI_Account_Parser.mkape
CommandLine: ""
ExportFormat: ""
-
Executable: PowerShell_OpenWebUI_Chat_Parser.mkape
CommandLine: ""
ExportFormat: ""
-
Executable: PowerShell_OpenWebUI_Document_Parser.mkape
CommandLine: ""
ExportFormat: ""
-
Executable: PowerShell_Docker_Containers.mkape
CommandLine: ""
ExportFormat: ""

# Documentation
# https://github.com/open-webui/open-webui
# https://docs.docker.com/reference/cli/docker/container/ls/
# This module combines Open WebUI artifacts located in Docker Desktop logs.
# .\kape.exe --msource c:\ --mdest k:\case-12345\Kape\mout --module open-webui