Skip to main content

Crate adler_server

Crate adler_server 

Source
Expand description

HTTP server for the Adler OSINT username-search engine.

This crate hosts the JSON API and embedded SolidJS web UI for Adler. It is a thin shell around adler_core: scans run through the same adler_core::executor the CLI uses, and the same adler_core::Client is shared across all in-process scans.

§Quick start

use std::net::SocketAddr;
use adler_core::{Client, Registry};
use adler_server::{AppConfig, serve};

let registry = Registry::default_embedded()?;
// Use the caller's filtering rules — the CLI already exposes
// --only/--tag/--exclude, so the server just runs whatever site
// list it's handed.
let filter = adler_core::SiteFilter::default();
let sites = registry.filter_with(&filter);
let catalog = registry.matches_with(&filter);
let client = Client::builder().build()?;
let config = AppConfig {
    bind: "127.0.0.1:8765".parse::<SocketAddr>()?,
    scan_capacity: 32,
    scans_dir: None, // or Some(adler_server::default_scans_dir())
};
serve(sites, catalog, client, config).await?;

§Routes

RouteMethodPurpose
/api/healthGETliveness
/api/sitesGETsite catalogue
/api/scanPOSTstart a scan, returns a scan_id
/api/scan/{id}GETpoll status / final aggregate
/api/scan/{id}/reportGETinvestigation report export
/api/scan/{id}/streamGETServer-Sent Events
/api/scan/{id}/retryPOSTretry one site in a scan
/api/scan/{id}/refilterPOSTcancel and restart with new filters
/api/scansGETrecent scan history
/api/accessGETread-only access-engine summary
/GETembedded SolidJS SPA

§Threading and shutdown

serve binds the TCP listener, installs a SIGINT / SIGTERM graceful-shutdown signal, and runs until the listener closes. All state (registry, client, in-flight scans) lives in an AppState cloned into each handler — no global mutables.

Structs§

AppConfig
Server configuration.
AppState
State shared across all axum handlers.
EvidenceChange
Profile evidence transition for one still-found site.
FinishedScan
Aggregate published once a scan finishes.
PersistedScan
Self-contained snapshot of a completed scan. Round-trips losslessly through JSON; tests assert that.
ScanDiff
Deterministic scan-to-scan diff used as the basis for timelines and watchlists.
ScanHandle
Live state of one scan.
ScanId
Identifier for a running or finished scan.
ScanTimeline
Historical view derived from a sequence of persisted scans.
Summary
Verdict counts for a finished scan.
TimelineEvent
One lifecycle event for a profile across scans.
TimelineProfile
Per-site lifecycle state in a scan timeline.
VerdictChange
A verdict transition for one site.

Enums§

Error
Errors surfaced by the public serve entry point.
TimelineEventKind
Timeline event category.

Functions§

apply_historical_confidence_overlay
Apply a non-persisted confidence overlay from previous scans of the same username.
build_investigation_report
Build a history-aware investigation report from a scan artifact.
build_scan_timeline
Build a chronological timeline from persisted scans.
default_scans_dir
Default directory for persisted scans.
diff_scans
Compare two persisted scans.
router
Build the axum router. Public so test harnesses can drive it directly without going through crate::serve.
serve
Run the server until the listener closes or a shutdown signal arrives.

Type Aliases§

Result
Result<T, Error> alias used throughout the crate.