Skip to content

Commit 9f35b8c

Browse files
authored
Exclude images from published crate (#239)
This commit introduces an explict `include` configuration in the `Cargo.toml` file of `color-spantrace`. That has the effect that it now excludes the two example images from the source code uploaded to crates.io. The main benifits of this change are: * It reduces the size of the uploaded tar-ball from 186KB to 12KB, so an over 90% reduction in size. That will reduce the traffic produced by this crate at crates.io by over 350GB in a 90 day period based on the number of downloads listed by crates.io * It removes a hard to review binary blob from the source code. In combination with the build script such a blob might enable a future supply chain attack. By removing the blob it becomes at least harder to perform a xz-like code injection. The pictures are only used by the readme. That readme is rendered by crates.io. To keep the rendering there intact the links to the image have been replaced by linkes to the image hosted by github. This removes the need to upload these images to crates.io.
1 parent 6e9ced8 commit 9f35b8c

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

color-spantrace/Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ name = "color-spantrace"
33
version = "0.2.2"
44
description = "A pretty printer for tracing_error::SpanTrace based on color-backtrace"
55
documentation = "https://docs.rs/color-spantrace"
6+
include = ["README.md", "src/**/*.rs", "build.rs", "LICENSE-APACHE", "LICENSE-MIT"]
67

78
authors = { workspace = true }
89
edition = { workspace = true }

color-spantrace/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -88,11 +88,11 @@ This creates the following output
8888

8989
### Minimal Format
9090

91-
![minimal format](./pictures/minimal.png)
91+
![minimal format](https://raw.githubusercontent.com/eyre-rs/eyre/refs/heads/master/color-spantrace/pictures/minimal.png)
9292

9393
### Full Format
9494

95-
![Full format](./pictures/full.png)
95+
![Full format](https://raw.githubusercontent.com/eyre-rs/eyre/refs/heads/master/color-spantrace/pictures/full.png)
9696

9797
#### License
9898

0 commit comments

Comments
 (0)