garage44.eu/jeroen/cartopolis

logclone: git clone https://garage44.eu/jeroen/cartopolis.git

.. /crates/simulator/Cargo.toml

raw

[package]
name = "cartopolis_simulator"
version.workspace = true
edition.workspace = true
# The workspace declares `MIT OR Apache-2.0`; a crate only inherits it by asking.
license.workspace = true

[lib]
name = "cartopolis_simulator"
path = "src/lib.rs"
# There is not one runnable doc fence in this crate — the only fenced block is
# the ```lua sample in `scripting`'s module docs — but `cargo test` cannot know
# that without running rustdoc over the crate to look, which it does on every
# invocation of the suite. `cartopolis` and `cartopolis_geo` already collect
# none, for a harder reason of their own (rustdoc is not given
# `.cargo/config.toml`'s rustflags). Turn this back on in the same commit as the
# first example worth executing.
doctest = false

# The *binary* keeps the short name: it is what a user runs, and unlike the
# package name it never appears in a dependency graph or a `-p` flag.
[[bin]]
name = "simulator"
path = "src/main.rs"
# No tests in the binary — it parses the config and calls into the lib, which is
# where the suite lives. Same reason as the client's shim: an enabled harness
# costs a full link per `cargo test` to run zero tests.
test = false

[dependencies]
anyhow.workspace = true
argon2.workspace = true
# Session-token hashing (`auth::token_hash`). Already in the tree — argon2's own
# digest — so naming it costs the build nothing new.
blake2 = "0.10"
axum.workspace = true
bytes.workspace = true
clap.workspace = true
futures-util = { workspace = true, features = ["sink", "async-await"] }
figment = { workspace = true, features = ["toml", "env"] }
# Outbound mail (account verification). `native-tls` is out of the default set
# deliberately: it means OpenSSL, and this workspace is rustls everywhere for the
# reason the client's dependency note gives. `tokio1-rustls-tls` selects rustls +
# ring + webpki-roots, all three of which are already in the tree.
lettre = { version = "0.11", default-features = false, features = [
    "builder",
    "hostname",
    "pool",
    "smtp-transport",
    "tokio1",
    "tokio1-rustls-tls",
] }
# Only to install the process-wide `CryptoProvider` rustls 0.23 refuses to pick
# for itself. Without it the first TLS connection to the mail relay panics —
# compiles perfectly, dies when somebody registers.
rustls.workspace = true
glam.workspace = true
# Physical prims (`physics.rs`, docs/notes/physical-prims.md). Pure Rust, so it
# adds no C toolchain to any lane. The simulator is the one authority over
# where a physical prim is; the client links it too, but only for the ambient
# traffic it invents itself (`systems::traffic_physics`), never for prims.
# `simd8`: the contact solver works on eight constraints at once (the `wide`
# crate, stable Rust). It costs only cross-platform bit-determinism, which a
# server-authoritative step does not need.
rapier3d.workspace = true
# Parsing an uploaded model, to count what is in it before it is stored
# (`assets::inspect`). Already in the tree — `bevy_gltf` builds it for the client
# — so naming it here costs the dependency graph nothing new.
gltf.workspace = true
# Decoding the data URIs in a self-contained `.gltf` so it can be repacked into a
# `.glb` (`assets::repack_gltf`). Already in the tree several times over — every
# HTTP and TLS crate here pulls one — so this is a name, not a new dependency.
base64.workspace = true
# Reading a texture's dimensions out of its header, which is the only way to tell
# a small file from a small *image*: a decompression bomb is tiny on disk.
image.workspace = true
refinery = { workspace = true }
rusqlite.workspace = true
serde.workspace = true
# Avatar looks are kept as postcard bytes (`looks.rs`), as the wire carries them.
postcard.workspace = true
serde_json.workspace = true
thiserror.workspace = true
tokio.workspace = true
tokio-util.workspace = true
tracing.workspace = true
tracing-subscriber.workspace = true
uuid.workspace = true
# Address lookups for house claims (`houses`), against PDOK's two keyless
# services. Blocking, and called from `spawn_blocking`: it is what the rest of
# this workspace already fetches with, and an async client for two requests would
# put a second TLS stack in the tree to save two threads.
ureq.workspace = true
# Unpacking the monthly country table (`stats::countries`), which is published
# gzipped. Already in the tree: it is what `ureq`'s `gzip` feature decodes with.
flate2.workspace = true
cartopolis_core = { path = "../core" }
# The call forwarder (`calls`). Only the `sfu` half: sealing and opening media
# is the `client` feature, which this crate must not link outside its tests,
# for the reason `cartopolis_e2ee` stays out of it.
cartopolis_calls = { path = "../calls", features = ["sfu"] }
# The video store's upload check (`videos::inspect`): reads a WebM's tracks
# and frame timestamps, never decodes a picture. Pure Rust, no dependencies.
matroska-demuxer.workspace = true
# Signing pushes to browsers (`vapid`, RFC 8292: ES256 over P-256). Both are
# already in the tree — `openmls_rust_crypto` builds p256 with ecdsa, and
# getrandom 0.2 is under half the crypto here — so these are names, not new
# dependencies.
p256 = { version = "0.13", default-features = false, features = ["ecdsa", "ecdh", "std"] }
getrandom = "0.2"
# Encrypting the one word a browser's push carries (`push::seal`, RFC 8291:
# ECDH, HKDF-SHA-256, AES-128-GCM). Both already in the tree, at these versions,
# under the MLS crypto and the calls.
hkdf = "0.12"
aes-gcm = { version = "0.10", default-features = false, features = ["aes", "alloc"] }
# Signing and checking ActivityPub requests (`fediverse::signing`): RSA with
# SHA-256 is the one key type every fediverse server verifies. Pure Rust, so no
# OpenSSL, which this workspace avoids everywhere (see `rustls` above); the
# timing advisory against `rsa` is discussed in `signing`'s module note. The
# pkcs8, spki and sha2 0.10 it builds on are already in the tree.
rsa = { version = "0.9", features = ["getrandom"] }
sha2 = { workspace = true, features = ["oid"] }
# Sealing the client secrets Discord, Google and the rest issue before they are
# stored (`signin::keys`). Already in the tree (the MLS crypto's), so a name,
# not a new dependency.
chacha20poly1305 = { version = "0.10", default-features = false, features = ["alloc"] }
# The `Date` header a signature covers. Already in the tree (hyper's).
httpdate = "1"
# Parsing the URLs other servers name, for the request guard
# (`fediverse::fetch`). Already in the tree (ureq's).
url.workspace = true
# Passing atlas's paths through when this listener stands in front of it
# (`atlas_proxy`). Already in the tree (axum's); the client half is a feature.
hyper-util = { version = "0.1", features = ["client-legacy", "http1", "tokio"] }
# The web UI and the map-data tree, when this listener is a whole site
# (`static_files`): directory serving with the `.br`/`.gz` copies atlas writes.
tower-http = { version = "0.6", features = ["fs"] }
# `oneshot`, to hand a path that is not a content page on to the files
# (`static_files`). Already in the tree, axum's.
tower = { version = "0.5", features = ["util"] }

[dev-dependencies]
tempfile.workspace = true
# A WebSocket *client*, for the test that proves the browser carrier reaches the
# same handshake the TCP one does. Test-only: the server half is axum's.
tokio-tungstenite.workspace = true
# Real encrypting clients for the private-chat suite, so it proves the server
# relays what MLS devices actually produce. Test-only, and it must stay that
# way: the server binary does not link the code that could open a message.
cartopolis_e2ee = { path = "../e2ee" }
# And real calling devices for the calls suite, for the same reason.
cartopolis_calls = { path = "../calls", features = ["sfu", "client"] }

[lints]
workspace = true