Accès
Interface web : https://<SERVER_IP>
Point de terminaison API : https://<SERVER_IP>:5004
Identifiants administrateur par défaut :
- E-mail :
[email protected] - Mot de passe :
1234
Modifiez les identifiants administrateur immédiatement après la première connexion.
Avis : certificat auto-signé
Cette installation utilise un certificat TLS auto-signé.
Un avertissement SSL du navigateur est attendu.
Pour les appels API avec curl, vous devez désactiver la validation du certificat :
curl -k https://<SERVER_IP>:5004
La -k Ce paramètre indique à curl d'ignorer la vérification du certificat TLS.
Exemple pour obtenir un token API :
curl -k https://<SERVER_IP>:5004/api/v1/auth/login
-H "Content-Type: application/json"
-d '{"email":"[email protected]","password":"1234"}'
Cette commande retourne une réponse JSON contenant un token.
Exemple pour obtenir un token API :
curl -k -i https://<SERVER_IP>:5004/api/v1/<VALID_ENDPOINT>
-H "Authorization: Bearer <TOKEN>"
En production, remplacez le certificat auto-signé par un certificat SSL approuvé (par exemple, Let's Encrypt).
Fichiers et répertoires importants
- Répertoire d'installation :
/root/peppermint - Variables d'environnement (identifiants DB, secrets, BASE_URL) :
/root/peppermint/.env - Configuration Docker Compose :
/root/peppermint/docker-compose.yml - Données persistantes PostgreSQL (volume Docker) :
/var/lib/docker/volumes/pgdata/_data - Configurations du reverse proxy Nginx :
/etc/nginx/conf.d/peppermint-client.conf&/etc/nginx/conf.d/peppermint-api.conf - Certificats TLS (auto-signés ou Let's Encrypt) :
/etc/nginx/ssl/
Activer SSL avec un domaine
1. Faites pointer votre domaine vers l'adresse IP du serveur.
2. Modifiez le fichier /root/peppermint/.env pour définir votre nom de domaine : BASE_URL=https://your.domain.com
3. Recréez les services :
cd /root/peppermint/
docker compose up -d
4. Modifiez les configurations Nginx et remplacez server_name <IP>; par votre domaine (« <your-domain>) pour les blocs HTTP (port 80) et HTTPS (port 443) :
vim /etc/nginx/conf.d/peppermint-client.conf
vim /etc/nginx/conf.d/peppermint-api.conf
5. Installez Certbot :
apt install -y certbot python3-certbot-nginx
6. Exécutez la commande suivante pour générer un certificat Let's Encrypt valide :
certbot certonly --nginx --non-interactive --agree-tos --email [email protected] -d yourdomain.com
7. Remplacez les chemins SSL dans la configuration Nginx (section TLS) :
vim /etc/nginx/conf.d/peppermint-client.conf
vim /etc/nginx/conf.d/peppermint-api.conf
# Before:
# ssl_certificate /etc/nginx/ssl/fullchain.pem;
# ssl_certificate_key /etc/nginx/ssl/privkey.pem;
# After:
# ssl_certificate /etc/letsencrypt/live/yourdomain.com/fullchain.pem;
# ssl_certificate_key /etc/letsencrypt/live/yourdomain.com/privkey.pem;
8. Redémarrez Nginx pour appliquer les modifications :
systemctl restart nginx
9. Ouvrez votre navigateur et accédez à : https://yourdomain.com