chore(i18n): finish translating code comments and scripts to English
CI / Format and clippy (push) Successful in 1m57s
CI / Dependency audit (push) Successful in 13s
CI / Check desktop app (Linux) (push) Successful in 3m54s
CI / Tests (Linux) (push) Failing after 7m25s
Release / Create release (push) Successful in 6s
Release / CLI (linux-aarch64) (push) Successful in 1m48s
Release / CLI (linux-x86_64) (push) Successful in 2m39s
Release / Desktop app (linux-aarch64) (push) Successful in 10m9s
Release / Desktop app (linux-x86_64) (push) Successful in 12m20s
Release / Desktop app (windows) (push) Successful in 7m32s
Release / Build latest.json (push) Successful in 5s

Completes the English-only standardization for code, comments, scripts
and CI templates (UI/CLI-facing strings stay bilingual pt-BR/en,
untouched). Covers the remaining crates/, apps/gui/ui/ and
apps/gui/src-tauri/ comments, .gitea/ workflow and template comments,
.githooks/ hooks, and the scripts/ source comments for the files
already renamed in a prior commit (check.sh, generate-logo.py,
install-hooks.sh).

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01VAyr8d7HuAdUGB6aA5xmDD
This commit is contained in:
Lucas RayanandClaude Sonnet 5 committed 2026-10-30 20:43:02 -03:00
1 parent da212e6926
commit 6328220c60
129 files changed
+1961 -1834

No files matched your search

+1 -1
View File
@@ -1,6 +1,6 @@
[package]
name = "guara-cli"
description = "Guará: recuperação de arquivos pelo terminal (e servidor da interface gráfica)"
description = "Guará: command-line file recovery tool and web UI server"
version.workspace = true
edition.workspace = true
license.workspace = true
+73 -73
View File
@@ -20,34 +20,34 @@ struct Cli {
#[derive(Subcommand)]
enum SignCmd {
/// Cria o par de chaves de assinatura (recusa sobrescrever uma chave existente)
/// Generate a signing keypair (refuses to overwrite an existing key)
Keygen {
/// Onde gravar a chave privada (padrão: assinatura.key na pasta de configuração ou GUARA_SIGNING_KEY)
/// Where to write the private key (default: assinatura.key in the config dir or GUARA_SIGNING_KEY)
#[arg(long)]
key: Option<String>,
},
/// Assina um arquivo e grava <arquivo>.assinatura.json
/// Sign a file and write <file>.assinatura.json
File {
path: String,
#[arg(long)]
key: Option<String>,
/// Nome de quem assina (padrão: GUARA_EXAMINER)
/// Signer name (default: GUARA_EXAMINER)
#[arg(long)]
signer: Option<String>,
},
/// Confere a assinatura de um arquivo
/// Verify a file signature
Verify {
path: String,
/// Arquivo de assinatura (padrão: <arquivo>.assinatura.json)
/// Signature file (default: <file>.assinatura.json)
#[arg(long)]
sig: Option<String>,
/// Impressão digital esperada da chave, publicada pelo perito
/// Expected key fingerprint published by the examiner
#[arg(long)]
trust: Option<String>,
#[arg(long)]
json: bool,
},
/// Confere uma pasta de recuperação: assinatura do manifesto e hash de cada arquivo
/// Verify a recovery folder: manifest signature and hash of every file
Recovery {
dir: String,
#[arg(long)]
@@ -59,103 +59,103 @@ enum SignCmd {
#[derive(Subcommand)]
enum Cmd {
/// Lista discos e pendrives detectados
/// List detected disks and USB drives
Devices {
#[arg(long)]
json: bool,
},
/// Mostra partições, sistemas de arquivos, espaço não particionado e volumes cifrados
/// Show partitions, filesystems, unpartitioned space, and encrypted volumes
Inspect {
/// Dispositivo (ex.: /dev/sdb, \\.\PhysicalDrive1) ou arquivo de imagem
/// Device (e.g. /dev/sdb, \\.\PhysicalDrive1) or image file
path: String,
#[arg(long)]
json: bool,
#[command(flatten)]
asm: AsmArgs,
},
/// Saúde do disco (SMART): estado, temperatura, uso e tabela de atributos
/// Disk health (SMART): status, temperature, usage, and attribute table
Health {
/// Dispositivo ou partição (o SMART lido é o do disco que a contém)
/// Device or partition (reads SMART from the containing disk)
path: String,
#[arg(long)]
json: bool,
},
/// Procura arquivos apagados/perdidos (metadados + assinatura)
/// Scan for deleted/lost files (metadata + file carving)
Scan(ScanArgs),
/// Continua uma varredura pausada (Ctrl+C) a partir do arquivo de sessão
/// Resume a paused scan (Ctrl+C) from the session file
Resume {
session: String,
#[command(flatten)]
out: OutArgs,
},
/// Recupera arquivos de uma sessão salva
/// Recover files from a saved session
Recover {
session: String,
/// Pasta de destino (em OUTRO disco)
/// Destination directory (on ANOTHER disk)
dest: String,
#[command(flatten)]
filter: FilterArgs,
},
/// Cria uma imagem do disco (tolerante a setores ruins) para trabalhar na cópia
/// Create a fault-tolerant disk image (skipping bad sectors) to work on a copy
Image {
path: String,
dest: String,
/// Formato da imagem: raw (padrão), e01 (Expert Witness) ou aff4 (AFF4 v1.0), com hash e metadados
/// Image format: raw (default), e01 (Expert Witness), or aff4 (AFF4 v1.0), with hash and metadata
#[arg(long, default_value = "raw")]
format: String,
/// E01: número do caso
/// E01: case number
#[arg(long, default_value = "")]
case: String,
/// E01: examinador
/// E01: examiner
#[arg(long, default_value = "")]
examiner: String,
/// E01: descrição da evidência
/// E01: evidence description
#[arg(long, default_value = "")]
description: String,
/// E01: número da evidência
/// E01: evidence number
#[arg(long, default_value = "")]
evidence: String,
/// E01: observações
/// E01: notes
#[arg(long, default_value = "")]
notes: String,
/// E01: tamanho máximo de cada segmento em MiB (0 = um arquivo só)
/// E01: maximum segment size in MiB (0 = single file)
#[arg(long, default_value_t = 1500)]
segment_mib: u64,
/// E01: compressão 0 (nenhuma) a 9
/// E01: compression level 0 (none) to 9
#[arg(long, default_value_t = 1)]
compression: u32,
},
/// Confere uma imagem E01/Ex01: recalcula o MD5 e compara com o gravado na própria imagem
/// Verify an E01/Ex01 image: recomputes MD5 and compares against the embedded hash
Verify { path: String },
/// Assina e confere arquivos (manifestos, relatórios) e pastas de recuperação com Ed25519
/// Sign and verify files (manifests, reports) and recovery folders with Ed25519
#[command(subcommand)]
Sign(SignCmd),
/// Mostra a trilha de auditoria (quem fez o quê e quando) ou confere o encadeamento por hash
/// Show the audit trail (who did what and when) or verify its hash chain
Audit {
/// Arquivo da trilha (padrão: auditoria.jsonl na pasta de configuração ou GUARA_AUDIT_LOG)
/// Audit log file (default: auditoria.jsonl in the config dir or GUARA_AUDIT_LOG)
#[arg(long)]
log: Option<String>,
/// Só confere a cadeia de hashes; sai com erro se ela estiver quebrada
/// Only verify the hash chain; exits with an error if broken
#[arg(long)]
verify: bool,
/// Mostra só as últimas N entradas
/// Show only the last N entries
#[arg(long)]
tail: Option<usize>,
#[arg(long)]
json: bool,
},
/// Exporta os achados de uma sessão para CSV (abre no Excel)
/// Export session findings to CSV (Excel-compatible)
Export {
session: String,
/// Arquivo CSV de saída
/// Output CSV file
csv: String,
#[command(flatten)]
filter: FilterArgs,
},
/// Gera o relatório de recuperação (identificação do caso, origem, achados, hashes): PDF se o arquivo terminar em .pdf, senão HTML
/// Generate the recovery report (case info, source, findings, hashes): PDF if output ends in .pdf, otherwise HTML
Report {
session: String,
/// Arquivo de saída (.pdf ou .html)
/// Output file (.pdf or .html)
out: String,
#[arg(long, default_value = "")]
case: String,
@@ -165,20 +165,20 @@ enum Cmd {
org: String,
#[arg(long, default_value = "")]
notes: String,
/// Calcula MD5/SHA-1/SHA-256 da origem e inclui no relatório (pode demorar)
/// Compute source MD5/SHA-1/SHA-256 and include in the report (may take time)
#[arg(long)]
hash_source: bool,
},
/// Procura texto em todo o disco, inclusive espaço livre (UTF-8 e UTF-16)
/// Search for text across the entire disk, including free space (UTF-8 and UTF-16)
Search {
path: String,
/// Termos a procurar
/// Search terms
#[arg(required = true)]
terms: Vec<String>,
/// Diferencia maiúsculas de minúsculas
/// Case-sensitive search
#[arg(long)]
case_sensitive: bool,
/// Não procura em UTF-16
/// Skip UTF-16 search
#[arg(long)]
no_utf16: bool,
#[arg(long, default_value_t = 200)]
@@ -186,11 +186,11 @@ enum Cmd {
#[arg(long)]
json: bool,
},
/// Calcula MD5, SHA-1 e SHA-256 do dispositivo ou imagem (verificação de integridade)
/// Compute MD5, SHA-1, and SHA-256 of the device or image (integrity check)
Hash { path: String },
/// Lista as sessões salvas automaticamente
/// List autosaved sessions
Sessions,
/// Abre a interface gráfica no navegador (modo local)
/// Open the web UI in the browser (local mode)
Ui {
#[arg(long, default_value_t = 0)]
port: u16,
@@ -201,72 +201,72 @@ enum Cmd {
#[derive(clap::Args, Clone)]
struct FilterArgs {
/// Categorias: image, document, video, audio, archive, database, other
/// Categories: image, document, video, audio, archive, database, other
#[arg(long, value_delimiter = ',')]
category: Vec<String>,
/// Confiança mínima: low, medium, high
/// Minimum confidence: low, medium, high
#[arg(long, default_value = "low")]
min_confidence: String,
/// Só nomes/caminhos que contenham este texto
/// Only match names/paths containing this substring
#[arg(long)]
name: Option<String>,
/// Como organizar o que for recuperado: folders (pastas originais), type, date ou flat
/// How to organize recovered files: folders (original paths), type, date, or flat
#[arg(long, default_value = "folders")]
organize: String,
}
#[derive(clap::Args, Clone)]
struct OutArgs {
/// Salva a sessão (necessária para recover/resume)
/// Save session file (required for recover/resume)
#[arg(long)]
session: Option<String>,
/// Lista os arquivos encontrados
/// List found files
#[arg(long)]
list: bool,
#[arg(long)]
json: bool,
}
/// Montagem do disco: volumes cifrados, RAID e LVM.
/// Disk assembly: encrypted volumes, RAID, and LVM.
#[derive(clap::Args, Clone, Default)]
struct AsmArgs {
/// Senha de volume cifrado (BitLocker, LUKS, FileVault 2). Prefira --ask-password ou GUARA_PASSWORD
/// Encrypted volume password (BitLocker, LUKS, FileVault 2). Prefer --ask-password or GUARA_PASSWORD
#[arg(long = "password")]
passwords: Vec<String>,
/// Pergunta a senha no terminal, sem mostrar o que é digitado
/// Prompt for the password in the terminal without echoing
#[arg(long)]
ask_password: bool,
/// Chave de recuperação numérica do BitLocker (8 grupos de 6 dígitos)
/// BitLocker numeric recovery password (8 groups of 6 digits)
#[arg(long = "recovery-key")]
recovery_keys: Vec<String>,
/// Arquivo de chave (.BEK do BitLocker ou keyfile do LUKS)
/// Key file (BitLocker .BEK or LUKS keyfile)
#[arg(long = "key-file")]
key_files: Vec<String>,
/// Chave do volume em hexadecimal (a que o Guará mostra ao abrir um volume)
/// Hex-encoded volume master key (shown by Guará when unlocking a volume)
#[arg(long = "volume-key")]
volume_keys: Vec<String>,
/// Outro disco ou imagem do mesmo conjunto (RAID/LVM). Pode repetir; "-" marca um disco ausente
/// Additional disk or image from the same set (RAID/LVM). Repeatable; "-" marks a missing disk
#[arg(long = "member")]
members: Vec<String>,
/// Os discos (alvo + --member, nesta ordem) formam um RAID sem metadados: descobre sozinho nível, faixa e layout
/// Treat disks (target + --member, in order) as a metadata-less RAID and auto-detect level, chunk size, and layout
#[arg(long)]
raid: bool,
/// Fixa o nível do RAID: 0, 5, 6, 1
/// Override RAID level: 0, 5, 6, 1
#[arg(long)]
raid_level: Option<String>,
/// Fixa o tamanho da faixa do RAID em KiB
/// Override RAID chunk size in KiB
#[arg(long)]
raid_chunk_kb: Option<u64>,
/// Fixa o layout: left-symmetric, left-asymmetric, right-symmetric, right-asymmetric
/// Override RAID parity layout: left-symmetric, left-asymmetric, right-symmetric, right-asymmetric
#[arg(long)]
raid_layout: Option<String>,
/// Ordem dos discos no RAID (índices; 0 = alvo)
/// Disk order in the RAID array (indices; 0 = target)
#[arg(long, value_delimiter = ',')]
raid_order: Vec<usize>,
/// Guarda na sessão as chaves dos volumes abertos (a senha nunca é guardada)
/// Store derived volume keys in the session file (passwords are never stored)
#[arg(long)]
remember_keys: bool,
/// Vídeo íntegro da mesma câmera/drone para refazer o índice de MP4 sem moov (pode repetir)
/// Intact reference video from the same camera/drone to rebuild headerless MP4 moov atoms (repeatable)
#[arg(long = "reference")]
references: Vec<String>,
}
@@ -343,15 +343,15 @@ impl AsmArgs {
#[derive(clap::Args)]
struct ScanArgs {
/// Dispositivo ou imagem
/// Device or image path
path: String,
/// Varredura rápida: só metadados dos sistemas de arquivos
/// Quick scan: filesystem metadata only
#[arg(long)]
quick: bool,
/// Também varre áreas ainda alocadas (mais lento)
/// Also carve currently allocated space (slower)
#[arg(long)]
include_allocated: bool,
/// Recupera tudo que casar com os filtros para esta pasta ao terminar
/// Recover all files matching the filters into this folder when finished
#[arg(long)]
recover: Option<String>,
#[command(flatten)]
@@ -684,7 +684,7 @@ fn query_from(f: &FilterArgs) -> Result<Query, String> {
"high" | "alta" => Confidence::High,
o => return Err(format!("confiança inválida: {o}")),
};
// Query aceita uma categoria; várias categorias são tratadas filtrando depois.
// Query accepts a single category; multiple categories are filtered afterwards.
Ok(Query {
category: if cats.len() == 1 { Some(cats[0]) } else { None },
min_confidence: Some(min),
@@ -756,7 +756,7 @@ fn recover_job(
filter: &FilterArgs,
) -> Result<(), String> {
let mut q = query_from(filter)?;
// Várias categorias: seleciona por ids.
// Multiple categories: select by IDs.
let cats = parse_cats(&filter.category)?;
let mut ids: Option<Vec<u64>> = None;
if cats.len() > 1 {
@@ -815,7 +815,7 @@ fn recover_job(
Ok(())
}
/// Confere o hash gravado numa imagem E01/Ex01 ou AFF4. `Some(true)` = confere.
/// Verifies the embedded hash of an E01/Ex01 or AFF4 image. `Some(true)` = matches.
fn verify_image(path: &str) -> Result<Option<bool>, String> {
if path.to_ascii_lowercase().ends_with(".aff4") {
let a = guara_core::aff4::Aff4Source::open(std::path::Path::new(path)).map_err(s)?;
@@ -869,7 +869,7 @@ fn verify_image(path: &str) -> Result<Option<bool>, String> {
}
}
/// `guara audit`: lista a trilha ou confere a cadeia de hashes.
/// `guara audit`: lists the audit trail or verifies its hash chain.
fn audit(log: Option<String>, verify: bool, tail: Option<usize>, json: bool) -> Result<(), String> {
let log = match log {
Some(p) => guara_core::audit::Log::at(p),
@@ -924,7 +924,7 @@ fn audit(log: Option<String>, verify: bool, tail: Option<usize>, json: bool) ->
Ok(())
}
/// `guara sign`: chaves, assinatura e conferência.
/// `guara sign`: key generation, signing, and verification.
fn sign_cmd(c: SignCmd) -> Result<(), String> {
use guara_core::sign;
use std::path::{Path, PathBuf};
+2 -2
View File
@@ -1,4 +1,4 @@
//! Servidor local da interface (127.0.0.1 + token): mesma UI do app Tauri.
//! Local UI server (127.0.0.1 + token): serves the same UI as the Tauri app.
use guara_core::service::Engine;
use serde_json::json;
@@ -43,7 +43,7 @@ pub fn run(port: u16, open: bool) -> Result<(), String> {
]);
for req in server.incoming_requests() {
let (eng, token, hosts) = (eng.clone(), token.clone(), hosts.clone());
// Uma thread por requisição: vídeo/áudio em streaming não pode travar a interface.
// One thread per request: streaming video/audio must not block the UI.
std::thread::spawn(move || handle(req, &eng, &token, &hosts[..]));
}
Ok(())