Ajouter le .env pour faire fonctionner le projet
docker-compose up --build http://localhost:8080/
ctrl + c docker-compose down
docker-compose down --volumes
net/http (serveur HTTP, routes) Apache/nginx + $_GET, $_POST, $_SERVER encoding/json json_encode, json_decode database/sql + go-sql-driver/mysql PDO (pdo_mysql extension livrée standard) Requêtes paramétrées avec ? $pdo->prepare(...) avec ? (syntaxe identique) golang.org/x/crypto/bcrypt password_hash($p, PASSWORD_BCRYPT) / password_verify golang-jwt/jwt/v5 hash_hmac('sha256', ...) + base64_encode + json_encode (JSON+base64+HMAC) crypto/rand (token confirmation) random_bytes(32) + bin2hex html.EscapeString (XSS) htmlspecialchars($s, ENT_QUOTES, 'UTF-8') image/png, image/gif, image/draw (fusion) Extension GD: imagecreatefrompng, imagecopy, imagerotate disintegration/imaging (resize/rotate) imagescale, imagerotate net/smtp (mail) mail() ou fsockopen + commandes SMTP brutes net/mail.ParseAddress (validation) filter_var($e, FILTER_VALIDATE_EMAIL) time.Ticker (cleaner async) Cron job (crontab standard) Goroutines (mail async non-bloquant) pcntl_fork ou fastcgi_finish_request
Mots de passe bcrypt Anti-XSS côté serveur (html.EscapeString sur username + commentaires) et côté client (escapeHTML avant innerHTML) Anti-SQLi: toutes les requêtes sont paramétrées (?), zéro concaténation Upload contrôlé: http.DetectContentType sur le MIME, whitelist des overlays serveur, taille limitée par nginx et par ParseMultipartForm côté Go JWT: signés HS256, révocation côté DB, expiration 24h, cleaner async toutes les 5 min Credentials hors du repo: tout dans .env (gitignored)