Skip to content

Latest commit

Β 

History

History
79 lines (53 loc) Β· 2.82 KB

File metadata and controls

79 lines (53 loc) Β· 2.82 KB

Technical Architecture

πŸ” Advanced Logging & Security

Powered by @wgtechlabs/log-engine

The bot includes enterprise-grade logging with advanced security features:

  • πŸ”’ PII Redaction - Automatically redacts sensitive information from logs
  • πŸ“Š Structured Logging - JSON-structured logs for better analysis
  • πŸ›‘οΈ SBOM Generation - Software Bill of Materials for supply chain transparency
  • πŸ“‹ Build Provenance - Attestations for build security and verification

Environment Variables for Debugging

# Enable debug logging
LOG_LEVEL=debug

# Enable verbose logging for detailed troubleshooting
VERBOSE_LOGGING=true

# Production logging (default)
LOG_LEVEL=info

SBOM Generation

Generate Software Bill of Materials for security analysis:

# Generate SBOM locally
bun run sbom:generate

# Docker build with SBOM and provenance
bun run docker:build:sbom

πŸ”— System Architecture & Integration

Webhook Server Integration

This bot works in conjunction with the unthread-webhook-server for complete bidirectional communication:

  • Webhook Server: Receives events from Unthread dashboard and routes them to the bot
  • Bot Service: Handles Telegram interactions and creates tickets in Unthread
  • Platform Detection: Smart username formatting ensures proper event classification

Username Format Compatibility

The bot implements a sophisticated username format that ensures seamless integration:

// Format Priority for Unthread Dashboard Display:
"Waren (@warengonzaga)"    // βœ… Best UX - detected as Telegram platform
"@warengonzaga"            // βœ… Minimal - detected as Telegram platform  
"Waren Gonzaga"            // βœ… Fallback - detected as Dashboard origin
"User 784879963"           // βœ… Legacy - detected as Dashboard origin

Integration Benefits:

  • βœ… Proper Analytics: Webhook server correctly classifies events by platform
  • βœ… Enhanced Monitoring: Clear distinction between bot vs dashboard activities
  • βœ… Audit Compliance: Complete traceability of user interactions
  • βœ… Event Routing: Accurate downstream processing and workflow automation

Technical Reference: Webhook Server Platform Detection Logic

πŸ›‘οΈ Security & Supply Chain

This project implements comprehensive supply chain security measures including:

  • SBOM generation for all container images
  • Build provenance attestations for transparency
  • Automated vulnerability scanning with Trivy
  • Multi-layer security from development to production

For complete security documentation, see the Contributing Guide.