diff --git a/install-extensions.sh b/install-extensions.sh index 82fccc0..d17da50 100644 --- a/install-extensions.sh +++ b/install-extensions.sh @@ -1,5 +1,22 @@ #!/bin/bash +# Starten des code-server + +# Überprüfen, ob eine PASSWORD Umgebungsvariable gesetzt ist +if [ -z "$PASSWORD" ]; then + echo "Starte Code Server ohne Passwort..." + # Konfiguration für keinen Authentifizierungsmodus + echo "bind-addr: 0.0.0.0:8443 +auth: none +password:" > /config/code-server/config.yaml +else + echo "Starte Code Server mit Passwort..." + # Konfiguration für Passwort-Authentifizierungsmodus + echo "bind-addr: 0.0.0.0:8443 +auth: password +password: $PASSWORD" > /config/code-server/config.yaml +fi + # Die ID der Extension, die installiert werden soll EXTENSION_ID="james-yu.latex-workshop" @@ -11,5 +28,5 @@ else echo "Extension ${EXTENSION_ID} ist bereits installiert." fi -# Starten des code-server -exec code-server --bind-addr 0.0.0.0:8443 --auth none \ No newline at end of file +# Starte den Code Server mit der Konfigurationsdatei +code-server --config /config/code-server/config.yaml