refactor: Review-Funde ausmerzen (Timeouts, atomar, Seed-Helfer, Asserts)

This commit is contained in:
humocs-man committed 2026-10-10 17:12:40 +02:00
1 parent d2d686c7a3
commit 6a95ff6cef
5 files changed
+40 -10

No files matched your search

+10 -8
View File
@@ -113,7 +113,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)
# --chmod=0644: keine world-writable Units (systemd warnt sonst im Journal)
# --chmod=0644: keine world-writable Units (systemd warnt sonst im Journal).
# HINWEIS: Zurueckgesetzt wird nur ExecStart. Kuenftige Upstream-ExecStartPre/
# ExecCondition-Zeilen liefen weiter (bewusst: kein Over-Override).
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
COPY --chmod=0644 configs/remount-fs-ostree-skip.conf /usr/lib/systemd/system/systemd-remount-fs.service.d/skip-on-ostree.conf
@@ -134,12 +136,12 @@ COPY --chmod=0644 configs/applications/bing-wallpaper-toggle.desktop /usr/share/
# User-Units (Bing-Wallpaper-Timer). --chmod: In-Image-Units muessen 644
# sein (world-writable Units warnt systemd lautstark an).
COPY --chmod=644 configs/systemd/user/bing-wallpaper.service /usr/lib/systemd/user/bing-wallpaper.service
COPY --chmod=644 configs/systemd/user/bing-wallpaper.timer /usr/lib/systemd/user/bing-wallpaper.timer
COPY --chmod=0644 configs/systemd/user/bing-wallpaper.service /usr/lib/systemd/user/bing-wallpaper.service
COPY --chmod=0644 configs/systemd/user/bing-wallpaper.timer /usr/lib/systemd/user/bing-wallpaper.timer
# Session-Target: zieht graphical-session.target hoch (Details in der Datei).
# Braucht kein enable (wird aus dem labwc-Autostart gestartet, kein [Install]
# noetig). --chmod wie oben: 644, keine world-writable Units.
COPY --chmod=644 configs/systemd/user/labwc-session.target /usr/lib/systemd/user/labwc-session.target
COPY --chmod=0644 configs/systemd/user/labwc-session.target /usr/lib/systemd/user/labwc-session.target
# labwc/kanshi-Defaults fuer neue Benutzer (Bestand bleibt via seed-labwc-skel)
COPY configs/skel/ /etc/skel/
@@ -190,7 +192,7 @@ RUN set -u; \
# =============================================================================
# 4. Kopiere den Systemd-Service für den Erst-Boot von Flatpak
COPY --chmod=644 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)
# HINWEIS: greetd wird bereits in 21-greetd.sh enabled; hier als
@@ -206,9 +208,9 @@ RUN systemctl enable \
# User-Units (Bing) liegen bereit, werden aber NICHT global aktiviert:
# Bing-Timer ist Opt-in per Launcher-App "Bing-Wallpaper an/aus".
# SELinux-Labels fuer Greeter/Skel/Sessions (Fehler tolerieren, Labels
# werden beim Deployment ggf. erneut gesetzt)
RUN restorecon -Rv /etc/greetd /etc/skel /usr/share/wayland-sessions 2>/dev/null || true
# SELinux-Labels fuer Greeter/Skel/Sessions/Greeter-Defaults/Skripte
# (Fehler tolerieren, Labels werden beim Deployment ggf. erneut gesetzt)
RUN restorecon -Rv /etc/greetd /etc/skel /usr/share/wayland-sessions /usr/share/noctalia-greeter /usr/bin/noctalia-greeter-session /usr/bin/kanshi-autoconfig /usr/bin/seed-labwc-skel /usr/bin/labwc-appmenu /usr/bin/bing-wallpaper.sh /usr/bin/bing-wallpaper-toggle.sh 2>/dev/null || true
###############################################################################
# PRE-FINAL CLEANUP
+3
View File
@@ -7,6 +7,9 @@ XKB_DEFAULT_LAYOUT=de
XKB_DEFAULT_VARIANT=nodeadkeys
QT_QPA_PLATFORM=wayland
GDK_BACKEND=wayland
# Native Electron-Apps (Brave nativ, VS Code u.a.) direkt auf Wayland
# statt XWayland-Umweg. Flatpaks bringen eigenes Env mit (unberuehrt).
ELECTRON_OZONE_PLATFORM_HINT=wayland
# Cursor: Adwaita ist im Image installiert; ohne diese Vars meckert labwc
# bei jedem Start ("$XCURSOR_SIZE/_THEME not set, ignoring").
XCURSOR_SIZE=24
Binary file not shown.
+21 -2
View File
@@ -14,6 +14,8 @@ Pipe-Menues nur, solange das Menue offen ist) - neu installierte Apps
"""
import configparser
import os
import re
import shlex
import shutil
import sys
import xml.sax.saxutils as sax
@@ -50,8 +52,25 @@ FIELD_CODES = {
def clean_exec(exec_line):
parts = [p for p in exec_line.split() if p not in FIELD_CODES]
return " ".join(parts).strip()
# shlex statt naive split (gequotete Pfade mit Leerzeichen bleiben ganz).
# Exakte Field-Codes fliegen raus; angeklebte Reste (%U, etc.) werden
# entfernt, leere Tokens gedroppt. Trade-off: ein legitimes "%f" als
# Teil eines Arguments (praktisch inexistent in Exec-Zeilen) wuerde
# mit entfernt - akzeptiert zugunsten robuster Menue-Commands.
try:
parts = shlex.split(exec_line)
except ValueError:
parts = exec_line.split()
cleaned = []
for p in parts:
if p in FIELD_CODES:
continue
p = re.sub(r"%[fFuUdDnNickvm]", "", p)
if p:
cleaned.append(p)
# shlex.join: Tokens mit Leerzeichen werden gequotet, damit labwc
# (Execute laeuft ueber die Shell) sie wieder als ein Argument sieht.
return shlex.join(cleaned).strip()
def read_desktop(path):
+6
View File
@@ -294,6 +294,12 @@ if [[ -f "${ENV_FILE}" ]] && ! grep -q '^XCURSOR_THEME=' "${ENV_FILE}"; then
printf '%s\n' 'XCURSOR_SIZE=24' 'XCURSOR_THEME=Adwaita' >> "${ENV_FILE}"
echo "migriert: XCURSOR-Vars in ${ENV_FILE} ergaenzt (Backup .bak)"
fi
# Migration: Native Electron-Apps direkt auf Wayland (statt XWayland).
if [[ -f "${ENV_FILE}" ]] && ! grep -q '^ELECTRON_OZONE_PLATFORM_HINT=' "${ENV_FILE}"; then
backup_file "${ENV_FILE}"
printf '%s\n' 'ELECTRON_OZONE_PLATFORM_HINT=wayland' >> "${ENV_FILE}"
echo "migriert: ELECTRON_OZONE_PLATFORM_HINT in ${ENV_FILE} ergaenzt (Backup .bak)"
fi
# Migration: Noctalia Window-Switcher auf Alt+Tab (statt labwc-Default aus
# <default />).