diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 715231f..df4c4ad 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -138,6 +138,23 @@ jobs: # tauri::generate_context! needs the built frontend to exist. pnpm build + # Accessibility audit (axe, keyboard, focus, reduced motion) on the demo + # build in Chromium: the same on every OS, so it runs once. + - name: Accessibility audit (Linux) + if: runner.os == 'Linux' + working-directory: crates/app/ui + run: | + pnpm exec playwright install --with-deps chromium + pnpm test:web + - name: Upload the accessibility report + if: failure() && runner.os == 'Linux' + uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7.0.2 + with: + name: a11y-report + path: crates/app/ui/test-results/ + retention-days: 7 + if-no-files-found: ignore + - name: Clippy (workspace) run: cargo clippy --workspace --all-targets -- -D warnings - name: Test (app) @@ -157,6 +174,90 @@ jobs: retention-days: 7 if-no-files-found: error + # The real app (Rust backend, IPC, WebKitGTK) on copies of the KeePassXC + # fixtures, driven through tauri-driver. Runs on every event: it verifies + # branches too, not only pull requests. + e2e: + name: e2e (ubuntu-24.04) + runs-on: ubuntu-24.04 + timeout-minutes: 45 + steps: + - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + - name: Install the Rust toolchain from rust-toolchain.toml + run: rustup toolchain install + - name: Install Tauri prerequisites, WebKitWebDriver, Xvfb and KeePassXC + run: | + sudo apt-get update + sudo apt-get install -y libwebkit2gtk-4.1-dev libgtk-3-dev librsvg2-dev \ + libayatana-appindicator3-dev libxdo-dev libssl-dev \ + webkit2gtk-driver xvfb dbus + sudo apt-get install -y --no-install-recommends keepassxc + - uses: Swatinem/rust-cache@d1527c8f67ef9af357290475d4af4b0fab8f12e0 # v2.9.3 + with: + key: e2e + - name: Install tauri-driver + run: cargo install tauri-driver --locked --version 2.1.0 + - uses: pnpm/action-setup@ea17c68df8912ef543352723c149a84f56e3d413 # v6.1.0 + with: + package_json_file: crates/app/ui/package.json + - uses: actions/setup-node@949feb2413d6458794dcd2491c4babbbce0c15c1 # v7.1.0 + with: + node-version: 24 + cache: pnpm + cache-dependency-path: | + crates/app/ui/pnpm-lock.yaml + crates/app/e2e/pnpm-lock.yaml + - name: Build the app (debug, no installer, unsigned) + working-directory: crates/app/ui + run: | + pnpm install --frozen-lockfile + pnpm tauri build --debug --no-bundle + - name: Smoke test + run: | + set -o pipefail + echo "KEYRUST_E2E_DIR=$RUNNER_TEMP/keyrust-e2e" >> "$GITHUB_ENV" + export KEYRUST_E2E_DIR="$RUNNER_TEMP/keyrust-e2e" KEYRUST_LOG=info + pnpm --dir crates/app/e2e install --frozen-lockfile + pnpm --dir crates/app/e2e check + # A session bus, as on a desktop: without one GTK waits ~25 s for the + # desktop portal before the window appears. + xvfb-run -a dbus-run-session -- pnpm --dir crates/app/e2e test 2>&1 | + tee "$RUNNER_TEMP/e2e.log" + # The file the real app saved is still a database KeePassXC reads, with + # the new title; the KDBX 3.1 copy was opened but never written. + - name: KeePassXC reads the saved file + run: | + printf '%s\n' keyrust-test-password | + keepassxc-cli show -q -a Title "$KEYRUST_E2E_DIR/vaults/keepassxc-rich.kdbx" \ + "/Work/Dev/GitHub (e2e)" | tee "$RUNNER_TEMP/title.txt" + test "$(cat "$RUNNER_TEMP/title.txt")" = "GitHub (e2e)" + cmp "$KEYRUST_E2E_DIR/vaults/keepassxc-kdbx31.kdbx" tests/fixtures/keepassxc-kdbx31.kdbx + # Job logs need a login to read; annotations are public. The logs carry no + # field values (logging policy) and the fixture password is public. + - name: Report the end of the log as an annotation + if: failure() + run: | + if [ -f "$RUNNER_TEMP/e2e.log" ]; then + # Test results and app logs only, without the D-Bus and portal noise; + # an annotation holds about 4 KB. + clean=$(sed 's/\x1b\[[0-9;]*[A-Za-z]//g' "$RUNNER_TEMP/e2e.log") + { grep -m 2 -E 'page (state|boot)' <<<"$clean" | cut -c 1-1200 + grep -E '^\[(0-0|wry)|Error|keyrust_' <<<"$clean" | + grep -vE 'WARNING|dbus-daemon|page (state|boot)|^\[0-0\] *$' | tail -c 1500 + } | + python3 -c "import sys; print('::error title=e2e log (filtered)::' + sys.stdin.read().replace('%','%25').replace('\r','').replace('\n','%0A'))" + fi + - name: Upload logs and screenshots + if: failure() + uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7.0.2 + with: + name: e2e-logs + path: | + ${{ runner.temp }}/e2e.log + ${{ runner.temp }}/keyrust-e2e/artifacts/ + retention-days: 7 + if-no-files-found: ignore + deny: name: cargo deny runs-on: ubuntu-24.04 diff --git a/Cargo.lock b/Cargo.lock index bc6fa28..b59202b 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2365,6 +2365,7 @@ name = "keyrust-core" version = "0.0.1" dependencies = [ "arbitrary", + "base64 0.22.1", "chrono", "getrandom 0.3.4", "keepass", diff --git a/README.md b/README.md index 820ec83..efe11a7 100644 --- a/README.md +++ b/README.md @@ -2,62 +2,155 @@ [](https://github.com/downlevel/keyrust/actions/workflows/ci.yml) -**A modern KeePass client, written in Rust.** +**A calm, minimal KeePass client for the desktop, written in Rust.** + +Keyrust is an open source password manager for Linux, Windows and macOS. It reads and writes the +standard **KDBX** format, so your database stays a plain file you own: open it with KeePassXC, +KeePassDX (Android) or Strongbox (iOS), and sync it with Syncthing, Nextcloud or Dropbox. No +account, no cloud, no telemetry, no network access. + +> **Status: alpha, not audited.** Keyrust opens and saves real databases and is tested against +> KeePassXC in CI, but it is young software. Keep backups of your database. + + + +
+
+
+
+