APIs for links and references in the ATmosphere

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

Data model: store rkey with dids

authored by bad-example.com and committed by

GitHub 1f6474ec 21c561b8

+1048 -112
+218 -5
Cargo.lock
··· 39 39 ] 40 40 41 41 [[package]] 42 + name = "android-tzdata" 43 + version = "0.1.1" 44 + source = "registry+https://github.com/rust-lang/crates.io-index" 45 + checksum = "e999941b234f3131b00bc13c22d06e8c5ff726d1b6318ac7eb276997bbb4fef0" 46 + 47 + [[package]] 48 + name = "android_system_properties" 49 + version = "0.1.5" 50 + source = "registry+https://github.com/rust-lang/crates.io-index" 51 + checksum = "819e7219dbd41043ac279b19830f2efc897156490d7fd6ea916720117ee66311" 52 + dependencies = [ 53 + "libc", 54 + ] 55 + 56 + [[package]] 42 57 name = "anstream" 43 58 version = "0.6.18" 44 59 source = "registry+https://github.com/rust-lang/crates.io-index" ··· 326 341 checksum = "613afe47fcd5fac7ccf1db93babcb082c5994d996f20b8b159f2ad1658eb5724" 327 342 328 343 [[package]] 344 + name = "chrono" 345 + version = "0.4.39" 346 + source = "registry+https://github.com/rust-lang/crates.io-index" 347 + checksum = "7e36cc9d416881d2e24f9a963be5fb1cd90966419ac844274161d10488b3e825" 348 + dependencies = [ 349 + "android-tzdata", 350 + "iana-time-zone", 351 + "num-traits", 352 + "serde", 353 + "windows-targets", 354 + ] 355 + 356 + [[package]] 329 357 name = "clang-sys" 330 358 version = "1.8.1" 331 359 source = "registry+https://github.com/rust-lang/crates.io-index" ··· 443 471 ] 444 472 445 473 [[package]] 474 + name = "darling" 475 + version = "0.20.10" 476 + source = "registry+https://github.com/rust-lang/crates.io-index" 477 + checksum = "6f63b86c8a8826a49b8c21f08a2d07338eec8d900540f8630dc76284be802989" 478 + dependencies = [ 479 + "darling_core", 480 + "darling_macro", 481 + ] 482 + 483 + [[package]] 484 + name = "darling_core" 485 + version = "0.20.10" 486 + source = "registry+https://github.com/rust-lang/crates.io-index" 487 + checksum = "95133861a8032aaea082871032f5815eb9e98cef03fa916ab4500513994df9e5" 488 + dependencies = [ 489 + "fnv", 490 + "ident_case", 491 + "proc-macro2", 492 + "quote", 493 + "strsim", 494 + "syn", 495 + ] 496 + 497 + [[package]] 498 + name = "darling_macro" 499 + version = "0.20.10" 500 + source = "registry+https://github.com/rust-lang/crates.io-index" 501 + checksum = "d336a2a514f6ccccaa3e09b02d41d35330c07ddf03a62165fcec10bb561c7806" 502 + dependencies = [ 503 + "darling_core", 504 + "quote", 505 + "syn", 506 + ] 507 + 508 + [[package]] 446 509 name = "data-encoding" 447 510 version = "2.7.0" 448 511 source = "registry+https://github.com/rust-lang/crates.io-index" 449 512 checksum = "0e60eed09d8c01d3cee5b7d30acb059b76614c918fa0f992e0dd6eeb10daad6f" 513 + 514 + [[package]] 515 + name = "deranged" 516 + version = "0.3.11" 517 + source = "registry+https://github.com/rust-lang/crates.io-index" 518 + checksum = "b42b6fa04a440b495c8b04d0e71b707c585f83cb9cb28cf8cd0d976c315e31b4" 519 + dependencies = [ 520 + "powerfmt", 521 + "serde", 522 + ] 450 523 451 524 [[package]] 452 525 name = "digest" ··· 635 708 "futures-core", 636 709 "futures-sink", 637 710 "http", 638 - "indexmap", 711 + "indexmap 2.7.1", 639 712 "slab", 640 713 "tokio", 641 714 "tokio-util", 642 715 "tracing", 643 716 ] 717 + 718 + [[package]] 719 + name = "hashbrown" 720 + version = "0.12.3" 721 + source = "registry+https://github.com/rust-lang/crates.io-index" 722 + checksum = "8a9ee70c43aaf417c914396645a0fa852624801b24ebb7ae78fe8272889ac888" 644 723 645 724 [[package]] 646 725 name = "hashbrown" ··· 750 829 ] 751 830 752 831 [[package]] 832 + name = "iana-time-zone" 833 + version = "0.1.61" 834 + source = "registry+https://github.com/rust-lang/crates.io-index" 835 + checksum = "235e081f3925a06703c2d0117ea8b91f042756fd6e7a6e5d901e8ca1a996b220" 836 + dependencies = [ 837 + "android_system_properties", 838 + "core-foundation-sys", 839 + "iana-time-zone-haiku", 840 + "js-sys", 841 + "wasm-bindgen", 842 + "windows-core 0.52.0", 843 + ] 844 + 845 + [[package]] 846 + name = "iana-time-zone-haiku" 847 + version = "0.1.2" 848 + source = "registry+https://github.com/rust-lang/crates.io-index" 849 + checksum = "f31827a206f56af32e590ba56d5d2d085f558508192593743f16b2306495269f" 850 + dependencies = [ 851 + "cc", 852 + ] 853 + 854 + [[package]] 855 + name = "ident_case" 856 + version = "1.0.1" 857 + source = "registry+https://github.com/rust-lang/crates.io-index" 858 + checksum = "b9e0384b61958566e926dc50660321d12159025e767c18e043daf26b70104c39" 859 + 860 + [[package]] 861 + name = "indexmap" 862 + version = "1.9.3" 863 + source = "registry+https://github.com/rust-lang/crates.io-index" 864 + checksum = "bd070e393353796e801d209ad339e89596eb4c8d430d18ede6a1cced8fafbd99" 865 + dependencies = [ 866 + "autocfg", 867 + "hashbrown 0.12.3", 868 + "serde", 869 + ] 870 + 871 + [[package]] 753 872 name = "indexmap" 754 873 version = "2.7.1" 755 874 source = "registry+https://github.com/rust-lang/crates.io-index" 756 875 checksum = "8c9c992b02b5b4c94ea26e32fe5bccb7aa7d9f390ab5c1221ff895bc7ea8b652" 757 876 dependencies = [ 758 877 "equivalent", 759 - "hashbrown", 878 + "hashbrown 0.15.2", 879 + "serde", 760 880 ] 761 881 762 882 [[package]] ··· 897 1017 "metrics-process", 898 1018 "rocksdb", 899 1019 "serde", 1020 + "serde_with", 900 1021 "tempfile", 901 1022 "tinyjson", 902 1023 "tokio", ··· 989 1110 "http-body-util", 990 1111 "hyper", 991 1112 "hyper-util", 992 - "indexmap", 1113 + "indexmap 2.7.1", 993 1114 "ipnet", 994 1115 "metrics", 995 1116 "metrics-util", ··· 1023 1144 dependencies = [ 1024 1145 "crossbeam-epoch", 1025 1146 "crossbeam-utils", 1026 - "hashbrown", 1147 + "hashbrown 0.15.2", 1027 1148 "metrics", 1028 1149 "quanta", 1029 1150 "rand", ··· 1103 1224 ] 1104 1225 1105 1226 [[package]] 1227 + name = "num-conv" 1228 + version = "0.1.0" 1229 + source = "registry+https://github.com/rust-lang/crates.io-index" 1230 + checksum = "51d515d32fb182ee37cda2ccdcb92950d6a3c2893aa280e540671c2cd0f3b1d9" 1231 + 1232 + [[package]] 1233 + name = "num-traits" 1234 + version = "0.2.19" 1235 + source = "registry+https://github.com/rust-lang/crates.io-index" 1236 + checksum = "071dfc062690e90b734c0b2273ce72ad0ffa95f0c74596bc250dcfd960262841" 1237 + dependencies = [ 1238 + "autocfg", 1239 + ] 1240 + 1241 + [[package]] 1106 1242 name = "object" 1107 1243 version = "0.36.7" 1108 1244 source = "registry+https://github.com/rust-lang/crates.io-index" ··· 1213 1349 version = "1.10.0" 1214 1350 source = "registry+https://github.com/rust-lang/crates.io-index" 1215 1351 checksum = "280dc24453071f1b63954171985a0b0d30058d287960968b9b2aca264c8d4ee6" 1352 + 1353 + [[package]] 1354 + name = "powerfmt" 1355 + version = "0.2.0" 1356 + source = "registry+https://github.com/rust-lang/crates.io-index" 1357 + checksum = "439ee305def115ba05938db6eb1644ff94165c5ab5e9420d1c1bcedbba909391" 1216 1358 1217 1359 [[package]] 1218 1360 name = "ppv-lite86" ··· 1533 1675 ] 1534 1676 1535 1677 [[package]] 1678 + name = "serde_with" 1679 + version = "3.12.0" 1680 + source = "registry+https://github.com/rust-lang/crates.io-index" 1681 + checksum = "d6b6f7f2fcb69f747921f79f3926bd1e203fce4fef62c268dd3abfb6d86029aa" 1682 + dependencies = [ 1683 + "base64", 1684 + "chrono", 1685 + "hex", 1686 + "indexmap 1.9.3", 1687 + "indexmap 2.7.1", 1688 + "serde", 1689 + "serde_derive", 1690 + "serde_json", 1691 + "serde_with_macros", 1692 + "time", 1693 + ] 1694 + 1695 + [[package]] 1696 + name = "serde_with_macros" 1697 + version = "3.12.0" 1698 + source = "registry+https://github.com/rust-lang/crates.io-index" 1699 + checksum = "8d00caa5193a3c8362ac2b73be6b9e768aa5a4b2f721d8f4b339600c3cb51f8e" 1700 + dependencies = [ 1701 + "darling", 1702 + "proc-macro2", 1703 + "quote", 1704 + "syn", 1705 + ] 1706 + 1707 + [[package]] 1536 1708 name = "sha1" 1537 1709 version = "0.10.6" 1538 1710 source = "registry+https://github.com/rust-lang/crates.io-index" ··· 1676 1848 ] 1677 1849 1678 1850 [[package]] 1851 + name = "time" 1852 + version = "0.3.37" 1853 + source = "registry+https://github.com/rust-lang/crates.io-index" 1854 + checksum = "35e7868883861bd0e56d9ac6efcaaca0d6d5d82a2a7ec8209ff492c07cf37b21" 1855 + dependencies = [ 1856 + "deranged", 1857 + "itoa", 1858 + "num-conv", 1859 + "powerfmt", 1860 + "serde", 1861 + "time-core", 1862 + "time-macros", 1863 + ] 1864 + 1865 + [[package]] 1866 + name = "time-core" 1867 + version = "0.1.2" 1868 + source = "registry+https://github.com/rust-lang/crates.io-index" 1869 + checksum = "ef927ca75afb808a4d64dd374f00a2adf8d0fcff8e7b184af886c3c87ec4a3f3" 1870 + 1871 + [[package]] 1872 + name = "time-macros" 1873 + version = "0.2.19" 1874 + source = "registry+https://github.com/rust-lang/crates.io-index" 1875 + checksum = "2834e6017e3e5e4b9834939793b282bc03b37a3336245fa820e35e233e2a85de" 1876 + dependencies = [ 1877 + "num-conv", 1878 + "time-core", 1879 + ] 1880 + 1881 + [[package]] 1679 1882 name = "tinyjson" 1680 1883 version = "2.5.1" 1681 1884 source = "registry+https://github.com/rust-lang/crates.io-index" ··· 1855 2058 dependencies = [ 1856 2059 "cfg-if", 1857 2060 "once_cell", 2061 + "rustversion", 1858 2062 "wasm-bindgen-macro", 1859 2063 ] 1860 2064 ··· 1942 2146 source = "registry+https://github.com/rust-lang/crates.io-index" 1943 2147 checksum = "dd04d41d93c4992d421894c18c8b43496aa748dd4c081bac0dc93eb0489272b6" 1944 2148 dependencies = [ 1945 - "windows-core", 2149 + "windows-core 0.58.0", 2150 + "windows-targets", 2151 + ] 2152 + 2153 + [[package]] 2154 + name = "windows-core" 2155 + version = "0.52.0" 2156 + source = "registry+https://github.com/rust-lang/crates.io-index" 2157 + checksum = "33ab640c8d7e35bf8ba19b884ba838ceb4fba93a4e8c65a9059d08afcfc683d9" 2158 + dependencies = [ 1946 2159 "windows-targets", 1947 2160 ] 1948 2161
+19 -2
cozy-setup (move to another repo).md
··· 53 53 match { 54 54 expression {header.User-Agent}.startsWith("Mozilla/5.0") 55 55 } 56 - events 2 57 - window 15s 56 + events 1000 57 + window 30s 58 58 log_key true 59 59 } 60 60 } ··· 74 74 cache 75 75 } 76 76 ``` 77 + 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. 78 + 79 + 80 + alternative proxies: 81 + 82 + - nginx. i should probably just use this. acme-client is a piece of cake to set up, and i know how to configure it. 83 + - haproxy. also kind of familiar, it's old and stable. no idea how it handle low-mem (our 1gb) vs nginx. 84 + - sozu. popular rust thing, fast. doesn't have rate-limiting or cache feature? 85 + - rpxy. like caddy (auto-tls) but in rust and actually fast? has an "experimental" cache feature. but the cache feature looks good. 86 + - rama. build-your-own proxy. not sure that it has both cache and limiter in their standard features? 87 + - pingora. build-your-own cloudflare, so like, probably stable. has tools for cache and limiting. low-mem...? 88 + - cache stuff in pingora seems a little... hit and miss (byeeeee). only a test impl for Storage for the main cache feature? 89 + - but the rate-limiter has a guide: https://github.com/cloudflare/pingora/blob/main/docs/user_guide/rate_limiter.md 90 + 91 + 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 92 + - varnish is a dedicated cache. has https://github.com/varnish/varnish-modules/blob/master/src/vmod_vsthrottle.vcc 93 + - apache traffic control has experimental rate-limiting plugins 77 94 78 95 79 96 - victoriametrics