├── .gitignore ├── Cargo.lock ├── Cargo.toml ├── LICENSE ├── README.md ├── github-hosts ├── Cargo.toml ├── README.md ├── build.rs ├── resources │ ├── dns.ico │ └── manifest.xml └── src │ ├── main.rs │ └── req.rs ├── resolve-github ├── .gitignore ├── Cargo.toml ├── README.md └── src │ ├── dns │ ├── mod.rs │ ├── res.rs │ └── resolve.rs │ └── main.rs └── src ├── file.rs └── lib.rs /.gitignore: -------------------------------------------------------------------------------- 1 | .vscode 2 | .idea 3 | 4 | /target 5 | hosts -------------------------------------------------------------------------------- /Cargo.lock: -------------------------------------------------------------------------------- 1 | # This file is automatically @generated by Cargo. 2 | # It is not intended for manual editing. 3 | version = 3 4 | 5 | [[package]] 6 | name = "async-trait" 7 | version = "0.1.50" 8 | source = "registry+https://github.com/rust-lang/crates.io-index" 9 | checksum = "0b98e84bbb4cbcdd97da190ba0c58a1bb0de2c1fdf67d159e192ed766aeca722" 10 | dependencies = [ 11 | "proc-macro2", 12 | "quote", 13 | "syn", 14 | ] 15 | 16 | [[package]] 17 | name = "autocfg" 18 | version = "1.0.1" 19 | source = "registry+https://github.com/rust-lang/crates.io-index" 20 | checksum = "cdb031dd78e28731d87d56cc8ffef4a8f36ca26c38fe2de700543e627f8a464a" 21 | 22 | [[package]] 23 | name = "base64" 24 | version = "0.13.0" 25 | source = "registry+https://github.com/rust-lang/crates.io-index" 26 | checksum = "904dfeac50f3cdaba28fc6f57fdcddb75f49ed61346676a78c4ffe55877802fd" 27 | 28 | [[package]] 29 | name = "bitflags" 30 | version = "1.2.1" 31 | source = "registry+https://github.com/rust-lang/crates.io-index" 32 | checksum = "cf1de2fe8c75bc145a2f577add951f8134889b4795d47466a54a5c846d691693" 33 | 34 | [[package]] 35 | name = "bumpalo" 36 | version = "3.7.0" 37 | source = "registry+https://github.com/rust-lang/crates.io-index" 38 | checksum = "9c59e7af012c713f529e7a3ee57ce9b31ddd858d4b512923602f74608b009631" 39 | 40 | [[package]] 41 | name = "bytes" 42 | version = "1.0.1" 43 | source = "registry+https://github.com/rust-lang/crates.io-index" 44 | checksum = "b700ce4376041dcd0a327fd0097c41095743c4c8af8887265942faf1100bd040" 45 | 46 | [[package]] 47 | name = "cc" 48 | version = "1.0.69" 49 | source = "registry+https://github.com/rust-lang/crates.io-index" 50 | checksum = "e70cc2f62c6ce1868963827bd677764c62d07c3d9a3e1fb1177ee1a9ab199eb2" 51 | 52 | [[package]] 53 | name = "cfg-if" 54 | version = "1.0.0" 55 | source = "registry+https://github.com/rust-lang/crates.io-index" 56 | checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" 57 | 58 | [[package]] 59 | name = "core-foundation" 60 | version = "0.9.1" 61 | source = "registry+https://github.com/rust-lang/crates.io-index" 62 | checksum = "0a89e2ae426ea83155dccf10c0fa6b1463ef6d5fcb44cee0b224a408fa640a62" 63 | dependencies = [ 64 | "core-foundation-sys", 65 | "libc", 66 | ] 67 | 68 | [[package]] 69 | name = "core-foundation-sys" 70 | version = "0.8.2" 71 | source = "registry+https://github.com/rust-lang/crates.io-index" 72 | checksum = "ea221b5284a47e40033bf9b66f35f984ec0ea2931eb03505246cd27a963f981b" 73 | 74 | [[package]] 75 | name = "data-encoding" 76 | version = "2.3.2" 77 | source = "registry+https://github.com/rust-lang/crates.io-index" 78 | checksum = "3ee2393c4a91429dffb4bedf19f4d6abf27d8a732c8ce4980305d782e5426d57" 79 | 80 | [[package]] 81 | name = "encoding_rs" 82 | version = "0.8.28" 83 | source = "registry+https://github.com/rust-lang/crates.io-index" 84 | checksum = "80df024fbc5ac80f87dfef0d9f5209a252f2a497f7f42944cff24d8253cac065" 85 | dependencies = [ 86 | "cfg-if", 87 | ] 88 | 89 | [[package]] 90 | name = "enum-as-inner" 91 | version = "0.3.3" 92 | source = "registry+https://github.com/rust-lang/crates.io-index" 93 | checksum = "7c5f0096a91d210159eceb2ff5e1c4da18388a170e1e3ce948aac9c8fdbbf595" 94 | dependencies = [ 95 | "heck", 96 | "proc-macro2", 97 | "quote", 98 | "syn", 99 | ] 100 | 101 | [[package]] 102 | name = "fnv" 103 | version = "1.0.7" 104 | source = "registry+https://github.com/rust-lang/crates.io-index" 105 | checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" 106 | 107 | [[package]] 108 | name = "foreign-types" 109 | version = "0.3.2" 110 | source = "registry+https://github.com/rust-lang/crates.io-index" 111 | checksum = "f6f339eb8adc052cd2ca78910fda869aefa38d22d5cb648e6485e4d3fc06f3b1" 112 | dependencies = [ 113 | "foreign-types-shared", 114 | ] 115 | 116 | [[package]] 117 | name = "foreign-types-shared" 118 | version = "0.1.1" 119 | source = "registry+https://github.com/rust-lang/crates.io-index" 120 | checksum = "00b0228411908ca8685dba7fc2cdd70ec9990a6e753e89b6ac91a84c40fbaf4b" 121 | 122 | [[package]] 123 | name = "form_urlencoded" 124 | version = "1.0.1" 125 | source = "registry+https://github.com/rust-lang/crates.io-index" 126 | checksum = "5fc25a87fa4fd2094bffb06925852034d90a17f0d1e05197d4956d3555752191" 127 | dependencies = [ 128 | "matches", 129 | "percent-encoding", 130 | ] 131 | 132 | [[package]] 133 | name = "futures-channel" 134 | version = "0.3.15" 135 | source = "registry+https://github.com/rust-lang/crates.io-index" 136 | checksum = "e682a68b29a882df0545c143dc3646daefe80ba479bcdede94d5a703de2871e2" 137 | dependencies = [ 138 | "futures-core", 139 | ] 140 | 141 | [[package]] 142 | name = "futures-core" 143 | version = "0.3.15" 144 | source = "registry+https://github.com/rust-lang/crates.io-index" 145 | checksum = "0402f765d8a89a26043b889b26ce3c4679d268fa6bb22cd7c6aad98340e179d1" 146 | 147 | [[package]] 148 | name = "futures-io" 149 | version = "0.3.15" 150 | source = "registry+https://github.com/rust-lang/crates.io-index" 151 | checksum = "acc499defb3b348f8d8f3f66415835a9131856ff7714bf10dadfc4ec4bdb29a1" 152 | 153 | [[package]] 154 | name = "futures-sink" 155 | version = "0.3.15" 156 | source = "registry+https://github.com/rust-lang/crates.io-index" 157 | checksum = "a57bead0ceff0d6dde8f465ecd96c9338121bb7717d3e7b108059531870c4282" 158 | 159 | [[package]] 160 | name = "futures-task" 161 | version = "0.3.15" 162 | source = "registry+https://github.com/rust-lang/crates.io-index" 163 | checksum = "8a16bef9fc1a4dddb5bee51c989e3fbba26569cbb0e31f5b303c184e3dd33dae" 164 | 165 | [[package]] 166 | name = "futures-util" 167 | version = "0.3.15" 168 | source = "registry+https://github.com/rust-lang/crates.io-index" 169 | checksum = "feb5c238d27e2bf94ffdfd27b2c29e3df4a68c4193bb6427384259e2bf191967" 170 | dependencies = [ 171 | "autocfg", 172 | "futures-core", 173 | "futures-io", 174 | "futures-task", 175 | "memchr", 176 | "pin-project-lite", 177 | "pin-utils", 178 | "slab", 179 | ] 180 | 181 | [[package]] 182 | name = "getrandom" 183 | version = "0.2.3" 184 | source = "registry+https://github.com/rust-lang/crates.io-index" 185 | checksum = "7fcd999463524c52659517fe2cea98493cfe485d10565e7b0fb07dbba7ad2753" 186 | dependencies = [ 187 | "cfg-if", 188 | "libc", 189 | "wasi", 190 | ] 191 | 192 | [[package]] 193 | name = "github-hosts" 194 | version = "0.1.1" 195 | dependencies = [ 196 | "hosts", 197 | "reqwest", 198 | "winres", 199 | ] 200 | 201 | [[package]] 202 | name = "h2" 203 | version = "0.3.3" 204 | source = "registry+https://github.com/rust-lang/crates.io-index" 205 | checksum = "825343c4eef0b63f541f8903f395dc5beb362a979b5799a84062527ef1e37726" 206 | dependencies = [ 207 | "bytes", 208 | "fnv", 209 | "futures-core", 210 | "futures-sink", 211 | "futures-util", 212 | "http", 213 | "indexmap", 214 | "slab", 215 | "tokio", 216 | "tokio-util", 217 | "tracing", 218 | ] 219 | 220 | [[package]] 221 | name = "hashbrown" 222 | version = "0.11.2" 223 | source = "registry+https://github.com/rust-lang/crates.io-index" 224 | checksum = "ab5ef0d4909ef3724cc8cce6ccc8572c5c817592e9285f5464f8e86f8bd3726e" 225 | 226 | [[package]] 227 | name = "heck" 228 | version = "0.3.3" 229 | source = "registry+https://github.com/rust-lang/crates.io-index" 230 | checksum = "6d621efb26863f0e9924c6ac577e8275e5e6b77455db64ffa6c65c904e9e132c" 231 | dependencies = [ 232 | "unicode-segmentation", 233 | ] 234 | 235 | [[package]] 236 | name = "hermit-abi" 237 | version = "0.1.19" 238 | source = "registry+https://github.com/rust-lang/crates.io-index" 239 | checksum = "62b467343b94ba476dcb2500d242dadbb39557df889310ac77c5d99100aaac33" 240 | dependencies = [ 241 | "libc", 242 | ] 243 | 244 | [[package]] 245 | name = "hostname" 246 | version = "0.3.1" 247 | source = "registry+https://github.com/rust-lang/crates.io-index" 248 | checksum = "3c731c3e10504cc8ed35cfe2f1db4c9274c3d35fa486e3b31df46f068ef3e867" 249 | dependencies = [ 250 | "libc", 251 | "match_cfg", 252 | "winapi", 253 | ] 254 | 255 | [[package]] 256 | name = "hosts" 257 | version = "0.1.1" 258 | 259 | [[package]] 260 | name = "http" 261 | version = "0.2.4" 262 | source = "registry+https://github.com/rust-lang/crates.io-index" 263 | checksum = "527e8c9ac747e28542699a951517aa9a6945af506cd1f2e1b53a576c17b6cc11" 264 | dependencies = [ 265 | "bytes", 266 | "fnv", 267 | "itoa", 268 | ] 269 | 270 | [[package]] 271 | name = "http-body" 272 | version = "0.4.2" 273 | source = "registry+https://github.com/rust-lang/crates.io-index" 274 | checksum = "60daa14be0e0786db0f03a9e57cb404c9d756eed2b6c62b9ea98ec5743ec75a9" 275 | dependencies = [ 276 | "bytes", 277 | "http", 278 | "pin-project-lite", 279 | ] 280 | 281 | [[package]] 282 | name = "httparse" 283 | version = "1.4.1" 284 | source = "registry+https://github.com/rust-lang/crates.io-index" 285 | checksum = "f3a87b616e37e93c22fb19bcd386f02f3af5ea98a25670ad0fce773de23c5e68" 286 | 287 | [[package]] 288 | name = "httpdate" 289 | version = "1.0.1" 290 | source = "registry+https://github.com/rust-lang/crates.io-index" 291 | checksum = "6456b8a6c8f33fee7d958fcd1b60d55b11940a79e63ae87013e6d22e26034440" 292 | 293 | [[package]] 294 | name = "hyper" 295 | version = "0.14.10" 296 | source = "registry+https://github.com/rust-lang/crates.io-index" 297 | checksum = "7728a72c4c7d72665fde02204bcbd93b247721025b222ef78606f14513e0fd03" 298 | dependencies = [ 299 | "bytes", 300 | "futures-channel", 301 | "futures-core", 302 | "futures-util", 303 | "h2", 304 | "http", 305 | "http-body", 306 | "httparse", 307 | "httpdate", 308 | "itoa", 309 | "pin-project-lite", 310 | "socket2 0.4.0", 311 | "tokio", 312 | "tower-service", 313 | "tracing", 314 | "want", 315 | ] 316 | 317 | [[package]] 318 | name = "hyper-tls" 319 | version = "0.5.0" 320 | source = "registry+https://github.com/rust-lang/crates.io-index" 321 | checksum = "d6183ddfa99b85da61a140bea0efc93fdf56ceaa041b37d553518030827f9905" 322 | dependencies = [ 323 | "bytes", 324 | "hyper", 325 | "native-tls", 326 | "tokio", 327 | "tokio-native-tls", 328 | ] 329 | 330 | [[package]] 331 | name = "idna" 332 | version = "0.2.3" 333 | source = "registry+https://github.com/rust-lang/crates.io-index" 334 | checksum = "418a0a6fab821475f634efe3ccc45c013f742efe03d853e8d3355d5cb850ecf8" 335 | dependencies = [ 336 | "matches", 337 | "unicode-bidi", 338 | "unicode-normalization", 339 | ] 340 | 341 | [[package]] 342 | name = "indexmap" 343 | version = "1.7.0" 344 | source = "registry+https://github.com/rust-lang/crates.io-index" 345 | checksum = "bc633605454125dec4b66843673f01c7df2b89479b32e0ed634e43a91cff62a5" 346 | dependencies = [ 347 | "autocfg", 348 | "hashbrown", 349 | ] 350 | 351 | [[package]] 352 | name = "instant" 353 | version = "0.1.10" 354 | source = "registry+https://github.com/rust-lang/crates.io-index" 355 | checksum = "bee0328b1209d157ef001c94dd85b4f8f64139adb0eac2659f4b08382b2f474d" 356 | dependencies = [ 357 | "cfg-if", 358 | ] 359 | 360 | [[package]] 361 | name = "ipconfig" 362 | version = "0.2.2" 363 | source = "registry+https://github.com/rust-lang/crates.io-index" 364 | checksum = "f7e2f18aece9709094573a9f24f483c4f65caa4298e2f7ae1b71cc65d853fad7" 365 | dependencies = [ 366 | "socket2 0.3.19", 367 | "widestring", 368 | "winapi", 369 | "winreg 0.6.2", 370 | ] 371 | 372 | [[package]] 373 | name = "ipnet" 374 | version = "2.3.1" 375 | source = "registry+https://github.com/rust-lang/crates.io-index" 376 | checksum = "68f2d64f2edebec4ce84ad108148e67e1064789bee435edc5b60ad398714a3a9" 377 | 378 | [[package]] 379 | name = "itoa" 380 | version = "0.4.7" 381 | source = "registry+https://github.com/rust-lang/crates.io-index" 382 | checksum = "dd25036021b0de88a0aff6b850051563c6516d0bf53f8638938edbb9de732736" 383 | 384 | [[package]] 385 | name = "js-sys" 386 | version = "0.3.51" 387 | source = "registry+https://github.com/rust-lang/crates.io-index" 388 | checksum = "83bdfbace3a0e81a4253f73b49e960b053e396a11012cbd49b9b74d6a2b67062" 389 | dependencies = [ 390 | "wasm-bindgen", 391 | ] 392 | 393 | [[package]] 394 | name = "lazy_static" 395 | version = "1.4.0" 396 | source = "registry+https://github.com/rust-lang/crates.io-index" 397 | checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" 398 | 399 | [[package]] 400 | name = "libc" 401 | version = "0.2.98" 402 | source = "registry+https://github.com/rust-lang/crates.io-index" 403 | checksum = "320cfe77175da3a483efed4bc0adc1968ca050b098ce4f2f1c13a56626128790" 404 | 405 | [[package]] 406 | name = "linked-hash-map" 407 | version = "0.5.4" 408 | source = "registry+https://github.com/rust-lang/crates.io-index" 409 | checksum = "7fb9b38af92608140b86b693604b9ffcc5824240a484d1ecd4795bacb2fe88f3" 410 | 411 | [[package]] 412 | name = "lock_api" 413 | version = "0.4.4" 414 | source = "registry+https://github.com/rust-lang/crates.io-index" 415 | checksum = "0382880606dff6d15c9476c416d18690b72742aa7b605bb6dd6ec9030fbf07eb" 416 | dependencies = [ 417 | "scopeguard", 418 | ] 419 | 420 | [[package]] 421 | name = "log" 422 | version = "0.4.14" 423 | source = "registry+https://github.com/rust-lang/crates.io-index" 424 | checksum = "51b9bbe6c47d51fc3e1a9b945965946b4c44142ab8792c50835a980d362c2710" 425 | dependencies = [ 426 | "cfg-if", 427 | ] 428 | 429 | [[package]] 430 | name = "lru-cache" 431 | version = "0.1.2" 432 | source = "registry+https://github.com/rust-lang/crates.io-index" 433 | checksum = "31e24f1ad8321ca0e8a1e0ac13f23cb668e6f5466c2c57319f6a5cf1cc8e3b1c" 434 | dependencies = [ 435 | "linked-hash-map", 436 | ] 437 | 438 | [[package]] 439 | name = "match_cfg" 440 | version = "0.1.0" 441 | source = "registry+https://github.com/rust-lang/crates.io-index" 442 | checksum = "ffbee8634e0d45d258acb448e7eaab3fce7a0a467395d4d9f228e3c1f01fb2e4" 443 | 444 | [[package]] 445 | name = "matches" 446 | version = "0.1.8" 447 | source = "registry+https://github.com/rust-lang/crates.io-index" 448 | checksum = "7ffc5c5338469d4d3ea17d269fa8ea3512ad247247c30bd2df69e68309ed0a08" 449 | 450 | [[package]] 451 | name = "memchr" 452 | version = "2.4.0" 453 | source = "registry+https://github.com/rust-lang/crates.io-index" 454 | checksum = "b16bd47d9e329435e309c58469fe0791c2d0d1ba96ec0954152a5ae2b04387dc" 455 | 456 | [[package]] 457 | name = "mime" 458 | version = "0.3.16" 459 | source = "registry+https://github.com/rust-lang/crates.io-index" 460 | checksum = "2a60c7ce501c71e03a9c9c0d35b861413ae925bd979cc7a4e30d060069aaac8d" 461 | 462 | [[package]] 463 | name = "mio" 464 | version = "0.7.13" 465 | source = "registry+https://github.com/rust-lang/crates.io-index" 466 | checksum = "8c2bdb6314ec10835cd3293dd268473a835c02b7b352e788be788b3c6ca6bb16" 467 | dependencies = [ 468 | "libc", 469 | "log", 470 | "miow", 471 | "ntapi", 472 | "winapi", 473 | ] 474 | 475 | [[package]] 476 | name = "miow" 477 | version = "0.3.7" 478 | source = "registry+https://github.com/rust-lang/crates.io-index" 479 | checksum = "b9f1c5b025cda876f66ef43a113f91ebc9f4ccef34843000e0adf6ebbab84e21" 480 | dependencies = [ 481 | "winapi", 482 | ] 483 | 484 | [[package]] 485 | name = "native-tls" 486 | version = "0.2.7" 487 | source = "registry+https://github.com/rust-lang/crates.io-index" 488 | checksum = "b8d96b2e1c8da3957d58100b09f102c6d9cfdfced01b7ec5a8974044bb09dbd4" 489 | dependencies = [ 490 | "lazy_static", 491 | "libc", 492 | "log", 493 | "openssl", 494 | "openssl-probe", 495 | "openssl-sys", 496 | "schannel", 497 | "security-framework", 498 | "security-framework-sys", 499 | "tempfile", 500 | ] 501 | 502 | [[package]] 503 | name = "ntapi" 504 | version = "0.3.6" 505 | source = "registry+https://github.com/rust-lang/crates.io-index" 506 | checksum = "3f6bb902e437b6d86e03cce10a7e2af662292c5dfef23b65899ea3ac9354ad44" 507 | dependencies = [ 508 | "winapi", 509 | ] 510 | 511 | [[package]] 512 | name = "num_cpus" 513 | version = "1.13.0" 514 | source = "registry+https://github.com/rust-lang/crates.io-index" 515 | checksum = "05499f3756671c15885fee9034446956fff3f243d6077b91e5767df161f766b3" 516 | dependencies = [ 517 | "hermit-abi", 518 | "libc", 519 | ] 520 | 521 | [[package]] 522 | name = "once_cell" 523 | version = "1.8.0" 524 | source = "registry+https://github.com/rust-lang/crates.io-index" 525 | checksum = "692fcb63b64b1758029e0a96ee63e049ce8c5948587f2f7208df04625e5f6b56" 526 | 527 | [[package]] 528 | name = "openssl" 529 | version = "0.10.35" 530 | source = "registry+https://github.com/rust-lang/crates.io-index" 531 | checksum = "549430950c79ae24e6d02e0b7404534ecf311d94cc9f861e9e4020187d13d885" 532 | dependencies = [ 533 | "bitflags", 534 | "cfg-if", 535 | "foreign-types", 536 | "libc", 537 | "once_cell", 538 | "openssl-sys", 539 | ] 540 | 541 | [[package]] 542 | name = "openssl-probe" 543 | version = "0.1.4" 544 | source = "registry+https://github.com/rust-lang/crates.io-index" 545 | checksum = "28988d872ab76095a6e6ac88d99b54fd267702734fd7ffe610ca27f533ddb95a" 546 | 547 | [[package]] 548 | name = "openssl-sys" 549 | version = "0.9.65" 550 | source = "registry+https://github.com/rust-lang/crates.io-index" 551 | checksum = "7a7907e3bfa08bb85105209cdfcb6c63d109f8f6c1ed6ca318fff5c1853fbc1d" 552 | dependencies = [ 553 | "autocfg", 554 | "cc", 555 | "libc", 556 | "pkg-config", 557 | "vcpkg", 558 | ] 559 | 560 | [[package]] 561 | name = "parking_lot" 562 | version = "0.11.1" 563 | source = "registry+https://github.com/rust-lang/crates.io-index" 564 | checksum = "6d7744ac029df22dca6284efe4e898991d28e3085c706c972bcd7da4a27a15eb" 565 | dependencies = [ 566 | "instant", 567 | "lock_api", 568 | "parking_lot_core", 569 | ] 570 | 571 | [[package]] 572 | name = "parking_lot_core" 573 | version = "0.8.3" 574 | source = "registry+https://github.com/rust-lang/crates.io-index" 575 | checksum = "fa7a782938e745763fe6907fc6ba86946d72f49fe7e21de074e08128a99fb018" 576 | dependencies = [ 577 | "cfg-if", 578 | "instant", 579 | "libc", 580 | "redox_syscall", 581 | "smallvec", 582 | "winapi", 583 | ] 584 | 585 | [[package]] 586 | name = "percent-encoding" 587 | version = "2.1.0" 588 | source = "registry+https://github.com/rust-lang/crates.io-index" 589 | checksum = "d4fd5641d01c8f18a23da7b6fe29298ff4b55afcccdf78973b24cf3175fee32e" 590 | 591 | [[package]] 592 | name = "pin-project-lite" 593 | version = "0.2.7" 594 | source = "registry+https://github.com/rust-lang/crates.io-index" 595 | checksum = "8d31d11c69a6b52a174b42bdc0c30e5e11670f90788b2c471c31c1d17d449443" 596 | 597 | [[package]] 598 | name = "pin-utils" 599 | version = "0.1.0" 600 | source = "registry+https://github.com/rust-lang/crates.io-index" 601 | checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184" 602 | 603 | [[package]] 604 | name = "pkg-config" 605 | version = "0.3.19" 606 | source = "registry+https://github.com/rust-lang/crates.io-index" 607 | checksum = "3831453b3449ceb48b6d9c7ad7c96d5ea673e9b470a1dc578c2ce6521230884c" 608 | 609 | [[package]] 610 | name = "ppv-lite86" 611 | version = "0.2.10" 612 | source = "registry+https://github.com/rust-lang/crates.io-index" 613 | checksum = "ac74c624d6b2d21f425f752262f42188365d7b8ff1aff74c82e45136510a4857" 614 | 615 | [[package]] 616 | name = "proc-macro2" 617 | version = "1.0.27" 618 | source = "registry+https://github.com/rust-lang/crates.io-index" 619 | checksum = "f0d8caf72986c1a598726adc988bb5984792ef84f5ee5aa50209145ee8077038" 620 | dependencies = [ 621 | "unicode-xid", 622 | ] 623 | 624 | [[package]] 625 | name = "quick-error" 626 | version = "1.2.3" 627 | source = "registry+https://github.com/rust-lang/crates.io-index" 628 | checksum = "a1d01941d82fa2ab50be1e79e6714289dd7cde78eba4c074bc5a4374f650dfe0" 629 | 630 | [[package]] 631 | name = "quote" 632 | version = "1.0.9" 633 | source = "registry+https://github.com/rust-lang/crates.io-index" 634 | checksum = "c3d0b9745dc2debf507c8422de05d7226cc1f0644216dfdfead988f9b1ab32a7" 635 | dependencies = [ 636 | "proc-macro2", 637 | ] 638 | 639 | [[package]] 640 | name = "rand" 641 | version = "0.8.4" 642 | source = "registry+https://github.com/rust-lang/crates.io-index" 643 | checksum = "2e7573632e6454cf6b99d7aac4ccca54be06da05aca2ef7423d22d27d4d4bcd8" 644 | dependencies = [ 645 | "libc", 646 | "rand_chacha", 647 | "rand_core", 648 | "rand_hc", 649 | ] 650 | 651 | [[package]] 652 | name = "rand_chacha" 653 | version = "0.3.1" 654 | source = "registry+https://github.com/rust-lang/crates.io-index" 655 | checksum = "e6c10a63a0fa32252be49d21e7709d4d4baf8d231c2dbce1eaa8141b9b127d88" 656 | dependencies = [ 657 | "ppv-lite86", 658 | "rand_core", 659 | ] 660 | 661 | [[package]] 662 | name = "rand_core" 663 | version = "0.6.3" 664 | source = "registry+https://github.com/rust-lang/crates.io-index" 665 | checksum = "d34f1408f55294453790c48b2f1ebbb1c5b4b7563eb1f418bcfcfdbb06ebb4e7" 666 | dependencies = [ 667 | "getrandom", 668 | ] 669 | 670 | [[package]] 671 | name = "rand_hc" 672 | version = "0.3.1" 673 | source = "registry+https://github.com/rust-lang/crates.io-index" 674 | checksum = "d51e9f596de227fda2ea6c84607f5558e196eeaf43c986b724ba4fb8fdf497e7" 675 | dependencies = [ 676 | "rand_core", 677 | ] 678 | 679 | [[package]] 680 | name = "redox_syscall" 681 | version = "0.2.9" 682 | source = "registry+https://github.com/rust-lang/crates.io-index" 683 | checksum = "5ab49abadf3f9e1c4bc499e8845e152ad87d2ad2d30371841171169e9d75feee" 684 | dependencies = [ 685 | "bitflags", 686 | ] 687 | 688 | [[package]] 689 | name = "remove_dir_all" 690 | version = "0.5.3" 691 | source = "registry+https://github.com/rust-lang/crates.io-index" 692 | checksum = "3acd125665422973a33ac9d3dd2df85edad0f4ae9b00dafb1a05e43a9f5ef8e7" 693 | dependencies = [ 694 | "winapi", 695 | ] 696 | 697 | [[package]] 698 | name = "reqwest" 699 | version = "0.11.4" 700 | source = "registry+https://github.com/rust-lang/crates.io-index" 701 | checksum = "246e9f61b9bb77df069a947682be06e31ac43ea37862e244a69f177694ea6d22" 702 | dependencies = [ 703 | "base64", 704 | "bytes", 705 | "encoding_rs", 706 | "futures-core", 707 | "futures-util", 708 | "http", 709 | "http-body", 710 | "hyper", 711 | "hyper-tls", 712 | "ipnet", 713 | "js-sys", 714 | "lazy_static", 715 | "log", 716 | "mime", 717 | "native-tls", 718 | "percent-encoding", 719 | "pin-project-lite", 720 | "serde", 721 | "serde_urlencoded", 722 | "tokio", 723 | "tokio-native-tls", 724 | "url", 725 | "wasm-bindgen", 726 | "wasm-bindgen-futures", 727 | "web-sys", 728 | "winreg 0.7.0", 729 | ] 730 | 731 | [[package]] 732 | name = "resolv-conf" 733 | version = "0.7.0" 734 | source = "registry+https://github.com/rust-lang/crates.io-index" 735 | checksum = "52e44394d2086d010551b14b53b1f24e31647570cd1deb0379e2c21b329aba00" 736 | dependencies = [ 737 | "hostname", 738 | "quick-error", 739 | ] 740 | 741 | [[package]] 742 | name = "resolve-github" 743 | version = "0.1.1" 744 | dependencies = [ 745 | "hosts", 746 | "trust-dns-resolver", 747 | ] 748 | 749 | [[package]] 750 | name = "ring" 751 | version = "0.16.20" 752 | source = "registry+https://github.com/rust-lang/crates.io-index" 753 | checksum = "3053cf52e236a3ed746dfc745aa9cacf1b791d846bdaf412f60a8d7d6e17c8fc" 754 | dependencies = [ 755 | "cc", 756 | "libc", 757 | "once_cell", 758 | "spin", 759 | "untrusted", 760 | "web-sys", 761 | "winapi", 762 | ] 763 | 764 | [[package]] 765 | name = "rustls" 766 | version = "0.19.1" 767 | source = "registry+https://github.com/rust-lang/crates.io-index" 768 | checksum = "35edb675feee39aec9c99fa5ff985081995a06d594114ae14cbe797ad7b7a6d7" 769 | dependencies = [ 770 | "base64", 771 | "log", 772 | "ring", 773 | "sct", 774 | "webpki", 775 | ] 776 | 777 | [[package]] 778 | name = "ryu" 779 | version = "1.0.5" 780 | source = "registry+https://github.com/rust-lang/crates.io-index" 781 | checksum = "71d301d4193d031abdd79ff7e3dd721168a9572ef3fe51a1517aba235bd8f86e" 782 | 783 | [[package]] 784 | name = "schannel" 785 | version = "0.1.19" 786 | source = "registry+https://github.com/rust-lang/crates.io-index" 787 | checksum = "8f05ba609c234e60bee0d547fe94a4c7e9da733d1c962cf6e59efa4cd9c8bc75" 788 | dependencies = [ 789 | "lazy_static", 790 | "winapi", 791 | ] 792 | 793 | [[package]] 794 | name = "scopeguard" 795 | version = "1.1.0" 796 | source = "registry+https://github.com/rust-lang/crates.io-index" 797 | checksum = "d29ab0c6d3fc0ee92fe66e2d99f700eab17a8d57d1c1d3b748380fb20baa78cd" 798 | 799 | [[package]] 800 | name = "sct" 801 | version = "0.6.1" 802 | source = "registry+https://github.com/rust-lang/crates.io-index" 803 | checksum = "b362b83898e0e69f38515b82ee15aa80636befe47c3b6d3d89a911e78fc228ce" 804 | dependencies = [ 805 | "ring", 806 | "untrusted", 807 | ] 808 | 809 | [[package]] 810 | name = "security-framework" 811 | version = "2.3.1" 812 | source = "registry+https://github.com/rust-lang/crates.io-index" 813 | checksum = "23a2ac85147a3a11d77ecf1bc7166ec0b92febfa4461c37944e180f319ece467" 814 | dependencies = [ 815 | "bitflags", 816 | "core-foundation", 817 | "core-foundation-sys", 818 | "libc", 819 | "security-framework-sys", 820 | ] 821 | 822 | [[package]] 823 | name = "security-framework-sys" 824 | version = "2.3.0" 825 | source = "registry+https://github.com/rust-lang/crates.io-index" 826 | checksum = "7e4effb91b4b8b6fb7732e670b6cee160278ff8e6bf485c7805d9e319d76e284" 827 | dependencies = [ 828 | "core-foundation-sys", 829 | "libc", 830 | ] 831 | 832 | [[package]] 833 | name = "serde" 834 | version = "1.0.126" 835 | source = "registry+https://github.com/rust-lang/crates.io-index" 836 | checksum = "ec7505abeacaec74ae4778d9d9328fe5a5d04253220a85c4ee022239fc996d03" 837 | 838 | [[package]] 839 | name = "serde_json" 840 | version = "1.0.64" 841 | source = "registry+https://github.com/rust-lang/crates.io-index" 842 | checksum = "799e97dc9fdae36a5c8b8f2cae9ce2ee9fdce2058c57a93e6099d919fd982f79" 843 | dependencies = [ 844 | "itoa", 845 | "ryu", 846 | "serde", 847 | ] 848 | 849 | [[package]] 850 | name = "serde_urlencoded" 851 | version = "0.7.0" 852 | source = "registry+https://github.com/rust-lang/crates.io-index" 853 | checksum = "edfa57a7f8d9c1d260a549e7224100f6c43d43f9103e06dd8b4095a9b2b43ce9" 854 | dependencies = [ 855 | "form_urlencoded", 856 | "itoa", 857 | "ryu", 858 | "serde", 859 | ] 860 | 861 | [[package]] 862 | name = "slab" 863 | version = "0.4.3" 864 | source = "registry+https://github.com/rust-lang/crates.io-index" 865 | checksum = "f173ac3d1a7e3b28003f40de0b5ce7fe2710f9b9dc3fc38664cebee46b3b6527" 866 | 867 | [[package]] 868 | name = "smallvec" 869 | version = "1.6.1" 870 | source = "registry+https://github.com/rust-lang/crates.io-index" 871 | checksum = "fe0f37c9e8f3c5a4a66ad655a93c74daac4ad00c441533bf5c6e7990bb42604e" 872 | 873 | [[package]] 874 | name = "socket2" 875 | version = "0.3.19" 876 | source = "registry+https://github.com/rust-lang/crates.io-index" 877 | checksum = "122e570113d28d773067fab24266b66753f6ea915758651696b6e35e49f88d6e" 878 | dependencies = [ 879 | "cfg-if", 880 | "libc", 881 | "winapi", 882 | ] 883 | 884 | [[package]] 885 | name = "socket2" 886 | version = "0.4.0" 887 | source = "registry+https://github.com/rust-lang/crates.io-index" 888 | checksum = "9e3dfc207c526015c632472a77be09cf1b6e46866581aecae5cc38fb4235dea2" 889 | dependencies = [ 890 | "libc", 891 | "winapi", 892 | ] 893 | 894 | [[package]] 895 | name = "spin" 896 | version = "0.5.2" 897 | source = "registry+https://github.com/rust-lang/crates.io-index" 898 | checksum = "6e63cff320ae2c57904679ba7cb63280a3dc4613885beafb148ee7bf9aa9042d" 899 | 900 | [[package]] 901 | name = "syn" 902 | version = "1.0.73" 903 | source = "registry+https://github.com/rust-lang/crates.io-index" 904 | checksum = "f71489ff30030d2ae598524f61326b902466f72a0fb1a8564c001cc63425bcc7" 905 | dependencies = [ 906 | "proc-macro2", 907 | "quote", 908 | "unicode-xid", 909 | ] 910 | 911 | [[package]] 912 | name = "tempfile" 913 | version = "3.2.0" 914 | source = "registry+https://github.com/rust-lang/crates.io-index" 915 | checksum = "dac1c663cfc93810f88aed9b8941d48cabf856a1b111c29a40439018d870eb22" 916 | dependencies = [ 917 | "cfg-if", 918 | "libc", 919 | "rand", 920 | "redox_syscall", 921 | "remove_dir_all", 922 | "winapi", 923 | ] 924 | 925 | [[package]] 926 | name = "thiserror" 927 | version = "1.0.26" 928 | source = "registry+https://github.com/rust-lang/crates.io-index" 929 | checksum = "93119e4feac1cbe6c798c34d3a53ea0026b0b1de6a120deef895137c0529bfe2" 930 | dependencies = [ 931 | "thiserror-impl", 932 | ] 933 | 934 | [[package]] 935 | name = "thiserror-impl" 936 | version = "1.0.26" 937 | source = "registry+https://github.com/rust-lang/crates.io-index" 938 | checksum = "060d69a0afe7796bf42e9e2ff91f5ee691fb15c53d38b4b62a9a53eb23164745" 939 | dependencies = [ 940 | "proc-macro2", 941 | "quote", 942 | "syn", 943 | ] 944 | 945 | [[package]] 946 | name = "tinyvec" 947 | version = "1.2.0" 948 | source = "registry+https://github.com/rust-lang/crates.io-index" 949 | checksum = "5b5220f05bb7de7f3f53c7c065e1199b3172696fe2db9f9c4d8ad9b4ee74c342" 950 | dependencies = [ 951 | "tinyvec_macros", 952 | ] 953 | 954 | [[package]] 955 | name = "tinyvec_macros" 956 | version = "0.1.0" 957 | source = "registry+https://github.com/rust-lang/crates.io-index" 958 | checksum = "cda74da7e1a664f795bb1f8a87ec406fb89a02522cf6e50620d016add6dbbf5c" 959 | 960 | [[package]] 961 | name = "tokio" 962 | version = "1.8.1" 963 | source = "registry+https://github.com/rust-lang/crates.io-index" 964 | checksum = "98c8b05dc14c75ea83d63dd391100353789f5f24b8b3866542a5e85c8be8e985" 965 | dependencies = [ 966 | "autocfg", 967 | "bytes", 968 | "libc", 969 | "memchr", 970 | "mio", 971 | "num_cpus", 972 | "pin-project-lite", 973 | "winapi", 974 | ] 975 | 976 | [[package]] 977 | name = "tokio-native-tls" 978 | version = "0.3.0" 979 | source = "registry+https://github.com/rust-lang/crates.io-index" 980 | checksum = "f7d995660bd2b7f8c1568414c1126076c13fbb725c40112dc0120b78eb9b717b" 981 | dependencies = [ 982 | "native-tls", 983 | "tokio", 984 | ] 985 | 986 | [[package]] 987 | name = "tokio-rustls" 988 | version = "0.22.0" 989 | source = "registry+https://github.com/rust-lang/crates.io-index" 990 | checksum = "bc6844de72e57df1980054b38be3a9f4702aba4858be64dd700181a8a6d0e1b6" 991 | dependencies = [ 992 | "rustls", 993 | "tokio", 994 | "webpki", 995 | ] 996 | 997 | [[package]] 998 | name = "tokio-util" 999 | version = "0.6.7" 1000 | source = "registry+https://github.com/rust-lang/crates.io-index" 1001 | checksum = "1caa0b0c8d94a049db56b5acf8cba99dc0623aab1b26d5b5f5e2d945846b3592" 1002 | dependencies = [ 1003 | "bytes", 1004 | "futures-core", 1005 | "futures-sink", 1006 | "log", 1007 | "pin-project-lite", 1008 | "tokio", 1009 | ] 1010 | 1011 | [[package]] 1012 | name = "toml" 1013 | version = "0.5.8" 1014 | source = "registry+https://github.com/rust-lang/crates.io-index" 1015 | checksum = "a31142970826733df8241ef35dc040ef98c679ab14d7c3e54d827099b3acecaa" 1016 | dependencies = [ 1017 | "serde", 1018 | ] 1019 | 1020 | [[package]] 1021 | name = "tower-service" 1022 | version = "0.3.1" 1023 | source = "registry+https://github.com/rust-lang/crates.io-index" 1024 | checksum = "360dfd1d6d30e05fda32ace2c8c70e9c0a9da713275777f5a4dbb8a1893930c6" 1025 | 1026 | [[package]] 1027 | name = "tracing" 1028 | version = "0.1.26" 1029 | source = "registry+https://github.com/rust-lang/crates.io-index" 1030 | checksum = "09adeb8c97449311ccd28a427f96fb563e7fd31aabf994189879d9da2394b89d" 1031 | dependencies = [ 1032 | "cfg-if", 1033 | "pin-project-lite", 1034 | "tracing-core", 1035 | ] 1036 | 1037 | [[package]] 1038 | name = "tracing-core" 1039 | version = "0.1.18" 1040 | source = "registry+https://github.com/rust-lang/crates.io-index" 1041 | checksum = "a9ff14f98b1a4b289c6248a023c1c2fa1491062964e9fed67ab29c4e4da4a052" 1042 | dependencies = [ 1043 | "lazy_static", 1044 | ] 1045 | 1046 | [[package]] 1047 | name = "trust-dns-https" 1048 | version = "0.20.3" 1049 | source = "registry+https://github.com/rust-lang/crates.io-index" 1050 | checksum = "9ab5bd71e569c3bf8c0398182bbbdd3065528dbe8cc5d2a9263641e3fdd6775d" 1051 | dependencies = [ 1052 | "bytes", 1053 | "cfg-if", 1054 | "data-encoding", 1055 | "futures-util", 1056 | "h2", 1057 | "http", 1058 | "log", 1059 | "rustls", 1060 | "thiserror", 1061 | "tokio", 1062 | "tokio-rustls", 1063 | "trust-dns-proto", 1064 | "trust-dns-rustls", 1065 | "webpki", 1066 | "webpki-roots", 1067 | ] 1068 | 1069 | [[package]] 1070 | name = "trust-dns-proto" 1071 | version = "0.20.3" 1072 | source = "registry+https://github.com/rust-lang/crates.io-index" 1073 | checksum = "ad0d7f5db438199a6e2609debe3f69f808d074e0a2888ee0bccb45fe234d03f4" 1074 | dependencies = [ 1075 | "async-trait", 1076 | "cfg-if", 1077 | "data-encoding", 1078 | "enum-as-inner", 1079 | "futures-channel", 1080 | "futures-io", 1081 | "futures-util", 1082 | "idna", 1083 | "ipnet", 1084 | "lazy_static", 1085 | "log", 1086 | "rand", 1087 | "smallvec", 1088 | "thiserror", 1089 | "tinyvec", 1090 | "tokio", 1091 | "url", 1092 | ] 1093 | 1094 | [[package]] 1095 | name = "trust-dns-resolver" 1096 | version = "0.20.3" 1097 | source = "registry+https://github.com/rust-lang/crates.io-index" 1098 | checksum = "f6ad17b608a64bd0735e67bde16b0636f8aa8591f831a25d18443ed00a699770" 1099 | dependencies = [ 1100 | "cfg-if", 1101 | "futures-util", 1102 | "ipconfig", 1103 | "lazy_static", 1104 | "log", 1105 | "lru-cache", 1106 | "parking_lot", 1107 | "resolv-conf", 1108 | "rustls", 1109 | "smallvec", 1110 | "thiserror", 1111 | "tokio", 1112 | "tokio-rustls", 1113 | "trust-dns-https", 1114 | "trust-dns-proto", 1115 | "trust-dns-rustls", 1116 | "webpki-roots", 1117 | ] 1118 | 1119 | [[package]] 1120 | name = "trust-dns-rustls" 1121 | version = "0.20.3" 1122 | source = "registry+https://github.com/rust-lang/crates.io-index" 1123 | checksum = "808b76640354180e411074e9874632e73aa2a5206b7a621928834ae791e9628b" 1124 | dependencies = [ 1125 | "futures-channel", 1126 | "futures-io", 1127 | "futures-util", 1128 | "log", 1129 | "rustls", 1130 | "tokio", 1131 | "tokio-rustls", 1132 | "trust-dns-proto", 1133 | "webpki", 1134 | ] 1135 | 1136 | [[package]] 1137 | name = "try-lock" 1138 | version = "0.2.3" 1139 | source = "registry+https://github.com/rust-lang/crates.io-index" 1140 | checksum = "59547bce71d9c38b83d9c0e92b6066c4253371f15005def0c30d9657f50c7642" 1141 | 1142 | [[package]] 1143 | name = "unicode-bidi" 1144 | version = "0.3.5" 1145 | source = "registry+https://github.com/rust-lang/crates.io-index" 1146 | checksum = "eeb8be209bb1c96b7c177c7420d26e04eccacb0eeae6b980e35fcb74678107e0" 1147 | dependencies = [ 1148 | "matches", 1149 | ] 1150 | 1151 | [[package]] 1152 | name = "unicode-normalization" 1153 | version = "0.1.19" 1154 | source = "registry+https://github.com/rust-lang/crates.io-index" 1155 | checksum = "d54590932941a9e9266f0832deed84ebe1bf2e4c9e4a3554d393d18f5e854bf9" 1156 | dependencies = [ 1157 | "tinyvec", 1158 | ] 1159 | 1160 | [[package]] 1161 | name = "unicode-segmentation" 1162 | version = "1.8.0" 1163 | source = "registry+https://github.com/rust-lang/crates.io-index" 1164 | checksum = "8895849a949e7845e06bd6dc1aa51731a103c42707010a5b591c0038fb73385b" 1165 | 1166 | [[package]] 1167 | name = "unicode-xid" 1168 | version = "0.2.2" 1169 | source = "registry+https://github.com/rust-lang/crates.io-index" 1170 | checksum = "8ccb82d61f80a663efe1f787a51b16b5a51e3314d6ac365b08639f52387b33f3" 1171 | 1172 | [[package]] 1173 | name = "untrusted" 1174 | version = "0.7.1" 1175 | source = "registry+https://github.com/rust-lang/crates.io-index" 1176 | checksum = "a156c684c91ea7d62626509bce3cb4e1d9ed5c4d978f7b4352658f96a4c26b4a" 1177 | 1178 | [[package]] 1179 | name = "url" 1180 | version = "2.2.2" 1181 | source = "registry+https://github.com/rust-lang/crates.io-index" 1182 | checksum = "a507c383b2d33b5fc35d1861e77e6b383d158b2da5e14fe51b83dfedf6fd578c" 1183 | dependencies = [ 1184 | "form_urlencoded", 1185 | "idna", 1186 | "matches", 1187 | "percent-encoding", 1188 | ] 1189 | 1190 | [[package]] 1191 | name = "vcpkg" 1192 | version = "0.2.15" 1193 | source = "registry+https://github.com/rust-lang/crates.io-index" 1194 | checksum = "accd4ea62f7bb7a82fe23066fb0957d48ef677f6eeb8215f372f52e48bb32426" 1195 | 1196 | [[package]] 1197 | name = "want" 1198 | version = "0.3.0" 1199 | source = "registry+https://github.com/rust-lang/crates.io-index" 1200 | checksum = "1ce8a968cb1cd110d136ff8b819a556d6fb6d919363c61534f6860c7eb172ba0" 1201 | dependencies = [ 1202 | "log", 1203 | "try-lock", 1204 | ] 1205 | 1206 | [[package]] 1207 | name = "wasi" 1208 | version = "0.10.2+wasi-snapshot-preview1" 1209 | source = "registry+https://github.com/rust-lang/crates.io-index" 1210 | checksum = "fd6fbd9a79829dd1ad0cc20627bf1ed606756a7f77edff7b66b7064f9cb327c6" 1211 | 1212 | [[package]] 1213 | name = "wasm-bindgen" 1214 | version = "0.2.74" 1215 | source = "registry+https://github.com/rust-lang/crates.io-index" 1216 | checksum = "d54ee1d4ed486f78874278e63e4069fc1ab9f6a18ca492076ffb90c5eb2997fd" 1217 | dependencies = [ 1218 | "cfg-if", 1219 | "serde", 1220 | "serde_json", 1221 | "wasm-bindgen-macro", 1222 | ] 1223 | 1224 | [[package]] 1225 | name = "wasm-bindgen-backend" 1226 | version = "0.2.74" 1227 | source = "registry+https://github.com/rust-lang/crates.io-index" 1228 | checksum = "3b33f6a0694ccfea53d94db8b2ed1c3a8a4c86dd936b13b9f0a15ec4a451b900" 1229 | dependencies = [ 1230 | "bumpalo", 1231 | "lazy_static", 1232 | "log", 1233 | "proc-macro2", 1234 | "quote", 1235 | "syn", 1236 | "wasm-bindgen-shared", 1237 | ] 1238 | 1239 | [[package]] 1240 | name = "wasm-bindgen-futures" 1241 | version = "0.4.24" 1242 | source = "registry+https://github.com/rust-lang/crates.io-index" 1243 | checksum = "5fba7978c679d53ce2d0ac80c8c175840feb849a161664365d1287b41f2e67f1" 1244 | dependencies = [ 1245 | "cfg-if", 1246 | "js-sys", 1247 | "wasm-bindgen", 1248 | "web-sys", 1249 | ] 1250 | 1251 | [[package]] 1252 | name = "wasm-bindgen-macro" 1253 | version = "0.2.74" 1254 | source = "registry+https://github.com/rust-lang/crates.io-index" 1255 | checksum = "088169ca61430fe1e58b8096c24975251700e7b1f6fd91cc9d59b04fb9b18bd4" 1256 | dependencies = [ 1257 | "quote", 1258 | "wasm-bindgen-macro-support", 1259 | ] 1260 | 1261 | [[package]] 1262 | name = "wasm-bindgen-macro-support" 1263 | version = "0.2.74" 1264 | source = "registry+https://github.com/rust-lang/crates.io-index" 1265 | checksum = "be2241542ff3d9f241f5e2cb6dd09b37efe786df8851c54957683a49f0987a97" 1266 | dependencies = [ 1267 | "proc-macro2", 1268 | "quote", 1269 | "syn", 1270 | "wasm-bindgen-backend", 1271 | "wasm-bindgen-shared", 1272 | ] 1273 | 1274 | [[package]] 1275 | name = "wasm-bindgen-shared" 1276 | version = "0.2.74" 1277 | source = "registry+https://github.com/rust-lang/crates.io-index" 1278 | checksum = "d7cff876b8f18eed75a66cf49b65e7f967cb354a7aa16003fb55dbfd25b44b4f" 1279 | 1280 | [[package]] 1281 | name = "web-sys" 1282 | version = "0.3.51" 1283 | source = "registry+https://github.com/rust-lang/crates.io-index" 1284 | checksum = "e828417b379f3df7111d3a2a9e5753706cae29c41f7c4029ee9fd77f3e09e582" 1285 | dependencies = [ 1286 | "js-sys", 1287 | "wasm-bindgen", 1288 | ] 1289 | 1290 | [[package]] 1291 | name = "webpki" 1292 | version = "0.21.4" 1293 | source = "registry+https://github.com/rust-lang/crates.io-index" 1294 | checksum = "b8e38c0608262c46d4a56202ebabdeb094cef7e560ca7a226c6bf055188aa4ea" 1295 | dependencies = [ 1296 | "ring", 1297 | "untrusted", 1298 | ] 1299 | 1300 | [[package]] 1301 | name = "webpki-roots" 1302 | version = "0.21.1" 1303 | source = "registry+https://github.com/rust-lang/crates.io-index" 1304 | checksum = "aabe153544e473b775453675851ecc86863d2a81d786d741f6b76778f2a48940" 1305 | dependencies = [ 1306 | "webpki", 1307 | ] 1308 | 1309 | [[package]] 1310 | name = "widestring" 1311 | version = "0.4.3" 1312 | source = "registry+https://github.com/rust-lang/crates.io-index" 1313 | checksum = "c168940144dd21fd8046987c16a46a33d5fc84eec29ef9dcddc2ac9e31526b7c" 1314 | 1315 | [[package]] 1316 | name = "winapi" 1317 | version = "0.3.9" 1318 | source = "registry+https://github.com/rust-lang/crates.io-index" 1319 | checksum = "5c839a674fcd7a98952e593242ea400abe93992746761e38641405d28b00f419" 1320 | dependencies = [ 1321 | "winapi-i686-pc-windows-gnu", 1322 | "winapi-x86_64-pc-windows-gnu", 1323 | ] 1324 | 1325 | [[package]] 1326 | name = "winapi-i686-pc-windows-gnu" 1327 | version = "0.4.0" 1328 | source = "registry+https://github.com/rust-lang/crates.io-index" 1329 | checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" 1330 | 1331 | [[package]] 1332 | name = "winapi-x86_64-pc-windows-gnu" 1333 | version = "0.4.0" 1334 | source = "registry+https://github.com/rust-lang/crates.io-index" 1335 | checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" 1336 | 1337 | [[package]] 1338 | name = "winreg" 1339 | version = "0.6.2" 1340 | source = "registry+https://github.com/rust-lang/crates.io-index" 1341 | checksum = "b2986deb581c4fe11b621998a5e53361efe6b48a151178d0cd9eeffa4dc6acc9" 1342 | dependencies = [ 1343 | "winapi", 1344 | ] 1345 | 1346 | [[package]] 1347 | name = "winreg" 1348 | version = "0.7.0" 1349 | source = "registry+https://github.com/rust-lang/crates.io-index" 1350 | checksum = "0120db82e8a1e0b9fb3345a539c478767c0048d842860994d96113d5b667bd69" 1351 | dependencies = [ 1352 | "winapi", 1353 | ] 1354 | 1355 | [[package]] 1356 | name = "winres" 1357 | version = "0.1.11" 1358 | source = "registry+https://github.com/rust-lang/crates.io-index" 1359 | checksum = "ff4fb510bbfe5b8992ff15f77a2e6fe6cf062878f0eda00c0f44963a807ca5dc" 1360 | dependencies = [ 1361 | "toml", 1362 | ] 1363 | -------------------------------------------------------------------------------- /Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "hosts" 3 | description = "" 4 | version = "0.1.1" 5 | authors = ["zu1k "] 6 | repository = "https://github.com/zu1k/github-hosts" 7 | license = "MIT" 8 | edition = "2018" 9 | 10 | [dependencies] 11 | 12 | [workspace] 13 | members = [ 14 | "github-hosts", 15 | "resolve-github" 16 | ] 17 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2021 zu1k 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # hosts-rs 2 | 3 | - hosts: Hosts file parsing, modification library 4 | - [resolve-github](./resolve-github): Use Cloudflare DoH to resolve GitHub domains and generate hosts files 5 | - [github-hosts](./github-hosts): Modify hosts to speed up GitHub access 6 | -------------------------------------------------------------------------------- /github-hosts/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "github-hosts" 3 | description = "Modify hosts to speed up GitHub access." 4 | version = "0.1.1" 5 | edition = "2018" 6 | build = "build.rs" 7 | 8 | [dependencies] 9 | hosts = { path = "../" } 10 | reqwest = { version = "0.11", features = ["blocking"] } 11 | 12 | [target.'cfg(target_os="windows")'.build-dependencies] 13 | winres = "0.1" 14 | -------------------------------------------------------------------------------- /github-hosts/README.md: -------------------------------------------------------------------------------- 1 | # GitHub Hosts 2 | 3 | Modify hosts to speed up GitHub access. 4 | 5 | Thanks to https://github.com/521xueweihan/GitHub520 6 | -------------------------------------------------------------------------------- /github-hosts/build.rs: -------------------------------------------------------------------------------- 1 | #[cfg(target_os = "windows")] 2 | use winres; 3 | 4 | // only build for windows 5 | #[cfg(target_os = "windows")] 6 | fn main() { 7 | use std::io::Write; 8 | // only build the resource for release builds 9 | // as calling rc.exe might be slow 10 | if std::env::var("PROFILE").unwrap() == "release" { 11 | let mut res = winres::WindowsResource::new(); 12 | res.set_icon("resources//dns.ico") 13 | .set_manifest_file("resources//manifest.xml"); 14 | match res.compile() { 15 | Err(e) => { 16 | write!(std::io::stderr(), "{}", e).unwrap(); 17 | std::process::exit(1); 18 | } 19 | Ok(_) => {} 20 | } 21 | } 22 | } 23 | 24 | // nothing to do for other operating systems 25 | #[cfg(not(target_os = "windows"))] 26 | fn main() {} 27 | -------------------------------------------------------------------------------- /github-hosts/resources/dns.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zu1k/hosts-rs/04f86e2585ced498b37b1e2d7a6d9a51c6475dad/github-hosts/resources/dns.ico -------------------------------------------------------------------------------- /github-hosts/resources/manifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | -------------------------------------------------------------------------------- /github-hosts/src/main.rs: -------------------------------------------------------------------------------- 1 | #![windows_subsystem = "windows"] 2 | 3 | mod req; 4 | use req::*; 5 | 6 | use hosts::*; 7 | 8 | fn main() { 9 | if let Some(hosts) = fetch() { 10 | let hosts = Hosts::from(hosts); 11 | 12 | match mod_hosts_file(hosts.to_string()) { 13 | Ok(_) => println!("Success!"), 14 | Err(err) => eprintln!("Error: {}", err), 15 | } 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /github-hosts/src/req.rs: -------------------------------------------------------------------------------- 1 | use reqwest::blocking::Client; 2 | use std::time::Duration; 3 | 4 | const USER_AGENT: &str = "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.124 Safari/537.36"; 5 | 6 | pub const GITHUB_HOSTS: [&str; 4] = [ 7 | "https://api.hellogithub.com/GitHub520/hosts", 8 | "https://raw.hellogithub.com/hosts", 9 | "https://raw.githubusercontent.com/521xueweihan/GitHub520/main/hosts", 10 | "https://www.suni.cf:8880/Hosts/GithubHosts.txt", 11 | ]; 12 | 13 | pub fn fetch() -> Option { 14 | let client = Client::builder() 15 | .timeout(Duration::from_secs(10)) 16 | .user_agent(USER_AGENT) 17 | .build() 18 | .unwrap(); 19 | 20 | for url in GITHUB_HOSTS { 21 | if let Ok(resp) = client.get(url).send() { 22 | if let Ok(body) = resp.text() { 23 | println!("valid url: {}", url); 24 | return Some(body); 25 | } 26 | } 27 | } 28 | 29 | None 30 | } 31 | -------------------------------------------------------------------------------- /resolve-github/.gitignore: -------------------------------------------------------------------------------- 1 | .vscode 2 | .idea 3 | 4 | /target 5 | hosts -------------------------------------------------------------------------------- /resolve-github/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "resolve-github" 3 | version = "0.1.1" 4 | edition = "2018" 5 | 6 | [dependencies] 7 | hosts = { path = "../" } 8 | trust-dns-resolver = { version = "0.20", features = ["dns-over-https-rustls"] } 9 | 10 | -------------------------------------------------------------------------------- /resolve-github/README.md: -------------------------------------------------------------------------------- 1 | # resolve-github 2 | 3 | Use Cloudflare DoH to resolve GitHub domains and generate hosts files. 4 | -------------------------------------------------------------------------------- /resolve-github/src/dns/mod.rs: -------------------------------------------------------------------------------- 1 | mod res; 2 | mod resolve; 3 | 4 | pub use res::*; 5 | pub use resolve::*; 6 | -------------------------------------------------------------------------------- /resolve-github/src/dns/res.rs: -------------------------------------------------------------------------------- 1 | pub const GITHUB_ASSETS: [&str; 33] = [ 2 | "alive.github.com", 3 | "live.github.com", 4 | "github.githubassets.com", 5 | "central.github.com", 6 | "desktop.githubusercontent.com", 7 | "assets-cdn.github.com", 8 | "camo.githubusercontent.com", 9 | "github.map.fastly.net", 10 | "github.global.ssl.fastly.net", 11 | "gist.github.com", 12 | "github.io", 13 | "github.com", 14 | "github.blog", 15 | "api.github.com", 16 | "raw.githubusercontent.com", 17 | "user-images.githubusercontent.com", 18 | "favicons.githubusercontent.com", 19 | "avatars5.githubusercontent.com", 20 | "avatars4.githubusercontent.com", 21 | "avatars3.githubusercontent.com", 22 | "avatars2.githubusercontent.com", 23 | "avatars1.githubusercontent.com", 24 | "avatars0.githubusercontent.com", 25 | "avatars.githubusercontent.com", 26 | "codeload.github.com", 27 | "github-cloud.s3.amazonaws.com", 28 | "github-com.s3.amazonaws.com", 29 | "github-production-release-asset-2e65be.s3.amazonaws.com", 30 | "github-production-user-asset-6210df.s3.amazonaws.com", 31 | "github-production-repository-file-5c1aeb.s3.amazonaws.com", 32 | "githubstatus.com", 33 | "github.community", 34 | "media.githubusercontent.com", 35 | ]; 36 | -------------------------------------------------------------------------------- /resolve-github/src/dns/resolve.rs: -------------------------------------------------------------------------------- 1 | use super::res::GITHUB_ASSETS; 2 | use hosts::*; 3 | use std::net::IpAddr; 4 | use trust_dns_resolver::Resolver; 5 | use trust_dns_resolver::{config::*, error::ResolveError}; 6 | 7 | pub struct Client { 8 | resolver: Resolver, 9 | } 10 | 11 | impl std::default::Default for Client { 12 | fn default() -> Self { 13 | let resolver = 14 | Resolver::new(ResolverConfig::cloudflare_https(), ResolverOpts::default()).unwrap(); 15 | Client { resolver } 16 | } 17 | } 18 | 19 | impl Client { 20 | pub fn resolve(&self, domain: &str) -> Result, ResolveError> { 21 | let response = self.resolver.lookup_ip(domain); 22 | match response { 23 | Ok(response) => { 24 | let mut fb_ipv6 = None; 25 | for item in response { 26 | if item.is_ipv4() { 27 | return Ok(Some(item)); 28 | } else if fb_ipv6.is_none() { 29 | fb_ipv6 = Some(item); 30 | } 31 | } 32 | Ok(fb_ipv6) 33 | } 34 | Err(e) => Err(e), 35 | } 36 | } 37 | } 38 | 39 | pub fn resolve_github_assets() -> Hosts { 40 | let client = Client::default(); 41 | let mut hosts = Hosts::default(); 42 | 43 | for domain in GITHUB_ASSETS { 44 | if let Ok(Some(ip)) = client.resolve(&domain) { 45 | hosts.insert(domain.to_string(), ip); 46 | } 47 | } 48 | 49 | hosts 50 | } 51 | -------------------------------------------------------------------------------- /resolve-github/src/main.rs: -------------------------------------------------------------------------------- 1 | mod dns; 2 | use dns::*; 3 | use std::{fs, io::Write}; 4 | 5 | fn main() { 6 | let hosts = resolve_github_assets(); 7 | if let Ok(mut file) = fs::File::create("hosts") { 8 | match file.write_all(hosts.to_string().as_bytes()) { 9 | Ok(_) => println!("Success"), 10 | Err(err) => eprintln!("Error: {}", err), 11 | } 12 | } else { 13 | println!("{:#?}", hosts); 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /src/file.rs: -------------------------------------------------------------------------------- 1 | use std::fs; 2 | use std::io::Write; 3 | 4 | #[cfg(target_os = "windows")] 5 | const HOST_FILE_PATH: &str = "C:\\Windows\\System32\\drivers\\etc\\hosts"; 6 | 7 | #[cfg(not(target_os = "windows"))] 8 | const HOST_FILE_PATH: &str = "/etc/hosts"; 9 | 10 | const MARK_START: &str = "# MARK_START"; 11 | const MARK_END: &str = "# MARK_END"; 12 | 13 | pub fn mod_hosts_file(hosts: String) -> Result<(), std::io::Error> { 14 | let mut txt = fs::read_to_string(HOST_FILE_PATH)?; 15 | let hosts = format!("{}\n{}{}", MARK_START, hosts, MARK_END); 16 | 17 | let idx_start = txt.find(MARK_START); 18 | let idx_end = txt.rfind(MARK_END); 19 | if idx_start.is_some() && idx_end.is_some() { 20 | let idx_start = idx_start.unwrap(); 21 | let idx_end = idx_end.unwrap() + MARK_END.len(); 22 | 23 | let pre: String = txt.chars().take(idx_start).collect(); 24 | let suf: String = txt.chars().skip(idx_end).collect(); 25 | txt = format!("{}{}{}", pre, hosts, suf); 26 | } else { 27 | txt = txt + hosts.as_str(); 28 | } 29 | 30 | let mut file = fs::File::create(HOST_FILE_PATH)?; 31 | file.write_all(txt.as_bytes()) 32 | } 33 | -------------------------------------------------------------------------------- /src/lib.rs: -------------------------------------------------------------------------------- 1 | mod file; 2 | 3 | pub use file::*; 4 | 5 | use std::collections::HashMap; 6 | use std::net::IpAddr; 7 | use std::str::FromStr; 8 | use std::vec::Vec; 9 | 10 | type HostItem = Vec; 11 | type HostMap = HashMap; 12 | 13 | #[derive(Debug, Default)] 14 | pub struct Hosts { 15 | pub data: HostMap, 16 | } 17 | 18 | impl Hosts { 19 | pub fn insert(&mut self, domain: String, ip: IpAddr) { 20 | let domains = self.data.entry(ip.to_string()).or_default(); 21 | domains.push(domain); 22 | } 23 | } 24 | 25 | impl From for Hosts { 26 | fn from(text: String) -> Self { 27 | let mut result = HostMap::new(); 28 | 29 | for line in text.lines() { 30 | if line.len() < 10 || line.starts_with("#") { 31 | continue; 32 | } 33 | 34 | let mut parts = line.split_whitespace(); 35 | match parts.next() { 36 | Some(ip) => match IpAddr::from_str(ip) { 37 | Ok(ip) => { 38 | let ip = ip.to_string(); 39 | let mut domains = HostItem::new(); 40 | while let Some(domain) = parts.next() { 41 | domains.push(domain.into()) 42 | } 43 | if domains.len() > 0 { 44 | let origin_domains = result.entry(ip).or_default(); 45 | origin_domains.append(&mut domains); 46 | } 47 | } 48 | Err(_) => continue, 49 | }, 50 | None => continue, 51 | } 52 | } 53 | 54 | Hosts { data: result } 55 | } 56 | } 57 | 58 | impl std::fmt::Display for Hosts { 59 | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { 60 | for (ip, domains) in self.data.iter() { 61 | f.write_str(format!("{}\t\t{}\n", ip, domains.join(" ")).as_str())?; 62 | } 63 | Ok(()) 64 | } 65 | } 66 | --------------------------------------------------------------------------------