Il y a 389 articles et 19 utilisateurs inscrits (ce bandeau est défini dans MediaWiki:Sitenotice)

« Httpd blocage des images » : différence entre les versions

De AJLSM
Aller à la navigation Aller à la recherche
 
(4 versions intermédiaires par 2 utilisateurs non affichées)
Ligne 1 : Ligne 1 :
[[category:Blocage images visionneuse]]
== Références ==Vignettes des images visibles. Image plein format non visibles<references/>
===Bloquer les aspirations des images dans Pleade===
===Bloquer les aspirations des images dans Pleade===


Ces paramètres sont à insérer dans le fichier de configuration d'Apache, pour l'application concernée.
Ces paramètres sont à insérer dans le fichier de configuration d'Apache (du serveur où sont stockées les images originales et préparées, par exemple eole2), pour l'application concernée.
Ici, toutes URL apellant la visionneuse avec un type /img-serveur/../..jpg sont rejetées sauf localhost et l'URL publique.


Pour utiliser le module rewrite dans apache :
<syntaxhighlight lang="bash">
sudo a2enmod rewrite
</syntaxhighlight>
Ici, toutes URL appelant la visionneuse avec un type /img-serveur/../..jpg sont rejetées sauf localhost et l'URL publique.
{{important|Lorsque les images ne sont pas sur le même serveur que Pleade, la configuration est à faire sur le serveur où sont stockées les données. Par exemple eole2. }}
{{notice|Le comportement de Pleade lorsque la configuration n'inclue pas le domaine est le suivant : les vignettes sont visibles en résultat de recherche, dans la fenêtre EAD et dans la visionneuse. Par contre, les image "plein format" ne se chargent pas dans la visionneuse.}}
<syntaxhighlight lang="bash"><VirtualHost *:80>
<syntaxhighlight lang="bash"><VirtualHost *:80>
         ServerName gael.gironde.fr
         ServerName gael.gironde.fr
Ligne 23 : Ligne 34 :


</VirtualHost></syntaxhighlight>
</VirtualHost></syntaxhighlight>
Autre exemple. Un extrait de la partie de la configuration apache modifiée sur eole2 :
<syntaxhighlight lang="bash">        # Protection contre les chargement directs des images. On ne laisse passer que les personnes ayant le cookie Pleade
        RewriteCond %{REQUEST_URI} ^/fcgi-bin/.*
        RewriteCond %{HTTP_REFERER} !^http://localhost
        RewriteCond %{HTTP_REFERER} !^http://formation0.pleade.com
        RewriteCond %{HTTP_REFERER} !^http://formation1.pleade.com
        RewriteCond %{HTTP_REFERER} !^http://formation2.pleade.com
        RewriteCond %{HTTP_REFERER} !^http://formation3.pleade.com
        RewriteCond %{HTTP_REFERER} !^http://formation4.pleade.com
        RewriteCond %{HTTP_REFERER} !^http://formation5.pleade.com
        RewriteCond %{HTTP_REFERER} !^http://formation6.pleade.com
        RewriteCond %{HTTP_REFERER} !^http://formation7.pleade.com
        RewriteCond %{HTTP_REFERER} !^http://formation8.pleade.com
        RewriteCond %{HTTP_REFERER} !^http://formation9.pleade.com
        RewriteCond %{HTTP_REFERER} !^http://formation10.pleade.com
        RewriteCond %{HTTP_REFERER} !^http://formation11.pleade.com
        RewriteCond %{HTTP_REFERER} !^http://formation12.pleade.com
        RewriteCond %{HTTP_REFERER} !^http://formation13.pleade.com
        RewriteCond %{HTTP_REFERER} !^https://archives.lamayenne.fr
        RewriteCond %{HTTP_REFERER} !^http://salle-de-lecture-archives.lamayenne.fr
        RewriteCond %{HTTP_REFERER} !^http://ad53-preprod.ajlsm.com
        RewriteCond %{HTTP_REFERER} !^http://test-v4.pleade.com
        RewriteCond %{HTTP_REFERER} !^http://test-v4-portail.pleade.com
        RewriteCond %{HTTP_REFERER} !^http://apbp.pleade.com
        RewriteCond %{HTTP_REFERER} !^http://am-angers.pleade.com
        RewriteCond %{HTTP_REFERER} !^http://apbp-preprod.ajlsm.com
        RewriteCond %{HTTP_REFERER} !^http://apbp-slecture.ajlsm.com
        RewriteCond %{HTTP_REFERER} !^http://apbp-internet.ajlsm.com
        RewriteCond %{HTTP_REFERER} !^https://archives-preprod.agglo-pau.fr
        RewriteCond %{HTTP_REFERER} !^https://archives-lecture.agglo-pau.fr
        RewriteCond %{HTTP_REFERER} !^http://archives-internet.agglo-pau.fr
        RewriteCond %{HTTP_REFERER} !^https://archives.agglo-pau.fr
        RewriteCond %{HTTP_REFERER} !^http://mirador.pleade.com
        #RewriteCond %{HTTP_REFERER} !^
        #RewriteCond %{HTTP_REFERER} !^
        #RewriteCond %{HTTP_REFERER} !^
        #RewriteCond %{HTTP_REFERER} !^
        #RewriteCond %{HTTP_COOKIE} !pleade-zone=""
        RewriteRule .* /403.html [R,L]
</syntaxhighlight>

Dernière version du 28 novembre 2022 à 12:18

== Références ==Vignettes des images visibles. Image plein format non visibles<references/>

Bloquer les aspirations des images dans Pleade

[modifier | modifier le wikicode]

Ces paramètres sont à insérer dans le fichier de configuration d'Apache (du serveur où sont stockées les images originales et préparées, par exemple eole2), pour l'application concernée.

Pour utiliser le module rewrite dans apache :

sudo a2enmod rewrite

Ici, toutes URL appelant la visionneuse avec un type /img-serveur/../..jpg sont rejetées sauf localhost et l'URL publique.


Important :
Lorsque les images ne sont pas sur le même serveur que Pleade, la configuration est à faire sur le serveur où sont stockées les données. Par exemple eole2. .
Notice :
Le comportement de Pleade lorsque la configuration n'inclue pas le domaine est le suivant : les vignettes sont visibles en résultat de recherche, dans la fenêtre EAD et dans la visionneuse. Par contre, les image "plein format" ne se chargent pas dans la visionneuse..
<VirtualHost *:80>
        ServerName gael.gironde.fr

        ### Configuration des rewrite ###
        RewriteEngine on
        RewriteLog "/var/log/httpd/rewrite.log"
        RewriteLogLevel 0

...

        # blocage de l'accès direct aux images
        RewriteCond %{REQUEST_URI} ^//?img-server/.*/.*\.(jpg|JPG|gif|GIF|png|PNG|jpeg|JPEG|tif|TIF|tiff|TIFF)
        RewriteCond %{REQUEST_URI} !^//?img-server/.*/.*\.(pdf|PDF)
        #RewriteCond %{REMOTE_ADDR} !82.225.177.85 !!!!! Attention : IP d'AJLSM !!!! Donc, la règle ne fonctionne pas pour le bureau
        RewriteCond %{HTTP_REFERER} !^http://localhost
        RewriteCond %{HTTP_REFERER} !^http://[URL_PUBLIQUE]
        RewriteRule .* /403.html [R,L]

</VirtualHost>

Autre exemple. Un extrait de la partie de la configuration apache modifiée sur eole2 :

        # Protection contre les chargement directs des images. On ne laisse passer que les personnes ayant le cookie Pleade
        RewriteCond %{REQUEST_URI} ^/fcgi-bin/.*
        RewriteCond %{HTTP_REFERER} !^http://localhost
        RewriteCond %{HTTP_REFERER} !^http://formation0.pleade.com
        RewriteCond %{HTTP_REFERER} !^http://formation1.pleade.com
        RewriteCond %{HTTP_REFERER} !^http://formation2.pleade.com
        RewriteCond %{HTTP_REFERER} !^http://formation3.pleade.com
        RewriteCond %{HTTP_REFERER} !^http://formation4.pleade.com
        RewriteCond %{HTTP_REFERER} !^http://formation5.pleade.com
        RewriteCond %{HTTP_REFERER} !^http://formation6.pleade.com
        RewriteCond %{HTTP_REFERER} !^http://formation7.pleade.com
        RewriteCond %{HTTP_REFERER} !^http://formation8.pleade.com
        RewriteCond %{HTTP_REFERER} !^http://formation9.pleade.com
        RewriteCond %{HTTP_REFERER} !^http://formation10.pleade.com
        RewriteCond %{HTTP_REFERER} !^http://formation11.pleade.com
        RewriteCond %{HTTP_REFERER} !^http://formation12.pleade.com
        RewriteCond %{HTTP_REFERER} !^http://formation13.pleade.com
        RewriteCond %{HTTP_REFERER} !^https://archives.lamayenne.fr
        RewriteCond %{HTTP_REFERER} !^http://salle-de-lecture-archives.lamayenne.fr
        RewriteCond %{HTTP_REFERER} !^http://ad53-preprod.ajlsm.com
        RewriteCond %{HTTP_REFERER} !^http://test-v4.pleade.com
        RewriteCond %{HTTP_REFERER} !^http://test-v4-portail.pleade.com
        RewriteCond %{HTTP_REFERER} !^http://apbp.pleade.com
        RewriteCond %{HTTP_REFERER} !^http://am-angers.pleade.com
        RewriteCond %{HTTP_REFERER} !^http://apbp-preprod.ajlsm.com
        RewriteCond %{HTTP_REFERER} !^http://apbp-slecture.ajlsm.com
        RewriteCond %{HTTP_REFERER} !^http://apbp-internet.ajlsm.com
        RewriteCond %{HTTP_REFERER} !^https://archives-preprod.agglo-pau.fr
        RewriteCond %{HTTP_REFERER} !^https://archives-lecture.agglo-pau.fr
        RewriteCond %{HTTP_REFERER} !^http://archives-internet.agglo-pau.fr
        RewriteCond %{HTTP_REFERER} !^https://archives.agglo-pau.fr
        RewriteCond %{HTTP_REFERER} !^http://mirador.pleade.com
        #RewriteCond %{HTTP_REFERER} !^
        #RewriteCond %{HTTP_REFERER} !^
        #RewriteCond %{HTTP_REFERER} !^
        #RewriteCond %{HTTP_REFERER} !^
        #RewriteCond %{HTTP_COOKIE} !pleade-zone=""
        RewriteRule .* /403.html [R,L]