Identifier l’ancien répertoire dans lequel les anciens contenus doivent être récupérés
This commit is contained in:
11
old_modules_EOLE_envole/documents/amon/contenu.html
Normal file
11
old_modules_EOLE_envole/documents/amon/contenu.html
Normal file
@ -0,0 +1,11 @@
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||
<head>
|
||||
<title>HEADER</title>
|
||||
<meta name="description" content="fleur jardin maison"/>
|
||||
<meta name="keywords" content="fleur jardin maison"/>
|
||||
</head>
|
||||
<body>
|
||||
sex, sexe, xxx
|
||||
</body>
|
||||
</html>
|
11
old_modules_EOLE_envole/documents/amon/entete.html
Normal file
11
old_modules_EOLE_envole/documents/amon/entete.html
Normal file
@ -0,0 +1,11 @@
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||
<head>
|
||||
<title>HEADER</title>
|
||||
<meta name="description" content="sex, sexe, xxx"/>
|
||||
<meta name="keywords" content="sex, sexe, xxx"/>
|
||||
</head>
|
||||
<body>
|
||||
fleur jardin maison
|
||||
</body>
|
||||
</html>
|
9
old_modules_EOLE_envole/documents/amon/virus.html
Normal file
9
old_modules_EOLE_envole/documents/amon/virus.html
Normal file
@ -0,0 +1,9 @@
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||
<head>
|
||||
<title>Virus</title>
|
||||
</head>
|
||||
<body>
|
||||
X5O!P%@AP[4\PZX54(P^)7CC)7}$EICAR-STANDARD-ANTIVIRUS-TEST-FILE!$H+H*
|
||||
</body>
|
||||
</html>
|
BIN
old_modules_EOLE_envole/documents/dotclear.iso
Normal file
BIN
old_modules_EOLE_envole/documents/dotclear.iso
Normal file
Binary file not shown.
BIN
old_modules_EOLE_envole/documents/eicar.iso
Normal file
BIN
old_modules_EOLE_envole/documents/eicar.iso
Normal file
Binary file not shown.
BIN
old_modules_EOLE_envole/documents/formationzephir.tar
Normal file
BIN
old_modules_EOLE_envole/documents/formationzephir.tar
Normal file
Binary file not shown.
@ -0,0 +1,21 @@
|
||||
Installation
|
||||
- AmonEcole
|
||||
- 2 cartes réseau
|
||||
- instancier
|
||||
- création de deux utilisateurs "prof" et "eleve"
|
||||
- désactiver clam et activer DHCP
|
||||
|
||||
- Seven : intégré au domaine
|
||||
|
||||
- Sphynx
|
||||
- faire une mise à jour
|
||||
- suppression du fichier udev
|
||||
|
||||
- Zéphir : suppression du fichier udev
|
||||
|
||||
Durée de la formation 3 jours :
|
||||
1 jour matin : fin DNS
|
||||
après midi : fin Era
|
||||
2 jour matin : avant filtration machine/utilisateur
|
||||
après midi : fin filtre web
|
||||
3 jour matin : fin présentation sphynx + integration virtualbox
|
@ -0,0 +1,50 @@
|
||||
##################
|
||||
# Partie serveur #
|
||||
##################
|
||||
|
||||
# Un scribe (dernière stable)
|
||||
- Le serveur Scribe
|
||||
- rdesktop, vnc-viewer (xthightvncviewer)
|
||||
- winexe
|
||||
|
||||
# Un horus (dernière stable)
|
||||
- Le serveur Horus
|
||||
- supprimer le fichier /etc/udev/rules.d/70-persistante-net.rules (plus d'actualité)
|
||||
|
||||
# Envole sur scribe (autre scribe) (ATTENTION, partir sur une version 2.5.2 de Scribe)
|
||||
- paquets supplémentaires : eole-ejabberd, ejabberd, eole-envole, eole-envole-theme, envole-pkg
|
||||
|
||||
##################################
|
||||
# Partie poste client virtualisé #
|
||||
##################################
|
||||
|
||||
# Windows 10 (prévoir 2 postes différents pour un confort lors de la formation)
|
||||
# Créer un poste avec toutes les applications ci-dessous et cloner cette machine (un pour Scribe et un pour Horus)
|
||||
- Windows 10 N
|
||||
- Firefox
|
||||
- putty, xming, winscp
|
||||
- activation des outils RSAT (Applications et fonctionnalités > Fonctionnalités facultatives > + Ajouter une fonctionnalité > RSAT : outils de gestion de stratégie de groupe > RSAT : outils de gestion du contrôleur de réseau)
|
||||
|
||||
# Windows 7 (formation faite sur W10, plus d'actualité)
|
||||
#- Windows 7
|
||||
#- Firefox
|
||||
#- Plugin flash player (pour Envole)
|
||||
#- Windows Enabler
|
||||
#- putty, xming, winscp
|
||||
|
||||
#######################################################
|
||||
# Fichiers supplémentaires nécessaires à la formation #
|
||||
#######################################################
|
||||
|
||||
# Si formation dans nos locaux :
|
||||
- Copier sur les postes de formation : sconet.iso, eicar.iso, dotclear.iso (disponibles dans "modules_EOLE_envole/documents/")
|
||||
|
||||
# Si formation à l'extérieur
|
||||
- Copier sur un support externe : sconet.iso, eicar.iso, dotclear.iso (disponibles dans "modules_EOLE_envole/documents/")
|
||||
|
||||
#######################################################
|
||||
# Découpage de la formation #
|
||||
#######################################################
|
||||
|
||||
- lancer l’import des comptes en fin de deuxième journée
|
||||
- sauvegarde partielle
|
@ -0,0 +1,13 @@
|
||||
Installer :
|
||||
Zephir1 à jour
|
||||
Supprimer le persistance-net
|
||||
Installer Scribe1
|
||||
Ne pas supprimer le persistance-net
|
||||
|
||||
Télécharger Xming/PUTTY/WinSCP
|
||||
Télécharger le paquet ircd-irc2
|
||||
|
||||
Durée de la formation 3 jours :
|
||||
1 jour : TC1 en démarrant les commandes systèmes
|
||||
2 jour : finir TC1
|
||||
3 jour : TC2
|
BIN
old_modules_EOLE_envole/documents/sconet.iso
Normal file
BIN
old_modules_EOLE_envole/documents/sconet.iso
Normal file
Binary file not shown.
@ -0,0 +1,10 @@
|
||||
Include {
|
||||
Options {
|
||||
aclsupport = no
|
||||
@/etc/bareos/include-options.conf
|
||||
}
|
||||
File = /tmp/repertoire
|
||||
}
|
||||
Exclude {
|
||||
File = /tmp/repertoire/toto.txt
|
||||
}
|
10
old_modules_EOLE_envole/documents/tronc-commun-2-avancee/diagnose/90-ircd
Executable file
10
old_modules_EOLE_envole/documents/tronc-commun-2-avancee/diagnose/90-ircd
Executable file
@ -0,0 +1,10 @@
|
||||
#!/bin/bash
|
||||
|
||||
if [ $(CreoleGet activer_ircd) = "oui" ];then
|
||||
. /usr/lib/eole/diagnose.sh
|
||||
EchoGras "*** Serveur IRCD"
|
||||
TestService IRCD 127.0.0.1:$(CreoleGet ircd_port)
|
||||
echo
|
||||
fi
|
||||
|
||||
exit 0
|
@ -0,0 +1,73 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
|
||||
<creole>
|
||||
|
||||
<files>
|
||||
<package>ircd-irc2</package>
|
||||
<service servicelist="ircd">ircd-irc2</service>
|
||||
<service_access service='ircd-irc2'>
|
||||
<port port_type="SymLinkOption">ircd_port</port>
|
||||
</service_access>
|
||||
<file filelist="ircd" name='/etc/ircd/ircd.conf'/>
|
||||
<file filelist="ircd" name='/etc/ircd/ircd.motd'/>
|
||||
</files>
|
||||
|
||||
<variables>
|
||||
<family name='services'>
|
||||
<variable name='activer_ircd' type='oui/non' description="Activer le serveur IRC" >
|
||||
<value>oui</value>
|
||||
</variable>
|
||||
</family>
|
||||
<family name='ircd'>
|
||||
<variable name='ircd_domaine' type='domain' description="Nom de domaine utilisé pour accéder au serveur IRC"/>
|
||||
<variable name='ircd_libelle' type='string' description="Libellé du serveur IRC"/>
|
||||
<variable name='ircd_port' type='port' description="Port du serveur IRC" mode='expert'>
|
||||
<value>6667</value>
|
||||
</variable>
|
||||
<variable name='ircd_banned_hostname' type='domain' description="Hote banni sur le serveur IRC" multi="True" mandatory="True"/>
|
||||
<variable name='ircd_banned_comment' type='string' description="Motif du bannissement du serveur IRC">
|
||||
<value>Vous êtes banni, contacter votre administrateur</value>
|
||||
</variable>
|
||||
<variable name='ircd_motd_message' type='string' description="Message de bienvenu"/>
|
||||
<variable name='ircd_motd_personnalise' type='string' description="Message de bienvenu personnalisé"/>
|
||||
</family>
|
||||
</variables>
|
||||
|
||||
<constraints>
|
||||
<check name='valid_enum' target='ircd_motd_message'>
|
||||
<param>['message 1', 'message 2', 'personnalisé']</param>
|
||||
</check>
|
||||
<fill name='calc_val' target='ircd_domaine'>
|
||||
<param type='eole' name='valeur' hidden="False">web_url</param>
|
||||
</fill>
|
||||
<fill name='ma_fonction' target='ircd_motd_personnalise'>
|
||||
</fill>
|
||||
<auto name="concat" target='ircd_libelle'>
|
||||
<param name='valeur1'>Serveur IRC pour </param>
|
||||
<param type='eole' name='valeur2'>libelle_etab</param>
|
||||
</auto>
|
||||
<group master='ircd_banned_hostname'>
|
||||
<slave>ircd_banned_comment</slave>
|
||||
</group>
|
||||
<condition name='disabled_if_in' source='activer_ircd'>
|
||||
<param>non</param>
|
||||
<target type='filelist'>ircd</target>
|
||||
<target type='servicelist'>ircd</target>
|
||||
<target type='family'>ircd</target>
|
||||
</condition>
|
||||
<condition name='disabled_if_not_in' source='ircd_motd_message'>
|
||||
<param>personnalisé</param>
|
||||
<target>ircd_motd_personnalise</target>
|
||||
</condition>
|
||||
<check name="valid_differ" target="ircd_libelle">
|
||||
<param type='eole' hidden="False">ircd_motd_personnalise</param>
|
||||
</check>
|
||||
</constraints>
|
||||
|
||||
<help>
|
||||
<variable name="activer_ircd">Cette variable permet d'activer un serveur IRC</variable>
|
||||
</help>
|
||||
|
||||
</creole>
|
||||
<!-- vim: ts=4 sw=4 expandtab
|
||||
-->
|
@ -0,0 +1,28 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
|
||||
<creole>
|
||||
|
||||
<files>
|
||||
</files>
|
||||
|
||||
<variables>
|
||||
<family name="services">
|
||||
<variable name="activer_clam" redefine="True" hidden="True">
|
||||
<value>non</value>
|
||||
</variable>
|
||||
</family>
|
||||
<family name="applications web">
|
||||
<variable name="web_url" description="l'url web specifique à Rennes" redefine="True"/>
|
||||
</family>
|
||||
</variables>
|
||||
|
||||
<constraints>
|
||||
</constraints>
|
||||
|
||||
<help>
|
||||
</help>
|
||||
|
||||
</creole>
|
||||
<!-- vim: ts=4 sw=4 expandtab
|
||||
-->
|
||||
|
@ -0,0 +1 @@
|
||||
cmd_ls
|
@ -0,0 +1,12 @@
|
||||
# -*- coding: UTF-8 -*-
|
||||
from ead2.backend.actions.lib.main import Cmd
|
||||
|
||||
class Cmd_Ls(Cmd):
|
||||
"""
|
||||
Action du mode commande
|
||||
"""
|
||||
name = "cmd_ls"
|
||||
# propriété de la commande à exécuter
|
||||
cmd_template = "/bin/ls /tmp"
|
||||
cmd_libelle = "ls sur /tmp"
|
||||
|
@ -0,0 +1 @@
|
||||
cmd_ls
|
@ -0,0 +1,5 @@
|
||||
[roles]
|
||||
admin=Administrateur
|
||||
|
||||
[permissions]
|
||||
cmd_ls=admin
|
@ -0,0 +1,30 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
|
||||
<creole>
|
||||
<variables>
|
||||
<family name='ircd_start'>
|
||||
<variable name="description" type="string"><value>Démarrage du service IRCD</value></variable>
|
||||
<variable name="day" type="schedule"></variable>
|
||||
<variable name="mode" type="schedulemod"><value>post</value></variable>
|
||||
</family>
|
||||
<family name='ircd_stop'>
|
||||
<variable name="description" type="string"><value>Arrêt du service IRCD</value></variable>
|
||||
<variable name="day" type="schedule"></variable>
|
||||
<variable name="mode" type="schedulemod"><value>pre</value></variable>
|
||||
</family>
|
||||
</variables>
|
||||
<constraints>
|
||||
<fill name='calc_multi_condition' target='schedule.ircd_stop.day'>
|
||||
<param>non</param>
|
||||
<param type='eole' name='condition_1'>activer_ircd</param>
|
||||
<param name='match'>none</param>
|
||||
<param name='mismatch'>daily</param>
|
||||
</fill>
|
||||
<fill name='calc_multi_condition' target='schedule.ircd_start.day'>
|
||||
<param>non</param>
|
||||
<param type='eole' name='condition_1'>activer_ircd</param>
|
||||
<param name='match'>none</param>
|
||||
<param name='mismatch'>daily</param>
|
||||
</fill>
|
||||
</constraints>
|
||||
</creole>
|
@ -0,0 +1,4 @@
|
||||
#!/usr/bin/python
|
||||
|
||||
def ma_fonction():
|
||||
return u'Ma phrase de ma fonction'
|
@ -0,0 +1,14 @@
|
||||
#!/bin/bash
|
||||
|
||||
. /usr/share/eole/FonctionsEoleNg
|
||||
|
||||
option=$1
|
||||
|
||||
if [ "$option" = "instance" ] && [ -d $container_path_web/tmp/toto ] ; then
|
||||
Question_ouinon "Voulez-vous supprimer le répertoire ?" "oui"
|
||||
[ "$?" = "0" ] && RunCmd "rm -rf /tmp/toto" web
|
||||
fi
|
||||
|
||||
RunCmd "mkdir -p /tmp/toto" web
|
||||
|
||||
exit 0
|
@ -0,0 +1,4 @@
|
||||
#!/bin/bash
|
||||
|
||||
CreoleService ircd-irc2 start
|
||||
exit 0
|
@ -0,0 +1,4 @@
|
||||
#!/bin/bash
|
||||
|
||||
CreoleService ircd-irc2 stop
|
||||
exit 0
|
720
old_modules_EOLE_envole/documents/tronc-commun-2/ircd-irc2.tex
Normal file
720
old_modules_EOLE_envole/documents/tronc-commun-2/ircd-irc2.tex
Normal file
@ -0,0 +1,720 @@
|
||||
\documentclass[a4paper,11pt]{report}
|
||||
\usepackage{ifxetex}
|
||||
\ifxetex
|
||||
%\usepackage{fontspec}
|
||||
%\usepackage{xunicode}
|
||||
\usepackage{xltxtra}
|
||||
\defaultfontfeatures{Mapping=tex-text} % To support LaTeX quoting style
|
||||
\setmainfont{Caviar Dreams}
|
||||
\else
|
||||
\usepackage[utf8]{inputenc}
|
||||
\usepackage[T1]{fontenc}
|
||||
\usepackage{amsfonts}
|
||||
\fi
|
||||
\usepackage{pifont}
|
||||
\usepackage{geometry}
|
||||
\usepackage{fancybox}
|
||||
\usepackage{verbatim}
|
||||
\usepackage{eurosym}
|
||||
\usepackage[english, francais]{babel}
|
||||
\usepackage{listings}
|
||||
\usepackage{color}
|
||||
\usepackage{graphicx}
|
||||
\usepackage{hyperref}
|
||||
\usepackage{titlesec}
|
||||
\usepackage{fancyhdr}
|
||||
\usepackage{lastpage}
|
||||
\usepackage{minted1}
|
||||
|
||||
\setlength{\hoffset}{-18pt}
|
||||
\setlength{\oddsidemargin}{0pt} % Marge gauche sur pages impaires
|
||||
\setlength{\evensidemargin}{9pt} % Marge gauche sur pages paires
|
||||
\setlength{\marginparwidth}{54pt} % Largeur de note dans la marge
|
||||
\setlength{\textwidth}{481pt} % Largeur de la zone de texte (17cm)
|
||||
\setlength{\voffset}{-18pt} % Bon pour DOS
|
||||
\setlength{\marginparsep}{7pt} % Séparation de la marge
|
||||
\setlength{\topmargin}{0pt} % Pas de marge en haut
|
||||
\setlength{\headheight}{13pt} % Haut de page
|
||||
\setlength{\headsep}{10pt} % Entre le haut de page et le texte
|
||||
\setlength{\footskip}{27pt} % Bas de page + séparation
|
||||
\setlength{\textheight}{708pt} % Hauteur de la zone de texte (25cm)
|
||||
\definecolor{bg}{rgb}{0.9,0.9,0.9}
|
||||
|
||||
% TITRE DU DOCUMENT !
|
||||
\title{Corrigé des exercices : intégration de ircd-irc2 dans EOLE}
|
||||
|
||||
%\date{}
|
||||
|
||||
\begin{document}
|
||||
\maketitle
|
||||
\normalsize
|
||||
\vspace{2cm}
|
||||
\textbf{Rédacteurs :}
|
||||
\begin{itemize}
|
||||
\item Emmanuel Garette (egarette@cadoles.com)
|
||||
\item Vincent Febvre (vfebvre@cadoles.com) \newline
|
||||
\end{itemize}
|
||||
\vspace{2cm}
|
||||
\textbf{Version} : 1.0 \newline
|
||||
|
||||
\chapter{Création d'un dictionnaire vierge}
|
||||
|
||||
Le répertoire des dictionnaires personnalisés local est dans /usr/share/eole/creole/dicos/local.
|
||||
|
||||
Créé un fichier en suivant les conventions suivantes :
|
||||
|
||||
\begin{itemize}
|
||||
\item deux chiffres en préfix
|
||||
\item le séparateur \_
|
||||
\item le nom du projet
|
||||
\item l'extention .xml
|
||||
\end{itemize}
|
||||
|
||||
Créer le fichier 00\_ircd.xml avec la structure de base suivante :
|
||||
|
||||
\begin{minted}[bgcolor=bg]{xml}
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<creole>
|
||||
|
||||
<files>
|
||||
</files>
|
||||
|
||||
<variables>
|
||||
</variables>
|
||||
|
||||
<constraints>
|
||||
</constraints>
|
||||
|
||||
<help>
|
||||
</help>
|
||||
|
||||
</creole>
|
||||
\end{minted}
|
||||
|
||||
\chapter{Installation du paquet et gestion du service}
|
||||
|
||||
Le logiciel doit s'installer à l'instanciation du serveur et le service doit être géré par EOLE :
|
||||
|
||||
\begin{minted}{xml}
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<creole>
|
||||
|
||||
<files>
|
||||
\end{minted}
|
||||
\begin{minted}[bgcolor=bg]{xml}
|
||||
<package>ircd-irc2</package>
|
||||
<service>ircd-irc2</service>
|
||||
\end{minted}
|
||||
\begin{minted}{xml}
|
||||
</files>
|
||||
|
||||
<variables>
|
||||
</variables>
|
||||
|
||||
<constraints>
|
||||
</constraints>
|
||||
|
||||
<help>
|
||||
</help>
|
||||
|
||||
</creole>
|
||||
\end{minted}
|
||||
|
||||
\chapter{Ouverture du firewall et tcpwrapper}
|
||||
\begin{minted}{xml}
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<creole>
|
||||
|
||||
<files>
|
||||
<package>ircd-irc2</package>
|
||||
<service>ircd-irc2</service>
|
||||
\end{minted}
|
||||
\begin{minted}[bgcolor=bg]{xml}
|
||||
<service_access service='ircd-irc2'>
|
||||
<port>6667</port>
|
||||
</service_access>
|
||||
\end{minted}
|
||||
\begin{minted}{xml}
|
||||
</files>
|
||||
|
||||
<variables>
|
||||
</variables>
|
||||
|
||||
<constraints>
|
||||
</constraints>
|
||||
|
||||
<help>
|
||||
</help>
|
||||
|
||||
</creole>
|
||||
\end{minted}
|
||||
|
||||
\chapter{Activation/désactivation du service}
|
||||
|
||||
Ajouter une variable pour activer/désactiver le service :
|
||||
|
||||
\begin{minted}{xml}
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<creole>
|
||||
|
||||
<files>
|
||||
<package>ircd-irc2</package>
|
||||
<service>ircd-irc2</service>
|
||||
<service_access service='ircd-irc2'>
|
||||
<port>6667</port>
|
||||
</service_access>
|
||||
</files>
|
||||
|
||||
<variables>
|
||||
\end{minted}
|
||||
\begin{minted}[bgcolor=bg]{xml}
|
||||
<family name='services'>
|
||||
<variable name='activer_ircd' type='oui/non'
|
||||
description="Activer le serveur IRC" >
|
||||
<value>oui</value>
|
||||
</variable>
|
||||
</family>
|
||||
\end{minted}
|
||||
\begin{minted}{xml}
|
||||
</variables>
|
||||
|
||||
<constraints>
|
||||
</constraints>
|
||||
|
||||
<help>
|
||||
</help>
|
||||
|
||||
</creole>
|
||||
\end{minted}
|
||||
|
||||
\chapter{Ajout des variables}
|
||||
Dans le template nous allons utiliser des variables définis dans le dictionnaire. Nous allons ajouter les variable pour configurer les M line et les K line :
|
||||
|
||||
\begin{minted}{xml}
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<creole>
|
||||
|
||||
<files>
|
||||
<package>ircd-irc2</package>
|
||||
<service>ircd-irc2</service>
|
||||
<service_access service='ircd-irc2'>
|
||||
<port>6667</port>
|
||||
</service_access>
|
||||
</files>
|
||||
|
||||
<variables>
|
||||
<family name='services'>
|
||||
<variable name='activer_ircd' type='oui/non'
|
||||
description="Activer le serveur IRC" >
|
||||
<value>oui</value>
|
||||
</variable>
|
||||
</family>
|
||||
\end{minted}
|
||||
\begin{minted}[bgcolor=bg]{xml}
|
||||
<family name='ircd'>
|
||||
<variable name='ircd_domaine' type='domain'
|
||||
description="Nom de domaine utilisé pour accéder au serveur IRC"/>
|
||||
<variable name='ircd_libelle' type='string'
|
||||
description="Libellé du serveur IRC"/>
|
||||
<variable name='ircd_port' type='port' description="Port du serveur IRC"
|
||||
mode='expert'>
|
||||
<value>6667</value>
|
||||
</variable>
|
||||
<variable name='ircd_banned_hostname' type='domain'
|
||||
description="Hote banni sur le serveur IRC" multi="True"
|
||||
mandatory="True"/>
|
||||
<variable name='ircd_banned_comment' type='string'
|
||||
description="Motif du bannissement du serveur IRC">
|
||||
<value>Vous êtes banni, contacter votre administrateur</value>
|
||||
</variable>
|
||||
</family>
|
||||
\end{minted}
|
||||
\begin{minted}{xml}
|
||||
</variables>
|
||||
|
||||
<constraints>
|
||||
</constraints>
|
||||
|
||||
<help>
|
||||
</help>
|
||||
|
||||
</creole>
|
||||
\end{minted}
|
||||
|
||||
\chapter{Le port du firewall devient variable}
|
||||
|
||||
On modifie le type du port en variable :
|
||||
|
||||
\begin{minted}{xml}
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<creole>
|
||||
|
||||
<files>
|
||||
<package>ircd-irc2</package>
|
||||
<service>ircd-irc2</service>
|
||||
<service_access service='ircd-irc2'>
|
||||
\end{minted}
|
||||
\begin{minted}[bgcolor=bg]{xml}
|
||||
<port port_type="SymLinkOption">ircd_port</port>
|
||||
\end{minted}
|
||||
\begin{minted}{xml}
|
||||
</service_access>
|
||||
</files>
|
||||
|
||||
<variables>
|
||||
<family name='ircd'>
|
||||
<variable name='ircd_domaine' type='domain'
|
||||
description="Nom de domaine utilisé pour accéder au serveur IRC"/>
|
||||
<variable name='ircd_libelle' type='string'
|
||||
description="Libellé du serveur IRC"/>
|
||||
<variable name='ircd_port' type='port' description="Port du serveur IRC"
|
||||
mode='expert'>
|
||||
<value>6667</value>
|
||||
</variable>
|
||||
<variable name='ircd_banned_hostname' type='domain'
|
||||
description="Hote banni sur le serveur IRC" multi="True"
|
||||
mandatory="True"/>
|
||||
<variable name='ircd_banned_comment' type='string'
|
||||
description="Motif du bannissement du serveur IRC">
|
||||
<value>Vous êtes banni, contacter votre administrateur</value>
|
||||
</variable>
|
||||
</family>
|
||||
</variables>
|
||||
|
||||
<constraints>
|
||||
</constraints>
|
||||
|
||||
<help>
|
||||
</help>
|
||||
|
||||
</creole>
|
||||
\end{minted}
|
||||
|
||||
\chapter{Ajout du template}
|
||||
|
||||
Le fichier de configuration du service doit être "templatiser" par EOLE :
|
||||
|
||||
\begin{minted}{xml}
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<creole>
|
||||
|
||||
<files>
|
||||
<package>ircd-irc2</package>
|
||||
<service>ircd-irc2</service>
|
||||
<service_access service='ircd-irc2'>
|
||||
<port port_type="SymLinkOption">ircd_port</port>
|
||||
</service_access>
|
||||
\end{minted}
|
||||
\begin{minted}[bgcolor=bg]{xml}
|
||||
<file name='/etc/ircd/ircd.conf'/>
|
||||
\end{minted}
|
||||
\begin{minted}{xml}
|
||||
</files>
|
||||
|
||||
<variables>
|
||||
<family name='ircd'>
|
||||
<variable name='ircd_domaine' type='domain'
|
||||
description="Nom de domaine utilisé pour accéder au serveur IRC"/>
|
||||
<variable name='ircd_libelle' type='string'
|
||||
description="Libellé du serveur IRC"/>
|
||||
<variable name='ircd_port' type='port' description="Port du serveur IRC"
|
||||
mode='expert'>
|
||||
<value>6667</value>
|
||||
</variable>
|
||||
<variable name='ircd_banned_hostname' type='domain'
|
||||
description="Hote banni sur le serveur IRC" multi="True"
|
||||
mandatory="True"/>
|
||||
<variable name='ircd_banned_comment' type='string'
|
||||
description="Motif du bannissement du serveur IRC">
|
||||
<value>Vous êtes banni, contacter votre administrateur</value>
|
||||
</variable>
|
||||
</family>
|
||||
</variables>
|
||||
|
||||
<constraints>
|
||||
</constraints>
|
||||
|
||||
<help>
|
||||
</help>
|
||||
|
||||
</creole>
|
||||
\end{minted}
|
||||
|
||||
\chapter{Désactivation des éléments}
|
||||
|
||||
Si "activer\_ircd" est à "non" le service ne devrait plus être démarré, la famille ne doit plus être accessible et le fichier de configuration ne doit plus être généré :
|
||||
|
||||
\begin{minted}{xml}
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<creole>
|
||||
|
||||
<files>
|
||||
<package>ircd-irc2</package>
|
||||
\end{minted}
|
||||
\begin{minted}[bgcolor=bg]{xml}
|
||||
<service servicelist="ircd">ircd-irc2</service>
|
||||
\end{minted}
|
||||
\begin{minted}{xml}
|
||||
<service_access service='ircd-irc2'>
|
||||
<port port_type="SymLinkOption">ircd_port</port>
|
||||
</service_access>
|
||||
\end{minted}
|
||||
\begin{minted}[bgcolor=bg]{xml}
|
||||
<file filelist="ircd" name='/etc/ircd/ircd.conf'/>
|
||||
\end{minted}
|
||||
\begin{minted}{xml}
|
||||
</files>
|
||||
|
||||
<variables>
|
||||
<family name='services'>
|
||||
<variable name='activer_ircd' type='oui/non'
|
||||
description="Activer le serveur IRC" >
|
||||
<value>oui</value>
|
||||
</variable>
|
||||
</family>
|
||||
<family name='ircd'>
|
||||
<variable name='ircd_domaine' type='domain'
|
||||
description="Nom de domaine utilisé pour accéder au serveur IRC"/>
|
||||
<variable name='ircd_libelle' type='string'
|
||||
description="Libellé du serveur IRC"/>
|
||||
<variable name='ircd_port' type='port' description="Port du serveur IRC"
|
||||
mode='expert'>
|
||||
<value>6667</value>
|
||||
</variable>
|
||||
<variable name='ircd_banned_hostname' type='domain'
|
||||
description="Hote banni sur le serveur IRC" multi="True"
|
||||
mandatory="True"/>
|
||||
<variable name='ircd_banned_comment' type='string'
|
||||
description="Motif du bannissement du serveur IRC">
|
||||
<value>Vous êtes banni, contacter votre administrateur</value>
|
||||
</variable>
|
||||
</family>
|
||||
</variables>
|
||||
|
||||
<constraints>
|
||||
\end{minted}
|
||||
\begin{minted}[bgcolor=bg]{xml}
|
||||
<condition name='disabled_if_in' source='activer_ircd'>
|
||||
<param>non</param>
|
||||
<target type='filelist'>ircd</target>
|
||||
<target type='servicelist'>ircd</target>
|
||||
<target type='family'>ircd</target>
|
||||
</condition>
|
||||
\end{minted}
|
||||
\begin{minted}{xml}
|
||||
</constraints>
|
||||
|
||||
<help>
|
||||
</help>
|
||||
|
||||
</creole>
|
||||
\end{minted}
|
||||
|
||||
\chapter{Ajout du groupe}
|
||||
|
||||
Il y a autant de message d'erreur que de nom d'hôte banni. Il est donc nécessaire de faire un groupe.
|
||||
|
||||
\begin{minted}{xml}
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<creole>
|
||||
|
||||
<files>
|
||||
<package>ircd-irc2</package>
|
||||
<service servicelist="ircd">ircd-irc2</service>
|
||||
<service_access service='ircd-irc2'>
|
||||
<port port_type="SymLinkOption">ircd_port</port>
|
||||
</service_access>
|
||||
<file filelist="ircd" name='/etc/ircd/ircd.conf'/>
|
||||
</files>
|
||||
|
||||
<variables>
|
||||
<family name='services'>
|
||||
<variable name='activer_ircd' type='oui/non'
|
||||
description="Activer le serveur IRC" >
|
||||
<value>oui</value>
|
||||
</variable>
|
||||
</family>
|
||||
<family name='ircd'>
|
||||
<variable name='ircd_domaine' type='domain'
|
||||
description="Nom de domaine utilisé pour accéder au serveur IRC"/>
|
||||
<variable name='ircd_libelle' type='string'
|
||||
description="Libellé du serveur IRC"/>
|
||||
<variable name='ircd_port' type='port' description="Port du serveur IRC"
|
||||
mode='expert'>
|
||||
<value>6667</value>
|
||||
</variable>
|
||||
<variable name='ircd_banned_hostname' type='domain'
|
||||
description="Hote banni sur le serveur IRC" multi="True"
|
||||
mandatory="True"/>
|
||||
<variable name='ircd_banned_comment' type='string'
|
||||
description="Motif du bannissement du serveur IRC">
|
||||
<value>Vous êtes banni, contacter votre administrateur</value>
|
||||
</variable>
|
||||
</family>
|
||||
</variables>
|
||||
|
||||
<constraints>
|
||||
<condition name='disabled_if_in' source='activer_ircd'>
|
||||
<param>non</param>
|
||||
<target type='filelist'>ircd</target>
|
||||
<target type='servicelist'>ircd</target>
|
||||
<target type='family'>ircd</target>
|
||||
</condition>
|
||||
\end{minted}
|
||||
\begin{minted}[bgcolor=bg]{xml}
|
||||
<group master="ircd_banned_hostname">
|
||||
<slave>icd_banned_comment</slave>
|
||||
</group>
|
||||
\end{minted}
|
||||
\begin{minted}{xml}
|
||||
</constraints>
|
||||
|
||||
<help>
|
||||
</help>
|
||||
|
||||
</creole>
|
||||
\end{minted}
|
||||
|
||||
\chapter{Ajout d'aide à la variable d'activation}
|
||||
|
||||
Ajouter de l'aide sur la variable activer\_ircd :
|
||||
|
||||
\begin{minted}{xml}
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<creole>
|
||||
|
||||
<files>
|
||||
<package>ircd-irc2</package>
|
||||
<service servicelist="ircd">ircd-irc2</service>
|
||||
<service_access service='ircd-irc2'>
|
||||
<port port_type="SymLinkOption">ircd_port</port>
|
||||
</service_access>
|
||||
<file filelist="ircd" name='/etc/ircd/ircd.conf'/>
|
||||
</files>
|
||||
|
||||
<variables>
|
||||
<family name='services'>
|
||||
<variable name='activer_ircd' type='oui/non'
|
||||
description="Activer le serveur IRC" >
|
||||
<value>oui</value>
|
||||
</variable>
|
||||
</family>
|
||||
<family name='ircd'>
|
||||
<variable name='ircd_domaine' type='domain'
|
||||
description="Nom de domaine utilisé pour accéder au serveur IRC"/>
|
||||
<variable name='ircd_libelle' type='string'
|
||||
description="Libellé du serveur IRC"/>
|
||||
<variable name='ircd_port' type='port' description="Port du serveur IRC"
|
||||
mode='expert'>
|
||||
<value>6667</value>
|
||||
</variable>
|
||||
<variable name='ircd_banned_hostname' type='domain'
|
||||
description="Hote banni sur le serveur IRC" multi="True"
|
||||
mandatory="True"/>
|
||||
<variable name='ircd_banned_comment' type='string'
|
||||
description="Motif du bannissement du serveur IRC">
|
||||
<value>Vous êtes banni, contacter votre administrateur</value>
|
||||
</variable>
|
||||
</family>
|
||||
</variables>
|
||||
|
||||
<constraints>
|
||||
<condition name='disabled_if_in' source='activer_ircd'>
|
||||
<param>non</param>
|
||||
<target type='filelist'>ircd</target>
|
||||
<target type='servicelist'>ircd</target>
|
||||
<target type='family'>ircd</target>
|
||||
</condition>
|
||||
|
||||
</constraints>
|
||||
|
||||
<help>
|
||||
\end{minted}
|
||||
\begin{minted}[bgcolor=bg]{xml}
|
||||
<variable name="activer_ircd">Cette variable permet d'activer un serveur IRC</variable>
|
||||
\end{minted}
|
||||
\begin{minted}{xml}
|
||||
</help>
|
||||
|
||||
</creole>
|
||||
\end{minted}
|
||||
|
||||
\chapter{Ajout d'un calcul}
|
||||
|
||||
Ajouter un calcul sur la variable ircd\_domaine :
|
||||
|
||||
\begin{minted}{xml}
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<creole>
|
||||
|
||||
<files>
|
||||
<package>ircd-irc2</package>
|
||||
<service servicelist="ircd">ircd-irc2</service>
|
||||
<service_access service='ircd-irc2'>
|
||||
<port port_type="SymLinkOption">ircd_port</port>
|
||||
</service_access>
|
||||
<file filelist="ircd" name='/etc/ircd/ircd.conf'/>
|
||||
</files>
|
||||
|
||||
<variables>
|
||||
<family name='services'>
|
||||
<variable name='activer_ircd' type='oui/non'
|
||||
description="Activer le serveur IRC" >
|
||||
<value>oui</value>
|
||||
</variable>
|
||||
</family>
|
||||
<family name='ircd'>
|
||||
<variable name='ircd_domaine' type='domain'
|
||||
description="Nom de domaine utilisé pour accéder au serveur IRC"/>
|
||||
<variable name='ircd_libelle' type='string'
|
||||
description="Libellé du serveur IRC"/>
|
||||
<variable name='ircd_port' type='port' description="Port du serveur IRC"
|
||||
mode='expert'>
|
||||
<value>6667</value>
|
||||
</variable>
|
||||
<variable name='ircd_banned_hostname' type='domain'
|
||||
description="Hote banni sur le serveur IRC" multi="True"
|
||||
mandatory="True"/>
|
||||
<variable name='ircd_banned_comment' type='string'
|
||||
description="Motif du bannissement du serveur IRC">
|
||||
<value>Vous êtes banni, contacter votre administrateur</value>
|
||||
</variable>
|
||||
</family>
|
||||
</variables>
|
||||
|
||||
<constraints>
|
||||
<condition name='disabled_if_in' source='activer_ircd'>
|
||||
<param>non</param>
|
||||
<target type='filelist'>ircd</target>
|
||||
<target type='servicelist'>ircd</target>
|
||||
<target type='family'>ircd</target>
|
||||
</condition>
|
||||
|
||||
\end{minted}
|
||||
\begin{minted}[bgcolor=bg]{xml}
|
||||
<fill name="calc_val" target="ircd_domaine">
|
||||
<param type="eole">web_url</param>
|
||||
</fill>
|
||||
\end{minted}
|
||||
\begin{minted}{xml}
|
||||
</constraints>
|
||||
|
||||
<help>
|
||||
<variable name="activer_ircd">Cette variable permet d'activer un serveur IRC</variable>
|
||||
</help>
|
||||
|
||||
</creole>
|
||||
\end{minted}
|
||||
\chapter{Test du dictionnaire}
|
||||
|
||||
Lancer gen\_config.Dans l'onglet service tester si l'onglet "Ircd" disparait bien si "Activer le serveur IRC" est à "non" et réapparait si la valeur est à "oui".
|
||||
|
||||
Renseigner la valeur de la variable "Nom de domaine utilisé pour accéder au serveur IRC" à "localhost.localdomaine".
|
||||
|
||||
\chapter{Création du template}
|
||||
|
||||
Si le variable pour activer le serveur est maintenant bien présente, le service n'est toujours pas fonctionnel.
|
||||
En effet, il faut configurer l'application avec les informations fournis par l'utilisateur.
|
||||
|
||||
Pour cela, nous allons créé le template /usr/share/eole/creole/distrib/ircd.conf :
|
||||
|
||||
\begin{otherlanguage}{english}
|
||||
\begin{minted}{cpp}
|
||||
# This is ircd's config-file. Look at
|
||||
# /usr/share/doc/ircd-irc2/ircd.conf.example.gz and
|
||||
# and /usr/share/doc/ircd-irc2/INSTALL.* for more detailled information
|
||||
# and instructions
|
||||
|
||||
# A-Line
|
||||
A:Default:Default file:Welcome::ExampleNet
|
||||
|
||||
# Y-Lines
|
||||
Y:1:90::100:512000:5.5:100.100
|
||||
Y:2:90::300:512000:5.5:250.250
|
||||
|
||||
# I-Line
|
||||
I:*:::0:1
|
||||
I:127.0.0.1/32:::0:1
|
||||
|
||||
# P-Line
|
||||
P::::6667:
|
||||
\end{minted}
|
||||
\end{otherlanguage}
|
||||
|
||||
\chapter{Configuration général du service}
|
||||
|
||||
L'utilisateur a renseigner un domaine, un label et un port pour IRCD. Il faut maintenant en tenir compte :
|
||||
\begin{otherlanguage}{english}
|
||||
\begin{minted}{cpp}
|
||||
# This is ircd's config-file. Look at
|
||||
# /usr/share/doc/ircd-irc2/ircd.conf.example.gz and
|
||||
# and /usr/share/doc/ircd-irc2/INSTALL.* for more detailled information
|
||||
# and instructions
|
||||
\end{minted}
|
||||
\begin{minted}[bgcolor=bg]{cpp}
|
||||
# M-Line
|
||||
M:%%ircd_domaine::%%ircd_libelle:%%ircd_port:000A
|
||||
\end{minted}
|
||||
\begin{minted}{cpp}
|
||||
# A-Line
|
||||
A:Default:Default file:Welcome::ExampleNet
|
||||
|
||||
# Y-Lines
|
||||
Y:1:90::100:512000:5.5:100.100
|
||||
Y:2:90::300:512000:5.5:250.250
|
||||
|
||||
# I-Line
|
||||
I:*:::0:1
|
||||
I:127.0.0.1/32:::0:1
|
||||
|
||||
# P-Line
|
||||
P::::6667:
|
||||
\end{minted}
|
||||
\end{otherlanguage}
|
||||
|
||||
|
||||
\chapter{Ajout des bannissements}
|
||||
|
||||
L'administrateur a la possibilité d'ajouté plusieurs lignes de bannissement. Il est donc nécessaire de récupérer les informations avec une boucle :
|
||||
|
||||
\begin{otherlanguage}{english}
|
||||
\begin{minted}{cpp}
|
||||
# This is ircd's config-file. Look at
|
||||
# /usr/share/doc/ircd-irc2/ircd.conf.example.gz and
|
||||
# and /usr/share/doc/ircd-irc2/INSTALL.* for more detailled information
|
||||
# and instructions
|
||||
# M-Line
|
||||
M:%%ircd_domaine::%%ircd_libelle:%%ircd_port:000A
|
||||
\end{minted}
|
||||
\begin{minted}[bgcolor=bg]{cpp}
|
||||
%for %%hostname in %%ircd_banned_hostname
|
||||
# K-Line
|
||||
K:%%hostname:%%hostname.ircd_banned_comment:*:0:
|
||||
%end for
|
||||
\end{minted}
|
||||
\begin{minted}{cpp}
|
||||
# A-Line
|
||||
A:Default:Default file:Welcome::ExampleNet
|
||||
|
||||
# Y-Lines
|
||||
Y:1:90::100:512000:5.5:100.100
|
||||
Y:2:90::300:512000:5.5:250.250
|
||||
|
||||
# I-Line
|
||||
I:*:::0:1
|
||||
I:127.0.0.1/32:::0:1
|
||||
|
||||
# P-Line
|
||||
P::::6667:
|
||||
\end{minted}
|
||||
\end{otherlanguage}
|
||||
|
||||
\chapter{Configuration et démarrage le service}
|
||||
|
||||
Il est maintenant possible de vérifier le fonctionnement du service.
|
||||
|
||||
Le service doit être démarré après le reconfigure si on active IRCD.
|
||||
|
||||
Le service doit être arrêté après le reconfigure si on désactive IRCD.
|
||||
|
||||
\end{document}
|
261
old_modules_EOLE_envole/documents/tronc-commun-2/minted1.sty
Normal file
261
old_modules_EOLE_envole/documents/tronc-commun-2/minted1.sty
Normal file
@ -0,0 +1,261 @@
|
||||
%%
|
||||
%% This is file `minted1.sty',
|
||||
%% generated with the docstrip utility.
|
||||
%%
|
||||
%% The original source files were:
|
||||
%%
|
||||
%% minted.dtx (with options: `packageone')
|
||||
%% Copyright 2013--2016 Geoffrey M. Poore
|
||||
%% Copyright 2010--2011 Konrad Rudolph
|
||||
%%
|
||||
%% This work may be distributed and/or modified under the
|
||||
%% conditions of the LaTeX Project Public License, either version 1.3
|
||||
%% of this license or (at your option) any later version.
|
||||
%% The latest version of this license is in
|
||||
%% http://www.latex-project.org/lppl.txt
|
||||
%% and version 1.3 or later is part of all distributions of LaTeX
|
||||
%% version 2005/12/01 or later.
|
||||
%%
|
||||
%% Additionally, the project may be distributed under the terms of the new BSD
|
||||
%% license.
|
||||
%%
|
||||
%% This work has the LPPL maintenance status `maintained'.
|
||||
%%
|
||||
%% The Current Maintainer of this work is Geoffrey Poore.
|
||||
%%
|
||||
%% This work consists of the files minted.dtx and minted.ins
|
||||
%% and the derived file minted.sty.
|
||||
\NeedsTeXFormat{LaTeX2e}
|
||||
%%%% Begin minted1 modification
|
||||
%%\ProvidesPackage{minted}[2011/09/17 v1.7 Yet another Pygments shim for LaTeX]
|
||||
\ProvidesPackage{minted1}[2015/01/31 v1.0 minted 1.7 compatibility package]
|
||||
%%%% End minted1 modification
|
||||
\RequirePackage{keyval}
|
||||
\RequirePackage{fancyvrb}
|
||||
\RequirePackage{xcolor}
|
||||
\RequirePackage{float}
|
||||
\RequirePackage{ifthen}
|
||||
%%%% Begin minted1 modification
|
||||
\newboolean{mintedone@mintedloaded}
|
||||
\@ifpackageloaded{minted}%
|
||||
{\setboolean{mintedone@mintedloaded}{true}%
|
||||
\PackageError{minted1}{The package "minted1" may not be loaded after
|
||||
^^J"minted" has already been loaded--load "minted1" only for "minted"
|
||||
^^Jversion 1.7 compatibility}%
|
||||
{Load "minted1" only when "minted" version 1.7 compatibility is required}}%
|
||||
{}
|
||||
\ifmintedone@mintedloaded\else
|
||||
\@namedef{ver@minted.sty}{2011/09/17 v1.7 Yet another Pygments shim for LaTeX}
|
||||
\expandafter\let\expandafter\minted@tmp\csname opt@minted1.sty\endcsname
|
||||
\expandafter\let\csname opt@minted.sty\endcsname\minted@tmp
|
||||
\let\minted@tmp\relax
|
||||
%%%% End minted1 modification
|
||||
\RequirePackage{calc}
|
||||
\RequirePackage{ifplatform}
|
||||
\DeclareOption{chapter}{\def\minted@float@within{chapter}}
|
||||
\DeclareOption{section}{\def\minted@float@within{section}}
|
||||
\ProcessOptions\relax
|
||||
\ifwindows
|
||||
\providecommand\DeleteFile[1]{\immediate\write18{del #1}}
|
||||
\else
|
||||
\providecommand\DeleteFile[1]{\immediate\write18{rm #1}}
|
||||
\fi
|
||||
\newboolean{AppExists}
|
||||
\newcommand\TestAppExists[1]{
|
||||
\ifwindows
|
||||
\DeleteFile{\jobname.aex}
|
||||
\immediate\write18{for \string^\@percentchar i in (#1.exe #1.bat #1.cmd)
|
||||
do set >\jobname.aex <nul: /p x=\string^\@percentchar \string~$PATH:i>>\jobname.aex} %$
|
||||
\newread\@appexistsfile
|
||||
\immediate\openin\@appexistsfile\jobname.aex
|
||||
\expandafter\def\expandafter\@tmp@cr\expandafter{\the\endlinechar}
|
||||
\endlinechar=-1\relax
|
||||
\readline\@appexistsfile to \@apppathifexists
|
||||
\endlinechar=\@tmp@cr
|
||||
\ifthenelse{\equal{\@apppathifexists}{}}
|
||||
{\AppExistsfalse}
|
||||
{\AppExiststrue}
|
||||
\immediate\closein\@appexistsfile
|
||||
\DeleteFile{\jobname.aex}
|
||||
\immediate\typeout{file deleted}
|
||||
\else
|
||||
\immediate\write18{which #1 && touch \jobname.aex}
|
||||
\IfFileExists{\jobname.aex}
|
||||
{\AppExiststrue
|
||||
\DeleteFile{\jobname.aex}}
|
||||
{\AppExistsfalse}
|
||||
\fi}
|
||||
\newcommand\minted@resetoptions{}
|
||||
\newcommand\minted@defopt[1]{
|
||||
\expandafter\def\expandafter\minted@resetoptions\expandafter{%
|
||||
\minted@resetoptions
|
||||
\@namedef{minted@opt@#1}{}}}
|
||||
\newcommand\minted@opt[1]{
|
||||
\expandafter\detokenize%
|
||||
\expandafter\expandafter\expandafter{\csname minted@opt@#1\endcsname}}
|
||||
\newcommand\minted@define@opt[3][]{
|
||||
\minted@defopt{#2}
|
||||
\ifthenelse{\equal{#1}{}}{
|
||||
\define@key{minted@opt}{#2}{\@namedef{minted@opt@#2}{#3}}}
|
||||
{\define@key{minted@opt}{#2}[#1]{\@namedef{minted@opt@#2}{#3}}}}
|
||||
\newcommand\minted@define@switch[3][]{
|
||||
\minted@defopt{#2}
|
||||
\define@booleankey{minted@opt}{#2}
|
||||
{\@namedef{minted@opt@#2}{#3}}
|
||||
{\@namedef{minted@opt@#2}{#1}}}
|
||||
\minted@defopt{extra}
|
||||
\newcommand\minted@define@extra[1]{
|
||||
\define@key{minted@opt}{#1}{
|
||||
\expandafter\def\expandafter\minted@opt@extra\expandafter{%
|
||||
\minted@opt@extra,#1=##1}}}
|
||||
\newcommand\minted@define@extra@switch[1]{
|
||||
\define@booleankey{minted@opt}{#1}
|
||||
{\expandafter\def\expandafter\minted@opt@extra\expandafter{%
|
||||
\minted@opt@extra,#1}}
|
||||
{\expandafter\def\expandafter\minted@opt@extra\expandafter{%
|
||||
\minted@opt@extra,#1=false}}}
|
||||
\minted@define@switch{texcl}{-P texcomments}
|
||||
\minted@define@switch{mathescape}{-P mathescape}
|
||||
\minted@define@switch{linenos}{-P linenos}
|
||||
\minted@define@switch{startinline}{-P startinline}
|
||||
\minted@define@switch[-P funcnamehighlighting=False]%
|
||||
{funcnamehighlighting}{-P funcnamehighlighting}
|
||||
\minted@define@opt{gobble}{-F gobble:n=#1}
|
||||
\minted@define@opt{bgcolor}{#1}
|
||||
\minted@define@extra{frame}
|
||||
\minted@define@extra{framesep}
|
||||
\minted@define@extra{framerule}
|
||||
\minted@define@extra{rulecolor}
|
||||
\minted@define@extra{numbersep}
|
||||
\minted@define@extra{firstnumber}
|
||||
\minted@define@extra{stepnumber}
|
||||
\minted@define@extra{firstline}
|
||||
\minted@define@extra{lastline}
|
||||
\minted@define@extra{baselinestretch}
|
||||
\minted@define@extra{xleftmargin}
|
||||
\minted@define@extra{xrightmargin}
|
||||
\minted@define@extra{fillcolor}
|
||||
\minted@define@extra{tabsize}
|
||||
\minted@define@extra{fontfamily}
|
||||
\minted@define@extra{fontsize}
|
||||
\minted@define@extra{fontshape}
|
||||
\minted@define@extra{fontseries}
|
||||
\minted@define@extra{formatcom}
|
||||
\minted@define@extra{label}
|
||||
\minted@define@extra@switch{numberblanklines}
|
||||
\minted@define@extra@switch{showspaces}
|
||||
\minted@define@extra@switch{resetmargins}
|
||||
\minted@define@extra@switch{samepage}
|
||||
\minted@define@extra@switch{showtabs}
|
||||
\minted@define@extra@switch{obeytabs}
|
||||
\newsavebox{\minted@bgbox}
|
||||
\newenvironment{minted@colorbg}[1]{
|
||||
\def\minted@bgcol{#1}
|
||||
\noindent
|
||||
\begin{lrbox}{\minted@bgbox}
|
||||
\begin{minipage}{\linewidth-2\fboxsep}}
|
||||
{\end{minipage}
|
||||
\end{lrbox}%
|
||||
\colorbox{\minted@bgcol}{\usebox{\minted@bgbox}}}
|
||||
\newwrite\minted@code
|
||||
\newcommand\minted@savecode[1]{
|
||||
\immediate\openout\minted@code\jobname.pyg
|
||||
\immediate\write\minted@code{#1}
|
||||
\immediate\closeout\minted@code}
|
||||
\newcommand\minted@pygmentize[2][\jobname.pyg]{
|
||||
\def\minted@cmd{pygmentize -l #2 -f latex -F tokenmerge
|
||||
\minted@opt{gobble} \minted@opt{texcl} \minted@opt{mathescape}
|
||||
\minted@opt{startinline} \minted@opt{funcnamehighlighting}
|
||||
\minted@opt{linenos} -P "verboptions=\minted@opt{extra}"
|
||||
-o \jobname.out.pyg #1}
|
||||
\immediate\write18{\minted@cmd}
|
||||
% For debugging, uncomment:
|
||||
%\immediate\typeout{\minted@cmd}
|
||||
\ifthenelse{\equal{\minted@opt@bgcolor}{}}
|
||||
{}
|
||||
{\begin{minted@colorbg}{\minted@opt@bgcolor}}
|
||||
\input{\jobname.out.pyg}
|
||||
\ifthenelse{\equal{\minted@opt@bgcolor}{}}
|
||||
{}
|
||||
{\end{minted@colorbg}}
|
||||
\DeleteFile{\jobname.out.pyg}}
|
||||
\newcommand\minted@usedefaultstyle{\usemintedstyle{default}}
|
||||
\newcommand\usemintedstyle[1]{
|
||||
\renewcommand\minted@usedefaultstyle{}
|
||||
\immediate\write18{pygmentize -S #1 -f latex > \jobname.pyg}
|
||||
\input{\jobname.pyg}}
|
||||
\newcommand\mint[3][]{
|
||||
\DefineShortVerb{#3}
|
||||
\minted@resetoptions
|
||||
\setkeys{minted@opt}{#1}
|
||||
\SaveVerb[aftersave={
|
||||
\UndefineShortVerb{#3}
|
||||
\minted@savecode{\FV@SV@minted@verb}
|
||||
\minted@pygmentize{#2}
|
||||
\DeleteFile{\jobname.pyg}}]{minted@verb}#3}
|
||||
\newcommand\minted@proglang[1]{}
|
||||
\newenvironment{minted}[2][]
|
||||
{\VerbatimEnvironment
|
||||
\renewcommand{\minted@proglang}[1]{#2}
|
||||
\minted@resetoptions
|
||||
\setkeys{minted@opt}{#1}
|
||||
\begin{VerbatimOut}[codes={\catcode`\^^I=12}]{\jobname.pyg}}%
|
||||
{\end{VerbatimOut}
|
||||
\minted@pygmentize{\minted@proglang{}}
|
||||
\DeleteFile{\jobname.pyg}}
|
||||
\newcommand\inputminted[3][]{
|
||||
\minted@resetoptions
|
||||
\setkeys{minted@opt}{#1}
|
||||
\minted@pygmentize[#3]{#2}}
|
||||
\newcommand\newminted[3][]{
|
||||
\ifthenelse{\equal{#1}{}}
|
||||
{\def\minted@envname{#2code}}
|
||||
{\def\minted@envname{#1}}
|
||||
\newenvironment{\minted@envname}
|
||||
{\VerbatimEnvironment\begin{minted}[#3]{#2}}
|
||||
{\end{minted}}
|
||||
\newenvironment{\minted@envname *}[1]
|
||||
{\VerbatimEnvironment\begin{minted}[#3,##1]{#2}}
|
||||
{\end{minted}}}
|
||||
\newcommand\newmint[3][]{
|
||||
\ifthenelse{\equal{#1}{}}
|
||||
{\def\minted@shortname{#2}}
|
||||
{\def\minted@shortname{#1}}
|
||||
\expandafter\newcommand\csname\minted@shortname\endcsname[2][]{
|
||||
\mint[#3,##1]{#2}##2}}
|
||||
\newcommand\newmintedfile[3][]{
|
||||
\ifthenelse{\equal{#1}{}}
|
||||
{\def\minted@shortname{#2file}}
|
||||
{\def\minted@shortname{#1}}
|
||||
\expandafter\newcommand\csname\minted@shortname\endcsname[2][]{
|
||||
\inputminted[#3,##1]{#2}{##2}}}
|
||||
\@ifundefined{minted@float@within}
|
||||
{\newfloat{listing}{h}{lol}}
|
||||
{\newfloat{listing}{h}{lol}[\minted@float@within]}
|
||||
\newcommand\listingscaption{Listing}
|
||||
\floatname{listing}{\listingscaption}
|
||||
\newcommand\listoflistingscaption{List of listings}
|
||||
\providecommand\listoflistings{\listof{listing}{\listoflistingscaption}}
|
||||
\AtBeginDocument{
|
||||
\minted@usedefaultstyle}
|
||||
\AtEndOfPackage{
|
||||
\ifnum\pdf@shellescape=1\relax\else
|
||||
\PackageError{minted}
|
||||
{You must invoke LaTeX with the
|
||||
-shell-escape flag}
|
||||
{Pass the -shell-escape flag to LaTeX. Refer to the minted.sty
|
||||
documentation for more information.}\fi
|
||||
\TestAppExists{pygmentize}
|
||||
\ifAppExists\else
|
||||
\PackageError{minted}
|
||||
{You must have `pygmentize' installed
|
||||
to use this package}
|
||||
{Refer to the installation instructions in the minted
|
||||
documentation for more information.}
|
||||
\fi}
|
||||
%%%% Begin minted1 modification
|
||||
\fi
|
||||
%%%% End minted1 modification
|
||||
\endinput
|
||||
%%
|
||||
%% End of file `minted1.sty'.
|
@ -0,0 +1,166 @@
|
||||
\documentclass[a4paper,11pt]{report}
|
||||
\usepackage{ifxetex}
|
||||
\ifxetex
|
||||
%\usepackage{fontspec}
|
||||
%\usepackage{xunicode}
|
||||
\usepackage{xltxtra}
|
||||
\defaultfontfeatures{Mapping=tex-text} % To support LaTeX quoting style
|
||||
\setmainfont{Caviar Dreams}
|
||||
\else
|
||||
\usepackage[utf8]{inputenc}
|
||||
\usepackage[T1]{fontenc}
|
||||
\usepackage{amsfonts}
|
||||
\fi
|
||||
\usepackage{pifont}
|
||||
\usepackage{geometry}
|
||||
\usepackage{fancybox}
|
||||
\usepackage{verbatim}
|
||||
\usepackage{eurosym}
|
||||
\usepackage[english, francais]{babel}
|
||||
\usepackage{listings}
|
||||
\usepackage{color}
|
||||
\usepackage{graphicx}
|
||||
\usepackage{hyperref}
|
||||
\usepackage{titlesec}
|
||||
\usepackage{fancyhdr}
|
||||
\usepackage{lastpage}
|
||||
\usepackage{minted}
|
||||
|
||||
\setlength{\hoffset}{-18pt}
|
||||
\setlength{\oddsidemargin}{0pt} % Marge gauche sur pages impaires
|
||||
\setlength{\evensidemargin}{9pt} % Marge gauche sur pages paires
|
||||
\setlength{\marginparwidth}{54pt} % Largeur de note dans la marge
|
||||
\setlength{\textwidth}{481pt} % Largeur de la zone de texte (17cm)
|
||||
\setlength{\voffset}{-18pt} % Bon pour DOS
|
||||
\setlength{\marginparsep}{7pt} % Séparation de la marge
|
||||
\setlength{\topmargin}{0pt} % Pas de marge en haut
|
||||
\setlength{\headheight}{13pt} % Haut de page
|
||||
\setlength{\headsep}{10pt} % Entre le haut de page et le texte
|
||||
\setlength{\footskip}{27pt} % Bas de page + séparation
|
||||
\setlength{\textheight}{708pt} % Hauteur de la zone de texte (25cm)
|
||||
\definecolor{bg}{rgb}{0.9,0.9,0.9}
|
||||
|
||||
% TITRE DU DOCUMENT !
|
||||
\title{Corrigé des exercices : créer un script Zéphir}
|
||||
|
||||
%\date{}
|
||||
|
||||
\begin{document}
|
||||
\maketitle
|
||||
\normalsize
|
||||
\vspace{2cm}
|
||||
\textbf{Rédacteurs :}
|
||||
\begin{itemize}
|
||||
\item Emmanuel Garette (egarette@cadoles.com)
|
||||
\item Vincent Febvre (vfebvre@cadoles.com) \newline
|
||||
\end{itemize}
|
||||
\vspace{2cm}
|
||||
\textbf{Version} : 1.0 \newline
|
||||
|
||||
\chapter{Création d'un script Zéphir : un script python}
|
||||
|
||||
Un script Zéphir est un script python. Des fonctions de base se proposer pour faciliter l'écriture de ce script.
|
||||
Les scripts doivent être dans /usr/share/zephir/scripts/ et exécutables.
|
||||
|
||||
\begin{minted}{xml}
|
||||
#!/usr/bin/env python
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
import sys
|
||||
from zephir.lib_zephir import *
|
||||
from creole import fonctionseole
|
||||
\end{minted}
|
||||
|
||||
\chapter{Création d'un script Zéphir : vérification}
|
||||
|
||||
Avant il faut vérifier qu'aucun blocage ne soit mis en place pour éviter l'exécuter de l'action.
|
||||
|
||||
\begin{minted}{xml}
|
||||
#!/usr/bin/env python
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
import sys
|
||||
from zephir.lib_zephir import *
|
||||
from creole import fonctionseole
|
||||
|
||||
\end{minted}
|
||||
\begin{minted}[bgcolor=bg]{xml}
|
||||
if fonctionseole.init_proc('PERSO') == False:
|
||||
fonctionseole.zephir("ERR" , "procédure supprimer_fichier bloquée par zephir", "PERSO")
|
||||
sys.exit(1)
|
||||
\end{minted}
|
||||
|
||||
\chapter{Création d'un script Zéphir : début}
|
||||
|
||||
Avant d'exécuter le script, emettre un message sur le Zéphir.
|
||||
|
||||
\begin{minted}{xml}
|
||||
#!/usr/bin/env python
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
import sys
|
||||
from zephir.lib_zephir import *
|
||||
from creole import fonctionseole
|
||||
|
||||
if fonctionseole.init_proc('PERSO') == False:
|
||||
fonctionseole.zephir("ERR" , "procédure supprimer_fichier bloquée par zephir", "PERSO")
|
||||
sys.exit(1)
|
||||
|
||||
\end{minted}
|
||||
\begin{minted}[bgcolor=bg]{xml}
|
||||
fonctionseole.zephir("INIT" , "script supprimer_fichier en cours d'execution", "PERSO")
|
||||
\end{minted}
|
||||
|
||||
\chapter{Création d'un script Zéphir : lancement du script en root}
|
||||
|
||||
Le script principal est exécuter avec l'utilisateur "uucp". Il faut utiliser la fonction sudo\_script pour avoir les droits "root".
|
||||
|
||||
Si tout se passe bien, deux messages seront remontés :
|
||||
|
||||
\begin{itemize}
|
||||
\item un message d'information avec le nom du fichier ;
|
||||
\item un message annonçant que le fichier est correctement supprimer.
|
||||
\end{itemize}
|
||||
|
||||
En cas d'erreur, un message d'erreur est remonté sur le Zéphir.
|
||||
|
||||
\begin{minted}{xml}
|
||||
#!/usr/bin/env python
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
import sys
|
||||
from zephir.lib_zephir import *
|
||||
from creole import fonctionseole
|
||||
|
||||
if fonctionseole.init_proc('PERSO') == False:
|
||||
fonctionseole.zephir("ERR" , "procédure supprimer_fichier bloquée par zephir", "PERSO")
|
||||
sys.exit(1)
|
||||
|
||||
fonctionseole.zephir("INIT" , "script supprimer_fichier en cours d'execution", "PERSO")
|
||||
|
||||
\end{minted}
|
||||
\begin{minted}[bgcolor=bg]{xml}
|
||||
try:
|
||||
filename = sys.argv[1]
|
||||
fonctionseole.zephir("MSG" , "supprimer_fichier lancé avec l'argument {}".format(filename), "PERSO")
|
||||
sudo_script('supprimer_fichier_sudo.zephir %s' % filename)
|
||||
except Exception, err:
|
||||
fonctionseole.zephir("ERR" , "supprimer_fichier a généré une erreur {}".format(err), "PERSO")
|
||||
sys.exit(1)
|
||||
|
||||
fonctionseole.zephir("FIN" , "supprimer_fichier {}: OK".format(filename), "PERSO")
|
||||
\end{minted}
|
||||
|
||||
\chapter{Création du script de suppression des fichiers}
|
||||
|
||||
Un second script bash est nécessaire. Ce script est utilisé pour supprimer effectivement le fichier sur le serveur.
|
||||
|
||||
\begin{minted}{bash}
|
||||
#!/bin/bash
|
||||
|
||||
[ -f "$1" ] && rm -f "$1"
|
||||
\end{minted}
|
||||
|
||||
Il faut redémarrer z\_stats .
|
||||
|
||||
\end{document}
|
@ -0,0 +1,22 @@
|
||||
#!/usr/bin/env python
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
import sys
|
||||
from zephir.lib_zephir import *
|
||||
from creole import fonctionseole
|
||||
|
||||
if fonctionseole.init_proc('PERSO') == False:
|
||||
fonctionseole.zephir("MSG" , "procédure supprimer_fichier bloquée par zephir", "PERSO")
|
||||
sys.exit(1)
|
||||
|
||||
fonctionseole.zephir("INIT" , "script supprimer_fichier en cours d'execution", "PERSO")
|
||||
|
||||
try:
|
||||
filename = sys.argv[1]
|
||||
fonctionseole.zephir("MSG" , "supprimer_fichier lancé avec l'argument {}".format(filename), "PERSO")
|
||||
sudo_script('supprimer_fichier_sudo.zephir %s' % filename)
|
||||
except Exception, err:
|
||||
fonctionseole.zephir("ERR" , "supprimer_fichier a généré une erreur {}".format(err), "PERSO")
|
||||
sys.exit(1)
|
||||
|
||||
fonctionseole.zephir("FIN" , "supprimer_fichier {}: OK".format(filename), "PERSO")
|
@ -0,0 +1,4 @@
|
||||
#!/bin/bash
|
||||
|
||||
[ -f "$1" ] && rm -f "$1"
|
||||
|
Reference in New Issue
Block a user