Skip to content

Latest commit

 

History

43 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

πŸ›‘οΈ AutoRedact

Secure, client-side image redaction powered by OCR.

CI Release License: GPL v3

Deploy to Cloudflare

All processing happens 100% in your browser. Your images never touch a server.

✨ Features

  • πŸ” Automatic Detection - Finds emails, IP addresses, credit cards, and API keys
  • 🎯 Precise Redaction - Uses OCR word-level bounding boxes for accurate redaction
  • πŸ”’ Privacy First - Everything runs locally via Tesseract.js
  • πŸ“¦ Batch Processing - Process unlimited images at once
  • ⚑ ZIP Download - Download all redacted files in one click

πŸš€ Quick Start

# Option 1: NPM (Local Dev)
npm install
npm run dev

# Option 2: Docker (Easiest)
docker run -p 8080:8080 karantdev/autoredact:latest

# Option 3: Docker Compose
docker compose up -d

Open http://localhost:5173 and drop your images.

Command Line Interface (CLI)

AutoRedact now supports a fully offline CLI mode using the same powerful engine. (jpg and png support only, for now. PDF support incoming)

# Process a single image
npm run cli -- input.jpg

# Disable specific redactors
npm run cli -- input.jpg --no-emails --no-ips

# Use custom rules
npm run cli -- input.jpg --block-words "Confidential" --custom-regex "Project-\d+"

🎯 What Gets Redacted

Type Pattern
πŸ“§ Emails user@example.com
🌐 IPs 192.168.1.1
πŸ’³ Credit Cards 4242-4242-4242-4242
πŸ”‘ API Keys Stripe, GitHub, AWS

πŸ› οΈ Tech Stack

  • React + Vite + TypeScript
  • Tesseract.js v6 (OCR)
  • JSZip (batch exports)
  • Tailwind CSS

πŸ“ Structure

src/
β”œβ”€β”€ adapters/     # Interface implementations (Browser/Node)
β”œβ”€β”€ components/   # UI Components
β”œβ”€β”€ core/         # Pure Logic (Regex, Math, Image Proc)
β”œβ”€β”€ hooks/        # Custom Hooks
β”œβ”€β”€ utils/        # Helpers
β”œβ”€β”€ types/        # TS Interfaces
β”œβ”€β”€ cli.ts        # CLI Entry Point
└── App.tsx       # Main Entry

πŸ“„ License

GNU General Public License v3.0

πŸ“– Real-World Recipes

πŸ› οΈ CLI Power Usage

1. Batch Process a Directory

The CLI processes one file at a time. Use a shell loop to process entire folders:

# Process all JPGs in 'input' dir and save to 'output' dir
mkdir -p output
for f in input/*.jpg; do
  npm run cli -- "$f" -o "output/$(basename "$f")"
done

2. Strict Redaction for Finance/Invoices

Enable strict blocking for sensitive documents:

npm run cli -- invoice.jpg \
  --block-words "Confidential,SSN,Account" \
  --custom-regex "(?i)account\s*#?\s*\d+" \
  --no-ips # Disable IP scanner if irrelevant to boost speed

3. Allowlist for Internal Docs

Prevent redaction of known internal terms or headers:

npm run cli -- internal-doc.jpg \
  --allowlist "CorpCorp,192.168.1.1,ProjectX"

The Docker API is proxied through nginx and available on port 8080 at /api/. It uses standard detection settings (Emails, IPs, Keys, PII) by default, but is fully configurable via the settings parameter.

πŸ‘‰ View Full API Documentation for detailed usage, schema, and Python/Node.js examples.

Quick Test (Curl)

curl -X POST http://localhost:8080/api/redact \
  -F "image=@/path/to/doc.jpg" \
  -o redacted.png

About

πŸ›‘οΈ Client-side, privacy-first image redaction tool. Automatically detects and blurs PII (Emails, IPs, Keys) using local OCR. No server, no data leaks.

Topics

Resources

Contributing

Security policy

Stars

78 stars

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages