Skip to content
Open
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
6 changes: 5 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,11 @@ jobs:
prefix-key: v1-librtbit

- name: Configure git for private deps
run: git config --global --replace-all url."https://x-access-token:${{ secrets.GHCR_TOKEN }}@github.com/".insteadOf "https://github.com/"
env:
GHCR_TOKEN: ${{ secrets.GHCR_TOKEN }}
run: |
git config --global --replace-all url."https://x-access-token:${GHCR_TOKEN}@github.com/".insteadOf "https://github.com/"
git config --global --replace-all url."http://git:${GHCR_TOKEN}@100.92.54.45:3002/".insteadOf "http://100.92.54.45:3002/"

- name: Format check
run: cargo fmt --all -- --check
Expand Down
46 changes: 29 additions & 17 deletions Cargo.lock

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

30 changes: 30 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -135,3 +135,33 @@ all = { level = "warn", priority = -1 }

[lints.rust]
unused = "warn"

# The v0.1.0 dependency tags still reference their historical GitHub URLs.
# Map those source identities to the equivalent Forgejo tags so Cargo does not
# load duplicate copies of the same internal crates during the migration soak.
[patch."https://github.com/AusAgentSmith-org/librtbit-bencode.git"]
librtbit-bencode = { git = "http://100.92.54.45:3002/indexarr/librtbit-bencode.git", tag = "v0.1.0" }

[patch."https://github.com/AusAgentSmith-org/librtbit-buffers.git"]
librtbit-buffers = { git = "http://100.92.54.45:3002/indexarr/librtbit-buffers.git", tag = "v0.1.0" }

[patch."https://github.com/AusAgentSmith-org/librtbit-clone-to-owned.git"]
librtbit-clone-to-owned = { git = "http://100.92.54.45:3002/indexarr/librtbit-clone-to-owned.git", tag = "v0.1.0" }

[patch."https://github.com/AusAgentSmith-org/librtbit-core.git"]
librtbit-core = { git = "http://100.92.54.45:3002/indexarr/librtbit-core.git", tag = "v0.1.0" }

[patch."https://github.com/AusAgentSmith-org/librtbit-sha1-wrapper.git"]
librtbit-sha1-wrapper = { git = "http://100.92.54.45:3002/indexarr/librtbit-sha1-wrapper.git", tag = "v0.1.0" }

[patch."https://github.com/AusAgentSmith-org/librtbit-upnp.git"]
librtbit-upnp = { git = "http://100.92.54.45:3002/indexarr/librtbit-upnp.git", tag = "v0.1.0" }

[patch."https://github.com/AusAgentSmith-org/librtbit-dht.git"]
librtbit-dht = { git = "http://100.92.54.45:3002/indexarr/librtbit-dht.git", tag = "v0.1.0" }

[patch."https://github.com/AusAgentSmith-org/librtbit-lsd.git"]
librtbit-lsd = { git = "http://100.92.54.45:3002/indexarr/librtbit-lsd.git", tag = "v0.1.0" }

[patch."https://github.com/AusAgentSmith-org/librtbit-peer-protocol.git"]
librtbit-peer-protocol = { git = "http://100.92.54.45:3002/indexarr/librtbit-peer-protocol.git", tag = "v0.1.0" }
4 changes: 2 additions & 2 deletions src/http_api_client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ impl HttpApiClient {
if root.server == "rtbit" {
return Ok(());
}
anyhow::bail!("not an rtbit server at {}", &self.base_url)
anyhow::bail!("not an rtbit server at {}", self.base_url)
}
.boxed()
}
Expand All @@ -103,7 +103,7 @@ impl HttpApiClient {
..Default::default()
};
let qs = serde_urlencoded::to_string(&params).unwrap();
let url = format!("{}torrents?{}", &self.base_url, qs);
let url = format!("{}torrents?{}", self.base_url, qs);
let response = check_response(
self.client
.post(&url)
Expand Down
2 changes: 1 addition & 1 deletion src/storage/filesystem/fs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ impl TorrentStorage for FilesystemStorage {
.with_context(|| {
format!(
"error creating a new file (because allow_overwrite = false) {:?}",
&full_path
full_path
)
})?;
OpenOptions::new().read(true).write(true).open(&full_path)?
Expand Down
8 changes: 4 additions & 4 deletions src/torrent_state/live/peer_handler.rs
Original file line number Diff line number Diff line change
Expand Up @@ -538,7 +538,7 @@ impl PeerHandler {
{
anyhow::bail!(
"got request for a chunk that is not ready to upload. chunk {:?}",
&chunk_info
chunk_info
);
}

Expand Down Expand Up @@ -813,7 +813,7 @@ impl PeerHandler {
) {
Some(i) => i,
None => {
anyhow::bail!("peer sent us an invalid piece {:?}", &piece,);
anyhow::bail!("peer sent us an invalid piece {:?}", piece,);
}
};

Expand All @@ -831,8 +831,8 @@ impl PeerHandler {
if !h.inflight_requests.remove(&chunk_info) {
anyhow::bail!(
"peer sent us a piece we did not ask. Requested pieces: {:?}. Got: {:?}",
&h.inflight_requests,
&piece,
h.inflight_requests,
piece,
);
}
Ok(())
Expand Down
Loading