Commit Graph
59 Commits
Author SHA1 Message Date
Asger Geel Weirsøe e6dfd7814c Read the tarball host from a secret, not a variable
Run logs of a public repository are public, and Gitea prints variables in
them in clear text; only secrets are masked.

Claude-Session: https://claude.ai/code/session_01GGe7kUhooMFuzY6GaDb2w9
2026-10-01 17:42:00 +02:00
Asger Geel Weirsøe 630cb54332 Take the tarball host address from a repository variable
The upload steps named the web host by its internal address. It now comes
from the TARBALLZ_TARGET repository variable, so the public workflow carries
no infrastructure details.

Claude-Session: https://claude.ai/code/session_01GGe7kUhooMFuzY6GaDb2w9
2026-10-01 17:15:00 +02:00
Asger Geel Weirsøe d5e1bd5016 Build only the PAM hook on macOS (0.10.2)
The gtklock module is Wayland-only and its GNU ld link flags
(--whole-archive) do not exist on macOS, so the macOS build stopped
there. macOS now builds just the PAM hook and the display binary, which
is all the Homebrew formula installs; libdl is optional (it is part of
libSystem on macOS).

Claude-Session: https://claude.ai/code/session_012LCTmU2ewo8tnM1dByYAoG
v0.10.2
2026-09-30 21:59:59 +02:00
Asger Geel Weirsøe 198bbb2278 Build the PAM module on macOS (0.10.1)
Cargo names a cdylib .dylib on macOS, so copying libahfail_pam.so out of
the target directory failed there, as the first real macOS build in the
Homebrew tap's Actions showed. The installed name stays .so.

Claude-Session: https://claude.ai/code/session_012LCTmU2ewo8tnM1dByYAoG
v0.10.1
2026-09-30 21:59:59 +02:00
Asger Geel Weirsøe 8b777652be Move the Homebrew formula to the tap on GitHub
Homebrew could not clone the Gitea tap (git over HTTP is disabled), so
brew tap agw/ahfail never worked. The formula now lives in
asger-weirsoee/homebrew-tap, and releases update it with a deploy key.

Claude-Session: https://claude.ai/code/session_012LCTmU2ewo8tnM1dByYAoG
2026-09-30 21:59:58 +02:00
Asger Geel Weirsøe 1934b86c13 Publish ahfail-bin, hosted on the tarballz index
A second AUR package with the same release prebuilt. The workflow
builds the tag into a staged meson install tree (--prefix=/usr, no
update check), names the tarball after its sha256 so a published name
never changes bytes, uploads it to asger.weirsoe.dk/tarballz with a key
that may only write ahfail-* tarballs, checks that the public URL serves
the same bytes, and only then pushes ahfail-bin to the AUR. A manual run
can now publish source, bin or both.

Claude-Session: https://claude.ai/code/session_012LCTmU2ewo8tnM1dByYAoG
2026-09-30 21:41:11 +02:00
Asger Geel Weirsøe a1a9a741cc Obfuscate the maintainer address, and allow PKGBUILD-only releases
The Maintainer line uses the usual AUR form (asger at weircon dot dk)
instead of a raw address that spam crawlers harvest. The AUR workflow
can now also be started by hand with a version and pkgrel, so a fix to
the PKGBUILD alone can be published without a new upstream release.

Claude-Session: https://claude.ai/code/session_012LCTmU2ewo8tnM1dByYAoG
2026-09-30 21:23:12 +02:00
Asger Geel Weirsøe 9538cefbf4 Fix the release token and the Homebrew tap update
Gitea refuses secret names starting with GITEA_, so GITEA_TOKEN could
never be set and every release failed; it is RELEASE_TOKEN now. git over
HTTP is disabled on this Gitea, so the tap formula is updated through
the contents API instead of a clone and push.

Claude-Session: https://claude.ai/code/session_012LCTmU2ewo8tnM1dByYAoG
v0.10.0
2026-09-30 20:03:00 +02:00
Asger Geel Weirsøe b71eb201b6 Add a disclaimer to the PKGBUILD and build the locker on Linux only
The PKGBUILD states what the package is: a real screen locker provided
as is, and parody media from Jurassic Park that the AGPL does not cover.
The ahfail command has only been tested on Linux, so macOS builds keep
the PAM hook and skip it; the README no longer promises it there.

Claude-Session: https://claude.ai/code/session_012LCTmU2ewo8tnM1dByYAoG
2026-09-30 20:03:00 +02:00
Asger Geel Weirsøe 2cf3b06aeb Install openssh in the CI containers
The runner rewrites Gitea URLs to SSH on port 2222, and without openssh
git falls back to the 'simple' SSH variant, which cannot set a port, so
checkout failed.

Claude-Session: https://claude.ai/code/session_012LCTmU2ewo8tnM1dByYAoG
2026-09-30 19:31:53 +02:00
Asger Geel Weirsøe 1156c1f927 Run CI and releases in an Arch container
The locker needs gtk-session-lock, which Ubuntu does not package, and
Arch is where the AUR package is built. The release tarball now carries
the ahfail binary and its PAM file as well.

Claude-Session: https://claude.ai/code/session_012LCTmU2ewo8tnM1dByYAoG
2026-09-30 19:19:09 +02:00
Asger Geel Weirsøe cb41117932 Document ahfail as a locker
The README leads with ahfail, ahfail test and ahfail doctor, the
platform table, idle locking and what the lock does and does not
guarantee, including pam_faillock. The old gtklock module and PAM hook
move to a short legacy section. CLAUDE.md describes the five crates.

Claude-Session: https://claude.ai/code/session_012LCTmU2ewo8tnM1dByYAoG
2026-09-30 19:18:21 +02:00
Asger Geel Weirsøe 79bb0e41d5 Build everything in one cargo run, and package for the AUR
Four cargo builds with four target directories compiled the GTK and
GStreamer bindings four times; one build with a shared target directory
takes a package build from about an hour to about seven minutes.
Adds the ahfail binary and /etc/pam.d/ahfail to the install, the
update_check option, an AUR PKGBUILD (offline build after cargo fetch
--locked) and a tag-triggered workflow that publishes it and mirrors the
PKGBUILD to the tarballz index.

Claude-Session: https://claude.ai/code/session_012LCTmU2ewo8tnM1dByYAoG
2026-09-30 19:18:21 +02:00
Asger Geel Weirsøe a4b6297156 Make the update check optional and harden the legacy paths
The Gitea update check is now the default feature update-check of
ahfail-ui; distro builds drop it, and the HTTP client with it.
ahfail-display refuses to run as root and keeps its lock file in
XDG_RUNTIME_DIR instead of a fixed name in the shared /tmp, and the PAM
module no longer spawns it from a root context such as a greeter.
Removes pam_tests.rs, which tested helpers dropped in v0.9.0 and has not
compiled since.

Claude-Session: https://claude.ai/code/session_012LCTmU2ewo8tnM1dByYAoG
2026-09-30 19:18:21 +02:00
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