You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.
#!/usr/bin/env sh
# Einrichtung / Reparatur auf dem Server. Im Ordner deploy/ ausführen: sh install.sh
set -e
cd " $( dirname " $0 " ) "
# 1 · Reste eines fehlgeschlagenen Einzeldatei-Mounts aufräumen
docker rm -f td-pult 2>/dev/null || true
for p in ../TD-Pult.html ./TD-Pult.html; do
if [ -d " $p " ] ; then echo " Räume leeren Ordner $p auf " ; rmdir " $p " 2>/dev/null || true; fi
done
# 2 · Website-Ordner vorbereiten
mkdir -p site
if [ -f ../TD-Pult.html ] ; then
cp ../TD-Pult.html site/index.html
fi
if [ ! -f site/index.html ] ; then
echo "FEHLER: site/index.html fehlt. Lade TD-Pult.html hoch und kopiere sie:"
echo " cp /pfad/zu/TD-Pult.html site/index.html"
exit 1
fi
# 3 · Rechte setzen – nginx im Container liest als eigener Benutzer
chmod 755 site
chmod 644 site/index.html
# 4 · Passwortdatei prüfen
if [ ! -s htpasswd ] ; then
echo "FEHLER: htpasswd fehlt. Einmalig anlegen:"
echo " docker run --rm httpd:alpine htpasswd -Bbn td 'DEIN-PASSWORT' > htpasswd"
exit 1
fi
chmod 600 htpasswd
# 5 · Starten und prüfen
docker compose up -d
sleep 2
echo
echo "Erwartet wird 401 Unauthorized:"
docker run --rm --network host curlimages/curl:latest -s -o /dev/null -w 'HTTP %{http_code}\n' http://127.0.0.1:8087/ \
|| curl -s -o /dev/null -w 'HTTP %{http_code}\n' http://127.0.0.1:8087/ \
|| echo "(Prüfung übersprungen – bitte manuell: curl -I http://127.0.0.1:8087/)"