$ show opsre/LiteOps
LiteOps is a lightweight, self-hosted CI/CD platform built with Django 4.2 (Python 3.9) and Vue 3 (Ant Design Vue). It provides project management, build task configuration, credential storage (GitLab tokens, SSH keys, kubeconfig), environment management, and notification robots (DingTalk, WeChat, Feishu). Builds are executed inside a Docker-in-Docker container that includes Java, Maven, Node, and kubectl, with real-time log streaming via Server-Sent Events (SSE). The system integrates with GitLab for webhook-triggered builds and branch/commit information, supports LDAP authentication, and enforces role-based permissions (function and data scopes). The frontend dashboard displays build statistics, trends, and recent builds using ECharts. The codebase is functional and actively developed, but exhibits several engineering weaknesses: no automated tests, threading for async build execution (no task queue), hardcoded secrets (admin password, database credentials), SHA256 password hashing (not bcrypt), and plaintext storage of GitLab tokens. The Docker image is large and requires privileged mode. Despite these issues, the system is suitable for small teams needing a simple, integrated CI/CD solution without external dependencies beyond GitLab and MySQL.
The LLM identified 3 files worth highlighting for reuse:
Implements a thread-safe singleton LogStreamManager that manages per-build log queues and SSE client connections. Each build has a dedicated queue; the manager supports adding log lines, registering/unregistering SSE clients, and cleaning up on build completion. This pattern is reusable for any real-time log streaming feature (e.g., CI/CD, server monitoring) and demonstrates careful handling of concurrency with threading.Lock and queue.Queue.
Provides a BuildNotifier class that formats and sends build notifications to DingTalk, WeChat Work, and Feishu robots. It handles message formatting (text, markdown), HMAC-SHA256 signature generation for DingTalk, and webhook URL construction. The class is self-contained and can be extracted for any project needing multi-platform notification dispatch with minimal adaptation.
Contains SecurityValidator for password strength checking (length, character types, common patterns) and account lockout logic (tracking failed attempts, lockout duration). Also includes CryptoUtils using Fernet symmetric encryption for sensitive data like LDAP passwords. These utilities are isolated from Django models and can be reused in any Python application requiring security validation and encryption.