├── Dockerfile ├── README.md ├── ctfwatch ├── .gitignore ├── Cargo.lock ├── Cargo.toml ├── out ├── rustfmt.toml └── src │ └── main.rs ├── entrypoint.sh ├── out ├── run.sh └── screenshot.png /Dockerfile: -------------------------------------------------------------------------------- 1 | # ubuntu 22 breaks podman 2 | FROM alpine:3.17 3 | 4 | RUN apk update 5 | RUN apk add chafa cargo openssl1.1-compat-dev ca-certificates bash socat 6 | 7 | COPY entrypoint.sh /entrypoint.sh 8 | 9 | CMD ["/bin/bash", "entrypoint.sh"] 10 | 11 | 12 | # later versions of archlinux have a broken pacman 13 | #FROM archlinux:base-devel-20210131.0.14634 14 | 15 | #RUN yes Y | pacman -Syy && yes Y | pacman -S archlinux-keyring --noconfirm &&\ 16 | #yes Y | pacman -Syyuu --noconfirm &&\ 17 | #yes Y | pacman -S cargo socat gcc pkgconf openssl chafa --noconfirm 18 | 19 | #COPY entrypoint.sh /entrypoint.sh 20 | 21 | #CMD ["/bin/bash", "entrypoint.sh"] 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | 2 | # Ctfwatch 3 | 4 | ![cool stuff](screenshot.png) 5 | 6 | Tired of going on [ctftime.org](https://ctftime.org) to check the upcoming ctfs? 7 | 8 | No worries, now you can do it directly from your terminal! 9 | 10 | Just `curl ctf.watch` or host your own by cloning this repo! 11 | 12 | 13 | 14 | # Instructions 15 | 16 | - `docker build -t ctfwatch .` 17 | 18 | - `bash run.sh` 19 | 20 | # Credits 21 | 22 | Data pulled from ctftime.org 23 | 24 | Thanks to @jonasbb's [ctftimebot](https://github.com/jonasbb/ctftimebot) for inspiration! 25 | 26 | Mini logos were generated using [chafa](https://github.com/hpjansson/chafa) 27 | -------------------------------------------------------------------------------- /ctfwatch/.gitignore: -------------------------------------------------------------------------------- 1 | target/ 2 | -------------------------------------------------------------------------------- /ctfwatch/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 = "android_system_properties" 7 | version = "0.1.5" 8 | source = "registry+https://github.com/rust-lang/crates.io-index" 9 | checksum = "819e7219dbd41043ac279b19830f2efc897156490d7fd6ea916720117ee66311" 10 | dependencies = [ 11 | "libc", 12 | ] 13 | 14 | [[package]] 15 | name = "arrayvec" 16 | version = "0.5.2" 17 | source = "registry+https://github.com/rust-lang/crates.io-index" 18 | checksum = "23b62fc65de8e4e7f52534fb52b0f3ed04746ae267519eef2a83941e8085068b" 19 | 20 | [[package]] 21 | name = "autocfg" 22 | version = "1.1.0" 23 | source = "registry+https://github.com/rust-lang/crates.io-index" 24 | checksum = "d468802bab17cbc0cc575e9b053f41e72aa36bfa6b7f55e3529ffa43161b97fa" 25 | 26 | [[package]] 27 | name = "base64" 28 | version = "0.21.0" 29 | source = "registry+https://github.com/rust-lang/crates.io-index" 30 | checksum = "a4a4ddaa51a5bc52a6948f74c06d20aaaddb71924eab79b8c97a8c556e942d6a" 31 | 32 | [[package]] 33 | name = "bitflags" 34 | version = "1.3.2" 35 | source = "registry+https://github.com/rust-lang/crates.io-index" 36 | checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" 37 | 38 | [[package]] 39 | name = "bumpalo" 40 | version = "3.12.0" 41 | source = "registry+https://github.com/rust-lang/crates.io-index" 42 | checksum = "0d261e256854913907f67ed06efbc3338dfe6179796deefc1ff763fc1aee5535" 43 | 44 | [[package]] 45 | name = "bytes" 46 | version = "1.4.0" 47 | source = "registry+https://github.com/rust-lang/crates.io-index" 48 | checksum = "89b2fd2a0dcf38d7971e2194b6b6eebab45ae01067456a7fd93d5547a61b70be" 49 | 50 | [[package]] 51 | name = "cc" 52 | version = "1.0.79" 53 | source = "registry+https://github.com/rust-lang/crates.io-index" 54 | checksum = "50d30906286121d95be3d479533b458f87493b30a4b5f79a607db8f5d11aa91f" 55 | 56 | [[package]] 57 | name = "cfg-if" 58 | version = "1.0.0" 59 | source = "registry+https://github.com/rust-lang/crates.io-index" 60 | checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" 61 | 62 | [[package]] 63 | name = "chrono" 64 | version = "0.4.24" 65 | source = "registry+https://github.com/rust-lang/crates.io-index" 66 | checksum = "4e3c5919066adf22df73762e50cffcde3a758f2a848b113b586d1f86728b673b" 67 | dependencies = [ 68 | "iana-time-zone", 69 | "js-sys", 70 | "num-integer", 71 | "num-traits", 72 | "serde", 73 | "time", 74 | "wasm-bindgen", 75 | "winapi", 76 | ] 77 | 78 | [[package]] 79 | name = "codespan-reporting" 80 | version = "0.11.1" 81 | source = "registry+https://github.com/rust-lang/crates.io-index" 82 | checksum = "3538270d33cc669650c4b093848450d380def10c331d38c768e34cac80576e6e" 83 | dependencies = [ 84 | "termcolor", 85 | "unicode-width", 86 | ] 87 | 88 | [[package]] 89 | name = "core-foundation" 90 | version = "0.9.3" 91 | source = "registry+https://github.com/rust-lang/crates.io-index" 92 | checksum = "194a7a9e6de53fa55116934067c844d9d749312f75c6f6d0980e8c252f8c2146" 93 | dependencies = [ 94 | "core-foundation-sys", 95 | "libc", 96 | ] 97 | 98 | [[package]] 99 | name = "core-foundation-sys" 100 | version = "0.8.3" 101 | source = "registry+https://github.com/rust-lang/crates.io-index" 102 | checksum = "5827cebf4670468b8772dd191856768aedcb1b0278a04f989f7766351917b9dc" 103 | 104 | [[package]] 105 | name = "ctf_watch" 106 | version = "0.1.0" 107 | dependencies = [ 108 | "chrono", 109 | "reqwest", 110 | "serde", 111 | "strip-ansi-escapes", 112 | "unicode-segmentation", 113 | ] 114 | 115 | [[package]] 116 | name = "cxx" 117 | version = "1.0.94" 118 | source = "registry+https://github.com/rust-lang/crates.io-index" 119 | checksum = "f61f1b6389c3fe1c316bf8a4dccc90a38208354b330925bce1f74a6c4756eb93" 120 | dependencies = [ 121 | "cc", 122 | "cxxbridge-flags", 123 | "cxxbridge-macro", 124 | "link-cplusplus", 125 | ] 126 | 127 | [[package]] 128 | name = "cxx-build" 129 | version = "1.0.94" 130 | source = "registry+https://github.com/rust-lang/crates.io-index" 131 | checksum = "12cee708e8962df2aeb38f594aae5d827c022b6460ac71a7a3e2c3c2aae5a07b" 132 | dependencies = [ 133 | "cc", 134 | "codespan-reporting", 135 | "once_cell", 136 | "proc-macro2", 137 | "quote", 138 | "scratch", 139 | "syn 2.0.10", 140 | ] 141 | 142 | [[package]] 143 | name = "cxxbridge-flags" 144 | version = "1.0.94" 145 | source = "registry+https://github.com/rust-lang/crates.io-index" 146 | checksum = "7944172ae7e4068c533afbb984114a56c46e9ccddda550499caa222902c7f7bb" 147 | 148 | [[package]] 149 | name = "cxxbridge-macro" 150 | version = "1.0.94" 151 | source = "registry+https://github.com/rust-lang/crates.io-index" 152 | checksum = "2345488264226bf682893e25de0769f3360aac9957980ec49361b083ddaa5bc5" 153 | dependencies = [ 154 | "proc-macro2", 155 | "quote", 156 | "syn 2.0.10", 157 | ] 158 | 159 | [[package]] 160 | name = "encoding_rs" 161 | version = "0.8.32" 162 | source = "registry+https://github.com/rust-lang/crates.io-index" 163 | checksum = "071a31f4ee85403370b58aca746f01041ede6f0da2730960ad001edc2b71b394" 164 | dependencies = [ 165 | "cfg-if", 166 | ] 167 | 168 | [[package]] 169 | name = "errno" 170 | version = "0.2.8" 171 | source = "registry+https://github.com/rust-lang/crates.io-index" 172 | checksum = "f639046355ee4f37944e44f60642c6f3a7efa3cf6b78c78a0d989a8ce6c396a1" 173 | dependencies = [ 174 | "errno-dragonfly", 175 | "libc", 176 | "winapi", 177 | ] 178 | 179 | [[package]] 180 | name = "errno-dragonfly" 181 | version = "0.1.2" 182 | source = "registry+https://github.com/rust-lang/crates.io-index" 183 | checksum = "aa68f1b12764fab894d2755d2518754e71b4fd80ecfb822714a1206c2aab39bf" 184 | dependencies = [ 185 | "cc", 186 | "libc", 187 | ] 188 | 189 | [[package]] 190 | name = "fastrand" 191 | version = "1.9.0" 192 | source = "registry+https://github.com/rust-lang/crates.io-index" 193 | checksum = "e51093e27b0797c359783294ca4f0a911c270184cb10f85783b118614a1501be" 194 | dependencies = [ 195 | "instant", 196 | ] 197 | 198 | [[package]] 199 | name = "fnv" 200 | version = "1.0.7" 201 | source = "registry+https://github.com/rust-lang/crates.io-index" 202 | checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" 203 | 204 | [[package]] 205 | name = "foreign-types" 206 | version = "0.3.2" 207 | source = "registry+https://github.com/rust-lang/crates.io-index" 208 | checksum = "f6f339eb8adc052cd2ca78910fda869aefa38d22d5cb648e6485e4d3fc06f3b1" 209 | dependencies = [ 210 | "foreign-types-shared", 211 | ] 212 | 213 | [[package]] 214 | name = "foreign-types-shared" 215 | version = "0.1.1" 216 | source = "registry+https://github.com/rust-lang/crates.io-index" 217 | checksum = "00b0228411908ca8685dba7fc2cdd70ec9990a6e753e89b6ac91a84c40fbaf4b" 218 | 219 | [[package]] 220 | name = "form_urlencoded" 221 | version = "1.1.0" 222 | source = "registry+https://github.com/rust-lang/crates.io-index" 223 | checksum = "a9c384f161156f5260c24a097c56119f9be8c798586aecc13afbcbe7b7e26bf8" 224 | dependencies = [ 225 | "percent-encoding", 226 | ] 227 | 228 | [[package]] 229 | name = "futures-channel" 230 | version = "0.3.27" 231 | source = "registry+https://github.com/rust-lang/crates.io-index" 232 | checksum = "164713a5a0dcc3e7b4b1ed7d3b433cabc18025386f9339346e8daf15963cf7ac" 233 | dependencies = [ 234 | "futures-core", 235 | ] 236 | 237 | [[package]] 238 | name = "futures-core" 239 | version = "0.3.27" 240 | source = "registry+https://github.com/rust-lang/crates.io-index" 241 | checksum = "86d7a0c1aa76363dac491de0ee99faf6941128376f1cf96f07db7603b7de69dd" 242 | 243 | [[package]] 244 | name = "futures-io" 245 | version = "0.3.27" 246 | source = "registry+https://github.com/rust-lang/crates.io-index" 247 | checksum = "89d422fa3cbe3b40dca574ab087abb5bc98258ea57eea3fd6f1fa7162c778b91" 248 | 249 | [[package]] 250 | name = "futures-sink" 251 | version = "0.3.27" 252 | source = "registry+https://github.com/rust-lang/crates.io-index" 253 | checksum = "ec93083a4aecafb2a80a885c9de1f0ccae9dbd32c2bb54b0c3a65690e0b8d2f2" 254 | 255 | [[package]] 256 | name = "futures-task" 257 | version = "0.3.27" 258 | source = "registry+https://github.com/rust-lang/crates.io-index" 259 | checksum = "fd65540d33b37b16542a0438c12e6aeead10d4ac5d05bd3f805b8f35ab592879" 260 | 261 | [[package]] 262 | name = "futures-util" 263 | version = "0.3.27" 264 | source = "registry+https://github.com/rust-lang/crates.io-index" 265 | checksum = "3ef6b17e481503ec85211fed8f39d1970f128935ca1f814cd32ac4a6842e84ab" 266 | dependencies = [ 267 | "futures-core", 268 | "futures-io", 269 | "futures-task", 270 | "memchr", 271 | "pin-project-lite", 272 | "pin-utils", 273 | "slab", 274 | ] 275 | 276 | [[package]] 277 | name = "h2" 278 | version = "0.3.16" 279 | source = "registry+https://github.com/rust-lang/crates.io-index" 280 | checksum = "5be7b54589b581f624f566bf5d8eb2bab1db736c51528720b6bd36b96b55924d" 281 | dependencies = [ 282 | "bytes", 283 | "fnv", 284 | "futures-core", 285 | "futures-sink", 286 | "futures-util", 287 | "http", 288 | "indexmap", 289 | "slab", 290 | "tokio", 291 | "tokio-util", 292 | "tracing", 293 | ] 294 | 295 | [[package]] 296 | name = "hashbrown" 297 | version = "0.12.3" 298 | source = "registry+https://github.com/rust-lang/crates.io-index" 299 | checksum = "8a9ee70c43aaf417c914396645a0fa852624801b24ebb7ae78fe8272889ac888" 300 | 301 | [[package]] 302 | name = "hermit-abi" 303 | version = "0.2.6" 304 | source = "registry+https://github.com/rust-lang/crates.io-index" 305 | checksum = "ee512640fe35acbfb4bb779db6f0d80704c2cacfa2e39b601ef3e3f47d1ae4c7" 306 | dependencies = [ 307 | "libc", 308 | ] 309 | 310 | [[package]] 311 | name = "hermit-abi" 312 | version = "0.3.1" 313 | source = "registry+https://github.com/rust-lang/crates.io-index" 314 | checksum = "fed44880c466736ef9a5c5b5facefb5ed0785676d0c02d612db14e54f0d84286" 315 | 316 | [[package]] 317 | name = "http" 318 | version = "0.2.9" 319 | source = "registry+https://github.com/rust-lang/crates.io-index" 320 | checksum = "bd6effc99afb63425aff9b05836f029929e345a6148a14b7ecd5ab67af944482" 321 | dependencies = [ 322 | "bytes", 323 | "fnv", 324 | "itoa", 325 | ] 326 | 327 | [[package]] 328 | name = "http-body" 329 | version = "0.4.5" 330 | source = "registry+https://github.com/rust-lang/crates.io-index" 331 | checksum = "d5f38f16d184e36f2408a55281cd658ecbd3ca05cce6d6510a176eca393e26d1" 332 | dependencies = [ 333 | "bytes", 334 | "http", 335 | "pin-project-lite", 336 | ] 337 | 338 | [[package]] 339 | name = "httparse" 340 | version = "1.8.0" 341 | source = "registry+https://github.com/rust-lang/crates.io-index" 342 | checksum = "d897f394bad6a705d5f4104762e116a75639e470d80901eed05a860a95cb1904" 343 | 344 | [[package]] 345 | name = "httpdate" 346 | version = "1.0.2" 347 | source = "registry+https://github.com/rust-lang/crates.io-index" 348 | checksum = "c4a1e36c821dbe04574f602848a19f742f4fb3c98d40449f11bcad18d6b17421" 349 | 350 | [[package]] 351 | name = "hyper" 352 | version = "0.14.25" 353 | source = "registry+https://github.com/rust-lang/crates.io-index" 354 | checksum = "cc5e554ff619822309ffd57d8734d77cd5ce6238bc956f037ea06c58238c9899" 355 | dependencies = [ 356 | "bytes", 357 | "futures-channel", 358 | "futures-core", 359 | "futures-util", 360 | "h2", 361 | "http", 362 | "http-body", 363 | "httparse", 364 | "httpdate", 365 | "itoa", 366 | "pin-project-lite", 367 | "socket2", 368 | "tokio", 369 | "tower-service", 370 | "tracing", 371 | "want", 372 | ] 373 | 374 | [[package]] 375 | name = "hyper-tls" 376 | version = "0.5.0" 377 | source = "registry+https://github.com/rust-lang/crates.io-index" 378 | checksum = "d6183ddfa99b85da61a140bea0efc93fdf56ceaa041b37d553518030827f9905" 379 | dependencies = [ 380 | "bytes", 381 | "hyper", 382 | "native-tls", 383 | "tokio", 384 | "tokio-native-tls", 385 | ] 386 | 387 | [[package]] 388 | name = "iana-time-zone" 389 | version = "0.1.54" 390 | source = "registry+https://github.com/rust-lang/crates.io-index" 391 | checksum = "0c17cc76786e99f8d2f055c11159e7f0091c42474dcc3189fbab96072e873e6d" 392 | dependencies = [ 393 | "android_system_properties", 394 | "core-foundation-sys", 395 | "iana-time-zone-haiku", 396 | "js-sys", 397 | "wasm-bindgen", 398 | "windows", 399 | ] 400 | 401 | [[package]] 402 | name = "iana-time-zone-haiku" 403 | version = "0.1.1" 404 | source = "registry+https://github.com/rust-lang/crates.io-index" 405 | checksum = "0703ae284fc167426161c2e3f1da3ea71d94b21bedbcc9494e92b28e334e3dca" 406 | dependencies = [ 407 | "cxx", 408 | "cxx-build", 409 | ] 410 | 411 | [[package]] 412 | name = "idna" 413 | version = "0.3.0" 414 | source = "registry+https://github.com/rust-lang/crates.io-index" 415 | checksum = "e14ddfc70884202db2244c223200c204c2bda1bc6e0998d11b5e024d657209e6" 416 | dependencies = [ 417 | "unicode-bidi", 418 | "unicode-normalization", 419 | ] 420 | 421 | [[package]] 422 | name = "indexmap" 423 | version = "1.9.3" 424 | source = "registry+https://github.com/rust-lang/crates.io-index" 425 | checksum = "bd070e393353796e801d209ad339e89596eb4c8d430d18ede6a1cced8fafbd99" 426 | dependencies = [ 427 | "autocfg", 428 | "hashbrown", 429 | ] 430 | 431 | [[package]] 432 | name = "instant" 433 | version = "0.1.12" 434 | source = "registry+https://github.com/rust-lang/crates.io-index" 435 | checksum = "7a5bbe824c507c5da5956355e86a746d82e0e1464f65d862cc5e71da70e94b2c" 436 | dependencies = [ 437 | "cfg-if", 438 | ] 439 | 440 | [[package]] 441 | name = "io-lifetimes" 442 | version = "1.0.9" 443 | source = "registry+https://github.com/rust-lang/crates.io-index" 444 | checksum = "09270fd4fa1111bc614ed2246c7ef56239a3063d5be0d1ec3b589c505d400aeb" 445 | dependencies = [ 446 | "hermit-abi 0.3.1", 447 | "libc", 448 | "windows-sys 0.45.0", 449 | ] 450 | 451 | [[package]] 452 | name = "ipnet" 453 | version = "2.7.1" 454 | source = "registry+https://github.com/rust-lang/crates.io-index" 455 | checksum = "30e22bd8629359895450b59ea7a776c850561b96a3b1d31321c1949d9e6c9146" 456 | 457 | [[package]] 458 | name = "itoa" 459 | version = "1.0.6" 460 | source = "registry+https://github.com/rust-lang/crates.io-index" 461 | checksum = "453ad9f582a441959e5f0d088b02ce04cfe8d51a8eaf077f12ac6d3e94164ca6" 462 | 463 | [[package]] 464 | name = "js-sys" 465 | version = "0.3.61" 466 | source = "registry+https://github.com/rust-lang/crates.io-index" 467 | checksum = "445dde2150c55e483f3d8416706b97ec8e8237c307e5b7b4b8dd15e6af2a0730" 468 | dependencies = [ 469 | "wasm-bindgen", 470 | ] 471 | 472 | [[package]] 473 | name = "lazy_static" 474 | version = "1.4.0" 475 | source = "registry+https://github.com/rust-lang/crates.io-index" 476 | checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" 477 | 478 | [[package]] 479 | name = "libc" 480 | version = "0.2.140" 481 | source = "registry+https://github.com/rust-lang/crates.io-index" 482 | checksum = "99227334921fae1a979cf0bfdfcc6b3e5ce376ef57e16fb6fb3ea2ed6095f80c" 483 | 484 | [[package]] 485 | name = "link-cplusplus" 486 | version = "1.0.8" 487 | source = "registry+https://github.com/rust-lang/crates.io-index" 488 | checksum = "ecd207c9c713c34f95a097a5b029ac2ce6010530c7b49d7fea24d977dede04f5" 489 | dependencies = [ 490 | "cc", 491 | ] 492 | 493 | [[package]] 494 | name = "linux-raw-sys" 495 | version = "0.1.4" 496 | source = "registry+https://github.com/rust-lang/crates.io-index" 497 | checksum = "f051f77a7c8e6957c0696eac88f26b0117e54f52d3fc682ab19397a8812846a4" 498 | 499 | [[package]] 500 | name = "log" 501 | version = "0.4.17" 502 | source = "registry+https://github.com/rust-lang/crates.io-index" 503 | checksum = "abb12e687cfb44aa40f41fc3978ef76448f9b6038cad6aef4259d3c095a2382e" 504 | dependencies = [ 505 | "cfg-if", 506 | ] 507 | 508 | [[package]] 509 | name = "memchr" 510 | version = "2.5.0" 511 | source = "registry+https://github.com/rust-lang/crates.io-index" 512 | checksum = "2dffe52ecf27772e601905b7522cb4ef790d2cc203488bbd0e2fe85fcb74566d" 513 | 514 | [[package]] 515 | name = "mime" 516 | version = "0.3.17" 517 | source = "registry+https://github.com/rust-lang/crates.io-index" 518 | checksum = "6877bb514081ee2a7ff5ef9de3281f14a4dd4bceac4c09388074a6b5df8a139a" 519 | 520 | [[package]] 521 | name = "mio" 522 | version = "0.8.6" 523 | source = "registry+https://github.com/rust-lang/crates.io-index" 524 | checksum = "5b9d9a46eff5b4ff64b45a9e316a6d1e0bc719ef429cbec4dc630684212bfdf9" 525 | dependencies = [ 526 | "libc", 527 | "log", 528 | "wasi 0.11.0+wasi-snapshot-preview1", 529 | "windows-sys 0.45.0", 530 | ] 531 | 532 | [[package]] 533 | name = "native-tls" 534 | version = "0.2.11" 535 | source = "registry+https://github.com/rust-lang/crates.io-index" 536 | checksum = "07226173c32f2926027b63cce4bcd8076c3552846cbe7925f3aaffeac0a3b92e" 537 | dependencies = [ 538 | "lazy_static", 539 | "libc", 540 | "log", 541 | "openssl", 542 | "openssl-probe", 543 | "openssl-sys", 544 | "schannel", 545 | "security-framework", 546 | "security-framework-sys", 547 | "tempfile", 548 | ] 549 | 550 | [[package]] 551 | name = "num-integer" 552 | version = "0.1.45" 553 | source = "registry+https://github.com/rust-lang/crates.io-index" 554 | checksum = "225d3389fb3509a24c93f5c29eb6bde2586b98d9f016636dff58d7c6f7569cd9" 555 | dependencies = [ 556 | "autocfg", 557 | "num-traits", 558 | ] 559 | 560 | [[package]] 561 | name = "num-traits" 562 | version = "0.2.15" 563 | source = "registry+https://github.com/rust-lang/crates.io-index" 564 | checksum = "578ede34cf02f8924ab9447f50c28075b4d3e5b269972345e7e0372b38c6cdcd" 565 | dependencies = [ 566 | "autocfg", 567 | ] 568 | 569 | [[package]] 570 | name = "num_cpus" 571 | version = "1.15.0" 572 | source = "registry+https://github.com/rust-lang/crates.io-index" 573 | checksum = "0fac9e2da13b5eb447a6ce3d392f23a29d8694bff781bf03a16cd9ac8697593b" 574 | dependencies = [ 575 | "hermit-abi 0.2.6", 576 | "libc", 577 | ] 578 | 579 | [[package]] 580 | name = "once_cell" 581 | version = "1.17.1" 582 | source = "registry+https://github.com/rust-lang/crates.io-index" 583 | checksum = "b7e5500299e16ebb147ae15a00a942af264cf3688f47923b8fc2cd5858f23ad3" 584 | 585 | [[package]] 586 | name = "openssl" 587 | version = "0.10.48" 588 | source = "registry+https://github.com/rust-lang/crates.io-index" 589 | checksum = "518915b97df115dd36109bfa429a48b8f737bd05508cf9588977b599648926d2" 590 | dependencies = [ 591 | "bitflags", 592 | "cfg-if", 593 | "foreign-types", 594 | "libc", 595 | "once_cell", 596 | "openssl-macros", 597 | "openssl-sys", 598 | ] 599 | 600 | [[package]] 601 | name = "openssl-macros" 602 | version = "0.1.0" 603 | source = "registry+https://github.com/rust-lang/crates.io-index" 604 | checksum = "b501e44f11665960c7e7fcf062c7d96a14ade4aa98116c004b2e37b5be7d736c" 605 | dependencies = [ 606 | "proc-macro2", 607 | "quote", 608 | "syn 1.0.109", 609 | ] 610 | 611 | [[package]] 612 | name = "openssl-probe" 613 | version = "0.1.5" 614 | source = "registry+https://github.com/rust-lang/crates.io-index" 615 | checksum = "ff011a302c396a5197692431fc1948019154afc178baf7d8e37367442a4601cf" 616 | 617 | [[package]] 618 | name = "openssl-sys" 619 | version = "0.9.83" 620 | source = "registry+https://github.com/rust-lang/crates.io-index" 621 | checksum = "666416d899cf077260dac8698d60a60b435a46d57e82acb1be3d0dad87284e5b" 622 | dependencies = [ 623 | "autocfg", 624 | "cc", 625 | "libc", 626 | "pkg-config", 627 | "vcpkg", 628 | ] 629 | 630 | [[package]] 631 | name = "percent-encoding" 632 | version = "2.2.0" 633 | source = "registry+https://github.com/rust-lang/crates.io-index" 634 | checksum = "478c572c3d73181ff3c2539045f6eb99e5491218eae919370993b890cdbdd98e" 635 | 636 | [[package]] 637 | name = "pin-project-lite" 638 | version = "0.2.9" 639 | source = "registry+https://github.com/rust-lang/crates.io-index" 640 | checksum = "e0a7ae3ac2f1173085d398531c705756c94a4c56843785df85a60c1a0afac116" 641 | 642 | [[package]] 643 | name = "pin-utils" 644 | version = "0.1.0" 645 | source = "registry+https://github.com/rust-lang/crates.io-index" 646 | checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184" 647 | 648 | [[package]] 649 | name = "pkg-config" 650 | version = "0.3.26" 651 | source = "registry+https://github.com/rust-lang/crates.io-index" 652 | checksum = "6ac9a59f73473f1b8d852421e59e64809f025994837ef743615c6d0c5b305160" 653 | 654 | [[package]] 655 | name = "proc-macro2" 656 | version = "1.0.53" 657 | source = "registry+https://github.com/rust-lang/crates.io-index" 658 | checksum = "ba466839c78239c09faf015484e5cc04860f88242cff4d03eb038f04b4699b73" 659 | dependencies = [ 660 | "unicode-ident", 661 | ] 662 | 663 | [[package]] 664 | name = "quote" 665 | version = "1.0.26" 666 | source = "registry+https://github.com/rust-lang/crates.io-index" 667 | checksum = "4424af4bf778aae2051a77b60283332f386554255d722233d09fbfc7e30da2fc" 668 | dependencies = [ 669 | "proc-macro2", 670 | ] 671 | 672 | [[package]] 673 | name = "redox_syscall" 674 | version = "0.2.16" 675 | source = "registry+https://github.com/rust-lang/crates.io-index" 676 | checksum = "fb5a58c1855b4b6819d59012155603f0b22ad30cad752600aadfcb695265519a" 677 | dependencies = [ 678 | "bitflags", 679 | ] 680 | 681 | [[package]] 682 | name = "reqwest" 683 | version = "0.11.15" 684 | source = "registry+https://github.com/rust-lang/crates.io-index" 685 | checksum = "0ba30cc2c0cd02af1222ed216ba659cdb2f879dfe3181852fe7c50b1d0005949" 686 | dependencies = [ 687 | "base64", 688 | "bytes", 689 | "encoding_rs", 690 | "futures-core", 691 | "futures-util", 692 | "h2", 693 | "http", 694 | "http-body", 695 | "hyper", 696 | "hyper-tls", 697 | "ipnet", 698 | "js-sys", 699 | "log", 700 | "mime", 701 | "native-tls", 702 | "once_cell", 703 | "percent-encoding", 704 | "pin-project-lite", 705 | "serde", 706 | "serde_json", 707 | "serde_urlencoded", 708 | "tokio", 709 | "tokio-native-tls", 710 | "tower-service", 711 | "url", 712 | "wasm-bindgen", 713 | "wasm-bindgen-futures", 714 | "web-sys", 715 | "winreg", 716 | ] 717 | 718 | [[package]] 719 | name = "rustix" 720 | version = "0.36.11" 721 | source = "registry+https://github.com/rust-lang/crates.io-index" 722 | checksum = "db4165c9963ab29e422d6c26fbc1d37f15bace6b2810221f9d925023480fcf0e" 723 | dependencies = [ 724 | "bitflags", 725 | "errno", 726 | "io-lifetimes", 727 | "libc", 728 | "linux-raw-sys", 729 | "windows-sys 0.45.0", 730 | ] 731 | 732 | [[package]] 733 | name = "ryu" 734 | version = "1.0.13" 735 | source = "registry+https://github.com/rust-lang/crates.io-index" 736 | checksum = "f91339c0467de62360649f8d3e185ca8de4224ff281f66000de5eb2a77a79041" 737 | 738 | [[package]] 739 | name = "schannel" 740 | version = "0.1.21" 741 | source = "registry+https://github.com/rust-lang/crates.io-index" 742 | checksum = "713cfb06c7059f3588fb8044c0fad1d09e3c01d225e25b9220dbfdcf16dbb1b3" 743 | dependencies = [ 744 | "windows-sys 0.42.0", 745 | ] 746 | 747 | [[package]] 748 | name = "scratch" 749 | version = "1.0.5" 750 | source = "registry+https://github.com/rust-lang/crates.io-index" 751 | checksum = "1792db035ce95be60c3f8853017b3999209281c24e2ba5bc8e59bf97a0c590c1" 752 | 753 | [[package]] 754 | name = "security-framework" 755 | version = "2.8.2" 756 | source = "registry+https://github.com/rust-lang/crates.io-index" 757 | checksum = "a332be01508d814fed64bf28f798a146d73792121129962fdf335bb3c49a4254" 758 | dependencies = [ 759 | "bitflags", 760 | "core-foundation", 761 | "core-foundation-sys", 762 | "libc", 763 | "security-framework-sys", 764 | ] 765 | 766 | [[package]] 767 | name = "security-framework-sys" 768 | version = "2.8.0" 769 | source = "registry+https://github.com/rust-lang/crates.io-index" 770 | checksum = "31c9bb296072e961fcbd8853511dd39c2d8be2deb1e17c6860b1d30732b323b4" 771 | dependencies = [ 772 | "core-foundation-sys", 773 | "libc", 774 | ] 775 | 776 | [[package]] 777 | name = "serde" 778 | version = "1.0.158" 779 | source = "registry+https://github.com/rust-lang/crates.io-index" 780 | checksum = "771d4d9c4163ee138805e12c710dd365e4f44be8be0503cb1bb9eb989425d9c9" 781 | dependencies = [ 782 | "serde_derive", 783 | ] 784 | 785 | [[package]] 786 | name = "serde_derive" 787 | version = "1.0.158" 788 | source = "registry+https://github.com/rust-lang/crates.io-index" 789 | checksum = "e801c1712f48475582b7696ac71e0ca34ebb30e09338425384269d9717c62cad" 790 | dependencies = [ 791 | "proc-macro2", 792 | "quote", 793 | "syn 2.0.10", 794 | ] 795 | 796 | [[package]] 797 | name = "serde_json" 798 | version = "1.0.94" 799 | source = "registry+https://github.com/rust-lang/crates.io-index" 800 | checksum = "1c533a59c9d8a93a09c6ab31f0fd5e5f4dd1b8fc9434804029839884765d04ea" 801 | dependencies = [ 802 | "itoa", 803 | "ryu", 804 | "serde", 805 | ] 806 | 807 | [[package]] 808 | name = "serde_urlencoded" 809 | version = "0.7.1" 810 | source = "registry+https://github.com/rust-lang/crates.io-index" 811 | checksum = "d3491c14715ca2294c4d6a88f15e84739788c1d030eed8c110436aafdaa2f3fd" 812 | dependencies = [ 813 | "form_urlencoded", 814 | "itoa", 815 | "ryu", 816 | "serde", 817 | ] 818 | 819 | [[package]] 820 | name = "slab" 821 | version = "0.4.8" 822 | source = "registry+https://github.com/rust-lang/crates.io-index" 823 | checksum = "6528351c9bc8ab22353f9d776db39a20288e8d6c37ef8cfe3317cf875eecfc2d" 824 | dependencies = [ 825 | "autocfg", 826 | ] 827 | 828 | [[package]] 829 | name = "socket2" 830 | version = "0.4.9" 831 | source = "registry+https://github.com/rust-lang/crates.io-index" 832 | checksum = "64a4a911eed85daf18834cfaa86a79b7d266ff93ff5ba14005426219480ed662" 833 | dependencies = [ 834 | "libc", 835 | "winapi", 836 | ] 837 | 838 | [[package]] 839 | name = "strip-ansi-escapes" 840 | version = "0.1.1" 841 | source = "registry+https://github.com/rust-lang/crates.io-index" 842 | checksum = "011cbb39cf7c1f62871aea3cc46e5817b0937b49e9447370c93cacbe93a766d8" 843 | dependencies = [ 844 | "vte", 845 | ] 846 | 847 | [[package]] 848 | name = "syn" 849 | version = "1.0.109" 850 | source = "registry+https://github.com/rust-lang/crates.io-index" 851 | checksum = "72b64191b275b66ffe2469e8af2c1cfe3bafa67b529ead792a6d0160888b4237" 852 | dependencies = [ 853 | "proc-macro2", 854 | "quote", 855 | "unicode-ident", 856 | ] 857 | 858 | [[package]] 859 | name = "syn" 860 | version = "2.0.10" 861 | source = "registry+https://github.com/rust-lang/crates.io-index" 862 | checksum = "5aad1363ed6d37b84299588d62d3a7d95b5a5c2d9aad5c85609fda12afaa1f40" 863 | dependencies = [ 864 | "proc-macro2", 865 | "quote", 866 | "unicode-ident", 867 | ] 868 | 869 | [[package]] 870 | name = "tempfile" 871 | version = "3.4.0" 872 | source = "registry+https://github.com/rust-lang/crates.io-index" 873 | checksum = "af18f7ae1acd354b992402e9ec5864359d693cd8a79dcbef59f76891701c1e95" 874 | dependencies = [ 875 | "cfg-if", 876 | "fastrand", 877 | "redox_syscall", 878 | "rustix", 879 | "windows-sys 0.42.0", 880 | ] 881 | 882 | [[package]] 883 | name = "termcolor" 884 | version = "1.2.0" 885 | source = "registry+https://github.com/rust-lang/crates.io-index" 886 | checksum = "be55cf8942feac5c765c2c993422806843c9a9a45d4d5c407ad6dd2ea95eb9b6" 887 | dependencies = [ 888 | "winapi-util", 889 | ] 890 | 891 | [[package]] 892 | name = "time" 893 | version = "0.1.45" 894 | source = "registry+https://github.com/rust-lang/crates.io-index" 895 | checksum = "1b797afad3f312d1c66a56d11d0316f916356d11bd158fbc6ca6389ff6bf805a" 896 | dependencies = [ 897 | "libc", 898 | "wasi 0.10.0+wasi-snapshot-preview1", 899 | "winapi", 900 | ] 901 | 902 | [[package]] 903 | name = "tinyvec" 904 | version = "1.6.0" 905 | source = "registry+https://github.com/rust-lang/crates.io-index" 906 | checksum = "87cc5ceb3875bb20c2890005a4e226a4651264a5c75edb2421b52861a0a0cb50" 907 | dependencies = [ 908 | "tinyvec_macros", 909 | ] 910 | 911 | [[package]] 912 | name = "tinyvec_macros" 913 | version = "0.1.1" 914 | source = "registry+https://github.com/rust-lang/crates.io-index" 915 | checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20" 916 | 917 | [[package]] 918 | name = "tokio" 919 | version = "1.26.0" 920 | source = "registry+https://github.com/rust-lang/crates.io-index" 921 | checksum = "03201d01c3c27a29c8a5cee5b55a93ddae1ccf6f08f65365c2c918f8c1b76f64" 922 | dependencies = [ 923 | "autocfg", 924 | "bytes", 925 | "libc", 926 | "memchr", 927 | "mio", 928 | "num_cpus", 929 | "pin-project-lite", 930 | "socket2", 931 | "windows-sys 0.45.0", 932 | ] 933 | 934 | [[package]] 935 | name = "tokio-native-tls" 936 | version = "0.3.1" 937 | source = "registry+https://github.com/rust-lang/crates.io-index" 938 | checksum = "bbae76ab933c85776efabc971569dd6119c580d8f5d448769dec1764bf796ef2" 939 | dependencies = [ 940 | "native-tls", 941 | "tokio", 942 | ] 943 | 944 | [[package]] 945 | name = "tokio-util" 946 | version = "0.7.7" 947 | source = "registry+https://github.com/rust-lang/crates.io-index" 948 | checksum = "5427d89453009325de0d8f342c9490009f76e999cb7672d77e46267448f7e6b2" 949 | dependencies = [ 950 | "bytes", 951 | "futures-core", 952 | "futures-sink", 953 | "pin-project-lite", 954 | "tokio", 955 | "tracing", 956 | ] 957 | 958 | [[package]] 959 | name = "tower-service" 960 | version = "0.3.2" 961 | source = "registry+https://github.com/rust-lang/crates.io-index" 962 | checksum = "b6bc1c9ce2b5135ac7f93c72918fc37feb872bdc6a5533a8b85eb4b86bfdae52" 963 | 964 | [[package]] 965 | name = "tracing" 966 | version = "0.1.37" 967 | source = "registry+https://github.com/rust-lang/crates.io-index" 968 | checksum = "8ce8c33a8d48bd45d624a6e523445fd21ec13d3653cd51f681abf67418f54eb8" 969 | dependencies = [ 970 | "cfg-if", 971 | "pin-project-lite", 972 | "tracing-core", 973 | ] 974 | 975 | [[package]] 976 | name = "tracing-core" 977 | version = "0.1.30" 978 | source = "registry+https://github.com/rust-lang/crates.io-index" 979 | checksum = "24eb03ba0eab1fd845050058ce5e616558e8f8d8fca633e6b163fe25c797213a" 980 | dependencies = [ 981 | "once_cell", 982 | ] 983 | 984 | [[package]] 985 | name = "try-lock" 986 | version = "0.2.4" 987 | source = "registry+https://github.com/rust-lang/crates.io-index" 988 | checksum = "3528ecfd12c466c6f163363caf2d02a71161dd5e1cc6ae7b34207ea2d42d81ed" 989 | 990 | [[package]] 991 | name = "unicode-bidi" 992 | version = "0.3.13" 993 | source = "registry+https://github.com/rust-lang/crates.io-index" 994 | checksum = "92888ba5573ff080736b3648696b70cafad7d250551175acbaa4e0385b3e1460" 995 | 996 | [[package]] 997 | name = "unicode-ident" 998 | version = "1.0.8" 999 | source = "registry+https://github.com/rust-lang/crates.io-index" 1000 | checksum = "e5464a87b239f13a63a501f2701565754bae92d243d4bb7eb12f6d57d2269bf4" 1001 | 1002 | [[package]] 1003 | name = "unicode-normalization" 1004 | version = "0.1.22" 1005 | source = "registry+https://github.com/rust-lang/crates.io-index" 1006 | checksum = "5c5713f0fc4b5db668a2ac63cdb7bb4469d8c9fed047b1d0292cc7b0ce2ba921" 1007 | dependencies = [ 1008 | "tinyvec", 1009 | ] 1010 | 1011 | [[package]] 1012 | name = "unicode-segmentation" 1013 | version = "1.10.1" 1014 | source = "registry+https://github.com/rust-lang/crates.io-index" 1015 | checksum = "1dd624098567895118886609431a7c3b8f516e41d30e0643f03d94592a147e36" 1016 | 1017 | [[package]] 1018 | name = "unicode-width" 1019 | version = "0.1.10" 1020 | source = "registry+https://github.com/rust-lang/crates.io-index" 1021 | checksum = "c0edd1e5b14653f783770bce4a4dabb4a5108a5370a5f5d8cfe8710c361f6c8b" 1022 | 1023 | [[package]] 1024 | name = "url" 1025 | version = "2.3.1" 1026 | source = "registry+https://github.com/rust-lang/crates.io-index" 1027 | checksum = "0d68c799ae75762b8c3fe375feb6600ef5602c883c5d21eb51c09f22b83c4643" 1028 | dependencies = [ 1029 | "form_urlencoded", 1030 | "idna", 1031 | "percent-encoding", 1032 | ] 1033 | 1034 | [[package]] 1035 | name = "utf8parse" 1036 | version = "0.2.1" 1037 | source = "registry+https://github.com/rust-lang/crates.io-index" 1038 | checksum = "711b9620af191e0cdc7468a8d14e709c3dcdb115b36f838e601583af800a370a" 1039 | 1040 | [[package]] 1041 | name = "vcpkg" 1042 | version = "0.2.15" 1043 | source = "registry+https://github.com/rust-lang/crates.io-index" 1044 | checksum = "accd4ea62f7bb7a82fe23066fb0957d48ef677f6eeb8215f372f52e48bb32426" 1045 | 1046 | [[package]] 1047 | name = "vte" 1048 | version = "0.10.1" 1049 | source = "registry+https://github.com/rust-lang/crates.io-index" 1050 | checksum = "6cbce692ab4ca2f1f3047fcf732430249c0e971bfdd2b234cf2c47ad93af5983" 1051 | dependencies = [ 1052 | "arrayvec", 1053 | "utf8parse", 1054 | "vte_generate_state_changes", 1055 | ] 1056 | 1057 | [[package]] 1058 | name = "vte_generate_state_changes" 1059 | version = "0.1.1" 1060 | source = "registry+https://github.com/rust-lang/crates.io-index" 1061 | checksum = "d257817081c7dffcdbab24b9e62d2def62e2ff7d00b1c20062551e6cccc145ff" 1062 | dependencies = [ 1063 | "proc-macro2", 1064 | "quote", 1065 | ] 1066 | 1067 | [[package]] 1068 | name = "want" 1069 | version = "0.3.0" 1070 | source = "registry+https://github.com/rust-lang/crates.io-index" 1071 | checksum = "1ce8a968cb1cd110d136ff8b819a556d6fb6d919363c61534f6860c7eb172ba0" 1072 | dependencies = [ 1073 | "log", 1074 | "try-lock", 1075 | ] 1076 | 1077 | [[package]] 1078 | name = "wasi" 1079 | version = "0.10.0+wasi-snapshot-preview1" 1080 | source = "registry+https://github.com/rust-lang/crates.io-index" 1081 | checksum = "1a143597ca7c7793eff794def352d41792a93c481eb1042423ff7ff72ba2c31f" 1082 | 1083 | [[package]] 1084 | name = "wasi" 1085 | version = "0.11.0+wasi-snapshot-preview1" 1086 | source = "registry+https://github.com/rust-lang/crates.io-index" 1087 | checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" 1088 | 1089 | [[package]] 1090 | name = "wasm-bindgen" 1091 | version = "0.2.84" 1092 | source = "registry+https://github.com/rust-lang/crates.io-index" 1093 | checksum = "31f8dcbc21f30d9b8f2ea926ecb58f6b91192c17e9d33594b3df58b2007ca53b" 1094 | dependencies = [ 1095 | "cfg-if", 1096 | "wasm-bindgen-macro", 1097 | ] 1098 | 1099 | [[package]] 1100 | name = "wasm-bindgen-backend" 1101 | version = "0.2.84" 1102 | source = "registry+https://github.com/rust-lang/crates.io-index" 1103 | checksum = "95ce90fd5bcc06af55a641a86428ee4229e44e07033963a2290a8e241607ccb9" 1104 | dependencies = [ 1105 | "bumpalo", 1106 | "log", 1107 | "once_cell", 1108 | "proc-macro2", 1109 | "quote", 1110 | "syn 1.0.109", 1111 | "wasm-bindgen-shared", 1112 | ] 1113 | 1114 | [[package]] 1115 | name = "wasm-bindgen-futures" 1116 | version = "0.4.34" 1117 | source = "registry+https://github.com/rust-lang/crates.io-index" 1118 | checksum = "f219e0d211ba40266969f6dbdd90636da12f75bee4fc9d6c23d1260dadb51454" 1119 | dependencies = [ 1120 | "cfg-if", 1121 | "js-sys", 1122 | "wasm-bindgen", 1123 | "web-sys", 1124 | ] 1125 | 1126 | [[package]] 1127 | name = "wasm-bindgen-macro" 1128 | version = "0.2.84" 1129 | source = "registry+https://github.com/rust-lang/crates.io-index" 1130 | checksum = "4c21f77c0bedc37fd5dc21f897894a5ca01e7bb159884559461862ae90c0b4c5" 1131 | dependencies = [ 1132 | "quote", 1133 | "wasm-bindgen-macro-support", 1134 | ] 1135 | 1136 | [[package]] 1137 | name = "wasm-bindgen-macro-support" 1138 | version = "0.2.84" 1139 | source = "registry+https://github.com/rust-lang/crates.io-index" 1140 | checksum = "2aff81306fcac3c7515ad4e177f521b5c9a15f2b08f4e32d823066102f35a5f6" 1141 | dependencies = [ 1142 | "proc-macro2", 1143 | "quote", 1144 | "syn 1.0.109", 1145 | "wasm-bindgen-backend", 1146 | "wasm-bindgen-shared", 1147 | ] 1148 | 1149 | [[package]] 1150 | name = "wasm-bindgen-shared" 1151 | version = "0.2.84" 1152 | source = "registry+https://github.com/rust-lang/crates.io-index" 1153 | checksum = "0046fef7e28c3804e5e38bfa31ea2a0f73905319b677e57ebe37e49358989b5d" 1154 | 1155 | [[package]] 1156 | name = "web-sys" 1157 | version = "0.3.61" 1158 | source = "registry+https://github.com/rust-lang/crates.io-index" 1159 | checksum = "e33b99f4b23ba3eec1a53ac264e35a755f00e966e0065077d6027c0f575b0b97" 1160 | dependencies = [ 1161 | "js-sys", 1162 | "wasm-bindgen", 1163 | ] 1164 | 1165 | [[package]] 1166 | name = "winapi" 1167 | version = "0.3.9" 1168 | source = "registry+https://github.com/rust-lang/crates.io-index" 1169 | checksum = "5c839a674fcd7a98952e593242ea400abe93992746761e38641405d28b00f419" 1170 | dependencies = [ 1171 | "winapi-i686-pc-windows-gnu", 1172 | "winapi-x86_64-pc-windows-gnu", 1173 | ] 1174 | 1175 | [[package]] 1176 | name = "winapi-i686-pc-windows-gnu" 1177 | version = "0.4.0" 1178 | source = "registry+https://github.com/rust-lang/crates.io-index" 1179 | checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" 1180 | 1181 | [[package]] 1182 | name = "winapi-util" 1183 | version = "0.1.5" 1184 | source = "registry+https://github.com/rust-lang/crates.io-index" 1185 | checksum = "70ec6ce85bb158151cae5e5c87f95a8e97d2c0c4b001223f33a334e3ce5de178" 1186 | dependencies = [ 1187 | "winapi", 1188 | ] 1189 | 1190 | [[package]] 1191 | name = "winapi-x86_64-pc-windows-gnu" 1192 | version = "0.4.0" 1193 | source = "registry+https://github.com/rust-lang/crates.io-index" 1194 | checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" 1195 | 1196 | [[package]] 1197 | name = "windows" 1198 | version = "0.46.0" 1199 | source = "registry+https://github.com/rust-lang/crates.io-index" 1200 | checksum = "cdacb41e6a96a052c6cb63a144f24900236121c6f63f4f8219fef5977ecb0c25" 1201 | dependencies = [ 1202 | "windows-targets", 1203 | ] 1204 | 1205 | [[package]] 1206 | name = "windows-sys" 1207 | version = "0.42.0" 1208 | source = "registry+https://github.com/rust-lang/crates.io-index" 1209 | checksum = "5a3e1820f08b8513f676f7ab6c1f99ff312fb97b553d30ff4dd86f9f15728aa7" 1210 | dependencies = [ 1211 | "windows_aarch64_gnullvm", 1212 | "windows_aarch64_msvc", 1213 | "windows_i686_gnu", 1214 | "windows_i686_msvc", 1215 | "windows_x86_64_gnu", 1216 | "windows_x86_64_gnullvm", 1217 | "windows_x86_64_msvc", 1218 | ] 1219 | 1220 | [[package]] 1221 | name = "windows-sys" 1222 | version = "0.45.0" 1223 | source = "registry+https://github.com/rust-lang/crates.io-index" 1224 | checksum = "75283be5efb2831d37ea142365f009c02ec203cd29a3ebecbc093d52315b66d0" 1225 | dependencies = [ 1226 | "windows-targets", 1227 | ] 1228 | 1229 | [[package]] 1230 | name = "windows-targets" 1231 | version = "0.42.2" 1232 | source = "registry+https://github.com/rust-lang/crates.io-index" 1233 | checksum = "8e5180c00cd44c9b1c88adb3693291f1cd93605ded80c250a75d472756b4d071" 1234 | dependencies = [ 1235 | "windows_aarch64_gnullvm", 1236 | "windows_aarch64_msvc", 1237 | "windows_i686_gnu", 1238 | "windows_i686_msvc", 1239 | "windows_x86_64_gnu", 1240 | "windows_x86_64_gnullvm", 1241 | "windows_x86_64_msvc", 1242 | ] 1243 | 1244 | [[package]] 1245 | name = "windows_aarch64_gnullvm" 1246 | version = "0.42.2" 1247 | source = "registry+https://github.com/rust-lang/crates.io-index" 1248 | checksum = "597a5118570b68bc08d8d59125332c54f1ba9d9adeedeef5b99b02ba2b0698f8" 1249 | 1250 | [[package]] 1251 | name = "windows_aarch64_msvc" 1252 | version = "0.42.2" 1253 | source = "registry+https://github.com/rust-lang/crates.io-index" 1254 | checksum = "e08e8864a60f06ef0d0ff4ba04124db8b0fb3be5776a5cd47641e942e58c4d43" 1255 | 1256 | [[package]] 1257 | name = "windows_i686_gnu" 1258 | version = "0.42.2" 1259 | source = "registry+https://github.com/rust-lang/crates.io-index" 1260 | checksum = "c61d927d8da41da96a81f029489353e68739737d3beca43145c8afec9a31a84f" 1261 | 1262 | [[package]] 1263 | name = "windows_i686_msvc" 1264 | version = "0.42.2" 1265 | source = "registry+https://github.com/rust-lang/crates.io-index" 1266 | checksum = "44d840b6ec649f480a41c8d80f9c65108b92d89345dd94027bfe06ac444d1060" 1267 | 1268 | [[package]] 1269 | name = "windows_x86_64_gnu" 1270 | version = "0.42.2" 1271 | source = "registry+https://github.com/rust-lang/crates.io-index" 1272 | checksum = "8de912b8b8feb55c064867cf047dda097f92d51efad5b491dfb98f6bbb70cb36" 1273 | 1274 | [[package]] 1275 | name = "windows_x86_64_gnullvm" 1276 | version = "0.42.2" 1277 | source = "registry+https://github.com/rust-lang/crates.io-index" 1278 | checksum = "26d41b46a36d453748aedef1486d5c7a85db22e56aff34643984ea85514e94a3" 1279 | 1280 | [[package]] 1281 | name = "windows_x86_64_msvc" 1282 | version = "0.42.2" 1283 | source = "registry+https://github.com/rust-lang/crates.io-index" 1284 | checksum = "9aec5da331524158c6d1a4ac0ab1541149c0b9505fde06423b02f5ef0106b9f0" 1285 | 1286 | [[package]] 1287 | name = "winreg" 1288 | version = "0.10.1" 1289 | source = "registry+https://github.com/rust-lang/crates.io-index" 1290 | checksum = "80d0f4e272c85def139476380b12f9ac60926689dd2e01d4923222f40580869d" 1291 | dependencies = [ 1292 | "winapi", 1293 | ] 1294 | -------------------------------------------------------------------------------- /ctfwatch/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "ctf_watch" 3 | version = "0.1.0" 4 | authors = ["Luca Di Bartolomeo "] 5 | edition = "2018" 6 | 7 | [[bin]] 8 | name = "ctf_watch" 9 | doc = false 10 | 11 | [dependencies] 12 | chrono = { version = "0.4", features = ["serde"] } 13 | reqwest = { version = "0.11", features = [ "blocking" , "json"] } 14 | serde = { version = "1.0", features = [ "derive" ] } 15 | unicode-segmentation = { version = "1.7.1" } 16 | strip-ansi-escapes = "0.1" 17 | 18 | [profile.release] 19 | lto = true 20 | panic = "abort" 21 | -------------------------------------------------------------------------------- /ctfwatch/out: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cyanpencil/ctfwatch/c69eaf6abd0e0e4846914b524399d33d1da3b7b5/ctfwatch/out -------------------------------------------------------------------------------- /ctfwatch/rustfmt.toml: -------------------------------------------------------------------------------- 1 | reorder_imported_names = true 2 | reorder_imports = true 3 | reorder_imports_in_group = true 4 | reorder_extern_crates = true 5 | reorder_extern_crates_in_group = true 6 | -------------------------------------------------------------------------------- /ctfwatch/src/main.rs: -------------------------------------------------------------------------------- 1 | //use chrono::Utc; 2 | use chrono::{FixedOffset, Duration, DateTime}; 3 | //use ctftimebot::{CtfEvent, CONFIG}; 4 | //use log::{error, info}; 5 | //use slack_hook::{PayloadBuilder, Slack}; 6 | use serde::Deserialize; 7 | use std::fs::File; 8 | use std::io::prelude::*; 9 | use unicode_segmentation::UnicodeSegmentation; 10 | 11 | #[derive(Clone, Debug, Deserialize, Eq, PartialEq)] 12 | pub struct CtfTeam { 13 | id: usize, 14 | name: String 15 | } 16 | 17 | #[derive(Debug, Deserialize)] 18 | pub struct CtfEvent { 19 | title: String, 20 | ctftime_url: String, 21 | id: usize, 22 | start: DateTime, 23 | finish: DateTime, 24 | logo: Option, 25 | url: Option, 26 | format: String, 27 | public_votable: bool, 28 | weight: f32, 29 | live_feed: Option, 30 | restrictions: String, 31 | location: Option, 32 | onsite: bool, 33 | organizers: Vec, 34 | ctf_id: usize, 35 | participants: usize, 36 | } 37 | 38 | fn format_duration(d: &Duration) -> String { 39 | let mut d = *d; 40 | let mut tmp = Vec::with_capacity(4); 41 | if d.num_hours() > 48 { 42 | tmp.push(format!("{} days", d.num_days())); 43 | d = d + Duration::days(-d.num_days()); 44 | } 45 | if d.num_hours() > 0 { 46 | tmp.push(format!("{} hours", d.num_hours())); 47 | d = d + Duration::hours(-d.num_hours()); 48 | } 49 | if d.num_minutes() > 0 { 50 | tmp.push(format!("{} minutes", d.num_minutes())); 51 | d = d + Duration::minutes(-d.num_minutes()); 52 | } 53 | if d.num_seconds() > 0 { 54 | tmp.push(format!("{} seconds", d.num_seconds())); 55 | } 56 | tmp.join(" ") 57 | } 58 | 59 | fn strip_ansi(s: &String) -> String { 60 | String::from_utf8(strip_ansi_escapes::strip(s).unwrap()).unwrap() 61 | } 62 | 63 | fn extra_bytes (s1: &String) -> usize { 64 | s1.graphemes(true).count() - strip_ansi(&s1).graphemes(true).count() 65 | } 66 | 67 | fn double_line (s1: &String, s2: &String) -> String { 68 | let mut fin = format!("│ {}", s1); 69 | let fin_len = strip_ansi(&fin).chars().count(); 70 | let fin_len2 = strip_ansi(&s2).chars().count(); 71 | if fin_len > LEN { 72 | return fin; 73 | } 74 | fin.push_str(&format!(" {: >1$} │", format!(" {}", s2), LEN - 1 - fin_len + (s2.chars().count() - fin_len2))); 75 | fin 76 | } 77 | 78 | fn blue>(s: S) -> String { 79 | format!("{}{}{}", "\x1b[38;2;174;129;255m", s.as_ref(), "\x1b[0m") 80 | } 81 | 82 | fn bold(s: impl std::fmt::Display) -> String { 83 | format!("{}{}{}", "\x1b[1m", format!("{}", s), "\x1b[0m") 84 | } 85 | 86 | fn pink(s: impl std::fmt::Display) -> String { 87 | format!("{}{}{}", "\x1b[38;2;249;38;114;1m", format!("{}", s), "\x1b[0m") 88 | } 89 | 90 | fn gray(s: impl std::fmt::Display) -> String { 91 | format!("{}{}{}", "\x1b[38;2;102;217;239m", format!("{}", s), "\x1b[0m") 92 | } 93 | 94 | fn green(s: impl std::fmt::Display) -> String { 95 | format!("{}{}{}", "\x1b[38;2;166;226;46m", format!("{}", s), "\x1b[0m") 96 | } 97 | 98 | static LEN: usize = 60; 99 | fn justdoit() -> Result<(), Box> { 100 | let client = reqwest::blocking::Client::builder() 101 | .user_agent("Mozilla Firefox") 102 | .build()?; 103 | //let v: Vec = client.get("http://google.com").send()?.json()?; 104 | //let v: Vec = client.get("https://ctftime.org").send()?.text()?; 105 | //let v: Vec = client.get("https://ctftime.org").send()?.json()?; 106 | let v: Vec = client.get("http://ctftime.org/api/v1/events/?limit=10").send()?.json()?; 107 | 108 | for event in v { 109 | let mut text : Vec = vec![]; 110 | //let title = format!(" {} ", pink(event.title)).chars().map(|c| if c.is_ascii() {c} else {'?'}).collect(); 111 | let title = format!(" {} ", pink(event.title)); 112 | text.push(format!("┌{:─^1$}┐", title, LEN + extra_bytes(&title))); 113 | 114 | let mut duration = format_duration(&event.finish.signed_duration_since(event.start)); 115 | duration.truncate(8); 116 | text.push(double_line(&format!("{}: {}", blue("Date"), bold(event.start)), 117 | &format!("{}: {}", blue("Duration"), bold(duration)))); 118 | 119 | text.push(double_line(&format!("{}: {}", blue("Organizers"), green(&event.organizers[0].name)), 120 | &format!("{}: {}", blue("Category"), bold(event.format)))); 121 | 122 | text.push(double_line(&format!("{}: {}", blue("Restrictions"), bold(event.restrictions)), 123 | &format!("{}: {}", blue("Weight"), bold(event.weight)))); 124 | 125 | text.push(double_line(&format!("{}: {}", blue("Onsite"), bold(event.onsite)), 126 | &format!("{}: {}", blue("Participants"), bold(event.participants)))); 127 | 128 | text.push(double_line(&format!("{}: {}", blue("ctftime url"), gray(event.ctftime_url)), 129 | &format!(""))); 130 | 131 | text.push(double_line(&format!("{}: {}", blue("website"), gray(event.url.unwrap_or(String::from("None")))), 132 | &format!(""))); 133 | 134 | text.push(format!("└{:─^1$}┘", "", LEN)); 135 | 136 | let mut downloaded = false; 137 | let img : Vec; 138 | 139 | if let Some(url) = event.logo { 140 | if url.len() > 5 { 141 | let mut buf: Vec = Vec::new(); 142 | reqwest::blocking::get(&url)?.copy_to(&mut buf)?; 143 | 144 | let mut file = File::create("/tmp/catastrophic_failure")?; 145 | file.write_all(&buf)?; 146 | 147 | downloaded = true; 148 | } 149 | } 150 | 151 | 152 | 153 | if downloaded { 154 | img = std::process::Command::new("chafa").arg("/tmp/catastrophic_failure") 155 | .arg("--size").arg(&format!("40x{}", text.len())) 156 | .output().expect("Failed running chafa").stdout; 157 | } 158 | else { 159 | img = vec![b'\n'; text.len()]; 160 | } 161 | 162 | for (i, s) in img.split(|c| *c == b'\n').enumerate() { 163 | if i < text.len() {print!("{} ", text[i]);} 164 | if downloaded { 165 | std::io::stdout().write_all(&s)?; 166 | } 167 | println!(); 168 | } 169 | } 170 | 171 | Ok(()) 172 | } 173 | 174 | fn main() -> Result<(), Box> { 175 | println!("# author: cyanpencil source: github.com/cyanpencil/ctfwatch"); 176 | println!("# data pulled from ctftime.org"); 177 | println!(); 178 | justdoit() 179 | } 180 | -------------------------------------------------------------------------------- /entrypoint.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | cd ctfwatch 4 | 5 | touch out 6 | ( while true; do cargo run > out; sleep 300; done ) & 7 | 8 | sleep 5 9 | 10 | socat tcp-l:80,reuseaddr,fork system:"echo HTTP/1.0 200; echo Content-Type\: text/plain; echo; cat out" 11 | -------------------------------------------------------------------------------- /out: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cyanpencil/ctfwatch/c69eaf6abd0e0e4846914b524399d33d1da3b7b5/out -------------------------------------------------------------------------------- /run.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | #if [[ -x "$(command -v podman)" ]]; then 4 | #ENGINE="podman" 5 | #else 6 | ENGINE="docker" 7 | #fi 8 | 9 | $ENGINE run --rm -d -v $(pwd)/ctfwatch:/ctfwatch -p 8081:80 --name ctfwatch ctfwatch 10 | -------------------------------------------------------------------------------- /screenshot.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cyanpencil/ctfwatch/c69eaf6abd0e0e4846914b524399d33d1da3b7b5/screenshot.png --------------------------------------------------------------------------------