secubox-openwrt/luci-app-cdn-cache/README.md
CyberMind-FR 403283419c docs: Reorganize documentation structure and add architecture diagrams
Major documentation improvements and restructuring for better maintainability
and navigation.

## Structural Changes

### New Documentation Organization
- Move all documentation to DOCS/ directory for better organization
- Create DOCS/archive/ for historical documents
- Move deployment scripts to secubox-tools/ directory

### Archived Documents
- COMPLETION_REPORT.md → archive/ (project milestone)
- MODULE-ENABLE-DISABLE-DESIGN.md → archive/ (feature implemented)
- BUILD_ISSUES.md → archive/ (issues resolved)
- Add archive/README.md with archiving policy and document index

## Documentation Enhancements

### Version Standardization
- Add version headers to CLAUDE.md (v1.0.0)
- Add version headers to BUILD_ISSUES.md (v1.0.0)
- Standardize date format to YYYY-MM-DD across all docs

### Cross-References & Navigation
- Add "See Also" sections to PERMISSIONS-GUIDE.md
- Add "See Also" sections to VALIDATION-GUIDE.md
- Link quick references to detailed guides
- Improve documentation discoverability

### Architecture Diagrams (Mermaid)
Add 3 professional diagrams to DEVELOPMENT-GUIDELINES.md:

1. **System Architecture Diagram** (§2)
   - Complete data flow: Browser → LuCI → RPCD → ubus → System
   - Color-coded components by layer
   - Shows JavaScript, RPC, RPCD daemon, UCI, system services

2. **Deployment Workflow Diagram** (§9)
   - Step-by-step deployment process with validation checkpoints
   - Error recovery paths for common issues (403, 404, -32000)
   - Local validation, file transfer, permission fixes, service restarts

3. **Component Hierarchy Diagram** (§1)
   - Standard page structure and CSS class relationships
   - Page → Header → Stats → Content → Cards → Buttons
   - Shows design system component organization

## New Files

### TODO-ANALYSE.md
- Comprehensive documentation improvement roadmap
- Tasks categorized: Immediate, Short-term, Long-term, Optional
- Progress tracking with acceptance criteria
- Covers testing, security, performance guides
- Documentation automation plans

## Benefits

 Cleaner project structure (docs in DOCS/, tools in secubox-tools/)
 Better documentation navigation with cross-references
 Visual understanding through architecture diagrams
 Historical documents archived but accessible
 Standardized versioning across all documentation
 Clear roadmap for future documentation improvements

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2025-12-28 09:52:15 +01:00

157 lines
4.4 KiB
Markdown

# SecuBox CDN Cache Dashboard
**Version:** 1.0.0
**Last Updated:** 2025-12-28
**Status:** Active
[![OpenWrt](https://img.shields.io/badge/OpenWrt-23.05+-blue.svg)](https://openwrt.org/)
[![License](https://img.shields.io/badge/License-Apache%202.0-green.svg)](LICENSE)
[![SecuBox](https://img.shields.io/badge/SecuBox-Module-cyan.svg)](https://cybermind.fr/secubox)
Dashboard LuCI pour gérer un proxy cache CDN local sur OpenWrt. Optimisez votre bande passante en cachant le contenu web fréquemment accédé.
![CDN Cache Dashboard](docs/screenshot-overview.png)
## 🎯 Fonctionnalités
- **📊 Dashboard temps réel** — Statistiques de hit ratio, économies de bande passante
- **💾 Gestion du cache** — Visualisation des objets en cache, purge sélective
- **📋 Policies configurables** — Règles par domaine, extension, durée
- **📈 Graphiques statistiques** — Évolution du hit ratio et des économies
- **🔧 Maintenance** — Purge, préchargement, logs, redémarrage
- **⚙️ Configuration complète** — Taille cache, port, mode transparent
## 📦 Installation
### Depuis les packages SecuBox
```bash
opkg update
opkg install luci-app-cdn-cache
```
### Compilation manuelle
```bash
# Cloner dans le SDK OpenWrt
git clone https://github.com/gkerma/luci-app-cdn-cache.git package/luci-app-cdn-cache
# Compiler
make package/luci-app-cdn-cache/compile V=s
```
## 🔧 Configuration
### Via LuCI
1. Accéder à **Services → CDN Cache → Settings**
2. Configurer la taille du cache, le port et les policies
3. Activer le service
### Via UCI
```bash
# Activer le service
uci set cdn-cache.main.enabled=1
uci set cdn-cache.main.cache_size=2048
uci set cdn-cache.main.listen_port=3128
uci commit cdn-cache
# Redémarrer
/etc/init.d/cdn-cache restart
```
### Configuration client
Configurez vos appareils pour utiliser le proxy :
```
Proxy HTTP: 192.168.1.1:3128
```
Ou utilisez le mode transparent avec des règles iptables.
## 📊 Policies de Cache
Les policies définissent quoi cacher et pour combien de temps :
| Policy | Domaines | Extensions | Durée |
|--------|----------|------------|-------|
| Windows Update | windowsupdate.com, download.microsoft.com | exe, msu, cab | 7 jours |
| Linux Repos | archive.ubuntu.com, deb.debian.org | deb, rpm | 3 jours |
| Static Content | * | js, css, png, jpg, woff | 1 jour |
## 🚫 Exclusions
Certains domaines ne doivent jamais être cachés :
- **Sites bancaires** — Sécurité
- **Streaming vidéo** — Contenu temps réel
- **APIs dynamiques** — Données changeantes
## 📁 Structure du Package
```
luci-app-cdn-cache/
├── Makefile
├── htdocs/luci-static/resources/
│ ├── view/cdn-cache/
│ │ ├── overview.js # Dashboard principal
│ │ ├── cache.js # Gestion du cache
│ │ ├── policies.js # Configuration policies
│ │ ├── statistics.js # Graphiques stats
│ │ ├── maintenance.js # Outils maintenance
│ │ └── settings.js # Configuration
│ └── cdn-cache/
│ ├── api.js # API RPC
│ └── dashboard.css # Styles
└── root/
├── etc/
│ ├── config/cdn-cache # Configuration UCI
│ └── init.d/cdn-cache # Script init
└── usr/
├── libexec/rpcd/cdn-cache # Backend RPCD
└── share/
├── luci/menu.d/ # Menu LuCI
└── rpcd/acl.d/ # ACL
```
## 🔗 API RPCD
| Méthode | Description |
|---------|-------------|
| `status` | État du service |
| `stats` | Statistiques globales |
| `cache_list` | Liste des objets en cache |
| `top_domains` | Top domaines par usage |
| `bandwidth_savings` | Économies de bande passante |
| `purge_cache` | Vider tout le cache |
| `purge_domain` | Vider cache d'un domaine |
| `preload_url` | Précharger une URL |
## 🔧 Dépendances
- `luci-base` — Framework LuCI
- `nginx-ssl` — Serveur proxy
- `rpcd` — Daemon RPC
- `coreutils-stat` — Utilitaires
## 📈 Performances
Avec une configuration optimale :
- **Hit ratio** : 60-80% typique
- **Économies** : 40-60% de bande passante
- **Latence** : < 1ms pour les hits
## 🔗 Liens
- [Documentation](https://cybermind.fr/apps/cdn-cache)
- [SecuBox Project](https://cybermind.fr/secubox)
- [CyberMind.fr](https://cybermind.fr)
## 📄 Licence
Apache-2.0 © 2025 CyberMind.fr