diff --git a/backend/services/vocabService.js b/backend/services/vocabService.js index b83a2c4..1d59415 100644 --- a/backend/services/vocabService.js +++ b/backend/services/vocabService.js @@ -1933,6 +1933,8 @@ export default class VocabService { if (correctIndices.length === 0) return false; + const options = Array.isArray(parsedQuestionData?.options) ? parsedQuestionData.options : []; + const correctTexts = correctIndices .map((i) => options[i]) .filter((opt) => opt !== undefined && opt !== null); diff --git a/frontend/src/i18n/locales/de/general.json b/frontend/src/i18n/locales/de/general.json index 771683c..ff36e37 100644 --- a/frontend/src/i18n/locales/de/general.json +++ b/frontend/src/i18n/locales/de/general.json @@ -30,6 +30,7 @@ "loading": "Lädt...", "back": "Zurück", "cancel": "Abbrechen", + "ok": "OK", "yes": "Ja", "no": "Nein" }, diff --git a/frontend/src/i18n/locales/en/general.json b/frontend/src/i18n/locales/en/general.json index 53ea8ca..b40bf7a 100644 --- a/frontend/src/i18n/locales/en/general.json +++ b/frontend/src/i18n/locales/en/general.json @@ -30,6 +30,7 @@ "loading": "Loading...", "back": "Back", "cancel": "Cancel", + "ok": "OK", "yes": "Yes", "no": "No" }, diff --git a/frontend/src/i18n/locales/es/general.json b/frontend/src/i18n/locales/es/general.json index 7d704ee..52b4c52 100644 --- a/frontend/src/i18n/locales/es/general.json +++ b/frontend/src/i18n/locales/es/general.json @@ -30,6 +30,7 @@ "loading": "Cargando...", "back": "Atrás", "cancel": "Cancelar", + "ok": "Aceptar", "yes": "Sí", "no": "No" }, diff --git a/update-backend.sh b/update-backend.sh index d48df42..b01f066 100755 --- a/update-backend.sh +++ b/update-backend.sh @@ -25,27 +25,21 @@ echo "Installing dependencies..." npm ci --production echo "Übernehme .env-Dateien vom Live-System..." -if sudo -n test -f "$CURRENT_BACKEND/.env"; then - sudo -n cp "$CURRENT_BACKEND/.env" "$BACKEND_DIR/.env" - sudo -n chown tsschulz:tsschulz "$BACKEND_DIR/.env" - echo "✓ .env-Datei übernommen" -else - echo "⚠ Keine lesbare .env-Datei in $CURRENT_BACKEND gefunden" -fi -TEMP_ENV_DIR="/tmp/yourpart-env-backup-$$" -mkdir -p "$TEMP_ENV_DIR" +SOURCE_ENV="/opt/yourpart/backend/.env" +TARGET_ENV="$BACKEND_DIR/.env" -echo "Sichere .env-Dateien aus $CURRENT_BACKEND..." -if [ -d "$CURRENT_BACKEND" ]; then - find "$CURRENT_BACKEND" -maxdepth 1 -name '.env*' -type f -exec cp {} "$TEMP_ENV_DIR/" \; 2>/dev/null || true - if [ "$(ls -A "$TEMP_ENV_DIR" 2>/dev/null)" ]; then - echo "✓ .env-Dateien gesichert: $(ls "$TEMP_ENV_DIR")" - cp "$TEMP_ENV_DIR"/.env* "$BACKEND_DIR"/ 2>/dev/null || true - else - echo "⚠ Keine .env-Dateien in $CURRENT_BACKEND gefunden" - fi -fi +echo "Quelle: $SOURCE_ENV" +echo "Ziel: $TARGET_ENV" + +sudo -n ls -l "$SOURCE_ENV" +sudo -n install -m 600 -o yourpart -g yourpart "$SOURCE_ENV" "$TARGET_ENV" + +echo "Prüfe kopierte Datei..." +ls -l "$TARGET_ENV" +sudo -n head -n 1 "$TARGET_ENV" >/dev/null + +echo "✓ .env-Datei wurde übernommen" sudo -n mkdir -p "$DATA_DIR/adult-verification" @@ -61,10 +55,6 @@ sudo -n chmod -R 755 "$BACKEND_DIR" sudo -n chown -R yourpart:yourpart "$DATA_DIR" sudo -n chmod -R 755 "$DATA_DIR" -if [ -f "$BACKEND_DIR/.env" ]; then - sudo -n chmod 600 "$BACKEND_DIR/.env" -fi - echo "Updating systemd service..." sudo -n cp "$TARGET_DIR/yourpart.service" /etc/systemd/system/ sudo -n systemctl daemon-reload