Compare commits

...

2 Commits

Author SHA1 Message Date
nevaforget 86d0f5e56d docs: translate CLAUDE.md to English
Per the committed=English rule.
2026-06-16 10:46:13 +02:00
nevaforget 49bcb9e58f ci: switch update-pkgver to tag-trigger (no-suffix pkgname) 2026-06-10 18:23:23 +02:00
2 changed files with 57 additions and 57 deletions
+11 -11
View File
@@ -1,22 +1,22 @@
# ABOUTME: Updates pkgver in moonarch-pkgbuilds after a push to main. # ABOUTME: Updates pkgver in moonarch-pkgbuilds when a new moongreet tag is pushed.
# ABOUTME: Ensures paru detects new versions of this package. # ABOUTME: Reads the latest version tag and bumps the PKGBUILD + .SRCINFO.
name: Update PKGBUILD version name: Update PKGBUILD version
on: on:
push: push:
branches: tags:
- main - 'v*'
jobs: jobs:
update-pkgver: update-pkgver:
runs-on: moonarch runs-on: moonarch
steps: steps:
- name: Checkout source repo - name: Determine pkgver from latest tag
run: | run: |
git clone --bare http://gitea:3000/nevaforget/greetd-moongreet.git source.git git clone --bare http://gitea:3000/nevaforget/greetd-moongreet.git source.git
cd source.git cd source.git
PKGVER=$(git describe --long --tags | sed 's/^v//;s/-/.r/;s/-/./') PKGVER=$(git describe --tags --abbrev=0 | sed 's/^v//')
echo "New pkgver: $PKGVER" echo "New pkgver: $PKGVER"
echo "$PKGVER" > /tmp/pkgver echo "$PKGVER" > /tmp/pkgver
@@ -26,18 +26,18 @@ jobs:
git clone http://gitea:3000/nevaforget/moonarch-pkgbuilds.git pkgbuilds git clone http://gitea:3000/nevaforget/moonarch-pkgbuilds.git pkgbuilds
cd pkgbuilds cd pkgbuilds
OLD_VER=$(grep '^pkgver=' moongreet-git/PKGBUILD | cut -d= -f2) OLD_VER=$(grep '^pkgver=' moongreet/PKGBUILD | cut -d= -f2)
if [ "$OLD_VER" = "$PKGVER" ]; then if [ "$OLD_VER" = "$PKGVER" ]; then
echo "pkgver already up to date ($PKGVER)" echo "pkgver already up to date ($PKGVER)"
exit 0 exit 0
fi fi
sed -i "s/^pkgver=.*/pkgver=$PKGVER/" moongreet-git/PKGBUILD sed -i "s/^pkgver=.*/pkgver=$PKGVER/" moongreet/PKGBUILD
sed -i "s/^\tpkgver = .*/\tpkgver = $PKGVER/" moongreet-git/.SRCINFO sed -i "s/^\tpkgver = .*/\tpkgver = $PKGVER/" moongreet/.SRCINFO
echo "Updated pkgver: $OLD_VER → $PKGVER" echo "Updated pkgver: $OLD_VER → $PKGVER"
git config user.name "pkgver-bot" git config user.name "pkgver-bot"
git config user.email "gitea@moonarch.de" git config user.email "gitea@moonarch.de"
git add moongreet-git/PKGBUILD moongreet-git/.SRCINFO git add moongreet/PKGBUILD moongreet/.SRCINFO
git commit -m "chore(moongreet-git): bump pkgver to $PKGVER" git commit -m "chore(moongreet): bump pkgver to $PKGVER"
git -c http.extraHeader="Authorization: token ${{ secrets.PKGBUILD_TOKEN }}" push git -c http.extraHeader="Authorization: token ${{ secrets.PKGBUILD_TOKEN }}" push
+46 -46
View File
@@ -1,69 +1,69 @@
# Moongreet # Moongreet
## Projekt ## Project
Moongreet ist ein greetd-Greeter für Wayland, gebaut mit Rust + gtk4-rs + gtk4-layer-shell. Moongreet is a greetd greeter for Wayland, built with Rust + gtk4-rs + gtk4-layer-shell.
Teil des Moonarch-Ökosystems. Part of the Moonarch ecosystem.
## Tech-Stack ## Tech Stack
- Rust (Edition 2024), gtk4-rs 0.11, glib 0.22 - Rust (edition 2024), gtk4-rs 0.11, glib 0.22
- gtk4-layer-shell 0.8 für Wayland Layer Shell (TOP Layer) - gtk4-layer-shell 0.8 for the Wayland Layer Shell (TOP layer)
- greetd IPC über Unix Domain Socket (length-prefixed JSON) - greetd IPC over a Unix domain socket (length-prefixed JSON)
- `cargo test` für Unit-Tests - `cargo test` for unit tests
## Projektstruktur ## Project Structure
- `src/` — Rust-Quellcode (main.rs, greeter.rs, ipc.rs, config.rs, users.rs, sessions.rs, i18n.rs, power.rs) - `src/` — Rust source code (main.rs, greeter.rs, ipc.rs, config.rs, users.rs, sessions.rs, i18n.rs, power.rs)
- `resources/` — GResource-Assets (style.css, default-avatar.svg) - `resources/` — GResource assets (style.css, default-avatar.svg)
- `config/`Beispiel-Konfigurationsdateien für `/etc/moongreet/` und `/etc/greetd/` - `config/`example configuration files for `/etc/moongreet/` and `/etc/greetd/`
- `pkg/` — PKGBUILD für Arch-Linux-Paketierung (`makepkg -sf`) - `pkg/` — PKGBUILD for Arch Linux packaging (`makepkg -sf`)
## Kommandos ## Commands
```bash ```bash
# Tests ausführen # Run tests
cargo test cargo test
# Release-Build # Release build
cargo build --release cargo build --release
# Greeter im Fenster starten (ohne greetd/Layer Shell) # Start the greeter in a window (without greetd/Layer Shell)
MOONGREET_NO_LAYER_SHELL=1 ./target/release/moongreet MOONGREET_NO_LAYER_SHELL=1 ./target/release/moongreet
# Paket bauen und installieren # Build and install the package
cd pkg && makepkg -sf && sudo pacman -U moongreet-git-<version>-x86_64.pkg.tar.zst cd pkg && makepkg -sf && sudo pacman -U moongreet-git-<version>-x86_64.pkg.tar.zst
``` ```
## Architektur ## Architecture
- `ipc.rs` — greetd Socket-Kommunikation (4-byte LE header + JSON) - `ipc.rs` — greetd socket communication (4-byte LE header + JSON)
- `users.rs`Benutzer aus /etc/passwd, Avatare (AccountsService + ~/.face), Symlink-Rejection - `users.rs`users from /etc/passwd, avatars (AccountsService + ~/.face), symlink rejection
- `sessions.rs` — Wayland/X11 Sessions aus .desktop Files - `sessions.rs` — Wayland/X11 sessions from .desktop files
- `power.rs`Reboot/Shutdown via systemctl (`--no-ask-password`) - `power.rs`reboot/shutdown via systemctl (`--no-ask-password`)
- `i18n.rs`Locale-Erkennung (LANG / /etc/locale.conf) und String-Tabellen (DE/EN), alle UI- und Login-Fehlermeldungen - `i18n.rs`locale detection (LANG / /etc/locale.conf) and string tables (DE/EN), all UI and login error messages
- `fingerprint.rs` — fprintd D-Bus Probe (gio::DBusProxy) — Geräteerkennung und Enrollment-Check für UI-Feedback - `fingerprint.rs` — fprintd D-Bus probe (gio::DBusProxy) — device detection and enrollment check for UI feedback
- `config.rs` — TOML-Config ([appearance] background, gtk-theme, cursor-theme, cursor-size, fingerprint-enabled) + Wallpaper-Fallback + Blur-Validierung (finite, clamp 0200) + Cursor-Size-Validierung (range 1256) - `config.rs` — TOML config ([appearance] background, gtk-theme, cursor-theme, cursor-size, fingerprint-enabled) + wallpaper fallback + blur validation (finite, clamp 0200) + cursor-size validation (range 1256)
- `greeter.rs` — GTK4 UI (Overlay-Layout), Login-Flow via greetd IPC (Multi-Stage-Auth für fprintd), Faillock-Warnung, Power-Confirm (Inline-Bestätigung vor Reboot/Shutdown, wie moonlock), Avatar-Cache, Last-User/Last-Session Persistence (0o700 Dirs, 0o600 Files) - `greeter.rs` — GTK4 UI (overlay layout), login flow via greetd IPC (multi-stage auth for fprintd), faillock warning, power confirm (inline confirmation before reboot/shutdown, like moonlock), avatar cache, last-user/last-session persistence (0o700 dirs, 0o600 files)
- `main.rs`Entry Point, GTK App, Layer Shell Setup, ein Greeter-Fenster auf dem fokussierten Output (kein `set_monitor`), `KeyboardMode::Exclusive`, systemd-journal-logger - `main.rs`entry point, GTK app, Layer Shell setup, one greeter window on the focused output (no `set_monitor`), `KeyboardMode::Exclusive`, systemd-journal-logger
- `resources/style.css` — Catppuccin-inspiriertes Theme - `resources/style.css` — Catppuccin-inspired theme
## Design Decisions ## Design Decisions
- **TOP Layer statt OVERLAY**: Greeter läuft unter greetd, nicht über Waybar - **TOP layer instead of OVERLAY**: the greeter runs under greetd, not above Waybar
- **GResource-Bundle**: CSS, Wallpaper und Default-Avatar sind in die Binary kompiliert - **GResource bundle**: CSS, wallpaper and default avatar are compiled into the binary
- **Async Login**: `glib::spawn_future_local` + `gio::spawn_blocking` statt raw Threads - **Async login**: `glib::spawn_future_local` + `gio::spawn_blocking` instead of raw threads
- **Socket-Cancellation**: `Arc<Mutex<Option<UnixStream>>>` + `AtomicBool` für saubere Abbrüche - **Socket cancellation**: `Arc<Mutex<Option<UnixStream>>>` + `AtomicBool` for clean cancellation
- **Avatar-Cache**: `HashMap<String, gdk::Texture>` in `Rc<RefCell<GreeterState>>` - **Avatar cache**: `HashMap<String, gdk::Texture>` in `Rc<RefCell<GreeterState>>`
- **GPU-Blur via GskBlurNode**: `Snapshot::push_blur()` + `GskRenderer::render_texture()` im `connect_realize` Callback — kein CPU-Blur, kein Disk-Cache, kein `image`-Crate. Blurred Texture wird per `Rc<RefCell<Option<gdk::Texture>>>` über alle Monitore gecacht (1x GPU-Renderpass statt N). - **GPU blur via GskBlurNode**: `Snapshot::push_blur()` + `GskRenderer::render_texture()` in the `connect_realize` callback — no CPU blur, no disk cache, no `image` crate. The blurred texture is cached across all monitors via `Rc<RefCell<Option<gdk::Texture>>>` (1 GPU render pass instead of N).
- **Fingerprint via greetd Multi-Stage PAM**: fprintd D-Bus nur als Probe (Gerät/Enrollment), eigentliche Verifizierung läuft über PAM im greetd-Auth-Loop. `auth_message_type: "secret"`Passwort, alles andere → `None` (PAM entscheidet). 60s Socket-Timeout bei fprintd. Device-Proxy in `GreeterState` gecacht, Generation-Counter gegen Race Conditions bei schnellem User-Switch. - **Fingerprint via greetd multi-stage PAM**: fprintd D-Bus only as a probe (device/enrollment), the actual verification runs through PAM in the greetd auth loop. `auth_message_type: "secret"`password, everything else → `None` (PAM decides). 60s socket timeout for fprintd. Device proxy cached in `GreeterState`, generation counter against race conditions on fast user switch.
- **Symmetrie mit moonlock/moonset**: Gleiche Patterns (i18n, config, users, power, GResource, GPU-Blur) - **Symmetry with moonlock/moonset**: same patterns (i18n, config, users, power, GResource, GPU blur)
- **Session-Validierung**: Relative Pfade erlaubt (greetd löst PATH auf), nur `..`/Null-Bytes werden abgelehnt - **Session validation**: relative paths allowed (greetd resolves PATH), only `..`/null bytes are rejected
- **GTK-Theme-Validierung**: Nur alphanumerisch + `_-+.` erlaubt, verhindert Path-Traversal über Config - **GTK theme validation**: only alphanumeric + `_-+.` allowed, prevents path traversal via config
- **Cursor-Theme via GtkSettings**: GTK4 unter greetd liest `XCURSOR_THEME` env nicht zuverlässig — Cursor wird via `gtk::Settings::set_gtk_cursor_theme_name()` gesetzt, analog zu `gtk-theme`. Gleiche Validierung (`is_valid_gtk_theme`) gegen Path-Traversal. - **Cursor theme via GtkSettings**: GTK4 under greetd does not read the `XCURSOR_THEME` env reliably — the cursor is set via `gtk::Settings::set_gtk_cursor_theme_name()`, analogous to `gtk-theme`. Same validation (`is_valid_gtk_theme`) against path traversal.
- **Journal-Logging**: `systemd-journal-logger` statt File-Logging — `journalctl -t moongreet`, Debug-Level per `MOONGREET_DEBUG` Env-Var - **Journal logging**: `systemd-journal-logger` instead of file logging — `journalctl -t moongreet`, debug level via the `MOONGREET_DEBUG` env var
- **File Permissions**: Cache-Verzeichnisse 0o700 via `DirBuilder::mode()`, Cache-Dateien 0o600 - **File permissions**: cache directories 0o700 via `DirBuilder::mode()`, cache files 0o600
- **Testbare Persistence**: `save_*_to`/`load_*_from` Varianten mit konfigurierbarem Pfad für Unit-Tests - **Testable persistence**: `save_*_to`/`load_*_from` variants with a configurable path for unit tests
- **Shared Wallpaper Texture**: `gdk::Texture` wird einmal in `load_background_texture()` dekodiert und per Ref-Count an alle Fenster geteilt — vermeidet redundante JPEG-Dekodierung pro Monitor - **Shared wallpaper texture**: the `gdk::Texture` is decoded once in `load_background_texture()` and shared by ref-count across all windows — avoids redundant JPEG decoding per monitor
- **Wallpaper-Validierung**: GResource-Zweig via `resources_lookup_data()` + `from_bytes()` (kein Abort bei fehlendem Pfad), Dateigröße-Limit 50 MB, non-UTF-8-Pfade`None` - **Wallpaper validation**: GResource branch via `resources_lookup_data()` + `from_bytes()` (no abort on a missing path), file-size limit 50 MB, non-UTF-8 paths`None`
- **Error-Detail-Filterung**: GDK/greetd-Fehlerdetails nur auf `debug!`-Level, `warn!` ohne interne Details — verhindert Systeminfo-Leak ins Journal - **Error-detail filtering**: GDK/greetd error details only at `debug!` level, `warn!` without internal details — prevents system-info leak into the journal