corrections pages maintenance

This commit is contained in:
Olivier Navas 2022-03-13 13:56:03 +01:00
parent 0440d0b433
commit b8a04561fa
3 changed files with 9 additions and 11 deletions

View file

@ -13,7 +13,7 @@ while true; do
for i in $(ls $VHOSTS_DIR); do for i in $(ls $VHOSTS_DIR); do
LISTE_VHOSTS="$LISTE_VHOSTS $i" LISTE_VHOSTS="$LISTE_VHOSTS $i"
if [ -f "$MAINTENANCE_DIR/$i" ]; then if [ -f "$MAINTENANCE_DIR/$i.html" ]; then
LISTE_VHOSTS="$LISTE_VHOSTS (maintenance)" LISTE_VHOSTS="$LISTE_VHOSTS (maintenance)"
else else
LISTE_VHOSTS="$LISTE_VHOSTS (normal)" LISTE_VHOSTS="$LISTE_VHOSTS (normal)"
@ -26,12 +26,10 @@ while true; do
rm $TMP rm $TMP
if [ "$ERR" == "0" ]; then if [ "$ERR" == "0" ]; then
if [ -f "$MAINTENANCE_DIR/$VHOST" ]; then if [ -f "$MAINTENANCE_DIR/$VHOST.html" ]; then
rm $MAINTENANCE_DIR/$VHOST rm $MAINTENANCE_DIR/$VHOST.html
# dialog --title "Gestion page de maintenance" --msgbox "$VHOST n'est plus en maintenance" 0 0
else else
ln -s $MAINTENANCE_DIR/maintenance-generique.html $MAINTENANCE_DIR/$VHOST ln -s $MAINTENANCE_DIR/maintenance-generique.html $MAINTENANCE_DIR/$VHOST.html
# dialog --title "Gestion page de maintenance" --msgbox "$VHOST est mis en maintenance" 0 0
fi fi
else else
exit exit

View file

@ -172,12 +172,12 @@ SecCookieFormat 0
</Location> </Location>
# Si on est en maintenance # Si on est en maintenance
<If "-f %{DOCUMENT_ROOT} . '/maintenance/$vhostFQDN'"> <If "-f %{DOCUMENT_ROOT} . '/rp_maintenance/$vhostFQDN.html'">
RewriteCond %{REMOTE_ADDR} !127.0.0.1 RewriteCond %{REMOTE_ADDR} !127.0.0.1
RewriteCond %{REQUEST_URI} !^/rp_ressources/* RewriteCond %{REQUEST_URI} !^/rp_ressources/*
RewriteCond %{REQUEST_URI} !^/rp_maintenance/* RewriteCond %{REQUEST_URI} !^/rp_maintenance/*
RewriteCond %{HTTP_COOKIE} !rp_acces_maintenance=([^;]+) RewriteCond %{HTTP_COOKIE} !rp_acces_maintenance=([^;]+)
RewriteRule ^.*$ %{DOCUMENT_ROOT}/maintenance/$vhostFQDN RewriteRule ^.*$ %{DOCUMENT_ROOT}/rp_maintenance/$vhostFQDN.html
Header Set Cache-Control "no-store" Header Set Cache-Control "no-store"
</If> </If>
</Macro> </Macro>

View file

@ -10,7 +10,7 @@
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap@4.5.3/dist/css/bootstrap.min.css" integrity="sha384-TX8t27EcRE3e/ihU7zmQxVncDAy5uIKz4rEkgIXeMed4M0jlfIDPvg6uqKI2xXr2" crossorigin="anonymous"> <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap@4.5.3/dist/css/bootstrap.min.css" integrity="sha384-TX8t27EcRE3e/ihU7zmQxVncDAy5uIKz4rEkgIXeMed4M0jlfIDPvg6uqKI2xXr2" crossorigin="anonymous">
<script src="https://cdn.jsdelivr.net/npm/bootstrap@4.5.3/dist/js/bootstrap.bundle.min.js" integrity="sha384-ho+j7jyWK8fNQe+A12Hb8AhRq26LrZ/JpcUGGOn+Y7RsweNrtN/tE3MoK7ZeZDyx" crossorigin="anonymous"></script> <script src="https://cdn.jsdelivr.net/npm/bootstrap@4.5.3/dist/js/bootstrap.bundle.min.js" integrity="sha384-ho+j7jyWK8fNQe+A12Hb8AhRq26LrZ/JpcUGGOn+Y7RsweNrtN/tE3MoK7ZeZDyx" crossorigin="anonymous"></script>
<script src="https://www.w3schools.com/lib/w3data.js"></script> <script src="https://www.w3schools.com/lib/w3data.js"></script>
<link href="/rp_ressources/crna_customization.css" rel="stylesheet"> <link href="/rp_ressources/customization.css" rel="stylesheet">
<script type="text/javascript"> <script type="text/javascript">
function setAccesMaintenanceCookie() { function setAccesMaintenanceCookie() {
var date = new Date(); var date = new Date();
@ -34,8 +34,8 @@
<p class="lead"></p> <p class="lead"></p>
<p>L'application demandée est en maintenance. En tant que personnel de la DSI vous allez pouvoir y accéder. Cependant, merci de vous assurer <p>L'application demandée est en maintenance. En qu'administrateur vous allez pouvoir y accéder. Merci cependant de vous assurer
auprès de l'équipe en charge de la maintenance que vos actions dans l'application ne risquent pas de perturber l'opération en cours.</p> que vos actions ne risquent pas de perturber l'opération en cours.</p>
<a class="btn btn-primary" href="/" role="button">Accéder à l'application</a> <a class="btn btn-primary" href="/" role="button">Accéder à l'application</a>
</div> </div>