35 lines
1.0 KiB
Bash
35 lines
1.0 KiB
Bash
#!/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:
|
|
cert: false" > /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
|
|
cert: false" > /config/code-server/config.yaml
|
|
fi
|
|
|
|
# Die ID der Extension, die installiert werden soll
|
|
EXTENSION_ID="james-yu.latex-workshop"
|
|
|
|
# Überprüfen, ob die Extension bereits installiert ist
|
|
if ! code-server --list-extensions | grep -q "${EXTENSION_ID}"; then
|
|
echo "Installiere Extension: ${EXTENSION_ID}"
|
|
code-server --install-extension ${EXTENSION_ID}
|
|
else
|
|
echo "Extension ${EXTENSION_ID} ist bereits installiert."
|
|
fi
|
|
|
|
# Starte den Code Server mit der Konfigurationsdatei
|
|
code-server --config /config/code-server/config.yaml
|