<?xml version="1.0" encoding="utf-8"?>

<creole>

    <files>
        <file filelist='proftpd_container' name='/usr/share/eole/bastion/data/11-proftpd' rm='True' mode='0755'/>
    </files>

    <containers>
        <!-- FIXME : 2.4 : nécessite eole-fichier ? -->
        <container name='ftp' id='25'>
            <!--<disknod>/home</disknod>-->
            <!--attention, redefini dans 50_amonecole-->
            <package>eole-proftpd-pkg</package>
            <package instance_mode='when_no_container'>eole-antivirus-pkg</package>
            <package instance_mode='when_container'>eole-antivirus-container-pkg</package>
            <service servicelist='proftpd'>proftpd</service>
            <service_access service='proftpd'>
                <port service_accesslist='proftpd_container'>21</port>
            </service_access>
            <service servicelist='antivirus_ftp'>clamav-daemon</service>
            <file filelist='proftpd' name='/etc/proftpd/proftpd.conf'/>
            <file filelist='proftpd' name='/etc/pam.d/proftpd' source='pam_proftpd'/>
            <!-- eole-proftpd depends on eole-sso-client -->
            <file filelist='ssoclient' name='/etc/pam_cas.conf' source='pam_cas_auth.conf'/>
            <!-- clamd.conf is provided by eole-antivirus -->
            <file filelist='antivirus_ftp' name='/etc/clamav/clamd.conf'/>
        </container>
    </containers>

    <variables>
        <family name='services'>
            <variable name='activer_proftpd' type='oui/non' description="Activer l'accès FTP" >
                <value>oui</value>
            </variable>
        </family>
        <family name='clamav' hidden='True'>
            <variable name='ftp_scan' type='oui/non' description="Activer l'anti-virus temps réel sur FTP">
                <value>oui</value>
            </variable>
        </family>
        <family name='proftpd' mode='expert' icon='cloud-download'>
            <variable name='ftp_servername' type='string' description='Nom du serveur FTP'/>
            <variable name='ftp_tls' type='oui/non' description="Activer le chiffrement TLS">
                <value>non</value>
            </variable>
            <variable name='activer_ftp_anonymous_access' type='oui/non' description="Activer l'accès anonyme">
                <value>non</value>
            </variable>
            <variable name='ftp_anonymous_directory' type='filename' description="Chemin du répertoire anonyme" mandatory='True'/>
            <variable name='activer_ftp_access' type='oui/non' description="Activer des accès FTP supplémentaires">
                <value>non</value>
            </variable>
            <variable name='ftp_access_directory' type='filename' description="Chemin du répertoire FTP supplémentaire" multi='True' mandatory='True'/>
            <variable name='ftp_pam_ldap' type='oui/non' description="Autoriser les comptes LDAP à se connecter en accès FTP">
                <value>oui</value>
            </variable>
            <variable name='ftp_pam_sso' type='oui/non' description="Autoriser CAS en accès FTP" >
                <value>oui</value>
            </variable>
            <variable name='ftp_maxclients' type='number' description="Nombre maximum d'utilisateurs simultanés">
                <value>50</value>
            </variable>
            <variable name='ftp_maxinstances' type='number' description="Nombre maximum de processus pour ProFTPD">
                <value>40</value>
            </variable>
            <variable name='ftp_maxretrievefilesize' type='number' description="Taille maximum du fichier récupéré (download) en Mb">
                <value>500</value>
            </variable>
            <variable name='ftp_maxstorefilesize' type='number' description="Taille maximum du fichier déposé (upload) en Mb">
                <value>100</value>
            </variable>
            <variable name='ftp_timeoutidle' type='number' description="Temps maximum d'inactivité avant déconnexion (en secondes)">
                <value>1200</value>
            </variable>
        </family>
        <separators>
            <!--<separator name='activer_ftp_anonymous_access'>Gestion des accès</separator>
            <separator name='ftp_maxclients'>Configuration avancée</separator>-->
        </separators>
    </variables>

    <constraints>

        <check name='valid_regexp' target='ftp_anonymous_directory'>
            <param>^/</param>
            <param name='err_msg'>Renseigner un chemin absolu</param>
        </check>

        <check name='valid_regexp' target='ftp_access_directory'>
            <param>^/</param>
            <param name='err_msg'>Renseigner un chemin absolu</param>
        </check>

        <fill name='calc_val' target='ftp_servername'>
            <param type='eole' name='valeur'>libelle_etab</param>
        </fill>

        <condition name='disabled_if_in' source='activer_proftpd'>
            <param>non</param>
            <target type='filelist'>proftpd</target>
            <target type='servicelist'>proftpd</target>
            <target type='family'>proftpd</target>
            <target type='variable'>ftp_scan</target>
            <target type='filelist'>proftpd_container</target>
            <target type='service_accesslist'>proftpd_container</target>
        </condition>
        <condition name='disabled_if_in' source='mode_conteneur_actif'>
            <param>oui</param>
            <target type='filelist'>proftpd_container</target>
            <target type='service_accesslist'>proftpd_container</target>
        </condition>
        <condition name='disabled_if_in' source='activer_ftp_anonymous_access'>
            <param>non</param>
            <target type='variable'>ftp_anonymous_directory</target>
        </condition>
        <condition name='disabled_if_in' source='activer_ftp_access'>
            <param>non</param>
            <target type='variable'>ftp_access_directory</target>
        </condition>

        <!-- Anti-virus sur FTP -->
        <condition name='disabled_if_in' source='activer_clam'>
            <param>non</param>
            <target type='servicelist'>antivirus_ftp</target>
            <target type='filelist'>antivirus_ftp</target>
        </condition>
        <condition name='disabled_if_in' source='ftp_scan'>
            <param>non</param>
            <target type='servicelist'>antivirus_ftp</target>
            <target type='filelist'>antivirus_ftp</target>
        </condition>
        <condition name='disabled_if_in' source='activer_client_ldap' fallback='True'>
            <param>non</param>
            <target type='variable'>ftp_pam_ldap</target>
        </condition>
        <condition name='disabled_if_in' source='ftp_pam_ldap'>
            <param>non</param>
            <target type='variable'>ftp_pam_sso</target>
        </condition>
        <condition name='disabled_if_in' source='activer_sso'>
            <param>non</param>
            <target type='variable'>ftp_pam_sso</target>
        </condition>

    </constraints>

    <help>
        <variable name='activer_proftpd'>ProFTPD est un serveur FTP</variable>
        <family name='proftpd'>Paramétrage avancé du serveur FTP</family>
    </help>

</creole>
<!-- vim: ts=4 sw=4 expandtab
-->
