Basic image and tag listing, stylesheet

This commit is contained in:
Gabriel Simmer 2022-12-11 17:52:51 +00:00
parent 55e91e6be9
commit 97bb5283d1
Signed by: arch
GPG key ID: C81B106D46C5B875
4 changed files with 253 additions and 328 deletions

519
Cargo.lock generated
View file

@ -64,24 +64,24 @@ dependencies = [
"async-trait",
"axum-core",
"bitflags",
"bytes 1.3.0",
"bytes",
"futures-util",
"http",
"http-body 0.4.5",
"hyper 0.14.23",
"itoa 1.0.4",
"http-body",
"hyper",
"itoa",
"matchit",
"memchr",
"mime",
"percent-encoding",
"pin-project-lite 0.2.9",
"pin-project-lite",
"rustversion",
"serde",
"serde_json",
"serde_path_to_error",
"serde_urlencoded",
"sync_wrapper",
"tokio 1.23.0",
"tokio",
"tower",
"tower-http",
"tower-layer",
@ -95,10 +95,10 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "79b8558f5a0581152dc94dcd289132a1d377494bdeafcd41869b3258e3e2ad92"
dependencies = [
"async-trait",
"bytes 1.3.0",
"bytes",
"futures-util",
"http",
"http-body 0.4.5",
"http-body",
"mime",
"rustversion",
"tower-layer",
@ -106,10 +106,23 @@ dependencies = [
]
[[package]]
name = "base64"
version = "0.12.3"
name = "axum-extra"
version = "0.4.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "3441f0f7b02788e948e47f457ca01f1d7e6d92c693bc132c22b087d3141c03ff"
checksum = "f9a320103719de37b7b4da4c8eb629d4573f6bcfd3dfe80d3208806895ccf81d"
dependencies = [
"axum",
"bytes",
"futures-util",
"http",
"mime",
"pin-project-lite",
"tokio",
"tower",
"tower-http",
"tower-layer",
"tower-service",
]
[[package]]
name = "base64"
@ -125,9 +138,9 @@ checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a"
[[package]]
name = "block-buffer"
version = "0.9.0"
version = "0.10.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "4152116fd6e9dadb291ae18fc1ec3575ed6d84c29642d97890f4b4a3417297e4"
checksum = "69cce20737498f97b993470a6e536b8523f0af7892a4f928cceb1ac5e52ebe7e"
dependencies = [
"generic-array",
]
@ -138,12 +151,6 @@ version = "3.11.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "572f695136211188308f16ad2ca5c851a712c464060ae6974944458eb83880ba"
[[package]]
name = "bytes"
version = "0.5.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "0e4cec68f03f32e44924783795810fa50a7035d8c8ebe78580ad7e6c703fba38"
[[package]]
name = "bytes"
version = "1.3.0"
@ -156,12 +163,6 @@ version = "1.0.77"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "e9f73505338f7d905b19d18738976aae232eb46b8efc15554ffc56deb5d9ebe4"
[[package]]
name = "cfg-if"
version = "0.1.10"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "4785bdd1c96b2a846b2bd7cc02e86b6b3dbf14e7e53446c4f54c92a361040822"
[[package]]
name = "cfg-if"
version = "1.0.0"
@ -183,31 +184,43 @@ version = "1.3.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b540bd8bc810d3885c6ea91e2018302f68baba2129ab3e88f32389ee9370880d"
dependencies = [
"cfg-if 1.0.0",
"cfg-if",
]
[[package]]
name = "crypto-common"
version = "0.1.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "1bfb12502f3fc46cca1bb51ac28df9d618d813cdc3d2f25b9fe775a34af26bb3"
dependencies = [
"generic-array",
"typenum",
]
[[package]]
name = "digest"
version = "0.9.0"
version = "0.10.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d3dd60d1080a57a05ab032377049e0591415d2b31afd7028356dbf3cc6dcb066"
checksum = "8168378f4e5023e7218c89c891c0fd8ecdb5e5e4f18cb78f38cf245dd021e76f"
dependencies = [
"generic-array",
"block-buffer",
"crypto-common",
]
[[package]]
name = "dkregistry"
version = "0.5.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "99a52c462b3ec89985ed6e1be6bd0cf0041640e6f43f315f153e5abfbc0063b4"
version = "0.5.1-alpha.0"
source = "git+https://github.com/camallo/dkregistry-rs#37acecb4b8139dd1b1cc83795442f94f90e1ffc5"
dependencies = [
"async-stream",
"base64 0.13.1",
"base64",
"bytes",
"futures",
"http",
"libflate",
"log",
"mime",
"pin-project",
"regex",
"reqwest",
"serde",
@ -218,7 +231,7 @@ dependencies = [
"strum_macros",
"tar",
"thiserror",
"tokio 0.2.25",
"tokio",
"url",
]
@ -227,10 +240,11 @@ name = "docker-rs-dashboard"
version = "0.1.0"
dependencies = [
"axum",
"axum-extra",
"dkregistry",
"futures",
"maud",
"tokio 1.23.0",
"tokio",
]
[[package]]
@ -239,7 +253,7 @@ version = "0.8.31"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "9852635589dc9f9ea1b6fe9f05b50ef208c85c834a562f0c6abb1c475736ec2b"
dependencies = [
"cfg-if 1.0.0",
"cfg-if",
]
[[package]]
@ -248,7 +262,7 @@ version = "0.2.19"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "4e884668cd0c7480504233e951174ddc3b382f7c2666e3b7310b5c4e7b0c37f9"
dependencies = [
"cfg-if 1.0.0",
"cfg-if",
"libc",
"redox_syscall",
"windows-sys",
@ -269,22 +283,6 @@ dependencies = [
"percent-encoding",
]
[[package]]
name = "fuchsia-zircon"
version = "0.3.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "2e9763c69ebaae630ba35f74888db465e49e259ba1bc0eda7d06f4a067615d82"
dependencies = [
"bitflags",
"fuchsia-zircon-sys",
]
[[package]]
name = "fuchsia-zircon-sys"
version = "0.3.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "3dcaa9ae7725d12cdb85b3ad99a434db70b468c09ded17e012d86b5c1010f7a7"
[[package]]
name = "futures"
version = "0.3.25"
@ -369,7 +367,7 @@ dependencies = [
"futures-sink",
"futures-task",
"memchr",
"pin-project-lite 0.2.9",
"pin-project-lite",
"pin-utils",
"slab",
]
@ -386,11 +384,11 @@ dependencies = [
[[package]]
name = "h2"
version = "0.2.7"
version = "0.3.15"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "5e4728fd124914ad25e99e3d15a9361a879f6620f63cb56bbb08f95abb97a535"
checksum = "5f9f29bc9dda355256b2916cf526ab02ce0aeaaaf2bad60d65ef3f12f11dd0f4"
dependencies = [
"bytes 0.5.6",
"bytes",
"fnv",
"futures-core",
"futures-sink",
@ -398,10 +396,9 @@ dependencies = [
"http",
"indexmap",
"slab",
"tokio 0.2.25",
"tokio",
"tokio-util",
"tracing",
"tracing-futures",
]
[[package]]
@ -434,19 +431,9 @@ version = "0.2.8"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "75f43d41e26995c17e71ee126451dd3941010b0514a81a9d11f3b341debc2399"
dependencies = [
"bytes 1.3.0",
"bytes",
"fnv",
"itoa 1.0.4",
]
[[package]]
name = "http-body"
version = "0.3.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "13d5ff830006f7646652e057693569bfe0d51760c0085a071769d142a205111b"
dependencies = [
"bytes 0.5.6",
"http",
"itoa",
]
[[package]]
@ -455,9 +442,9 @@ version = "0.4.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d5f38f16d184e36f2408a55281cd658ecbd3ca05cce6d6510a176eca393e26d1"
dependencies = [
"bytes 1.3.0",
"bytes",
"http",
"pin-project-lite 0.2.9",
"pin-project-lite",
]
[[package]]
@ -472,60 +459,31 @@ version = "1.8.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d897f394bad6a705d5f4104762e116a75639e470d80901eed05a860a95cb1904"
[[package]]
name = "httpdate"
version = "0.3.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "494b4d60369511e7dea41cf646832512a94e542f68bb9c49e54518e0f468eb47"
[[package]]
name = "httpdate"
version = "1.0.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "c4a1e36c821dbe04574f602848a19f742f4fb3c98d40449f11bcad18d6b17421"
[[package]]
name = "hyper"
version = "0.13.10"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "8a6f157065790a3ed2f88679250419b5cdd96e714a0d65f7797fd337186e96bb"
dependencies = [
"bytes 0.5.6",
"futures-channel",
"futures-core",
"futures-util",
"h2",
"http",
"http-body 0.3.1",
"httparse",
"httpdate 0.3.2",
"itoa 0.4.8",
"pin-project",
"socket2 0.3.19",
"tokio 0.2.25",
"tower-service",
"tracing",
"want",
]
[[package]]
name = "hyper"
version = "0.14.23"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "034711faac9d2166cb1baf1a2fb0b60b1f277f8492fd72176c17f3515e1abd3c"
dependencies = [
"bytes 1.3.0",
"bytes",
"futures-channel",
"futures-core",
"futures-util",
"h2",
"http",
"http-body 0.4.5",
"http-body",
"httparse",
"httpdate 1.0.2",
"itoa 1.0.4",
"pin-project-lite 0.2.9",
"socket2 0.4.7",
"tokio 1.23.0",
"httpdate",
"itoa",
"pin-project-lite",
"socket2",
"tokio",
"tower-service",
"tracing",
"want",
@ -533,18 +491,15 @@ dependencies = [
[[package]]
name = "hyper-rustls"
version = "0.21.0"
version = "0.23.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "37743cc83e8ee85eacfce90f2f4102030d9ff0a95244098d781e9bee4a90abb6"
checksum = "1788965e61b367cd03a62950836d5cd41560c3577d90e40e0819373194d1661c"
dependencies = [
"bytes 0.5.6",
"futures-util",
"hyper 0.13.10",
"log",
"http",
"hyper",
"rustls",
"tokio 0.2.25",
"tokio",
"tokio-rustls",
"webpki",
]
[[package]]
@ -567,27 +522,12 @@ dependencies = [
"hashbrown",
]
[[package]]
name = "iovec"
version = "0.1.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b2b3ea6ff95e175473f8ffe6a7eb7c00d054240321b84c57051175fe3c1e075e"
dependencies = [
"libc",
]
[[package]]
name = "ipnet"
version = "2.6.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "ec947b7a4ce12e3b87e353abae7ce124d025b6c7d6c5aea5cc0bcf92e9510ded"
[[package]]
name = "itoa"
version = "0.4.8"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b71991ff56294aa922b450139ee08b3bfc70982c6b2c7562771375cf73542dd4"
[[package]]
name = "itoa"
version = "1.0.4"
@ -603,22 +543,6 @@ dependencies = [
"wasm-bindgen",
]
[[package]]
name = "kernel32-sys"
version = "0.2.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "7507624b29483431c0ba2d82aece8ca6cdba9382bff4ddd0f7490560c056098d"
dependencies = [
"winapi 0.2.8",
"winapi-build",
]
[[package]]
name = "lazy_static"
version = "1.4.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646"
[[package]]
name = "libc"
version = "0.2.138"
@ -645,13 +569,23 @@ dependencies = [
"rle-decode-fast",
]
[[package]]
name = "lock_api"
version = "0.4.9"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "435011366fe56583b16cf956f9df0095b405b82d76425bc8981c0e22e60ec4df"
dependencies = [
"autocfg",
"scopeguard",
]
[[package]]
name = "log"
version = "0.4.17"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "abb12e687cfb44aa40f41fc3978ef76448f9b6038cad6aef4259d3c095a2382e"
dependencies = [
"cfg-if 1.0.0",
"cfg-if",
]
[[package]]
@ -667,7 +601,7 @@ source = "git+https://github.com/mhutter/maud?branch=axum-0.6#c0adc397322e9ce1b6
dependencies = [
"axum-core",
"http",
"itoa 1.0.4",
"itoa",
"maud_macros",
]
@ -704,25 +638,6 @@ dependencies = [
"unicase",
]
[[package]]
name = "mio"
version = "0.6.23"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "4afd66f5b91bf2a3bc13fad0e21caedac168ca4c707504e75585648ae80e4cc4"
dependencies = [
"cfg-if 0.1.10",
"fuchsia-zircon",
"fuchsia-zircon-sys",
"iovec",
"kernel32-sys",
"libc",
"log",
"miow",
"net2",
"slab",
"winapi 0.2.8",
]
[[package]]
name = "mio"
version = "0.8.5"
@ -735,29 +650,6 @@ dependencies = [
"windows-sys",
]
[[package]]
name = "miow"
version = "0.2.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "ebd808424166322d4a38da87083bfddd3ac4c131334ed55856112eb06d46944d"
dependencies = [
"kernel32-sys",
"net2",
"winapi 0.2.8",
"ws2_32-sys",
]
[[package]]
name = "net2"
version = "0.2.38"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "74d0df99cfcd2530b2e694f6e17e7f37b8e26bb23983ac530c0c97408837c631"
dependencies = [
"cfg-if 0.1.10",
"libc",
"winapi 0.3.9",
]
[[package]]
name = "num_cpus"
version = "1.14.0"
@ -775,10 +667,27 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "86f0b0d4bf799edbc74508c1e8bf170ff5f41238e5f8225603ca7caaae2b7860"
[[package]]
name = "opaque-debug"
version = "0.3.0"
name = "parking_lot"
version = "0.12.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "624a8340c38c1b80fd549087862da4ba43e08858af025b236e509b6649fc13d5"
checksum = "3742b2c103b9f06bc9fff0a37ff4912935851bee6d36f3c02bcc755bcfec228f"
dependencies = [
"lock_api",
"parking_lot_core",
]
[[package]]
name = "parking_lot_core"
version = "0.9.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "7ff9f3fef3968a3ec5945535ed654cb38ff72d7495a25619e2247fb15a2ed9ba"
dependencies = [
"cfg-if",
"libc",
"redox_syscall",
"smallvec",
"windows-sys",
]
[[package]]
name = "percent-encoding"
@ -806,12 +715,6 @@ dependencies = [
"syn",
]
[[package]]
name = "pin-project-lite"
version = "0.1.12"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "257b64915a082f7811703966789728173279bdebb956b143dbcd23f6f970a777"
[[package]]
name = "pin-project-lite"
version = "0.2.9"
@ -894,33 +797,36 @@ checksum = "456c603be3e8d448b072f410900c09faf164fbce2d480456f50eea6e25f9c848"
[[package]]
name = "reqwest"
version = "0.10.10"
version = "0.11.13"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "0718f81a8e14c4dbb3b34cf23dc6aaf9ab8a0dfec160c534b3dbca1aaa21f47c"
checksum = "68cc60575865c7831548863cc02356512e3f1dc2f3f82cb837d7fc4cc8f3c97c"
dependencies = [
"base64 0.13.1",
"bytes 0.5.6",
"base64",
"bytes",
"encoding_rs",
"futures-core",
"futures-util",
"h2",
"http",
"http-body 0.3.1",
"hyper 0.13.10",
"http-body",
"hyper",
"hyper-rustls",
"ipnet",
"js-sys",
"lazy_static",
"log",
"mime",
"mime_guess",
"once_cell",
"percent-encoding",
"pin-project-lite 0.2.9",
"pin-project-lite",
"rustls",
"rustls-pemfile",
"serde",
"serde_json",
"serde_urlencoded",
"tokio 0.2.25",
"tokio",
"tokio-rustls",
"tokio-util",
"tower-service",
"url",
"wasm-bindgen",
"wasm-bindgen-futures",
@ -941,7 +847,7 @@ dependencies = [
"spin",
"untrusted",
"web-sys",
"winapi 0.3.9",
"winapi",
]
[[package]]
@ -952,17 +858,25 @@ checksum = "3582f63211428f83597b51b2ddb88e2a91a9d52d12831f9d08f5e624e8977422"
[[package]]
name = "rustls"
version = "0.18.1"
version = "0.20.7"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "5d1126dcf58e93cee7d098dbda643b5f92ed724f1f6a63007c1116eed6700c81"
checksum = "539a2bfe908f471bfa933876bd1eb6a19cf2176d375f82ef7f99530a40e48c2c"
dependencies = [
"base64 0.12.3",
"log",
"ring",
"sct",
"webpki",
]
[[package]]
name = "rustls-pemfile"
version = "1.0.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "0864aeff53f8c05aa08d86e5ef839d3dfcf07aeba2db32f12db0ef716e87bd55"
dependencies = [
"base64",
]
[[package]]
name = "rustversion"
version = "1.0.9"
@ -976,10 +890,16 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "4501abdff3ae82a1c1b477a17252eb69cee9e66eb915c1abaa4f44d873df9f09"
[[package]]
name = "sct"
version = "0.6.1"
name = "scopeguard"
version = "1.1.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b362b83898e0e69f38515b82ee15aa80636befe47c3b6d3d89a911e78fc228ce"
checksum = "d29ab0c6d3fc0ee92fe66e2d99f700eab17a8d57d1c1d3b748380fb20baa78cd"
[[package]]
name = "sct"
version = "0.7.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d53dcdb7c9f8158937a7981b48accfd39a43af418591a5d008c7b22b5e1b7ca4"
dependencies = [
"ring",
"untrusted",
@ -1020,7 +940,7 @@ version = "1.0.89"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "020ff22c755c2ed3f8cf162dbb41a7268d934702f3ed3631656ea597e08fc3db"
dependencies = [
"itoa 1.0.4",
"itoa",
"ryu",
"serde",
]
@ -1041,22 +961,29 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d3491c14715ca2294c4d6a88f15e84739788c1d030eed8c110436aafdaa2f3fd"
dependencies = [
"form_urlencoded",
"itoa 1.0.4",
"itoa",
"ryu",
"serde",
]
[[package]]
name = "sha2"
version = "0.9.9"
version = "0.10.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "4d58a1e1bf39749807d89cf2d98ac2dfa0ff1cb3faa38fbb64dd88ac8013d800"
checksum = "82e6b795fe2e3b1e845bafcb27aa35405c4d47cdfc92af5fc8d3002f76cebdc0"
dependencies = [
"block-buffer",
"cfg-if 1.0.0",
"cfg-if",
"cpufeatures",
"digest",
"opaque-debug",
]
[[package]]
name = "signal-hook-registry"
version = "1.4.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "e51e73328dc4ac0c7ccbda3a494dfa03df1de2f46018127f60c693f2648455b0"
dependencies = [
"libc",
]
[[package]]
@ -1069,15 +996,10 @@ dependencies = [
]
[[package]]
name = "socket2"
version = "0.3.19"
name = "smallvec"
version = "1.10.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "122e570113d28d773067fab24266b66753f6ea915758651696b6e35e49f88d6e"
dependencies = [
"cfg-if 1.0.0",
"libc",
"winapi 0.3.9",
]
checksum = "a507befe795404456341dfab10cef66ead4c041f62b8b11bbb92bffe5d0953e0"
[[package]]
name = "socket2"
@ -1086,7 +1008,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "02e2d2db9033d13a1567121ddd7a095ee144db4e1ca1b1bda3419bc0da294ebd"
dependencies = [
"libc",
"winapi 0.3.9",
"winapi",
]
[[package]]
@ -1097,19 +1019,20 @@ checksum = "6e63cff320ae2c57904679ba7cb63280a3dc4613885beafb148ee7bf9aa9042d"
[[package]]
name = "strum"
version = "0.19.5"
version = "0.23.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b89a286a7e3b5720b9a477b23253bc50debac207c8d21505f8e70b36792f11b5"
checksum = "cae14b91c7d11c9a851d3fbc80a963198998c2a64eec840477fa92d8ce9b70bb"
[[package]]
name = "strum_macros"
version = "0.19.4"
version = "0.23.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "e61bb0be289045cb80bfce000512e32d09f8337e54c186725da381377ad1f8d5"
checksum = "5bb0dc7ee9c15cea6199cde9a127fa16a4c5819af85395457ad72d68edc85a38"
dependencies = [
"heck",
"proc-macro2",
"quote",
"rustversion",
"syn",
]
@ -1176,23 +1099,6 @@ version = "0.1.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "cda74da7e1a664f795bb1f8a87ec406fb89a02522cf6e50620d016add6dbbf5c"
[[package]]
name = "tokio"
version = "0.2.25"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "6703a273949a90131b290be1fe7b039d0fc884aa1935860dfcbe056f28cd8092"
dependencies = [
"bytes 0.5.6",
"fnv",
"futures-core",
"iovec",
"lazy_static",
"memchr",
"mio 0.6.23",
"pin-project-lite 0.1.12",
"slab",
]
[[package]]
name = "tokio"
version = "1.23.0"
@ -1200,11 +1106,15 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "eab6d665857cc6ca78d6e80303a02cea7a7851e85dfbd77cbdc09bd129f1ef46"
dependencies = [
"autocfg",
"bytes",
"libc",
"mio 0.8.5",
"memchr",
"mio",
"num_cpus",
"pin-project-lite 0.2.9",
"socket2 0.4.7",
"parking_lot",
"pin-project-lite",
"signal-hook-registry",
"socket2",
"tokio-macros",
"windows-sys",
]
@ -1222,28 +1132,27 @@ dependencies = [
[[package]]
name = "tokio-rustls"
version = "0.14.1"
version = "0.23.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "e12831b255bcfa39dc0436b01e19fea231a37db570686c06ee72c423479f889a"
checksum = "c43ee83903113e03984cb9e5cebe6c04a5116269e900e3ddba8f068a62adda59"
dependencies = [
"futures-core",
"rustls",
"tokio 0.2.25",
"tokio",
"webpki",
]
[[package]]
name = "tokio-util"
version = "0.3.1"
version = "0.7.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "be8242891f2b6cbef26a2d7e8605133c2c554cd35b3e4948ea892d6d68436499"
checksum = "0bb2e075f03b3d66d8d8785356224ba688d2906a371015e225beeb65ca92c740"
dependencies = [
"bytes 0.5.6",
"bytes",
"futures-core",
"futures-sink",
"log",
"pin-project-lite 0.1.12",
"tokio 0.2.25",
"pin-project-lite",
"tokio",
"tracing",
]
[[package]]
@ -1255,8 +1164,8 @@ dependencies = [
"futures-core",
"futures-util",
"pin-project",
"pin-project-lite 0.2.9",
"tokio 1.23.0",
"pin-project-lite",
"tokio",
"tower-layer",
"tower-service",
"tracing",
@ -1269,13 +1178,19 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f873044bf02dd1e8239e9c1293ea39dad76dc594ec16185d0a1bf31d8dc8d858"
dependencies = [
"bitflags",
"bytes 1.3.0",
"bytes",
"futures-core",
"futures-util",
"http",
"http-body 0.4.5",
"http-body",
"http-range-header",
"pin-project-lite 0.2.9",
"httpdate",
"mime",
"mime_guess",
"percent-encoding",
"pin-project-lite",
"tokio",
"tokio-util",
"tower",
"tower-layer",
"tower-service",
@ -1299,9 +1214,9 @@ version = "0.1.37"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "8ce8c33a8d48bd45d624a6e523445fd21ec13d3653cd51f681abf67418f54eb8"
dependencies = [
"cfg-if 1.0.0",
"cfg-if",
"log",
"pin-project-lite 0.2.9",
"pin-project-lite",
"tracing-core",
]
@ -1314,16 +1229,6 @@ dependencies = [
"once_cell",
]
[[package]]
name = "tracing-futures"
version = "0.2.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "97d095ae15e245a057c8e8451bab9b3ee1e1f68e9ba2b4fbc18d0ac5237835f2"
dependencies = [
"pin-project",
"tracing",
]
[[package]]
name = "try-lock"
version = "0.2.3"
@ -1417,9 +1322,7 @@ version = "0.2.83"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "eaf9f5aceeec8be17c128b2e93e031fb8a4d469bb9c4ae2d7dc1888b26887268"
dependencies = [
"cfg-if 1.0.0",
"serde",
"serde_json",
"cfg-if",
"wasm-bindgen-macro",
]
@ -1444,7 +1347,7 @@ version = "0.4.33"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "23639446165ca5a5de86ae1d8896b737ae80319560fbaa4c2887b7da6e7ebd7d"
dependencies = [
"cfg-if 1.0.0",
"cfg-if",
"js-sys",
"wasm-bindgen",
"web-sys",
@ -1491,9 +1394,9 @@ dependencies = [
[[package]]
name = "webpki"
version = "0.21.4"
version = "0.22.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b8e38c0608262c46d4a56202ebabdeb094cef7e560ca7a226c6bf055188aa4ea"
checksum = "f095d78192e208183081cc07bc5515ef55216397af48b873e5edcd72637fa1bd"
dependencies = [
"ring",
"untrusted",
@ -1501,19 +1404,13 @@ dependencies = [
[[package]]
name = "webpki-roots"
version = "0.20.0"
version = "0.22.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "0f20dea7535251981a9670857150d571846545088359b28e4951d350bdaf179f"
checksum = "b6c71e40d7d2c34a5106301fb632274ca37242cd0c9d3e64dbece371a40a2d87"
dependencies = [
"webpki",
]
[[package]]
name = "winapi"
version = "0.2.8"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "167dc9d6949a9b857f3451275e911c3f44255842c1f7a76f33c55103a909087a"
[[package]]
name = "winapi"
version = "0.3.9"
@ -1524,12 +1421,6 @@ dependencies = [
"winapi-x86_64-pc-windows-gnu",
]
[[package]]
name = "winapi-build"
version = "0.1.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "2d315eee3b34aca4797b2da6b13ed88266e6d612562a0c46390af8299fc699bc"
[[package]]
name = "winapi-i686-pc-windows-gnu"
version = "0.4.0"
@ -1601,21 +1492,11 @@ checksum = "f40009d85759725a34da6d89a94e63d7bdc50a862acf0dbc7c8e488f1edcb6f5"
[[package]]
name = "winreg"
version = "0.7.0"
version = "0.10.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "0120db82e8a1e0b9fb3345a539c478767c0048d842860994d96113d5b667bd69"
checksum = "80d0f4e272c85def139476380b12f9ac60926689dd2e01d4923222f40580869d"
dependencies = [
"winapi 0.3.9",
]
[[package]]
name = "ws2_32-sys"
version = "0.2.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d59cefebd0c892fa2dd6de581e937301d8552cb44489cdff035c6187cb63fa5e"
dependencies = [
"winapi 0.2.8",
"winapi-build",
"winapi",
]
[[package]]

View file

@ -8,6 +8,7 @@ edition = "2021"
[dependencies]
axum = "0.6.1"
maud = { git = "https://github.com/mhutter/maud", branch = "axum-0.6", features = ["axum"] }
tokio = {version = "1.23.0", features = ["macros", "rt-multi-thread"]}
dkregistry = { version = "0.5.0", features = ["reqwest-rustls"], default-features = false}
futures = "0.3"
tokio = {version = "1.23.0", features = ["full"]}
dkregistry = { git = "https://github.com/camallo/dkregistry-rs", features = ["reqwest-rustls"], default-features = false}
futures = "0.3"
axum-extra = { version = "0.4.2", features = ["spa"] }

4
assets/style.css Normal file
View file

@ -0,0 +1,4 @@
body {
background-color: black;
color: white;
}

View file

@ -2,13 +2,26 @@ use std::{boxed, error};
use dkregistry::v2::Client;
use maud::{html, Markup, DOCTYPE};
use axum::{Router, routing::get};
use futures::stream::StreamExt;
use futures::{stream::{StreamExt, self}, future::join_all};
use axum_extra::routing::SpaRouter;
// To be expanded upon.
#[derive(Debug)]
struct Image {
name: String,
tags: Vec<Tag>,
}
#[derive(Debug)]
struct Tag {
name: String,
}
#[tokio::main(flavor = "multi_thread", worker_threads = 10)]
async fn main() {
// build our application with a single route
let app = Router::new()
.route("/", get(root));
.route("/", get(root))
.merge(SpaRouter::new("/assets", "assets"));
// run it with hyper on localhost:3000
axum::Server::bind(&"0.0.0.0:3000".parse().unwrap())
@ -22,6 +35,7 @@ fn header(page_title: &str) -> Markup {
(DOCTYPE)
meta charset="utf-8";
title { (page_title) }
link rel="stylesheet" href="/assets/style.css";
}
}
@ -37,7 +51,16 @@ async fn root() -> Markup {
html! {
(header("/"))
@for image in &c {
p { (image) }
div {
details {
summary { (image.name) }
ul {
@for tag in &image.tags {
li { (tag.name) }
}
}
}
}
}
(footer())
}
@ -51,13 +74,29 @@ async fn page(body: &Markup) -> Markup {
}
}
async fn get_images() -> Result<Vec<String>, boxed::Box<dyn error::Error>> {
async fn get_images() -> Result<Vec<Image>, boxed::Box<dyn error::Error>> {
let host = "icr.gmem.ca";
let dclient = Client::configure()
.insecure_registry(false)
.registry(host)
.build()?;
Ok(dclient.get_catalog(None).collect::<Vec<_>>().await
let catalog = dclient.get_catalog(None).collect::<Vec<_>>().await
.into_iter()
.map(Result::unwrap).collect::<Vec<String>>())
.map(Result::unwrap).collect::<Vec<String>>();
let images: Vec<Image> = join_all(catalog.into_iter()
.map(|img| async { Image{name: String::from(&img), tags: get_tags(img).await.unwrap() } })
).await;
Ok(images)
}
async fn get_tags(image: String) -> Result<Vec<Tag>, boxed::Box<dyn error::Error>> {
let host = "icr.gmem.ca";
let dclient = Client::configure()
.insecure_registry(false)
.registry(host)
.build()?;
let tags = dclient.get_tags(image.as_str(), None).collect::<Vec<_>>().await
.into_iter()
.map(Result::unwrap).collect::<Vec<String>>();
Ok(tags.into_iter().map(|t| Tag{name: t}).collect())
}