Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions app/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion app/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "kindtech-transcribe-app",
"private": true,
"version": "0.2.1",
"version": "0.3.0",
"type": "module",
"description": "Privacy-first, CPU-only, zero-egress local transcription app shell (Tauri v2 + React 19). PR2: hardened shell + network-crate gate only.",
"scripts": {
Expand Down
2 changes: 1 addition & 1 deletion app/src-tauri/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion app/src-tauri/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "kindtech-transcribe-app"
version = "0.2.1"
version = "0.3.0"
description = "Hardened, zero-egress local transcription app shell (Tauri v2)."
edition = "2021"
license = "Apache-2.0"
Expand Down
2 changes: 1 addition & 1 deletion app/src-tauri/tauri.conf.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"$schema": "https://schema.tauri.app/config/2",
"productName": "Folio",
"version": "0.2.1",
"version": "0.3.0",
"identifier": "uk.kindtech.folio",
"build": {
"beforeDevCommand": "npm run dev",
Expand Down
17 changes: 17 additions & 0 deletions docs/build-from-source.md
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,23 @@ Installers land under `app/src-tauri/target/{release,debug}/bundle/`:
- Windows → `nsis/*.exe`
- Linux → `appimage/*.AppImage`, `deb/*.deb`

### Windows installer from a Mac

Without CI, a Mac can cross-build the Windows installer with
[`scripts/build-windows-on-mac.sh`](https://github.com/KindTechUK/folio/blob/main/scripts/build-windows-on-mac.sh):

```bash
brew install nsis llvm lld # one-time setup
rustup target add x86_64-pc-windows-msvc
cargo install --locked cargo-xwin
scripts/build-windows-on-mac.sh /path/to/vendor-public.spki.pem
```

The key must be the one the official model packs are signed with. The script checks that the key
is embedded and that the app needs no DLL that Windows doesn't ship. Tauri calls cross-compilation
experimental, and the installer is unsigned, so test it on Windows before you share it. The installer
lands in `app/src-tauri/target/x86_64-pc-windows-msvc/release/bundle/nsis/`.

## The zero-egress gate

The product guarantee is that the shipped binaries link **no** networking crates. Prove
Expand Down
41 changes: 41 additions & 0 deletions scripts/build-windows-on-mac.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
#!/bin/bash
# Cross-build the Windows x64 installer (NSIS -setup.exe) on a Mac, without GitHub Actions.
#
# Usage: scripts/build-windows-on-mac.sh /path/to/vendor-public.spki.pem
#
# The key must be the public key the official model packs are signed with, or the packs won't
# import. It is compiled into every official release; to recover it from one, mount the release's
# .dmg and run: strings -n 8 Folio.app/Contents/MacOS/kindtech-transcribe-app | grep -A2 "BEGIN PUBLIC KEY"
#
# One-time setup:
# brew install nsis llvm lld
# rustup target add x86_64-pc-windows-msvc
# cargo install --locked cargo-xwin
#
# Tauri calls cross-compilation experimental, and the installer is unsigned. Test the result on Windows.
# Output: app/src-tauri/target/x86_64-pc-windows-msvc/release/bundle/nsis/Folio_<version>_x64-setup.exe
set -euo pipefail

key="${1:?usage: $0 /path/to/vendor-public.spki.pem}"
[ -f "$key" ] || { echo "no such key file: $key" >&2; exit 1; }
cd "$(dirname "$0")/../app"

export PATH="/opt/homebrew/opt/llvm/bin:/opt/homebrew/opt/lld/bin:$HOME/.cargo/bin:$PATH"
for tool in makensis lld-link llvm-rc cargo-xwin; do
command -v "$tool" >/dev/null || { echo "missing $tool; see the one-time setup in $0" >&2; exit 1; }
done
export XWIN_CACHE_DIR="${XWIN_CACHE_DIR:-$HOME/.cache/cargo-xwin}" # Windows SDK, downloaded once
VENDOR_PUBKEY_SPKI_PEM="$(cat "$key")"
export VENDOR_PUBKEY_SPKI_PEM

npm ci
npm run tauri build -- --runner cargo-xwin --target x86_64-pc-windows-msvc --features hardened

exe=src-tauri/target/x86_64-pc-windows-msvc/release/kindtech-transcribe-app.exe
# The build must have embedded this key, and nothing but Windows' own DLLs may be needed at runtime.
# grep -q would exit early and SIGPIPE strings, failing the pipeline under pipefail.
strings -n 8 "$exe" | grep -F "$(sed -n 2p "$key")" >/dev/null || { echo "key not embedded in $exe" >&2; exit 1; }
if llvm-objdump -p "$exe" | grep "DLL Name" | grep -viE "api-ms-win-|advapi32|bcryptprimitives|combase|comctl32|dbghelp|dwmapi|dxgi|gdi32|kernel32|mmdevapi|ntdll|ole32|oleaut32|setupapi|shell32|shlwapi|user32|uxtheme|version|winmm|ws2_32|crypt32|bcrypt|userenv|propsys"; then
echo "the exe needs a DLL Windows doesn't ship (listed above)" >&2; exit 1
fi
ls -l src-tauri/target/x86_64-pc-windows-msvc/release/bundle/nsis/*.exe