Basculer le menu
Changer de menu des préférences
Basculer le menu personnel
Non connecté(e)
Votre adresse IP sera visible au public si vous faites des modifications.
Version datée du 14 mai 2026 à 14:27 par Eugene (discussion | contributions)
(diff) ← Version précédente | Voir la version actuelle (diff) | Version suivante → (diff)

Retour Linux | Accueil | Architecture Infra Finale

Étape 1 — Préparer le dossier de l’application

Création l’arborescence :

sudo mkdir -p /opt/outils/templates
sudo mkdir -p /opt/outils/static

Étape 2 — Créer l’environnement Python

cd /opt/outils

sudo python3 -m venv venv

Étape 3 — Installer Flask + Gunicorn

sudo /opt/outils/venv/bin/pip install flask gunicorn

Étape 4 — Créer l’application Flask

Créer :

sudo nano /opt/outils/app.py

Puis mettre :

 from flask import Flask, render_template
 
 app = Flask(__name__)
 
 SERVICES = [
    {
        "name": "Nextcloud",
        "url": "https://cloud.ec-informatique.fr",
        "description": "Cloud personnel"
    },
    {
        "name": "MeshCentral",
        "url": "https://support.ec-informatique.fr",
        "description": "Support distant"
    },
    {
        "name": "Grafana",
        "url": "https://grafana.ec-informatique.fr",
        "description": "Monitoring"
    },
    {
        "name": "Wiki",
        "url": "https://wiki.ec-informatique.fr",
        "description": "Documentation infrastructure"
    },
 ]
 
 @app.route('/')
 def index():
    return render_template('index.html', services=SERVICES)
 
 if __name__ == '__main__':
    app.run(host='0.0.0.0', port=5050)

Étape 5 — Créer le template HTML

Créer :

sudo nano /opt/outils/templates/index.html

Puis :

<!DOCTYPE html>
<html lang="fr">
<head>
   <meta charset="UTF-8">
   <title>Infrastructure EC-Informatique</title>

   <style>
       body {
           font-family: Arial, sans-serif;
           background: #111827;
           color: white;
           margin: 40px;
       }

       .grid {
           display: grid;
           grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
           gap: 20px;
       }

       .card {
           background: #1f2937;
           padding: 20px;
           border-radius: 10px;
       }

       a {
           color: #60a5fa;
           text-decoration: none;
       }
   </style>
</head>
<body>

Infrastructure EC-Informatique

{% for service in services %}
{% endfor %}

</body>
</html>

Étape 6 — Tester localement

Lancer :

cd /opt/outils
sudo /opt/outils/venv/bin/python app.py

On doit voir :

Running on http://0.0.0.0:5050


Configuration Service

En-tête

Nom du service :
URL :
Fonction :
Type : 
Exposition :

Infrastructure

Machine hôte : 
Docker / VM / service :
Port interne :
Dépendances :
Volumes :
Base de données :

Reverse proxy

Vhost nginx :
Certificat SSL :
Proxy_pass :

Sauvegarde

Méthode :
Fréquence :
Emplacement :

Sécurité

Auth MFA :
VPN requis:
Fail2ban :
Firewall :