diff --git a/Containerfile b/Containerfile index a738e0c..24ed7cb 100644 --- a/Containerfile +++ b/Containerfile @@ -73,14 +73,14 @@ RUN --mount=type=bind,from=build-ctx,source=/build/50-prepare-flatpak-for-bazaar ############################################################################### # 1. Kopiere die Filesystem-Fixes (tmpfiles.d, Vendor-Default) -COPY configs/bootc-fix.conf /usr/lib/tmpfiles.d/bootc-fix.conf +COPY --chmod=0644 configs/bootc-fix.conf /usr/lib/tmpfiles.d/bootc-fix.conf # 1b. Container-Policy & Registry Auth für bootc # sigstoreSigned-Pflicht für eigenes Image, Public-Registries explizit erlaubt -COPY configs/containers/policy.json /etc/containers/policy.json -COPY cosign.pub /etc/pki/containers/cosign.pub -COPY configs/auth.json /etc/containers/auth.json -COPY configs/humocs-man.yaml /etc/containers/registries.d/humocs-man.yaml +COPY --chmod=0644 configs/containers/policy.json /etc/containers/policy.json +COPY --chmod=0644 cosign.pub /etc/pki/containers/cosign.pub +COPY --chmod=0600 configs/auth.json /etc/containers/auth.json +COPY --chmod=0644 configs/humocs-man.yaml /etc/containers/registries.d/humocs-man.yaml RUN chmod 0644 /etc/containers/policy.json /etc/pki/containers/cosign.pub && \ chmod 0600 /etc/containers/auth.json && \ @@ -88,8 +88,9 @@ RUN chmod 0644 /etc/containers/policy.json /etc/pki/containers/cosign.pub && \ python3 -m json.tool /etc/containers/auth.json > /dev/null # 2. Kopiere die Systemd-Overrides als Vendor-Drop-ins (kein /etc/-Override im Image) -COPY configs/bootc-timer-override.conf /usr/lib/systemd/system/bootc-fetch-apply-updates.timer.d/override.conf -COPY configs/bootc-override.conf /usr/lib/systemd/system/bootc-fetch-apply-updates.service.d/override.conf +# --chmod=0644: schliesst world-writable Warnungen von systemd aus (0644 statt 0666 durch Checkout-umask) +COPY --chmod=0644 configs/bootc-timer-override.conf /usr/lib/systemd/system/bootc-fetch-apply-updates.timer.d/override.conf +COPY --chmod=0644 configs/bootc-override.conf /usr/lib/systemd/system/bootc-fetch-apply-updates.service.d/override.conf # 3. Kopiere das Benachrichtigungs-Skript COPY --chmod=755 scripts/notify-bootc-user.sh /usr/bin/ @@ -99,7 +100,7 @@ COPY --chmod=755 scripts/notify-bootc-user.sh /usr/bin/ # ============================================================================= # 4. Kopiere den Systemd-Service für den Erst-Boot von Flatpak -COPY configs/flatpak-preinstall.service /usr/lib/systemd/system/flatpak-preinstall.service +COPY --chmod=0644 configs/flatpak-preinstall.service /usr/lib/systemd/system/flatpak-preinstall.service # 5. Aktiviere Services (Presets greifen nicht bei COPY-Dateien) RUN systemctl enable \ diff --git a/build/30-virt.sh b/build/30-virt.sh index 3f77781..61cf1a1 100755 --- a/build/30-virt.sh +++ b/build/30-virt.sh @@ -16,7 +16,9 @@ dnf5 install -y \ micro \ fuse \ fuse-libs \ - fuse3 + fuse3 \ + jq \ + libnotify dnf5 clean all diff --git a/configs/bootc-timer-override.conf b/configs/bootc-timer-override.conf index 60ca540..fe58067 100644 --- a/configs/bootc-timer-override.conf +++ b/configs/bootc-timer-override.conf @@ -1,8 +1,7 @@ [Timer] -# Leeren der Standardwerte +# Leeren der Standardwerte (nur Listen-Keys duerfen leer zugewiesen werden) OnBootSec= OnUnitInactiveSec= -RandomizedDelaySec= OnCalendar= # Prüfe jeden Tag um 20:00 Uhr diff --git a/scripts/notify-bootc-user.sh b/scripts/notify-bootc-user.sh index cc599a9..43d3810 100755 --- a/scripts/notify-bootc-user.sh +++ b/scripts/notify-bootc-user.sh @@ -10,15 +10,32 @@ SYSTEMCTL="/usr/bin/systemctl" TAG="bootc-timer" +have() { command -v "$1" >/dev/null 2>&1; } + +# Harte Abhaengigkeiten pruefen (jq für bootc-JSON, notify-send für Desktop-Dialog) +# Fehlt etwas, ist das ein Build-Fehler (Paket fehlt im Image) – klar loggen statt kryptisch crashen. +if ! have jq; then + $LOGGER -t "$TAG" "FEHLER: 'jq' fehlt im Image (notify-bootc-user.sh braucht es). Abbruch." + exit 1 +fi + # ============================================================================= -# Flatpaks im Hintergrund aktualisieren +# Flatpaks im Hintergrund aktualisieren (nur wenn flatpak vorhanden) # ============================================================================= -$LOGGER -t "$TAG" "Suche nach Flatpak-Updates..." -$FLATPAK update -y --noninteractive || $LOGGER -t "$TAG" "Flatpak-Update fehlgeschlagen oder keine Updates vorhanden." +if have "$FLATPAK"; then + $LOGGER -t "$TAG" "Suche nach Flatpak-Updates..." + $FLATPAK update -y --noninteractive || $LOGGER -t "$TAG" "Flatpak-Update fehlgeschlagen oder keine Updates vorhanden." +else + $LOGGER -t "$TAG" "Flatpak nicht installiert, ueberspringe Flatpak-Update." +fi # ============================================================================= # 1. Bootc Upgrade ausfuehren # ============================================================================= +if ! have "$BOOTC"; then + $LOGGER -t "$TAG" "FEHLER: '$BOOTC' fehlt im Image. Abbruch." + exit 1 +fi $LOGGER -t "$TAG" "Suche nach System-Updates (bootc)..." $BOOTC upgrade || true @@ -49,6 +66,11 @@ fi $LOGGER -t "$TAG" "Sende Benachrichtigung an User-ID: $USER_ID" +if ! have "$NOTIFY"; then + $LOGGER -t "$TAG" "Update bereit, aber 'notify-send' (libnotify) fehlt im Image – keine Desktop-Benachrichtigung moeglich." + exit 0 +fi + # ============================================================================= # 4. Benachrichtigung senden # =============================================================================