Major repository cleanup and enhancement

- Reorganize documentation: moved old docs to docs/ directory
- Add comprehensive README.md with build options and usage guide
- Add detailed CONTRIBUTING.md with help content management guide
- Create Makefile for automated building and testing
- Add Dockerfile.scratch for building from Ubuntu 20.04 base
- Enhance all Dockerfiles with PowerShell + PSScriptAnalyzer
- Add modern shells: zsh (with plugins) and fish (with config)
- Add modern CLI tools: fd-find, ripgrep, fzf
- Create comprehensive help system with cheat/TLDR/fish completions
- Add helper scripts for help content management and coverage checking
- Fix Dockerfile.remnux script references
- Support three build variants: upstream (REMnux), scratch (Ubuntu), kali

Build options:
  - make build-upstream: Fast, uses REMnux upstream (recommended)
  - make build-scratch: Full control, builds from Ubuntu 20.04
  - make build-kali: Legacy Kali Linux base

Features:
  - PowerShell with PSScriptAnalyzer module
  - Modern shells (zsh, fish) with custom configurations
  - Enhanced help system (cheat sheets, TLDR pages, fish completions)
  - Help coverage checking and bulk import tools
  - Comprehensive documentation for users and contributors
This commit is contained in:
Tobias Kessels
2025-10-01 11:45:56 +02:00
parent 6bfcfd7935
commit b98aaee3e0
27 changed files with 5000 additions and 62 deletions

164
test-help-system.sh Executable file
View File

@@ -0,0 +1,164 @@
#!/bin/bash
# Test script for enhanced help system
# This validates that all help components work correctly
echo "🧪 Testing Enhanced Help System"
echo "==============================="
echo ""
# Build the container first
echo "🏗️ Building container with enhanced help system..."
docker build -f Dockerfile.remnux -t tabledevil/file-analysis:enhanced . || {
echo "❌ Container build failed!"
exit 1
}
echo "✅ Container built successfully"
echo ""
# Test basic help functions
echo "📋 Testing basic help functions..."
# Test 1: Main help
echo " • Testing main help..."
docker run --rm tabledevil/file-analysis:enhanced fhelp | head -10 | grep -q "File Analysis Container Help System" && {
echo " ✅ Main help works"
} || {
echo " ❌ Main help failed"
}
# Test 2: Tools search
echo " • Testing tools search..."
docker run --rm tabledevil/file-analysis:enhanced fhelp tools pdf 2>/dev/null | head -20 | grep -q "PDF" && {
echo " ✅ Tools search works"
} || {
echo " ❌ Tools search failed"
}
# Test 3: PDF workflow
echo " • Testing PDF workflow..."
docker run --rm tabledevil/file-analysis:enhanced fhelp pdf | grep -q "pdfid.py" && {
echo " ✅ PDF workflow works"
} || {
echo " ❌ PDF workflow failed"
}
# Test 4: Malware workflow
echo " • Testing malware workflow..."
docker run --rm tabledevil/file-analysis:enhanced fhelp malware | grep -q "capa" && {
echo " ✅ Malware workflow works"
} || {
echo " ❌ Malware workflow failed"
}
# Test 5: Cheat sheets
echo " • Testing cheat sheets..."
docker run --rm tabledevil/file-analysis:enhanced fhelp cheat pdf | grep -q "pdfid.py" && {
echo " ✅ Cheat sheets work"
} || {
echo " ❌ Cheat sheets failed"
}
# Test 6: Quick examples (tldr)
echo " • Testing tldr integration..."
docker run --rm tabledevil/file-analysis:enhanced fhelp quick tar 2>/dev/null | head -20 | grep -q "tar" && {
echo " ✅ TLDR integration works"
} || {
echo " ❌ TLDR integration failed"
}
# Test 7: Offline status
echo " • Testing offline status check..."
docker run --rm tabledevil/file-analysis:enhanced fhelp --offline | grep -q "Offline help system ready" && {
echo " ✅ Offline status works"
} || {
echo " ❌ Offline status failed"
}
echo ""
# Test individual help tools
echo "🔧 Testing individual help tools..."
# Test find-tool
echo " • Testing find-tool..."
docker run --rm tabledevil/file-analysis:enhanced find-tool pdf 2>/dev/null | head -20 | grep -q "PDF" && {
echo " ✅ find-tool works"
} || {
echo " ❌ find-tool failed"
}
# Test fhelp cheat command (internal implementation)
echo " • Testing fhelp cheat command..."
docker run --rm tabledevil/file-analysis:enhanced fhelp cheat tar 2>/dev/null | head -20 | grep -q "tar" && {
echo " ✅ fhelp cheat command works"
} || {
echo " ❌ fhelp cheat command failed"
}
# Test tldr command
echo " • Testing tldr command..."
docker run --rm tabledevil/file-analysis:enhanced tldr tar 2>/dev/null | head -20 | grep -q "tar" && {
echo " ✅ tldr command works"
} || {
echo " ❌ tldr command failed"
}
# Test navi (just check if it exists and doesn't crash immediately)
echo " • Testing navi availability..."
docker run --rm tabledevil/file-analysis:enhanced bash -c "command -v navi && echo 'navi available'" | grep -q "navi available" && {
echo " ✅ navi is available"
} || {
echo " ❌ navi not available"
}
echo ""
# Test actual analysis tools mentioned in help
echo "🛠️ Testing analysis tools availability..."
TOOLS=("pdfid.py" "pdf-parser.py" "peepdf" "pdftk" "capa" "strings" "exiftool" "file")
for tool in "${TOOLS[@]}"; do
echo " • Testing $tool..."
docker run --rm tabledevil/file-analysis:enhanced bash -c "command -v '$tool' >/dev/null 2>&1" && {
echo "$tool available"
} || {
echo "$tool not found"
}
done
echo ""
# Test file structure
echo "📁 Testing help system file structure..."
FILES=(
"/opt/remnux-docs/tools.db"
"/opt/cheatsheets/pdf-analysis.cheat"
"/opt/cheatsheets/malware-analysis.cheat"
"/opt/navi-cheats/pdf-analysis.cheat"
"/usr/local/bin/fhelp"
"/usr/local/bin/find-tool"
)
for file in "${FILES[@]}"; do
echo " • Testing $file..."
docker run --rm tabledevil/file-analysis:enhanced test -f "$file" && {
echo "$file exists"
} || {
echo "$file missing"
}
done
echo ""
# Interactive test (requires manual validation)
echo "🎯 Manual Test Available:"
echo " Run: docker run -it tabledevil/file-analysis:enhanced"
echo " Then try: fhelp, fhelp tools pdf, fhelp examples, etc."
echo ""
echo "🏁 Help system testing complete!"
echo " Review the results above to ensure all components work correctly."