admin 30c2cfeba5 feat(security): Implement comprehensive security fixes and enhancements
- Added Security Handoff Report detailing resolved issues and current configurations.
- Implemented CSRF protection using Flask-WTF, including token management in templates and JavaScript.
- Created standardized error handling module to log detailed errors while returning generic messages.
- Developed phone number validation module to ensure compliance with E.164 standards.
- Added CSV injection prevention measures during file uploads.
- Updated installation guide for clarity and completeness.
- Created script to update API keys from Android device, ensuring secure key management.
- Enhanced Docker security configurations to remove privileged mode and host networking.
- Implemented logging and sanitization for error messages to prevent information disclosure.
- Added verification script to test security setup flow and validate configurations.
2026-01-01 17:18:50 -07:00

4.8 KiB

SMS Campaign Manager Documentation

SMS Campaign Manager is a Dockerized SMS automation system with Android device integration via Termux API. It provides a web interface for managing campaigns, tracking responses, and viewing analytics.

Getting Started

New to SMS Campaign Manager? Follow these guides in order:

  1. Installation Guide - Complete production setup
  2. Quick Start - Deploy and verify your installation
  3. Authentication Setup - Configure user login

Documentation Overview

Setup

Guide Description
Installation Guide Step-by-step production installation
Quick Start Rapid deployment and testing
Authentication Setup User login and session configuration

Security

Guide Description
Security Setup API keys, Docker security, best practices
API Security API authentication implementation

Deployment

Guide Description
Deployment Guide Production deployment with Tailscale

User Guides

Guide Description
User Management Creating and managing users
Testing Verification and testing procedures
Troubleshooting Common issues and solutions

Development

Guide Description
Android Development Android device configuration
Termux Flask Setup Termux server configuration

Reference

Guide Description
API Endpoints Complete API reference
Environment Variables Configuration options
File Structure Project organization
Project Instructions Development guidelines

System Architecture

Ubuntu Server (Docker)          Android Device (Termux)
┌─────────────────────┐        ┌─────────────────────┐
│  Flask Web App      │        │  Termux SMS API     │
│  Port 5000          │◄──────►│  Port 5001          │
│                     │        │                     │
│  - Campaign Mgmt    │        │  - SMS Sending      │
│  - Contact Upload   │        │  - Device Status    │
│  - Analytics        │        │  - Response Sync    │
│  - User Auth        │        │                     │
└─────────────────────┘        └─────────────────────┘
         │                              │
         ▼                              ▼
    SQLite Database             Android SMS System

Key Features

Campaign Management

  • Create and schedule SMS campaigns
  • Import contacts from CSV files
  • Personalize messages with template variables
  • Track delivery and responses

User Management

  • Web-based login (no browser extensions needed)
  • Role-based access control (Admin/User)
  • API key authentication for automation
  • 24-hour session persistence

Android Integration

  • Send SMS via Termux API
  • Automatic device status monitoring
  • Battery and connectivity tracking
  • Fallback to ADB if needed

Security

  • API key authentication
  • Session-based web authentication
  • Docker container isolation
  • Encrypted Tailscale connectivity

Requirements

Ubuntu Server

  • Docker and Docker Compose
  • Tailscale (recommended) or local network access

Android Device

  • Termux (from F-Droid, not Google Play)
  • Termux:API (from F-Droid)
  • Tailscale app
  • SSH server enabled in Termux

Project Structure

campaign_connector/
├── src/               # Flask application code
├── android/           # Android Termux servers
├── docs/              # Documentation (this site)
├── scripts/           # Deployment and utility scripts
├── docker/            # Docker configuration
├── data/              # SQLite database (runtime)
├── uploads/           # CSV uploads (runtime)
└── logs/              # Application logs (runtime)