Constellation, Spacedust, Slingshot, UFOs: atproto crates and services for microcosm

Merge pull request #3 from at-ucosm/store-rkey-with-likers

Data model: store rkey with dids

+218 -5
Cargo.lock
···
]
[[package]]
+
name = "android-tzdata"
+
version = "0.1.1"
+
source = "registry+https://github.com/rust-lang/crates.io-index"
+
checksum = "e999941b234f3131b00bc13c22d06e8c5ff726d1b6318ac7eb276997bbb4fef0"
+
+
[[package]]
+
name = "android_system_properties"
+
version = "0.1.5"
+
source = "registry+https://github.com/rust-lang/crates.io-index"
+
checksum = "819e7219dbd41043ac279b19830f2efc897156490d7fd6ea916720117ee66311"
+
dependencies = [
+
"libc",
+
]
+
+
[[package]]
name = "anstream"
version = "0.6.18"
source = "registry+https://github.com/rust-lang/crates.io-index"
···
checksum = "613afe47fcd5fac7ccf1db93babcb082c5994d996f20b8b159f2ad1658eb5724"
[[package]]
+
name = "chrono"
+
version = "0.4.39"
+
source = "registry+https://github.com/rust-lang/crates.io-index"
+
checksum = "7e36cc9d416881d2e24f9a963be5fb1cd90966419ac844274161d10488b3e825"
+
dependencies = [
+
"android-tzdata",
+
"iana-time-zone",
+
"num-traits",
+
"serde",
+
"windows-targets",
+
]
+
+
[[package]]
name = "clang-sys"
version = "1.8.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
···
]
[[package]]
+
name = "darling"
+
version = "0.20.10"
+
source = "registry+https://github.com/rust-lang/crates.io-index"
+
checksum = "6f63b86c8a8826a49b8c21f08a2d07338eec8d900540f8630dc76284be802989"
+
dependencies = [
+
"darling_core",
+
"darling_macro",
+
]
+
+
[[package]]
+
name = "darling_core"
+
version = "0.20.10"
+
source = "registry+https://github.com/rust-lang/crates.io-index"
+
checksum = "95133861a8032aaea082871032f5815eb9e98cef03fa916ab4500513994df9e5"
+
dependencies = [
+
"fnv",
+
"ident_case",
+
"proc-macro2",
+
"quote",
+
"strsim",
+
"syn",
+
]
+
+
[[package]]
+
name = "darling_macro"
+
version = "0.20.10"
+
source = "registry+https://github.com/rust-lang/crates.io-index"
+
checksum = "d336a2a514f6ccccaa3e09b02d41d35330c07ddf03a62165fcec10bb561c7806"
+
dependencies = [
+
"darling_core",
+
"quote",
+
"syn",
+
]
+
+
[[package]]
name = "data-encoding"
version = "2.7.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "0e60eed09d8c01d3cee5b7d30acb059b76614c918fa0f992e0dd6eeb10daad6f"
+
+
[[package]]
+
name = "deranged"
+
version = "0.3.11"
+
source = "registry+https://github.com/rust-lang/crates.io-index"
+
checksum = "b42b6fa04a440b495c8b04d0e71b707c585f83cb9cb28cf8cd0d976c315e31b4"
+
dependencies = [
+
"powerfmt",
+
"serde",
+
]
[[package]]
name = "digest"
···
"futures-core",
"futures-sink",
"http",
-
"indexmap",
+
"indexmap 2.7.1",
"slab",
"tokio",
"tokio-util",
"tracing",
]
+
+
[[package]]
+
name = "hashbrown"
+
version = "0.12.3"
+
source = "registry+https://github.com/rust-lang/crates.io-index"
+
checksum = "8a9ee70c43aaf417c914396645a0fa852624801b24ebb7ae78fe8272889ac888"
[[package]]
name = "hashbrown"
···
]
[[package]]
+
name = "iana-time-zone"
+
version = "0.1.61"
+
source = "registry+https://github.com/rust-lang/crates.io-index"
+
checksum = "235e081f3925a06703c2d0117ea8b91f042756fd6e7a6e5d901e8ca1a996b220"
+
dependencies = [
+
"android_system_properties",
+
"core-foundation-sys",
+
"iana-time-zone-haiku",
+
"js-sys",
+
"wasm-bindgen",
+
"windows-core 0.52.0",
+
]
+
+
[[package]]
+
name = "iana-time-zone-haiku"
+
version = "0.1.2"
+
source = "registry+https://github.com/rust-lang/crates.io-index"
+
checksum = "f31827a206f56af32e590ba56d5d2d085f558508192593743f16b2306495269f"
+
dependencies = [
+
"cc",
+
]
+
+
[[package]]
+
name = "ident_case"
+
version = "1.0.1"
+
source = "registry+https://github.com/rust-lang/crates.io-index"
+
checksum = "b9e0384b61958566e926dc50660321d12159025e767c18e043daf26b70104c39"
+
+
[[package]]
+
name = "indexmap"
+
version = "1.9.3"
+
source = "registry+https://github.com/rust-lang/crates.io-index"
+
checksum = "bd070e393353796e801d209ad339e89596eb4c8d430d18ede6a1cced8fafbd99"
+
dependencies = [
+
"autocfg",
+
"hashbrown 0.12.3",
+
"serde",
+
]
+
+
[[package]]
name = "indexmap"
version = "2.7.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "8c9c992b02b5b4c94ea26e32fe5bccb7aa7d9f390ab5c1221ff895bc7ea8b652"
dependencies = [
"equivalent",
-
"hashbrown",
+
"hashbrown 0.15.2",
+
"serde",
]
[[package]]
···
"metrics-process",
"rocksdb",
"serde",
+
"serde_with",
"tempfile",
"tinyjson",
"tokio",
···
"http-body-util",
"hyper",
"hyper-util",
-
"indexmap",
+
"indexmap 2.7.1",
"ipnet",
"metrics",
"metrics-util",
···
dependencies = [
"crossbeam-epoch",
"crossbeam-utils",
-
"hashbrown",
+
"hashbrown 0.15.2",
"metrics",
"quanta",
"rand",
···
[[package]]
+
name = "num-conv"
+
version = "0.1.0"
+
source = "registry+https://github.com/rust-lang/crates.io-index"
+
checksum = "51d515d32fb182ee37cda2ccdcb92950d6a3c2893aa280e540671c2cd0f3b1d9"
+
+
[[package]]
+
name = "num-traits"
+
version = "0.2.19"
+
source = "registry+https://github.com/rust-lang/crates.io-index"
+
checksum = "071dfc062690e90b734c0b2273ce72ad0ffa95f0c74596bc250dcfd960262841"
+
dependencies = [
+
"autocfg",
+
]
+
+
[[package]]
name = "object"
version = "0.36.7"
source = "registry+https://github.com/rust-lang/crates.io-index"
···
version = "1.10.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "280dc24453071f1b63954171985a0b0d30058d287960968b9b2aca264c8d4ee6"
+
+
[[package]]
+
name = "powerfmt"
+
version = "0.2.0"
+
source = "registry+https://github.com/rust-lang/crates.io-index"
+
checksum = "439ee305def115ba05938db6eb1644ff94165c5ab5e9420d1c1bcedbba909391"
[[package]]
name = "ppv-lite86"
···
[[package]]
+
name = "serde_with"
+
version = "3.12.0"
+
source = "registry+https://github.com/rust-lang/crates.io-index"
+
checksum = "d6b6f7f2fcb69f747921f79f3926bd1e203fce4fef62c268dd3abfb6d86029aa"
+
dependencies = [
+
"base64",
+
"chrono",
+
"hex",
+
"indexmap 1.9.3",
+
"indexmap 2.7.1",
+
"serde",
+
"serde_derive",
+
"serde_json",
+
"serde_with_macros",
+
"time",
+
]
+
+
[[package]]
+
name = "serde_with_macros"
+
version = "3.12.0"
+
source = "registry+https://github.com/rust-lang/crates.io-index"
+
checksum = "8d00caa5193a3c8362ac2b73be6b9e768aa5a4b2f721d8f4b339600c3cb51f8e"
+
dependencies = [
+
"darling",
+
"proc-macro2",
+
"quote",
+
"syn",
+
]
+
+
[[package]]
name = "sha1"
version = "0.10.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
···
[[package]]
+
name = "time"
+
version = "0.3.37"
+
source = "registry+https://github.com/rust-lang/crates.io-index"
+
checksum = "35e7868883861bd0e56d9ac6efcaaca0d6d5d82a2a7ec8209ff492c07cf37b21"
+
dependencies = [
+
"deranged",
+
"itoa",
+
"num-conv",
+
"powerfmt",
+
"serde",
+
"time-core",
+
"time-macros",
+
]
+
+
[[package]]
+
name = "time-core"
+
version = "0.1.2"
+
source = "registry+https://github.com/rust-lang/crates.io-index"
+
checksum = "ef927ca75afb808a4d64dd374f00a2adf8d0fcff8e7b184af886c3c87ec4a3f3"
+
+
[[package]]
+
name = "time-macros"
+
version = "0.2.19"
+
source = "registry+https://github.com/rust-lang/crates.io-index"
+
checksum = "2834e6017e3e5e4b9834939793b282bc03b37a3336245fa820e35e233e2a85de"
+
dependencies = [
+
"num-conv",
+
"time-core",
+
]
+
+
[[package]]
name = "tinyjson"
version = "2.5.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
···
dependencies = [
"cfg-if",
"once_cell",
+
"rustversion",
"wasm-bindgen-macro",
···
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "dd04d41d93c4992d421894c18c8b43496aa748dd4c081bac0dc93eb0489272b6"
dependencies = [
-
"windows-core",
+
"windows-core 0.58.0",
+
"windows-targets",
+
]
+
+
[[package]]
+
name = "windows-core"
+
version = "0.52.0"
+
source = "registry+https://github.com/rust-lang/crates.io-index"
+
checksum = "33ab640c8d7e35bf8ba19b884ba838ceb4fba93a4e8c65a9059d08afcfc683d9"
+
dependencies = [
"windows-targets",
+19 -2
cozy-setup (move to another repo).md
···
match {
expression {header.User-Agent}.startsWith("Mozilla/5.0")
}
-
events 2
-
window 15s
+
events 1000
+
window 30s
log_key true
}
}
···
cache
}
```
+
well... the gateway fell over IMMEDIATELY with like 2 req/sec from deletions, with that ^^ config. for now i removed everything except the reverse proxy config + normal caddy metrics and it's running fine on vanilla caddy. i did try reducing the rate-limiting configs to a single, fixed-key global limit but it still ate all the ram and died. maybe badger w/ the cache config was still a problem. maybe it would have been ok on a machine with more than 1GB mem.
+
+
+
alternative proxies:
+
+
- nginx. i should probably just use this. acme-client is a piece of cake to set up, and i know how to configure it.
+
- haproxy. also kind of familiar, it's old and stable. no idea how it handle low-mem (our 1gb) vs nginx.
+
- sozu. popular rust thing, fast. doesn't have rate-limiting or cache feature?
+
- rpxy. like caddy (auto-tls) but in rust and actually fast? has an "experimental" cache feature. but the cache feature looks good.
+
- rama. build-your-own proxy. not sure that it has both cache and limiter in their standard features?
+
- pingora. build-your-own cloudflare, so like, probably stable. has tools for cache and limiting. low-mem...?
+
- cache stuff in pingora seems a little... hit and miss (byeeeee). only a test impl for Storage for the main cache feature?
+
- but the rate-limiter has a guide: https://github.com/cloudflare/pingora/blob/main/docs/user_guide/rate_limiter.md
+
+
what i want is low-resource reverse proxy with built-in rate-limiting and caching. but maybe cache (and/or ratelimiting) could be external to the reverse proxy
+
- varnish is a dedicated cache. has https://github.com/varnish/varnish-modules/blob/master/src/vmod_vsthrottle.vcc
+
- apache traffic control has experimental rate-limiting plugins
- victoriametrics