Pre-0.1 cleanup: fmt, docs, licenses, AUR-ready packaging
ci / quality (push) Failing after 6s

- cargo fmt across the workspace (the CI gate the last push tripped).
- varde-daemon: drop the now-unused bytes dependency.
- varde-ctl(1): document push; gc reflects the continuous-sweep
  reality; subscribe mentions push events.
- config.toml example: gc_interval_secs, and an honest note that
  max_download_bytes_per_sec is currently unenforced.
- LICENSE-MIT + LICENSE-APACHE at the root (the declared license now
  ships as files), bundled into release tarballs and installed by the
  PKGBUILD.
- PKGBUILD: real maintainer, AUR pre-flight note (updpkgsums), license
  installation.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
2026-08-16 15:04:22 +02:00
parent c52c3b1238
commit 5d29bdc4bd
12 changed files with 272 additions and 25 deletions
-1
View File
@@ -22,7 +22,6 @@ iroh-mdns-address-lookup = "0.4"
# dependency tree via iroh-blobs.
n0-future = "0.1"
irpc = "0.17"
bytes = "1"
# Feature-gated D-Bus client for NetworkManager metered status.
zbus = { version = "5", optional = true, default-features = false, features = ["tokio"] }
# Announcement signatures use iroh's own key types; postcard is the
+6 -2
View File
@@ -382,7 +382,12 @@ impl Daemon {
.present_trusted_peers()
.into_iter()
.filter(|p| p.connected)
.filter_map(|p| p.node_id.parse::<iroh::EndpointId>().ok().map(iroh::EndpointAddr::from))
.filter_map(|p| {
p.node_id
.parse::<iroh::EndpointId>()
.ok()
.map(iroh::EndpointAddr::from)
})
.collect();
if !present.is_empty() {
self.transfer.spawn_fetch(
@@ -568,7 +573,6 @@ impl Daemon {
Request::Subscribe {} => Ok(ResponseData::Done {}),
}
}
}
fn blob_format(format: StoredFormat) -> BlobFormat {
+3 -6
View File
@@ -160,9 +160,8 @@ pub fn provider_events(gate: Gate) -> EventSender {
conns.remove(&m.inner.connection_id);
}
ProviderMessage::GetRequestReceived(m) => {
let allowed = allow(&gate, &conns, m.inner.connection_id, [
m.inner.request.hash,
]);
let allowed =
allow(&gate, &conns, m.inner.connection_id, [m.inner.request.hash]);
let verdict = if allowed {
Ok(())
} else {
@@ -200,9 +199,7 @@ pub fn provider_events(gate: Gate) -> EventSender {
.map(|i| i.trusted)
.unwrap_or(false);
let allowed = trusted
|| allow(&gate, &conns, m.inner.connection_id, [
m.inner.request.hash,
]);
|| allow(&gate, &conns, m.inner.connection_id, [m.inner.request.hash]);
let verdict = if allowed {
Ok(())
} else {
+13 -6
View File
@@ -197,10 +197,7 @@ impl BlobStore {
Ok((root, total, StoredFormat::HashSeq))
}
async fn import_one(
&self,
path: PathBuf,
) -> Result<(iroh_blobs::api::TempTag, u64), OpError> {
async fn import_one(&self, path: PathBuf) -> Result<(iroh_blobs::api::TempTag, u64), OpError> {
let tag = self
.store
.add_path_with_opts(AddPathOptions {
@@ -211,7 +208,13 @@ impl BlobStore {
.temp_tag()
.await
.map_err(internal)?;
let size = match self.store.blobs().status(tag.hash()).await.map_err(internal)? {
let size = match self
.store
.blobs()
.status(tag.hash())
.await
.map_err(internal)?
{
BlobStatus::Complete { size } => size,
_ => {
return Err(OpError::Internal(anyhow::anyhow!(
@@ -335,7 +338,11 @@ impl BlobStore {
// report the bytes actually present and verified.
let bitfield = self.store.blobs().observe(hash).await.map_err(internal)?;
let total = bitfield.validated_size().or(size);
Ok((bitfield.total_bytes().min(total.unwrap_or(u64::MAX)), total, false))
Ok((
bitfield.total_bytes().min(total.unwrap_or(u64::MAX)),
total,
false,
))
}
BlobStatus::Complete { size } => Ok((size, Some(size), true)),
}
+1 -2
View File
@@ -125,8 +125,7 @@ fn gc_drops_unpinned_and_keeps_pinned() {
// Since iroh-blobs 0.103 gc is a periodic loop inside the store, not
// an on-demand request; run it fast so the sweep happens in-test.
let daemon_dir = tempfile::tempdir().unwrap();
let daemon =
support::spawn_daemon_with_env(daemon_dir.path(), &[("VARDE_GC_INTERVAL", "1")]);
let daemon = support::spawn_daemon_with_env(daemon_dir.path(), &[("VARDE_GC_INTERVAL", "1")]);
let mut client = support::Client::connect(&daemon.socket);
let dir = tempfile::tempdir().unwrap();