The code and data behind xeiaso.net
5
fork

Configure Feed

Select the types of activity you want to include in your feed.

Rewrite the site routing with Axum (#441)

* broken state

Signed-off-by: Xe Iaso <me@christine.website>

* fix???

Signed-off-by: Xe Iaso <me@christine.website>

* Port everything else to axum

Signed-off-by: Xe <me@christine.website>

* headers

Signed-off-by: Xe Iaso <me@christine.website>

* site update post

Signed-off-by: Christine Dodrill <me@christine.website>

* fix headers

Signed-off-by: Xe Iaso <me@christine.website>

* remove warp example

Signed-off-by: Xe Iaso <me@christine.website>

* 80c wrap

Signed-off-by: Xe Iaso <me@christine.website>

* bump version

Signed-off-by: Xe Iaso <me@christine.website>

authored by

Xe Iaso and committed by
GitHub
8b747c1c f45ca40a

+1247 -897
+682 -409
Cargo.lock
··· 25 25 26 26 [[package]] 27 27 name = "addr2line" 28 - version = "0.15.2" 28 + version = "0.17.0" 29 29 source = "registry+https://github.com/rust-lang/crates.io-index" 30 - checksum = "e7a2e47a1fbe209ee101dd6d61285226744c6c8d3c21c8dc878ba6cb9f467f3a" 30 + checksum = "b9ecd88a8c8378ca913a680cd98f0f13ac67383d35993f86c90a70e3f137816b" 31 31 dependencies = [ 32 32 "gimli", 33 33 ] ··· 40 40 41 41 [[package]] 42 42 name = "aho-corasick" 43 - version = "0.7.15" 43 + version = "0.7.18" 44 44 source = "registry+https://github.com/rust-lang/crates.io-index" 45 - checksum = "7404febffaa47dac81aa44dba71523c9d069b1bdc50a77db41195149e17f68e5" 45 + checksum = "1e37cfd5e7657ada45f742d6e99ca5788580b5c529dc78faf11ece6dc702656f" 46 46 dependencies = [ 47 47 "memchr", 48 48 ] 49 49 50 50 [[package]] 51 - name = "annotate-snippets" 52 - version = "0.9.1" 51 + name = "alloc-no-stdlib" 52 + version = "2.0.3" 53 + source = "registry+https://github.com/rust-lang/crates.io-index" 54 + checksum = "35ef4730490ad1c4eae5c4325b2a95f521d023e5c885853ff7aca0a6a1631db3" 55 + 56 + [[package]] 57 + name = "alloc-stdlib" 58 + version = "0.2.1" 53 59 source = "registry+https://github.com/rust-lang/crates.io-index" 54 - checksum = "c3b9d411ecbaf79885c6df4d75fff75858d5995ff25385657a28af47e82f9c36" 60 + checksum = "697ed7edc0f1711de49ce108c541623a0af97c6c60b2f6e2b65229847ac843c2" 55 61 dependencies = [ 56 - "unicode-width", 62 + "alloc-no-stdlib", 57 63 ] 58 64 59 65 [[package]] 60 - name = "ansi_term" 61 - version = "0.11.0" 66 + name = "annotate-snippets" 67 + version = "0.9.1" 62 68 source = "registry+https://github.com/rust-lang/crates.io-index" 63 - checksum = "ee49baf6cb617b853aa8d93bf420db2383fab46d314482ca2803b40d5fde979b" 69 + checksum = "c3b9d411ecbaf79885c6df4d75fff75858d5995ff25385657a28af47e82f9c36" 64 70 dependencies = [ 65 - "winapi", 71 + "unicode-width", 66 72 ] 67 73 68 74 [[package]] ··· 81 87 checksum = "23b62fc65de8e4e7f52534fb52b0f3ed04746ae267519eef2a83941e8085068b" 82 88 83 89 [[package]] 90 + name = "async-compression" 91 + version = "0.3.12" 92 + source = "registry+https://github.com/rust-lang/crates.io-index" 93 + checksum = "f2bf394cfbbe876f0ac67b13b6ca819f9c9f2fb9ec67223cceb1555fbab1c31a" 94 + dependencies = [ 95 + "brotli", 96 + "flate2", 97 + "futures-core", 98 + "memchr", 99 + "pin-project-lite", 100 + "tokio", 101 + ] 102 + 103 + [[package]] 104 + name = "async-trait" 105 + version = "0.1.52" 106 + source = "registry+https://github.com/rust-lang/crates.io-index" 107 + checksum = "061a7acccaa286c011ddc30970520b98fa40e00c9d644633fb26b5fc63a265e3" 108 + dependencies = [ 109 + "proc-macro2", 110 + "quote", 111 + "syn", 112 + ] 113 + 114 + [[package]] 84 115 name = "atty" 85 116 version = "0.2.14" 86 117 source = "registry+https://github.com/rust-lang/crates.io-index" ··· 93 124 94 125 [[package]] 95 126 name = "autocfg" 96 - version = "1.0.1" 127 + version = "1.1.0" 128 + source = "registry+https://github.com/rust-lang/crates.io-index" 129 + checksum = "d468802bab17cbc0cc575e9b053f41e72aa36bfa6b7f55e3529ffa43161b97fa" 130 + 131 + [[package]] 132 + name = "axum" 133 + version = "0.4.8" 134 + source = "registry+https://github.com/rust-lang/crates.io-index" 135 + checksum = "c9f346c92c1e9a71d14fe4aaf7c2a5d9932cc4e5e48d8fb6641524416eb79ddd" 136 + dependencies = [ 137 + "async-trait", 138 + "axum-core", 139 + "bitflags", 140 + "bytes", 141 + "futures-util", 142 + "http", 143 + "http-body", 144 + "hyper", 145 + "matchit", 146 + "memchr", 147 + "mime", 148 + "percent-encoding", 149 + "pin-project-lite", 150 + "serde", 151 + "serde_json", 152 + "serde_urlencoded", 153 + "sync_wrapper", 154 + "tokio", 155 + "tower", 156 + "tower-http", 157 + "tower-layer", 158 + "tower-service", 159 + ] 160 + 161 + [[package]] 162 + name = "axum-core" 163 + version = "0.1.2" 97 164 source = "registry+https://github.com/rust-lang/crates.io-index" 98 - checksum = "cdb031dd78e28731d87d56cc8ffef4a8f36ca26c38fe2de700543e627f8a464a" 165 + checksum = "6dbcda393bef9c87572779cb8ef916f12d77750b27535dd6819fa86591627a51" 166 + dependencies = [ 167 + "async-trait", 168 + "bytes", 169 + "futures-util", 170 + "http", 171 + "http-body", 172 + "mime", 173 + ] 174 + 175 + [[package]] 176 + name = "axum-extra" 177 + version = "0.1.5" 178 + source = "registry+https://github.com/rust-lang/crates.io-index" 179 + checksum = "b5b6d79bc9c2975821d39c7df31ea766026beb9efe28c076a48cfd7d50f34f18" 180 + dependencies = [ 181 + "axum", 182 + "bytes", 183 + "http", 184 + "mime", 185 + "pin-project-lite", 186 + "tower", 187 + "tower-http", 188 + "tower-layer", 189 + "tower-service", 190 + ] 191 + 192 + [[package]] 193 + name = "axum-macros" 194 + version = "0.1.2" 195 + source = "registry+https://github.com/rust-lang/crates.io-index" 196 + checksum = "c5b2a9133b2658e684c8ea04157a8bd48dac7906a2eb884ffebfb051af123394" 197 + dependencies = [ 198 + "heck", 199 + "proc-macro2", 200 + "quote", 201 + "syn", 202 + ] 99 203 100 204 [[package]] 101 205 name = "backtrace" 102 - version = "0.3.59" 206 + version = "0.3.64" 103 207 source = "registry+https://github.com/rust-lang/crates.io-index" 104 - checksum = "4717cfcbfaa661a0fd48f8453951837ae7e8f81e481fbb136e3202d72805a744" 208 + checksum = "5e121dee8023ce33ab248d9ce1493df03c3b38a659b240096fcbd7048ff9c31f" 105 209 dependencies = [ 106 210 "addr2line", 107 211 "cc", ··· 135 239 136 240 [[package]] 137 241 name = "bitvec" 138 - version = "0.19.5" 242 + version = "0.19.6" 139 243 source = "registry+https://github.com/rust-lang/crates.io-index" 140 - checksum = "8942c8d352ae1838c9dda0b0ca2ab657696ef2232a20147cf1b30ae1a9cb4321" 244 + checksum = "55f93d0ef3363c364d5976646a38f04cf67cfe1d4c8d160cdea02cab2c116b33" 141 245 dependencies = [ 142 246 "funty", 143 247 "radium", ··· 163 267 source = "registry+https://github.com/rust-lang/crates.io-index" 164 268 checksum = "4152116fd6e9dadb291ae18fc1ec3575ed6d84c29642d97890f4b4a3417297e4" 165 269 dependencies = [ 166 - "generic-array 0.14.4", 270 + "generic-array 0.14.5", 167 271 ] 168 272 169 273 [[package]] ··· 176 280 ] 177 281 178 282 [[package]] 179 - name = "buf_redux" 180 - version = "0.8.4" 283 + name = "brotli" 284 + version = "3.3.3" 181 285 source = "registry+https://github.com/rust-lang/crates.io-index" 182 - checksum = "b953a6887648bb07a535631f2bc00fbdb2a2216f135552cb3f534ed136b9c07f" 286 + checksum = "f838e47a451d5a8fa552371f80024dd6ace9b7acdf25c4c3d0f9bc6816fb1c39" 183 287 dependencies = [ 184 - "memchr", 185 - "safemem", 288 + "alloc-no-stdlib", 289 + "alloc-stdlib", 290 + "brotli-decompressor", 291 + ] 292 + 293 + [[package]] 294 + name = "brotli-decompressor" 295 + version = "2.3.2" 296 + source = "registry+https://github.com/rust-lang/crates.io-index" 297 + checksum = "59ad2d4653bf5ca36ae797b1f4bb4dbddb60ce49ca4aed8a2ce4829f60425b80" 298 + dependencies = [ 299 + "alloc-no-stdlib", 300 + "alloc-stdlib", 186 301 ] 187 302 188 303 [[package]] 189 304 name = "bumpalo" 190 - version = "3.7.1" 305 + version = "3.9.1" 191 306 source = "registry+https://github.com/rust-lang/crates.io-index" 192 - checksum = "d9df67f7bf9ef8498769f994239c45613ef0c5899415fb58e9add412d2c1a538" 307 + checksum = "a4a45a46ab1f2412e53d3a0ade76ffad2025804294569aae387231a0cd6e0899" 193 308 194 309 [[package]] 195 310 name = "byte-tools" ··· 217 332 218 333 [[package]] 219 334 name = "cc" 220 - version = "1.0.70" 335 + version = "1.0.73" 221 336 source = "registry+https://github.com/rust-lang/crates.io-index" 222 - checksum = "d26a6ce4b6a484fa3edb70f7efa6fc430fd2b87285fe8b84304fd0936faa0dc0" 337 + checksum = "2fff2a6927b3bb87f9595d67196a70493f627687a71d87a0d692242c33f58c11" 223 338 224 339 [[package]] 225 340 name = "cfcache" ··· 252 367 "num-integer", 253 368 "num-traits", 254 369 "serde", 255 - "time", 370 + "time 0.1.43", 256 371 "winapi", 257 372 ] 258 373 ··· 267 382 268 383 [[package]] 269 384 name = "clap" 270 - version = "2.33.3" 385 + version = "2.34.0" 271 386 source = "registry+https://github.com/rust-lang/crates.io-index" 272 - checksum = "37e58ac78573c40708d45522f0d80fa2f01cc4f9b4e2bf749807255454312002" 387 + checksum = "a0610544180c38b88101fecf2dd634b174a62eef6946f84dfc6a7127512b381c" 273 388 dependencies = [ 274 - "ansi_term 0.11.0", 389 + "ansi_term", 275 390 "atty", 276 391 "bitflags", 277 392 "strsim", ··· 282 397 283 398 [[package]] 284 399 name = "color-eyre" 285 - version = "0.6.0" 400 + version = "0.6.1" 286 401 source = "registry+https://github.com/rust-lang/crates.io-index" 287 - checksum = "9d6ec7641ff3474b7593009c809db602c414cd97c7d47a78ed004162b74ff96c" 402 + checksum = "8ebf286c900a6d5867aeff75cfee3192857bb7f24b547d4f0df2ed6baa812c90" 288 403 dependencies = [ 289 404 "backtrace", 290 405 "color-spantrace", ··· 321 436 "regex", 322 437 "shell-words", 323 438 "syntect", 324 - "twoway 0.2.2", 439 + "twoway", 325 440 "typed-arena", 326 441 "unicode_categories", 327 442 "xdg", 328 443 ] 329 444 330 445 [[package]] 446 + name = "convert_case" 447 + version = "0.4.0" 448 + source = "registry+https://github.com/rust-lang/crates.io-index" 449 + checksum = "6245d59a3e82a7fc217c5828a6692dbc6dfb63a0c8c90495621f7b9d79704a0e" 450 + 451 + [[package]] 331 452 name = "core-foundation" 332 - version = "0.9.1" 453 + version = "0.9.3" 333 454 source = "registry+https://github.com/rust-lang/crates.io-index" 334 - checksum = "0a89e2ae426ea83155dccf10c0fa6b1463ef6d5fcb44cee0b224a408fa640a62" 455 + checksum = "194a7a9e6de53fa55116934067c844d9d749312f75c6f6d0980e8c252f8c2146" 335 456 dependencies = [ 336 457 "core-foundation-sys", 337 458 "libc", ··· 339 460 340 461 [[package]] 341 462 name = "core-foundation-sys" 342 - version = "0.8.2" 463 + version = "0.8.3" 343 464 source = "registry+https://github.com/rust-lang/crates.io-index" 344 - checksum = "ea221b5284a47e40033bf9b66f35f984ec0ea2931eb03505246cd27a963f981b" 465 + checksum = "5827cebf4670468b8772dd191856768aedcb1b0278a04f989f7766351917b9dc" 345 466 346 467 [[package]] 347 468 name = "cpufeatures" 348 - version = "0.2.1" 469 + version = "0.2.2" 349 470 source = "registry+https://github.com/rust-lang/crates.io-index" 350 - checksum = "95059428f66df56b63431fdb4e1947ed2190586af5c5a8a8b71122bdf5a7f469" 471 + checksum = "59a6001667ab124aebae2a495118e11d30984c3a653e99d86d58971708cf5e4b" 351 472 dependencies = [ 352 473 "libc", 353 474 ] 354 475 355 476 [[package]] 356 477 name = "crc32fast" 357 - version = "1.2.1" 478 + version = "1.3.2" 358 479 source = "registry+https://github.com/rust-lang/crates.io-index" 359 - checksum = "81156fece84ab6a9f2afdb109ce3ae577e42b1228441eded99bd77f627953b1a" 480 + checksum = "b540bd8bc810d3885c6ea91e2018302f68baba2129ab3e88f32389ee9370880d" 481 + dependencies = [ 482 + "cfg-if", 483 + ] 484 + 485 + [[package]] 486 + name = "crossbeam-channel" 487 + version = "0.5.4" 488 + source = "registry+https://github.com/rust-lang/crates.io-index" 489 + checksum = "5aaa7bd5fb665c6864b5f963dd9097905c54125909c7aa94c9e18507cdbe6c53" 360 490 dependencies = [ 361 491 "cfg-if", 492 + "crossbeam-utils", 493 + ] 494 + 495 + [[package]] 496 + name = "crossbeam-utils" 497 + version = "0.8.8" 498 + source = "registry+https://github.com/rust-lang/crates.io-index" 499 + checksum = "0bf124c720b7686e3c2663cf54062ab0f68a88af2fb6a030e87e30bf721fcb38" 500 + dependencies = [ 501 + "cfg-if", 502 + "lazy_static", 503 + ] 504 + 505 + [[package]] 506 + name = "derive_more" 507 + version = "0.99.17" 508 + source = "registry+https://github.com/rust-lang/crates.io-index" 509 + checksum = "4fb810d30a7c1953f91334de7244731fc3f3c10d7fe163338a35b9f640960321" 510 + dependencies = [ 511 + "convert_case", 512 + "proc-macro2", 513 + "quote", 514 + "rustc_version", 515 + "syn", 362 516 ] 363 517 364 518 [[package]] ··· 413 567 source = "registry+https://github.com/rust-lang/crates.io-index" 414 568 checksum = "d3dd60d1080a57a05ab032377049e0591415d2b31afd7028356dbf3cc6dcb066" 415 569 dependencies = [ 416 - "generic-array 0.14.4", 570 + "generic-array 0.14.5", 571 + ] 572 + 573 + [[package]] 574 + name = "dirs" 575 + version = "4.0.0" 576 + source = "registry+https://github.com/rust-lang/crates.io-index" 577 + checksum = "ca3aa72a6f96ea37bbc5aa912f6788242832f75369bdfdadcb0e38423f100059" 578 + dependencies = [ 579 + "dirs-sys", 580 + ] 581 + 582 + [[package]] 583 + name = "dirs-sys" 584 + version = "0.3.7" 585 + source = "registry+https://github.com/rust-lang/crates.io-index" 586 + checksum = "1b1d1d91c932ef41c0f2663aa8b0ca0342d444d842c06914aa0a7e352d0bada6" 587 + dependencies = [ 588 + "libc", 589 + "redox_users", 590 + "winapi", 417 591 ] 418 592 419 593 [[package]] ··· 423 597 checksum = "fea41bba32d969b513997752735605054bc0dfa92b4c56bf1189f2e174be7a10" 424 598 425 599 [[package]] 426 - name = "dtoa" 427 - version = "0.4.8" 428 - source = "registry+https://github.com/rust-lang/crates.io-index" 429 - checksum = "56899898ce76aaf4a0f24d914c97ea6ed976d42fec6ad33fcbb0a1103e07b2b0" 430 - 431 - [[package]] 432 600 name = "either" 433 601 version = "1.6.1" 434 602 source = "registry+https://github.com/rust-lang/crates.io-index" ··· 436 604 437 605 [[package]] 438 606 name = "elsa" 439 - version = "1.4.0" 607 + version = "1.7.0" 440 608 source = "registry+https://github.com/rust-lang/crates.io-index" 441 - checksum = "848344296205756adc00ab3bec02658da0f72eaa1461474aa2d51d64311876a5" 609 + checksum = "2b4b5d23ed6b6948d68240aafa4ac98e568c9a020efd9d4201a6288bc3006e09" 442 610 dependencies = [ 443 611 "stable_deref_trait", 444 612 ] 445 613 446 614 [[package]] 447 615 name = "encoding_rs" 448 - version = "0.8.28" 616 + version = "0.8.30" 449 617 source = "registry+https://github.com/rust-lang/crates.io-index" 450 - checksum = "80df024fbc5ac80f87dfef0d9f5209a252f2a497f7f42944cff24d8253cac065" 618 + checksum = "7896dc8abb250ffdda33912550faa54c88ec8b998dec0b2c55ab224921ce11df" 451 619 dependencies = [ 452 620 "cfg-if", 453 621 ] ··· 498 666 499 667 [[package]] 500 668 name = "eyre" 501 - version = "0.6.6" 669 + version = "0.6.7" 502 670 source = "registry+https://github.com/rust-lang/crates.io-index" 503 - checksum = "bc225d8f637923fe585089fcf03e705c222131232d2c1fb622e84ecf725d0eb8" 671 + checksum = "9289ed2c0440a6536e65119725cf91fc2c6b5e513bfd2e36e1134d7cca6ca12f" 504 672 dependencies = [ 505 673 "indenter", 506 674 "once_cell", ··· 513 681 checksum = "e88a8acf291dafb59c2d96e8f59828f3838bb1a70398823ade51a84de6a6deed" 514 682 515 683 [[package]] 684 + name = "fastrand" 685 + version = "1.7.0" 686 + source = "registry+https://github.com/rust-lang/crates.io-index" 687 + checksum = "c3fcf0cee53519c866c09b5de1f6c56ff9d647101f81c1964fa632e148896cdf" 688 + dependencies = [ 689 + "instant", 690 + ] 691 + 692 + [[package]] 516 693 name = "flate2" 517 694 version = "1.0.22" 518 695 source = "registry+https://github.com/rust-lang/crates.io-index" ··· 563 740 564 741 [[package]] 565 742 name = "futures" 566 - version = "0.3.17" 743 + version = "0.3.21" 567 744 source = "registry+https://github.com/rust-lang/crates.io-index" 568 - checksum = "a12aa0eb539080d55c3f2d45a67c3b58b6b0773c1a3ca2dfec66d58c97fd66ca" 745 + checksum = "f73fe65f54d1e12b726f517d3e2135ca3125a437b6d998caf1962961f7172d9e" 569 746 dependencies = [ 570 747 "futures-channel", 571 748 "futures-core", ··· 578 755 579 756 [[package]] 580 757 name = "futures-channel" 581 - version = "0.3.17" 758 + version = "0.3.21" 582 759 source = "registry+https://github.com/rust-lang/crates.io-index" 583 - checksum = "5da6ba8c3bb3c165d3c7319fc1cc8304facf1fb8db99c5de877183c08a273888" 760 + checksum = "c3083ce4b914124575708913bca19bfe887522d6e2e6d0952943f5eac4a74010" 584 761 dependencies = [ 585 762 "futures-core", 586 763 "futures-sink", ··· 588 765 589 766 [[package]] 590 767 name = "futures-core" 591 - version = "0.3.17" 768 + version = "0.3.21" 592 769 source = "registry+https://github.com/rust-lang/crates.io-index" 593 - checksum = "88d1c26957f23603395cd326b0ffe64124b818f4449552f960d815cfba83a53d" 770 + checksum = "0c09fd04b7e4073ac7156a9539b57a484a8ea920f79c7c675d05d289ab6110d3" 594 771 595 772 [[package]] 596 773 name = "futures-executor" 597 - version = "0.3.17" 774 + version = "0.3.21" 598 775 source = "registry+https://github.com/rust-lang/crates.io-index" 599 - checksum = "45025be030969d763025784f7f355043dc6bc74093e4ecc5000ca4dc50d8745c" 776 + checksum = "9420b90cfa29e327d0429f19be13e7ddb68fa1cccb09d65e5706b8c7a749b8a6" 600 777 dependencies = [ 601 778 "futures-core", 602 779 "futures-task", ··· 605 782 606 783 [[package]] 607 784 name = "futures-io" 608 - version = "0.3.17" 785 + version = "0.3.21" 609 786 source = "registry+https://github.com/rust-lang/crates.io-index" 610 - checksum = "522de2a0fe3e380f1bc577ba0474108faf3f6b18321dbf60b3b9c39a75073377" 787 + checksum = "fc4045962a5a5e935ee2fdedaa4e08284547402885ab326734432bed5d12966b" 611 788 612 789 [[package]] 613 790 name = "futures-macro" 614 - version = "0.3.17" 791 + version = "0.3.21" 615 792 source = "registry+https://github.com/rust-lang/crates.io-index" 616 - checksum = "18e4a4b95cea4b4ccbcf1c5675ca7c4ee4e9e75eb79944d07defde18068f79bb" 793 + checksum = "33c1e13800337f4d4d7a316bf45a567dbcb6ffe087f16424852d97e97a91f512" 617 794 dependencies = [ 618 - "autocfg", 619 - "proc-macro-hack", 620 795 "proc-macro2", 621 796 "quote", 622 797 "syn", ··· 624 799 625 800 [[package]] 626 801 name = "futures-sink" 627 - version = "0.3.17" 802 + version = "0.3.21" 628 803 source = "registry+https://github.com/rust-lang/crates.io-index" 629 - checksum = "36ea153c13024fe480590b3e3d4cad89a0cfacecc24577b68f86c6ced9c2bc11" 804 + checksum = "21163e139fa306126e6eedaf49ecdb4588f939600f0b1e770f4205ee4b7fa868" 630 805 631 806 [[package]] 632 807 name = "futures-task" 633 - version = "0.3.17" 808 + version = "0.3.21" 634 809 source = "registry+https://github.com/rust-lang/crates.io-index" 635 - checksum = "1d3d00f4eddb73e498a54394f228cd55853bdf059259e8e7bc6e69d408892e99" 810 + checksum = "57c66a976bf5909d801bbef33416c41372779507e7a6b3a5e25e4749c58f776a" 636 811 637 812 [[package]] 638 813 name = "futures-util" 639 - version = "0.3.17" 814 + version = "0.3.21" 640 815 source = "registry+https://github.com/rust-lang/crates.io-index" 641 - checksum = "36568465210a3a6ee45e1f165136d68671471a501e632e9a98d96872222b5481" 816 + checksum = "d8b7abd5d659d9b90c8cba917f6ec750a74e2dc23902ef9cd4cc8c8b22e6036a" 642 817 dependencies = [ 643 - "autocfg", 644 818 "futures-channel", 645 819 "futures-core", 646 820 "futures-io", ··· 650 824 "memchr", 651 825 "pin-project-lite", 652 826 "pin-utils", 653 - "proc-macro-hack", 654 - "proc-macro-nested", 655 827 "slab", 656 828 ] 657 829 ··· 666 838 667 839 [[package]] 668 840 name = "generic-array" 669 - version = "0.14.4" 841 + version = "0.14.5" 670 842 source = "registry+https://github.com/rust-lang/crates.io-index" 671 - checksum = "501466ecc8a30d1d3b7fc9229b122b2ce8ed6e9d9223f1138d4babb253e51817" 843 + checksum = "fd48d33ec7f05fbfa152300fdad764757cbded343c1aa1cff2fbaf4134851803" 672 844 dependencies = [ 673 845 "typenum", 674 846 "version_check", ··· 676 848 677 849 [[package]] 678 850 name = "getrandom" 679 - version = "0.2.3" 851 + version = "0.2.5" 680 852 source = "registry+https://github.com/rust-lang/crates.io-index" 681 - checksum = "7fcd999463524c52659517fe2cea98493cfe485d10565e7b0fb07dbba7ad2753" 853 + checksum = "d39cd93900197114fa1fcb7ae84ca742095eed9442088988ae74fa744e930e77" 682 854 dependencies = [ 683 855 "cfg-if", 684 856 "libc", 685 - "wasi", 857 + "wasi 0.10.2+wasi-snapshot-preview1", 686 858 ] 687 859 688 860 [[package]] 689 861 name = "gimli" 690 - version = "0.24.0" 862 + version = "0.26.1" 691 863 source = "registry+https://github.com/rust-lang/crates.io-index" 692 - checksum = "0e4075386626662786ddb0ec9081e7c7eeb1ba31951f447ca780ef9f5d568189" 864 + checksum = "78cc372d058dcf6d5ecd98510e7fbc9e5aec4d21de70f65fea8fecebcd881bd4" 693 865 694 866 [[package]] 695 867 name = "glob" ··· 698 870 checksum = "9b919933a397b79c37e33b77bb2aa3dc8eb6e165ad809e58ff75bc7db2e34574" 699 871 700 872 [[package]] 701 - name = "go_vanity" 702 - version = "0.2.0" 703 - dependencies = [ 704 - "mime", 705 - "ructe", 706 - "warp", 707 - ] 708 - 709 - [[package]] 710 873 name = "h2" 711 - version = "0.3.10" 874 + version = "0.3.12" 712 875 source = "registry+https://github.com/rust-lang/crates.io-index" 713 - checksum = "0c9de88456263e249e241fcd211d3954e2c9b0ef7ccfc235a444eb367cae3689" 876 + checksum = "62eeb471aa3e3c9197aa4bfeabfe02982f6dc96f750486c0bb0009ac58b26d2b" 714 877 dependencies = [ 715 878 "bytes", 716 879 "fnv", ··· 721 884 "indexmap", 722 885 "slab", 723 886 "tokio", 724 - "tokio-util", 887 + "tokio-util 0.6.9", 725 888 "tracing", 726 889 ] 727 890 728 891 [[package]] 729 892 name = "half" 730 - version = "1.7.1" 893 + version = "1.8.2" 731 894 source = "registry+https://github.com/rust-lang/crates.io-index" 732 - checksum = "62aca2aba2d62b4a7f5b33f3712cb1b0692779a56fb510499d5c0aa594daeaf3" 895 + checksum = "eabb4a44450da02c90444cf74558da904edde8fb4e9035a9a6a4e15445af0bd7" 733 896 734 897 [[package]] 735 898 name = "hashbrown" ··· 738 901 checksum = "ab5ef0d4909ef3724cc8cce6ccc8572c5c817592e9285f5464f8e86f8bd3726e" 739 902 740 903 [[package]] 741 - name = "headers" 742 - version = "0.3.4" 904 + name = "hdrhistogram" 905 + version = "7.5.0" 743 906 source = "registry+https://github.com/rust-lang/crates.io-index" 744 - checksum = "f0b7591fb62902706ae8e7aaff416b1b0fa2c0fd0878b46dc13baa3712d8a855" 907 + checksum = "31672b7011be2c4f7456c4ddbcb40e7e9a4a9fad8efe49a6ebaf5f307d0109c0" 745 908 dependencies = [ 746 909 "base64", 747 - "bitflags", 748 - "bytes", 749 - "headers-core", 750 - "http", 751 - "mime", 752 - "sha-1 0.9.8", 753 - "time", 910 + "byteorder", 911 + "crossbeam-channel", 912 + "flate2", 913 + "nom 7.1.1", 914 + "num-traits", 754 915 ] 755 916 756 917 [[package]] 757 - name = "headers-core" 758 - version = "0.2.0" 918 + name = "heck" 919 + version = "0.4.0" 759 920 source = "registry+https://github.com/rust-lang/crates.io-index" 760 - checksum = "e7f66481bfee273957b1f20485a4ff3362987f85b2c236580d81b4eb7a326429" 761 - dependencies = [ 762 - "http", 763 - ] 921 + checksum = "2540771e65fc8cb83cd6e8a237f70c319bd5c29f78ed1084ba5d50eeac86f7f9" 764 922 765 923 [[package]] 766 924 name = "hermit-abi" ··· 788 946 789 947 [[package]] 790 948 name = "http" 791 - version = "0.2.5" 949 + version = "0.2.6" 792 950 source = "registry+https://github.com/rust-lang/crates.io-index" 793 - checksum = "1323096b05d41827dadeaee54c9981958c0f94e670bc94ed80037d1a7b8b186b" 951 + checksum = "31f4c6746584866f0feabcc69893c5b51beef3831656a968ed7ae254cdc4fd03" 794 952 dependencies = [ 795 953 "bytes", 796 954 "fnv", ··· 799 957 800 958 [[package]] 801 959 name = "http-body" 802 - version = "0.4.3" 960 + version = "0.4.4" 803 961 source = "registry+https://github.com/rust-lang/crates.io-index" 804 - checksum = "399c583b2979440c60be0821a6199eca73bc3c8dcd9d070d75ac726e2c6186e5" 962 + checksum = "1ff4f84919677303da5f147645dbea6b1881f368d03ac84e1dc09031ebd7b2c6" 805 963 dependencies = [ 806 964 "bytes", 807 965 "http", ··· 809 967 ] 810 968 811 969 [[package]] 970 + name = "http-range-header" 971 + version = "0.3.0" 972 + source = "registry+https://github.com/rust-lang/crates.io-index" 973 + checksum = "0bfe8eed0a9285ef776bb792479ea3834e8b94e13d615c2f66d03dd50a435a29" 974 + 975 + [[package]] 812 976 name = "httparse" 813 - version = "1.5.1" 977 + version = "1.6.0" 814 978 source = "registry+https://github.com/rust-lang/crates.io-index" 815 - checksum = "acd94fdbe1d4ff688b67b04eee2e17bd50995534a61539e45adfefb45e5e5503" 979 + checksum = "9100414882e15fb7feccb4897e5f0ff0ff1ca7d1a86a23208ada4d7a18e6c6c4" 816 980 817 981 [[package]] 818 982 name = "httpdate" 819 - version = "1.0.1" 983 + version = "1.0.2" 820 984 source = "registry+https://github.com/rust-lang/crates.io-index" 821 - checksum = "6456b8a6c8f33fee7d958fcd1b60d55b11940a79e63ae87013e6d22e26034440" 985 + checksum = "c4a1e36c821dbe04574f602848a19f742f4fb3c98d40449f11bcad18d6b17421" 822 986 823 987 [[package]] 824 988 name = "humantime" ··· 831 995 832 996 [[package]] 833 997 name = "hyper" 834 - version = "0.14.13" 998 + version = "0.14.17" 835 999 source = "registry+https://github.com/rust-lang/crates.io-index" 836 - checksum = "15d1cfb9e4f68655fa04c01f59edb405b6074a0f7118ea881e5026e4a1cd8593" 1000 + checksum = "043f0e083e9901b6cc658a77d1eb86f4fc650bbb977a4337dd63192826aa85dd" 837 1001 dependencies = [ 838 1002 "bytes", 839 1003 "futures-channel", ··· 885 1049 886 1050 [[package]] 887 1051 name = "indexmap" 888 - version = "1.7.0" 1052 + version = "1.8.0" 889 1053 source = "registry+https://github.com/rust-lang/crates.io-index" 890 - checksum = "bc633605454125dec4b66843673f01c7df2b89479b32e0ed634e43a91cff62a5" 1054 + checksum = "282a6247722caba404c065016bbfa522806e51714c34f5dfc3e4a3a46fcb4223" 891 1055 dependencies = [ 892 1056 "autocfg", 893 1057 "hashbrown", ··· 895 1059 896 1060 [[package]] 897 1061 name = "instant" 898 - version = "0.1.11" 1062 + version = "0.1.12" 899 1063 source = "registry+https://github.com/rust-lang/crates.io-index" 900 - checksum = "716d3d89f35ac6a34fd0eed635395f4c3b76fa889338a4632e5231a8684216bd" 1064 + checksum = "7a5bbe824c507c5da5956355e86a746d82e0e1464f65d862cc5e71da70e94b2c" 901 1065 dependencies = [ 902 1066 "cfg-if", 903 1067 ] 904 1068 905 1069 [[package]] 906 1070 name = "ipnet" 907 - version = "2.3.1" 1071 + version = "2.4.0" 908 1072 source = "registry+https://github.com/rust-lang/crates.io-index" 909 - checksum = "68f2d64f2edebec4ce84ad108148e67e1064789bee435edc5b60ad398714a3a9" 1073 + checksum = "35e70ee094dc02fd9c13fdad4940090f22dbd6ac7c9e7094a46cf0232a50bc7c" 1074 + 1075 + [[package]] 1076 + name = "iri-string" 1077 + version = "0.4.1" 1078 + source = "registry+https://github.com/rust-lang/crates.io-index" 1079 + checksum = "8f0f7638c1e223529f1bfdc48c8b133b9e0b434094d1d28473161ee48b235f78" 1080 + dependencies = [ 1081 + "nom 7.1.1", 1082 + ] 910 1083 911 1084 [[package]] 912 1085 name = "itertools" ··· 919 1092 920 1093 [[package]] 921 1094 name = "itertools" 922 - version = "0.10.1" 1095 + version = "0.10.3" 923 1096 source = "registry+https://github.com/rust-lang/crates.io-index" 924 - checksum = "69ddb889f9d0d08a67338271fa9b62996bc788c7796a5c18cf057420aaed5eaf" 1097 + checksum = "a9a9d19fa1e79b6215ff29b9d6880b706147f16e9b1dbb1e4e5947b5b02bc5e3" 925 1098 dependencies = [ 926 1099 "either", 927 1100 ] 928 1101 929 1102 [[package]] 930 1103 name = "itoa" 931 - version = "0.4.8" 1104 + version = "1.0.1" 932 1105 source = "registry+https://github.com/rust-lang/crates.io-index" 933 - checksum = "b71991ff56294aa922b450139ee08b3bfc70982c6b2c7562771375cf73542dd4" 1106 + checksum = "1aab8fc367588b89dcee83ab0fd66b72b50b72fa1904d7095045ace2b0c81c35" 934 1107 935 1108 [[package]] 936 1109 name = "js-sys" 937 - version = "0.3.55" 1110 + version = "0.3.56" 938 1111 source = "registry+https://github.com/rust-lang/crates.io-index" 939 - checksum = "7cc9ffccd38c451a86bf13657df244e9c3f37493cce8e5e21e940963777acc84" 1112 + checksum = "a38fc24e30fd564ce974c02bf1d337caddff65be6cc4735a1f7eab22a7440f04" 940 1113 dependencies = [ 941 1114 "wasm-bindgen", 942 1115 ] ··· 984 1157 985 1158 [[package]] 986 1159 name = "libc" 987 - version = "0.2.102" 1160 + version = "0.2.120" 988 1161 source = "registry+https://github.com/rust-lang/crates.io-index" 989 - checksum = "a2a5ac8f984bfcf3a823267e5fde638acc3325f6496633a5da6bb6eb2171e103" 1162 + checksum = "ad5c14e80759d0939d013e6ca49930e59fc53dd8e5009132f76240c179380c09" 990 1163 991 1164 [[package]] 992 1165 name = "line-wrap" ··· 1005 1178 1006 1179 [[package]] 1007 1180 name = "lock_api" 1008 - version = "0.4.5" 1181 + version = "0.4.6" 1009 1182 source = "registry+https://github.com/rust-lang/crates.io-index" 1010 - checksum = "712a4d093c9976e24e7dbca41db895dabcbac38eb5f4045393d17a95bdfb1109" 1183 + checksum = "88943dd7ef4a2e5a4bfa2753aaab3013e34ce2533d1996fb18ef591e315e2b3b" 1011 1184 dependencies = [ 1012 1185 "scopeguard", 1013 1186 ] ··· 1034 1207 checksum = "a3e378b66a060d48947b590737b30a1be76706c8dd7b8ba0f2fe3989c68a853f" 1035 1208 1036 1209 [[package]] 1210 + name = "matchit" 1211 + version = "0.4.6" 1212 + source = "registry+https://github.com/rust-lang/crates.io-index" 1213 + checksum = "9376a4f0340565ad675d11fc1419227faf5f60cd7ac9cb2e7185a471f30af833" 1214 + 1215 + [[package]] 1037 1216 name = "md5" 1038 1217 version = "0.7.0" 1039 1218 source = "registry+https://github.com/rust-lang/crates.io-index" ··· 1041 1220 1042 1221 [[package]] 1043 1222 name = "memchr" 1044 - version = "2.3.4" 1223 + version = "2.4.1" 1045 1224 source = "registry+https://github.com/rust-lang/crates.io-index" 1046 - checksum = "0ee1c47aaa256ecabcaea351eae4a9b01ef39ed810004e298d2511ed284b1525" 1225 + checksum = "308cc39be01b73d0d18f82a0e7b2a3df85245f84af96fdddc5d202d27e47b86a" 1047 1226 1048 1227 [[package]] 1049 1228 name = "mi" ··· 1070 1249 1071 1250 [[package]] 1072 1251 name = "mime_guess" 1073 - version = "2.0.3" 1252 + version = "2.0.4" 1074 1253 source = "registry+https://github.com/rust-lang/crates.io-index" 1075 - checksum = "2684d4c2e97d99848d30b324b00c8fcc7e5c897b7cbb5819b09e7c90e8baf212" 1254 + checksum = "4192263c238a5f0d0c6bfd21f336a313a4ce1c450542449ca191bb657b4642ef" 1076 1255 dependencies = [ 1077 1256 "mime", 1078 1257 "unicase", 1079 1258 ] 1259 + 1260 + [[package]] 1261 + name = "minimal-lexical" 1262 + version = "0.2.1" 1263 + source = "registry+https://github.com/rust-lang/crates.io-index" 1264 + checksum = "68354c5c6bd36d73ff3feceb05efa59b6acb7626617f4962be322a825e61f79a" 1080 1265 1081 1266 [[package]] 1082 1267 name = "miniz_oxide" ··· 1090 1275 1091 1276 [[package]] 1092 1277 name = "mio" 1093 - version = "0.7.13" 1278 + version = "0.8.2" 1094 1279 source = "registry+https://github.com/rust-lang/crates.io-index" 1095 - checksum = "8c2bdb6314ec10835cd3293dd268473a835c02b7b352e788be788b3c6ca6bb16" 1280 + checksum = "52da4364ffb0e4fe33a9841a98a3f3014fb964045ce4f7a45a398243c8d6b0c9" 1096 1281 dependencies = [ 1097 1282 "libc", 1098 1283 "log", 1099 1284 "miow", 1100 1285 "ntapi", 1286 + "wasi 0.11.0+wasi-snapshot-preview1", 1101 1287 "winapi", 1102 1288 ] 1103 1289 ··· 1111 1297 ] 1112 1298 1113 1299 [[package]] 1114 - name = "multipart" 1115 - version = "0.18.0" 1116 - source = "registry+https://github.com/rust-lang/crates.io-index" 1117 - checksum = "00dec633863867f29cb39df64a397cdf4a6354708ddd7759f70c7fb51c5f9182" 1118 - dependencies = [ 1119 - "buf_redux", 1120 - "httparse", 1121 - "log", 1122 - "mime", 1123 - "mime_guess", 1124 - "quick-error", 1125 - "rand", 1126 - "safemem", 1127 - "tempfile", 1128 - "twoway 0.1.8", 1129 - ] 1130 - 1131 - [[package]] 1132 1300 name = "native-tls" 1133 1301 version = "0.2.8" 1134 1302 source = "registry+https://github.com/rust-lang/crates.io-index" ··· 1159 1327 1160 1328 [[package]] 1161 1329 name = "nom" 1162 - version = "6.2.1" 1330 + version = "6.1.2" 1163 1331 source = "registry+https://github.com/rust-lang/crates.io-index" 1164 - checksum = "9c5c51b9083a3c620fa67a2a635d1ce7d95b897e957d6b28ff9a5da960a103a6" 1332 + checksum = "e7413f999671bd4745a7b624bd370a569fb6bc574b23c83a3c5ed2e453f3d5e2" 1165 1333 dependencies = [ 1166 1334 "bitvec", 1167 1335 "funty", ··· 1171 1339 ] 1172 1340 1173 1341 [[package]] 1342 + name = "nom" 1343 + version = "7.1.1" 1344 + source = "registry+https://github.com/rust-lang/crates.io-index" 1345 + checksum = "a8903e5a29a317527874d0402f867152a3d21c908bb0b933e416c65e301d4c36" 1346 + dependencies = [ 1347 + "memchr", 1348 + "minimal-lexical", 1349 + ] 1350 + 1351 + [[package]] 1174 1352 name = "ntapi" 1175 - version = "0.3.6" 1353 + version = "0.3.7" 1176 1354 source = "registry+https://github.com/rust-lang/crates.io-index" 1177 - checksum = "3f6bb902e437b6d86e03cce10a7e2af662292c5dfef23b65899ea3ac9354ad44" 1355 + checksum = "c28774a7fd2fbb4f0babd8237ce554b73af68021b5f695a3cebd6c59bac0980f" 1178 1356 dependencies = [ 1179 1357 "winapi", 1180 1358 ] ··· 1200 1378 1201 1379 [[package]] 1202 1380 name = "num_cpus" 1203 - version = "1.13.0" 1381 + version = "1.13.1" 1204 1382 source = "registry+https://github.com/rust-lang/crates.io-index" 1205 - checksum = "05499f3756671c15885fee9034446956fff3f243d6077b91e5767df161f766b3" 1383 + checksum = "19e64526ebdee182341572e50e9ad03965aa510cd94427a4549448f285e957a1" 1206 1384 dependencies = [ 1207 1385 "hermit-abi", 1208 1386 "libc", 1209 1387 ] 1210 1388 1211 1389 [[package]] 1390 + name = "num_threads" 1391 + version = "0.1.5" 1392 + source = "registry+https://github.com/rust-lang/crates.io-index" 1393 + checksum = "aba1801fb138d8e85e11d0fc70baf4fe1cdfffda7c6cd34a854905df588e5ed0" 1394 + dependencies = [ 1395 + "libc", 1396 + ] 1397 + 1398 + [[package]] 1212 1399 name = "object" 1213 - version = "0.24.0" 1400 + version = "0.27.1" 1214 1401 source = "registry+https://github.com/rust-lang/crates.io-index" 1215 - checksum = "1a5b3dd1c072ee7963717671d1ca129f1048fda25edea6b752bfc71ac8854170" 1402 + checksum = "67ac1d3f9a1d3616fd9a60c8d74296f22406a238b6a72f5cc1e6f314df4ffbf9" 1403 + dependencies = [ 1404 + "memchr", 1405 + ] 1216 1406 1217 1407 [[package]] 1218 1408 name = "once_cell" 1219 - version = "1.8.0" 1409 + version = "1.10.0" 1220 1410 source = "registry+https://github.com/rust-lang/crates.io-index" 1221 - checksum = "692fcb63b64b1758029e0a96ee63e049ce8c5948587f2f7208df04625e5f6b56" 1411 + checksum = "87f3e037eac156d1775da914196f0f37741a274155e34a0b7e427c35d2a2ecb9" 1222 1412 1223 1413 [[package]] 1224 1414 name = "onig" 1225 - version = "6.2.0" 1415 + version = "6.3.1" 1226 1416 source = "registry+https://github.com/rust-lang/crates.io-index" 1227 - checksum = "b16fd3c0e73b516af509c13c4ba76ec0c987ce20d78b38cff356b8d01fc6a6c0" 1417 + checksum = "67ddfe2c93bb389eea6e6d713306880c7f6dcc99a75b659ce145d962c861b225" 1228 1418 dependencies = [ 1229 1419 "bitflags", 1230 1420 "lazy_static", ··· 1234 1424 1235 1425 [[package]] 1236 1426 name = "onig_sys" 1237 - version = "69.7.0" 1427 + version = "69.7.1" 1238 1428 source = "registry+https://github.com/rust-lang/crates.io-index" 1239 - checksum = "9fd9442a09e4fbd08d196ddf419b2c79a43c3a46c800320cc841d45c2449a240" 1429 + checksum = "5dd3eee045c84695b53b20255bb7317063df090b68e18bfac0abb6c39cf7f33e" 1240 1430 dependencies = [ 1241 1431 "cc", 1242 1432 "pkg-config", ··· 1256 1446 1257 1447 [[package]] 1258 1448 name = "openssl" 1259 - version = "0.10.36" 1449 + version = "0.10.38" 1260 1450 source = "registry+https://github.com/rust-lang/crates.io-index" 1261 - checksum = "8d9facdb76fec0b73c406f125d44d86fdad818d66fef0531eec9233ca425ff4a" 1451 + checksum = "0c7ae222234c30df141154f159066c5093ff73b63204dcda7121eb082fc56a95" 1262 1452 dependencies = [ 1263 1453 "bitflags", 1264 1454 "cfg-if", ··· 1270 1460 1271 1461 [[package]] 1272 1462 name = "openssl-probe" 1273 - version = "0.1.4" 1463 + version = "0.1.5" 1274 1464 source = "registry+https://github.com/rust-lang/crates.io-index" 1275 - checksum = "28988d872ab76095a6e6ac88d99b54fd267702734fd7ffe610ca27f533ddb95a" 1465 + checksum = "ff011a302c396a5197692431fc1948019154afc178baf7d8e37367442a4601cf" 1276 1466 1277 1467 [[package]] 1278 1468 name = "openssl-sys" 1279 - version = "0.9.67" 1469 + version = "0.9.72" 1280 1470 source = "registry+https://github.com/rust-lang/crates.io-index" 1281 - checksum = "69df2d8dfc6ce3aaf44b40dec6f487d5a886516cf6879c49e98e0710f310a058" 1471 + checksum = "7e46109c383602735fa0a2e48dd2b7c892b048e1bf69e5c3b1d804b7d9c203cb" 1282 1472 dependencies = [ 1283 1473 "autocfg", 1284 1474 "cc", ··· 1301 1491 dependencies = [ 1302 1492 "instant", 1303 1493 "lock_api", 1304 - "parking_lot_core", 1494 + "parking_lot_core 0.8.5", 1495 + ] 1496 + 1497 + [[package]] 1498 + name = "parking_lot" 1499 + version = "0.12.0" 1500 + source = "registry+https://github.com/rust-lang/crates.io-index" 1501 + checksum = "87f5ec2493a61ac0506c0f4199f99070cbe83857b0337006a30f3e6719b8ef58" 1502 + dependencies = [ 1503 + "lock_api", 1504 + "parking_lot_core 0.9.1", 1305 1505 ] 1306 1506 1307 1507 [[package]] ··· 1319 1519 ] 1320 1520 1321 1521 [[package]] 1522 + name = "parking_lot_core" 1523 + version = "0.9.1" 1524 + source = "registry+https://github.com/rust-lang/crates.io-index" 1525 + checksum = "28141e0cc4143da2443301914478dc976a61ffdb3f043058310c70df2fed8954" 1526 + dependencies = [ 1527 + "cfg-if", 1528 + "libc", 1529 + "redox_syscall", 1530 + "smallvec", 1531 + "windows-sys", 1532 + ] 1533 + 1534 + [[package]] 1322 1535 name = "patreon" 1323 1536 version = "0.1.0" 1324 1537 dependencies = [ ··· 1402 1615 dependencies = [ 1403 1616 "maplit", 1404 1617 "pest", 1405 - "sha-1 0.8.2", 1618 + "sha-1", 1406 1619 ] 1407 1620 1408 1621 [[package]] ··· 1419 1632 1420 1633 [[package]] 1421 1634 name = "pin-project" 1422 - version = "1.0.8" 1635 + version = "1.0.10" 1423 1636 source = "registry+https://github.com/rust-lang/crates.io-index" 1424 - checksum = "576bc800220cc65dac09e99e97b08b358cfab6e17078de8dc5fee223bd2d0c08" 1637 + checksum = "58ad3879ad3baf4e44784bc6a718a8698867bb991f8ce24d1bcbe2cfb4c3a75e" 1425 1638 dependencies = [ 1426 1639 "pin-project-internal", 1427 1640 ] 1428 1641 1429 1642 [[package]] 1430 1643 name = "pin-project-internal" 1431 - version = "1.0.8" 1644 + version = "1.0.10" 1432 1645 source = "registry+https://github.com/rust-lang/crates.io-index" 1433 - checksum = "6e8fe8163d14ce7f0cdac2e040116f22eac817edabff0be91e8aff7e9accf389" 1646 + checksum = "744b6f092ba29c3650faf274db506afd39944f48420f6c86b17cfe0ee1cb36bb" 1434 1647 dependencies = [ 1435 1648 "proc-macro2", 1436 1649 "quote", ··· 1439 1652 1440 1653 [[package]] 1441 1654 name = "pin-project-lite" 1442 - version = "0.2.7" 1655 + version = "0.2.8" 1443 1656 source = "registry+https://github.com/rust-lang/crates.io-index" 1444 - checksum = "8d31d11c69a6b52a174b42bdc0c30e5e11670f90788b2c471c31c1d17d449443" 1657 + checksum = "e280fbe77cc62c91527259e9442153f4688736748d24660126286329742b4c6c" 1445 1658 1446 1659 [[package]] 1447 1660 name = "pin-utils" ··· 1451 1664 1452 1665 [[package]] 1453 1666 name = "pkg-config" 1454 - version = "0.3.19" 1667 + version = "0.3.24" 1455 1668 source = "registry+https://github.com/rust-lang/crates.io-index" 1456 - checksum = "3831453b3449ceb48b6d9c7ad7c96d5ea673e9b470a1dc578c2ce6521230884c" 1669 + checksum = "58893f751c9b0412871a09abd62ecd2a00298c6c83befa223ef98c52aef40cbe" 1457 1670 1458 1671 [[package]] 1459 1672 name = "plist" 1460 - version = "1.2.1" 1673 + version = "1.3.1" 1461 1674 source = "registry+https://github.com/rust-lang/crates.io-index" 1462 - checksum = "a38d026d73eeaf2ade76309d0c65db5a35ecf649e3cec428db316243ea9d6711" 1675 + checksum = "bd39bc6cdc9355ad1dc5eeedefee696bb35c34caf21768741e81826c0bbd7225" 1463 1676 dependencies = [ 1464 1677 "base64", 1465 - "chrono", 1466 1678 "indexmap", 1467 1679 "line-wrap", 1468 1680 "serde", 1681 + "time 0.3.7", 1469 1682 "xml-rs", 1470 1683 ] 1471 1684 1472 1685 [[package]] 1473 1686 name = "ppv-lite86" 1474 - version = "0.2.10" 1687 + version = "0.2.16" 1475 1688 source = "registry+https://github.com/rust-lang/crates.io-index" 1476 - checksum = "ac74c624d6b2d21f425f752262f42188365d7b8ff1aff74c82e45136510a4857" 1689 + checksum = "eb9f9e6e233e5c4a35559a617bf40a4ec447db2e84c20b55a6f83167b7e57872" 1477 1690 1478 1691 [[package]] 1479 1692 name = "pretty" ··· 1495 1708 ] 1496 1709 1497 1710 [[package]] 1498 - name = "proc-macro-hack" 1499 - version = "0.5.19" 1500 - source = "registry+https://github.com/rust-lang/crates.io-index" 1501 - checksum = "dbf0c48bc1d91375ae5c3cd81e3722dff1abcf81a30960240640d223f59fe0e5" 1502 - 1503 - [[package]] 1504 - name = "proc-macro-nested" 1505 - version = "0.1.7" 1506 - source = "registry+https://github.com/rust-lang/crates.io-index" 1507 - checksum = "bc881b2c22681370c6a780e47af9840ef841837bc98118431d4e1868bd0c1086" 1508 - 1509 - [[package]] 1510 1711 name = "proc-macro2" 1511 - version = "1.0.29" 1712 + version = "1.0.36" 1512 1713 source = "registry+https://github.com/rust-lang/crates.io-index" 1513 - checksum = "b9f5105d4fdaab20335ca9565e106a5d9b82b6219b5ba735731124ac6711d23d" 1714 + checksum = "c7342d5883fbccae1cc37a2353b09c87c9b0f3afd73f5fb9bba687a1f733b029" 1514 1715 dependencies = [ 1515 1716 "unicode-xid", 1516 1717 ] ··· 1540 1741 "lazy_static", 1541 1742 "libc", 1542 1743 "memchr", 1543 - "parking_lot", 1744 + "parking_lot 0.11.2", 1544 1745 "procfs", 1545 1746 "thiserror", 1546 1747 ] ··· 1553 1754 1554 1755 [[package]] 1555 1756 name = "quote" 1556 - version = "1.0.9" 1757 + version = "1.0.16" 1557 1758 source = "registry+https://github.com/rust-lang/crates.io-index" 1558 - checksum = "c3d0b9745dc2debf507c8422de05d7226cc1f0644216dfdfead988f9b1ab32a7" 1759 + checksum = "b4af2ec4714533fcdf07e886f17025ace8b997b9ce51204ee69b6da831c3da57" 1559 1760 dependencies = [ 1560 1761 "proc-macro2", 1561 1762 ] ··· 1568 1769 1569 1770 [[package]] 1570 1771 name = "rand" 1571 - version = "0.8.4" 1772 + version = "0.8.5" 1572 1773 source = "registry+https://github.com/rust-lang/crates.io-index" 1573 - checksum = "2e7573632e6454cf6b99d7aac4ccca54be06da05aca2ef7423d22d27d4d4bcd8" 1774 + checksum = "34af8d1a0e25924bc5b7c43c079c942339d8f0a8b57c39049bef581b46327404" 1574 1775 dependencies = [ 1575 1776 "libc", 1576 1777 "rand_chacha", 1577 1778 "rand_core", 1578 - "rand_hc", 1579 1779 ] 1580 1780 1581 1781 [[package]] ··· 1598 1798 ] 1599 1799 1600 1800 [[package]] 1601 - name = "rand_hc" 1602 - version = "0.3.1" 1801 + name = "redox_syscall" 1802 + version = "0.2.11" 1603 1803 source = "registry+https://github.com/rust-lang/crates.io-index" 1604 - checksum = "d51e9f596de227fda2ea6c84607f5558e196eeaf43c986b724ba4fb8fdf497e7" 1804 + checksum = "8380fe0152551244f0747b1bf41737e0f8a74f97a14ccefd1148187271634f3c" 1605 1805 dependencies = [ 1606 - "rand_core", 1806 + "bitflags", 1607 1807 ] 1608 1808 1609 1809 [[package]] 1610 - name = "redox_syscall" 1611 - version = "0.2.10" 1810 + name = "redox_users" 1811 + version = "0.4.2" 1612 1812 source = "registry+https://github.com/rust-lang/crates.io-index" 1613 - checksum = "8383f39639269cde97d255a32bdb68c047337295414940c68bdd30c2e13203ff" 1813 + checksum = "7776223e2696f1aa4c6b0170e83212f47296a00424305117d013dfe86fb0fe55" 1614 1814 dependencies = [ 1615 - "bitflags", 1815 + "getrandom", 1816 + "redox_syscall", 1817 + "thiserror", 1616 1818 ] 1617 1819 1618 1820 [[package]] 1619 1821 name = "regex" 1620 - version = "1.4.6" 1822 + version = "1.5.5" 1621 1823 source = "registry+https://github.com/rust-lang/crates.io-index" 1622 - checksum = "2a26af418b574bd56588335b3a3659a65725d4e636eb1016c2f9e3b38c7cc759" 1824 + checksum = "1a11647b6b25ff05a515cb92c365cec08801e83423a235b51e231e1808747286" 1623 1825 dependencies = [ 1624 1826 "aho-corasick", 1625 1827 "memchr", ··· 1643 1845 1644 1846 [[package]] 1645 1847 name = "reqwest" 1646 - version = "0.11.9" 1848 + version = "0.11.10" 1647 1849 source = "registry+https://github.com/rust-lang/crates.io-index" 1648 - checksum = "87f242f1488a539a79bac6dbe7c8609ae43b7914b7736210f239a37cccb32525" 1850 + checksum = "46a1f7aa4f35e5e8b4160449f51afc758f0ce6454315a9fa7d0d113e958c41eb" 1649 1851 dependencies = [ 1650 1852 "base64", 1651 1853 "bytes", ··· 1685 1887 dependencies = [ 1686 1888 "base64", 1687 1889 "bytecount", 1688 - "itertools 0.10.1", 1890 + "itertools 0.10.3", 1689 1891 "md5", 1690 1892 "mime", 1691 - "nom 6.2.1", 1893 + "nom 6.1.2", 1692 1894 ] 1693 1895 1694 1896 [[package]] ··· 1698 1900 checksum = "7ef03e0a2b150c7a90d01faf6254c9c48a41e95fb2a8c2ac1c6f0d2b9aefc342" 1699 1901 1700 1902 [[package]] 1903 + name = "rustc_version" 1904 + version = "0.4.0" 1905 + source = "registry+https://github.com/rust-lang/crates.io-index" 1906 + checksum = "bfa0f585226d2e68097d4f95d113b15b83a82e819ab25717ec0590d9584ef366" 1907 + dependencies = [ 1908 + "semver", 1909 + ] 1910 + 1911 + [[package]] 1701 1912 name = "ryu" 1702 - version = "1.0.5" 1913 + version = "1.0.9" 1703 1914 source = "registry+https://github.com/rust-lang/crates.io-index" 1704 - checksum = "71d301d4193d031abdd79ff7e3dd721168a9572ef3fe51a1517aba235bd8f86e" 1915 + checksum = "73b4b750c782965c211b42f022f59af1fbceabdd026623714f104152f1ec149f" 1705 1916 1706 1917 [[package]] 1707 1918 name = "safemem" ··· 1729 1940 ] 1730 1941 1731 1942 [[package]] 1732 - name = "scoped-tls" 1733 - version = "1.0.0" 1734 - source = "registry+https://github.com/rust-lang/crates.io-index" 1735 - checksum = "ea6a9290e3c9cf0f18145ef7ffa62d68ee0bf5fcd651017e586dc7fd5da448c2" 1736 - 1737 - [[package]] 1738 1943 name = "scopeguard" 1739 1944 version = "1.1.0" 1740 1945 source = "registry+https://github.com/rust-lang/crates.io-index" ··· 1748 1953 1749 1954 [[package]] 1750 1955 name = "security-framework" 1751 - version = "2.4.2" 1956 + version = "2.6.1" 1752 1957 source = "registry+https://github.com/rust-lang/crates.io-index" 1753 - checksum = "525bc1abfda2e1998d152c45cf13e696f76d0a4972310b22fac1658b05df7c87" 1958 + checksum = "2dc14f172faf8a0194a3aded622712b0de276821addc574fa54fc0a1167e10dc" 1754 1959 dependencies = [ 1755 1960 "bitflags", 1756 1961 "core-foundation", ··· 1761 1966 1762 1967 [[package]] 1763 1968 name = "security-framework-sys" 1764 - version = "2.4.2" 1969 + version = "2.6.1" 1765 1970 source = "registry+https://github.com/rust-lang/crates.io-index" 1766 - checksum = "a9dd14d83160b528b7bfd66439110573efcfbe281b17fc2ca9f39f550d619c7e" 1971 + checksum = "0160a13a177a45bfb43ce71c01580998474f556ad854dcbca936dd2841a5c556" 1767 1972 dependencies = [ 1768 1973 "core-foundation-sys", 1769 1974 "libc", 1770 1975 ] 1771 1976 1772 1977 [[package]] 1978 + name = "semver" 1979 + version = "1.0.6" 1980 + source = "registry+https://github.com/rust-lang/crates.io-index" 1981 + checksum = "a4a3381e03edd24287172047536f20cabde766e2cd3e65e6b00fb3af51c4f38d" 1982 + 1983 + [[package]] 1773 1984 name = "serde" 1774 - version = "1.0.130" 1985 + version = "1.0.136" 1775 1986 source = "registry+https://github.com/rust-lang/crates.io-index" 1776 - checksum = "f12d06de37cf59146fbdecab66aa99f9fe4f78722e3607577a5375d66bd0c913" 1987 + checksum = "ce31e24b01e1e524df96f1c2fdd054405f8d7376249a5110886fb4b658484789" 1777 1988 dependencies = [ 1778 1989 "serde_derive", 1779 1990 ] ··· 1790 2001 1791 2002 [[package]] 1792 2003 name = "serde_derive" 1793 - version = "1.0.130" 2004 + version = "1.0.136" 1794 2005 source = "registry+https://github.com/rust-lang/crates.io-index" 1795 - checksum = "d7bc1a1ab1961464eae040d96713baa5a724a8152c1222492465b54322ec508b" 2006 + checksum = "08597e7152fcd306f41838ed3e37be9eaeed2b61c42e2117266a554fab4662f9" 1796 2007 dependencies = [ 1797 2008 "proc-macro2", 1798 2009 "quote", ··· 1814 2025 1815 2026 [[package]] 1816 2027 name = "serde_json" 1817 - version = "1.0.68" 2028 + version = "1.0.79" 1818 2029 source = "registry+https://github.com/rust-lang/crates.io-index" 1819 - checksum = "0f690853975602e1bfe1ccbf50504d67174e3bcf340f23b5ea9992e0587a52d8" 2030 + checksum = "8e8d9fa5c3b304765ce1fd9c4c8a3de2c8db365a5b91be52f186efc675681d95" 1820 2031 dependencies = [ 1821 2032 "itoa", 1822 2033 "ryu", ··· 1825 2036 1826 2037 [[package]] 1827 2038 name = "serde_urlencoded" 1828 - version = "0.7.0" 2039 + version = "0.7.1" 1829 2040 source = "registry+https://github.com/rust-lang/crates.io-index" 1830 - checksum = "edfa57a7f8d9c1d260a549e7224100f6c43d43f9103e06dd8b4095a9b2b43ce9" 2041 + checksum = "d3491c14715ca2294c4d6a88f15e84739788c1d030eed8c110436aafdaa2f3fd" 1831 2042 dependencies = [ 1832 2043 "form_urlencoded", 1833 2044 "itoa", ··· 1837 2048 1838 2049 [[package]] 1839 2050 name = "serde_yaml" 1840 - version = "0.8.21" 2051 + version = "0.8.23" 1841 2052 source = "registry+https://github.com/rust-lang/crates.io-index" 1842 - checksum = "d8c608a35705a5d3cdc9fbe403147647ff34b921f8e833e49306df898f9b20af" 2053 + checksum = "a4a521f2940385c165a24ee286aa8599633d162077a54bdcae2a6fd5a7bfa7a0" 1843 2054 dependencies = [ 1844 - "dtoa", 1845 2055 "indexmap", 2056 + "ryu", 1846 2057 "serde", 1847 2058 "yaml-rust", 1848 2059 ] ··· 1860 2071 ] 1861 2072 1862 2073 [[package]] 1863 - name = "sha-1" 1864 - version = "0.9.8" 1865 - source = "registry+https://github.com/rust-lang/crates.io-index" 1866 - checksum = "99cd6713db3cf16b6c84e06321e049a9b9f699826e16096d23bbcc44d15d51a6" 1867 - dependencies = [ 1868 - "block-buffer 0.9.0", 1869 - "cfg-if", 1870 - "cpufeatures", 1871 - "digest 0.9.0", 1872 - "opaque-debug 0.3.0", 1873 - ] 1874 - 1875 - [[package]] 1876 2074 name = "sha2" 1877 - version = "0.9.8" 2075 + version = "0.9.9" 1878 2076 source = "registry+https://github.com/rust-lang/crates.io-index" 1879 - checksum = "b69f9a4c9740d74c5baa3fd2e547f9525fa8088a8a958e0ca2409a514e33f5fa" 2077 + checksum = "4d58a1e1bf39749807d89cf2d98ac2dfa0ff1cb3faa38fbb64dd88ac8013d800" 1880 2078 dependencies = [ 1881 2079 "block-buffer 0.9.0", 1882 2080 "cfg-if", ··· 1887 2085 1888 2086 [[package]] 1889 2087 name = "sharded-slab" 1890 - version = "0.1.3" 2088 + version = "0.1.4" 1891 2089 source = "registry+https://github.com/rust-lang/crates.io-index" 1892 - checksum = "740223c51853f3145fe7c90360d2d4232f2b62e3449489c207eccde818979982" 2090 + checksum = "900fba806f70c630b0a382d0d825e17a0f19fcd059a2ade1ff237bcddf446b31" 1893 2091 dependencies = [ 1894 2092 "lazy_static", 1895 2093 ] 1896 2094 1897 2095 [[package]] 1898 2096 name = "shell-words" 1899 - version = "1.0.0" 2097 + version = "1.1.0" 1900 2098 source = "registry+https://github.com/rust-lang/crates.io-index" 1901 - checksum = "b6fa3938c99da4914afedd13bf3d79bcb6c277d1b2c398d23257a304d9e1b074" 2099 + checksum = "24188a676b6ae68c3b2cb3a01be17fbf7240ce009799bb56d5b1409051e78fde" 1902 2100 1903 2101 [[package]] 1904 2102 name = "signal-hook-registry" ··· 1923 2121 1924 2122 [[package]] 1925 2123 name = "slab" 1926 - version = "0.4.4" 2124 + version = "0.4.5" 1927 2125 source = "registry+https://github.com/rust-lang/crates.io-index" 1928 - checksum = "c307a32c1c5c437f38c7fd45d753050587732ba8628319fbdf12a7e289ccc590" 2126 + checksum = "9def91fd1e018fe007022791f865d0ccc9b3a0d5001e01aabb8b40e46000afb5" 1929 2127 1930 2128 [[package]] 1931 2129 name = "smallvec" 1932 - version = "1.6.1" 2130 + version = "1.8.0" 1933 2131 source = "registry+https://github.com/rust-lang/crates.io-index" 1934 - checksum = "fe0f37c9e8f3c5a4a66ad655a93c74daac4ad00c441533bf5c6e7990bb42604e" 2132 + checksum = "f2dd574626839106c320a323308629dcb1acfc96e32a8cba364ddc61ac23ee83" 1935 2133 1936 2134 [[package]] 1937 2135 name = "socket2" 1938 - version = "0.4.2" 2136 + version = "0.4.4" 1939 2137 source = "registry+https://github.com/rust-lang/crates.io-index" 1940 - checksum = "5dc90fe6c7be1a323296982db1836d1ea9e47b6839496dde9a541bc496df3516" 2138 + checksum = "66d72b759436ae32898a2af0a14218dbf55efde3feeb170eb623637db85ee1e0" 1941 2139 dependencies = [ 1942 2140 "libc", 1943 2141 "winapi", ··· 1963 2161 1964 2162 [[package]] 1965 2163 name = "syn" 1966 - version = "1.0.77" 2164 + version = "1.0.89" 1967 2165 source = "registry+https://github.com/rust-lang/crates.io-index" 1968 - checksum = "5239bc68e0fef57495900cfea4e8dc75596d9a319d7e16b1e0a440d24e6fe0a0" 2166 + checksum = "ea297be220d52398dcc07ce15a209fce436d361735ac1db700cab3b6cdfb9f54" 1969 2167 dependencies = [ 1970 2168 "proc-macro2", 1971 2169 "quote", ··· 1973 2171 ] 1974 2172 1975 2173 [[package]] 2174 + name = "sync_wrapper" 2175 + version = "0.1.1" 2176 + source = "registry+https://github.com/rust-lang/crates.io-index" 2177 + checksum = "20518fe4a4c9acf048008599e464deb21beeae3d3578418951a189c235a7a9a8" 2178 + 2179 + [[package]] 1976 2180 name = "syntect" 1977 2181 version = "4.6.0" 1978 2182 source = "registry+https://github.com/rust-lang/crates.io-index" ··· 2002 2206 2003 2207 [[package]] 2004 2208 name = "tempfile" 2005 - version = "3.2.0" 2209 + version = "3.3.0" 2006 2210 source = "registry+https://github.com/rust-lang/crates.io-index" 2007 - checksum = "dac1c663cfc93810f88aed9b8941d48cabf856a1b111c29a40439018d870eb22" 2211 + checksum = "5cdb1ef4eaeeaddc8fbd371e5017057064af0911902ef36b39801f67cc6d79e4" 2008 2212 dependencies = [ 2009 2213 "cfg-if", 2214 + "fastrand", 2010 2215 "libc", 2011 - "rand", 2012 2216 "redox_syscall", 2013 2217 "remove_dir_all", 2014 2218 "winapi", ··· 2016 2220 2017 2221 [[package]] 2018 2222 name = "termcolor" 2019 - version = "1.1.2" 2223 + version = "1.1.3" 2020 2224 source = "registry+https://github.com/rust-lang/crates.io-index" 2021 - checksum = "2dfed899f0eb03f32ee8c6a0aabdb8a7949659e3466561fc0adf54e26d88c5f4" 2225 + checksum = "bab24d30b911b2376f3a13cc2cd443142f0c81dda04c118693e35b3835757755" 2022 2226 dependencies = [ 2023 2227 "winapi-util", 2024 2228 ] ··· 2034 2238 2035 2239 [[package]] 2036 2240 name = "thiserror" 2037 - version = "1.0.29" 2241 + version = "1.0.30" 2038 2242 source = "registry+https://github.com/rust-lang/crates.io-index" 2039 - checksum = "602eca064b2d83369e2b2f34b09c70b605402801927c65c11071ac911d299b88" 2243 + checksum = "854babe52e4df1653706b98fcfc05843010039b406875930a70e4d9644e5c417" 2040 2244 dependencies = [ 2041 2245 "thiserror-impl", 2042 2246 ] 2043 2247 2044 2248 [[package]] 2045 2249 name = "thiserror-impl" 2046 - version = "1.0.29" 2250 + version = "1.0.30" 2047 2251 source = "registry+https://github.com/rust-lang/crates.io-index" 2048 - checksum = "bad553cc2c78e8de258400763a647e80e6d1b31ee237275d756f6836d204494c" 2252 + checksum = "aa32fd3f627f367fe16f893e2597ae3c05020f8bba2666a4e6ea73d377e5714b" 2049 2253 dependencies = [ 2050 2254 "proc-macro2", 2051 2255 "quote", ··· 2072 2276 ] 2073 2277 2074 2278 [[package]] 2279 + name = "time" 2280 + version = "0.3.7" 2281 + source = "registry+https://github.com/rust-lang/crates.io-index" 2282 + checksum = "004cbc98f30fa233c61a38bc77e96a9106e65c88f2d3bef182ae952027e5753d" 2283 + dependencies = [ 2284 + "itoa", 2285 + "libc", 2286 + "num_threads", 2287 + ] 2288 + 2289 + [[package]] 2075 2290 name = "tinyvec" 2076 - version = "1.4.0" 2291 + version = "1.5.1" 2077 2292 source = "registry+https://github.com/rust-lang/crates.io-index" 2078 - checksum = "5241dd6f21443a3606b432718b166d3cedc962fd4b8bea54a8bc7f514ebda986" 2293 + checksum = "2c1c1d5a42b6245520c249549ec267180beaffcc0615401ac8e31853d4b6d8d2" 2079 2294 dependencies = [ 2080 2295 "tinyvec_macros", 2081 2296 ] ··· 2088 2303 2089 2304 [[package]] 2090 2305 name = "tokio" 2091 - version = "1.12.0" 2306 + version = "1.17.0" 2092 2307 source = "registry+https://github.com/rust-lang/crates.io-index" 2093 - checksum = "c2c2416fdedca8443ae44b4527de1ea633af61d8f7169ffa6e72c5b53d24efcc" 2308 + checksum = "2af73ac49756f3f7c01172e34a23e5d0216f6c32333757c2c61feb2bbff5a5ee" 2094 2309 dependencies = [ 2095 - "autocfg", 2096 2310 "bytes", 2097 2311 "libc", 2098 2312 "memchr", 2099 2313 "mio", 2100 2314 "num_cpus", 2101 2315 "once_cell", 2102 - "parking_lot", 2316 + "parking_lot 0.12.0", 2103 2317 "pin-project-lite", 2104 2318 "signal-hook-registry", 2319 + "socket2", 2105 2320 "tokio-macros", 2106 2321 "winapi", 2107 2322 ] 2108 2323 2109 2324 [[package]] 2110 2325 name = "tokio-macros" 2111 - version = "1.3.0" 2326 + version = "1.7.0" 2112 2327 source = "registry+https://github.com/rust-lang/crates.io-index" 2113 - checksum = "54473be61f4ebe4efd09cec9bd5d16fa51d70ea0192213d754d2d500457db110" 2328 + checksum = "b557f72f448c511a979e2564e55d74e6c4432fc96ff4f6241bc6bded342643b7" 2114 2329 dependencies = [ 2115 2330 "proc-macro2", 2116 2331 "quote", ··· 2139 2354 ] 2140 2355 2141 2356 [[package]] 2142 - name = "tokio-tungstenite" 2143 - version = "0.15.0" 2357 + name = "tokio-util" 2358 + version = "0.6.9" 2144 2359 source = "registry+https://github.com/rust-lang/crates.io-index" 2145 - checksum = "511de3f85caf1c98983545490c3d09685fa8eb634e57eec22bb4db271f46cbd8" 2360 + checksum = "9e99e1983e5d376cd8eb4b66604d2e99e79f5bd988c3055891dcd8c9e2604cc0" 2146 2361 dependencies = [ 2147 - "futures-util", 2362 + "bytes", 2363 + "futures-core", 2364 + "futures-sink", 2148 2365 "log", 2149 - "pin-project", 2366 + "pin-project-lite", 2150 2367 "tokio", 2151 - "tungstenite", 2152 2368 ] 2153 2369 2154 2370 [[package]] 2155 2371 name = "tokio-util" 2156 - version = "0.6.8" 2372 + version = "0.7.0" 2157 2373 source = "registry+https://github.com/rust-lang/crates.io-index" 2158 - checksum = "08d3725d3efa29485e87311c5b699de63cde14b00ed4d256b8318aa30ca452cd" 2374 + checksum = "64910e1b9c1901aaf5375561e35b9c057d95ff41a44ede043a03e09279eabaf1" 2159 2375 dependencies = [ 2160 2376 "bytes", 2161 2377 "futures-core", ··· 2166 2382 ] 2167 2383 2168 2384 [[package]] 2385 + name = "tower" 2386 + version = "0.4.12" 2387 + source = "registry+https://github.com/rust-lang/crates.io-index" 2388 + checksum = "9a89fd63ad6adf737582df5db40d286574513c69a11dac5214dc3b5603d6713e" 2389 + dependencies = [ 2390 + "futures-core", 2391 + "futures-util", 2392 + "hdrhistogram", 2393 + "indexmap", 2394 + "pin-project", 2395 + "pin-project-lite", 2396 + "rand", 2397 + "slab", 2398 + "tokio", 2399 + "tokio-util 0.7.0", 2400 + "tower-layer", 2401 + "tower-service", 2402 + "tracing", 2403 + ] 2404 + 2405 + [[package]] 2406 + name = "tower-http" 2407 + version = "0.2.5" 2408 + source = "registry+https://github.com/rust-lang/crates.io-index" 2409 + checksum = "aba3f3efabf7fb41fae8534fc20a817013dd1c12cb45441efb6c82e6556b4cd8" 2410 + dependencies = [ 2411 + "async-compression", 2412 + "base64", 2413 + "bitflags", 2414 + "bytes", 2415 + "futures-core", 2416 + "futures-util", 2417 + "http", 2418 + "http-body", 2419 + "http-range-header", 2420 + "httpdate", 2421 + "iri-string", 2422 + "mime", 2423 + "mime_guess", 2424 + "percent-encoding", 2425 + "pin-project-lite", 2426 + "tokio", 2427 + "tokio-util 0.7.0", 2428 + "tower", 2429 + "tower-layer", 2430 + "tower-service", 2431 + "tracing", 2432 + ] 2433 + 2434 + [[package]] 2435 + name = "tower-layer" 2436 + version = "0.3.1" 2437 + source = "registry+https://github.com/rust-lang/crates.io-index" 2438 + checksum = "343bc9466d3fe6b0f960ef45960509f84480bf4fd96f92901afe7ff3df9d3a62" 2439 + 2440 + [[package]] 2169 2441 name = "tower-service" 2170 2442 version = "0.3.1" 2171 2443 source = "registry+https://github.com/rust-lang/crates.io-index" ··· 2173 2445 2174 2446 [[package]] 2175 2447 name = "tracing" 2176 - version = "0.1.28" 2448 + version = "0.1.32" 2177 2449 source = "registry+https://github.com/rust-lang/crates.io-index" 2178 - checksum = "84f96e095c0c82419687c20ddf5cb3eadb61f4e1405923c9dc8e53a1adacbda8" 2450 + checksum = "4a1bdf54a7c28a2bbf701e1d2233f6c77f473486b94bee4f9678da5a148dca7f" 2179 2451 dependencies = [ 2180 2452 "cfg-if", 2181 2453 "log", ··· 2186 2458 2187 2459 [[package]] 2188 2460 name = "tracing-attributes" 2189 - version = "0.1.16" 2461 + version = "0.1.20" 2190 2462 source = "registry+https://github.com/rust-lang/crates.io-index" 2191 - checksum = "98863d0dd09fa59a1b79c6750ad80dbda6b75f4e71c437a6a1a8cb91a8bcbd77" 2463 + checksum = "2e65ce065b4b5c53e73bb28912318cb8c9e9ad3921f1d669eb0e68b4c8143a2b" 2192 2464 dependencies = [ 2193 2465 "proc-macro2", 2194 2466 "quote", ··· 2197 2469 2198 2470 [[package]] 2199 2471 name = "tracing-core" 2200 - version = "0.1.21" 2472 + version = "0.1.23" 2201 2473 source = "registry+https://github.com/rust-lang/crates.io-index" 2202 - checksum = "1f4ed65637b8390770814083d20756f87bfa2c21bf2f110babdc5438351746e4" 2474 + checksum = "aa31669fa42c09c34d94d8165dd2012e8ff3c66aca50f3bb226b68f216f2706c" 2203 2475 dependencies = [ 2204 2476 "lazy_static", 2477 + "valuable", 2205 2478 ] 2206 2479 2207 2480 [[package]] ··· 2237 2510 2238 2511 [[package]] 2239 2512 name = "tracing-subscriber" 2240 - version = "0.3.7" 2513 + version = "0.3.9" 2241 2514 source = "registry+https://github.com/rust-lang/crates.io-index" 2242 - checksum = "5312f325fe3588e277415f5a6cca1f4ccad0f248c4cd5a4bd33032d7286abc22" 2515 + checksum = "9e0ab7bdc962035a87fba73f3acca9b8a8d0034c2e6f60b84aeaaddddc155dce" 2243 2516 dependencies = [ 2244 - "ansi_term 0.12.1", 2517 + "ansi_term", 2245 2518 "sharded-slab", 2246 2519 "smallvec", 2247 2520 "thread_local", ··· 2256 2529 checksum = "59547bce71d9c38b83d9c0e92b6066c4253371f15005def0c30d9657f50c7642" 2257 2530 2258 2531 [[package]] 2259 - name = "tungstenite" 2260 - version = "0.14.0" 2261 - source = "registry+https://github.com/rust-lang/crates.io-index" 2262 - checksum = "a0b2d8558abd2e276b0a8df5c05a2ec762609344191e5fd23e292c910e9165b5" 2263 - dependencies = [ 2264 - "base64", 2265 - "byteorder", 2266 - "bytes", 2267 - "http", 2268 - "httparse", 2269 - "log", 2270 - "rand", 2271 - "sha-1 0.9.8", 2272 - "thiserror", 2273 - "url", 2274 - "utf-8", 2275 - ] 2276 - 2277 - [[package]] 2278 - name = "twoway" 2279 - version = "0.1.8" 2280 - source = "registry+https://github.com/rust-lang/crates.io-index" 2281 - checksum = "59b11b2b5241ba34be09c3cc85a36e56e48f9888862e19cedf23336d35316ed1" 2282 - dependencies = [ 2283 - "memchr", 2284 - ] 2285 - 2286 - [[package]] 2287 2532 name = "twoway" 2288 2533 version = "0.2.2" 2289 2534 source = "registry+https://github.com/rust-lang/crates.io-index" ··· 2301 2546 2302 2547 [[package]] 2303 2548 name = "typenum" 2304 - version = "1.14.0" 2549 + version = "1.15.0" 2305 2550 source = "registry+https://github.com/rust-lang/crates.io-index" 2306 - checksum = "b63708a265f51345575b27fe43f9500ad611579e764c79edbc2037b1121959ec" 2551 + checksum = "dcf81ac59edc17cc8697ff311e8f5ef2d99fcbd9817b34cec66f90b6c3dfd987" 2307 2552 2308 2553 [[package]] 2309 2554 name = "ucd-trie" ··· 2328 2573 2329 2574 [[package]] 2330 2575 name = "unicode-bidi" 2331 - version = "0.3.6" 2576 + version = "0.3.7" 2332 2577 source = "registry+https://github.com/rust-lang/crates.io-index" 2333 - checksum = "246f4c42e67e7a4e3c6106ff716a5d067d4132a642840b242e357e468a2a0085" 2578 + checksum = "1a01404663e3db436ed2746d9fefef640d868edae3cceb81c3b8d5732fda678f" 2334 2579 2335 2580 [[package]] 2336 2581 name = "unicode-normalization" ··· 2372 2617 ] 2373 2618 2374 2619 [[package]] 2375 - name = "utf-8" 2376 - version = "0.7.6" 2377 - source = "registry+https://github.com/rust-lang/crates.io-index" 2378 - checksum = "09cc8ee72d2a9becf2f2febe0205bbed8fc6615b7cb429ad062dc7b7ddd036a9" 2379 - 2380 - [[package]] 2381 2620 name = "uuid" 2382 2621 version = "0.8.2" 2383 2622 source = "registry+https://github.com/rust-lang/crates.io-index" ··· 2388 2627 ] 2389 2628 2390 2629 [[package]] 2630 + name = "valuable" 2631 + version = "0.1.0" 2632 + source = "registry+https://github.com/rust-lang/crates.io-index" 2633 + checksum = "830b7e5d4d90034032940e4ace0d9a9a057e7a45cd94e6c007832e39edb82f6d" 2634 + 2635 + [[package]] 2391 2636 name = "vcpkg" 2392 2637 version = "0.2.15" 2393 2638 source = "registry+https://github.com/rust-lang/crates.io-index" ··· 2401 2646 2402 2647 [[package]] 2403 2648 name = "version_check" 2404 - version = "0.9.3" 2649 + version = "0.9.4" 2405 2650 source = "registry+https://github.com/rust-lang/crates.io-index" 2406 - checksum = "5fecdca9a5291cc2b8dcf7dc02453fee791a280f3743cb0905f8822ae463b3fe" 2651 + checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f" 2407 2652 2408 2653 [[package]] 2409 2654 name = "walkdir" ··· 2427 2672 ] 2428 2673 2429 2674 [[package]] 2430 - name = "warp" 2431 - version = "0.3.2" 2675 + name = "wasi" 2676 + version = "0.10.2+wasi-snapshot-preview1" 2432 2677 source = "registry+https://github.com/rust-lang/crates.io-index" 2433 - checksum = "3cef4e1e9114a4b7f1ac799f16ce71c14de5778500c5450ec6b7b920c55b587e" 2434 - dependencies = [ 2435 - "bytes", 2436 - "futures-channel", 2437 - "futures-util", 2438 - "headers", 2439 - "http", 2440 - "hyper", 2441 - "log", 2442 - "mime", 2443 - "mime_guess", 2444 - "multipart", 2445 - "percent-encoding", 2446 - "pin-project", 2447 - "scoped-tls", 2448 - "serde", 2449 - "serde_json", 2450 - "serde_urlencoded", 2451 - "tokio", 2452 - "tokio-stream", 2453 - "tokio-tungstenite", 2454 - "tokio-util", 2455 - "tower-service", 2456 - "tracing", 2457 - ] 2678 + checksum = "fd6fbd9a79829dd1ad0cc20627bf1ed606756a7f77edff7b66b7064f9cb327c6" 2458 2679 2459 2680 [[package]] 2460 2681 name = "wasi" 2461 - version = "0.10.2+wasi-snapshot-preview1" 2682 + version = "0.11.0+wasi-snapshot-preview1" 2462 2683 source = "registry+https://github.com/rust-lang/crates.io-index" 2463 - checksum = "fd6fbd9a79829dd1ad0cc20627bf1ed606756a7f77edff7b66b7064f9cb327c6" 2684 + checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" 2464 2685 2465 2686 [[package]] 2466 2687 name = "wasm-bindgen" 2467 - version = "0.2.78" 2688 + version = "0.2.79" 2468 2689 source = "registry+https://github.com/rust-lang/crates.io-index" 2469 - checksum = "632f73e236b219150ea279196e54e610f5dbafa5d61786303d4da54f84e47fce" 2690 + checksum = "25f1af7423d8588a3d840681122e72e6a24ddbcb3f0ec385cac0d12d24256c06" 2470 2691 dependencies = [ 2471 2692 "cfg-if", 2472 2693 "wasm-bindgen-macro", ··· 2474 2695 2475 2696 [[package]] 2476 2697 name = "wasm-bindgen-backend" 2477 - version = "0.2.78" 2698 + version = "0.2.79" 2478 2699 source = "registry+https://github.com/rust-lang/crates.io-index" 2479 - checksum = "a317bf8f9fba2476b4b2c85ef4c4af8ff39c3c7f0cdfeed4f82c34a880aa837b" 2700 + checksum = "8b21c0df030f5a177f3cba22e9bc4322695ec43e7257d865302900290bcdedca" 2480 2701 dependencies = [ 2481 2702 "bumpalo", 2482 2703 "lazy_static", ··· 2489 2710 2490 2711 [[package]] 2491 2712 name = "wasm-bindgen-futures" 2492 - version = "0.4.28" 2713 + version = "0.4.29" 2493 2714 source = "registry+https://github.com/rust-lang/crates.io-index" 2494 - checksum = "8e8d7523cb1f2a4c96c1317ca690031b714a51cc14e05f712446691f413f5d39" 2715 + checksum = "2eb6ec270a31b1d3c7e266b999739109abce8b6c87e4b31fcfcd788b65267395" 2495 2716 dependencies = [ 2496 2717 "cfg-if", 2497 2718 "js-sys", ··· 2501 2722 2502 2723 [[package]] 2503 2724 name = "wasm-bindgen-macro" 2504 - version = "0.2.78" 2725 + version = "0.2.79" 2505 2726 source = "registry+https://github.com/rust-lang/crates.io-index" 2506 - checksum = "d56146e7c495528bf6587663bea13a8eb588d39b36b679d83972e1a2dbbdacf9" 2727 + checksum = "2f4203d69e40a52ee523b2529a773d5ffc1dc0071801c87b3d270b471b80ed01" 2507 2728 dependencies = [ 2508 2729 "quote", 2509 2730 "wasm-bindgen-macro-support", ··· 2511 2732 2512 2733 [[package]] 2513 2734 name = "wasm-bindgen-macro-support" 2514 - version = "0.2.78" 2735 + version = "0.2.79" 2515 2736 source = "registry+https://github.com/rust-lang/crates.io-index" 2516 - checksum = "7803e0eea25835f8abdc585cd3021b3deb11543c6fe226dcd30b228857c5c5ab" 2737 + checksum = "bfa8a30d46208db204854cadbb5d4baf5fcf8071ba5bf48190c3e59937962ebc" 2517 2738 dependencies = [ 2518 2739 "proc-macro2", 2519 2740 "quote", ··· 2524 2745 2525 2746 [[package]] 2526 2747 name = "wasm-bindgen-shared" 2527 - version = "0.2.78" 2748 + version = "0.2.79" 2528 2749 source = "registry+https://github.com/rust-lang/crates.io-index" 2529 - checksum = "0237232789cf037d5480773fe568aac745bfe2afbc11a863e97901780a6b47cc" 2750 + checksum = "3d958d035c4438e28c70e4321a2911302f10135ce78a9c7834c0cab4123d06a2" 2530 2751 2531 2752 [[package]] 2532 2753 name = "web-sys" 2533 - version = "0.3.55" 2754 + version = "0.3.56" 2534 2755 source = "registry+https://github.com/rust-lang/crates.io-index" 2535 - checksum = "38eb105f1c59d9eaa6b5cdc92b859d85b926e82cb2e0945cd0c9259faa6fe9fb" 2756 + checksum = "c060b319f29dd25724f09a2ba1418f142f539b2be99fbf4d2d5a8f7330afb8eb" 2536 2757 dependencies = [ 2537 2758 "js-sys", 2538 2759 "wasm-bindgen", ··· 2570 2791 checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" 2571 2792 2572 2793 [[package]] 2794 + name = "windows-sys" 2795 + version = "0.32.0" 2796 + source = "registry+https://github.com/rust-lang/crates.io-index" 2797 + checksum = "3df6e476185f92a12c072be4a189a0210dcdcf512a1891d6dff9edb874deadc6" 2798 + dependencies = [ 2799 + "windows_aarch64_msvc", 2800 + "windows_i686_gnu", 2801 + "windows_i686_msvc", 2802 + "windows_x86_64_gnu", 2803 + "windows_x86_64_msvc", 2804 + ] 2805 + 2806 + [[package]] 2807 + name = "windows_aarch64_msvc" 2808 + version = "0.32.0" 2809 + source = "registry+https://github.com/rust-lang/crates.io-index" 2810 + checksum = "d8e92753b1c443191654ec532f14c199742964a061be25d77d7a96f09db20bf5" 2811 + 2812 + [[package]] 2813 + name = "windows_i686_gnu" 2814 + version = "0.32.0" 2815 + source = "registry+https://github.com/rust-lang/crates.io-index" 2816 + checksum = "6a711c68811799e017b6038e0922cb27a5e2f43a2ddb609fe0b6f3eeda9de615" 2817 + 2818 + [[package]] 2819 + name = "windows_i686_msvc" 2820 + version = "0.32.0" 2821 + source = "registry+https://github.com/rust-lang/crates.io-index" 2822 + checksum = "146c11bb1a02615db74680b32a68e2d61f553cc24c4eb5b4ca10311740e44172" 2823 + 2824 + [[package]] 2825 + name = "windows_x86_64_gnu" 2826 + version = "0.32.0" 2827 + source = "registry+https://github.com/rust-lang/crates.io-index" 2828 + checksum = "c912b12f7454c6620635bbff3450962753834be2a594819bd5e945af18ec64bc" 2829 + 2830 + [[package]] 2831 + name = "windows_x86_64_msvc" 2832 + version = "0.32.0" 2833 + source = "registry+https://github.com/rust-lang/crates.io-index" 2834 + checksum = "504a2476202769977a040c6364301a3f65d0cc9e3fb08600b2bda150a0488316" 2835 + 2836 + [[package]] 2573 2837 name = "winreg" 2574 - version = "0.7.0" 2838 + version = "0.10.1" 2575 2839 source = "registry+https://github.com/rust-lang/crates.io-index" 2576 - checksum = "0120db82e8a1e0b9fb3345a539c478767c0048d842860994d96113d5b667bd69" 2840 + checksum = "80d0f4e272c85def139476380b12f9ac60926689dd2e01d4923222f40580869d" 2577 2841 dependencies = [ 2578 2842 "winapi", 2579 2843 ] ··· 2586 2850 2587 2851 [[package]] 2588 2852 name = "xdg" 2589 - version = "2.2.0" 2853 + version = "2.4.1" 2590 2854 source = "registry+https://github.com/rust-lang/crates.io-index" 2591 - checksum = "d089681aa106a86fade1b0128fb5daf07d5867a509ab036d99988dec80429a57" 2855 + checksum = "0c4583db5cbd4c4c0303df2d15af80f0539db703fa1c68802d4cbbd2dd0f88f6" 2856 + dependencies = [ 2857 + "dirs", 2858 + ] 2592 2859 2593 2860 [[package]] 2594 2861 name = "xesite" 2595 - version = "2.3.0" 2862 + version = "2.4.0" 2596 2863 dependencies = [ 2864 + "axum", 2865 + "axum-extra", 2866 + "axum-macros", 2597 2867 "cfcache", 2598 2868 "chrono", 2599 2869 "color-eyre", 2600 2870 "comrak", 2871 + "derive_more", 2601 2872 "envy", 2602 2873 "estimated_read_time", 2603 2874 "eyre", 2604 2875 "futures", 2605 2876 "glob", 2606 - "go_vanity", 2877 + "http", 2878 + "http-body", 2607 2879 "hyper", 2608 2880 "jsonfeed", 2609 2881 "kankyo", ··· 2627 2899 "thiserror", 2628 2900 "tokio", 2629 2901 "tokio-stream", 2902 + "tower", 2903 + "tower-http", 2630 2904 "tracing", 2631 2905 "tracing-futures", 2632 2906 "tracing-subscriber", 2633 2907 "url", 2634 2908 "uuid", 2635 - "warp", 2636 2909 "xml-rs", 2637 2910 ] 2638 2911
+16 -4
Cargo.toml
··· 1 1 [package] 2 2 name = "xesite" 3 - version = "2.3.0" 3 + version = "2.4.0" 4 4 authors = ["Xe Iaso <me@christine.website>"] 5 5 edition = "2018" 6 6 build = "src/build.rs" ··· 9 9 # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html 10 10 11 11 [dependencies] 12 + axum = "0.4" 13 + axum-macros = "0.1" 14 + axum-extra = "0.1" 12 15 color-eyre = "0.6" 13 16 chrono = "0.4" 14 17 comrak = "0.12.1" 18 + derive_more = "0.99" 15 19 envy = "0.4" 16 20 estimated_read_time = "1" 17 21 futures = "0.3" 18 22 glob = "0.3" 23 + http = "0.2" 24 + http-body = "0.4" 19 25 hyper = "0.14" 20 26 kankyo = "0.3" 21 27 lazy_static = "1.4" ··· 34 40 tracing = "0.1" 35 41 tracing-futures = "0.2" 36 42 tracing-subscriber = { version = "0.3", features = ["fmt"] } 37 - warp = "0.3" 38 43 xml-rs = "0.8" 39 44 url = "2" 40 45 uuid = { version = "0.8", features = ["serde", "v4"] } 41 46 42 47 # workspace dependencies 43 48 cfcache = { path = "./lib/cfcache" } 44 - go_vanity = { path = "./lib/go_vanity" } 45 49 jsonfeed = { path = "./lib/jsonfeed" } 46 50 mi = { path = "./lib/mi" } 47 51 patreon = { path = "./lib/patreon" } 48 52 53 + [dependencies.tower] 54 + version = "0.4" 55 + features = [ "full" ] 56 + 57 + [dependencies.tower-http] 58 + version = "0.2" 59 + features = [ "full" ] 60 + 49 61 # os-specific dependencies 50 62 [target.'cfg(target_os = "linux")'.dependencies] 51 63 sdnotify = { version = "0.2", default-features = false } 52 64 53 65 [build-dependencies] 54 - ructe = { version = "0.13", features = ["warp02"] } 66 + ructe = { version = "0.13", features = [ "mime03" ] } 55 67 56 68 [dev-dependencies] 57 69 pfacts = "0"
+81
blog/site-update-axum-2022-03-21.markdown
··· 1 + --- 2 + title: "Site Update: Axum" 3 + date: 2022-03-21 4 + --- 5 + 6 + I have made a bunch of huge changes to my website that hopefully you won't 7 + notice unless you read this post that points them out to you. I have redone how 8 + the website's URL routing works to use 9 + [axum](https://tokio.rs/blog/2021-07-announcing-axum) instead of 10 + [warp](https://docs.rs/warp/latest/warp/). 11 + 12 + I chose warp fairly arbitrarily when I was getting into the swing of Rust. This 13 + choice turned out to be a bit of a mistake. Don't get me wrong, warp is a 14 + fantastic framework, but overall I've not been happy with how it impacts compile 15 + times. Warp works by pushing a lot of the complexities with HTTP routing into 16 + the type system. This can lead to undebuggable inscruitable types that make it 17 + really hard to understand what is wrong. Here is the autogenerated type for the 18 + `/blog/:name` route: 19 + 20 + ``` 21 + warp::filter::and::And<warp::filter::and::And<impl warp::filter::FilterBase<Extract = (), Error = Infallible> + warp::Filter + std::marker::Copy, Exact<warp::path::internal::Opaque<main::{closure#0}::__StaticPath>>>, warp::filter::and_then::AndThen<warp::filter::and::And<warp::filter::and::And<warp::filter::and::And<warp::filter::and::And<impl warp::filter::FilterBase<Extract = (), Error = Infallible> + warp::Filter + std::marker::Copy, impl warp::filter::FilterBase<Extract = (std::string::String,), Error = Rejection> + warp::Filter + std::marker::Copy>, impl warp::filter::FilterBase<Extract = (), Error = Rejection> + warp::Filter + std::marker::Copy>, impl warp::filter::FilterBase<Extract = (Arc<app::State>,), Error = Infallible> + warp::Filter + Clone>, impl warp::filter::FilterBase<Extract = (), Error = Rejection> + warp::Filter + std::marker::Copy>, fn(std::string::String, Arc<app::State>) -> impl warp::Future<Output = Result<Opaque(DefId(0:1249 ~ xesite[3495]::handlers::blog::post_view::{opaque#0}::{opaque#0}), []), Rejection>> {blog::post_view}>> 22 + ``` 23 + 24 + [What the heck is that? Is that a binary tree?](conversation://Numa/delet) 25 + 26 + [Yep. It's insufferable to try and debug too.](conversation://Cadey/coffee) 27 + 28 + Yeah, it's really hard to understand what's going on in error messages because 29 + of this. This also means that the routes are put into a binary tree in the type 30 + system, which means if your tree is unbalanced then you get slower compile times 31 + and a slight hit at runtime as the framework traverses your binary tree to 32 + figure out what to do. This has also made it difficult for me to add features 33 + such as [historical views of my RSS feed](https://github.com/Xe/site/issues/419) 34 + or other things I want to add like the April Fools day feature I've been working 35 + on. 36 + 37 + When I went out framework shopping, I tried a few things and got reccomendations 38 + from a trusted friend before I finally settled on axum as the heart of this 39 + website. Axum has a few major advantages that bbrought me "in the door": 40 + 41 + - It's maintained by the tokio team 42 + - It leverages the type system of Rust to make writing handlers easier 43 + - It uses extractors (think lenses) to help you pick out the subset of data you 44 + need, not blindly giving you everything and hoping you figure it out 45 + - It has sub-routers which can have different middleware stacks than the main 46 + one (useful for things like API authentication) 47 + 48 + And it has these disadvantages: 49 + 50 + - Writing middleware is kinda weird (though this may be because I'm not used to 51 + working with tower), but easy once you get the general flow of things 52 + - I can't find a way to have the template data get continuously piped to client 53 + connections instead of rendering it to a buffer and then writing that buffer 54 + to the client 55 + - It doesn't have the biggest mindshare and one of the best ways to get unstuck 56 + at the time of writing this article is to ask on their Discord server 57 + 58 + Overall, I've been happy with the experience of porting over my site to using 59 + Axum. I did [a stream on Twitch](https://www.twitch.tv/videos/1429533858) where 60 + I ported it all over if you want to watch the process and hear my thought 61 + processes as I was figuring things out. 62 + 63 + As users, nothing should have changed about this site. However I'm almost 64 + certain that I did forget to port _something_ over, so if I missed something you 65 + rely on, [get in contact](/contact). I have not gotten the Patreon API 66 + interoperability code fixed yet, so that is the next major issue. I am going to 67 + figure out how refresh tokens work the hard way and make the patrons page 68 + auto-updating instead of having to [manually get a new API key every 69 + month](https://github.com/Xe/site/blob/main/docs/patron-page.org). I am also 70 + looking into having that patrons page be updated by a cronjob that emits json to 71 + the disk and have my site load from that instead of just hoping that the patreon 72 + API credentials are up to date. We'll see how that goes, but you can track that 73 + [here](https://github.com/Xe/site/issues/442). I will likely do a livestream for 74 + this. 75 + 76 + I have also contacted a copyeditor for my blog. I am so happy with the results 77 + so far. [My Devops post](/blog/social-quandry-devops-2022-03-17) was the first 78 + thing that the editor reviewed and they absolutely tore my first draft in half 79 + and helped me put the parts back together into something more palateable. I am 80 + beyond satisfied with this and will continue to use this editor in the future. I 81 + wish I had gotten a copyeditor sooner.
-14
examples/warp.rs
··· 1 - use warp::Filter; 2 - 3 - #[tokio::main] 4 - async fn main() { 5 - let hello = warp::path!("hello" / String) 6 - .map(|name| format!("Hello, {}!", name)); 7 - let health = warp::path!(".within" / "health") 8 - .map(|| "OK"); 9 - let routes = hello.or(health); 10 - 11 - warp::serve(routes) 12 - .run(([0, 0, 0, 0], 3030)) 13 - .await; 14 - }
-15
lib/go_vanity/Cargo.toml
··· 1 - [package] 2 - name = "go_vanity" 3 - version = "0.2.0" 4 - authors = ["Xe Iaso <me@christine.website>"] 5 - edition = "2018" 6 - build = "src/build.rs" 7 - 8 - # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html 9 - 10 - [dependencies] 11 - mime = "0.3" 12 - warp = "0.3" 13 - 14 - [build-dependencies] 15 - ructe = { version = "0.13", features = ["warp02"] }
-5
lib/go_vanity/src/build.rs
··· 1 - use ructe::{Result, Ructe}; 2 - 3 - fn main() -> Result<()> { 4 - Ructe::from_env()?.compile_templates("templates") 5 - }
-12
lib/go_vanity/src/lib.rs
··· 1 - use crate::templates::RenderRucte; 2 - use warp::{http::Response, Rejection, Reply}; 3 - 4 - include!(concat!(env!("OUT_DIR"), "/templates.rs")); 5 - 6 - pub async fn gitea(pkg_name: &str, git_repo: &str, branch: &str) -> Result<impl Reply, Rejection> { 7 - Response::builder().html(|o| templates::gitea_html(o, pkg_name, git_repo, branch)) 8 - } 9 - 10 - pub async fn github(pkg_name: &str, git_repo: &str, branch: &str) -> Result<impl Reply, Rejection> { 11 - Response::builder().html(|o| templates::github_html(o, pkg_name, git_repo, branch)) 12 - }
lib/go_vanity/templates/gitea.rs.html templates/gitea.rs.html
-14
lib/go_vanity/templates/github.rs.html
··· 1 - @(pkg_name: &str, git_repo: &str, branch: &str) 2 - 3 - <!DOCTYPE html> 4 - <html> 5 - <head> 6 - <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/> 7 - <meta name="go-import" content="@pkg_name git @git_repo"> 8 - <meta name="go-source" content="@pkg_name @git_repo @git_repo/tree/@branch@{/dir@} @git_repo/blob/@branch@{/dir@}/@{file@}#L@{line@}"> 9 - <meta http-equiv="refresh" content="0; url=https://godoc.org/@pkg_name"> 10 - </head> 11 - <body> 12 - Please see <a href="https://godoc.org/@pkg_name">here</a> for documentation on this package. 13 - </body> 14 - </html>
+2 -2
lib/mi/src/lib.rs
··· 1 1 use color_eyre::eyre::Result; 2 2 use reqwest::header; 3 - use serde::Deserialize; 3 + use serde::{Deserialize, Serialize}; 4 4 use tracing::instrument; 5 5 6 6 const USER_AGENT_BASE: &str = concat!( ··· 58 58 } 59 59 } 60 60 61 - #[derive(Debug, Deserialize, Eq, PartialEq, Clone)] 61 + #[derive(Debug, Deserialize, Eq, PartialEq, Clone, Serialize)] 62 62 pub struct WebMention { 63 63 pub source: String, 64 64 pub title: Option<String>,
+94
src/domainsocket.rs
··· 1 + use axum::extract::connect_info; 2 + use futures::ready; 3 + use hyper::{ 4 + client::connect::{Connected, Connection}, 5 + server::accept::Accept, 6 + }; 7 + use std::{ 8 + io, 9 + pin::Pin, 10 + sync::Arc, 11 + task::{Context, Poll}, 12 + }; 13 + use tokio::{ 14 + io::{AsyncRead, AsyncWrite}, 15 + net::{unix::UCred, UnixListener, UnixStream}, 16 + }; 17 + use tower::BoxError; 18 + 19 + pub struct ServerAccept { 20 + pub uds: UnixListener, 21 + } 22 + 23 + impl Accept for ServerAccept { 24 + type Conn = UnixStream; 25 + type Error = BoxError; 26 + 27 + fn poll_accept( 28 + self: Pin<&mut Self>, 29 + cx: &mut Context<'_>, 30 + ) -> Poll<Option<Result<Self::Conn, Self::Error>>> { 31 + let (stream, _addr) = ready!(self.uds.poll_accept(cx))?; 32 + Poll::Ready(Some(Ok(stream))) 33 + } 34 + } 35 + 36 + pub struct ClientConnection { 37 + pub stream: UnixStream, 38 + } 39 + 40 + impl AsyncWrite for ClientConnection { 41 + fn poll_write( 42 + mut self: Pin<&mut Self>, 43 + cx: &mut Context<'_>, 44 + buf: &[u8], 45 + ) -> Poll<Result<usize, io::Error>> { 46 + Pin::new(&mut self.stream).poll_write(cx, buf) 47 + } 48 + 49 + fn poll_flush(mut self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll<Result<(), io::Error>> { 50 + Pin::new(&mut self.stream).poll_flush(cx) 51 + } 52 + 53 + fn poll_shutdown( 54 + mut self: Pin<&mut Self>, 55 + cx: &mut Context<'_>, 56 + ) -> Poll<Result<(), io::Error>> { 57 + Pin::new(&mut self.stream).poll_shutdown(cx) 58 + } 59 + } 60 + 61 + impl AsyncRead for ClientConnection { 62 + fn poll_read( 63 + mut self: Pin<&mut Self>, 64 + cx: &mut Context<'_>, 65 + buf: &mut tokio::io::ReadBuf<'_>, 66 + ) -> Poll<io::Result<()>> { 67 + Pin::new(&mut self.stream).poll_read(cx, buf) 68 + } 69 + } 70 + 71 + impl Connection for ClientConnection { 72 + fn connected(&self) -> Connected { 73 + Connected::new() 74 + } 75 + } 76 + 77 + #[derive(Clone, Debug)] 78 + #[allow(dead_code)] 79 + pub struct UdsConnectInfo { 80 + pub peer_addr: Arc<tokio::net::unix::SocketAddr>, 81 + pub peer_cred: UCred, 82 + } 83 + 84 + impl connect_info::Connected<&UnixStream> for UdsConnectInfo { 85 + fn connect_info(target: &UnixStream) -> Self { 86 + let peer_addr = target.peer_addr().unwrap(); 87 + let peer_cred = target.peer_cred().unwrap(); 88 + 89 + Self { 90 + peer_addr: Arc::new(peer_addr), 91 + peer_cred, 92 + } 93 + } 94 + }
+31 -26
src/handlers/blog.rs
··· 1 - use super::{PostNotFound, SeriesNotFound, LAST_MODIFIED}; 2 - use crate::{ 3 - app::State, 4 - post::Post, 5 - templates::{self, Html, RenderRucte}, 1 + use super::Result; 2 + use crate::{app::State, post::Post, templates}; 3 + use axum::{ 4 + extract::{Extension, Path}, 5 + response::Html, 6 6 }; 7 7 use lazy_static::lazy_static; 8 8 use prometheus::{opts, register_int_counter_vec, IntCounterVec}; 9 9 use std::sync::Arc; 10 10 use tracing::{error, instrument}; 11 - use warp::{http::Response, Rejection, Reply}; 12 11 13 12 lazy_static! { 14 13 static ref HIT_COUNTER: IntCounterVec = register_int_counter_vec!( ··· 19 18 } 20 19 21 20 #[instrument(skip(state))] 22 - pub async fn index(state: Arc<State>) -> Result<impl Reply, Rejection> { 21 + pub async fn index(Extension(state): Extension<Arc<State>>) -> Result { 23 22 let state = state.clone(); 24 - Response::builder() 25 - .header("Last-Modified", &*LAST_MODIFIED) 26 - .html(|o| templates::blogindex_html(o, state.blog.clone())) 23 + let mut result: Vec<u8> = vec![]; 24 + templates::blogindex_html(&mut result, state.blog.clone())?; 25 + Ok(Html(result)) 27 26 } 28 27 29 28 #[instrument(skip(state))] 30 - pub async fn series(state: Arc<State>) -> Result<impl Reply, Rejection> { 29 + pub async fn series(Extension(state): Extension<Arc<State>>) -> Result { 31 30 let state = state.clone(); 32 31 let mut series: Vec<String> = vec![]; 32 + let mut result: Vec<u8> = vec![]; 33 33 34 34 for post in &state.blog { 35 35 if post.front_matter.series.is_some() { ··· 40 40 series.sort(); 41 41 series.dedup(); 42 42 43 - Response::builder() 44 - .header("Last-Modified", &*LAST_MODIFIED) 45 - .html(|o| templates::series_html(o, series)) 43 + templates::series_html(&mut result, series)?; 44 + Ok(Html(result)) 46 45 } 47 46 48 47 #[instrument(skip(state))] 49 - pub async fn series_view(series: String, state: Arc<State>) -> Result<impl Reply, Rejection> { 48 + pub async fn series_view( 49 + Path(series): Path<String>, 50 + Extension(state): Extension<Arc<State>>, 51 + ) -> Result { 50 52 let state = state.clone(); 51 53 let mut posts: Vec<Post> = vec![]; 54 + let mut result: Vec<u8> = vec![]; 52 55 53 56 for post in &state.blog { 54 57 if post.front_matter.series.is_none() { ··· 62 65 63 66 if posts.len() == 0 { 64 67 error!("series not found"); 65 - Err(SeriesNotFound(series).into()) 66 - } else { 67 - Response::builder() 68 - .header("Last-Modified", &*LAST_MODIFIED) 69 - .html(|o| templates::series_posts_html(o, series, &posts)) 68 + return Err(super::Error::SeriesNotFound(series)); 70 69 } 70 + 71 + templates::series_posts_html(&mut result, series, &posts).unwrap(); 72 + Ok(Html(result)) 71 73 } 72 74 73 75 #[instrument(skip(state))] 74 - pub async fn post_view(name: String, state: Arc<State>) -> Result<impl Reply, Rejection> { 76 + pub async fn post_view( 77 + Path(name): Path<String>, 78 + Extension(state): Extension<Arc<State>>, 79 + ) -> Result { 75 80 let mut want: Option<Post> = None; 76 81 77 82 for post in &state.blog { ··· 81 86 } 82 87 83 88 match want { 84 - None => Err(PostNotFound("blog".into(), name).into()), 89 + None => Err(super::Error::PostNotFound(name)), 85 90 Some(post) => { 86 91 HIT_COUNTER 87 92 .with_label_values(&[name.clone().as_str()]) 88 93 .inc(); 89 - let body = Html(post.body_html.clone()); 90 - Response::builder() 91 - .header("Last-Modified", &*LAST_MODIFIED) 92 - .html(|o| templates::blogpost_html(o, post, body)) 94 + let body = templates::Html(post.body_html.clone()); 95 + let mut result: Vec<u8> = vec![]; 96 + templates::blogpost_html(&mut result, post, body)?; 97 + Ok(Html(result)) 93 98 } 94 99 } 95 100 }
+26 -69
src/handlers/feeds.rs
··· 1 - use super::LAST_MODIFIED; 2 - use crate::{app::State, post::Post, templates}; 1 + use super::{Result, LAST_MODIFIED}; 2 + use crate::{ 3 + app::State, 4 + post::{NewPost, Post}, 5 + templates, 6 + }; 7 + use axum::{body, extract::Extension, response::Response, Json}; 3 8 use lazy_static::lazy_static; 4 9 use prometheus::{opts, register_int_counter_vec, IntCounterVec}; 5 - use std::{io, sync::Arc}; 10 + use std::sync::Arc; 6 11 use tracing::instrument; 7 - use warp::{http::Response, Rejection, Reply}; 8 12 9 13 lazy_static! { 10 14 pub static ref HIT_COUNTER: IntCounterVec = register_int_counter_vec!( ··· 16 20 } 17 21 18 22 #[instrument(skip(state))] 19 - pub async fn jsonfeed(state: Arc<State>, since: Option<String>) -> Result<impl Reply, Rejection> { 23 + pub async fn jsonfeed(Extension(state): Extension<Arc<State>>) -> Json<jsonfeed::Feed> { 20 24 HIT_COUNTER.with_label_values(&["json"]).inc(); 21 25 let state = state.clone(); 22 - Ok(warp::reply::json(&state.jf)) 26 + Json(state.jf.clone()) 23 27 } 24 28 25 29 #[instrument(skip(state))] 26 - pub async fn new_post(state: Arc<State>) -> Result<impl Reply, Rejection> { 30 + #[axum_macros::debug_handler] 31 + pub async fn new_post(Extension(state): Extension<Arc<State>>) -> Result<Json<NewPost>> { 27 32 let state = state.clone(); 28 - let everything = state.everything.clone(); 29 - let p: &Post = everything.iter().next().unwrap(); 30 - Ok(warp::reply::json(&p.new_post)) 31 - } 32 - 33 - #[derive(Debug)] 34 - pub enum RenderError { 35 - Build(warp::http::Error), 36 - IO(io::Error), 33 + let p: Post = state.everything.iter().next().unwrap().clone(); 34 + Ok(Json(p.new_post)) 37 35 } 38 36 39 - impl warp::reject::Reject for RenderError {} 40 - 41 37 #[instrument(skip(state))] 42 - pub async fn atom(state: Arc<State>, since: Option<String>) -> Result<impl Reply, Rejection> { 43 - if let Some(etag) = since { 44 - if etag == ETAG.clone() { 45 - return Response::builder() 46 - .status(304) 47 - .header("Content-Type", "text/plain") 48 - .body( 49 - "You already have the newest version of this feed." 50 - .to_string() 51 - .into_bytes(), 52 - ) 53 - .map_err(RenderError::Build) 54 - .map_err(warp::reject::custom); 55 - } 56 - } 57 - 38 + pub async fn atom(Extension(state): Extension<Arc<State>>) -> Result<Response> { 58 39 HIT_COUNTER.with_label_values(&["atom"]).inc(); 59 40 let state = state.clone(); 60 41 let mut buf = Vec::new(); 61 - templates::blog_atom_xml(&mut buf, state.everything.clone()) 62 - .map_err(RenderError::IO) 63 - .map_err(warp::reject::custom)?; 64 - Response::builder() 42 + templates::blog_atom_xml(&mut buf, state.everything.clone())?; 43 + Ok(Response::builder() 65 44 .status(200) 66 45 .header("Content-Type", "application/atom+xml") 67 46 .header("ETag", ETAG.clone()) 68 47 .header("Last-Modified", &*LAST_MODIFIED) 69 - .body(buf) 70 - .map_err(RenderError::Build) 71 - .map_err(warp::reject::custom) 48 + .body(body::boxed(body::Full::from(buf)))?) 72 49 } 73 50 74 51 #[instrument(skip(state))] 75 - pub async fn rss(state: Arc<State>, since: Option<String>) -> Result<impl Reply, Rejection> { 76 - if let Some(etag) = since { 77 - if etag == ETAG.clone() { 78 - return Response::builder() 79 - .status(304) 80 - .header("Content-Type", "text/plain") 81 - .body( 82 - "You already have the newest version of this feed." 83 - .to_string() 84 - .into_bytes(), 85 - ) 86 - .map_err(RenderError::Build) 87 - .map_err(warp::reject::custom); 88 - } 89 - } 90 - 52 + pub async fn rss(Extension(state): Extension<Arc<State>>) -> Result<Response> { 91 53 HIT_COUNTER.with_label_values(&["rss"]).inc(); 92 54 let state = state.clone(); 93 55 let mut buf = Vec::new(); 94 - templates::blog_rss_xml(&mut buf, state.everything.clone()) 95 - .map_err(RenderError::IO) 96 - .map_err(warp::reject::custom)?; 97 - Response::builder() 56 + templates::blog_rss_xml(&mut buf, state.everything.clone())?; 57 + Ok(Response::builder() 98 58 .status(200) 99 59 .header("Content-Type", "application/rss+xml") 100 60 .header("ETag", ETAG.clone()) 101 61 .header("Last-Modified", &*LAST_MODIFIED) 102 - .body(buf) 103 - .map_err(RenderError::Build) 104 - .map_err(warp::reject::custom) 62 + .body(body::boxed(body::Full::from(buf)))?) 105 63 } 106 64 107 65 #[instrument(skip(state))] 108 - pub async fn sitemap(state: Arc<State>) -> Result<impl Reply, Rejection> { 66 + #[axum_macros::debug_handler] 67 + pub async fn sitemap(Extension(state): Extension<Arc<State>>) -> Result<Response> { 109 68 HIT_COUNTER.with_label_values(&["sitemap"]).inc(); 110 69 let state = state.clone(); 111 - Response::builder() 70 + Ok(Response::builder() 112 71 .status(200) 113 72 .header("Content-Type", "application/xml") 114 73 .header("Last-Modified", &*LAST_MODIFIED) 115 - .body(state.sitemap.clone()) 116 - .map_err(RenderError::Build) 117 - .map_err(warp::reject::custom) 74 + .body(body::boxed(body::Full::from(state.sitemap.clone())))?) 118 75 }
+18 -12
src/handlers/gallery.rs
··· 1 - use super::PostNotFound; 2 - use crate::{ 3 - app::State, 4 - post::Post, 5 - templates::{self, Html, RenderRucte}, 1 + use super::{Error::*, Result}; 2 + use crate::{app::State, post::Post, templates}; 3 + use axum::{ 4 + extract::{Extension, Path}, 5 + response::Html, 6 6 }; 7 7 use lazy_static::lazy_static; 8 8 use prometheus::{opts, register_int_counter_vec, IntCounterVec}; 9 9 use std::sync::Arc; 10 10 use tracing::instrument; 11 - use warp::{http::Response, Rejection, Reply}; 12 11 13 12 lazy_static! { 14 13 static ref HIT_COUNTER: IntCounterVec = register_int_counter_vec!( ··· 19 18 } 20 19 21 20 #[instrument(skip(state))] 22 - pub async fn index(state: Arc<State>) -> Result<impl Reply, Rejection> { 21 + pub async fn index(Extension(state): Extension<Arc<State>>) -> Result { 23 22 let state = state.clone(); 24 - Response::builder().html(|o| templates::galleryindex_html(o, state.gallery.clone())) 23 + let mut result: Vec<u8> = vec![]; 24 + templates::galleryindex_html(&mut result, state.gallery.clone())?; 25 + Ok(Html(result)) 25 26 } 26 27 27 28 #[instrument(skip(state))] 28 - pub async fn post_view(name: String, state: Arc<State>) -> Result<impl Reply, Rejection> { 29 + pub async fn post_view( 30 + Path(name): Path<String>, 31 + Extension(state): Extension<Arc<State>>, 32 + ) -> Result { 29 33 let mut want: Option<Post> = None; 30 34 31 35 for post in &state.gallery { ··· 35 39 } 36 40 37 41 match want { 38 - None => Err(PostNotFound("gallery".into(), name).into()), 42 + None => Err(PostNotFound(name)), 39 43 Some(post) => { 40 44 HIT_COUNTER 41 45 .with_label_values(&[name.clone().as_str()]) 42 46 .inc(); 43 - let body = Html(post.body_html.clone()); 44 - Response::builder().html(|o| templates::gallerypost_html(o, post, body)) 47 + let body = templates::Html(post.body_html.clone()); 48 + let mut result: Vec<u8> = vec![]; 49 + templates::gallerypost_html(&mut result, post, body)?; 50 + Ok(Html(result)) 45 51 } 46 52 } 47 53 }
+69 -100
src/handlers/mod.rs
··· 1 - use crate::{ 2 - app::State, 3 - templates::{self, Html, RenderRucte}, 1 + use crate::{app::State, templates}; 2 + use axum::{ 3 + body, 4 + extract::Extension, 5 + http::StatusCode, 6 + response::{Html, IntoResponse, Response}, 4 7 }; 5 8 use chrono::{Datelike, Timelike, Utc}; 6 9 use lazy_static::lazy_static; 7 10 use prometheus::{opts, register_int_counter_vec, IntCounterVec}; 8 - use std::{convert::Infallible, fmt, sync::Arc}; 11 + use std::sync::Arc; 9 12 use tracing::instrument; 10 - use warp::{ 11 - http::{Response, StatusCode}, 12 - Rejection, Reply, 13 - }; 13 + 14 + pub mod blog; 15 + pub mod feeds; 16 + pub mod gallery; 17 + pub mod talks; 14 18 15 19 lazy_static! { 16 20 static ref HIT_COUNTER: IntCounterVec = ··· 32 36 } 33 37 34 38 #[instrument] 35 - pub async fn index() -> Result<impl Reply, Rejection> { 39 + pub async fn index() -> Result { 36 40 HIT_COUNTER.with_label_values(&["index"]).inc(); 37 - Response::builder() 38 - .header("Last-Modified", &*LAST_MODIFIED) 39 - .html(|o| templates::index_html(o)) 41 + let mut result: Vec<u8> = vec![]; 42 + templates::index_html(&mut result)?; 43 + Ok(Html(result)) 40 44 } 41 45 42 46 #[instrument] 43 - pub async fn contact() -> Result<impl Reply, Rejection> { 47 + pub async fn contact() -> Result { 44 48 HIT_COUNTER.with_label_values(&["contact"]).inc(); 45 - Response::builder() 46 - .header("Last-Modified", &*LAST_MODIFIED) 47 - .html(|o| templates::contact_html(o)) 49 + let mut result: Vec<u8> = vec![]; 50 + templates::contact_html(&mut result)?; 51 + Ok(Html(result)) 48 52 } 49 53 50 54 #[instrument] 51 - pub async fn feeds() -> Result<impl Reply, Rejection> { 55 + pub async fn feeds() -> Result { 52 56 HIT_COUNTER.with_label_values(&["feeds"]).inc(); 53 - Response::builder() 54 - .header("Last-Modified", &*LAST_MODIFIED) 55 - .html(|o| templates::feeds_html(o)) 57 + let mut result: Vec<u8> = vec![]; 58 + templates::feeds_html(&mut result)?; 59 + Ok(Html(result)) 56 60 } 57 61 62 + #[axum_macros::debug_handler] 58 63 #[instrument(skip(state))] 59 - pub async fn resume(state: Arc<State>) -> Result<impl Reply, Rejection> { 64 + pub async fn resume(Extension(state): Extension<Arc<State>>) -> Result { 60 65 HIT_COUNTER.with_label_values(&["resume"]).inc(); 61 66 let state = state.clone(); 62 - Response::builder() 63 - .header("Last-Modified", &*LAST_MODIFIED) 64 - .html(|o| templates::resume_html(o, Html(state.resume.clone()))) 67 + let mut result: Vec<u8> = vec![]; 68 + templates::resume_html(&mut result, templates::Html(state.resume.clone()))?; 69 + Ok(Html(result)) 65 70 } 66 71 67 72 #[instrument(skip(state))] 68 - pub async fn patrons(state: Arc<State>) -> Result<impl Reply, Rejection> { 73 + pub async fn patrons(Extension(state): Extension<Arc<State>>) -> Result { 69 74 HIT_COUNTER.with_label_values(&["patrons"]).inc(); 70 75 let state = state.clone(); 76 + let mut result: Vec<u8> = vec![]; 71 77 match &state.patrons { 72 - None => Response::builder().status(500).html(|o| { 73 - templates::error_html( 74 - o, 75 - "Could not load patrons, let me know the API token expired again".to_string(), 76 - ) 77 - }), 78 - Some(patrons) => Response::builder() 79 - .header("Last-Modified", &*LAST_MODIFIED) 80 - .html(|o| templates::patrons_html(o, patrons.clone())), 78 + None => Err(Error::NoPatrons), 79 + Some(patrons) => { 80 + templates::patrons_html(&mut result, patrons.clone())?; 81 + Ok(Html(result)) 82 + } 81 83 } 82 84 } 83 85 86 + #[axum_macros::debug_handler] 84 87 #[instrument(skip(state))] 85 - pub async fn signalboost(state: Arc<State>) -> Result<impl Reply, Rejection> { 88 + pub async fn signalboost(Extension(state): Extension<Arc<State>>) -> Result { 86 89 HIT_COUNTER.with_label_values(&["signalboost"]).inc(); 87 90 let state = state.clone(); 88 - Response::builder() 89 - .header("Last-Modified", &*LAST_MODIFIED) 90 - .html(|o| templates::signalboost_html(o, state.signalboost.clone())) 91 + let mut result: Vec<u8> = vec![]; 92 + templates::signalboost_html(&mut result, state.signalboost.clone())?; 93 + Ok(Html(result)) 91 94 } 92 95 93 96 #[instrument] 94 - pub async fn not_found() -> Result<impl Reply, Rejection> { 97 + pub async fn not_found() -> Result { 95 98 HIT_COUNTER.with_label_values(&["not_found"]).inc(); 96 - Response::builder() 97 - .header("Last-Modified", &*LAST_MODIFIED) 98 - .html(|o| templates::notfound_html(o, "some path".into())) 99 + let mut result: Vec<u8> = vec![]; 100 + templates::notfound_html(&mut result, "some path".into())?; 101 + Ok(Html(result)) 99 102 } 100 103 101 - pub mod blog; 102 - pub mod feeds; 103 - pub mod gallery; 104 - pub mod talks; 105 - 106 104 #[derive(Debug, thiserror::Error)] 107 - struct PostNotFound(String, String); 105 + pub enum Error { 106 + #[error("series not found: {0}")] 107 + SeriesNotFound(String), 108 108 109 - impl fmt::Display for PostNotFound { 110 - fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { 111 - write!(f, "not found: {}/{}", self.0, self.1) 112 - } 113 - } 109 + #[error("post not found: {0}")] 110 + PostNotFound(String), 114 111 115 - impl warp::reject::Reject for PostNotFound {} 112 + #[error("patreon key not working, poke me to get this fixed")] 113 + NoPatrons, 116 114 117 - #[derive(Debug, thiserror::Error)] 118 - struct SeriesNotFound(String); 115 + #[error("io error: {0}")] 116 + IO(#[from] std::io::Error), 119 117 120 - impl fmt::Display for SeriesNotFound { 121 - fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { 122 - write!(f, "{}", self.0) 123 - } 118 + #[error("axum http error: {0}")] 119 + AxumHTTP(#[from] axum::http::Error), 124 120 } 125 121 126 - impl warp::reject::Reject for SeriesNotFound {} 122 + pub type Result<T = Html<Vec<u8>>> = std::result::Result<T, Error>; 127 123 128 - lazy_static! { 129 - static ref REJECTION_COUNTER: IntCounterVec = register_int_counter_vec!( 130 - opts!("rejections", "Number of rejections by kind"), 131 - &["kind"] 132 - ) 133 - .unwrap(); 134 - } 135 - 136 - #[instrument] 137 - pub async fn rejection(err: Rejection) -> Result<impl Reply, Infallible> { 138 - let path: String; 139 - let code; 124 + impl IntoResponse for Error { 125 + fn into_response(self) -> Response { 126 + let mut result: Vec<u8> = vec![]; 127 + templates::error_html(&mut result, format!("{}", self)).unwrap(); 140 128 141 - if err.is_not_found() { 142 - REJECTION_COUNTER.with_label_values(&["404"]).inc(); 143 - path = "".into(); 144 - code = StatusCode::NOT_FOUND; 145 - } else if let Some(SeriesNotFound(series)) = err.find() { 146 - REJECTION_COUNTER 147 - .with_label_values(&["SeriesNotFound"]) 148 - .inc(); 149 - log::error!("invalid series {}", series); 150 - path = format!("/blog/series/{}", series); 151 - code = StatusCode::NOT_FOUND; 152 - } else if let Some(PostNotFound(kind, name)) = err.find() { 153 - REJECTION_COUNTER.with_label_values(&["PostNotFound"]).inc(); 154 - log::error!("unknown post {}/{}", kind, name); 155 - path = format!("/{}/{}", kind, name); 156 - code = StatusCode::NOT_FOUND; 157 - } else { 158 - REJECTION_COUNTER.with_label_values(&["Other"]).inc(); 159 - log::error!("unhandled rejection: {:?}", err); 160 - path = format!("weird rejection: {:?}", err); 161 - code = StatusCode::INTERNAL_SERVER_ERROR; 162 - } 129 + let body = body::boxed(body::Full::from(result)); 163 130 164 - Ok(warp::reply::with_status( 165 131 Response::builder() 166 - .html(|o| templates::notfound_html(o, path)) 167 - .unwrap(), 168 - code, 169 - )) 132 + .status(match self { 133 + Error::SeriesNotFound(_) | Error::PostNotFound(_) => StatusCode::NOT_FOUND, 134 + _ => StatusCode::INTERNAL_SERVER_ERROR, 135 + }) 136 + .body(body) 137 + .unwrap() 138 + } 170 139 }
+18 -12
src/handlers/talks.rs
··· 1 - use super::PostNotFound; 2 - use crate::{ 3 - app::State, 4 - post::Post, 5 - templates::{self, Html, RenderRucte}, 1 + use super::{Error::*, Result}; 2 + use crate::{app::State, post::Post, templates}; 3 + use axum::{ 4 + extract::{Extension, Path}, 5 + response::Html, 6 6 }; 7 7 use lazy_static::lazy_static; 8 8 use prometheus::{opts, register_int_counter_vec, IntCounterVec}; 9 9 use std::sync::Arc; 10 10 use tracing::instrument; 11 - use warp::{http::Response, Rejection, Reply}; 12 11 13 12 lazy_static! { 14 13 static ref HIT_COUNTER: IntCounterVec = register_int_counter_vec!( ··· 19 18 } 20 19 21 20 #[instrument(skip(state))] 22 - pub async fn index(state: Arc<State>) -> Result<impl Reply, Rejection> { 21 + pub async fn index(Extension(state): Extension<Arc<State>>) -> Result { 23 22 let state = state.clone(); 24 - Response::builder().html(|o| templates::talkindex_html(o, state.talks.clone())) 23 + let mut result: Vec<u8> = vec![]; 24 + templates::talkindex_html(&mut result, state.talks.clone())?; 25 + Ok(Html(result)) 25 26 } 26 27 27 28 #[instrument(skip(state))] 28 - pub async fn post_view(name: String, state: Arc<State>) -> Result<impl Reply, Rejection> { 29 + pub async fn post_view( 30 + Path(name): Path<String>, 31 + Extension(state): Extension<Arc<State>>, 32 + ) -> Result { 29 33 let mut want: Option<Post> = None; 30 34 31 35 for post in &state.talks { ··· 35 39 } 36 40 37 41 match want { 38 - None => Err(PostNotFound("talks".into(), name).into()), 42 + None => Err(PostNotFound(name).into()), 39 43 Some(post) => { 40 44 HIT_COUNTER 41 45 .with_label_values(&[name.clone().as_str()]) 42 46 .inc(); 43 - let body = Html(post.body_html.clone()); 44 - Response::builder().html(|o| templates::talkpost_html(o, post, body)) 47 + let body = templates::Html(post.body_html.clone()); 48 + let mut result: Vec<u8> = vec![]; 49 + templates::talkpost_html(&mut result, post, body)?; 50 + Ok(Html(result)) 45 51 } 46 52 } 47 53 }
+207 -200
src/main.rs
··· 1 1 #[macro_use] 2 2 extern crate tracing; 3 3 4 + use axum::{ 5 + body, 6 + extract::Extension, 7 + http::header::{self, HeaderValue, CACHE_CONTROL, CONTENT_TYPE}, 8 + response::{Html, Response}, 9 + routing::get, 10 + Router, 11 + }; 4 12 use color_eyre::eyre::Result; 5 - use hyper::{header::CONTENT_TYPE, Body, Response}; 13 + use hyper::StatusCode; 6 14 use prometheus::{Encoder, TextEncoder}; 7 - use std::net::IpAddr; 8 - use std::str::FromStr; 9 - use std::sync::Arc; 15 + use std::{ 16 + env, 17 + net::{IpAddr, SocketAddr}, 18 + str::FromStr, 19 + sync::Arc, 20 + }; 10 21 use tokio::net::UnixListener; 11 - use tokio_stream::wrappers::UnixListenerStream; 12 - use warp::{path, Filter}; 22 + use tower_http::{ 23 + services::{ServeDir, ServeFile}, 24 + set_header::SetResponseHeaderLayer, 25 + trace::TraceLayer, 26 + }; 13 27 14 28 pub mod app; 15 29 pub mod handlers; 16 30 pub mod post; 17 31 pub mod signalboost; 18 32 19 - use app::State; 33 + mod domainsocket; 34 + use domainsocket::*; 20 35 21 36 const APPLICATION_NAME: &str = concat!(env!("CARGO_PKG_NAME"), "/", env!("CARGO_PKG_VERSION")); 22 37 23 - fn with_state( 24 - state: Arc<State>, 25 - ) -> impl Filter<Extract = (Arc<State>,), Error = std::convert::Infallible> + Clone { 26 - warp::any().map(move || state.clone()) 38 + async fn healthcheck() -> &'static str { 39 + "OK" 40 + } 41 + 42 + fn cache_header(_: &Response) -> Option<header::HeaderValue> { 43 + Some(header::HeaderValue::from_static( 44 + "public, max-age=3600, stale-if-error=60", 45 + )) 46 + } 47 + 48 + fn webmention_header(_: &Response) -> Option<HeaderValue> { 49 + Some(header::HeaderValue::from_static( 50 + r#"<https://mi.within.website/api/webmention/accept>; rel="webmention""#, 51 + )) 52 + } 53 + 54 + fn clacks_header(_: &Response) -> Option<HeaderValue> { 55 + Some(HeaderValue::from_static("Ashlynn")) 56 + } 57 + 58 + fn hacker_header(_: &Response) -> Option<HeaderValue> { 59 + Some(header::HeaderValue::from_static( 60 + "If you are reading this, check out /signalboost to find people for your team", 61 + )) 27 62 } 28 63 29 64 #[tokio::main] ··· 35 70 36 71 let state = Arc::new( 37 72 app::init( 38 - std::env::var("CONFIG_FNAME") 73 + env::var("CONFIG_FNAME") 39 74 .unwrap_or("./config.dhall".into()) 40 75 .as_str() 41 76 .into(), ··· 43 78 .await?, 44 79 ); 45 80 46 - let healthcheck = warp::get().and(warp::path(".within").and(warp::path("health")).map(|| "OK")); 47 - let new_post = warp::path!(".within" / "website.within.xesite" / "new_post") 48 - .and(with_state(state.clone())) 49 - .and_then(handlers::feeds::new_post); 50 - 51 - let base = warp::path!("blog" / ..); 52 - let blog_index = base 53 - .and(warp::path::end()) 54 - .and(with_state(state.clone())) 55 - .and_then(handlers::blog::index); 56 - let series = base 57 - .and(warp::path!("series").and(with_state(state.clone()).and_then(handlers::blog::series))); 58 - let series_view = base.and( 59 - warp::path!("series" / String) 60 - .and(with_state(state.clone())) 61 - .and(warp::get()) 62 - .and_then(handlers::blog::series_view), 63 - ); 64 - let post_view = base.and( 65 - warp::path!(String) 66 - .and(with_state(state.clone())) 67 - .and(warp::get()) 68 - .and_then(handlers::blog::post_view), 69 - ); 81 + let middleware = tower::ServiceBuilder::new() 82 + .layer(TraceLayer::new_for_http()) 83 + .layer(Extension(state.clone())) 84 + .layer(SetResponseHeaderLayer::overriding( 85 + header::CACHE_CONTROL, 86 + cache_header, 87 + )) 88 + .layer(SetResponseHeaderLayer::appending( 89 + header::LINK, 90 + webmention_header, 91 + )) 92 + .layer(SetResponseHeaderLayer::appending( 93 + header::HeaderName::from_static("x-clacks-overhead"), 94 + clacks_header, 95 + )) 96 + .layer(SetResponseHeaderLayer::overriding( 97 + header::HeaderName::from_static("x-hacker"), 98 + hacker_header, 99 + )); 70 100 71 - let gallery_base = warp::path!("gallery" / ..); 72 - let gallery_index = gallery_base 73 - .and(warp::path::end()) 74 - .and(with_state(state.clone())) 75 - .and_then(handlers::gallery::index); 76 - let gallery_post_view = gallery_base.and( 77 - warp::path!(String) 78 - .and(with_state(state.clone())) 79 - .and(warp::get()) 80 - .and_then(handlers::gallery::post_view), 81 - ); 82 - 83 - let talk_base = warp::path!("talks" / ..); 84 - let talk_index = talk_base 85 - .and(warp::path::end()) 86 - .and(with_state(state.clone())) 87 - .and_then(handlers::talks::index); 88 - let talk_post_view = talk_base.and( 89 - warp::path!(String) 90 - .and(with_state(state.clone())) 91 - .and(warp::get()) 92 - .and_then(handlers::talks::post_view), 93 - ); 94 - 95 - let index = warp::get().and(path::end().and_then(handlers::index)); 96 - let contact = warp::path!("contact").and_then(handlers::contact); 97 - let feeds = warp::path!("feeds").and_then(handlers::feeds); 98 - let resume = warp::path!("resume") 99 - .and(with_state(state.clone())) 100 - .and_then(handlers::resume); 101 - let signalboost = warp::path!("signalboost") 102 - .and(with_state(state.clone())) 103 - .and_then(handlers::signalboost); 104 - let patrons = warp::path!("patrons") 105 - .and(with_state(state.clone())) 106 - .and_then(handlers::patrons); 107 - 108 - let files = warp::path("static") 109 - .and(warp::fs::dir("./static")) 110 - .map(|reply| { 111 - warp::reply::with_header( 112 - reply, 113 - "Cache-Control", 114 - "public, max-age=86400, stale-if-error=60", 115 - ) 116 - }); 117 - 118 - let css = warp::path("css").and(warp::fs::dir("./css")).map(|reply| { 119 - warp::reply::with_header( 120 - reply, 121 - "Cache-Control", 122 - "public, max-age=86400, stale-if-error=60", 101 + let app = Router::new() 102 + // meta 103 + .route("/.within/health", get(healthcheck)) 104 + .route( 105 + "/.within/website.within.xesite/new_post", 106 + get(handlers::feeds::new_post), 107 + ) 108 + .route("/jsonfeed", get(go_vanity)) 109 + .route("/metrics", get(metrics)) 110 + .route( 111 + "/sw.js", 112 + axum::routing::get_service(ServeFile::new("./static/js/sw.js")).handle_error( 113 + |err: std::io::Error| async move { 114 + ( 115 + StatusCode::INTERNAL_SERVER_ERROR, 116 + format!("unhandled internal server error: {}", err), 117 + ) 118 + }, 119 + ), 120 + ) 121 + .route( 122 + "/.well-known/assetlinks.json", 123 + axum::routing::get_service(ServeFile::new("./static/assetlinks.json")).handle_error( 124 + |err: std::io::Error| async move { 125 + ( 126 + StatusCode::INTERNAL_SERVER_ERROR, 127 + format!("unhandled internal server error: {}", err), 128 + ) 129 + }, 130 + ), 131 + ) 132 + .route( 133 + "/robots.txt", 134 + axum::routing::get_service(ServeFile::new("./static/robots.txt")).handle_error( 135 + |err: std::io::Error| async move { 136 + ( 137 + StatusCode::INTERNAL_SERVER_ERROR, 138 + format!("unhandled internal server error: {}", err), 139 + ) 140 + }, 141 + ), 142 + ) 143 + .route( 144 + "/favicon.ico", 145 + axum::routing::get_service(ServeFile::new("./static/favicon/favicon.ico")) 146 + .handle_error(|err: std::io::Error| async move { 147 + ( 148 + StatusCode::INTERNAL_SERVER_ERROR, 149 + format!("unhandled internal server error: {}", err), 150 + ) 151 + }), 152 + ) 153 + // static pages 154 + .route("/", get(handlers::index)) 155 + .route("/contact", get(handlers::contact)) 156 + .route("/feeds", get(handlers::feeds)) 157 + .route("/resume", get(handlers::resume)) 158 + .route("/patrons", get(handlers::patrons)) 159 + .route("/signalboost", get(handlers::signalboost)) 160 + // feeds 161 + .route("/blog.json", get(handlers::feeds::jsonfeed)) 162 + .route("/blog.atom", get(handlers::feeds::atom)) 163 + .route("/blog.rss", get(handlers::feeds::rss)) 164 + // blog 165 + .route("/blog", get(handlers::blog::index)) 166 + .route("/blog/", get(handlers::blog::index)) 167 + .route("/blog/:name", get(handlers::blog::post_view)) 168 + .route("/blog/series", get(handlers::blog::series)) 169 + .route("/blog/series/:series", get(handlers::blog::series_view)) 170 + // gallery 171 + .route("/gallery", get(handlers::gallery::index)) 172 + .route("/gallery/", get(handlers::gallery::index)) 173 + .route("/gallery/:name", get(handlers::gallery::post_view)) 174 + // talks 175 + .route("/talks", get(handlers::talks::index)) 176 + .route("/talks/", get(handlers::talks::index)) 177 + .route("/talks/:name", get(handlers::talks::post_view)) 178 + // junk google wants 179 + .route("/sitemap.xml", get(handlers::feeds::sitemap)) 180 + // static files 181 + .nest( 182 + "/css", 183 + axum::routing::get_service(ServeDir::new("./css")).handle_error( 184 + |err: std::io::Error| async move { 185 + ( 186 + StatusCode::INTERNAL_SERVER_ERROR, 187 + format!("unhandled internal server error: {}", err), 188 + ) 189 + }, 190 + ), 191 + ) 192 + .nest( 193 + "/static", 194 + axum::routing::get_service(ServeDir::new("./static")).handle_error( 195 + |err: std::io::Error| async move { 196 + ( 197 + StatusCode::INTERNAL_SERVER_ERROR, 198 + format!("unhandled internal server error: {}", err), 199 + ) 200 + }, 201 + ), 123 202 ) 124 - }); 125 - 126 - let sw = warp::path("sw.js").and(warp::fs::file("./static/js/sw.js")); 127 - let robots = warp::path("robots.txt").and(warp::fs::file("./static/robots.txt")); 128 - let favicon = warp::path("favicon.ico").and(warp::fs::file("./static/favicon/favicon.ico")); 129 - 130 - let jsonfeed = warp::path("blog.json") 131 - .and(with_state(state.clone())) 132 - .and(warp::header::optional("if-none-match")) 133 - .and_then(handlers::feeds::jsonfeed); 134 - let atom = warp::path("blog.atom") 135 - .and(with_state(state.clone())) 136 - .and(warp::header::optional("if-none-match")) 137 - .and_then(handlers::feeds::atom); 138 - let rss = warp::path("blog.rss") 139 - .and(with_state(state.clone())) 140 - .and(warp::header::optional("if-none-match")) 141 - .and_then(handlers::feeds::rss); 142 - let sitemap = warp::path("sitemap.xml") 143 - .and(with_state(state.clone())) 144 - .and_then(handlers::feeds::sitemap); 145 - let asset_links = warp::path!(".well-known" / "assetlinks.json") 146 - .and(warp::fs::file("./static/assetlinks.json")); 147 - 148 - let go_vanity_jsonfeed = warp::path("jsonfeed") 149 - .and(warp::any().map(move || "christine.website/jsonfeed")) 150 - .and(warp::any().map(move || "https://tulpa.dev/Xe/jsonfeed")) 151 - .and(warp::any().map(move || "master")) 152 - .and_then(go_vanity::gitea); 153 - 154 - let metrics_endpoint = warp::path("metrics").and(warp::path::end()).map(move || { 155 - let encoder = TextEncoder::new(); 156 - let metric_families = prometheus::gather(); 157 - let mut buffer = vec![]; 158 - encoder.encode(&metric_families, &mut buffer).unwrap(); 159 - Response::builder() 160 - .status(200) 161 - .header(CONTENT_TYPE, encoder.format_type()) 162 - .body(Body::from(buffer)) 163 - .unwrap() 164 - }); 165 - 166 - let static_pages = index 167 - .or(feeds.or(asset_links)) 168 - .or(resume.or(signalboost)) 169 - .or(patrons) 170 - .or(jsonfeed.or(atom.or(sitemap)).or(rss)) 171 - .or(favicon.or(robots).or(sw)) 172 - .or(contact.or(new_post)) 173 - .map(|reply| { 174 - warp::reply::with_header( 175 - reply, 176 - "Cache-Control", 177 - "public, max-age=86400, stale-if-error=60", 178 - ) 179 - }); 180 - 181 - let dynamic_pages = blog_index 182 - .or(series.or(series_view).or(post_view)) 183 - .or(gallery_index.or(gallery_post_view)) 184 - .or(talk_index.or(talk_post_view)) 185 - .map(|reply| { 186 - warp::reply::with_header( 187 - reply, 188 - "Cache-Control", 189 - "public, max-age=600, stale-if-error=60", 190 - ) 191 - }); 192 - 193 - let site = static_pages 194 - .or(dynamic_pages) 195 - .or(healthcheck.or(metrics_endpoint).or(go_vanity_jsonfeed)) 196 - .or(files.or(css)) 197 - .map(|reply| { 198 - warp::reply::with_header( 199 - reply, 200 - "X-Hacker", 201 - "If you are reading this, check out /signalboost to find people for your team", 202 - ) 203 - }) 204 - .map(|reply| warp::reply::with_header(reply, "X-Clacks-Overhead", "GNU Ashlynn")) 205 - .map(|reply| { 206 - warp::reply::with_header( 207 - reply, 208 - "Link", 209 - format!( 210 - r#"<{}>; rel="webmention""#, 211 - std::env::var("WEBMENTION_URL") 212 - .unwrap_or("https://mi.within.website/api/webmention/accept".to_string()) 213 - ), 214 - ) 215 - }) 216 - .with(warp::log(APPLICATION_NAME)) 217 - .recover(handlers::rejection); 203 + .layer(middleware); 218 204 219 205 #[cfg(target_os = "linux")] 220 206 { ··· 241 227 } 242 228 } 243 229 244 - let server = warp::serve(site); 245 - 246 230 match std::env::var("SOCKPATH") { 247 231 Ok(sockpath) => { 248 - let _ = std::fs::remove_file(&sockpath); 249 - let listener = UnixListener::bind(sockpath)?; 250 - let incoming = UnixListenerStream::new(listener); 251 - server.run_incoming(incoming).await; 252 - 253 - Ok(()) 232 + let uds = UnixListener::bind(&sockpath)?; 233 + axum::Server::builder(ServerAccept { uds }) 234 + .serve(app.into_make_service_with_connect_info::<UdsConnectInfo, _>()) 235 + .await?; 254 236 } 255 237 Err(_) => { 256 - server 257 - .run(( 258 - IpAddr::from_str(&std::env::var("HOST").unwrap_or("::".into()))?, 259 - std::env::var("PORT") 260 - .unwrap_or("3030".into()) 261 - .parse::<u16>()?, 262 - )) 263 - .await; 264 - 265 - Ok(()) 238 + let addr: SocketAddr = ( 239 + IpAddr::from_str(&env::var("HOST").unwrap_or("::".into()))?, 240 + env::var("PORT").unwrap_or("3030".into()).parse::<u16>()?, 241 + ) 242 + .into(); 243 + info!("listening on {}", addr); 244 + axum::Server::bind(&addr) 245 + .serve(app.into_make_service()) 246 + .await?; 266 247 } 267 248 } 249 + 250 + Ok(()) 251 + } 252 + 253 + async fn metrics() -> Response { 254 + let encoder = TextEncoder::new(); 255 + let metric_families = prometheus::gather(); 256 + let mut buffer = vec![]; 257 + encoder.encode(&metric_families, &mut buffer).unwrap(); 258 + Response::builder() 259 + .status(200) 260 + .header(CONTENT_TYPE, encoder.format_type()) 261 + .body(body::boxed(body::Full::from(buffer))) 262 + .unwrap() 263 + } 264 + 265 + async fn go_vanity() -> Html<Vec<u8>> { 266 + let mut buffer: Vec<u8> = vec![]; 267 + templates::gitea_html( 268 + &mut buffer, 269 + "christine.website/jsonfeed", 270 + "https://christine.website/metrics", 271 + "master", 272 + ) 273 + .unwrap(); 274 + Html(buffer) 268 275 } 269 276 270 277 include!(concat!(env!("OUT_DIR"), "/templates.rs"));
+3 -3
src/post/mod.rs
··· 1 1 use chrono::prelude::*; 2 2 use color_eyre::eyre::{eyre, Result, WrapErr}; 3 3 use glob::glob; 4 - use serde::Serialize; 4 + use serde::{Deserialize, Serialize}; 5 5 use std::{borrow::Borrow, cmp::Ordering, path::PathBuf}; 6 6 use tokio::fs; 7 7 8 8 pub mod frontmatter; 9 9 10 - #[derive(Eq, PartialEq, Debug, Clone)] 10 + #[derive(Eq, PartialEq, Debug, Clone, Serialize, Deserialize)] 11 11 pub struct Post { 12 12 pub front_matter: frontmatter::Data, 13 13 pub link: String, ··· 19 19 } 20 20 21 21 /// Used with the Android app to show information in a widget. 22 - #[derive(Eq, PartialEq, Debug, Clone, Serialize)] 22 + #[derive(Eq, PartialEq, Debug, Clone, Serialize, Deserialize)] 23 23 pub struct NewPost { 24 24 pub title: String, 25 25 pub summary: String,