Logo Khaganat

Différences

Ci-dessous, les différences entre deux révisions de la page.

Lien vers cette vue comparative

Les deux révisions précédentesRévision précédente
Dernière révisionLes deux révisions suivantes
fr:manager [2017/11/03 22:06] YannKfr:manager [2017/11/13 21:36] aleajactaest
Ligne 50: Ligne 50:
 ==== Création d'un certificat ==== ==== Création d'un certificat ====
  
-La communication entre le client et le serveur s’effectue via une clef et un certificat+Pour la création du certificat, nous utilisons la version TLS1.2. 
-Cela sécurise la communication entre ce deux modules.+ 
 +Vous retrouver dans le code un script python pour générer (pour le test) les certificats
 <code> <code>
-openssl req -nodes -x509 -newkey rsa:2048 -keyout "crt/key.pem" -out "crt/cert.pem" -days 365  -subj "/C=FR/ST=France/L=Paris/O=khaganat/CN=khaganat.org"+khanat-code/code/khaganat/tools/create_certificate.py
 </code> </code>
  
-On aura deux fichier +Il génère (en autre) 
-  * key.pem : clef +  * ca/private/cakey.pem           la clef de notre certificat racine 
-  * cert.pem : certificat+  * ca/certs/cacert.pem            le certificat racine  
 +  * ca/appli/certs/applicert.pem   : le certificat utilisé par tous les composant du Manager 
 +  * ca/appli/certs/cachaincert.pem : concaténation du certificat racine & application 
 +  * ca/appli/private/serverkey.pem : la clef du certificat du serveur (manager) 
 +  * ca/appli/certs/servercert.pem  : le certificat du serveur (manager) 
 +  * ca/appli/private/clientkey.pem : la clef du certificat du client 
 +  * ca/appli/certs/clientcert.pem  : le certificat du client 
  
 ==== Configuration ==== ==== Configuration ====
Ligne 70: Ligne 78:
 # Define port listen (default 8000) # Define port listen (default 8000)
 port = 8000 port = 8000
- 
-# Generate key 
-# openssl req -nodes -x509 -newkey rsa:2048 -keyout key.pem -out cert.pem -days 365 -subj "/C=FR/ST=France/L=Paris/O=khaganat/CN=khaganat.org" 
  
 # key # key
-keyfile = /home/gameserver/khanat/key.pem+keyfile = /home/gameserver/ca/appli/private/serverkey.pem
  
 # certificate # certificate
-certfile = /home/gameserver/khanat/cert.pem+certfile = /home/gameserver/ca/appli/certs/servercert.pem 
 + 
 +# certification to check signature 
 +ca_cert = /home/gameserver/ca/appli/certs/cachaincert.pem
  
 # address listen (default all port) # address listen (default all port)
Ligne 100: Ligne 108:
 path = /home/gameserver/khanat/server/ path = /home/gameserver/khanat/server/
  
-# size buffer log for each program launched +# size buffer log for each program launched (number line stdout) 
-sizelog = 1000+logsize = 1000 
 + 
 +# buffer size (define value bufsize on subprocess.Popen, this buffer is use before read by manager) 
 +bufsize = 100
  
 # Define other program # Define other program
Ligne 121: Ligne 132:
 contrôle l'état de tous les programmes (retourne "started" ou "stopped") contrôle l'état de tous les programmes (retourne "started" ou "stopped")
 <code> <code>
-/home/gameserver/ext/khaganat/tools/client.py --key="/home/gameserver/khanat/key.pem--cert="/home/gameserver/khanat/cert.pem--log="info" --show-log-console --command="STATUSALL"+/home/gameserver/ext/khaganat/tools/client.py --key /home/gameserver/ca/appli/private/clientkey.pem --cert /home/gameserver/ca/appli/certs/clientcert.pem --ca_cert /home/gameserver/ca/appli/certs/cachaincert.pem --log="info" --show-log-console --command="STATUSALL"
 </code> </code>
  
Ligne 127: Ligne 138:
 Démarre tous les programmes (retourne "started", "already-started" ou "crashed") Démarre tous les programmes (retourne "started", "already-started" ou "crashed")
 <code> <code>
-/home/gameserver/ext/khaganat/tools/client.py --key="/home/gameserver/khanat/key.pem--cert="/home/gameserver/khanat/cert.pem--log="info" --show-log-console --command="STARTALL"+/home/gameserver/ext/khaganat/tools/client.py --key /home/gameserver/ca/appli/private/clientkey.pem --cert /home/gameserver/ca/appli/certs/clientcert.pem --ca_cert /home/gameserver/ca/appli/certs/cachaincert.pem --log="info" --show-log-console --command="STARTALL"
 </code> </code>
  
Ligne 133: Ligne 144:
 Arrête tous les programmes (retourne "stopped") Arrête tous les programmes (retourne "stopped")
 <code> <code>
-/home/gameserver/ext/khaganat/tools/client.py --key="/home/gameserver/khanat/key.pem--cert="/home/gameserver/khanat/cert.pem--log="info" --show-log-console --command="STOPALL"+/home/gameserver/ext/khaganat/tools/client.py --key /home/gameserver/ca/appli/private/clientkey.pem --cert /home/gameserver/ca/appli/certs/clientcert.pem --ca_cert /home/gameserver/ca/appli/certs/cachaincert.pem --log="info" --show-log-console --command="STOPALL"
 </code> </code>
  
Ligne 139: Ligne 150:
 Arrête le manager (ainsi que tous les programmes) Arrête le manager (ainsi que tous les programmes)
 <code> <code>
-/home/gameserver/ext/khaganat/tools/client.py --key="/home/gameserver/khanat/key.pem--cert="/home/gameserver/khanat/cert.pem--log="info" --show-log-console --command="SHUTDOWN"+/home/gameserver/ext/khaganat/tools/client.py --key /home/gameserver/ca/appli/private/clientkey.pem --cert /home/gameserver/ca/appli/certs/clientcert.pem --ca_cert /home/gameserver/ca/appli/certs/cachaincert.pem --log="info" --show-log-console --command="SHUTDOWN"
 </code> </code>
  
Ligne 145: Ligne 156:
 Retourne la liste de tous les programmes disponible (démarré ou arrêté) Retourne la liste de tous les programmes disponible (démarré ou arrêté)
 <code> <code>
-/home/gameserver/ext/khaganat/tools/client.py --key="/home/gameserver/khanat/key.pem--cert="/home/gameserver/khanat/cert.pem--log="info" --show-log-console --command="LIST"+/home/gameserver/ext/khaganat/tools/client.py --key /home/gameserver/ca/appli/private/clientkey.pem --cert /home/gameserver/ca/appli/certs/clientcert.pem --ca_cert /home/gameserver/ca/appli/certs/cachaincert.pem --log="info" --show-log-console --command="LIST"
 </code> </code>
  
Ligne 151: Ligne 162:
 contrôle l'état de d'un programme (retourne "started" ou "stopped") contrôle l'état de d'un programme (retourne "started" ou "stopped")
 <code> <code>
-/home/gameserver/ext/khaganat/tools/client.py --key="/home/gameserver/khanat/key.pem--cert="/home/gameserver/khanat/cert.pem--log="info" --show-log-console --command="STATUS" --program="aes"+/home/gameserver/ext/khaganat/tools/client.py --key /home/gameserver/ca/appli/private/clientkey.pem --cert /home/gameserver/ca/appli/certs/clientcert.pem --ca_cert /home/gameserver/ca/appli/certs/cachaincert.pem --log="info" --show-log-console --command="STATUS" --program="aes"
 </code> </code>
  
Ligne 157: Ligne 168:
 Démarre un programme (retourne "started" ou "stopped") Démarre un programme (retourne "started" ou "stopped")
 <code> <code>
-/home/gameserver/ext/khaganat/tools/client.py --key="/home/gameserver/khanat/key.pem--cert="/home/gameserver/khanat/cert.pem--log="info" --show-log-console --command="START" --program="aes"+/home/gameserver/ext/khaganat/tools/client.py --key /home/gameserver/ca/appli/private/clientkey.pem --cert /home/gameserver/ca/appli/certs/clientcert.pem --ca_cert /home/gameserver/ca/appli/certs/cachaincert.pem --log="info" --show-log-console --command="START" --program="aes"
 </code> </code>
  
Ligne 163: Ligne 174:
 Arrête un programme (retourne "stopped") Arrête un programme (retourne "stopped")
 <code> <code>
-/home/gameserver/ext/khaganat/tools/client.py --key="/home/gameserver/khanat/key.pem--cert="/home/gameserver/khanat/cert.pem--log="info" --show-log-console --command="STOP" --program="aes"+/home/gameserver/ext/khaganat/tools/client.py --key /home/gameserver/ca/appli/private/clientkey.pem --cert /home/gameserver/ca/appli/certs/clientcert.pem --ca_cert /home/gameserver/ca/appli/certs/cachaincert.pem --log="info" --show-log-console --command="STOP" --program="aes"
 </code> </code>
  
Ligne 171: Ligne 182:
 firstline: première ligne que vous souhaitez récupérer firstline: première ligne que vous souhaitez récupérer
 <code> <code>
-/home/gameserver/ext/khaganat/tools/client.py --key="/home/gameserver/khanat/key.pem--cert="/home/gameserver/khanat/cert.pem--log="info" --show-log-console --command="LOG" --program="aes" --firstline=0+/home/gameserver/ext/khaganat/tools/client.py --key /home/gameserver/ca/appli/private/clientkey.pem --cert /home/gameserver/ca/appli/certs/clientcert.pem --ca_cert /home/gameserver/ca/appli/certs/cachaincert.pem --log="info" --show-log-console --command="LOG" --program="aes" --firstline=0
 </code> </code>
  
Ligne 178: Ligne 189:
  
 <code> <code>
-/home/gameserver/ext/khaganat/tools/client.py --key="/home/gameserver/khanat/key.pem--cert="/home/gameserver/khanat/cert.pem--log="info" --show-log-console --command="ACTION" --program="aes" --action="help all"+/home/gameserver/ext/khaganat/tools/client.py --key /home/gameserver/ca/appli/private/clientkey.pem --cert /home/gameserver/ca/appli/certs/clientcert.pem --ca_cert /home/gameserver/ca/appli/certs/cachaincert.pem --log="info" --show-log-console --command="ACTION" --program="aes" --action="help all"
 </code> </code>
 Souvent utilisé avec la commande "LOG" qui permet de voir le résultat. Souvent utilisé avec la commande "LOG" qui permet de voir le résultat.
Ligne 186: Ligne 197:
  
 Le serveur "manager" se met en écoute "style" https. Le serveur "manager" se met en écoute "style" https.
-Il attend les commandes et les envoie à ces fils (chaque fils gère un programme)+ 
 +Il attend les commandes et les envoient à ces fils (chaque fils gère un programme) 
 Nous utilisons le format REST pour communiquer avec le serveur (les données envoyées au format json). Nous utilisons le format REST pour communiquer avec le serveur (les données envoyées au format json).
  
CC Attribution-Share Alike 4.0 International Driven by DokuWiki
fr/manager.txt · Dernière modification : 2021/12/03 19:19 de 127.0.0.1

Licences Mentions légales Accueil du site Contact