This commit is contained in:
2026-03-24 23:56:33 +01:00
parent 4372d7d273
commit a42272bd56
2 changed files with 46 additions and 0 deletions

22
web_secu/avahi.sh Normal file
View File

@@ -0,0 +1,22 @@
#!/bin/bash
cat << 'EOF'
=============================
_______ ________ ___ ___ _______ ________
|\ ___ \ |\ __ \|\ \|\ \|\ ___ \ |\ ____\
\ \ __/|\ \ \|\ \ \ \\\ \ \ __/|\ \ \___|
\ \ \_|/_\ \ ____\ \ __ \ \ \_|/_\ \ \
\ \ \_|\ \ \ \___|\ \ \ \ \ \ \_|\ \ \ \____
\ \_______\ \__\ \ \__\ \__\ \_______\ \_______\
\|_______|\|__| \|__|\|__|\|_______|\|_______|
=============================
EOF
if dpkg -l avahi-daemon 2>/dev/null | grep -q '^ii'; then
echo "Avahi est déjà installé et actif."
else
apt install -y avahi-daemon
systemctl enable avahi-daemon
systemctl start avahi-daemon
echo "Avahi démarré — accessible via loustiques.local"
fi

24
web_secu/ssl.sh Normal file
View File

@@ -0,0 +1,24 @@
#!/bin/bash
cat << 'EOF'
=============================
_______ ________ ___ ___ _______ ________
|\ ___ \ |\ __ \|\ \|\ \|\ ___ \ |\ ____\
\ \ __/|\ \ \|\ \ \ \\\ \ \ __/|\ \ \___|
\ \ \_|/_\ \ ____\ \ __ \ \ \_|/_\ \ \
\ \ \_|\ \ \ \___|\ \ \ \ \ \ \_|\ \ \ \____
\ \_______\ \__\ \ \__\ \__\ \_______\ \_______\
\|_______|\|__| \|__|\|__|\|_______|\|_______|
=============================
EOF
EOF
if [ -f "web_secu/ssl/cert.pem" ] && [ -f "web_secu/ssl/key.pem" ]; then
echo "Certificat SSL déjà existant, on passe."
else
mkdir -p web_secu/ssl
openssl req -x509 -newkey rsa:4096 -keyout web_secu/ssl/key.pem -out web_secu/ssl/cert.pem -days 365 -nodes \
-subj "/C=BE/ST=Brabant Wallon/L=Louvain-La-Neuve/O=Les Loustiques/OU=EPHEC/CN=loustiques.local"
echo "Certificat généré avec succès !"
fi