248 lines
6.2 KiB
Markdown
248 lines
6.2 KiB
Markdown
# InnotexBoard - Interface d'Administration Debian Légère
|
|
|
|
Alternative légère à Cockpit pour administrer des serveurs Debian via le web.
|
|
|
|
## 🎯 Caractéristiques
|
|
|
|
- ✅ **Authentification PAM** - Connexion via les utilisateurs système Debian
|
|
- 📊 **Dashboard système** - Surveillance CPU, RAM et processus en temps réel
|
|
- 🐳 **Gestion Docker** - Contrôler les conteneurs (start/stop/restart)
|
|
- 🔐 **JWT Authentication** - API sécurisée avec tokens
|
|
- 🎨 **Interface moderne** - Dashboard sombre avec Vue.js 3 + Tailwind CSS
|
|
- ⚡ **Léger** - Peu de dépendances, performance optimale
|
|
|
|
## 📋 Stack technique
|
|
|
|
### Backend
|
|
- **FastAPI** - Framework web async haute performance
|
|
- **python-pam** - Authentification système
|
|
- **psutil** - Monitoring système
|
|
- **Docker SDK** - Gestion Docker
|
|
- **PyJWT** - Tokens JWT
|
|
|
|
### Frontend
|
|
- **Vue.js 3** - Framework réactif moderne
|
|
- **Tailwind CSS** - Styling utilitaire
|
|
- **Vite** - Build tool rapide
|
|
- **Axios** - Client HTTP
|
|
|
|
## 🚀 Installation rapide
|
|
|
|
### Prérequis
|
|
|
|
- Python 3.8+
|
|
- Node.js 16+
|
|
- Docker (optionnel, pour Docker API)
|
|
- Accès root/sudo
|
|
|
|
### Backend
|
|
|
|
```bash
|
|
cd backend
|
|
|
|
# Installer les dépendances
|
|
pip install -r requirements.txt
|
|
|
|
# Copier la configuration
|
|
cp .env.example .env
|
|
|
|
# Lancer le serveur
|
|
python main.py
|
|
```
|
|
|
|
L'API sera accessible à `http://localhost:8000`
|
|
Documentation Swagger : `http://localhost:8000/docs`
|
|
|
|
### Frontend
|
|
|
|
```bash
|
|
cd frontend
|
|
|
|
# Installer les dépendances
|
|
npm install
|
|
|
|
# Lancer le serveur de développement
|
|
npm run dev
|
|
```
|
|
|
|
L'interface sera accessible à `http://localhost:3000`
|
|
|
|
## 🔐 Configuration des permissions
|
|
|
|
Voir [PERMISSIONS.md](PERMISSIONS.md) pour :
|
|
- Configuration Docker
|
|
- Permissions système
|
|
- Configuration PAM
|
|
- Déploiement en production
|
|
|
|
## 📡 Endpoints API
|
|
|
|
### Authentification
|
|
- `POST /api/v1/auth/login` - Connexion PAM
|
|
- `GET /api/v1/auth/me` - Info utilisateur
|
|
- `POST /api/v1/auth/logout` - Déconnexion
|
|
|
|
### Système
|
|
- `GET /api/v1/system/stats` - Stats CPU/RAM/Processus
|
|
- `GET /api/v1/system/cpu` - Stats CPU uniquement
|
|
- `GET /api/v1/system/memory` - Stats mémoire uniquement
|
|
- `GET /api/v1/system/processes` - Liste processus
|
|
|
|
### Docker
|
|
- `GET /api/v1/docker/status` - Statut de connexion
|
|
- `GET /api/v1/docker/containers` - Liste conteneurs
|
|
- `POST /api/v1/docker/containers/{id}/start` - Démarrer
|
|
- `POST /api/v1/docker/containers/{id}/stop` - Arrêter
|
|
- `POST /api/v1/docker/containers/{id}/restart` - Redémarrer
|
|
- `DELETE /api/v1/docker/containers/{id}` - Supprimer
|
|
|
|
## 🗂️ Structure du projet
|
|
|
|
```
|
|
innotexboard/
|
|
├── backend/
|
|
│ ├── app/
|
|
│ │ ├── core/ # Configuration, sécurité
|
|
│ │ ├── api/ # Routes et endpoints
|
|
│ │ │ └── endpoints/ # Auth, system, docker
|
|
│ │ └── services/ # Logique métier
|
|
│ ├── main.py # Point d'entrée
|
|
│ ├── requirements.txt # Dépendances Python
|
|
│ └── README.md
|
|
├── frontend/
|
|
│ ├── src/
|
|
│ │ ├── components/ # Composants réutilisables
|
|
│ │ ├── views/ # Pages (Login, Dashboard, Containers)
|
|
│ │ ├── stores/ # State management Pinia
|
|
│ │ ├── api/ # Client HTTP
|
|
│ │ ├── router/ # Routage Vue Router
|
|
│ │ └── assets/ # Styles et images
|
|
│ ├── package.json
|
|
│ ├── vite.config.js # Configuration Vite
|
|
│ ├── tailwind.config.js # Configuration Tailwind
|
|
│ └── index.html
|
|
├── PERMISSIONS.md # Guide de configuration
|
|
└── README.md
|
|
```
|
|
|
|
## 🛡️ Sécurité
|
|
|
|
### Authentification
|
|
- Authentification via PAM (système Debian)
|
|
- Tokens JWT pour sécuriser l'API
|
|
- Expiration des tokens configurable
|
|
|
|
### API
|
|
- CORS limité aux origines autorisées
|
|
- Headers de confiance (TrustedHost)
|
|
- Validation des données Pydantic
|
|
|
|
### Production
|
|
- Utiliser HTTPS
|
|
- Changer la SECRET_KEY
|
|
- Ajouter un reverse proxy (Nginx)
|
|
- Voir [PERMISSIONS.md](PERMISSIONS.md) pour plus de détails
|
|
|
|
## 📝 Exemples d'utilisation
|
|
|
|
### Login et obtenir un token
|
|
|
|
```bash
|
|
curl -X POST "http://localhost:8000/api/v1/auth/login" \
|
|
-H "Content-Type: application/x-www-form-urlencoded" \
|
|
-d "username=your_user&password=your_pass"
|
|
```
|
|
|
|
### Récupérer les stats système
|
|
|
|
```bash
|
|
curl -X GET "http://localhost:8000/api/v1/system/stats" \
|
|
-H "Authorization: Bearer YOUR_TOKEN"
|
|
```
|
|
|
|
### Lister les conteneurs Docker
|
|
|
|
```bash
|
|
curl -X GET "http://localhost:8000/api/v1/docker/containers" \
|
|
-H "Authorization: Bearer YOUR_TOKEN"
|
|
```
|
|
|
|
## 🚀 Déploiement
|
|
|
|
### Avec Systemd
|
|
|
|
Voir [PERMISSIONS.md](PERMISSIONS.md) pour la configuration du service.
|
|
|
|
### Avec Docker
|
|
|
|
```bash
|
|
docker run -d \
|
|
-p 8000:8000 \
|
|
-v /var/run/docker.sock:/var/run/docker.sock \
|
|
-e SECRET_KEY="your-key" \
|
|
innotexboard-backend
|
|
```
|
|
|
|
### Avec Nginx
|
|
|
|
Configuration exemple :
|
|
|
|
```nginx
|
|
server {
|
|
listen 80;
|
|
server_name admin.example.com;
|
|
|
|
location / {
|
|
proxy_pass http://localhost:3000;
|
|
proxy_set_header Host $host;
|
|
}
|
|
|
|
location /api {
|
|
proxy_pass http://localhost:8000;
|
|
proxy_set_header Authorization $http_authorization;
|
|
}
|
|
}
|
|
```
|
|
|
|
## 🐛 Troubleshooting
|
|
|
|
### Erreur Docker: "Permission denied"
|
|
→ Voir [PERMISSIONS.md](PERMISSIONS.md) section "Permissions Docker"
|
|
|
|
### Erreur PAM: "Permission denied"
|
|
→ L'utilisateur doit être dans le groupe `shadow`
|
|
```bash
|
|
sudo usermod -aG shadow $USER
|
|
```
|
|
|
|
### Erreur psutil: "Permission denied"
|
|
→ Lancer avec `sudo` ou changer les permissions de `/proc`
|
|
|
|
## 📚 Documentation complète
|
|
|
|
- [FastAPI Docs](https://fastapi.tiangolo.com)
|
|
- [Vue 3 Docs](https://vuejs.org)
|
|
- [Tailwind CSS](https://tailwindcss.com)
|
|
- [Docker Python SDK](https://docker-py.readthedocs.io)
|
|
|
|
## 📄 Licence
|
|
|
|
MIT
|
|
|
|
## 🤝 Contribution
|
|
|
|
Les contributions sont bienvenues ! N'hésitez pas à :
|
|
1. Fork le projet
|
|
2. Créer une branche (`git checkout -b feature/AmazingFeature`)
|
|
3. Commit les changements (`git commit -m 'Add AmazingFeature'`)
|
|
4. Push la branche (`git push origin feature/AmazingFeature`)
|
|
5. Ouvrir une Pull Request
|
|
|
|
## 📧 Support
|
|
|
|
Pour toute question ou problème, ouvrez une issue sur le repository.
|
|
|
|
---
|
|
|
|
**Fait avec ❤️ pour les administrateurs Debian**
|