chadtmiller.com/knotless
git that lives in your Atmosphere account
1
10
knotless-serve: repositories are read by the atproto crate's readers
crates/knotless-serve/src/archive.rs+216−569
785 lines changed: not loaded until asked for.
crates/knotless-serve/Cargo.toml+1−1
| @@ -73,6 +73,6 @@ tree-sitter-language = "0.1.7" | ||
| ||
[dev-dependencies] | ||
futures.workspace = true | ||
reqwest = { workspace = true, features = ["blocking"] } | ||
reqwest = { workspace = true, features = ["blocking", "stream"] } | ||
flate2.workspace = true | ||
tempfile.workspace = true | ||
docs/design/serve.md+6−3
| @@ -662,9 +662,12 @@ not have the repository, leaves the read to the account's PDS, as one CAR | ||
(`com.atproto.sync.getRepo`), held whole to walk its tree. A mirror that asks to | ||
be asked less fails the read, for a later backfill to try again. | ||
| ||
Nothing read is believed until it checks out: the commit must be the account's | ||
and signed by the key its DID document names, and the records must be the ones | ||
its MST holds, block by block for a CAR, or as the rebuilt root for STAR-lite. | ||
Nothing read is believed until it checks out, by the `atproto` crate's readers | ||
(`star_lite::Reader`, `car::read`, `mst::Tree::read`), as grain and group-host | ||
read one: the commit must be a version 3 commit, the account's, and signed by | ||
the key its DID document names, and the records must be the ones its MST holds, | ||
in the one tree their keys make, read from the CAR's blocks or rebuilt from | ||
STAR-lite's keys. Every block is DRISL as atproto has it, map keys in order. | ||
Only the indexed collections' records are kept. An account is first asked for | ||
its latest commit (`com.atproto.sync.getLatestCommit`), and one whose commit is | ||
the one last read is passed over, so a sweep reads only the accounts that | ||
Cargo.lock+17−2
| @@ -140,9 +140,9 @@ checksum = "1505bd5d3d116872e7271a6d4e16d81d0c8570876c8de68093a09ac269d8aac0" | ||
| ||
[[package]] | ||
name = "atproto" | ||
version = "0.2.0" | ||
version = "0.2.2" | ||
source = "sparse+https://knotless.dev/cargo/did:plc:bcgltzqazw5tb6k2g3ttenbj/3mzr5vldibtui/" | ||
checksum = "1e2e64b879335e9885d684bd1f93acd1d28acefa4e498daf6b3249a6e20d396f" | ||
checksum = "8795ce2e4481daea735af125c1304ff5d180ecefd4318790ea8bbf13d50e47c8" | ||
dependencies = [ | ||
"base64 0.22.1", | ||
"blake3", | ||
| @@ -3153,12 +3153,14 @@ dependencies = [ | ||
"sync_wrapper", | ||
"tokio", | ||
"tokio-rustls", | ||
"tokio-util", | ||
"tower", | ||
"tower-http 0.6.11", | ||
"tower-service", | ||
"url", | ||
"wasm-bindgen", | ||
"wasm-bindgen-futures", | ||
"wasm-streams", | ||
"web-sys", | ||
"webpki-roots 1.0.10", | ||
] | ||
| @@ -4641,6 +4643,19 @@ dependencies = [ | ||
"unicode-ident", | ||
] | ||
| ||
[[package]] | ||
name = "wasm-streams" | ||
version = "0.4.2" | ||
source = "registry+https://github.com/rust-lang/crates.io-index" | ||
checksum = "15053d8d85c7eccdbefef60f06769760a563c7f0a9d6902a13d35c7800b0ad65" | ||
dependencies = [ | ||
"futures-util", | ||
"js-sys", | ||
"wasm-bindgen", | ||
"wasm-bindgen-futures", | ||
"web-sys", | ||
] | ||
| ||
[[package]] | ||
name = "web-sys" | ||
version = "0.3.106" | ||
Cargo.toml+1−1
| @@ -17,7 +17,7 @@ unused_workspace_dependencies = "deny" | ||
[workspace.dependencies] | ||
knotless = { path = "crates/knotless" } | ||
# atproto's primitives, from their own repository's registry (.cargo/config.toml). | ||
atproto = { version = "0.2.0", registry = "atproto" } | ||
atproto = { version = "0.2.2", registry = "atproto" } | ||
anyhow = "1" | ||
base64 = "0.22" | ||
futures = "0.3" | ||