Claude Add complete API files with filesystem endpoints

This commit is contained in:
nicoboy
2026-01-01 17:47:52 +01:00
parent 9550e05045
commit 7e72663685
11 changed files with 1268 additions and 0 deletions

50
config/allowed_paths.yaml Normal file
View File

@ -0,0 +1,50 @@
# Configuration des chemins autorisés pour l'accès fichiers
# Format YAML
# Chemins autorisés en LECTURE
allowed_read_paths:
- /var/www/mathematiques
- /var/www/html
- /enseignement
# Chemins autorisés en ÉCRITURE (pour plus tard)
allowed_write_paths:
- /var/www/mathematiques/_generated
- /var/www/mathematiques/uploads
# Chemins BLOQUÉS (sécurité)
blocked_paths:
- /etc
- /root
- /home
- /boot
- /sys
- /proc
- /.ssh
- /var/log
# Extensions de fichiers autorisées
allowed_extensions:
- .php
- .html
- .css
- .js
- .json
- .xml
- .txt
- .md
- .sql
- .py
- .sh
- .conf
- .yaml
- .yml
# Taille maximale de fichier (en octets)
max_file_size: 10485760 # 10 MB
# Nombre max de fichiers retournés par listing
max_files_listing: 1000
# Profondeur max pour récursion
max_recursion_depth: 10

34
config/example.env Normal file
View File

@ -0,0 +1,34 @@
# Exemple de configuration - Copier vers .env et modifier les valeurs
# Application
APP_NAME="Jetson Agent API"
APP_VERSION="1.0.0"
APP_ENV="development" # development, production
LOG_LEVEL="info" # debug, info, warning, error
# API Configuration
API_HOST="0.0.0.0"
API_PORT=8000
API_RELOAD=true # false en production
# Sécurité JWT
JWT_SECRET_KEY="CHANGE_ME_GENERATE_WITH_openssl_rand_hex_32"
JWT_ALGORITHM="HS256"
JWT_ACCESS_TOKEN_EXPIRE_MINUTES=1440 # 24 heures
# Chemins de configuration
CONFIG_DIR="/home/nicoboy/projects/jetson-agent/config"
ALLOWED_PATHS_CONFIG="allowed_paths.yaml"
# Réseau et sécurité
ALLOWED_IPS="192.168.1.0/24,82.67.167.0/24" # Adapte selon ton réseau
CORS_ORIGINS="http://localhost:3000,https://82.67.167.147"
# Rate limiting
RATE_LIMIT_ENABLED=true
RATE_LIMIT_PER_MINUTE=100
# Logs
LOG_FILE="/home/nicoboy/projects/jetson-agent/logs/api.log"
LOG_ROTATION_SIZE=10485760 # 10 MB
LOG_BACKUP_COUNT=5