9 Commits
Author SHA1 Message Date
Lucas RayanandClaude Sonnet 5.5 1bbb5f934c fix(update): non-blocking desktop update with progress bar (1.0.7)
Release / Desktop app (windows) (push) Successful in 3m27s
Release / Create release (push) Successful in 13s
CI / Tests (Linux) (push) Successful in 29s
CI / Format and clippy (push) Successful in 28s
CI / Dependency audit (push) Successful in 14s
Release / CLI (linux-aarch64) (push) Successful in 53s
Release / CLI (linux-x86_64) (push) Successful in 1m22s
CI / Check desktop app (Linux) (push) Successful in 1m19s
Release / Desktop app (linux-aarch64) (push) Successful in 4m27s
Release / Desktop app (linux-x86_64) (push) Successful in 4m58s
Update commands ran on the UI thread and froze the window; they now run
in the background, with a real download percentage bar.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-03 19:34:00 -03:00
lucasrguerra fd7435cc68 Merge pull request 'Unguessable sabia ui token (1.0.6)' (#1) from fix/token-ui into main
CI / Format and clippy (push) Successful in 24s
CI / Tests (Linux) (push) Successful in 41s
Release / Create release (push) Successful in 9s
CI / Dependency audit (push) Successful in 19s
CI / Check desktop app (Linux) (push) Successful in 1m44s
Release / CLI (linux-aarch64) (push) Successful in 1m52s
Release / CLI (linux-x86_64) (push) Successful in 1m42s
Release / Desktop app (linux-aarch64) (push) Successful in 10m43s
Release / Desktop app (linux-x86_64) (push) Successful in 12m33s
Release / Desktop app (windows) (push) Successful in 3m51s
2026-11-03 14:50:30 +00:00
Lucas RayanandClaude Opus 5.5 bcc4178e89 fix(ui): generate the sabia ui token from the OS CSPRNG
CI / Format and clippy (pull_request) Successful in 30s
CI / Tests (Linux) (pull_request) Successful in 29s
CI / Dependency audit (pull_request) Successful in 17s
CI / Check desktop app (Linux) (pull_request) Successful in 1m13s
The token was the startup time in nanoseconds, guessable by another local
user or process within a small window, which would hand over the API
(captures, deauth, Evil Twin). It is now 32 random bytes from getrandom,
checked in constant time. Release 1.0.6.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-03 11:16:27 -03:00
Lucas GuerraandClaude Sonnet 5 0ff945ef65 feat(report): add TLP classification badge to the audit report
CI / Format and clippy (push) Successful in 1m34s
CI / Dependency audit (push) Successful in 12s
CI / Tests (Linux) (push) Successful in 2m5s
CI / Check desktop app (Linux) (push) Successful in 4m2s
The cover already had the Sabiá logo, but only an "Uso autorizado" badge —
no sharing classification. Adds a TLP:AMBER badge (FIRST.org brand color)
next to it, on both the cover and the running per-page header, matching
the convention the rest of the Ciberfauna ecosystem's reports now follow.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-11-02 11:32:04 -03:00
Lucas RayanandClaude Sonnet 5 7e01e599fd chore(release): bump version to 1.0.5, move repository to the ciberfauna org
Release / Create release (push) Successful in 7s
CI / Format and clippy (push) Successful in 1m25s
CI / Tests (Linux) (push) Successful in 1m57s
CI / Check desktop app (Linux) (push) Successful in 3m43s
Release / Desktop app (linux-aarch64) (push) Successful in 4m22s
Release / CLI (linux-x86_64) (push) Successful in 51s
Release / Desktop app (linux-x86_64) (push) Successful in 4m20s
CI / Dependency audit (push) Successful in 11s
Release / CLI (linux-aarch64) (push) Successful in 45s
Release / Desktop app (windows) (push) Successful in 3m12s
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01VAyr8d7HuAdUGB6aA5xmDD
2026-10-31 10:19:32 -03:00
Lucas RayanandClaude Sonnet 5 6191c7bbc6 feat(update): one-click desktop self-update (AppImage, .deb, Windows)
Same change as Guará: update_apply used to flatly refuse to run for
the GUI binary and point the user to a manual download instead. Since
the desktop app already elevates to root before showing its window,
the process applying the update already has everything it needs — no
second authentication round is required.

- New sabia_core::update::apply_desktop[_with_progress], alongside the
  existing CLI-only apply() (left untouched): detects the install kind
  at runtime (AppImage via the APPIMAGE env var, same FUSE-mount issue
  elevated_exe() already works around and this reuses; Deb otherwise
  on Linux; WindowsInstaller on Windows), matches the right release
  asset by the GUI bundle naming (_amd64/_aarch64.AppImage,
  _amd64/_arm64.deb, _x64-setup.exe), verifies SHA-256 when a sidecar
  is published, and installs:
  - AppImage: downloads to a temp file in the same directory, renames
    over the running file, execs it in place (same PID, already root).
  - .deb: runs dpkg -i directly (already root), execs current_exe()
    again now that dpkg replaced it on disk.
  - Windows: runs the installer silently and detached, exits
    immediately to release the file lock. Does not claim to relaunch
    the app afterwards — no documented NSIS or Tauri flag does that;
    needs a real Windows machine to confirm actual post-install
    behavior.
- Engine::update_apply_desktop wires it into the Tauri update_apply
  command (now takes AppHandle, emits update-progress events).
- Fixed a real gap: the existing update button handler changed its own
  label when an update was available but never actually called apply
  — wired it for real, with per-phase progress feedback in the
  interface's existing language (download/verify/install/restart).
- scripts/build-gui.sh: generates a checksum file next to every file
  in dist-gui/, matching the CLI release archive convention.
- 3 new unit tests: install-kind detection, GUI asset suffix matching
  against real release naming, existing CLI-refusal test unchanged.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01VAyr8d7HuAdUGB6aA5xmDD
2026-10-31 10:18:31 -03:00
Lucas RayanandClaude Sonnet 5 7d69f2e4b2 ci: pin CI jobs to the arm64 runners, not the shared ubuntu-latest alias
CI / Format and clippy (push) Successful in 17s
CI / Tests (Linux) (push) Successful in 27s
CI / Dependency audit (push) Successful in 10s
CI / Check desktop app (Linux) (push) Successful in 1m47s
Release / Create release (push) Successful in 6s
Release / CLI (linux-aarch64) (push) Successful in 49s
Release / Desktop app (linux-aarch64) (push) Successful in 4m22s
Release / CLI (linux-x86_64) (push) Successful in 50s
Release / Desktop app (linux-x86_64) (push) Successful in 4m4s
Release / Desktop app (windows) (push) Successful in 3m8s
Same issue and fix as Guará: ci.yml's four jobs used
runs-on: ubuntu-latest, which now resolves only to hostinger-runner
after the Gitea runner relabeling, piling every CI push onto the same
single machine release.yml routes x86_64 builds to and overloading it.
Pins all four jobs to linux-arm64.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01VAyr8d7HuAdUGB6aA5xmDD
2026-10-30 22:23:45 -03:00
Lucas RayanandClaude Sonnet 5 ba0c99d5b6 chore(release): bump version to 1.0.4
CI / Dependency audit (push) Canceled after 0s
CI / Check desktop app (Linux) (push) Canceled after 0s
Release / Create release (push) Successful in 6s
CI / Format and clippy (push) Canceled after 0s
CI / Tests (Linux) (push) Canceled after 0s
Release / CLI (linux-aarch64) (push) Successful in 53s
Release / Desktop app (linux-aarch64) (push) Successful in 4m45s
Release / CLI (linux-x86_64) (push) Successful in 1m28s
Release / Desktop app (linux-x86_64) (push) Successful in 10m26s
Release / Desktop app (windows) (push) Successful in 8m12s
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01VAyr8d7HuAdUGB6aA5xmDD
2026-10-30 22:06:19 -03:00
Lucas RayanandClaude Sonnet 5 476e27e253 ci(release): build linux-x86_64 natively on the new amd64 runner
A native x86_64 Gitea Actions runner (hostinger-runner, label
linux-amd64) is now available alongside the two aarch64 runners
(oracle-runner/-b, label linux-arm64). Routes the linux-x86_64 leg of
the cli and gui release matrices to it instead of cross-compiling it
from an aarch64 host, same change as the Guará repository.

- matrix.include gets an explicit runner field per platform
  (linux-arm64 for aarch64, linux-amd64 for x86_64 and windows);
  runs-on: ${{ matrix.runner }} picks it per job. windows is pinned to
  linux-amd64 explicitly rather than relying on the ubuntu-latest
  alias, since that alias has already been reassigned once between
  the aarch64 and the x86_64 runner on this Gitea instance.
- The "Platform cross-linker" step (gcc-x86-64-linux-gnu) only runs
  when NOT on the native amd64 runner, since a native build needs no
  cross-linker.
- scripts/build-gui.sh and scripts/package-cli.sh are intentionally
  left untouched: both already branch on `uname -m` and take the
  simple native path when run on x86_64, so no script change was
  needed. The existing cross-compile path (qemu wrappers, the ELF
  launcher that survives tauri-bundler's dd patch) stays in place as a
  dormant fallback in case the single amd64 runner is ever
  unavailable — deliberately kept, not deleted.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01VAyr8d7HuAdUGB6aA5xmDD
2026-10-30 22:06:13 -03:00
19 changed files with 641 additions and 51 deletions

No files matched your search

+4 -4
View File
@@ -26,7 +26,7 @@ env:
jobs:
lint:
name: Format and clippy
runs-on: ubuntu-latest
runs-on: linux-arm64
env:
CARGO_TARGET_DIR: /opt/hostedtoolcache/cargo-target/sabia-lint
steps:
@@ -45,7 +45,7 @@ jobs:
# Linux-only runner (ARM64).
test:
name: Tests (Linux)
runs-on: ubuntu-latest
runs-on: linux-arm64
env:
CARGO_TARGET_DIR: /opt/hostedtoolcache/cargo-target/sabia-test
steps:
@@ -55,7 +55,7 @@ jobs:
audit:
name: Dependency audit
runs-on: ubuntu-latest
runs-on: linux-arm64
steps:
- uses: actions/checkout@v7
- uses: dtolnay/rust-toolchain@stable
@@ -69,7 +69,7 @@ jobs:
gui:
name: Check desktop app (Linux)
runs-on: ubuntu-latest
runs-on: linux-arm64
env:
CARGO_TARGET_DIR: /opt/hostedtoolcache/cargo-target/sabia-gui
steps:
+9 -6
View File
@@ -48,22 +48,22 @@ jobs:
cli:
name: CLI (${{ matrix.platform }})
needs: release
runs-on: ubuntu-latest
runs-on: ${{ matrix.runner }}
env:
CARGO_TARGET_DIR: /opt/hostedtoolcache/cargo-target/sabia-release-cli-${{ matrix.platform }}
strategy:
fail-fast: false
matrix:
include:
- { platform: linux-aarch64, target: aarch64-unknown-linux-gnu, apt: "" }
- { platform: linux-x86_64, target: x86_64-unknown-linux-gnu, apt: "gcc-x86-64-linux-gnu" }
- { platform: linux-aarch64, target: aarch64-unknown-linux-gnu, apt: "", runner: linux-arm64 }
- { platform: linux-x86_64, target: x86_64-unknown-linux-gnu, apt: "gcc-x86-64-linux-gnu", runner: linux-amd64 }
steps:
- uses: actions/checkout@v7
- uses: dtolnay/rust-toolchain@stable
with:
targets: ${{ matrix.target }}
- name: Platform cross-linker
if: ${{ matrix.apt != '' }}
if: ${{ matrix.apt != '' && matrix.runner != 'linux-amd64' }}
run: scripts/apt-install.sh /opt/hostedtoolcache/apt-cache/cli-x86_64 ${{ matrix.apt }}
- name: Build and package
run: scripts/package-cli.sh "${{ gitea.ref_name }}" "${{ matrix.platform }}" "${{ matrix.target }}" | tee packages.txt
@@ -76,7 +76,7 @@ jobs:
gui:
name: Desktop app (${{ matrix.platform }})
needs: release
runs-on: ubuntu-latest
runs-on: ${{ matrix.runner }}
env:
CARGO_TARGET_DIR: /opt/hostedtoolcache/cargo-target/sabia-release-gui-${{ matrix.platform }}
TAURI_SIGNING_PRIVATE_KEY: ${{ secrets.SABIA_TAURI_SIGNING_PRIVATE_KEY || secrets.TAURI_SIGNING_PRIVATE_KEY }}
@@ -84,7 +84,10 @@ jobs:
strategy:
fail-fast: false
matrix:
platform: [linux-aarch64, linux-x86_64, windows]
include:
- { platform: linux-aarch64, runner: linux-arm64 }
- { platform: linux-x86_64, runner: linux-amd64 }
- { platform: windows, runner: linux-amd64 }
steps:
- uses: actions/checkout@v7
- uses: dtolnay/rust-toolchain@stable
+21
View File
@@ -4,6 +4,27 @@
Format based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/); versions follow SemVer.
## [1.0.7] - 2026-11-03
### Added
- **Update progress bar.** The in-app update shows a bar with the real download percentage, then the verify, install and restart steps.
### Fixed
- **Updating no longer freezes the app.** The update check and install ran on the UI thread; they now run in the background.
## [1.0.6] - 2026-11-03
### Security
- **`sabia ui` token is now unguessable.** It was the server's startup time in nanoseconds, so another user or process on the same machine could find it by trying values around that moment and then drive the API (captures, deauthentication, Evil Twin). It is now 32 random bytes from the operating system, and requests are checked in constant time. The desktop app does not use this token and is unaffected.
## [1.0.5] - 2026-10-31
### Added
- **One-click desktop update.** The update button actually downloads, verifies (SHA-256) and installs the new version now, instead of only changing its own label. Works for all three desktop packages: AppImage (atomic self-replace), `.deb` (`dpkg -i`, no new password prompt — the app is already running as root by the time you click it), and the Windows installer (silent install). On Linux, the app restarts itself automatically; on Windows, the installer runs silently but the app does not reopen on its own yet — start it again once the install finishes.
### Changed
- **The repository moved to the Ciberfauna organization** (`ciberfauna/sabia`, was `lucasrguerra/sabia`). **Important notice for existing installations:** versions up to 1.0.4 have the old location baked into their update check; they will not find this release automatically. Download 1.0.5 once manually from the new Releases page, and future update checks will work through the new location.
## [1.0.3] - 2026-10-30
### Fixed
+21
View File
@@ -4,6 +4,27 @@
Formato baseado em [Keep a Changelog](https://keepachangelog.com/pt-BR/1.1.0/); versões seguem SemVer.
## [1.0.7] - 2026-11-03
### Adicionado
- **Barra de progresso da atualização.** A atualização dentro do app mostra uma barra com a porcentagem real do download, seguida das etapas de verificação, instalação e reinício.
### Corrigido
- **Atualizar não trava mais o app.** A verificação e a instalação rodavam na thread da interface; agora rodam em segundo plano.
## [1.0.6] - 2026-11-03
### Segurança
- **O token do `sabia ui` agora não pode ser adivinhado.** Ele era o horário de partida do servidor em nanossegundos, então outro usuário ou processo na mesma máquina podia achá-lo testando valores próximos daquele momento e passar a comandar a API (capturas, desautenticação, Evil Twin). Agora são 32 bytes aleatórios do sistema operacional, e as requisições são conferidas em tempo constante. O app desktop não usa esse token e não é afetado.
## [1.0.5] - 2026-10-31
### Adicionado
- **Atualização do app desktop em um clique.** O botão de atualizar agora baixa, confere (SHA-256) e instala a versão nova de verdade, em vez de só mudar o próprio texto. Funciona nos três pacotes do desktop: AppImage (substituição atômica), `.deb` (`dpkg -i`, sem pedir senha de novo — o app já roda como root quando você clica), e o instalador do Windows (instalação silenciosa). No Linux o app reabre sozinho; no Windows o instalador roda silencioso mas o app ainda não reabre por conta própria — abra de novo depois que a instalação terminar.
### Alterado
- **O repositório se mudou pra organização Ciberfauna** (`ciberfauna/sabia`, era `lucasrguerra/sabia`). **Aviso importante pra instalações existentes:** versões até a 1.0.4 têm o endereço antigo fixo na checagem de atualização e não vão encontrar esta versão sozinhas. Baixe a 1.0.5 manualmente uma vez na nova página de Releases, e as próximas verificações voltam a funcionar pelo novo endereço.
## [1.0.3] - 2026-10-30
### Corrigido
Generated
+3 -2
View File
@@ -440,10 +440,11 @@ dependencies = [
[[package]]
name = "sabia-cli"
version = "1.0.3"
version = "1.0.7"
dependencies = [
"clap",
"ctrlc",
"getrandom",
"sabia-core",
"serde",
"serde_json",
@@ -451,7 +452,7 @@ dependencies = [
[[package]]
name = "sabia-core"
version = "1.0.3"
version = "1.0.7"
dependencies = [
"aes",
"flate2",
+2 -2
View File
@@ -3,10 +3,10 @@ resolver = "2"
members = ["crates/sabia-core", "crates/sabia-cli"]
[workspace.package]
version = "1.0.3"
version = "1.0.7"
edition = "2021"
license = "MIT OR Apache-2.0"
repository = "https://git.lucasrguerra.dev.br/lucasrguerra/sabia"
repository = "https://git.lucasrguerra.dev.br/ciberfauna/sabia"
authors = ["Sabiá contributors"]
rust-version = "1.80"
+2 -2
View File
@@ -2538,7 +2538,7 @@ checksum = "cf54715a573b99ac80df0bc206da022bcd442c974952c7b9720069370852e21f"
[[package]]
name = "sabia-core"
version = "1.0.3"
version = "1.0.7"
dependencies = [
"aes",
"flate2",
@@ -2555,7 +2555,7 @@ dependencies = [
[[package]]
name = "sabia-gui"
version = "1.0.3"
version = "1.0.7"
dependencies = [
"libc",
"sabia-core",
+2 -2
View File
@@ -3,11 +3,11 @@
[package]
name = "sabia-gui"
description = "Sabiá: graphical Wi-Fi security auditing interface"
version = "1.0.3"
version = "1.0.7"
edition = "2021"
license = "MIT OR Apache-2.0"
authors = ["Sabiá contributors"]
repository = "https://git.lucasrguerra.dev.br/lucasrguerra/sabia"
repository = "https://git.lucasrguerra.dev.br/ciberfauna/sabia"
rust-version = "1.80"
[workspace]
+35 -5
View File
@@ -496,14 +496,44 @@ fn start_scan_opts(
}
#[tauri::command]
fn update_check(state: tauri::State<'_, State>) -> Result<serde_json::Value, String> {
let status = state.0.update_check().map_err(|e| e.to_string())?;
serde_json::to_value(status).map_err(|e| e.to_string())
async fn update_check(state: tauri::State<'_, State>) -> Result<serde_json::Value, String> {
let eng = state.0.clone();
tauri::async_runtime::spawn_blocking(move || {
let status = eng.update_check().map_err(|e| e.to_string())?;
serde_json::to_value(status).map_err(|e| e.to_string())
})
.await
.map_err(|e| e.to_string())?
}
#[tauri::command]
fn update_apply(state: tauri::State<'_, State>) -> Result<String, String> {
state.0.update_apply().map_err(|e| e.to_string())
async fn update_apply(
app: tauri::AppHandle,
state: tauri::State<'_, State>,
) -> Result<String, String> {
use tauri::Emitter;
#[cfg(any(target_os = "linux", target_os = "macos"))]
let exe = elevated_exe().unwrap_or_else(|_| std::env::current_exe().unwrap_or_default());
#[cfg(not(any(target_os = "linux", target_os = "macos")))]
let exe = std::env::current_exe().unwrap_or_default();
// Blocking download/install must not run on the UI thread, or the window freezes.
let eng = state.0.clone();
tauri::async_runtime::spawn_blocking(move || {
eng.update_apply_desktop(&exe, move |phase| {
let (name, pct) = match phase.split_once(':') {
Some((n, p)) => (n, p.parse::<u8>().ok()),
None => (phase, None),
};
let _ = app.emit(
"update-progress",
serde_json::json!({ "phase": name, "percent": pct }),
);
})
.map_err(|e| e.to_string())
})
.await
.map_err(|e| e.to_string())?
}
/// `true` when the process already has sufficient privileges for all
+1 -1
View File
@@ -1,7 +1,7 @@
{
"$schema": "https://schema.tauri.app/config/2",
"productName": "Sabiá",
"version": "1.0.3",
"version": "1.0.7",
"identifier": "dev.sabia.app",
"build": {
"frontendDist": "../ui"
+6 -1
View File
@@ -116,7 +116,7 @@ code, .mono { font-family: var(--mono); font-variant-numeric: tabular-nums; }
.iface-pick .pill { align-self: flex-start; }
.side-foot { margin-top: auto; padding: 14px 4px 4px; font-size: 11.5px; color: var(--text-3); display: grid; gap: 8px; }
.foot-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.foot-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; }
.side-foot button { background: transparent; border: 0; color: var(--text-3); cursor: pointer; }
.side-foot .foot-row > button:not(.icon-btn) { text-decoration: underline; text-underline-offset: 2px; }
.side-foot button:hover { color: var(--text-2); }
@@ -457,3 +457,8 @@ dialog menu { display: flex; gap: 10px; justify-content: flex-end; padding: 0; m
.report-dlg { width: 100vw; height: 100vh; max-height: 100vh; border-radius: 0; }
.report-view { padding: 8px; }
}
.upd-bar { flex-basis: 100%; height: 6px; border-radius: 99px; margin-top: 8px; overflow: hidden; background: color-mix(in srgb, currentColor 12%, transparent); }
.upd-bar > i { display: block; height: 100%; border-radius: 99px; background: var(--accent, currentColor); transition: width .3s ease; }
.upd-bar.indet > i { animation: upd-slide 1.2s infinite ease-in-out; }
@keyframes upd-slide { 0% { transform: translateX(-100%); } 100% { transform: translateX(300%); } }
+66 -4
View File
@@ -267,6 +267,8 @@ async function tauriApi(path, opts = {}) {
return await invoke('export_all_hc22000', { iface: q.get('iface'), out: q.get('out') });
case 'GET /api/update/check':
return await invoke('update_check');
case 'POST /api/update/apply':
return await invoke('update_apply');
default:
return { error: 'rota desconhecida' };
}
@@ -371,12 +373,72 @@ els.btnScan.addEventListener('click', async () => {
}
});
let updateStatus = null;
let updateInProgress = false;
// Progress bar under the update button (indeterminate until a percentage arrives).
function setUpdBar(pct) {
const row = els.btnUpdate.parentElement;
let bar = row.querySelector('.upd-bar');
if (!bar) {
bar = document.createElement('div');
bar.className = 'upd-bar';
bar.innerHTML = '<i></i>';
row.appendChild(bar);
}
bar.classList.toggle('indet', pct == null);
bar.firstChild.style.width = pct == null ? '35%' : `${pct}%`;
}
els.btnUpdate.addEventListener('click', async () => {
if (updateInProgress) return;
if (updateStatus?.update_available) {
updateInProgress = true;
els.btnUpdate.disabled = true;
els.btnUpdate.textContent = 'baixando…';
setUpdBar(null);
let unlisten = null;
if (tauri?.event?.listen) {
try {
unlisten = await tauri.event.listen('update-progress', (event) => {
const phase = event.payload?.phase;
const pct = event.payload?.percent;
setUpdBar(pct);
if (phase === 'downloading') els.btnUpdate.textContent = pct != null ? `baixando… ${pct}%` : 'baixando…';
else if (phase === 'verifying') els.btnUpdate.textContent = 'verificando…';
else if (phase === 'installing') els.btnUpdate.textContent = 'instalando…';
else if (phase === 'restarting') els.btnUpdate.textContent = 'reiniciando…';
});
} catch (_) {}
}
try {
await api('/api/update/apply', { method: 'POST' });
els.btnUpdate.textContent = 'já atualizado';
} catch (err) {
updateInProgress = false;
els.btnUpdate.parentElement.querySelector('.upd-bar')?.remove();
els.btnUpdate.disabled = false;
els.btnUpdate.textContent = `atualizar para ${updateStatus.latest_version}`;
alert('Falha na atualização: ' + (err?.message || err));
} finally {
if (unlisten) unlisten();
}
return;
}
els.btnUpdate.textContent = 'checando…';
const status = await api('/api/update/check');
els.btnUpdate.textContent = status.update_available
? `atualizar para ${status.latest_version}`
: 'já atualizado';
try {
const status = await api('/api/update/check');
updateStatus = status;
els.btnUpdate.textContent = status?.update_available
? `atualizar para ${status.latest_version}`
: 'já atualizado';
} catch (err) {
els.btnUpdate.textContent = 'checar atualização';
alert('Não foi possível verificar atualizações: ' + (err?.message || err));
}
});
const SEC_RANK = {
+7
View File
@@ -12,6 +12,12 @@ export const EN = {
'checando…': 'checking…',
'atualizar para {n}': 'update to {n}',
'já atualizado': 'already up to date',
'baixando…': 'downloading…',
'verificando…': 'verifying…',
'instalando…': 'installing…',
'reiniciando…': 'restarting…',
'Falha na atualização:': 'Update failed:',
'Não foi possível verificar atualizações:': 'Could not check for updates:',
// topbar
'Painel de captura': 'Capture dashboard',
@@ -564,4 +570,5 @@ export const EN = {
'a captura em {n} não está ativa': 'capture on {n} is not active',
'{n} não está disponível; o reaver integrado não pôde ser extraído':
'{n} is not available; the bundled reaver could not be extracted',
'baixando… {n}%': 'downloading… {n}%',
};
+1
View File
@@ -13,6 +13,7 @@ name = "sabia"
path = "src/main.rs"
[dependencies]
getrandom = "0.4"
sabia-core = { path = "../sabia-core" }
clap = { version = "4", features = ["derive"] }
serde = { version = "1", features = ["derive"] }
+42 -9
View File
@@ -10,7 +10,6 @@ use std::io::{BufRead, BufReader, Read, Write};
use std::net::{TcpListener, TcpStream};
use std::sync::Arc;
use std::thread;
use std::time::{SystemTime, UNIX_EPOCH};
const INDEX_HTML: &str = include_str!("../../../../apps/gui/ui/index.html");
const APP_CSS: &str = include_str!("../../../../apps/gui/ui/app.css");
@@ -54,12 +53,27 @@ pub fn serve(port: u16, audit_path: std::path::PathBuf, open: bool) -> sabia_cor
Ok(())
}
/// 32 bytes from the operating system's CSPRNG, hex-encoded. The token used to
/// be the startup time in nanoseconds, which anyone on the machine could guess
/// within a small window and use to drive the API (captures, deauth, Evil Twin).
fn gen_token() -> String {
let nanos = SystemTime::now()
.duration_since(UNIX_EPOCH)
.unwrap_or_default()
.as_nanos();
format!("{nanos:x}")
let mut bytes = [0u8; 32];
getrandom::fill(&mut bytes).expect("operating system random number generator");
bytes.iter().map(|b| format!("{b:02x}")).collect()
}
/// Constant-time check, so response timing does not reveal how much of a
/// guess was right.
fn token_ok(candidate: Option<&str>, expected: &str) -> bool {
let Some(candidate) = candidate else {
return false;
};
let (candidate, expected) = (candidate.as_bytes(), expected.as_bytes());
let mut diff = candidate.len() ^ expected.len();
for (index, byte) in expected.iter().enumerate() {
diff |= usize::from(byte ^ candidate.get(index).copied().unwrap_or(0));
}
diff == 0
}
#[cfg(target_os = "linux")]
@@ -230,7 +244,7 @@ fn handle(
let req = parse_request(&mut stream)?;
if req.path == "/" {
if req.token.as_deref() != Some(expected_token) {
if !token_ok(req.token.as_deref(), expected_token) {
return respond(&mut stream, 401, "text/plain", b"token invalido");
}
return respond(
@@ -242,7 +256,7 @@ fn handle(
}
if req.path == "/api/report.html" {
if req.token.as_deref() != Some(expected_token) {
if !token_ok(req.token.as_deref(), expected_token) {
return respond(&mut stream, 401, "text/plain", b"token invalido");
}
let Some(iface) = req.text("iface") else {
@@ -315,7 +329,7 @@ fn handle(
if !req.path.starts_with("/api/") {
return respond(&mut stream, 404, "text/plain", b"not found");
}
if req.token.as_deref() != Some(expected_token) {
if !token_ok(req.token.as_deref(), expected_token) {
return respond(
&mut stream,
401,
@@ -834,6 +848,25 @@ fn api(engine: &Arc<Engine>, req: &Request) -> (u16, String) {
#[cfg(test)]
mod tests {
#[test]
fn tokens_are_random_and_long() {
let (a, b) = (gen_token(), gen_token());
assert_eq!(a.len(), 64);
assert!(a.bytes().all(|c| c.is_ascii_hexdigit()));
assert_ne!(a, b);
}
#[test]
fn token_check_needs_the_exact_value() {
assert!(token_ok(Some("abc123"), "abc123"));
assert!(!token_ok(Some("abc12"), "abc123"));
assert!(!token_ok(Some("abc1234"), "abc123"));
assert!(!token_ok(Some("abc124"), "abc123"));
assert!(!token_ok(None, "abc123"));
assert!(!token_ok(Some(""), "abc123"));
}
use super::*;
#[test]
+11
View File
@@ -2979,6 +2979,17 @@ impl Engine {
update::apply(&exe)
}
pub fn update_apply_desktop<F>(
&self,
current_exe: &std::path::Path,
on_progress: F,
) -> Result<String>
where
F: Fn(&str),
{
update::apply_desktop_with_progress(current_exe, on_progress)
}
fn session_handshake(
&self,
name: &str,
+5 -2
View File
@@ -402,7 +402,10 @@ section.chapter:first-of-type { break-before: avoid; }
.cover .brand { display: flex; align-items: center; gap: 3mm; }
.cover .brand img { width: 11mm; height: 11mm; border-radius: 3mm; display: block; }
.cover .brand span { font-family: var(--display); font-size: 14pt; font-weight: 700; letter-spacing: -0.01em; }
.cover .badges { display: flex; align-items: center; gap: 2.5mm; }
.cover .badge { font: 700 8pt var(--mono); letter-spacing: .14em; text-transform: uppercase; color: #ffd38a; border: 1px solid #a66a2e; background: rgba(255,211,138,.08); padding: 2.5mm 4mm; border-radius: 1mm; white-space: nowrap; }
/* FIRST.org TLP 2.0 brand color (amber), matching the sharing-classification badge the Ciberfauna report convention requires. */
.cover .badge-tlp { color: #FFC000; border-color: #FFC000; background: rgba(255,192,0,.08); }
.cover .mid { margin-top: auto; }
.cover .eyebrow { color: #ffb963; margin-bottom: 4mm; }
.cover h1 { font-size: 40pt; letter-spacing: -0.02em; max-width: 150mm; color: #fff; margin-bottom: 6mm; }
@@ -484,7 +487,7 @@ tbody tr:nth-child(even) td { background: #f7f9f7; }
background: #fff;
@top-left { content: "SABIÁ · AUDITORIA WI-FI"; font: 600 7.5pt var(--mono); letter-spacing: .1em; color: var(--faint); vertical-align: bottom; padding-bottom: 4mm; }
@top-center { content: string(section); font: 500 7.5pt var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--faint); vertical-align: bottom; padding-bottom: 4mm; text-align: center; }
@top-right { content: "\25CF USO AUTORIZADO"; font: 700 7.5pt var(--mono); letter-spacing: .1em; color: var(--accent); vertical-align: bottom; padding-bottom: 4mm; text-align: right; white-space: nowrap; }
@top-right { content: "TLP:AMBER \25CF USO AUTORIZADO"; font: 700 7.5pt var(--mono); letter-spacing: .1em; color: var(--accent); vertical-align: bottom; padding-bottom: 4mm; text-align: right; white-space: nowrap; }
@bottom-left { content: string(footline); font: 400 7.5pt var(--mono); color: var(--faint); vertical-align: top; padding-top: 4mm; }
@bottom-right { content: counter(page) " / " counter(pages); font: 700 8pt var(--mono); color: var(--ink); vertical-align: top; padding-top: 4mm; text-align: right; }
}
@@ -549,7 +552,7 @@ pub fn render(model: &ReportModel, options: ReportOptions) -> String {
<section class="cover">
<div class="top">
<div class="brand"><img src="{logo}" alt=""><span>Sabiá</span></div>
<span class="badge">Uso autorizado</span>
<div class="badges"><span class="badge badge-tlp">TLP:AMBER</span><span class="badge">Uso autorizado</span></div>
</div>
<div class="mid">
<p class="eyebrow">Relatório de auditoria · redes sem fio</p>
+390 -7
View File
@@ -9,16 +9,16 @@ use crate::error::{Result, SabiaError};
use serde::Deserialize;
use sha2::{Digest, Sha256};
use std::fs;
use std::path::PathBuf;
use std::path::{Path, PathBuf};
use std::process::Command;
/// Gitea `releases/latest` API endpoint (`tag_name`, `assets[].name`, `assets[].browser_download_url`).
///
const LATEST_RELEASE_URL: &str =
"https://git.lucasrguerra.dev.br/api/v1/repos/lucasrguerra/sabia/releases/latest";
"https://git.lucasrguerra.dev.br/api/v1/repos/ciberfauna/sabia/releases/latest";
/// Human-facing Gitea Releases page for desktop GUI users.
const RELEASES_PAGE_URL: &str = "https://git.lucasrguerra.dev.br/lucasrguerra/sabia/releases";
const RELEASES_PAGE_URL: &str = "https://git.lucasrguerra.dev.br/ciberfauna/sabia/releases";
#[derive(Debug, Deserialize)]
struct Release {
@@ -30,6 +30,8 @@ struct Release {
struct Asset {
name: String,
browser_download_url: String,
#[serde(default)]
size: u64,
}
#[derive(Debug, Clone, serde::Serialize)]
@@ -56,16 +58,32 @@ fn curl_text(url: &str) -> Result<String> {
Ok(String::from_utf8_lossy(&out.stdout).into_owned())
}
fn curl_download(url: &str, dest: &PathBuf) -> Result<()> {
let status = Command::new("curl")
/// Downloads `url` to `dest`, polling the file size to report a percentage (0-100)
/// through `on_pct` while curl runs; `total` is the release asset size (0 = unknown).
fn curl_download(url: &str, dest: &Path, total: u64, on_pct: &dyn Fn(u8)) -> Result<()> {
let mut child = Command::new("curl")
.args(["-fsSL", "-H", "User-Agent: sabia-updater", "-o"])
.arg(dest)
.arg(url)
.status()
.spawn()
.map_err(|e| SabiaError::CommandFailed {
cmd: format!("curl {url}"),
detail: e.to_string(),
})?;
let status = loop {
let waited = child.try_wait().map_err(|e| SabiaError::CommandFailed {
cmd: format!("curl {url}"),
detail: e.to_string(),
})?;
if let Some(st) = waited {
break st;
}
let got = fs::metadata(dest).map(|m| m.len()).unwrap_or(0);
if let Some(pct) = got.saturating_mul(100).checked_div(total) {
on_pct(pct.min(100) as u8);
}
std::thread::sleep(std::time::Duration::from_millis(150));
};
if !status.success() {
return Err(SabiaError::CommandFailed {
cmd: format!("curl {url}"),
@@ -162,7 +180,7 @@ pub fn apply(current_exe: &PathBuf) -> Result<String> {
let tmp_dir = std::env::temp_dir().join("sabia-update");
fs::create_dir_all(&tmp_dir)?;
let archive_path = tmp_dir.join(&asset.name);
curl_download(&asset.browser_download_url, &archive_path)?;
curl_download(&asset.browser_download_url, &archive_path, 0, &|_| {})?;
if let Some(checksum_asset) = checksum_asset {
let expected = curl_text(&checksum_asset.browser_download_url)?;
@@ -246,6 +264,305 @@ fn find_binary(dir: &PathBuf) -> Result<PathBuf> {
})
}
/// Desktop GUI installation type detected at runtime.
#[derive(Debug, Clone, PartialEq, Eq)]
pub enum DesktopInstall {
/// Linux AppImage: real filesystem path of the .AppImage file (from APPIMAGE env var).
AppImage(PathBuf),
/// Linux Debian package installed via dpkg: `current_exe` is reliable here.
Deb,
/// Windows NSIS installer: downloaded setup executable run with `/S`
/// (silent). Does not relaunch the app on its own — see the comment on
/// the `WindowsInstaller` apply path.
WindowsInstaller,
}
/// Detects the desktop installation type given an optional `APPIMAGE` environment
/// variable value and the current executable path.
pub fn detect_desktop_install_from(
appimage_env: Option<&std::ffi::OsStr>,
current_exe: &Path,
) -> Result<DesktopInstall> {
#[cfg(windows)]
{
let _ = (appimage_env, current_exe);
Ok(DesktopInstall::WindowsInstaller)
}
#[cfg(target_os = "linux")]
{
if let Some(val) = appimage_env {
let path = PathBuf::from(val);
if path.is_file() {
return Ok(DesktopInstall::AppImage(path));
}
}
if current_exe.is_file()
&& current_exe
.extension()
.and_then(|e| e.to_str())
.map(|e| e.eq_ignore_ascii_case("appimage"))
.unwrap_or(false)
{
return Ok(DesktopInstall::AppImage(current_exe.to_path_buf()));
}
Ok(DesktopInstall::Deb)
}
#[cfg(not(any(windows, target_os = "linux")))]
{
let _ = (appimage_env, current_exe);
Err(SabiaError::CommandFailed {
cmd: "update".into(),
detail: format!(
"automatic self-update is not supported on this platform; please download manually from {RELEASES_PAGE_URL}"
),
})
}
}
/// Detects the desktop installation type using the live environment.
pub fn detect_desktop_install() -> Result<DesktopInstall> {
let exe = std::env::current_exe()?;
detect_desktop_install_from(std::env::var_os("APPIMAGE").as_deref(), &exe)
}
/// Returns the expected release asset suffix for a desktop installation and CPU architecture.
pub fn gui_asset_suffix_for(install: &DesktopInstall, arch: &str) -> Result<&'static str> {
match install {
DesktopInstall::AppImage(_) => match arch {
"x86_64" => Ok("_amd64.AppImage"),
"aarch64" => Ok("_aarch64.AppImage"),
other => Err(SabiaError::CommandFailed {
cmd: "update".into(),
detail: format!("unsupported architecture for AppImage: {other}"),
}),
},
DesktopInstall::Deb => match arch {
"x86_64" => Ok("_amd64.deb"),
"aarch64" => Ok("_arm64.deb"),
other => Err(SabiaError::CommandFailed {
cmd: "update".into(),
detail: format!("unsupported architecture for deb package: {other}"),
}),
},
DesktopInstall::WindowsInstaller => match arch {
"x86_64" => Ok("_x64-setup.exe"),
other => Err(SabiaError::CommandFailed {
cmd: "update".into(),
detail: format!("unsupported architecture for Windows installer: {other}"),
}),
},
}
}
/// Returns the expected release asset suffix for the current architecture.
pub fn gui_asset_suffix(install: &DesktopInstall) -> Result<&'static str> {
gui_asset_suffix_for(install, std::env::consts::ARCH)
}
/// Downloads, verifies, and installs the latest desktop GUI release in place.
pub fn apply_desktop(current_exe: &Path) -> Result<String> {
apply_desktop_with_progress(current_exe, |_| {})
}
/// Downloads, verifies, and installs the latest desktop GUI release in place,
/// notifying the progress callback of phase transitions (`"downloading"`,
/// `"verifying"`, `"installing"`, `"restarting"`).
pub fn apply_desktop_with_progress<F>(current_exe: &Path, on_progress: F) -> Result<String>
where
F: Fn(&str),
{
let install =
detect_desktop_install_from(std::env::var_os("APPIMAGE").as_deref(), current_exe)?;
let body = curl_text(LATEST_RELEASE_URL)?;
let release: Release = serde_json::from_str(&body)?;
let suffix = gui_asset_suffix(&install)?;
let asset = release
.assets
.iter()
.find(|a| a.name.ends_with(suffix))
.ok_or_else(|| SabiaError::CommandFailed {
cmd: "update".into(),
detail: format!(
"no asset ending with `{suffix}` in release {}",
release.tag_name
),
})?;
let checksum_asset = release
.assets
.iter()
.find(|a| a.name == format!("{}.sha256", asset.name));
let tmp_dir = std::env::temp_dir().join("sabia-desktop-update");
fs::create_dir_all(&tmp_dir)?;
let download_path = tmp_dir.join(&asset.name);
on_progress("downloading");
curl_download(
&asset.browser_download_url,
&download_path,
asset.size,
&|pct| on_progress(&format!("downloading:{pct}")),
)?;
if let Some(checksum_asset) = checksum_asset {
on_progress("verifying");
let expected = curl_text(&checksum_asset.browser_download_url)?;
let expected_hash = expected
.split_whitespace()
.next()
.unwrap_or("")
.to_lowercase();
let data = fs::read(&download_path)?;
let mut hasher = Sha256::new();
hasher.update(&data);
let actual_hash: String = hasher
.finalize()
.iter()
.map(|b| format!("{b:02x}"))
.collect();
if actual_hash != expected_hash {
return Err(SabiaError::CommandFailed {
cmd: "update".into(),
detail: "checksum SHA-256 não confere — atualização descartada".into(),
});
}
}
on_progress("installing");
match install {
DesktopInstall::AppImage(target_appimage) => {
#[cfg(target_os = "linux")]
{
let parent_dir = target_appimage.parent().unwrap_or_else(|| Path::new("."));
let temp_name = format!(
".{}.tmp-{}",
target_appimage
.file_name()
.and_then(|n| n.to_str())
.unwrap_or("appimage"),
std::process::id()
);
let temp_file = parent_dir.join(temp_name);
fs::copy(&download_path, &temp_file)?;
#[cfg(unix)]
{
use std::os::unix::fs::PermissionsExt;
let mut perms = fs::metadata(&temp_file)?.permissions();
perms.set_mode(0o755);
fs::set_permissions(&temp_file, perms)?;
}
fs::rename(&temp_file, &target_appimage)?;
let _ = fs::remove_file(&download_path);
on_progress("restarting");
#[cfg(unix)]
{
use std::os::unix::process::CommandExt;
let err = Command::new(&target_appimage)
.args(std::env::args().skip(1))
.exec();
return Err(SabiaError::CommandFailed {
cmd: "update".into(),
detail: format!("failed to relaunch AppImage: {err}"),
});
}
}
#[cfg(not(target_os = "linux"))]
{
let _ = (&target_appimage, &download_path);
return Err(SabiaError::CommandFailed {
cmd: "update".into(),
detail: "AppImage updates are only supported on Linux".into(),
});
}
}
DesktopInstall::Deb => {
#[cfg(target_os = "linux")]
{
let status = Command::new("dpkg")
.args(["-i"])
.arg(&download_path)
.status()
.map_err(|e| SabiaError::CommandFailed {
cmd: "dpkg -i".into(),
detail: e.to_string(),
})?;
if !status.success() {
return Err(SabiaError::CommandFailed {
cmd: "dpkg -i".into(),
detail: format!("dpkg -i failed with exit code {:?}", status.code()),
});
}
let _ = fs::remove_file(&download_path);
on_progress("restarting");
#[cfg(unix)]
{
use std::os::unix::process::CommandExt;
let err = Command::new(current_exe)
.args(std::env::args().skip(1))
.exec();
return Err(SabiaError::CommandFailed {
cmd: "update".into(),
detail: format!("failed to relaunch updated app: {err}"),
});
}
}
#[cfg(not(target_os = "linux"))]
{
let _ = (&download_path, current_exe);
return Err(SabiaError::CommandFailed {
cmd: "update".into(),
detail: "deb updates are only supported on Linux".into(),
});
}
}
DesktopInstall::WindowsInstaller => {
#[cfg(windows)]
{
// `/S` is the one NSIS silent-install switch with a documented,
// stable meaning. There is no standard NSIS or Tauri flag that
// makes a silent install relaunch the app afterwards — that was
// claimed in an earlier draft of this code and could not be
// verified against NSIS's or Tauri's documentation; passing an
// invented flag to a stock NSIS installer is silently ignored,
// not harmful, but also not a relaunch mechanism. Spawning
// detached and exiting immediately (instead of waiting on the
// child) also avoids a self-deadlock: if the installer's script
// waits for this process to close before it can overwrite the
// running .exe, blocking here on the installer's exit status
// would hang forever. The practical effect: the update installs
// silently, but the app does not reopen itself — the user needs
// to start it again. This needs real-world confirmation on
// Windows before relying on it; if testing shows the bundled
// NSIS template does support an explicit relaunch flag or step,
// wire it in here instead of this comment.
on_progress("restarting");
Command::new(&download_path)
.arg("/S")
.spawn()
.map_err(|e| SabiaError::CommandFailed {
cmd: "installer".into(),
detail: format!("failed to launch installer: {e}"),
})?;
std::process::exit(0);
}
#[cfg(not(windows))]
{
let _ = &download_path;
return Err(SabiaError::CommandFailed {
cmd: "update".into(),
detail: "Windows installer updates are only supported on Windows".into(),
});
}
}
}
#[allow(unreachable_code)]
Ok(release.tag_name)
}
#[cfg(test)]
mod tests {
use super::*;
@@ -258,4 +575,70 @@ mod tests {
let err = apply(&PathBuf::from("C:/Program Files/Sabia/sabia-gui.exe")).unwrap_err();
assert!(err.to_string().contains(RELEASES_PAGE_URL), "{err}");
}
#[test]
fn detect_desktop_install_variants() {
#[cfg(target_os = "linux")]
{
let temp_appimage =
std::env::temp_dir().join(format!("test-sabia-{}.AppImage", std::process::id()));
let _ = fs::write(&temp_appimage, b"dummy appimage");
let res = detect_desktop_install_from(
Some(temp_appimage.as_os_str()),
Path::new("/usr/bin/sabia-gui"),
)
.unwrap();
assert_eq!(res, DesktopInstall::AppImage(temp_appimage.clone()));
let res_fallback = detect_desktop_install_from(None, &temp_appimage).unwrap();
assert_eq!(
res_fallback,
DesktopInstall::AppImage(temp_appimage.clone())
);
let _ = fs::remove_file(&temp_appimage);
let res_deb =
detect_desktop_install_from(None, Path::new("/usr/bin/sabia-gui")).unwrap();
assert_eq!(res_deb, DesktopInstall::Deb);
}
#[cfg(windows)]
{
let res = detect_desktop_install_from(
None,
Path::new("C:/Program Files/Sabia/sabia-gui.exe"),
)
.unwrap();
assert_eq!(res, DesktopInstall::WindowsInstaller);
}
}
#[test]
fn gui_asset_suffix_matches_known_release_naming() {
let appimage = DesktopInstall::AppImage(PathBuf::from("/tmp/Sabia.AppImage"));
assert_eq!(
gui_asset_suffix_for(&appimage, "x86_64").unwrap(),
"_amd64.AppImage"
);
assert_eq!(
gui_asset_suffix_for(&appimage, "aarch64").unwrap(),
"_aarch64.AppImage"
);
let deb = DesktopInstall::Deb;
assert_eq!(gui_asset_suffix_for(&deb, "x86_64").unwrap(), "_amd64.deb");
assert_eq!(gui_asset_suffix_for(&deb, "aarch64").unwrap(), "_arm64.deb");
let win = DesktopInstall::WindowsInstaller;
assert_eq!(
gui_asset_suffix_for(&win, "x86_64").unwrap(),
"_x64-setup.exe"
);
assert!(gui_asset_suffix_for(&appimage, "mips").is_err());
assert!(gui_asset_suffix_for(&deb, "riscv64").is_err());
assert!(gui_asset_suffix_for(&win, "arm").is_err());
}
}
+13 -4
View File
@@ -76,8 +76,6 @@ case "$platform" in
rm -rf "$bundle/appimage" "$bundle/deb"
tauri build --bundles appimage,deb
cp "$bundle"/appimage/*.AppImage "$bundle"/deb/*.deb ../../../dist-gui/
# Include .sig alongside the bundle when updater signing is enabled.
cp "$bundle"/appimage/*.AppImage.sig ../../../dist-gui/ 2>/dev/null || true
;;
linux-x86_64)
if [ "$(uname -m)" = x86_64 ]; then
@@ -165,7 +163,6 @@ EOF
tauri build --target x86_64-unknown-linux-gnu --bundles appimage,deb
fi
cp "$bundle"/appimage/*.AppImage "$bundle"/deb/*.deb ../../../dist-gui/
cp "$bundle"/appimage/*.AppImage.sig ../../../dist-gui/ 2>/dev/null || true
;;
windows)
rustup target add x86_64-pc-windows-msvc >/dev/null
@@ -173,9 +170,21 @@ EOF
rm -rf "$bundle"
tauri build --runner cargo-xwin --target x86_64-pc-windows-msvc --bundles nsis
cp "$bundle"/*-setup.exe ../../../dist-gui/
cp "$bundle"/*-setup.exe.sig ../../../dist-gui/ 2>/dev/null || true
;;
*) echo "unknown platform: $platform" >&2; exit 2 ;;
esac
(
cd ../../../dist-gui
for asset in *; do
[ -f "$asset" ] || continue
case "$asset" in
*.sha256) ;;
*)
sha256sum "$asset" > "$asset.sha256"
;;
esac
done
)
ls -1 ../../../dist-gui