Commit Graph
45 Commits
Author SHA1 Message Date
Asger Geel Weirsøe 37e6c36aee Add ahfail, a screen locker of its own
ahfail locks the screen itself instead of hooking another locker: Wayland
through ext-session-lock-v1 (gtk-session-lock), X11 through an input grab.
It authenticates against its own PAM service, /etc/pam.d/ahfail, so a
package never has to edit another package's PAM file.

One command for every platform: ahfail (lock), ahfail test (the effect
without locking) and ahfail doctor (what is missing, with the fix).
Enter is handled directly and the entry uses no input method, since the
Wayland text-input IM swallowed Return. Sprites avoid the password box
in window coordinates, and placement gets 100 tries instead of 10.

Claude-Session: https://claude.ai/code/session_012LCTmU2ewo8tnM1dByYAoG
2026-09-30 19:18:21 +02:00
Asger Geel WeirsøeandClaude Sonnet 4.6 18c5c05be1 release: v0.9.0 pre-release — X11 PAM integration, shadow suppression, macOS cfg guards
- PAM module now correctly fires on failed attempts (must precede auth includes)
- ahfail-display: sprite-sized window replaces full-screen overlay
- ahfail-display: XGrabKeyboard unlock detection replaces process scanning
- ahfail-display: _COMPTON_SHADOW=0 suppresses picom shadow without config changes
- ahfail-display: flock single-instance guard prevents stacking on rapid failures
- X11-specific code guarded behind #[cfg(target_os = "linux")] for macOS builds
- Removed debug logging (dlog/plog) from display and PAM binaries
- README: PAM ordering requirement, supported locker table, roadmap section

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
v0.9.0
2026-05-07 21:35:12 +02:00
Asger Geel WeirsøeandClaude Sonnet 4.6 f2e32fd057 feat: add uninstall scripts for X11 and macOS
scripts/uninstall-linux-x11.sh — strips ahfail from common PAM service
files and removes binaries (via ninja uninstall or known paths).

scripts/uninstall-macos.sh — strips ahfail from screensaverui/screensaver
and removes /usr/local/lib/ahfail/.

README: add Uninstall section covering all four cases (X11, Wayland,
Homebrew macOS, manual macOS).

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-06 20:21:52 +02:00
Asger Geel WeirsøeandClaude Sonnet 4.6 1f0d42b24d docs: make X11 PAM config instructions unambiguous
Replace bare config snippets with actual tee -a commands so there is no
way to mistake a file entry for a shell command to run directly.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-06 20:20:32 +02:00
Asger Geel WeirsøeandClaude Sonnet 4.6 bab73b1ee8 docs: add --prefix=/usr to Arch build instructions
Without it meson defaults to /usr/local, so the installed paths don't
match the README and DEFAULT_PATH compiled into the PAM module is wrong.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-06 20:17:43 +02:00
Asger Geel Weirsøe 181372b2fe updates readme.md 2026-05-06 20:15:44 +02:00
Asger Geel Weirsøe 5e9fce4fd4 updates readme.md 2026-05-06 20:15:23 +02:00
Asger Geel WeirsøeandClaude Sonnet 4.6 59c68f8187 docs: add binary install section for Linux, Homebrew section for macOS
Linux x86_64 binary install covers both Wayland and X11 from the same
tarball — clarified with a table showing which file is used by which.

macOS section now leads with Homebrew (brew tap + brew install) as the
recommended path, with script and manual install as fallbacks.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-06 20:14:03 +02:00
Asger Geel WeirsøeandClaude Sonnet 4.6 12fb29eb0e ci: auto-update Homebrew tap on release
After uploading the release asset, the workflow now:
1. Computes the SHA256 of the source tarball from the Gitea archive endpoint
2. Clones homebrew-ahfail via token auth, patches url + sha256 in Formula/ahfail.rb
3. Commits and pushes — so `brew upgrade ahfail` works without any manual steps

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-06 20:13:03 +02:00
Asger Geel WeirsøeandClaude Sonnet 4.6 179da7b277 fix: use build-time AHFAIL_INSTALL_DIR on macOS, not hardcoded /usr/local/lib
Apple Silicon Homebrew uses /opt/homebrew as prefix, so hardcoding
/usr/local/lib/ahfail/ahfail-display as DEFAULT_PATH breaks there.
build.rs now falls back to /usr/local/lib on macOS and /usr/lib on Linux
when AHFAIL_LIBDIR is not set; macOS uses the same concat!(env!(...))
approach as Linux.

install-macos.sh passes -Dlibdir so the baked-in path matches INSTALL_DIR.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-06 20:12:37 +02:00
Asger Geel WeirsøeandClaude Sonnet 4.6 554bb00a69 docs: rewrite readme; add macOS install script
- Clarify that the sprite is the author's face on Nedry's body
- Explicit Wayland (gtklock module) vs X11/macOS (PAM module) comparison table
  with an explanation of how each integration works
- Accurate per-distro PAM paths (standard/Fedora multilib/Debian multiarch)
- scripts/install-macos.sh: one-shot installer for macOS — checks Homebrew,
  installs brew deps, builds from source, copies binaries, and patches
  /etc/pam.d/screensaverui (or screensaver) after the last auth line

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-06 20:10:55 +02:00
Asger Geel WeirsøeandClaude Sonnet 4.6 a35ca838ce ci: use gitea-release-action@v1 for release upload
Replaces the manual curl-based release creation with the standard action,
consistent with other Gitea repos. Also bumps checkout to @v4.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
v0.1.0
2026-05-06 19:47:34 +02:00
Asger Geel WeirsøeandClaude Sonnet 4.6 a76e0cc9eb fix: pass absolute path to pam_smoke_test via meson.current_build_dir()
dlopen with a bare filename searches LD_LIBRARY_PATH/ld.so cache, not the
build dir. Using the explicit absolute path avoids the lookup failure.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-06 19:45:23 +02:00
Asger Geel WeirsøeandClaude Sonnet 4.6 d4a6987b72 fix: run cargo test under xvfb-run; clean up unused imports and mut warning
ahfail_tests.rs calls on_activation which initialises GTK — needs a virtual
display in CI just like the Meson test step.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-06 19:43:31 +02:00
Asger Geel WeirsøeandClaude Sonnet 4.6 9d904a5469 ci: add libgstreamer-plugins-bad1.0-dev for gstreamer-player-1.0.pc
gstreamer-player-1.0.pc is shipped by the -bad dev package, not -base.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-06 19:42:28 +02:00
Asger Geel WeirsøeandClaude Sonnet 4.6 91f89357cc ci: install meson via apt instead of pip (PEP 668 / Ubuntu 24.04)
ubuntu-latest now resolves to Ubuntu 24.04 which ships meson 1.3.2 (satisfies
>=1.3.0) and enforces PEP 668, blocking pip3 install without --break-system-packages.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-06 19:41:58 +02:00
Asger Geel WeirsøeandClaude Sonnet 4.6 ad7d55f804 fix: PID-based volume lock with state persistence and multiarch default path
Volume lock file now stores {pid}:{volume}:{muted} instead of "1":
- Allows recovery of saved volume state if the holder is SIGKILLed
- On stale lock detection (holder PID not alive), inherit saved volume state
  and take ownership — prevents permanent volume loss and infinite lockout

PAM module DEFAULT_PATH now baked in at build time via AHFAIL_LIBDIR env var
passed by Meson, fixing the wrong path on multiarch Debian/Ubuntu where libdir
is /usr/lib/x86_64-linux-gnu rather than /usr/lib.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-06 19:38:33 +02:00
Asger Geel WeirsøeandClaude Sonnet 4.6 0d456dd0a3 chore: remove accidental empty v file from remote merge
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-06 19:38:31 +02:00
Asger Geel Weirsøe cc5a77f894 Merge remote-tracking branch 'origin/master' 2026-05-06 19:38:30 +02:00
Asger Geel Weirsøe 79fe88c147 fix: xvfb for headless CI, curl -f + set -euo pipefail in release, fix PAM paths in README 2026-05-06 19:32:52 +02:00
Asger Geel Weirsøe ef090772f0 docs: add macOS build-from-source and PAM configuration instructions 2026-05-06 19:32:18 +02:00
Asger Geel Weirsøe 0e9c3fa621 ci: add Gitea Actions workflows for test and release 2026-05-06 19:32:16 +02:00
Asger Geel Weirsøe 8fc16befe1 fix: separate cargo target-dirs to avoid parallel lock contention, add pam smoke test 2026-05-06 19:32:05 +02:00
Asger Geel Weirsøe f455ed4c89 build: update meson.build for workspace — add PAM module and display binary targets 2026-05-06 19:31:25 +02:00
Asger Geel Weirsøe f901367571 fix: pam_set_data error handling, setsid+fd sweep in grandchild, is_replace logic, null pamh guard 2026-05-06 19:31:11 +02:00
Asger Geel Weirsøe 23e33cccf1 feat: add ahfail-pam PAM module with cleanup-based failure detection
Implements a C-ABI PAM shared library that registers a pam_set_data
cleanup callback to detect auth failures and spawn/kill ahfail-display
via a double-fork, without ever touching credentials.
2026-05-06 19:30:05 +02:00
Asger Geel Weirsøe 9a2b081ff1 fix: defer volume lock to after setup, fix sighandler cast comment, check pkg-config status 2026-05-06 19:29:39 +02:00
Asger Geel WeirsøeandClaude Sonnet 4.6 d51b6a2727 feat: add ahfail-display standalone binary
Implements the ahfail-display binary crate: GTK popup window that spawns
the Nedry sprite and plays the audio clip, with SIGTERM handling, 15-minute
failsafe, deadzone CLI parsing, volume save/restore, and update check.
Adds a build.rs that compiles GResources via glib-compile-resources so the
binary can be built with plain `cargo build` outside of Meson.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-06 19:28:49 +02:00
Asger Geel Weirsøe 1fbe87ab2a fix: update check — handle spaced JSON, move cache touch after HTTP success, add timeouts and multi-monitor guard 2026-05-06 19:28:07 +02:00
Asger Geel WeirsøeandClaude Sonnet 4.6 40902cdd88 feat: add rate-limited update check with desktop notification
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-06 19:03:59 +02:00
Asger Geel Weirsøe 1df9fb1aec fix: remove redundant volume_state=None, improve pactl volume parser for stereo sinks 2026-05-06 19:03:38 +02:00
Asger Geel WeirsøeandClaude Sonnet 4.6 ed2ab3d7d5 feat: add volume save/restore on failure/unload
On the first failed unlock attempt, save the current system volume and
mute state then set volume to maximum unmuted; restore on g_module_unload.
A lock file under XDG_RUNTIME_DIR prevents double-acquisition when
multiple gtklock windows are active.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-06 19:03:05 +02:00
Asger Geel Weirsøe 3c4f21fe5d chore: remove unused imports, stale deps, and unnecessary unsafe block in ahfail-gtklock 2026-05-06 19:02:25 +02:00
Asger Geel WeirsøeandClaude Sonnet 4.6 e030f8fc26 refactor: wire ahfail-gtklock to use ahfail-ui for animation/audio/display
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-06 19:00:32 +02:00
Asger Geel WeirsøeandClaude Sonnet 4.6 14190c7e33 fix: image.show(), private ahfail_get_resource, saturating_sub in display
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-06 18:59:47 +02:00
Asger Geel WeirsøeandClaude Sonnet 4.6 d53c598776 feat: add ahfail-ui crate with animation, audio, display, config
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-06 18:58:22 +02:00
Asger Geel WeirsøeandClaude Sonnet 4.6 9e74bb5144 refactor: remove dead utils/bench.rs
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-06 18:57:50 +02:00
Asger Geel WeirsøeandClaude Sonnet 4.6 01bc34e54e refactor: convert to Cargo workspace, move gtklock crate
Replaces the single-crate Cargo.toml with a workspace containing
ahfail-gtklock (migrated from root src/) and three stub crates
(ahfail-ui, ahfail-pam, ahfail-display). Updates meson.build to
build with -p ahfail-gtklock.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-05 20:24:53 +02:00
Asger Geel WeirsøeandClaude Sonnet 4.6 d0b1ae7b40 Add implementation plan for PAM rewrite
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-05 20:23:33 +02:00
Asger Geel WeirsøeandClaude Sonnet 4.6 ef7af5fd26 Add design doc for PAM module + cross-platform rewrite
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-05 20:21:57 +02:00
Asger Geel Weirsøe 7a1ba29e44 test 2026-01-19 19:53:44 +01:00
agw aacfef1670 Adds license 2025-12-01 18:52:02 +01:00
agw 5ff2bca59c Removes incorrect stuff 2025-12-01 18:51:06 +01:00
Asger Geel Weirsøe 382b5a489e Code 2025-11-30 21:08:42 +01:00
Asger Geel Weirsøe 8c08e33ba0 initial commit 2025-11-30 20:52:00 +01:00