Initial commit
61 files changed, 9103 insertions(+)
@@ -1,0 +1,1 @@
/target
@@ -1,0 +1,3676 @@
# This file is automatically @generated by Cargo.
# It is not intended for manual editing.
version = 4
[[package]]
name = "actix-codec"
version = "0.5.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "5f7b0a21988c1bf877cf4759ef5ddaac04c1c9fe808c9142ecb78ba97d97a28a"
dependencies = [
"bitflags 2.13.1",
"bytes",
"futures-core",
"futures-sink",
"memchr",
"pin-project-lite",
"tokio",
"tokio-util",
"tracing",
]
[[package]]
name = "actix-http"
version = "3.13.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "48e2faa3e7418ed780cca54829d32782a4008a077230f67457caa063415e99c2"
dependencies = [
"actix-codec",
"actix-rt",
"actix-service",
"actix-utils",
"base64",
"bitflags 2.13.1",
"brotli",
"bytes",
"bytestring",
"derive_more",
"encoding_rs",
"flate2",
"foldhash",
"futures-core",
"h2",
"http",
"httparse",
"httpdate",
"itoa",
"language-tags",
"local-channel",
"mime",
"percent-encoding",
"pin-project-lite",
"rand",
"sha1 0.11.0",
"smallvec",
"tokio",
"tokio-util",
"tracing",
"zstd",
]
[[package]]
name = "actix-macros"
version = "0.2.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "e01ed3140b2f8d422c68afa1ed2e85d996ea619c988ac834d255db32138655cb"
dependencies = [
"quote",
"syn 2.0.119",
]
[[package]]
name = "actix-router"
version = "0.5.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "14f8c75c51892f18d9c46150c5ac7beb81c95f78c8b83a634d49f4ca32551fe7"
dependencies = [
"bytestring",
"cfg-if",
"http",
"regex",
"regex-lite",
"serde",
"tracing",
]
[[package]]
name = "actix-rt"
version = "2.11.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "92589714878ca59a7626ea19734f0e07a6a875197eec751bb5d3f99e64998c63"
dependencies = [
"futures-core",
"tokio",
]
[[package]]
name = "actix-server"
version = "2.6.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "a65064ea4a457eaf07f2fba30b4c695bf43b721790e9530d26cb6f9019ff7502"
dependencies = [
"actix-rt",
"actix-service",
"actix-utils",
"futures-core",
"futures-util",
"mio",
"socket2 0.5.10",
"tokio",
"tracing",
]
[[package]]
name = "actix-service"
version = "2.0.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "9e46f36bf0e5af44bdc4bdb36fbbd421aa98c79a9bce724e1edeb3894e10dc7f"
dependencies = [
"futures-core",
"pin-project-lite",
]
[[package]]
name = "actix-utils"
version = "3.0.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "88a1dcdff1466e3c2488e1cb5c36a71822750ad43839937f85d2f4d9f8b705d8"
dependencies = [
"local-waker",
"pin-project-lite",
]
[[package]]
name = "actix-web"
version = "4.14.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "df09e2d9239703dd64056359c920c7f3fba6535ec61a0059e0f44e095ffe02b4"
dependencies = [
"actix-codec",
"actix-http",
"actix-macros",
"actix-router",
"actix-rt",
"actix-server",
"actix-service",
"actix-utils",
"actix-web-codegen",
"bytes",
"bytestring",
"cfg-if",
"cookie",
"derive_more",
"encoding_rs",
"foldhash",
"futures-core",
"futures-util",
"impl-more",
"itoa",
"language-tags",
"log",
"mime",
"once_cell",
"pin-project-lite",
"regex",
"regex-lite",
"serde",
"serde_json",
"serde_urlencoded",
"smallvec",
"socket2 0.6.5",
"time",
"tracing",
"url",
]
[[package]]
name = "actix-web-codegen"
version = "4.3.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f591380e2e68490b5dfaf1dd1aa0ebe78d84ba7067078512b4ea6e4492d622b8"
dependencies = [
"actix-router",
"proc-macro2",
"quote",
"syn 2.0.119",
]
[[package]]
name = "adler2"
version = "2.0.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "320119579fcad9c21884f5c4861d16174d0e06250625266f50fe6898340abefa"
[[package]]
name = "aho-corasick"
version = "1.1.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "ddd31a130427c27518df266943a5308ed92d4b226cc639f5a8f1002816174301"
dependencies = [
"memchr",
]
[[package]]
name = "alloc-no-stdlib"
version = "2.0.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "cc7bb162ec39d46ab1ca8c77bf72e890535becd1751bb45f64c597edb4c8c6b3"
[[package]]
name = "alloc-stdlib"
version = "0.2.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "0e76a019e91224d279006ff972f1e984179a6e9feb050adba6ce8274aef23195"
dependencies = [
"alloc-no-stdlib",
]
[[package]]
name = "allocator-api2"
version = "0.2.21"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "683d7910e743518b0e34f1186f92494becacb047c7b6bf616c96772180fef923"
[[package]]
name = "android_system_properties"
version = "0.1.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "819e7219dbd41043ac279b19830f2efc897156490d7fd6ea916720117ee66311"
dependencies = [
"libc",
]
[[package]]
name = "anstyle"
version = "1.0.14"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "940b3a0ca603d1eade50a4846a2afffd5ef57a9feac2c0e2ec2e14f9ead76000"
[[package]]
name = "anyhow"
version = "1.0.104"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "330a5ed07fa54e4702c9d6c4174f74427fc0ef6e214bbd677ae50a5099946470"
[[package]]
name = "arc-swap"
version = "1.9.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "c049c0be4daef0b145cb3555416b3b8ef5b7888a38aea1a3a155801fe7b0810b"
dependencies = [
"rustversion",
]
[[package]]
name = "arrayvec"
version = "0.7.8"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d3fb67a6e08acf24fdeccbac2cb6ac4305825bd1f117462e0e6f2f193345ad56"
[[package]]
name = "askama"
version = "0.16.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f1bf825125edd887a019d0a3a837dcc5499a68b0d034cc3eb594070c3e18addc"
dependencies = [
"askama_macros",
"itoa",
"percent-encoding",
"serde",
"serde_json",
]
[[package]]
name = "askama_derive"
version = "0.16.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "e1c7065972a130eafa84215f21352ae15b4a7393da48c1f5e103904490736738"
dependencies = [
"askama_parser",
"basic-toml",
"glob",
"memchr",
"proc-macro2",
"quote",
"rustc-hash",
"serde",
"serde_derive",
"syn 2.0.119",
]
[[package]]
name = "askama_macros"
version = "0.16.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "0e23b1d2c4bd39a41971f6124cef4cc6fd0540913ecb90919b69ab3bbe44ae1a"
dependencies = [
"askama_derive",
]
[[package]]
name = "askama_parser"
version = "0.16.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "7db09fde9143e7ac4513358fb32ee32847125b63b18ea715afd487956da715da"
dependencies = [
"rustc-hash",
"serde",
"serde_derive",
"unicode-ident",
"winnow",
]
[[package]]
name = "autocfg"
version = "1.5.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f2032f911046de80f0a198e0901378627c33f59ea0ac00e363d481118bd70a53"
[[package]]
name = "base64"
version = "0.22.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "72b3254f16251a8381aa12e40e3c4d2f0199f8c6508fbecb9d91f575e0fbb8c6"
[[package]]
name = "basic-toml"
version = "0.1.10"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "ba62675e8242a4c4e806d12f11d136e626e6c8361d6b829310732241652a178a"
dependencies = [
"serde",
]
[[package]]
name = "bisync"
version = "0.3.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "5020822f6d6f23196ccaf55e228db36f9de1cf788052b37992e17cbc96ec41a7"
dependencies = [
"bisync_macros",
]
[[package]]
name = "bisync_macros"
version = "0.2.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d21f40d350a700f6aa107e45fb26448cf489d34794b2ba4522181dc9f1173af6"
[[package]]
name = "bitflags"
version = "1.3.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a"
[[package]]
name = "bitflags"
version = "2.13.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b588b76d00fde79687d7646a9b5bdf3cc0f655e0bbd080335a95d7e96f3587da"
dependencies = [
"serde_core",
]
[[package]]
name = "block-buffer"
version = "0.10.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "3078c7629b62d3f0439517fa394996acacc5cbc91c5a20d8c658e77abd503a71"
dependencies = [
"generic-array",
]
[[package]]
name = "block-buffer"
version = "0.12.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d2f6c7dbe95a6ed67ad9f18e57daf93a2f034c524b99fd2b76d18fdfeb6660aa"
dependencies = [
"hybrid-array",
]
[[package]]
name = "brotli"
version = "8.0.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "5cc91aac060a7a1e25823bdccbfb6af1875b88f17c6daac97894eed8207166b3"
dependencies = [
"alloc-no-stdlib",
"alloc-stdlib",
"brotli-decompressor",
]
[[package]]
name = "brotli-decompressor"
version = "5.0.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "3a32acac15fe1967bc3986b2a6347dffc965602354ea6f450ad07e8bfd253583"
dependencies = [
"alloc-no-stdlib",
"alloc-stdlib",
]
[[package]]
name = "bstr"
version = "1.13.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "1f7dc094d718f2e1c1559ad110e27eeaae14a5465d3d56dd6dbd793079fbd530"
dependencies = [
"memchr",
"regex-automata",
"serde_core",
]
[[package]]
name = "buf-min"
version = "0.7.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "22d5698cf6842742ed64805705798f8b351fff53fa546fd45c52184bee58dc90"
[[package]]
name = "bumpalo"
version = "3.20.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "72f5acc6cb2ba439de613abc23857ec3d78374d8ed5ac84e9d11336e87da8649"
[[package]]
name = "byteorder"
version = "1.5.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "1fd0f2584146f6f2ef48085050886acf353beff7305ebd1ae69500e27c67f64b"
[[package]]
name = "bytes"
version = "1.12.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "fc652a48c352aef3ea3aed32080501cf3ef6ed5da78602a020c991775b0aff04"
[[package]]
name = "bytesize"
version = "2.4.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "3d7c8918969267b2932ffd5655509bbbea0833823058c378876953217f5fc50e"
[[package]]
name = "bytestring"
version = "1.5.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "86566c496f2f47d9b8147a4c8b02ffdb69c919fe0c2b2e7195d22cbba0e635c9"
dependencies = [
"bytes",
]
[[package]]
name = "cc"
version = "1.4.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "5add81bb678e6cb321aff7fa0dc7689ad82b112dbc032cea19f91d6b8e3582b9"
dependencies = [
"find-msvc-tools",
"jobserver",
"libc",
"shlex",
]
[[package]]
name = "cfg-if"
version = "1.0.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "9330f8b2ff13f34540b44e946ef35111825727b38d33286ef986142615121801"
[[package]]
name = "chacha20"
version = "0.10.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d524456ba66e72eb8b115ff89e01e497f8e6d11d78b70b1aa13c0fbd97540a81"
dependencies = [
"cfg-if",
"cpufeatures 0.3.0",
"rand_core",
]
[[package]]
name = "chrono"
version = "0.4.45"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "1aa79e62e7697b8e29b513a68abacf485adcd1fe8284a4316c5ae868e6633327"
dependencies = [
"iana-time-zone",
"js-sys",
"num-traits",
"wasm-bindgen",
"windows-link",
]
[[package]]
name = "clap"
version = "4.6.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d91e0c145792ef73a6ad36d27c75ac09f1832222a3c209689d90f534685ee5b7"
dependencies = [
"clap_builder",
"clap_derive",
]
[[package]]
name = "clap_builder"
version = "4.6.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f09628afdcc538b57f3c6341e9c8e9970f18e4a481690a64974d7023bd33548b"
dependencies = [
"anstyle",
"clap_lex",
]
[[package]]
name = "clap_derive"
version = "4.6.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d012d2b9d65aca7f18f4d9878a045bc17899bba951561ba5ec3c2ba1eed9a061"
dependencies = [
"heck",
"proc-macro2",
"quote",
"syn 3.0.2",
]
[[package]]
name = "clap_lex"
version = "1.1.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "c8d4a3bb8b1e0c1050499d1815f5ab16d04f0959b233085fb31653fbfc9d98f9"
[[package]]
name = "clru"
version = "0.6.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "197fd99cb113a8d5d9b6376f3aa817f32c1078f2343b714fff7d2ca44fdf67d5"
dependencies = [
"hashbrown 0.16.1",
]
[[package]]
name = "const-oid"
version = "0.10.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "a6ef517f0926dd24a1582492c791b6a4818a4d94e789a334894aa15b0d12f55c"
[[package]]
name = "convert_case"
version = "0.10.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "633458d4ef8c78b72454de2d54fd6ab2e60f9e02be22f3c6104cdc8a4e0fceb9"
dependencies = [
"unicode-segmentation",
]
[[package]]
name = "cookie"
version = "0.16.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "e859cd57d0710d9e06c381b550c06e76992472a8c6d527aecd2fc673dcc231fb"
dependencies = [
"percent-encoding",
"time",
"version_check",
]
[[package]]
name = "core-foundation-sys"
version = "0.8.7"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "773648b94d0e5d620f64f280777445740e61fe701025087ec8b57f45c791888b"
[[package]]
name = "cpufeatures"
version = "0.2.17"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "59ed5838eebb26a2bb2e58f6d5b5316989ae9d08bab10e0e6d103e656d1b0280"
dependencies = [
"libc",
]
[[package]]
name = "cpufeatures"
version = "0.3.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "8b2a41393f66f16b0823bb79094d54ac5fbd34ab292ddafb9a0456ac9f87d201"
dependencies = [
"libc",
]
[[package]]
name = "crc32fast"
version = "1.5.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "9481c1c90cbf2ac953f07c8d4a58aa3945c425b7185c9154d67a65e4230da511"
dependencies = [
"cfg-if",
]
[[package]]
name = "crossbeam-channel"
version = "0.5.16"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d85363c37faeca707aef026efa9f3b34d077bce547e48f770770625c6013679e"
dependencies = [
"crossbeam-utils",
]
[[package]]
name = "crossbeam-utils"
version = "0.8.22"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "61803da095bee82a81bb1a452ecc25d3b2f1416d1897eb86430c6159ef717c17"
[[package]]
name = "crypto-common"
version = "0.1.7"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "78c8292055d1c1df0cce5d180393dc8cce0abec0a7102adb6c7b1eef6016d60a"
dependencies = [
"generic-array",
"typenum",
]
[[package]]
name = "crypto-common"
version = "0.2.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "ce6e4c961d6cd6c9a86db418387425e8bdeaf05b3c8bc1411e6dca4c252f1453"
dependencies = [
"hybrid-array",
]
[[package]]
name = "dashmap"
version = "6.2.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "e6361d5c062261c78a176addb82d4c821ae42bed6089de0e12603cd25de2059c"
dependencies = [
"cfg-if",
"crossbeam-utils",
"hashbrown 0.14.5",
"lock_api",
"once_cell",
"parking_lot_core",
]
[[package]]
name = "defmt"
version = "1.1.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "e2953bfe4f93bbd20cc71198842756f77d161884c99ebbabc41d80231ded88d1"
dependencies = [
"bitflags 1.3.2",
"defmt-macros",
]
[[package]]
name = "defmt-macros"
version = "1.1.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "bad9c72e7ca2137e0dc3813245a0d282fd6daad32fd800af018306a9169b5fe8"
dependencies = [
"defmt-parser",
"proc-macro2",
"quote",
"syn 2.0.119",
]
[[package]]
name = "defmt-parser"
version = "1.0.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "10d60334b3b2e7c9d91ef8150abfb6fa4c1c39ebbcf4a81c2e346aad939fee3e"
dependencies = [
"thiserror",
]
[[package]]
name = "deranged"
version = "0.5.8"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "7cd812cc2bc1d69d4764bd80df88b4317eaef9e773c75226407d9bc0876b211c"
[[package]]
name = "derive_more"
version = "2.1.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d751e9e49156b02b44f9c1815bcb94b984cdcc4396ecc32521c739452808b134"
dependencies = [
"derive_more-impl",
]
[[package]]
name = "derive_more-impl"
version = "2.1.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "799a97264921d8623a957f6c3b9011f3b5492f557bbb7a5a19b7fa6d06ba8dcb"
dependencies = [
"convert_case",
"proc-macro2",
"quote",
"rustc_version",
"syn 2.0.119",
"unicode-xid",
]
[[package]]
name = "digest"
version = "0.10.7"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "9ed9a281f7bc9b7576e61468ba615a66a5c8cfdff42420a70aa82701a3b1e292"
dependencies = [
"block-buffer 0.10.4",
"crypto-common 0.1.7",
]
[[package]]
name = "digest"
version = "0.11.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f1dd6dbb5841937940781866fa1281a1ff7bd3bf827091440879f9994983d5c2"
dependencies = [
"block-buffer 0.12.1",
"const-oid",
"crypto-common 0.2.2",
]
[[package]]
name = "displaydoc"
version = "0.2.7"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "c6232dd377dcc64799954cbd3a9bb882e9cdc1308ccd87b1c098f1fb2eaf82a8"
dependencies = [
"proc-macro2",
"quote",
"syn 3.0.2",
]
[[package]]
name = "dunce"
version = "1.0.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "92773504d58c093f6de2459af4af33faa518c13451eb8f2b5698ed3d36e7c813"
[[package]]
name = "encoding_rs"
version = "0.8.35"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "75030f3c4f45dafd7586dd6780965a8c7e8e285a5ecb86713e63a79c5b2766f3"
dependencies = [
"cfg-if",
]
[[package]]
name = "equivalent"
version = "1.0.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "877a4ace8713b0bcf2a4e7eec82529c029f1d0619886d18145fea96c3ffe5c0f"
[[package]]
name = "errno"
version = "0.3.14"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "39cab71617ae0d63f51a36d69f866391735b51691dbda63cf6f96d042b63efeb"
dependencies = [
"libc",
"windows-sys 0.61.2",
]
[[package]]
name = "faster-hex"
version = "0.10.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "7223ae2d2f179b803433d9c830478527e92b8117eab39460edae7f1614d9fb73"
dependencies = [
"heapless",
"serde",
]
[[package]]
name = "fastrand"
version = "2.5.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "da7c62ceae207dd37ea5b845da6a0696c799f85e97da1ab5b7910be3c1c80223"
[[package]]
name = "filetime"
version = "0.2.29"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "5c287a33c7f0a620c38e641e7f60827713987b3c0f26e8ddc9462cc69cf75759"
dependencies = [
"cfg-if",
"libc",
]
[[package]]
name = "find-msvc-tools"
version = "0.1.9"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "5baebc0774151f905a1a2cc41989300b1e6fbb29aff0ceffa1064fdd3088d582"
[[package]]
name = "flate2"
version = "1.1.9"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "843fba2746e448b37e26a819579957415c8cef339bf08564fe8b7ddbd959573c"
dependencies = [
"crc32fast",
"miniz_oxide",
]
[[package]]
name = "fnv"
version = "1.0.7"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1"
[[package]]
name = "foldhash"
version = "0.2.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "77ce24cb58228fbb8aa041425bb1050850ac19177686ea6e0f41a70416f56fdb"
[[package]]
name = "form_urlencoded"
version = "1.2.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "cb4cb245038516f5f85277875cdaa4f7d2c9a0fa0468de06ed190163b1581fcf"
dependencies = [
"percent-encoding",
]
[[package]]
name = "fsevent-sys"
version = "4.1.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "76ee7a02da4d231650c7cea31349b889be2f45ddb3ef3032d2ec8185f6313fd2"
dependencies = [
"libc",
]
[[package]]
name = "futures-core"
version = "0.3.33"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "2cd50c473c80f6d7c3670a752354b8e569b1a7cbfdc0419ec88e5edad85e0dc7"
[[package]]
name = "futures-sink"
version = "0.3.33"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "e34418ac499d6305c2fb5ad0ed2f6ac998c5f8ca209b4510f7f94242c647e307"
[[package]]
name = "futures-task"
version = "0.3.33"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b231ed28831efb4a61a08580c4bc233ec56bc009f4cd8f52da2c3cb97df0c109"
[[package]]
name = "futures-util"
version = "0.3.33"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "a77a90a256fce34da66415271e30f94ee91c57b04b8a2c042d9cf3220179deaa"
dependencies = [
"futures-core",
"futures-task",
"pin-project-lite",
"slab",
]
[[package]]
name = "generic-array"
version = "0.14.7"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "85649ca51fd72272d7821adaf274ad91c288277713d9c18820d8499a7ff69e9a"
dependencies = [
"typenum",
"version_check",
]
[[package]]
name = "getopts"
version = "0.2.24"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "cfe4fbac503b8d1f88e6676011885f34b7174f46e59956bba534ba83abded4df"
dependencies = [
"unicode-width",
]
[[package]]
name = "getrandom"
version = "0.4.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "300e883d756b2e4ec94e02791f39b04b522276138852cfc41d9fb7e904106099"
dependencies = [
"cfg-if",
"libc",
"r-efi",
"rand_core",
]
[[package]]
name = "git-rs"
version = "0.1.0"
dependencies = [
"actix-web",
"anyhow",
"askama",
"bytes",
"chrono",
"clap",
"flate2",
"gix",
"linkify",
"md5",
"mime_guess",
"notify",
"pulldown-cmark",
"rust-embed",
"serde",
"serde_json",
"tar",
"thiserror",
"time",
"timeago",
"tokio",
"v_htmlescape",
]
[[package]]
name = "gix"
version = "0.86.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "bb3790fd8981cba7949f1ba924ef865d902df731627bc5998d14164063892fce"
dependencies = [
"gix-actor",
"gix-archive",
"gix-attributes",
"gix-blame",
"gix-command",
"gix-commitgraph",
"gix-config",
"gix-credentials",
"gix-date",
"gix-diff",
"gix-dir",
"gix-discover",
"gix-error",
"gix-features",
"gix-filter",
"gix-fs",
"gix-glob",
"gix-hash",
"gix-hashtable",
"gix-ignore",
"gix-index",
"gix-lock",
"gix-mailmap",
"gix-negotiate",
"gix-object",
"gix-odb",
"gix-pack",
"gix-path",
"gix-pathspec",
"gix-prompt",
"gix-protocol",
"gix-ref",
"gix-refspec",
"gix-revision",
"gix-revwalk",
"gix-sec",
"gix-shallow",
"gix-status",
"gix-submodule",
"gix-tempfile",
"gix-trace",
"gix-transport",
"gix-traverse",
"gix-url",
"gix-utils",
"gix-validate",
"gix-worktree",
"gix-worktree-state",
"gix-worktree-stream",
"gix-zlib",
"nonempty",
"parking_lot",
"regex",
"serde",
"signal-hook",
"smallvec",
"thiserror",
]
[[package]]
name = "gix-actor"
version = "0.41.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "33f9308ad6fd35b2a865cbe4117ac61b2be59e4a9ef1621c7a9794f7c8e52c5b"
dependencies = [
"bstr",
"gix-date",
"gix-error",
"serde",
]
[[package]]
name = "gix-archive"
version = "0.35.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "6760ef6ef4edfa6449918977d59518ff209676f47e89bdce87a36a50be35e834"
dependencies = [
"bstr",
"gix-date",
"gix-error",
"gix-object",
"gix-worktree-stream",
]
[[package]]
name = "gix-attributes"
version = "0.34.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "c31c593692ebdc1e38858d9a2b56f6a594c501e24a38971fe6685571f5a07be0"
dependencies = [
"bstr",
"gix-features",
"gix-glob",
"gix-path",
"gix-quote",
"gix-trace",
"serde",
"smallvec",
"thiserror",
"unicode-bom",
]
[[package]]
name = "gix-bitmap"
version = "0.3.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "7cd1d118d0f5d88b96e6f6e13b566475fef4797ead4a02c26fed36c1375066f7"
dependencies = [
"gix-error",
]
[[package]]
name = "gix-blame"
version = "0.16.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b06d20ff0e88ada2dd852b3852727b664ec9baefdf653d1d4e722e858c52cd17"
dependencies = [
"gix-commitgraph",
"gix-date",
"gix-diff",
"gix-error",
"gix-hash",
"gix-object",
"gix-revwalk",
"gix-trace",
"gix-traverse",
"gix-worktree",
"smallvec",
"thiserror",
]
[[package]]
name = "gix-chunk"
version = "0.7.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b2a871e5cab12ba568845714473505deefffb3c04eb47f4708ce344cd459c1cc"
dependencies = [
"gix-error",
]
[[package]]
name = "gix-command"
version = "0.9.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "00706d4fef135ef4b01680d5218c6ee40cda8baf697b864296cbc887d19118f6"
dependencies = [
"bstr",
"gix-path",
"gix-quote",
"gix-trace",
"shell-words",
]
[[package]]
name = "gix-commitgraph"
version = "0.38.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "a2cd7f054ae2727223fe46dd39c012f066b12f532962d336d29ee193261787da"
dependencies = [
"bstr",
"gix-chunk",
"gix-error",
"gix-hash",
"memmap2",
"nonempty",
"serde",
]
[[package]]
name = "gix-config"
version = "0.59.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "103d11bef95c467577ecfa8b7b86a22e65af3507b2c9bfa3809a4afbae7df301"
dependencies = [
"bstr",
"gix-config-value",
"gix-features",
"gix-glob",
"gix-path",
"gix-ref",
"gix-sec",
"gix-utils",
"smallvec",
"thiserror",
"unicode-bom",
]
[[package]]
name = "gix-config-value"
version = "0.19.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "9f813e312a3f7f327187823cd4c754a3e4d948c98907d11e8f37554a2b6b8059"
dependencies = [
"bitflags 2.13.1",
"bstr",
"gix-path",
"libc",
"thiserror",
]
[[package]]
name = "gix-credentials"
version = "0.39.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "73b637f873d5f9aa67e672c1b23741a18e046d33028017adede32f4b4087a2e7"
dependencies = [
"bstr",
"gix-command",
"gix-config-value",
"gix-date",
"gix-path",
"gix-prompt",
"gix-sec",
"gix-trace",
"gix-url",
"serde",
"thiserror",
]
[[package]]
name = "gix-date"
version = "0.15.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "7e47b9e8cdc688296609b706428de570f88b1e0eed7156dde7b4a89d26fa4567"
dependencies = [
"bstr",
"gix-error",
"itoa",
"jiff",
"serde",
]
[[package]]
name = "gix-diff"
version = "0.66.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "fee7d89a3c507491cdfc57a1d1e0e300214720b4f7709ebc253e422f99822bfc"
dependencies = [
"bstr",
"gix-attributes",
"gix-command",
"gix-filter",
"gix-fs",
"gix-hash",
"gix-imara-diff",
"gix-index",
"gix-object",
"gix-path",
"gix-pathspec",
"gix-tempfile",
"gix-trace",
"gix-traverse",
"gix-worktree",
"thiserror",
]
[[package]]
name = "gix-dir"
version = "0.28.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f24bc78f283946ac64757c8a61ffa71f0230aa1e8d98cbb0771db479871dd5b6"
dependencies = [
"bstr",
"gix-discover",
"gix-fs",
"gix-ignore",
"gix-index",
"gix-object",
"gix-path",
"gix-pathspec",
"gix-trace",
"gix-utils",
"gix-worktree",
"thiserror",
]
[[package]]
name = "gix-discover"
version = "0.54.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b9f517766fa1101dfe2606c1a19a8ffa699099030995a9194445446dfe261bdf"
dependencies = [
"bstr",
"dunce",
"gix-fs",
"gix-path",
"gix-ref",
"gix-sec",
"thiserror",
]
[[package]]
name = "gix-error"
version = "0.2.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "4a9292309fd944e71b2a3c96d3c03a6feb8852db646febdde7cbb9f79cb5f329"
dependencies = [
"bstr",
]
[[package]]
name = "gix-features"
version = "0.49.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "20aa09e83a48dc02c5f5f08578aa79d3ab1bab4618b8c362f88684645a02bdcc"
dependencies = [
"bytes",
"bytesize",
"crc32fast",
"crossbeam-channel",
"gix-path",
"gix-trace",
"gix-utils",
"libc",
"once_cell",
"parking_lot",
"prodash",
"walkdir",
]
[[package]]
name = "gix-filter"
version = "0.33.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "5e7b5dbf524d97e839f642930c76d7f011c0791e7d11d8148989ac5af7c76aa8"
dependencies = [
"bstr",
"encoding_rs",
"gix-attributes",
"gix-command",
"gix-hash",
"gix-object",
"gix-packetline",
"gix-path",
"gix-quote",
"gix-trace",
"gix-utils",
"smallvec",
"thiserror",
]
[[package]]
name = "gix-fs"
version = "0.22.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "865cf13fcaf5455220546cb9607c416bd1be9a6caafd143655a362fdeab64e80"
dependencies = [
"bstr",
"gix-features",
"gix-path",
"gix-utils",
"thiserror",
]
[[package]]
name = "gix-glob"
version = "0.27.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "421e92a711554fa5827d1b0599d3389acdd0f6729e97a8c5a57d79af1e50bf36"
dependencies = [
"bitflags 2.13.1",
"bstr",
"gix-features",
"gix-path",
"serde",
]
[[package]]
name = "gix-hash"
version = "0.26.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "13adaa73415fd6c902310923f68d0b98e8cecf14b33ea58c02cc387cee56f54e"
dependencies = [
"faster-hex",
"gix-features",
"serde",
"sha1-checked",
"thiserror",
]
[[package]]
name = "gix-hashtable"
version = "0.16.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "78fccd6fea3bcf0b39c076bae60ae49b08daaf538b950202101a981f9d3c01d3"
dependencies = [
"gix-hash",
"hashbrown 0.17.1",
"parking_lot",
]
[[package]]
name = "gix-ignore"
version = "0.22.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "12cff8e8aa125e39377456073e63df3334d9e5741372ddcc226198015076dda2"
dependencies = [
"bstr",
"gix-glob",
"gix-path",
"gix-trace",
"serde",
"unicode-bom",
]
[[package]]
name = "gix-imara-diff"
version = "0.2.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "1a791e6620676a875f362f3156ed213e73ca099a09bf992c18812abe65cc37b1"
dependencies = [
"bstr",
"hashbrown 0.17.1",
]
[[package]]
name = "gix-index"
version = "0.54.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "5009c4e7e9f9b4cfaaab1153e49133eb04d79c015b5702d6c3d2ab94271a89c6"
dependencies = [
"bitflags 2.13.1",
"bstr",
"filetime",
"fnv",
"gix-bitmap",
"gix-features",
"gix-fs",
"gix-hash",
"gix-lock",
"gix-object",
"gix-traverse",
"gix-utils",
"gix-validate",
"hashbrown 0.17.1",
"itoa",
"libc",
"memmap2",
"rustix",
"serde",
"smallvec",
"thiserror",
]
[[package]]
name = "gix-lock"
version = "24.0.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d4c69157820343bf1c6e4b88b9808e920900de02e18aaf5862b30ada43814848"
dependencies = [
"gix-tempfile",
"gix-utils",
"thiserror",
]
[[package]]
name = "gix-mailmap"
version = "0.33.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "a824767d38b81475059cb01f5020a13fb96e7ed6bbf9851c7112b46ada78db48"
dependencies = [
"bstr",
"gix-actor",
"gix-date",
"gix-error",
"serde",
]
[[package]]
name = "gix-negotiate"
version = "0.34.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "2fa5aa789990f124e4f559b142cecfb60662cb4ae17006684ea9d668f4f07689"
dependencies = [
"bitflags 2.13.1",
"gix-commitgraph",
"gix-date",
"gix-hash",
"gix-object",
"gix-revwalk",
]
[[package]]
name = "gix-object"
version = "0.63.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "0e48c235e7f886eb819fc878af75be889333dd3c38bee02ed7af48ae2cf596c4"
dependencies = [
"bstr",
"gix-actor",
"gix-date",
"gix-features",
"gix-hash",
"gix-hashtable",
"gix-utils",
"gix-validate",
"itoa",
"serde",
"smallvec",
"thiserror",
]
[[package]]
name = "gix-odb"
version = "0.83.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "8dd494ffb5037e62b8220109e894d2861ff2150a2cacbfccdba57ae1ebab2b96"
dependencies = [
"arc-swap",
"gix-features",
"gix-fs",
"gix-hash",
"gix-hashtable",
"gix-object",
"gix-pack",
"gix-path",
"gix-quote",
"gix-zlib",
"memmap2",
"parking_lot",
"serde",
"tempfile",
"thiserror",
]
[[package]]
name = "gix-pack"
version = "0.73.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "6d5446127b269706e85998065267ddd2ccc3550179da6780b22fe496175ccb20"
dependencies = [
"clru",
"gix-chunk",
"gix-error",
"gix-features",
"gix-hash",
"gix-hashtable",
"gix-object",
"gix-path",
"gix-zlib",
"memmap2",
"serde",
"smallvec",
"thiserror",
"uluru",
]
[[package]]
name = "gix-packetline"
version = "0.22.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "3766025c72319c4accdd854a18e6f0dd176c8eb0f3bc8a60a7765be2b50cabf2"
dependencies = [
"bstr",
"faster-hex",
"gix-trace",
"thiserror",
]
[[package]]
name = "gix-path"
version = "0.12.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "1ed3e8d7a82e886e17a72e03d4ba0c13db6f2219b6cd4e2900b4cae426ec20c9"
dependencies = [
"bstr",
"gix-trace",
"gix-validate",
"thiserror",
]
[[package]]
name = "gix-pathspec"
version = "0.19.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "49f6fa5f8007f008187c3f60b4373209ca83d1cc947f35ede03e16cd15a4d137"
dependencies = [
"bitflags 2.13.1",
"bstr",
"gix-attributes",
"gix-config-value",
"gix-glob",
"gix-path",
"thiserror",
]
[[package]]
name = "gix-prompt"
version = "0.16.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "5cb1f1eb92d6f4c9d4c105a6ca912cff637fbd5cacbcbafa5deccd88bfaa3565"
dependencies = [
"gix-command",
"gix-config-value",
"parking_lot",
"rustix",
"thiserror",
]
[[package]]
name = "gix-protocol"
version = "0.64.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "dede40e89c1e90f548415f50636bb051f6d9c60f68b8b710bc07825722d19588"
dependencies = [
"bisync",
"bstr",
"gix-date",
"gix-features",
"gix-hash",
"gix-ref",
"gix-shallow",
"gix-transport",
"gix-utils",
"nonempty",
"serde",
"thiserror",
]
[[package]]
name = "gix-quote"
version = "0.7.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "a6e541fc33cc2b783b7979040d445a0c86a2eca747c8faea4ca84230d06ae6ef"
dependencies = [
"bstr",
"gix-error",
"gix-utils",
]
[[package]]
name = "gix-ref"
version = "0.66.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "eeb0c90a8f6202ceaaa22996cbf837c943ccb2d8af9ff3490f0758305e6b7883"
dependencies = [
"gix-actor",
"gix-features",
"gix-fs",
"gix-hash",
"gix-lock",
"gix-object",
"gix-path",
"gix-tempfile",
"gix-utils",
"gix-validate",
"memmap2",
"serde",
"thiserror",
]
[[package]]
name = "gix-refspec"
version = "0.44.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "7406282cc0259b51f6aee299ca3d31279a020530363152a2e6c96e8a7f7bbc83"
dependencies = [
"bstr",
"gix-error",
"gix-glob",
"gix-hash",
"gix-revision",
"gix-validate",
"smallvec",
"thiserror",
]
[[package]]
name = "gix-revision"
version = "0.48.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "e55e09d4a1ecf2beecc8c09cafcad37979e805b31f588b0e957e191df5783681"
dependencies = [
"bitflags 2.13.1",
"bstr",
"gix-commitgraph",
"gix-date",
"gix-error",
"gix-hash",
"gix-hashtable",
"gix-object",
"gix-revwalk",
"gix-trace",
"nonempty",
"serde",
]
[[package]]
name = "gix-revwalk"
version = "0.34.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "36c113c0a53294dc6280ffc06cbcc4f50f820397e97d6a00b429a44b8db26e29"
dependencies = [
"gix-commitgraph",
"gix-date",
"gix-error",
"gix-hash",
"gix-hashtable",
"gix-object",
"smallvec",
"thiserror",
]
[[package]]
name = "gix-sec"
version = "0.14.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "af4fe6c152c1d50aea36f299825702cd37e303307832fec1d0fdd5844e47ce2f"
dependencies = [
"bitflags 2.13.1",
"gix-path",
"libc",
"serde",
"windows-sys 0.61.2",
]
[[package]]
name = "gix-shallow"
version = "0.13.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "1ecc9f4b40537043e4bbd7d3d1760e74fb8e7b07a546166b558acaa73ad97f4a"
dependencies = [
"bstr",
"gix-hash",
"gix-lock",
"nonempty",
"serde",
"thiserror",
]
[[package]]
name = "gix-status"
version = "0.33.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "5f83b1c74e69b90411fbfe89ccebc47aa49457ce4eb9b942b1311258fc863d22"
dependencies = [
"bstr",
"filetime",
"gix-diff",
"gix-dir",
"gix-features",
"gix-filter",
"gix-fs",
"gix-hash",
"gix-index",
"gix-object",
"gix-path",
"gix-pathspec",
"gix-worktree",
"hashbrown 0.16.1",
"portable-atomic",
"thiserror",
"windows-sys 0.61.2",
]
[[package]]
name = "gix-submodule"
version = "0.33.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "5fd98077a56d08886112e6b08dc94076d03539f4bc0b9d7880e4be2b8a640d8c"
dependencies = [
"bstr",
"gix-config",
"gix-path",
"gix-pathspec",
"gix-refspec",
"gix-url",
"thiserror",
]
[[package]]
name = "gix-tempfile"
version = "24.0.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b675b920bd5a61d17ad542772f03ec34c60feb8ff683e1560c03ae967363731e"
dependencies = [
"dashmap",
"gix-fs",
"libc",
"parking_lot",
"signal-hook",
"signal-hook-registry",
"tempfile",
]
[[package]]
name = "gix-trace"
version = "0.1.21"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "be3eb81d9dc914335923e50d52829c551feefd6a72d176c4130c546b67a60814"
dependencies = [
"tracing",
]
[[package]]
name = "gix-transport"
version = "0.58.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b7c1bcf30081eb8ab04540a5795c67a2fcb22cb2e976e8b1a4ea657b1ed61469"
dependencies = [
"bstr",
"gix-command",
"gix-features",
"gix-packetline",
"gix-path",
"gix-quote",
"gix-sec",
"gix-url",
"serde",
"thiserror",
]
[[package]]
name = "gix-traverse"
version = "0.60.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "008c5cd879e46e86b5c2469e633611978b18775d53d05668d691bc13088bd409"
dependencies = [
"bitflags 2.13.1",
"gix-commitgraph",
"gix-date",
"gix-hash",
"gix-hashtable",
"gix-object",
"gix-revwalk",
"smallvec",
"thiserror",
]
[[package]]
name = "gix-url"
version = "0.37.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "42d10e53b8eae21ee601687f47bbbd6cb2ed7162cb4c1cafdd422fb7ec64cbee"
dependencies = [
"bstr",
"gix-path",
"gix-utils",
"percent-encoding",
"serde",
"thiserror",
]
[[package]]
name = "gix-utils"
version = "0.3.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b1795bd2a970ca8b2185318c2abb97d955c71992f1cf28de73ad3b593a9f3ce8"
dependencies = [
"bstr",
"fastrand",
"getrandom",
"unicode-normalization",
]
[[package]]
name = "gix-validate"
version = "0.11.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "9a034e84d1e04e1b1f20f51f12491da230b6ac8b925d0c8e1b89bcd87a7c5ccc"
dependencies = [
"bstr",
]
[[package]]
name = "gix-worktree"
version = "0.55.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "31eb8e675122e83585e461fe28f68ff8c5ed55b49017b697e7e76423ff973424"
dependencies = [
"bstr",
"gix-attributes",
"gix-features",
"gix-fs",
"gix-glob",
"gix-hash",
"gix-ignore",
"gix-index",
"gix-object",
"gix-path",
"gix-validate",
"serde",
]
[[package]]
name = "gix-worktree-state"
version = "0.33.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "bc47372fc12b9fbea51b257bcc8d4970326cf5c7e42135bbfb5d72871bb30bd4"
dependencies = [
"bstr",
"gix-features",
"gix-filter",
"gix-fs",
"gix-index",
"gix-object",
"gix-path",
"gix-worktree",
"io-close",
"thiserror",
]
[[package]]
name = "gix-worktree-stream"
version = "0.35.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "3b088c8724e7be120c4798dd86925cf05332c9d356a463542578600c50c7a549"
dependencies = [
"gix-attributes",
"gix-error",
"gix-features",
"gix-filter",
"gix-fs",
"gix-hash",
"gix-object",
"gix-path",
"gix-traverse",
"parking_lot",
]
[[package]]
name = "gix-zlib"
version = "0.1.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "3e8813f5579b3075ff9c90f7c59cd2b62b4ebb639361f0911648b22d7446cc7c"
dependencies = [
"serde",
"thiserror",
"zlib-rs",
]
[[package]]
name = "glob"
version = "0.3.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "e4eba85ea1d0a966a983acd07deee566e67395d2d96b6fb39e62b5a833f1eb0b"
[[package]]
name = "h2"
version = "0.3.27"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "0beca50380b1fc32983fc1cb4587bfa4bb9e78fc259aad4a0032d2080309222d"
dependencies = [
"bytes",
"fnv",
"futures-core",
"futures-sink",
"futures-util",
"http",
"indexmap",
"slab",
"tokio",
"tokio-util",
"tracing",
]
[[package]]
name = "hash32"
version = "0.3.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "47d60b12902ba28e2730cd37e95b8c9223af2808df9e902d4df49588d1470606"
dependencies = [
"byteorder",
]
[[package]]
name = "hashbrown"
version = "0.14.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "e5274423e17b7c9fc20b6e7e208532f9b19825d82dfd615708b70edd83df41f1"
[[package]]
name = "hashbrown"
version = "0.16.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "841d1cc9bed7f9236f321df977030373f4a4163ae1a7dbfe1a51a2c1a51d9100"
dependencies = [
"allocator-api2",
"equivalent",
"foldhash",
]
[[package]]
name = "hashbrown"
version = "0.17.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "ed5909b6e89a2db4456e54cd5f673791d7eca6732202bbf2a9cc504fe2f9b84a"
dependencies = [
"allocator-api2",
"equivalent",
"foldhash",
]
[[package]]
name = "heapless"
version = "0.8.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "0bfb9eb618601c89945a70e254898da93b13be0388091d42117462b265bb3fad"
dependencies = [
"hash32",
"stable_deref_trait",
]
[[package]]
name = "heck"
version = "0.5.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "2304e00983f87ffb38b55b444b5e3b60a884b5d30c0fca7d82fe33449bbe55ea"
[[package]]
name = "http"
version = "0.2.12"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "601cbb57e577e2f5ef5be8e7b83f0f63994f25aa94d673e54a92d5c516d101f1"
dependencies = [
"bytes",
"fnv",
"itoa",
]
[[package]]
name = "httparse"
version = "1.10.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "6dbf3de79e51f3d586ab4cb9d5c3e2c14aa28ed23d180cf89b4df0454a69cc87"
[[package]]
name = "httpdate"
version = "1.0.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "df3b46402a9d5adb4c86a0cf463f42e19994e3ee891101b1841f30a545cb49a9"
[[package]]
name = "human_format"
version = "1.2.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "eaec953f16e5bcf6b8a3cb3aa959b17e5577dbd2693e94554c462c08be22624b"
[[package]]
name = "hybrid-array"
version = "0.4.13"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "818356c5132c1fede50f837ca96afbe78ff42413047f4abb886217845e1b6c8c"
dependencies = [
"typenum",
]
[[package]]
name = "iana-time-zone"
version = "0.1.65"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "e31bc9ad994ba00e440a8aa5c9ef0ec67d5cb5e5cb0cc7f8b744a35b389cc470"
dependencies = [
"android_system_properties",
"core-foundation-sys",
"iana-time-zone-haiku",
"js-sys",
"log",
"wasm-bindgen",
"windows-core",
]
[[package]]
name = "iana-time-zone-haiku"
version = "0.1.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f31827a206f56af32e590ba56d5d2d085f558508192593743f16b2306495269f"
dependencies = [
"cc",
]
[[package]]
name = "icu_collections"
version = "2.2.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "2984d1cd16c883d7935b9e07e44071dca8d917fd52ecc02c04d5fa0b5a3f191c"
dependencies = [
"displaydoc",
"potential_utf",
"utf8_iter",
"yoke",
"zerofrom",
"zerovec",
]
[[package]]
name = "icu_locale_core"
version = "2.2.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "92219b62b3e2b4d88ac5119f8904c10f8f61bf7e95b640d25ba3075e6cac2c29"
dependencies = [
"displaydoc",
"litemap",
"tinystr",
"writeable",
"zerovec",
]
[[package]]
name = "icu_normalizer"
version = "2.2.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "c56e5ee99d6e3d33bd91c5d85458b6005a22140021cc324cea84dd0e72cff3b4"
dependencies = [
"icu_collections",
"icu_normalizer_data",
"icu_properties",
"icu_provider",
"smallvec",
"zerovec",
]
[[package]]
name = "icu_normalizer_data"
version = "2.2.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "da3be0ae77ea334f4da67c12f149704f19f81d1adf7c51cf482943e84a2bad38"
[[package]]
name = "icu_properties"
version = "2.2.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "bee3b67d0ea5c2cca5003417989af8996f8604e34fb9ddf96208a033901e70de"
dependencies = [
"icu_collections",
"icu_locale_core",
"icu_properties_data",
"icu_provider",
"zerotrie",
"zerovec",
]
[[package]]
name = "icu_properties_data"
version = "2.2.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "8e2bbb201e0c04f7b4b3e14382af113e17ba4f63e2c9d2ee626b720cbce54a14"
[[package]]
name = "icu_provider"
version = "2.2.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "139c4cf31c8b5f33d7e199446eff9c1e02decfc2f0eec2c8d71f65befa45b421"
dependencies = [
"displaydoc",
"icu_locale_core",
"writeable",
"yoke",
"zerofrom",
"zerotrie",
"zerovec",
]
[[package]]
name = "idna"
version = "1.1.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "3b0875f23caa03898994f6ddc501886a45c7d3d62d04d2d90788d47be1b1e4de"
dependencies = [
"idna_adapter",
"smallvec",
"utf8_iter",
]
[[package]]
name = "idna_adapter"
version = "1.2.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "cb68373c0d6620ef8105e855e7745e18b0d00d3bdb07fb532e434244cdb9a714"
dependencies = [
"icu_normalizer",
"icu_properties",
]
[[package]]
name = "impl-more"
version = "0.3.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "277ff51754a3f68f12f58446c5d006aa8baa4914ea273cce24a599cfaff33d4f"
[[package]]
name = "indexmap"
version = "2.14.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d466e9454f08e4a911e14806c24e16fba1b4c121d1ea474396f396069cf949d9"
dependencies = [
"equivalent",
"hashbrown 0.17.1",
]
[[package]]
name = "inotify"
version = "0.11.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "153be1941a183ec9ccd095ddbe17a8b8d435ef6c76e9e02451b933c3999af2c8"
dependencies = [
"bitflags 2.13.1",
"inotify-sys",
"libc",
]
[[package]]
name = "inotify-sys"
version = "0.1.8"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "c033f80b2c113cdf91ab7a33faa9cbc014726dcad99880c8609af2a370edf37d"
dependencies = [
"libc",
]
[[package]]
name = "io-close"
version = "0.3.7"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "9cadcf447f06744f8ce713d2d6239bb5bde2c357a452397a9ed90c625da390bc"
dependencies = [
"libc",
"winapi",
]
[[package]]
name = "isolang"
version = "2.4.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "fe50d48c77760c55188549098b9a7f6e37ae980c586a24693d6b01c3b2010c3c"
dependencies = [
"phf",
]
[[package]]
name = "itoa"
version = "1.0.18"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "8f42a60cbdf9a97f5d2305f08a87dc4e09308d1276d28c869c684d7777685682"
[[package]]
name = "jiff"
version = "0.2.34"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "e184d09547b80eb7e20d141ba2fb1fbac843ca53f4cf1b31210adc4c1adc6e16"
dependencies = [
"defmt",
"jiff-core",
"jiff-static",
"jiff-tzdb-platform",
"log",
"portable-atomic",
"portable-atomic-util",
"serde_core",
"windows-link",
]
[[package]]
name = "jiff-core"
version = "0.1.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "7feca88439efe53da3754500c1851dedf3cb36c524dd5cf8225cc0794de95d09"
dependencies = [
"defmt",
]
[[package]]
name = "jiff-static"
version = "0.2.34"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "323da076b7a6faf914dc677cb05a4b907742ff7375c8322c9e7f5061e5e0e9de"
dependencies = [
"jiff-core",
"proc-macro2",
"quote",
"syn 2.0.119",
]
[[package]]
name = "jiff-tzdb"
version = "0.1.8"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "142bd39932ad231f10513df9ab62661fead8719872150b7ad02a2df79f4e141e"
[[package]]
name = "jiff-tzdb-platform"
version = "0.1.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "875a5a69ac2bab1a891711cf5eccbec1ce0341ea805560dcd90b7a2e925132e8"
dependencies = [
"jiff-tzdb",
]
[[package]]
name = "jobserver"
version = "0.1.35"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "1c00acbd29eabad4a2392fa0e921c874934dbbf4194312ad20f04a0ed67a3cb3"
dependencies = [
"getrandom",
"libc",
]
[[package]]
name = "js-sys"
version = "0.3.103"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "53b44bfcdb3f8d5837a46dae1ca9660a837176eee74a28b229bc626816589102"
dependencies = [
"cfg-if",
"futures-util",
"wasm-bindgen",
]
[[package]]
name = "kqueue"
version = "1.2.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "8d763e5b24120b4ddf50de6c92308156765aabfbbccebf401da7cff2d70a41ea"
dependencies = [
"kqueue-sys",
"libc",
]
[[package]]
name = "kqueue-sys"
version = "1.1.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "07293a4e297ac234359b510362495713f75ea345d5307140414f20c69ffeb087"
dependencies = [
"bitflags 2.13.1",
"libc",
]
[[package]]
name = "language-tags"
version = "0.3.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d4345964bb142484797b161f473a503a434de77149dd8c7427788c6e13379388"
[[package]]
name = "libc"
version = "0.2.189"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "3eaf3ede3fee6db1a4c2ee091bf8a8b4dccdc6d17f656fb07896ee72867612f2"
[[package]]
name = "linkify"
version = "0.11.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "92f9ae2f3d31697697311f016320fe984127e636b45cf5eb5c175b7eb103dadb"
dependencies = [
"memchr",
]
[[package]]
name = "linux-raw-sys"
version = "0.12.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "32a66949e030da00e8c7d4434b251670a91556f4144941d37452769c25d58a53"
[[package]]
name = "litemap"
version = "0.8.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "92daf443525c4cce67b150400bc2316076100ce0b3686209eb8cf3c31612e6f0"
[[package]]
name = "local-channel"
version = "0.1.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b6cbc85e69b8df4b8bb8b89ec634e7189099cea8927a276b7384ce5488e53ec8"
dependencies = [
"futures-core",
"futures-sink",
"local-waker",
]
[[package]]
name = "local-waker"
version = "0.1.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "4d873d7c67ce09b42110d801813efbc9364414e356be9935700d368351657487"
[[package]]
name = "lock_api"
version = "0.4.14"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "224399e74b87b5f3557511d98dff8b14089b3dadafcab6bb93eab67d3aace965"
dependencies = [
"scopeguard",
]
[[package]]
name = "log"
version = "0.4.33"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "0ceec5bc11778974d1bcb055b18002eba7f4b3518b6a0081b3af5f21666da9ad"
[[package]]
name = "md5"
version = "0.8.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "7ebb8d8732c6a6df3d8f032a82911cfc747e00efb95cc46e8d0acd5b5b88570c"
[[package]]
name = "memchr"
version = "2.8.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "cf8baf1c55e62ffcace7a9f06f4bd9cd3f0c4beb022d3b367256b91b87513d98"
[[package]]
name = "memmap2"
version = "0.9.11"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d1219ed1b7f229ee7104d281dd01d6802fe28bb6e95d292942c4daacdeb798c0"
dependencies = [
"libc",
]
[[package]]
name = "mime"
version = "0.3.17"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "6877bb514081ee2a7ff5ef9de3281f14a4dd4bceac4c09388074a6b5df8a139a"
[[package]]
name = "mime_guess"
version = "2.0.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f7c44f8e672c00fe5308fa235f821cb4198414e1c77935c1ab6948d3fd78550e"
dependencies = [
"mime",
"unicase",
]
[[package]]
name = "miniz_oxide"
version = "0.8.9"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "1fa76a2c86f704bdb222d66965fb3d63269ce38518b83cb0575fca855ebb6316"
dependencies = [
"adler2",
"simd-adler32",
]
[[package]]
name = "mio"
version = "1.2.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "30d65c71f1ce40ab09135ce117d742b9f8a19ff91a41a8b57ed50bc2de59c427"
dependencies = [
"libc",
"log",
"wasi",
"windows-sys 0.61.2",
]
[[package]]
name = "nonempty"
version = "0.12.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "9737e026353e5cd0736f98eddae28665118eb6f6600902a7f50db585621fecb6"
dependencies = [
"serde",
]
[[package]]
name = "notify"
version = "8.2.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "4d3d07927151ff8575b7087f245456e549fea62edf0ec4e565a5ee50c8402bc3"
dependencies = [
"bitflags 2.13.1",
"fsevent-sys",
"inotify",
"kqueue",
"libc",
"log",
"mio",
"notify-types",
"walkdir",
"windows-sys 0.60.2",
]
[[package]]
name = "notify-types"
version = "2.1.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "42b8cfee0e339a0337359f3c88165702ac6e600dc01c0cc9579a92d62b08477a"
dependencies = [
"bitflags 2.13.1",
]
[[package]]
name = "num-conv"
version = "0.2.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "521739c6d2bac4aa25192232afe6841231376b2b26d4d9fae5ecf8ca5772e441"
[[package]]
name = "num-traits"
version = "0.2.19"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "071dfc062690e90b734c0b2273ce72ad0ffa95f0c74596bc250dcfd960262841"
dependencies = [
"autocfg",
]
[[package]]
name = "once_cell"
version = "1.21.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "9f7c3e4beb33f85d45ae3e3a1792185706c8e16d043238c593331cc7cd313b50"
[[package]]
name = "parking_lot"
version = "0.12.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "93857453250e3077bd71ff98b6a65ea6621a19bb0f559a85248955ac12c45a1a"
dependencies = [
"lock_api",
"parking_lot_core",
]
[[package]]
name = "parking_lot_core"
version = "0.9.12"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "2621685985a2ebf1c516881c026032ac7deafcda1a2c9b7850dc81e3dfcb64c1"
dependencies = [
"cfg-if",
"libc",
"redox_syscall",
"smallvec",
"windows-link",
]
[[package]]
name = "percent-encoding"
version = "2.3.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "9b4f627cb1b25917193a259e49bdad08f671f8d9708acfd5fe0a8c1455d87220"
[[package]]
name = "phf"
version = "0.11.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "1fd6780a80ae0c52cc120a26a1a42c1ae51b247a253e4e06113d23d2c2edd078"
dependencies = [
"phf_shared",
]
[[package]]
name = "phf_shared"
version = "0.11.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "67eabc2ef2a60eb7faa00097bd1ffdb5bd28e62bf39990626a582201b7a754e5"
dependencies = [
"siphasher",
]
[[package]]
name = "pin-project-lite"
version = "0.2.17"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "a89322df9ebe1c1578d689c92318e070967d1042b512afbe49518723f4e6d5cd"
[[package]]
name = "pkg-config"
version = "0.3.33"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "19f132c84eca552bf34cab8ec81f1c1dcc229b811638f9d283dceabe58c5569e"
[[package]]
name = "portable-atomic"
version = "1.14.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "3d20d5497ef88037a52ff98267d066e7f11fcc5e99bbfbd58a42336193aacec3"
[[package]]
name = "portable-atomic-util"
version = "0.2.7"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "c2a106d1259c23fac8e543272398ae0e3c0b8d33c88ed73d0cc71b0f1d902618"
dependencies = [
"portable-atomic",
]
[[package]]
name = "potential_utf"
version = "0.1.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "0103b1cef7ec0cf76490e969665504990193874ea05c85ff9bab8b911d0a0564"
dependencies = [
"zerovec",
]
[[package]]
name = "powerfmt"
version = "0.2.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "439ee305def115ba05938db6eb1644ff94165c5ab5e9420d1c1bcedbba909391"
[[package]]
name = "proc-macro2"
version = "1.0.107"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "985e7ec9bb745e6ce6535b544d84d6cd6f7ad8bd711c398938ae983b91a766d9"
dependencies = [
"unicode-ident",
]
[[package]]
name = "prodash"
version = "31.0.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "962200e2d7d551451297d9fdce85138374019ada198e30ea9ede38034e27604c"
dependencies = [
"bytesize",
"human_format",
"parking_lot",
]
[[package]]
name = "pulldown-cmark"
version = "0.13.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "e9f068eba8e7071c5f9511831b44f32c740d5adf574e990f946ddb53db2f314e"
dependencies = [
"bitflags 2.13.1",
"getopts",
"memchr",
"pulldown-cmark-escape",
"unicase",
]
[[package]]
name = "pulldown-cmark-escape"
version = "0.11.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "007d8adb5ddab6f8e3f491ac63566a7d5002cc7ed73901f72057943fa71ae1ae"
[[package]]
name = "quote"
version = "1.0.47"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "1fbf4db142a473a8d80c26bbf18454ed458bf8d26c8219c331daecfdbd079001"
dependencies = [
"proc-macro2",
]
[[package]]
name = "r-efi"
version = "6.0.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f8dcc9c7d52a811697d2151c701e0d08956f92b0e24136cf4cf27b57a6a0d9bf"
[[package]]
name = "rand"
version = "0.10.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "c7f5fa3a058cd35567ef9bfa5e75732bee0f9e4c55fa90477bef2dfcdbc4be80"
dependencies = [
"chacha20",
"getrandom",
"rand_core",
]
[[package]]
name = "rand_core"
version = "0.10.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "63b8176103e19a2643978565ca18b50549f6101881c443590420e4dc998a3c69"
[[package]]
name = "redox_syscall"
version = "0.5.18"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "ed2bf2547551a7053d6fdfafda3f938979645c44812fbfcda098faae3f1a362d"
dependencies = [
"bitflags 2.13.1",
]
[[package]]
name = "regex"
version = "1.13.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f020237b6c8eed93db2e2cb53c00c60a8e1bc73da7d073199a1180401450218d"
dependencies = [
"aho-corasick",
"memchr",
"regex-automata",
"regex-syntax",
]
[[package]]
name = "regex-automata"
version = "0.4.16"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "8fcfdb36bda0c880c5931cdc7a2bcdc8ba4556847b9d912bca70bc94708711ad"
dependencies = [
"aho-corasick",
"memchr",
"regex-syntax",
]
[[package]]
name = "regex-lite"
version = "0.1.9"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "cab834c73d247e67f4fae452806d17d3c7501756d98c8808d7c9c7aa7d18f973"
[[package]]
name = "regex-syntax"
version = "0.8.11"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d6f6ff9a378485b298a5286656da665ba74413d36db0979633275d2e708145d4"
[[package]]
name = "rust-embed"
version = "8.12.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "e9e7760e252aaba7b09f4be00e36476cf585bdb68a53552ac954cdf504ab4bc9"
dependencies = [
"rust-embed-impl",
"rust-embed-utils",
"walkdir",
]
[[package]]
name = "rust-embed-impl"
version = "8.12.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "3bcfc4d6f53af43755f7a723e4b6b8794fcce052a178dd8c6c1dadc5f5343097"
dependencies = [
"mime_guess",
"proc-macro2",
"quote",
"rust-embed-utils",
"syn 2.0.119",
"walkdir",
]
[[package]]
name = "rust-embed-utils"
version = "8.12.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "42ffa149f6aa81b58a5b3011d01a857c4ed12c7a732d2c51947a4c7c692185f0"
dependencies = [
"sha2",
"walkdir",
]
[[package]]
name = "rustc-hash"
version = "2.1.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "6b1e7f9a428571be2dc5bc0505c13fb6bf936822b894ec87abf8a08a4e51742d"
[[package]]
name = "rustc_version"
version = "0.4.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "cfcb3a22ef46e85b45de6ee7e79d063319ebb6594faafcf1c225ea92ab6e9b92"
dependencies = [
"semver",
]
[[package]]
name = "rustix"
version = "1.1.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b6fe4565b9518b83ef4f91bb47ce29620ca828bd32cb7e408f0062e9930ba190"
dependencies = [
"bitflags 2.13.1",
"errno",
"libc",
"linux-raw-sys",
"windows-sys 0.61.2",
]
[[package]]
name = "rustversion"
version = "1.0.23"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "cf54715a573b99ac80df0bc206da022bcd442c974952c7b9720069370852e21f"
[[package]]
name = "ryu"
version = "1.0.23"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "9774ba4a74de5f7b1c1451ed6cd5285a32eddb5cccb8cc655a4e50009e06477f"
[[package]]
name = "same-file"
version = "1.0.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "93fc1dc3aaa9bfed95e02e6eadabb4baf7e3078b0bd1b4d7b6b0b68378900502"
dependencies = [
"winapi-util",
]
[[package]]
name = "scopeguard"
version = "1.2.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49"
[[package]]
name = "semver"
version = "1.0.28"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "8a7852d02fc848982e0c167ef163aaff9cd91dc640ba85e263cb1ce46fae51cd"
[[package]]
name = "serde"
version = "1.0.229"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "4148590afebada386688f18773da617792bf2ef03ffc1e4cbd2b1d45b023e0ba"
dependencies = [
"serde_core",
"serde_derive",
]
[[package]]
name = "serde_core"
version = "1.0.229"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "67dca2c9c51e58a4791a4b1ed58308b39c64224d349a935ab5039aa360942a48"
dependencies = [
"serde_derive",
]
[[package]]
name = "serde_derive"
version = "1.0.229"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "e7a5d71263a5a7d47b41f6b3f06ba276f10cc18b0931f1799f710578e2309348"
dependencies = [
"proc-macro2",
"quote",
"syn 3.0.2",
]
[[package]]
name = "serde_json"
version = "1.0.151"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "c841b55ecdae098c80dcae9cf767f6f8a0c2cdb3416bbef72181df4d0fe73f14"
dependencies = [
"itoa",
"memchr",
"serde",
"serde_core",
"zmij",
]
[[package]]
name = "serde_urlencoded"
version = "0.7.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d3491c14715ca2294c4d6a88f15e84739788c1d030eed8c110436aafdaa2f3fd"
dependencies = [
"form_urlencoded",
"itoa",
"ryu",
"serde",
]
[[package]]
name = "sha1"
version = "0.10.7"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "a978451301f4db1d02937a4ab3ccce137717b81826e79b7d49ffe3244a13c3b8"
dependencies = [
"cfg-if",
"cpufeatures 0.2.17",
"digest 0.10.7",
]
[[package]]
name = "sha1"
version = "0.11.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "aacc4cc499359472b4abe1bf11d0b12e688af9a805fa5e3016f9a386dc2d0214"
dependencies = [
"cfg-if",
"cpufeatures 0.3.0",
"digest 0.11.3",
]
[[package]]
name = "sha1-checked"
version = "0.10.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "89f599ac0c323ebb1c6082821a54962b839832b03984598375bff3975b804423"
dependencies = [
"digest 0.10.7",
"sha1 0.10.7",
]
[[package]]
name = "sha2"
version = "0.11.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "446ba717509524cb3f22f17ecc096f10f4822d76ab5c0b9822c5f9c284e825f4"
dependencies = [
"cfg-if",
"cpufeatures 0.3.0",
"digest 0.11.3",
]
[[package]]
name = "shell-words"
version = "1.1.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "dc6fe69c597f9c37bfeeeeeb33da3530379845f10be461a66d16d03eca2ded77"
[[package]]
name = "shlex"
version = "2.0.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f8fadd59c855ef2080decdef8ff161eb6661b86933c9d82e5ba29dc602a55aba"
[[package]]
name = "signal-hook"
version = "0.4.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b2a0c28ca5908dbdbcd52e6fdaa00358ab88637f8ab33e1f188dd510eb44b53d"
dependencies = [
"libc",
"signal-hook-registry",
]
[[package]]
name = "signal-hook-registry"
version = "1.4.8"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "c4db69cba1110affc0e9f7bcd48bbf87b3f4fc7c61fc9155afd4c469eb3d6c1b"
dependencies = [
"errno",
"libc",
]
[[package]]
name = "simd-adler32"
version = "0.3.10"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "3a219298ac11a56ea9a6d2120044824d6f01aeb034955e7af7bc16858527deea"
[[package]]
name = "siphasher"
version = "1.0.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "8ee5873ec9cce0195efcb7a4e9507a04cd49aec9c83d0389df45b1ef7ba2e649"
[[package]]
name = "slab"
version = "0.4.12"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "0c790de23124f9ab44544d7ac05d60440adc586479ce501c1d6d7da3cd8c9cf5"
[[package]]
name = "smallvec"
version = "1.15.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "8ed6a63f02c8539c91a8685a86f4099661ba3da017932f6ebbea6de3f0fa7c90"
dependencies = [
"serde",
]
[[package]]
name = "socket2"
version = "0.5.10"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "e22376abed350d73dd1cd119b57ffccad95b4e585a7cda43e286245ce23c0678"
dependencies = [
"libc",
"windows-sys 0.52.0",
]
[[package]]
name = "socket2"
version = "0.6.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "c3d1e2c7f27f8d4cb10542a02c49005dbd6e93095799d6f3be745fae9f8fedd4"
dependencies = [
"libc",
"windows-sys 0.61.2",
]
[[package]]
name = "stable_deref_trait"
version = "1.2.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "6ce2be8dc25455e1f91df71bfa12ad37d7af1092ae736f3a6cd0e37bc7810596"
[[package]]
name = "syn"
version = "2.0.119"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "872831b642d1a07999a962a351ed35b955ea2cfc8f3862091e2a240a84f17297"
dependencies = [
"proc-macro2",
"quote",
"unicode-ident",
]
[[package]]
name = "syn"
version = "3.0.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "a207d6d6a2b7fc470b80443726053f18a2481b7e1eee970597051596567987a3"
dependencies = [
"proc-macro2",
"quote",
"unicode-ident",
]
[[package]]
name = "synstructure"
version = "0.13.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "728a70f3dbaf5bab7f0c4b1ac8d7ae5ea60a4b5549c8a5914361c99147a709d2"
dependencies = [
"proc-macro2",
"quote",
"syn 2.0.119",
]
[[package]]
name = "tar"
version = "0.4.46"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "3f6221d9a6003c78398e3b239969f352578258df48c8eb051caadae0015bc840"
dependencies = [
"filetime",
"libc",
"xattr",
]
[[package]]
name = "tempfile"
version = "3.27.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "32497e9a4c7b38532efcdebeef879707aa9f794296a4f0244f6f69e9bc8574bd"
dependencies = [
"fastrand",
"getrandom",
"once_cell",
"rustix",
"windows-sys 0.61.2",
]
[[package]]
name = "thiserror"
version = "2.0.19"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "09a43598840e33d5b0331f38c5e30d13bb11c11210a4b58f0d9b18a5a5eefcd9"
dependencies = [
"thiserror-impl",
]
[[package]]
name = "thiserror-impl"
version = "2.0.19"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "43cbfe0cf76104d42a574802844187e84a305e531ed54455f11fbde0f10541cd"
dependencies = [
"proc-macro2",
"quote",
"syn 3.0.2",
]
[[package]]
name = "time"
version = "0.3.55"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "cdb87b95ec50ddfa440816d227a17b2ccbdda963a316a727fda0fc4334f7d134"
dependencies = [
"deranged",
"num-conv",
"powerfmt",
"serde_core",
"time-core",
"time-macros",
]
[[package]]
name = "time-core"
version = "0.1.9"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "9e1c906769ad99c88eaa54e728060edef082f8e358ff32030cb7c7d315e81109"
[[package]]
name = "time-macros"
version = "0.2.32"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "7e689342a48d2ea927c87ea50cabf8594854bf940e9310208848d680d668ed85"
dependencies = [
"num-conv",
"time-core",
]
[[package]]
name = "timeago"
version = "0.6.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "46c29b13d230e9cd58513d38701a661fc06e1215398937532a2d938ecca6f219"
dependencies = [
"chrono",
"isolang",
]
[[package]]
name = "tinystr"
version = "0.8.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "c8323304221c2a851516f22236c5722a72eaa19749016521d6dff0824447d96d"
dependencies = [
"displaydoc",
"zerovec",
]
[[package]]
name = "tinyvec"
version = "1.12.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "bb4ebadaa0af04fab11ae01eb5f9fdb5f9c5b875506e210e71c07873528baa7f"
dependencies = [
"tinyvec_macros",
]
[[package]]
name = "tinyvec_macros"
version = "0.1.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20"
[[package]]
name = "tokio"
version = "1.53.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "202caea871b69668250d242070849eb495be178ed697a3e98aebce5bc81a0bed"
dependencies = [
"bytes",
"libc",
"mio",
"parking_lot",
"pin-project-lite",
"signal-hook-registry",
"socket2 0.6.5",
"windows-sys 0.61.2",
]
[[package]]
name = "tokio-util"
version = "0.7.19"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "494815d09bf52b5548659851081238f0ca39ff638363907596da739561c62c52"
dependencies = [
"bytes",
"futures-core",
"futures-sink",
"libc",
"pin-project-lite",
"tokio",
]
[[package]]
name = "tracing"
version = "0.1.44"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "63e71662fa4b2a2c3a26f570f037eb95bb1f85397f3cd8076caed2f026a6d100"
dependencies = [
"log",
"pin-project-lite",
"tracing-attributes",
"tracing-core",
]
[[package]]
name = "tracing-attributes"
version = "0.1.31"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "7490cfa5ec963746568740651ac6781f701c9c5ea257c58e057f3ba8cf69e8da"
dependencies = [
"proc-macro2",
"quote",
"syn 2.0.119",
]
[[package]]
name = "tracing-core"
version = "0.1.36"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "db97caf9d906fbde555dd62fa95ddba9eecfd14cb388e4f491a66d74cd5fb79a"
dependencies = [
"once_cell",
]
[[package]]
name = "typenum"
version = "1.20.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b6f5e870be6c3b371b77fe0ee0bafb859fa4964b4404c27de1d380043c4dda20"
[[package]]
name = "uluru"
version = "3.1.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "7c8a2469e56e6e5095c82ccd3afb98dad95f7af7929aab6d8ba8d6e0f73657da"
dependencies = [
"arrayvec",
]
[[package]]
name = "unicase"
version = "2.9.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "dbc4bc3a9f746d862c45cb89d705aa10f187bb96c76001afab07a0d35ce60142"
[[package]]
name = "unicode-bom"
version = "2.0.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "7eec5d1121208364f6793f7d2e222bf75a915c19557537745b195b253dd64217"
[[package]]
name = "unicode-ident"
version = "1.0.24"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "e6e4313cd5fcd3dad5cafa179702e2b244f760991f45397d14d4ebf38247da75"
[[package]]
name = "unicode-normalization"
version = "0.1.25"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "5fd4f6878c9cb28d874b009da9e8d183b5abc80117c40bbd187a1fde336be6e8"
dependencies = [
"tinyvec",
]
[[package]]
name = "unicode-segmentation"
version = "1.13.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "c6f5d3c3b1bf09027a88a6bc961fc00497d651009560b5463668dc81b0fa87a8"
[[package]]
name = "unicode-width"
version = "0.2.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b4ac048d71ede7ee76d585517add45da530660ef4390e49b098733c6e897f254"
[[package]]
name = "unicode-xid"
version = "0.2.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "ebc1c04c71510c7f702b52b7c350734c9ff1295c464a03335b00bb84fc54f853"
[[package]]
name = "url"
version = "2.5.8"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "ff67a8a4397373c3ef660812acab3268222035010ab8680ec4215f38ba3d0eed"
dependencies = [
"form_urlencoded",
"idna",
"percent-encoding",
"serde",
]
[[package]]
name = "utf8_iter"
version = "1.0.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b6c140620e7ffbb22c2dee59cafe6084a59b5ffc27a8859a5f0d494b5d52b6be"
[[package]]
name = "v_htmlescape"
version = "0.15.8"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "4e8257fbc510f0a46eb602c10215901938b5c2a7d5e70fc11483b1d3c9b5b18c"
dependencies = [
"buf-min",
]
[[package]]
name = "version_check"
version = "0.9.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "0b928f33d975fc6ad9f86c8f283853ad26bdd5b10b7f1542aa2fa15e2289105a"
[[package]]
name = "walkdir"
version = "2.5.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "29790946404f91d9c5d06f9874efddea1dc06c5efe94541a7d6863108e3a5e4b"
dependencies = [
"same-file",
"winapi-util",
]
[[package]]
name = "wasi"
version = "0.11.1+wasi-snapshot-preview1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "ccf3ec651a847eb01de73ccad15eb7d99f80485de043efb2f370cd654f4ea44b"
[[package]]
name = "wasm-bindgen"
version = "0.2.126"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "4b067c0c11094aef6b7a801c1e34a26affafdf3d051dba08456b868789aaf9a4"
dependencies = [
"cfg-if",
"once_cell",
"rustversion",
"wasm-bindgen-macro",
"wasm-bindgen-shared",
]
[[package]]
name = "wasm-bindgen-macro"
version = "0.2.126"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "167ce5e579f6bcf889c4f7175a8a5a585de84e8ff93976ce393efa5f2837aab1"
dependencies = [
"quote",
"wasm-bindgen-macro-support",
]
[[package]]
name = "wasm-bindgen-macro-support"
version = "0.2.126"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f3997c7839262f4ef12cf90b818d6340c18e80f263f1a94bf157d0ec4420380e"
dependencies = [
"bumpalo",
"proc-macro2",
"quote",
"syn 2.0.119",
"wasm-bindgen-shared",
]
[[package]]
name = "wasm-bindgen-shared"
version = "0.2.126"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "dc1b4cb0cc549fcf58d7dfc081778139b3d283a081644e833e84682ad71cea24"
dependencies = [
"unicode-ident",
]
[[package]]
name = "winapi"
version = "0.3.9"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "5c839a674fcd7a98952e593242ea400abe93992746761e38641405d28b00f419"
dependencies = [
"winapi-i686-pc-windows-gnu",
"winapi-x86_64-pc-windows-gnu",
]
[[package]]
name = "winapi-i686-pc-windows-gnu"
version = "0.4.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6"
[[package]]
name = "winapi-util"
version = "0.1.11"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "c2a7b1c03c876122aa43f3020e6c3c3ee5c05081c9a00739faf7503aeba10d22"
dependencies = [
"windows-sys 0.61.2",
]
[[package]]
name = "winapi-x86_64-pc-windows-gnu"
version = "0.4.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f"
[[package]]
name = "windows-core"
version = "0.62.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b8e83a14d34d0623b51dce9581199302a221863196a1dde71a7663a4c2be9deb"
dependencies = [
"windows-implement",
"windows-interface",
"windows-link",
"windows-result",
"windows-strings",
]
[[package]]
name = "windows-implement"
version = "0.60.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "053e2e040ab57b9dc951b72c264860db7eb3b0200ba345b4e4c3b14f67855ddf"
dependencies = [
"proc-macro2",
"quote",
"syn 2.0.119",
]
[[package]]
name = "windows-interface"
version = "0.59.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "3f316c4a2570ba26bbec722032c4099d8c8bc095efccdc15688708623367e358"
dependencies = [
"proc-macro2",
"quote",
"syn 2.0.119",
]
[[package]]
name = "windows-link"
version = "0.2.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f0805222e57f7521d6a62e36fa9163bc891acd422f971defe97d64e70d0a4fe5"
[[package]]
name = "windows-result"
version = "0.4.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "7781fa89eaf60850ac3d2da7af8e5242a5ea78d1a11c49bf2910bb5a73853eb5"
dependencies = [
"windows-link",
]
[[package]]
name = "windows-strings"
version = "0.5.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "7837d08f69c77cf6b07689544538e017c1bfcf57e34b4c0ff58e6c2cd3b37091"
dependencies = [
"windows-link",
]
[[package]]
name = "windows-sys"
version = "0.52.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "282be5f36a8ce781fad8c8ae18fa3f9beff57ec1b52cb3de0789201425d9a33d"
dependencies = [
"windows-targets 0.52.6",
]
[[package]]
name = "windows-sys"
version = "0.60.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f2f500e4d28234f72040990ec9d39e3a6b950f9f22d3dba18416c35882612bcb"
dependencies = [
"windows-targets 0.53.5",
]
[[package]]
name = "windows-sys"
version = "0.61.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "ae137229bcbd6cdf0f7b80a31df61766145077ddf49416a728b02cb3921ff3fc"
dependencies = [
"windows-link",
]
[[package]]
name = "windows-targets"
version = "0.52.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "9b724f72796e036ab90c1021d4780d4d3d648aca59e491e6b98e725b84e99973"
dependencies = [
"windows_aarch64_gnullvm 0.52.6",
"windows_aarch64_msvc 0.52.6",
"windows_i686_gnu 0.52.6",
"windows_i686_gnullvm 0.52.6",
"windows_i686_msvc 0.52.6",
"windows_x86_64_gnu 0.52.6",
"windows_x86_64_gnullvm 0.52.6",
"windows_x86_64_msvc 0.52.6",
]
[[package]]
name = "windows-targets"
version = "0.53.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "4945f9f551b88e0d65f3db0bc25c33b8acea4d9e41163edf90dcd0b19f9069f3"
dependencies = [
"windows-link",
"windows_aarch64_gnullvm 0.53.1",
"windows_aarch64_msvc 0.53.1",
"windows_i686_gnu 0.53.1",
"windows_i686_gnullvm 0.53.1",
"windows_i686_msvc 0.53.1",
"windows_x86_64_gnu 0.53.1",
"windows_x86_64_gnullvm 0.53.1",
"windows_x86_64_msvc 0.53.1",
]
[[package]]
name = "windows_aarch64_gnullvm"
version = "0.52.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "32a4622180e7a0ec044bb555404c800bc9fd9ec262ec147edd5989ccd0c02cd3"
[[package]]
name = "windows_aarch64_gnullvm"
version = "0.53.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "a9d8416fa8b42f5c947f8482c43e7d89e73a173cead56d044f6a56104a6d1b53"
[[package]]
name = "windows_aarch64_msvc"
version = "0.52.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "09ec2a7bb152e2252b53fa7803150007879548bc709c039df7627cabbd05d469"
[[package]]
name = "windows_aarch64_msvc"
version = "0.53.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b9d782e804c2f632e395708e99a94275910eb9100b2114651e04744e9b125006"
[[package]]
name = "windows_i686_gnu"
version = "0.52.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "8e9b5ad5ab802e97eb8e295ac6720e509ee4c243f69d781394014ebfe8bbfa0b"
[[package]]
name = "windows_i686_gnu"
version = "0.53.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "960e6da069d81e09becb0ca57a65220ddff016ff2d6af6a223cf372a506593a3"
[[package]]
name = "windows_i686_gnullvm"
version = "0.52.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "0eee52d38c090b3caa76c563b86c3a4bd71ef1a819287c19d586d7334ae8ed66"
[[package]]
name = "windows_i686_gnullvm"
version = "0.53.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "fa7359d10048f68ab8b09fa71c3daccfb0e9b559aed648a8f95469c27057180c"
[[package]]
name = "windows_i686_msvc"
version = "0.52.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "240948bc05c5e7c6dabba28bf89d89ffce3e303022809e73deaefe4f6ec56c66"
[[package]]
name = "windows_i686_msvc"
version = "0.53.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "1e7ac75179f18232fe9c285163565a57ef8d3c89254a30685b57d83a38d326c2"
[[package]]
name = "windows_x86_64_gnu"
version = "0.52.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "147a5c80aabfbf0c7d901cb5895d1de30ef2907eb21fbbab29ca94c5b08b1a78"
[[package]]
name = "windows_x86_64_gnu"
version = "0.53.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "9c3842cdd74a865a8066ab39c8a7a473c0778a3f29370b5fd6b4b9aa7df4a499"
[[package]]
name = "windows_x86_64_gnullvm"
version = "0.52.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "24d5b23dc417412679681396f2b49f3de8c1473deb516bd34410872eff51ed0d"
[[package]]
name = "windows_x86_64_gnullvm"
version = "0.53.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "0ffa179e2d07eee8ad8f57493436566c7cc30ac536a3379fdf008f47f6bb7ae1"
[[package]]
name = "windows_x86_64_msvc"
version = "0.52.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "589f6da84c646204747d1270a2a5661ea66ed1cced2631d546fdfb155959f9ec"
[[package]]
name = "windows_x86_64_msvc"
version = "0.53.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d6bbff5f0aada427a1e5a6da5f1f98158182f26556f345ac9e04d36d0ebed650"
[[package]]
name = "winnow"
version = "1.0.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "23b97319f7b8343df12cc98938e5c3eb436064524c8d2b4e30a1d3a36eecdf81"
dependencies = [
"memchr",
]
[[package]]
name = "writeable"
version = "0.6.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "1ffae5123b2d3fc086436f8834ae3ab053a283cfac8fe0a0b8eaae044768a4c4"
[[package]]
name = "xattr"
version = "1.6.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "32e45ad4206f6d2479085147f02bc2ef834ac85886624a23575ae137c8aa8156"
dependencies = [
"libc",
"rustix",
]
[[package]]
name = "yoke"
version = "0.8.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "709fe23a0424b6a435d82152b1bd3fdfb0833487d5fa90d05d42762a9891fef5"
dependencies = [
"stable_deref_trait",
"yoke-derive",
"zerofrom",
]
[[package]]
name = "yoke-derive"
version = "0.8.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "de844c262c8848816172cef550288e7dc6c7b7814b4ee56b3e1553f275f1858e"
dependencies = [
"proc-macro2",
"quote",
"syn 2.0.119",
"synstructure",
]
[[package]]
name = "zerofrom"
version = "0.1.8"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "0ec05a11813ea801ff6d75110ad09cd0824ddba17dfe17128ea0d5f68e6c5272"
dependencies = [
"zerofrom-derive",
]
[[package]]
name = "zerofrom-derive"
version = "0.1.7"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "11532158c46691caf0f2593ea8358fed6bbf68a0315e80aae9bd41fbade684a1"
dependencies = [
"proc-macro2",
"quote",
"syn 2.0.119",
"synstructure",
]
[[package]]
name = "zerotrie"
version = "0.2.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "0f9152d31db0792fa83f70fb2f83148effb5c1f5b8c7686c3459e361d9bc20bf"
dependencies = [
"displaydoc",
"yoke",
"zerofrom",
]
[[package]]
name = "zerovec"
version = "0.11.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "90f911cbc359ab6af17377d242225f4d75119aec87ea711a880987b18cd7b239"
dependencies = [
"yoke",
"zerofrom",
"zerovec-derive",
]
[[package]]
name = "zerovec-derive"
version = "0.11.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "625dc425cab0dca6dc3c3319506e6593dcb08a9f387ea3b284dbd52a92c40555"
dependencies = [
"proc-macro2",
"quote",
"syn 2.0.119",
]
[[package]]
name = "zlib-rs"
version = "0.6.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b142a20ec14a91d5bc708c1dc21b080c550113d8aa77afa29635673a65dd02c5"
[[package]]
name = "zmij"
version = "1.0.23"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "29666d0abbfad1e3dc4dcf6144730dd3a3ab225bbbdac83319345b1b44ccfc1b"
[[package]]
name = "zstd"
version = "0.13.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "e91ee311a569c327171651566e07972200e76fcfe2242a4fa446149a3881c08a"
dependencies = [
"zstd-safe",
]
[[package]]
name = "zstd-safe"
version = "7.2.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "8f49c4d5f0abb602a93fb8736af2a4f4dd9512e36f7f570d66e65ff867ed3b9d"
dependencies = [
"zstd-sys",
]
[[package]]
name = "zstd-sys"
version = "2.0.16+zstd.1.5.7"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "91e19ebc2adc8f83e43039e79776e3fda8ca919132d68a1fed6a5faca2683748"
dependencies = [
"cc",
"pkg-config",
]
@@ -1,0 +1,31 @@
[package]
name = "git-rs"
version = "0.1.0"
edition = "2024"
[dependencies]
actix-web = "4.14.0"
anyhow = "1.0.104"
askama = "0.16.0"
bytes = "1.12.1"
chrono = "0.4.45"
clap = { version = "4.6.4", default-features = false, features = ["derive", "usage", "help", "std", "cargo", "env"] }
flate2 = "1.1.9"
gix = { version = "0.86.0", features = ["serde", "tracing", "parallel", "blob-diff", "revision"] }
linkify = "0.11.0"
md5 = "0.8.1"
mime_guess = "2.0.5"
notify = "8.2.0"
pulldown-cmark = "0.13.4"
rust-embed = "8.12.0"
serde = { version = "1.0.229", features = ["derive"] }
serde_json = "1.0.151"
tar = "0.4.46"
thiserror = "2.0.19"
time = "0.3.55"
timeago = "0.6.1"
tokio = "1.53.1"
v_htmlescape = { version = "0.15.8", default-features = false, features = ["bytes-buf"] }
[profile.dev.package.askama_derive]
opt-level = 3
@@ -1,0 +1,674 @@
GNU GENERAL PUBLIC LICENSE
Version 3, 29 June 2007
Copyright (C) 2007 Free Software Foundation, Inc. <https://fsf.org/>
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
Preamble
The GNU General Public License is a free, copyleft license for
software and other kinds of works.
The licenses for most software and other practical works are designed
to take away your freedom to share and change the works. By contrast,
the GNU General Public License is intended to guarantee your freedom to
share and change all versions of a program--to make sure it remains free
software for all its users. We, the Free Software Foundation, use the
GNU General Public License for most of our software; it applies also to
any other work released this way by its authors. You can apply it to
your programs, too.
When we speak of free software, we are referring to freedom, not
price. Our General Public Licenses are designed to make sure that you
have the freedom to distribute copies of free software (and charge for
them if you wish), that you receive source code or can get it if you
want it, that you can change the software or use pieces of it in new
free programs, and that you know you can do these things.
To protect your rights, we need to prevent others from denying you
these rights or asking you to surrender the rights. Therefore, you have
certain responsibilities if you distribute copies of the software, or if
you modify it: responsibilities to respect the freedom of others.
For example, if you distribute copies of such a program, whether
gratis or for a fee, you must pass on to the recipients the same
freedoms that you received. You must make sure that they, too, receive
or can get the source code. And you must show them these terms so they
know their rights.
Developers that use the GNU GPL protect your rights with two steps:
(1) assert copyright on the software, and (2) offer you this License
giving you legal permission to copy, distribute and/or modify it.
For the developers' and authors' protection, the GPL clearly explains
that there is no warranty for this free software. For both users' and
authors' sake, the GPL requires that modified versions be marked as
changed, so that their problems will not be attributed erroneously to
authors of previous versions.
Some devices are designed to deny users access to install or run
modified versions of the software inside them, although the manufacturer
can do so. This is fundamentally incompatible with the aim of
protecting users' freedom to change the software. The systematic
pattern of such abuse occurs in the area of products for individuals to
use, which is precisely where it is most unacceptable. Therefore, we
have designed this version of the GPL to prohibit the practice for those
products. If such problems arise substantially in other domains, we
stand ready to extend this provision to those domains in future versions
of the GPL, as needed to protect the freedom of users.
Finally, every program is threatened constantly by software patents.
States should not allow patents to restrict development and use of
software on general-purpose computers, but in those that do, we wish to
avoid the special danger that patents applied to a free program could
make it effectively proprietary. To prevent this, the GPL assures that
patents cannot be used to render the program non-free.
The precise terms and conditions for copying, distribution and
modification follow.
TERMS AND CONDITIONS
0. Definitions.
"This License" refers to version 3 of the GNU General Public License.
"Copyright" also means copyright-like laws that apply to other kinds of
works, such as semiconductor masks.
"The Program" refers to any copyrightable work licensed under this
License. Each licensee is addressed as "you". "Licensees" and
"recipients" may be individuals or organizations.
To "modify" a work means to copy from or adapt all or part of the work
in a fashion requiring copyright permission, other than the making of an
exact copy. The resulting work is called a "modified version" of the
earlier work or a work "based on" the earlier work.
A "covered work" means either the unmodified Program or a work based
on the Program.
To "propagate" a work means to do anything with it that, without
permission, would make you directly or secondarily liable for
infringement under applicable copyright law, except executing it on a
computer or modifying a private copy. Propagation includes copying,
distribution (with or without modification), making available to the
public, and in some countries other activities as well.
To "convey" a work means any kind of propagation that enables other
parties to make or receive copies. Mere interaction with a user through
a computer network, with no transfer of a copy, is not conveying.
An interactive user interface displays "Appropriate Legal Notices"
to the extent that it includes a convenient and prominently visible
feature that (1) displays an appropriate copyright notice, and (2)
tells the user that there is no warranty for the work (except to the
extent that warranties are provided), that licensees may convey the
work under this License, and how to view a copy of this License. If
the interface presents a list of user commands or options, such as a
menu, a prominent item in the list meets this criterion.
1. Source Code.
The "source code" for a work means the preferred form of the work
for making modifications to it. "Object code" means any non-source
form of a work.
A "Standard Interface" means an interface that either is an official
standard defined by a recognized standards body, or, in the case of
interfaces specified for a particular programming language, one that
is widely used among developers working in that language.
The "System Libraries" of an executable work include anything, other
than the work as a whole, that (a) is included in the normal form of
packaging a Major Component, but which is not part of that Major
Component, and (b) serves only to enable use of the work with that
Major Component, or to implement a Standard Interface for which an
implementation is available to the public in source code form. A
"Major Component", in this context, means a major essential component
(kernel, window system, and so on) of the specific operating system
(if any) on which the executable work runs, or a compiler used to
produce the work, or an object code interpreter used to run it.
The "Corresponding Source" for a work in object code form means all
the source code needed to generate, install, and (for an executable
work) run the object code and to modify the work, including scripts to
control those activities. However, it does not include the work's
System Libraries, or general-purpose tools or generally available free
programs which are used unmodified in performing those activities but
which are not part of the work. For example, Corresponding Source
includes interface definition files associated with source files for
the work, and the source code for shared libraries and dynamically
linked subprograms that the work is specifically designed to require,
such as by intimate data communication or control flow between those
subprograms and other parts of the work.
The Corresponding Source need not include anything that users
can regenerate automatically from other parts of the Corresponding
Source.
The Corresponding Source for a work in source code form is that
same work.
2. Basic Permissions.
All rights granted under this License are granted for the term of
copyright on the Program, and are irrevocable provided the stated
conditions are met. This License explicitly affirms your unlimited
permission to run the unmodified Program. The output from running a
covered work is covered by this License only if the output, given its
content, constitutes a covered work. This License acknowledges your
rights of fair use or other equivalent, as provided by copyright law.
You may make, run and propagate covered works that you do not
convey, without conditions so long as your license otherwise remains
in force. You may convey covered works to others for the sole purpose
of having them make modifications exclusively for you, or provide you
with facilities for running those works, provided that you comply with
the terms of this License in conveying all material for which you do
not control copyright. Those thus making or running the covered works
for you must do so exclusively on your behalf, under your direction
and control, on terms that prohibit them from making any copies of
your copyrighted material outside their relationship with you.
Conveying under any other circumstances is permitted solely under
the conditions stated below. Sublicensing is not allowed; section 10
makes it unnecessary.
3. Protecting Users' Legal Rights From Anti-Circumvention Law.
No covered work shall be deemed part of an effective technological
measure under any applicable law fulfilling obligations under article
11 of the WIPO copyright treaty adopted on 20 December 1996, or
similar laws prohibiting or restricting circumvention of such
measures.
When you convey a covered work, you waive any legal power to forbid
circumvention of technological measures to the extent such circumvention
is effected by exercising rights under this License with respect to
the covered work, and you disclaim any intention to limit operation or
modification of the work as a means of enforcing, against the work's
users, your or third parties' legal rights to forbid circumvention of
technological measures.
4. Conveying Verbatim Copies.
You may convey verbatim copies of the Program's source code as you
receive it, in any medium, provided that you conspicuously and
appropriately publish on each copy an appropriate copyright notice;
keep intact all notices stating that this License and any
non-permissive terms added in accord with section 7 apply to the code;
keep intact all notices of the absence of any warranty; and give all
recipients a copy of this License along with the Program.
You may charge any price or no price for each copy that you convey,
and you may offer support or warranty protection for a fee.
5. Conveying Modified Source Versions.
You may convey a work based on the Program, or the modifications to
produce it from the Program, in the form of source code under the
terms of section 4, provided that you also meet all of these conditions:
a) The work must carry prominent notices stating that you modified
it, and giving a relevant date.
b) The work must carry prominent notices stating that it is
released under this License and any conditions added under section
7. This requirement modifies the requirement in section 4 to
"keep intact all notices".
c) You must license the entire work, as a whole, under this
License to anyone who comes into possession of a copy. This
License will therefore apply, along with any applicable section 7
additional terms, to the whole of the work, and all its parts,
regardless of how they are packaged. This License gives no
permission to license the work in any other way, but it does not
invalidate such permission if you have separately received it.
d) If the work has interactive user interfaces, each must display
Appropriate Legal Notices; however, if the Program has interactive
interfaces that do not display Appropriate Legal Notices, your
work need not make them do so.
A compilation of a covered work with other separate and independent
works, which are not by their nature extensions of the covered work,
and which are not combined with it such as to form a larger program,
in or on a volume of a storage or distribution medium, is called an
"aggregate" if the compilation and its resulting copyright are not
used to limit the access or legal rights of the compilation's users
beyond what the individual works permit. Inclusion of a covered work
in an aggregate does not cause this License to apply to the other
parts of the aggregate.
6. Conveying Non-Source Forms.
You may convey a covered work in object code form under the terms
of sections 4 and 5, provided that you also convey the
machine-readable Corresponding Source under the terms of this License,
in one of these ways:
a) Convey the object code in, or embodied in, a physical product
(including a physical distribution medium), accompanied by the
Corresponding Source fixed on a durable physical medium
customarily used for software interchange.
b) Convey the object code in, or embodied in, a physical product
(including a physical distribution medium), accompanied by a
written offer, valid for at least three years and valid for as
long as you offer spare parts or customer support for that product
model, to give anyone who possesses the object code either (1) a
copy of the Corresponding Source for all the software in the
product that is covered by this License, on a durable physical
medium customarily used for software interchange, for a price no
more than your reasonable cost of physically performing this
conveying of source, or (2) access to copy the
Corresponding Source from a network server at no charge.
c) Convey individual copies of the object code with a copy of the
written offer to provide the Corresponding Source. This
alternative is allowed only occasionally and noncommercially, and
only if you received the object code with such an offer, in accord
with subsection 6b.
d) Convey the object code by offering access from a designated
place (gratis or for a charge), and offer equivalent access to the
Corresponding Source in the same way through the same place at no
further charge. You need not require recipients to copy the
Corresponding Source along with the object code. If the place to
copy the object code is a network server, the Corresponding Source
may be on a different server (operated by you or a third party)
that supports equivalent copying facilities, provided you maintain
clear directions next to the object code saying where to find the
Corresponding Source. Regardless of what server hosts the
Corresponding Source, you remain obligated to ensure that it is
available for as long as needed to satisfy these requirements.
e) Convey the object code using peer-to-peer transmission, provided
you inform other peers where the object code and Corresponding
Source of the work are being offered to the general public at no
charge under subsection 6d.
A separable portion of the object code, whose source code is excluded
from the Corresponding Source as a System Library, need not be
included in conveying the object code work.
A "User Product" is either (1) a "consumer product", which means any
tangible personal property which is normally used for personal, family,
or household purposes, or (2) anything designed or sold for incorporation
into a dwelling. In determining whether a product is a consumer product,
doubtful cases shall be resolved in favor of coverage. For a particular
product received by a particular user, "normally used" refers to a
typical or common use of that class of product, regardless of the status
of the particular user or of the way in which the particular user
actually uses, or expects or is expected to use, the product. A product
is a consumer product regardless of whether the product has substantial
commercial, industrial or non-consumer uses, unless such uses represent
the only significant mode of use of the product.
"Installation Information" for a User Product means any methods,
procedures, authorization keys, or other information required to install
and execute modified versions of a covered work in that User Product from
a modified version of its Corresponding Source. The information must
suffice to ensure that the continued functioning of the modified object
code is in no case prevented or interfered with solely because
modification has been made.
If you convey an object code work under this section in, or with, or
specifically for use in, a User Product, and the conveying occurs as
part of a transaction in which the right of possession and use of the
User Product is transferred to the recipient in perpetuity or for a
fixed term (regardless of how the transaction is characterized), the
Corresponding Source conveyed under this section must be accompanied
by the Installation Information. But this requirement does not apply
if neither you nor any third party retains the ability to install
modified object code on the User Product (for example, the work has
been installed in ROM).
The requirement to provide Installation Information does not include a
requirement to continue to provide support service, warranty, or updates
for a work that has been modified or installed by the recipient, or for
the User Product in which it has been modified or installed. Access to a
network may be denied when the modification itself materially and
adversely affects the operation of the network or violates the rules and
protocols for communication across the network.
Corresponding Source conveyed, and Installation Information provided,
in accord with this section must be in a format that is publicly
documented (and with an implementation available to the public in
source code form), and must require no special password or key for
unpacking, reading or copying.
7. Additional Terms.
"Additional permissions" are terms that supplement the terms of this
License by making exceptions from one or more of its conditions.
Additional permissions that are applicable to the entire Program shall
be treated as though they were included in this License, to the extent
that they are valid under applicable law. If additional permissions
apply only to part of the Program, that part may be used separately
under those permissions, but the entire Program remains governed by
this License without regard to the additional permissions.
When you convey a copy of a covered work, you may at your option
remove any additional permissions from that copy, or from any part of
it. (Additional permissions may be written to require their own
removal in certain cases when you modify the work.) You may place
additional permissions on material, added by you to a covered work,
for which you have or can give appropriate copyright permission.
Notwithstanding any other provision of this License, for material you
add to a covered work, you may (if authorized by the copyright holders of
that material) supplement the terms of this License with terms:
a) Disclaiming warranty or limiting liability differently from the
terms of sections 15 and 16 of this License; or
b) Requiring preservation of specified reasonable legal notices or
author attributions in that material or in the Appropriate Legal
Notices displayed by works containing it; or
c) Prohibiting misrepresentation of the origin of that material, or
requiring that modified versions of such material be marked in
reasonable ways as different from the original version; or
d) Limiting the use for publicity purposes of names of licensors or
authors of the material; or
e) Declining to grant rights under trademark law for use of some
trade names, trademarks, or service marks; or
f) Requiring indemnification of licensors and authors of that
material by anyone who conveys the material (or modified versions of
it) with contractual assumptions of liability to the recipient, for
any liability that these contractual assumptions directly impose on
those licensors and authors.
All other non-permissive additional terms are considered "further
restrictions" within the meaning of section 10. If the Program as you
received it, or any part of it, contains a notice stating that it is
governed by this License along with a term that is a further
restriction, you may remove that term. If a license document contains
a further restriction but permits relicensing or conveying under this
License, you may add to a covered work material governed by the terms
of that license document, provided that the further restriction does
not survive such relicensing or conveying.
If you add terms to a covered work in accord with this section, you
must place, in the relevant source files, a statement of the
additional terms that apply to those files, or a notice indicating
where to find the applicable terms.
Additional terms, permissive or non-permissive, may be stated in the
form of a separately written license, or stated as exceptions;
the above requirements apply either way.
8. Termination.
You may not propagate or modify a covered work except as expressly
provided under this License. Any attempt otherwise to propagate or
modify it is void, and will automatically terminate your rights under
this License (including any patent licenses granted under the third
paragraph of section 11).
However, if you cease all violation of this License, then your
license from a particular copyright holder is reinstated (a)
provisionally, unless and until the copyright holder explicitly and
finally terminates your license, and (b) permanently, if the copyright
holder fails to notify you of the violation by some reasonable means
prior to 60 days after the cessation.
Moreover, your license from a particular copyright holder is
reinstated permanently if the copyright holder notifies you of the
violation by some reasonable means, this is the first time you have
received notice of violation of this License (for any work) from that
copyright holder, and you cure the violation prior to 30 days after
your receipt of the notice.
Termination of your rights under this section does not terminate the
licenses of parties who have received copies or rights from you under
this License. If your rights have been terminated and not permanently
reinstated, you do not qualify to receive new licenses for the same
material under section 10.
9. Acceptance Not Required for Having Copies.
You are not required to accept this License in order to receive or
run a copy of the Program. Ancillary propagation of a covered work
occurring solely as a consequence of using peer-to-peer transmission
to receive a copy likewise does not require acceptance. However,
nothing other than this License grants you permission to propagate or
modify any covered work. These actions infringe copyright if you do
not accept this License. Therefore, by modifying or propagating a
covered work, you indicate your acceptance of this License to do so.
10. Automatic Licensing of Downstream Recipients.
Each time you convey a covered work, the recipient automatically
receives a license from the original licensors, to run, modify and
propagate that work, subject to this License. You are not responsible
for enforcing compliance by third parties with this License.
An "entity transaction" is a transaction transferring control of an
organization, or substantially all assets of one, or subdividing an
organization, or merging organizations. If propagation of a covered
work results from an entity transaction, each party to that
transaction who receives a copy of the work also receives whatever
licenses to the work the party's predecessor in interest had or could
give under the previous paragraph, plus a right to possession of the
Corresponding Source of the work from the predecessor in interest, if
the predecessor has it or can get it with reasonable efforts.
You may not impose any further restrictions on the exercise of the
rights granted or affirmed under this License. For example, you may
not impose a license fee, royalty, or other charge for exercise of
rights granted under this License, and you may not initiate litigation
(including a cross-claim or counterclaim in a lawsuit) alleging that
any patent claim is infringed by making, using, selling, offering for
sale, or importing the Program or any portion of it.
11. Patents.
A "contributor" is a copyright holder who authorizes use under this
License of the Program or a work on which the Program is based. The
work thus licensed is called the contributor's "contributor version".
A contributor's "essential patent claims" are all patent claims
owned or controlled by the contributor, whether already acquired or
hereafter acquired, that would be infringed by some manner, permitted
by this License, of making, using, or selling its contributor version,
but do not include claims that would be infringed only as a
consequence of further modification of the contributor version. For
purposes of this definition, "control" includes the right to grant
patent sublicenses in a manner consistent with the requirements of
this License.
Each contributor grants you a non-exclusive, worldwide, royalty-free
patent license under the contributor's essential patent claims, to
make, use, sell, offer for sale, import and otherwise run, modify and
propagate the contents of its contributor version.
In the following three paragraphs, a "patent license" is any express
agreement or commitment, however denominated, not to enforce a patent
(such as an express permission to practice a patent or covenant not to
sue for patent infringement). To "grant" such a patent license to a
party means to make such an agreement or commitment not to enforce a
patent against the party.
If you convey a covered work, knowingly relying on a patent license,
and the Corresponding Source of the work is not available for anyone
to copy, free of charge and under the terms of this License, through a
publicly available network server or other readily accessible means,
then you must either (1) cause the Corresponding Source to be so
available, or (2) arrange to deprive yourself of the benefit of the
patent license for this particular work, or (3) arrange, in a manner
consistent with the requirements of this License, to extend the patent
license to downstream recipients. "Knowingly relying" means you have
actual knowledge that, but for the patent license, your conveying the
covered work in a country, or your recipient's use of the covered work
in a country, would infringe one or more identifiable patents in that
country that you have reason to believe are valid.
If, pursuant to or in connection with a single transaction or
arrangement, you convey, or propagate by procuring conveyance of, a
covered work, and grant a patent license to some of the parties
receiving the covered work authorizing them to use, propagate, modify
or convey a specific copy of the covered work, then the patent license
you grant is automatically extended to all recipients of the covered
work and works based on it.
A patent license is "discriminatory" if it does not include within
the scope of its coverage, prohibits the exercise of, or is
conditioned on the non-exercise of one or more of the rights that are
specifically granted under this License. You may not convey a covered
work if you are a party to an arrangement with a third party that is
in the business of distributing software, under which you make payment
to the third party based on the extent of your activity of conveying
the work, and under which the third party grants, to any of the
parties who would receive the covered work from you, a discriminatory
patent license (a) in connection with copies of the covered work
conveyed by you (or copies made from those copies), or (b) primarily
for and in connection with specific products or compilations that
contain the covered work, unless you entered into that arrangement,
or that patent license was granted, prior to 28 March 2007.
Nothing in this License shall be construed as excluding or limiting
any implied license or other defenses to infringement that may
otherwise be available to you under applicable patent law.
12. No Surrender of Others' Freedom.
If conditions are imposed on you (whether by court order, agreement or
otherwise) that contradict the conditions of this License, they do not
excuse you from the conditions of this License. If you cannot convey a
covered work so as to satisfy simultaneously your obligations under this
License and any other pertinent obligations, then as a consequence you may
not convey it at all. For example, if you agree to terms that obligate you
to collect a royalty for further conveying from those to whom you convey
the Program, the only way you could satisfy both those terms and this
License would be to refrain entirely from conveying the Program.
13. Use with the GNU Affero General Public License.
Notwithstanding any other provision of this License, you have
permission to link or combine any covered work with a work licensed
under version 3 of the GNU Affero General Public License into a single
combined work, and to convey the resulting work. The terms of this
License will continue to apply to the part which is the covered work,
but the special requirements of the GNU Affero General Public License,
section 13, concerning interaction through a network will apply to the
combination as such.
14. Revised Versions of this License.
The Free Software Foundation may publish revised and/or new versions of
the GNU General Public License from time to time. Such new versions will
be similar in spirit to the present version, but may differ in detail to
address new problems or concerns.
Each version is given a distinguishing version number. If the
Program specifies that a certain numbered version of the GNU General
Public License "or any later version" applies to it, you have the
option of following the terms and conditions either of that numbered
version or of any later version published by the Free Software
Foundation. If the Program does not specify a version number of the
GNU General Public License, you may choose any version ever published
by the Free Software Foundation.
If the Program specifies that a proxy can decide which future
versions of the GNU General Public License can be used, that proxy's
public statement of acceptance of a version permanently authorizes you
to choose that version for the Program.
Later license versions may give you additional or different
permissions. However, no additional obligations are imposed on any
author or copyright holder as a result of your choosing to follow a
later version.
15. Disclaimer of Warranty.
THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
16. Limitation of Liability.
IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
SUCH DAMAGES.
17. Interpretation of Sections 15 and 16.
If the disclaimer of warranty and limitation of liability provided
above cannot be given local legal effect according to their terms,
reviewing courts shall apply local law that most closely approximates
an absolute waiver of all civil liability in connection with the
Program, unless a warranty or assumption of liability accompanies a
copy of the Program in return for a fee.
END OF TERMS AND CONDITIONS
How to Apply These Terms to Your New Programs
If you develop a new program, and you want it to be of the greatest
possible use to the public, the best way to achieve this is to make it
free software which everyone can redistribute and change under these terms.
To do so, attach the following notices to the program. It is safest
to attach them to the start of each source file to most effectively
state the exclusion of warranty; and each file should have at least
the "copyright" line and a pointer to where the full notice is found.
<one line to give the program's name and a brief idea of what it does.>
Copyright (C) <year> <name of author>
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>.
Also add information on how to contact you by electronic and paper mail.
If the program does terminal interaction, make it output a short
notice like this when it starts in an interactive mode:
<program> Copyright (C) <year> <name of author>
This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
This is free software, and you are welcome to redistribute it
under certain conditions; type `show c' for details.
The hypothetical commands `show w' and `show c' should show the appropriate
parts of the General Public License. Of course, your program's commands
might be different; for a GUI interface, you would use an "about box".
You should also get your employer (if you work as a programmer) or school,
if any, to sign a "copyright disclaimer" for the program, if necessary.
For more information on this, and how to apply and follow the GNU GPL, see
<https://www.gnu.org/licenses/>.
The GNU General Public License does not permit incorporating your program
into proprietary programs. If your program is a subroutine library, you
may consider it more useful to permit linking proprietary applications with
the library. If this is what you want to do, use the GNU Lesser General
Public License instead of this License. But first, please read
<https://www.gnu.org/licenses/why-not-lgpl.html>.
@@ -1,0 +1,13 @@
<div align="center">
<h1> git-rs 🦀 </h1>
<strong>A web interface fot git built in Rust.</strong>
<br>
<br>
<img src="https://img.shields.io/badge/license-GPL--3-blue?style=for-the-badge" alt="License">
<img src="https://img.shields.io/badge/built%20with-Actix-red?style=for-the-badge" alt="Actix">
</div>
A cgit-like interface built in Rust using Actix, gitoxide and Askama.
[✨Screenshots](docs/screenshots/)
@@ -1,0 +1,5 @@
fn main() {
// Cargo watches this directory recursively; any file added/changed/removed
// under it triggers a rebuild on the next `cargo build`/`cargo run`.
println!("cargo:rerun-if-changed=templates");
}
@@ -1,0 +1,1 @@
large-error-threshold = 266
@@ -1,0 +1,29 @@
build mode="":
cargo build --{{mode}}
run:
cargo run
debug argument="":
@GIT_LOG=trace cargo run -- {{argument}}
@bat ~/.cache/nmrs-tui/nmrs-tui.log
check:
cargo check
package:
cargo package
publish:
cargo publish
release level="patch":
cargo release {{level}} --execute
fmt:
cargo fmt --all
lint:
cargo clippy --all-targets --all-features -- -D warnings
ci: fmt lint
@@ -1,0 +1,180 @@
use std::{
collections::HashMap,
fs,
path::{Path, PathBuf},
sync::{Arc, RwLock},
time::Duration,
};
use notify::{
Event, EventKind, RecommendedWatcher, RecursiveMode, Watcher,
event::{CreateKind, ModifyKind, RemoveKind, RenameMode},
};
use tokio::sync::mpsc;
use crate::git::repository::Repository;
pub struct App {
pub repos_dir: String,
pub repos: Arc<RwLock<Vec<Repository>>>,
_watcher: RecommendedWatcher,
}
impl App {
pub async fn new(repos_dir: String) -> Self {
let repos: Arc<RwLock<Vec<Repository>>> = Arc::new(RwLock::new(scan_repos(&repos_dir)));
let watch_repos = repos.clone();
let (tx, mut rx) = mpsc::unbounded_channel::<Event>();
let mut watcher = notify::recommended_watcher(move |res: notify::Result<Event>| {
match res {
Ok(event) => {
let _ = tx.send(event);
}
Err(e) => eprintln!("repo watcher error: {e}"),
}
})
.expect("Failed to create repo directory watcher");
watcher
.watch(Path::new(&repos_dir), RecursiveMode::NonRecursive)
.expect("Failed to watch repos directory");
tokio::spawn(async move {
let mut pending_creates: HashMap<PathBuf, tokio::task::JoinHandle<()>> = HashMap::new();
while let Some(event) = rx.recv().await {
match event.kind {
EventKind::Create(CreateKind::Folder) => {
for path in event.paths {
if let Some(handle) = pending_creates.remove(&path) {
handle.abort();
}
let repos_for_task = watch_repos.clone();
let path_for_task = path.clone();
let handle = tokio::spawn(async move {
Self::try_add_repo_when_ready(repos_for_task, path_for_task).await;
});
pending_creates.insert(path, handle);
}
}
EventKind::Remove(RemoveKind::Folder) => match watch_repos.write() {
Ok(mut guard) => {
let before = guard.len();
let removed: Vec<_> = guard
.iter()
.filter(|r| event.paths.contains(&r.path))
.map(|r| (r.name.clone(), r.path.clone()))
.collect();
guard.retain(|r| !event.paths.contains(&r.path));
for (name, path) in &removed {
println!("[watcher] - removed repo: {name} ({path:?})");
}
println!("[watcher] repo count now: {} (was {before})", guard.len());
}
Err(e) => eprintln!("[watcher] repo cache lock poisoned: {e}"),
},
EventKind::Modify(ModifyKind::Name(RenameMode::Both)) => {
if let [old_path, new_path] = event.paths.as_slice() {
let (old_path, new_path) = (old_path.clone(), new_path.clone());
match watch_repos.write() {
Ok(mut guard) => guard.retain(|r| r.path != old_path),
Err(e) => eprintln!("[watcher] repo cache lock poisoned: {e}"),
}
let repos_for_task = watch_repos.clone();
tokio::spawn(async move {
Self::try_add_repo_when_ready(repos_for_task, new_path).await;
});
println!("[watcher] ~ rename detected: {old_path:?} -> ...");
}
}
_ => {}
}
}
});
Self {
repos_dir,
repos,
_watcher: watcher,
}
}
async fn try_add_repo_when_ready(watch_repos: Arc<RwLock<Vec<Repository>>>, path: PathBuf) {
const MAX_ATTEMPTS: u32 = 30; // e.g. 30 * 1s = up to 30s for a big clone
const POLL_INTERVAL: Duration = Duration::from_secs(1);
const QUIET_CHECKS_REQUIRED: u32 = 2; // must succeed N times in a row (dir stopped changing)
let mut consecutive_ok = 0;
for attempt in 0..MAX_ATTEMPTS {
tokio::time::sleep(POLL_INTERVAL).await;
match Repository::open(&path) {
Ok(repo) => {
consecutive_ok += 1;
if consecutive_ok >= QUIET_CHECKS_REQUIRED {
match watch_repos.write() {
Ok(mut guard) => {
println!("[watcher] + added repo: {} ({:?})", repo.name, path);
guard.push(repo);
println!("[watcher] repo count now: {}", guard.len());
}
Err(e) => eprintln!("[watcher] repo cache lock poisoned: {e}"),
}
return;
}
}
Err(_) => {
// not ready yet (mid-clone) — reset streak and keep polling
consecutive_ok = 0;
}
}
if attempt == MAX_ATTEMPTS - 1 {
eprintln!("[watcher] gave up waiting for repo to become ready: {path:?}");
}
}
}
pub fn find_repo(&self, name: String) -> Option<Repository> {
self.repos
.read()
.ok()?
.iter()
.find(|r| r.name == name)
.cloned()
}
}
fn scan_repos(repos_dir: &str) -> Vec<Repository> {
let entries = fs::read_dir(repos_dir).unwrap();
let repos: Vec<Repository> = entries
.filter_map(|e| e.ok())
.filter(|e| e.path().is_dir())
.filter_map(|e| {
let name = e.file_name();
let path = e.path();
match Repository::open(&path) {
Ok(repo) => Some(repo),
Err(e) => {
eprintln!("Failed to open repo {:?}: {:?}", name, e);
None
}
}
})
.collect();
repos
}
@@ -1,0 +1,22 @@
use clap::Parser;
#[derive(Parser)]
#[command(
name = "rsgit",
version,
about = "A lightweight, blazingly fast Git web frontend written in Rust 🦀",
long_about = "rsgit is a minimalist web interface for scouting and browsing local Git repositories, viewing diffs, and managing user patches natively."
)]
pub struct Args {
/// The URL where the frontend is hosted (e.g., 127.0.0.1 or 0.0.0.0 for the public)
#[arg(short, long, value_name = "URL", default_value = "127.0.0.1")]
pub url: String,
/// Port for the server to listen on
#[arg(short, long, value_name = "PORT", default_value_t = 80)]
pub port: u16,
// Repositories directory
#[arg(short, long, value_name = "DIR", default_value = "/srv/git")]
pub repos_dir: String,
}
@@ -1,0 +1,74 @@
#[derive(Debug, thiserror::Error)]
pub enum Error {
#[error("operation failed")]
Failed,
#[error("not found: {0}")]
NotFound(String),
#[error(transparent)]
Utf8(#[from] std::str::Utf8Error),
#[error(transparent)]
Format(#[from] std::fmt::Error),
#[error(transparent)]
Open(#[from] Box<gix::open::Error>),
#[error(transparent)]
ObjectFind(#[from] gix::object::find::existing::Error),
#[error(transparent)]
ObjectFindConversion(#[from] gix::object::find::existing::with_conversion::Error),
#[error(transparent)]
ObjectCommit(#[from] gix::object::commit::Error),
#[error(transparent)]
ObjectTree(#[from] gix::object::tree::diff::for_each::Error),
#[error(transparent)]
DiffOptions(#[from] gix::diff::options::init::Error),
#[error(transparent)]
DiffPrepare(#[from] gix::diff::blob::platform::prepare_diff::Error),
#[error(transparent)]
DiffResource(#[from] gix::diff::blob::platform::set_resource::Error),
#[error(transparent)]
RepoDiff(#[from] gix::repository::diff_resource_cache::Error),
#[error(transparent)]
DecodeCommit(#[from] gix::objs::decode::Error),
#[error(transparent)]
DecodeHash(#[from] gix::hash::decode::Error),
#[error(transparent)]
RevWalk(#[from] gix::revision::walk::Error),
#[error(transparent)]
RevWalkIter(#[from] gix::revision::walk::iter::Error),
#[error(transparent)]
RevParseSpec(#[from] gix::revision::spec::parse::single::Error),
#[error(transparent)]
PeelToCommit(#[from] gix::head::peel::to_commit::Error),
#[error(transparent)]
PeelToKind(#[from] gix::reference::peel::to_kind::Error),
#[error(transparent)]
ReferenceFind(#[from] gix::reference::find::existing::Error),
#[error(transparent)]
ReferenceIter(#[from] gix::reference::iter::Error),
#[error(transparent)]
ReferenceIterInit(#[from] gix::reference::iter::init::Error),
#[error(transparent)]
Boxed(#[from] Box<dyn std::error::Error + Send + Sync>),
}
@@ -1,0 +1,46 @@
use crate::prelude::*;
use actix_web::{App as ActixApp, HttpServer, web};
use clap::Parser;
use std::io::Error;
use crate::cli::Args;
pub mod app;
pub mod cli;
pub mod error;
pub mod git;
pub mod markdown;
pub mod prelude;
pub mod routes;
pub mod time;
#[actix_web::main]
async fn main() -> Result<(), Error> {
let args = Args::parse();
let app = web::Data::new(App::new(args.repos_dir.to_string()).await);
HttpServer::new(move || {
ActixApp::new()
.app_data(app.clone())
.service(routes::r#static::files)
.service(routes::git::git_info_refs)
.service(routes::git::git_upload_pack)
.service(routes::git::git_receive_pack)
.service(routes::repository::diff::patch)
.service(routes::repository::snapshot::download)
.service(routes::page)
.service(routes::about::page)
.service(routes::repository::about::page)
.service(routes::repository::summary::page)
.service(routes::repository::refs::page)
.service(routes::repository::tag::page)
.service(routes::repository::log::page)
.service(routes::repository::tree::page)
.service(routes::repository::tree::raw)
.service(routes::repository::commit::page)
.service(routes::repository::diff::page)
})
.bind((args.url, args.port))?
.run()
.await
}
@@ -1,0 +1,93 @@
use std::collections::HashMap;
use pulldown_cmark::{CowStr, Event, LinkType, Options, Parser, Tag, TagEnd, html};
pub fn render(raw: &str) -> String {
let events: Vec<Event> = Parser::new_ext(raw, Options::all()).collect();
let events = link_headings(events);
let mut out = String::new();
html::push_html(&mut out, events.into_iter());
out
}
fn link_headings(events: Vec<Event<'_>>) -> Vec<Event<'_>> {
let mut output = Vec::with_capacity(events.len());
let mut seen: HashMap<String, usize> = HashMap::new();
let mut i = 0;
while i < events.len() {
if let Event::Start(Tag::Heading {
level,
classes,
attrs,
id: None,
}) = &events[i]
{
let level = *level;
let classes = classes.clone();
let attrs = attrs.clone();
let mut j = i + 1;
let mut text = String::new();
while j < events.len() {
match &events[j] {
Event::End(TagEnd::Heading(_)) => break,
Event::Text(t) | Event::Code(t) => text.push_str(t),
_ => {}
}
j += 1;
}
let mut slug = slugify(&text);
if slug.is_empty() {
slug = "section".to_string();
}
let count = seen.entry(slug.clone()).or_insert(0);
if *count > 0 {
slug = format!("{slug}-{count}");
}
*count += 1;
output.push(Event::Start(Tag::Heading {
level,
id: Some(CowStr::from(slug.clone())),
classes,
attrs,
}));
output.push(Event::Start(Tag::Link {
link_type: LinkType::Inline,
dest_url: CowStr::from(format!("#{slug}")),
title: CowStr::from(""),
id: CowStr::from(""),
}));
output.extend_from_slice(&events[i + 1..j]);
output.push(Event::End(TagEnd::Link));
output.push(events[j].clone()); // End(Heading)
i = j + 1;
} else {
output.push(events[i].clone());
i += 1;
}
}
output
}
fn slugify(text: &str) -> String {
let mut slug = String::new();
let mut last_was_dash = false;
for c in text.to_lowercase().chars() {
if c.is_alphanumeric() {
slug.push(c);
last_was_dash = false;
} else if !last_was_dash {
slug.push('-');
last_was_dash = true;
}
}
slug.trim_matches('-').to_string()
}
@@ -1,0 +1,11 @@
pub use actix_web::{
HttpRequest, HttpResponse, Result as ActixResult, delete, get, post, put, web,
};
pub use crate::app::App;
pub use crate::error::Error;
pub use crate::git::{
self, GitSignature, branch::Branch, commit::Commit, refs::Ref, repository::Repository, tag::Tag,
};
pub use crate::time::Time;
pub use askama::Template;
@@ -1,0 +1,284 @@
use std::{
cell::RefCell,
collections::HashMap,
fmt::Write as FmtWrite,
io::{ErrorKind, Write as IoWrite},
path::Path,
sync::LazyLock,
};
use comrak::adapters::SyntaxHighlighterAdapter;
use tree_sitter_grammar_repository::{Grammar, Language};
use tree_sitter_highlight::{HighlightConfiguration, HighlightEvent, Highlighter};
thread_local! {
static HIGHLIGHTER: RefCell<Highlighter> = RefCell::new(Highlighter::new());
}
macro_rules! count {
() => (0);
($e:expr) => (1);
($e:expr, $($rest:expr),*) => (1 + count!($($rest),*));
}
macro_rules! define_classes {
($($name:literal => $class:literal),*,) => {
static HIGHLIGHT_NAMES: [&str; count!($($name),*)] = [
$($name),*
];
static HIGHLIGHT_CLASSES: [&str; count!($($name),*)] = [
$($class),*
];
};
}
define_classes! {
"attribute" => "attribute",
"boolean" => "boolean",
"carriage-return" => "carriage-return",
"comment" => "comment",
"comment.documentation" => "comment documentation",
"constant" => "constant",
"constant.builtin" => "constant builtin",
"constructor" => "constructor",
"constructor.builtin" => "constructor builtin",
"embedded" => "embedded",
"error" => "error",
"escape" => "escape",
"function" => "function",
"function.builtin" => "function builtin",
"keyword" => "keyword",
"markup" => "markup",
"markup.bold" => "markup bold",
"markup.heading" => "markup heading",
"markup.italic" => "markup italic",
"markup.link" => "markup link",
"markup.link.url" => "markup link url",
"markup.list" => "markup list",
"markup.list.checked" => "markup list checked",
"markup.list.numbered" => "markup list numbered",
"markup.list.unchecked" => "markup list unchecked",
"markup.list.unnumbered" => "markup list unnumbered",
"markup.quote" => "markup quote",
"markup.raw" => "markup raw",
"markup.raw.block" => "markup raw block",
"markup.raw.inline" => "markup raw inline",
"markup.strikethrough" => "markup strikethrough",
"module" => "module",
"number" => "number",
"operator" => "operator",
"property" => "property",
"property.builtin" => "property builtin",
"punctuation" => "punctuation",
"punctuation.bracket" => "punctuation bracket",
"punctuation.delimiter" => "punctuation delimiter",
"punctuation.special" => "punctuation special",
"string" => "string",
"string.escape" => "string escape",
"string.regexp" => "string regexp",
"string.special" => "string special",
"string.special.symbol" => "string special symbol",
"tag" => "tag",
"type" => "type",
"type.builtin" => "type builtin",
"variable" => "variable",
"variable.builtin" => "variable builtin",
"variable.member" => "variable member",
"variable.parameter" => "variable parameter",}
pub fn prime_highlighters() {
let _res = HIGHLIGHTER_CONFIGS.len();
}
static HIGHLIGHTER_CONFIGS: LazyLock<Vec<HighlightConfiguration>> = LazyLock::new(|| {
Grammar::VARIANTS
.iter()
.copied()
.map(Grammar::highlight_configuration_params)
.map(|v| {
let mut configuration = HighlightConfiguration::new(
v.language.into(),
v.name,
v.highlights_query,
v.injection_query,
v.locals_query,
)
.unwrap_or_else(|e| panic!("bad query for {}: {e}", v.name));
configuration.configure(&HIGHLIGHT_NAMES);
configuration
})
.collect()
});
pub fn fetch_highlighter_config(file: &Path) -> Option<&'static HighlightConfiguration> {
Language::from_file_name(file)
.map(Language::grammar)
.map(Grammar::idx)
.map(|idx| &HIGHLIGHTER_CONFIGS[idx])
}
pub fn fetch_highlighter_config_by_token(token: &str) -> Option<&'static HighlightConfiguration> {
Language::from_injection(token)
.map(Language::grammar)
.map(Grammar::idx)
.map(|idx| &HIGHLIGHTER_CONFIGS[idx])
}
pub struct ComrakHighlightAdapter;
impl SyntaxHighlighterAdapter for ComrakHighlightAdapter {
fn write_highlighted(
&self,
output: &mut dyn IoWrite,
lang: Option<&str>,
code: &str,
) -> std::io::Result<()> {
let out = format_file(code, FileIdentifier::Token(lang.unwrap_or_default()))
.map_err(|e| std::io::Error::new(ErrorKind::Other, e))?;
output.write_all(out.as_bytes())
}
fn write_pre_tag(
&self,
output: &mut dyn IoWrite,
_attributes: HashMap<String, String>,
) -> std::io::Result<()> {
write!(output, "<pre>")
}
fn write_code_tag(
&self,
_output: &mut dyn IoWrite,
_attributes: HashMap<String, String>,
) -> std::io::Result<()> {
Ok(())
}
}
#[derive(Copy, Clone, Debug)]
pub enum FileIdentifier<'a> {
Path(&'a Path),
Token(&'a str),
}
fn render_line_prefix(tag: bool, line_number: usize) -> String {
if !tag {
return "".to_string();
}
format!("<span class='lnb'><a id='n{0}' href='#n{0}'>{0}</a></span><code>", line_number)
}
fn render_line_suffix(tag: bool, line_number: usize) -> String {
if !tag {
return "\n".to_string();
}
"</code>\n".to_string()
}
pub fn format_file(content: &str, identifier: FileIdentifier<'_>) -> Result<String. Error> {
let mut out = String::new();
format_file_inner(&mut out, content, identifier, true)?;
Ok(out)
}
pub fn format_file_inner(
out: &mut String,
content: &str,
identifier: FileIdentifier<'_>,
code_tag: bool,
) -> anyhow::Result<()> {
let config = match identifier {
FileIdentifier::Path(v) => fetch_highlighter_config(v),
FileIdentifier::Token(v) => fetch_highlighter_config_by_token(v),
};
let Some(config) = config else {
for (i, line) in content.lines().enumerate() {
out.push_str(&render_line_prefix(code_tag, i));
v_htmlescape::b_escape(line.as_bytes(), out);
out.push_str(&render_line_suffix(code_tag, i));
}
return Ok(());
};
let mut line_number = 0;
HIGHLIGHTER.with_borrow_mut(|highlighter| {
highlighter.parser().reset();
let spans = highlighter.highlight(config, content.as_bytes(), None, |injection| {
debug!(injection, "Highlighter switch requested");
fetch_highlighter_config_by_token(injection)
});
let mut spans = match spans {
Ok(v) => v,
Err(error) => {
error!(
?error,
"Failed to run highlighter, falling back to plaintext"
);
for line in content.lines() {
line_number = line_number + 1;
out.push_str(&render_line_prefix(code_tag, line_number));
v_htmlescape::b_escape(line.as_bytes(), out);
out.push_str(&render_line_suffix(code_tag, line_number));
}
return Ok(());
}
};
let mut tag_open = true;
line_number = line_number + 1;
out.push_str(&render_line_prefix(code_tag, line_number));
while let Some(span) = spans.next().transpose()? {
if !tag_open {
line_number = line_number + 1;
out.push_str(&render_line_prefix(code_tag, line_number));
tag_open = true;
}
match span {
HighlightEvent::Source { start, end } => {
let content = &content[start..end];
for (i, line) in content.lines().enumerate() {
if i != 0 {
out.push_str(&render_line_suffix(code_tag, line_number));
line_number = line_number + 1;
out.push_str(&render_line_prefix(code_tag, line_number));
}
v_htmlescape::b_escape(line.as_bytes(), out);
}
if content.ends_with('\n') {
out.push_str(&render_line_suffix(code_tag, line_number));
tag_open = false;
}
}
HighlightEvent::HighlightStart(highlight) => {
write!(
out,
r#"<span class="highlight {}">"#,
HIGHLIGHT_CLASSES[highlight.0]
)?;
}
HighlightEvent::HighlightEnd => {
out.push_str("</span>");
}
}
}
if tag_open {
out.push_str(&render_line_suffix(code_tag, line_number));
}
Ok::<_, anyhow::Error>(())
})?;
Ok(())
}
@@ -1,0 +1,85 @@
use std::{fmt::Display, io::Write};
use bytes::{BytesMut, buf::Writer};
use gix::date::Time as GixTime;
use chrono::{DateTime, FixedOffset, TimeZone, Utc};
#[derive(Clone)]
pub struct Time {
gix: GixTime,
}
pub enum Recency {
Fresh,
Recent,
Stale,
}
impl Display for Recency {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
match self {
Self::Fresh => write!(f, "fresh"),
Self::Recent => write!(f, "recent"),
Self::Stale => write!(f, "stale"),
}
}
}
impl Time {
pub fn new(gix: GixTime) -> Self {
Self { gix }
}
pub fn format(&self) -> String {
let dt: DateTime<Utc> = Utc.timestamp_opt(self.gix.seconds, 0).unwrap();
let offset = FixedOffset::east_opt(self.gix.offset).unwrap();
let local = dt.with_timezone(&offset);
local.format("%Y-%m-%d %H:%M:%S %z").to_string()
}
pub fn format_rfc(&self, writer: &mut Writer<BytesMut>) {
let dt: DateTime<Utc> = Utc.timestamp_opt(self.gix.seconds, 0).unwrap();
let offset = FixedOffset::east_opt(self.gix.offset).unwrap();
let local = dt.with_timezone(&offset);
writer
.write_all(
local
.format("%a, %d %b %Y %H:%M:%S %z")
.to_string()
.as_bytes(),
)
.unwrap();
}
pub fn format_relative(&self) -> (String, Recency) {
format_relative(self.gix.seconds)
}
}
pub fn format_relative(seconds: i64) -> (String, Recency) {
let then = Utc.timestamp_opt(seconds, 0).unwrap();
let now = Utc::now();
let diff = now.signed_duration_since(then);
let secs = diff.num_seconds();
let mins = diff.num_minutes();
let hours = diff.num_hours();
let days = diff.num_days();
if secs < 120 {
(format!("{} seconds", secs.max(0)), Recency::Fresh)
} else if mins < 120 {
(format!("{} minutes", mins), Recency::Fresh)
} else if hours < 48 {
(format!("{} hours", hours), Recency::Fresh)
} else if days < 14 {
(format!("{} days", days), Recency::Fresh)
} else if days < 60 {
(format!("{} month", days / 30), Recency::Recent)
} else if days < 365 {
(format!("{} months", days / 30), Recency::Stale)
} else {
(format!("{} year", days / 365), Recency::Stale)
}
}
Binary files /dev/null and b/static/favicon.ico differ
Binary files /dev/null and b/static/logo.png differ
@@ -1,0 +1,575 @@
:root {
/* Catppuccin Mocha palette */
--base: #1e1d2d;
--mantle: #181825;
--crust: #11111b;
--text: #cdd6f4;
--subtext1: #bac2de;
--subtext0: #a6adc8;
--surface0: #313244;
--surface1: #45475a;
--surface2: #585b70;
--overlay0: #6c7086;
--overlay1: #7f849c;
--overlay2: #9399b2;
--rosewater: #f5e0dc;
--flamingo: #f2cdcd;
--pink: #f5c2e7;
--mauve: #cba6f7;
--red: #f38ba8;
--maroon: #eba0ac;
--peach: #fab387;
--yellow: #f9e2af;
--green: #a6e3a1;
--teal: #94e2d5;
--sky: #89dceb;
--saphhire: #74c7ec;
--blue: #89b4fa;
--lavender: #b4befe;
--white: #D9E0EE;
--black2: #252434;
--one_bg: #2d2c3c;
--one_bg2: #363545;
--one_bg3: #3e3d4d;
--grey: #474656;
--grey_fg: #4e4d5d;
--grey_fg2: #555464;
--light_grey: #605f6f;
}
* {
box-sizing: border-box;
}
body {
font-family: 'Maple Mono NF', monospace;
/* font-family: 'BigBlueTerm437 Nerd Font', monospace; */
font-size: 1rem;
margin: 0;
background: var(--base);
color: var(--text);
}
div#body {
padding: 2rem;
}
main {
padding: 2rem;
margin: 0 auto;
}
h1,
h2,
h3 {
color: var(--text);
}
table {
border-collapse: collapse;
width: 100%;
overflow: hidden;
}
td.msg {
display: flex;
align-items: center;
gap: 0.4em;
overflow: hidden; /* needed for ellipsis to take effect */
}
td.msg .msg-text {
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
min-width: 0; /* flex children don't shrink below content size by default — this overrides that */
}
td.author {
white-space: nowrap;
}
th {
text-align: left;
white-space: nowrap;
}
tbody tr.no-background:nth-child(even),
tbody tr.no-background:nth-child(odd),
tbody tr.no-background:hover {
background: transparent;
}
td {
text-align: left;
white-space: nowrap;
padding: 0.75rem 1rem;
}
tbody tr:nth-child(even) {
background: var(--one_bg);
}
tbody tr:nth-child(odd) {
background: var(--black2);
}
tbody tr:hover {
background: var(--surface0);
}
th {
color: var(--peach);
font-weight: 600;
font-style: bold;
letter-spacing: 0.05em;
}
td.form {
text-align: right;
}
td.form input {
color: var(--text);
background: var(--surface0);
border: 1px solid var(--surface1);
border-radius: 0;
padding: 5px;
}
td.form select {
color: var(--text);
background: var(--surface0);
border: 1px solid var(--surface1);
border-radius: 0;
padding: 5px;
}
.tabs {
margin-top: 2rem;
background: var(--black2);
}
.tabs a,
td a {
color: var(--text);
}
.commit-info {
margin-top: 2rem;
max-width: fit-content;
background: transparent;
}
.commit-info tr:nth-child(odd),
.commit-info tr:nth-child(even),
.commit-info tr:hover{
background-color: transparent;
}
.commit-info td {
padding: 0.20rem 1rem 0.20rem 0rem;
}
.commit-info a {
color: var(--peach);
}
.commit-subject {
padding: 1rem 0;
}
.commit-subject h1 {
font-weight: bold;
font-size: 120%;
}
.commit-subject h4 {
font-weight: bold;
color: var(--overlay1);
}
.tree-breadcrumb {
background: var(--black2);
padding: 5px;
}
code {
background: var(--black2);
color: var(--green);
padding: 2px 6px;
}
pre {
color: var(--text);
background: var(--surface0);
border: 1px var(--surface1) solid;
font-size: 14px;
padding: 6px 10px;
}
pre code {
color: var(--text);
background: var(--surface0);
padding: 0;
}
a {
color: var(--peach);
padding: 5px;
text-decoration: none;
}
a:hover,
a:active,
a.active {
color: var(--crust);
background: var(--peach);
}
.fresh {
color: var(--green);
font-weight: 600;
}
.recent {
color: var(--overlay1);
}
.stale {
color: var(--surface2);
}
.description {
color: var(--subtext1);
font-style: italic;
}
span.avatar img.onhover {
display: none;
border: 1px solid var(--surface1);
padding: 0px;
width: 128px;
height: 128px;
}
span.avatar img.inline {
width: 20px;
height: 20px;
vertical-align: top;
}
span.avatar:hover>img.onhover {
display: block;
position: absolute;
margin-left: 1.5em;
background-color: var(--crust);
}
.folder {
color: var(--peach);
}
td.logo {
width: 96px;
vertical-align: top;
}
td.logo img {
width: 96px;
height: 96px;
}
td.main {
font-size: 200%;
padding-left: 10px;
white-space: nowrap;
}
td.sub {
color: var(--subtext0);
border-top: solid 2px var(--surface1);
padding-left: 10px;
}
td.mode, th.mode {
width: 10ch;
font-family: monospace;
white-space: nowrap;
}
/* === Blob metadata bar === */
.blob-meta {
display: flex;
align-items: center;
gap: 1em;
padding: 0.5em 0.8em;
margin-bottom: 0.5em;
background-color: var(--black2);
border: 1px solid var(--surface1);
font-family: monospace;
font-size: 0.9em;
}
.blob-meta .mode {
white-space: nowrap;
color: var(--green);
}
.blob-meta .blob-id {
color: var(--subtext0);
overflow: hidden;
text-overflow: ellipsis;
}
.blob-meta .size {
white-space: nowrap;
color: var(--subtext1);
margin-left: auto; /* pushes size + raw-link to the right edge */
}
.blob-table {
width: 100%;
border-collapse: collapse;
font-family: monospace;
}
.blob-table tr:nth-child(odd),
.blob-table tr:nth-child(even),
.blob-table tr:hover{
background-color: transparent;
}
.blob-table .line-no {
width: 4em;
text-align: right;
padding: 0 0.8em;
color: var(--overlay0);
user-select: none; /* selecting code shouldn't drag line numbers along with it */
border-right: 1px solid var(--surface1);
vertical-align: top;
white-space: nowrap;
}
.blob-table .line-content {
width: 100%;
padding: 0 0.8em;
color: var(--text);
}
.blob-table .line-content pre {
margin: 0;
background: none;
border: none;
padding: 0;
white-space: pre-wrap; /* wraps long lines instead of forcing horizontal scroll */
word-break: break-all;
}
.clone-url {
background: var(--surface0);
color: var(--peach);
padding: 4px 10px;
font-size: 0.85em;
}
.show_more a,
.pagination a{
color: var(--peach);
font-size: 18px;
}
.show_more a:hover,
.pagination a:hover{
color: var(--crust);
}
.pagination {
margin-top: 1rem;
text-align: center;
font-size: 20px;
}
.badge_head {
background: var(--crust);
color: var(--text);
border: 1px solid var(--red);
padding: 2px 8px;
}
.badge_branch {
background: var(--crust);
color: var(--text);
border: 1px solid var(--green);
padding: 2px 8px;
}
.badge_branch:hover,
.badge_head:hover {
color: var(--peach);
background: var(--crust);
}
.green {
color: var(--green);
}
.red {
color: var(--red);
}
.mt-1 {
margin-top: 1rem;
}
.mt-2 {
margin-top: 2rem;
}
.mt-3 {
margin-top: 3rem;
}
.mt-4 {
margin-top: 4rem;
}
.mt-5 {
margin-top: 5rem;
}
table.diffstat {
background: var(--surface0);
border: 1px var(--surface1) solid;
max-width: 50%;
min-width: 50%;
}
table.diffstat td {
padding: 0.2em 0.2em 0.1em 0.1em;
}
.diffstat tr,
.diffstat tr:nth-child(odd),
.diffstat tr:nth-child(even),
.diffstat tr:hover{
background-color: transparent;
}
.diffstat .mode,
.diffstat .upd,
.diffstat .right {
width: 1%;
}
a.diffstat-added {
color: var(--green);
}
a.diffstat-removed {
color: var(--red);
}
a.diffstat-changed {
color: var(--peach);
}
a.diffstat-added:hover,
a.diffstat-removed:hover,
a.diffstat-changed:hover {
color: var(--crust);
}
.diffstat-addition {
background: var(--green);
height: 0.5rem;
}
.diffstat-deletion {
background: var(--red);
height: 0.5rem;
}
pre.diff {
color: var(--text);
background: none;
border: none;
font-size: 14px;
padding: 0;
}
.diff-hunk {
color: var(--blue);
}
.diff-addition::before, .diff-deletion::before, .diff-context::before {
display: inline-block;
color: #888;
}
.diff-file-header {
font-weight: bold;
}
.diff-file-header > span > span {
font-weight: normal;
}
.diff-addition {
background: #2b3038;
color: var(--green);
display: block;
&::before {
content: '+ ';
}
}
.diff-deletion {
background: #332839;
color: var(--red);
display: block;
&::before {
content: '- ';
}
}
.diff-context {
&::before {
content: ' ';
}
}
/* NOTE: Markdown */
.readme h1,
.readme h2,
.readme h3,
.readme h4,
.readme h5,
.readme h6 {
margin-bottom: 1rem;
}
.readme h1,
.readme h2 {
border-bottom: 1px solid var(--surface1);
padding-bottom: 0.3rem;
}
/* Paragraph */
.readme p {
font-size: 14px;
color: var(--catppuccin-subtext1);
}
.readme hr {
border: none;
border-top: 1px solid var(--surface1);
}
@@ -1,0 +1,20 @@
{% extends "base.html" %}
{% block title %}y2w8 Repos{% endblock %}
{% block header %}
{{ macros::header() }}
{% endblock %}
{% block tabs %}
<tr>
<td>
<a href="/">index</a>
<a href="/about" class="active">about</a>
</td>
</tr>
{% endblock %}
{% block content %}
Hello!
{% endblock %}
@@ -1,0 +1,32 @@
{%- import "macros.html" as macros -%}
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>{% block title %}rsgit{% endblock %}</title>
<link rel="stylesheet" href="/static/style.css">
<link rel="shortcut icon" href="/static/favicon.ico">
</head>
<body>
<table class="header blob-table">
<tbody>
{% block header %}{% endblock %}
</tbody>
</table>
<div id="body">
{% block body %}
<table class="tabs">
<thead>
{% block tabs %}{% endblock %}
</thead>
</table>
{% block breadcrumb %}{% endblock %}
<main>
{% block content %}{% endblock %}
</main>
{% endblock %}
</div>
</body>
</html>
@@ -1,0 +1,236 @@
{% macro header(repo: Option<&Repository> = None, branches: Vec<String> = Vec::new(), current_ref: Option<&Ref> = None) %}
{% if let Some(repo) = repo && let Some(current_ref) = current_ref %}
<tr>
<td class="logo" rowspan="2"><a href="/"><img src="/static/logo.png" alt="logo"></a></td>
<td class="main"><a href="/">index</a> : <a title="{{ repo.name }}" href="/{{ repo.name }}/">{{ repo.name }}</a></td>
<td class="form">
<form method="get">
<select name="h" onchange="this.form.submit();">
{% for branch in branches %}
<option value="{{ branch }}" {% if branch == ¤t_ref.name %}selected{% endif %}>{{ branch }}</option>
{% endfor %}
</select>
<input type="submit" value="switch">
</form>
</td>
</tr>
<tr>
<td class="sub" colspan="2">{{ repo.description }}</td>
</tr>
{% else %}
<tr>
<td class="logo" rowspan="2"><a href="/"><img src="/static/logo.png" alt="logo"></a></td>
<td class="main">y2w8 Repos</td>
</tr>
<tr>
<td class="sub">y2w8 git repositories, powered by rsgit</td>
</tr>
{% endif %}
{% endmacro %}
{% macro repo_tabs(repo: Repository, current_ref: Ref, query: PageQuery, active: str) %}
<tr>
<td>
{% decl parameters %}
{% if let Some(id) = query.id %}
{% let parameters %}?id={{ id }}{% endlet %}
<a href="/{{ repo.name }}/about/" class="{% if active == "about" %}active{% endif %}">about</a>
<a href="/{{ repo.name }}/" class="{% if active == "summary" %}active{% endif %}">summary</a>
<a href="/{{ repo.name }}/refs/{{ parameters }}" class="{% if active == "refs" %}active{% endif %}">refs</a>
<a href="/{{ repo.name }}/log/" class="{% if active == "log" %}active{% endif %}">log</a>
<a href="/{{ repo.name }}/tree/{{ parameters }}" class="{% if active == "tree" %}active{% endif %}">tree</a>
<a href="/{{ repo.name }}/commit/{{ parameters }}" class="{% if active == "commit" %}active{% endif %}">commit</a>
<a href="/{{ repo.name }}/diff/{{ parameters }}" class="{% if active == "diff" %}active{% endif %}">diff</a>
{% else if let Some(head) = query.head %}
{% let parameters %}?h={{ head }}{% endlet %}
<a href="/{{ repo.name }}/about/{{ parameters }}" class="{% if active == "about" %}active{% endif %}">about</a>
<a href="/{{ repo.name }}/" class="{% if active == "summary" %}active{% endif %}">summary</a>
<a href="/{{ repo.name }}/refs/" class="{% if active == "refs" %}active{% endif %}">refs</a>
<a href="/{{ repo.name }}/log/{{ parameters }}" class="{% if active == "log" %}active{% endif %}">log</a>
<a href="/{{ repo.name }}/tree/{{ parameters }}" class="{% if active == "tree" %}active{% endif %}">tree</a>
<a href="/{{ repo.name }}/commit/{{ parameters }}" class="{% if active == "commit" %}active{% endif %}">commit</a>
<a href="/{{ repo.name }}/diff/{{ parameters }}" class="{% if active == "diff" %}active{% endif %}">diff</a>
{% else %}
<a href="/{{ repo.name }}/about/" class="{% if active == "about" %}active{% endif %}">about</a>
<a href="/{{ repo.name }}/" class="{% if active == "summary" %}active{% endif %}">summary</a>
<a href="/{{ repo.name }}/refs/" class="{% if active == "refs" %}active{% endif %}">refs</a>
<a href="/{{ repo.name }}/log/" class="{% if active == "log" %}active{% endif %}">log</a>
<a href="/{{ repo.name }}/tree/" class="{% if active == "tree" %}active{% endif %}">tree</a>
<a href="/{{ repo.name }}/commit/" class="{% if active == "commit" %}active{% endif %}">commit</a>
<a href="/{{ repo.name }}/diff/" class="{% if active == "diff" %}active{% endif %}">diff</a>
{% endif %}
</td>
<td class="form">
<form method="get" action="/{{ repo.name }}/log/">
<select name="qt">
<option value="msg" selected>msg</option>
<option value="author" >author</option>
<option value="committer">committer</option>
</select>
<input type="search" name="v" size="10" value="">
<input type="submit" value="search">
</form>
</td>
</tr>
{% endmacro %}
{% macro branches(branches, branches_has_more, has_prev, page, mode) %}
<thead>
<tr>
<th>Branch</th>
<th>Commit message</th>
<th>Author</th>
<th>Age</th>
</tr>
</thead>
<tbody>
{% for branch in branches %}
<tr>
<td>
<a href="/{{ repo.name }}/log/?h={{ branch.name }}">{{ branch.name }}</a>
</td>
<td class="msg"><span class="msg-text">{{ branch.last_commit.summary()? }}</span></td>
<td class="author">
<span class="avatar">
<img class="inline" src="{{ branch.author.avatar_url(20) }}">
<img class="onhover" src="{{ branch.author.avatar_url(128) }}">
</span>
{{ branch.author.name }}
</td>
{% let time = branch.author.time.format_relative() %}
<td class="{{ time.1 }}" title="{{ branch.author.time.format() }}">{{ time.0 }}</td>
</tr>
{% endfor %}
<tr class="no-background">
{% if mode == "heads" %}
<td colspan="4" class="pagination">
{% if has_prev %}
{% let offset = offset.saturating_sub(PAGE_SIZE) %}
{% if offset > 0 %}
<a href="/{{ repo.name }}/refs/heada/?ofs={{ offset }}">[prev]</a>
{% else %}
<a href="/{{ repo.name }}/refs/heada/">[prev]</a>
{% endif %}
{% endif %}
{% if branches_has_more %}
<a href="/{{ repo.name }}/refs/heads?ofs={{ offset.saturating_add(PAGE_SIZE) }}">[next]</a>
{% endif %}
</td>
{% else if branches_has_more %}
<td class="show_more">
<a href="/{{ repo.name }}/refs/heads">[...]</a>
</td>
{% endif %}
</tr>
</tbody>
{% endmacro %}
{% macro tags(tags, tags_has_more, has_prev, page, mode) %}
<thead>
<tr>
<th>Tag</th>
<th>Download</th>
<th>Author</th>
<th>Age</th>
</tr>
</thead>
<tbody>
{% for tag in tags %}
<tr>
<td><a href="/{{ repo.name }}/tag/?h={{ tag.name }}">{{ tag.name }}</a></td>
<td>
<a href="/{{ repo.name }}/snapshot/?h={{ tag.name }}">{{ tag.name }}.tar.gz</a>
</td>
<td>
{% if let Some(tagger) = tag.tagger %}
<span class="avatar">
<img class="inline" src="{{ tagger.avatar_url(20) }}">
<img class="onhover" src="{{ tagger.avatar_url(128) }}">
</span>
{{ tagger.name }}
{% endif %}
</td>
{% let time = tag.time.format_relative() %}
<td class="
{{ time.1 }}" title="{{ tag.time.format() }}">{{ time.0 }}</td>
</tr>
{% endfor %}
<tr class="no-background">
{% if mode == "tags" %}
<td colspan="4" class="pagination">
{% if has_prev %}
{% let offset = offset.saturating_sub(PAGE_SIZE) %}
{% if offset > 0 %}
<a href="/{{ repo.name }}/refs/tags/?ofs={{ offset }}">[prev]</a>
{% else %}
<a href="/{{ repo.name }}/refs/tags/">[prev]</a>
{% endif %}
{% endif %}
{% if tags_has_more %}
<a href="/{{ repo.name }}/refs/tags?ofs={{ offset.saturating_add(PAGE_SIZE) }}">[next]</a>
{% endif %}
</td>
{% else if tags_has_more %}
<td class="show_more">
<a href="/{{ repo.name }}/refs/tags">[...]</a>
</td>
{% endif %}
</tr>
</tbody>
{% endmacro %}
{% macro commits(commits, commits_has_more, has_prev, page, mode) %}
<thead>
<tr>
<th>Age</th>
<th>Commit message</th>
<th>Author</th>
</tr>
</thead>
<tbody>
{% for commit in commits %}
<tr>
{% let time = commit.author.time.format_relative() %}
<td class="{{ time.1 }}" title="{{ commit.author.time.format() }}">{{ time.0 }}</td>
<td>
<a href="/{{ repo.name }}/commit/?id={{ commit.id }}">{{ commit.summary()? | truncate(80)}}</a>
{% if commit.is_head(repo)? %}<a href="/{{ repo.name }}/commit/?id={{ commit.id }}" class="badge_head">HEAD</a>{% endif %}
{% for branch in commit.branch_tips(repo)? %}
<a href="/{{ repo.name }}/log/?h={{ branch }}" class="badge_branch">{{ branch }}</a>
{% endfor %}
</td>
<td>
<span class="avatar">
<img class="inline" src="{{ commit.author.avatar_url(20) }}">
<img class="onhover" src="{{ commit.author.avatar_url(128) }}">
</span>
{{ commit.author.name }}
</td>
</tr>
{% endfor %}
<tr class="no-background">
{% if mode == "log" %}
<td colspan="3" class="pagination">
{% if has_prev %}
{% let offset = offset.saturating_sub(PAGE_SIZE) %}
{% if offset > 0 %}
<a href="/{{ repo.name }}/log/?ofs={{ offset }}">[prev]</a>
{% else %}
<a href="/{{ repo.name }}/log/">[prev]</a>
{% endif %}
{% endif %}
{% if commits_has_more %}
<a href="/{{ repo.name }}/log/?ofs={{ offset.saturating_add(PAGE_SIZE) }}">[next]</a>
{% endif %}
</td>
{% else if commits_has_more %}
<td class="show_more">
<a href="/{{ repo.name }}/log/">[...]</a>
</td>
{% endif %}
</tr>
</tbody>
{% endmacro %}
@@ -1,0 +1,65 @@
{% extends "base.html" %}
{% block title %}y2w8 Repos{% endblock %}
{% block header %}
{{ macros::header() }}
{% endblock %}
{% block tabs %}
<tr>
<td>
<a href="/" class="active">index</a>
<a href="/about">about</a>
</td>
<td class="form">
<form method="get" action="/">
<input type="search" name="v" size="10" value="">
<input type="submit" value="search">
</form>
</td>
</tr>
{% endblock %}
{% block content %}
<table>
<thead>
<tr>
<th>Name</th>
<th>Description</th>
<th>Owner</th>
<th>Idle</th>
<th>Links</th>
</tr>
</thead>
<tbody>
{% for repo in repos %}
<tr>
<td><a href="/{{ repo.name }}/">{{ repo.name }}</a></td>
<td><a href="/{{ repo.name }}/">{{ repo.description }}</a></td>
<td>{% if let Some(owner) = repo.owner %}{{ owner }}{% endif %}</td>
<td>
{% let gix_repo = repo.gix() %}
{% if let Some(last_commit) = repo.last_commit(gix_repo)? %}
{% let time = last_commit.time.format_relative() %}
<span class="
{% match time.1 %}
{% when Recency::Fresh %}fresh
{% when Recency::Recent %}recent
{% when Recency::Stale %}stale
{% endmatch %}
"
title="{{ last_commit.time.format() }}">
{{ time.0 }}
</span>
{% else %}
<span class="stale">Unknown</span>
{% endif %}
</td>
<td><a href="/{{ repo.name }}/">summary</a><a href="/{{ repo.name }}/log/">log</a><a href="/{{ repo.name }}/tree/">tree</a></td>
</tr>
{% endfor %}
</tbody>
</table>
{% endblock %}
Binary files /dev/null and b/docs/screenshots/commit.png differ
Binary files /dev/null and b/docs/screenshots/diff.png differ
Binary files /dev/null and b/docs/screenshots/log.png differ
Binary files /dev/null and b/docs/screenshots/refs.png differ
Binary files /dev/null and b/docs/screenshots/repos_page.png differ
Binary files /dev/null and b/docs/screenshots/summary.png differ
Binary files /dev/null and b/docs/screenshots/tree.png differ
@@ -1,0 +1,78 @@
use crate::{git::GitSignature, prelude::*, time::Time};
use gix::Reference;
pub struct Branch<'repo> {
pub name: String,
pub last_commit: Commit<'repo>,
pub author: GitSignature,
pub time: Time,
pub gix: Reference<'repo>,
}
impl<'repo> Branch<'repo> {
pub fn from_gix(mut reference: Reference<'repo>) -> Result<Branch<'repo>, Error> {
let commit = reference.peel_to_commit()?;
Ok(Branch {
name: reference.name().shorten().to_string(),
last_commit: Commit::from_gix(commit.clone())?,
author: GitSignature::from_gix(commit.author()?),
time: Time::new(commit.time()?),
gix: reference,
})
}
pub fn is_head(&self, repo: &Repository) -> Result<bool, Error> {
Ok(repo.head_branch_name()? == self.name)
}
}
impl Repository {
pub fn head_branch_name(&self) -> Result<String, Error> {
let gix_repo = self.gix();
let head = gix_repo.head()?;
let branch_name = match head.referent_name() {
Some(b) => b.shorten().to_string(),
None => head.name().shorten().to_string(),
};
Ok(branch_name)
}
pub fn branches<'repo>(
&self,
gix_repo: &'repo gix::Repository,
offset: usize,
limit: usize,
) -> Result<(Vec<Branch<'repo>>, bool), Error> {
let references = gix_repo.references()?;
let gix_branches = references.local_branches()?;
let mut branches: Vec<Branch> = Vec::new();
let mut has_next = false;
for (i, branch) in gix_branches.skip(offset).enumerate() {
if i >= limit {
has_next = true;
break;
}
let branch = branch?;
branches.push(Branch::from_gix(branch)?);
}
Ok((branches, has_next))
}
pub fn branch_names(&self) -> Result<Vec<String>, Error> {
let gix_repo = self.gix();
let references = gix_repo.references()?;
let gix_branches = references.local_branches()?;
let mut names: Vec<String> = Vec::new();
for branch in gix_branches {
let branch = branch?;
names.push(branch.name().shorten().to_string());
}
Ok(names)
}
}
@@ -1,0 +1,156 @@
use std::str::FromStr;
use std::{borrow::Cow, collections::HashMap};
use gix::{bstr::BStr, utils::AsBStr};
use crate::{prelude::*, time::Time};
pub struct Commit<'repo> {
pub id: String,
pub tree_id: String,
pub parents: Vec<String>,
pub author: GitSignature,
pub committer: GitSignature,
pub time: Time,
pub gix: gix::Commit<'repo>,
}
impl<'repo> Commit<'repo> {
pub fn from_gix(gix: gix::Commit<'_>) -> Result<Commit<'_>, Error> {
let commit_id = gix.id().to_string();
let tree_id = gix.tree_id()?.to_string();
let parents = gix.parent_ids().map(|id| id.to_string()).collect();
Ok(Commit {
id: commit_id,
tree_id,
parents,
author: GitSignature::from_gix(gix.author()?),
committer: GitSignature::from_gix(gix.committer()?),
time: Time::new(gix.time()?),
gix,
})
}
pub fn summary(&'repo self) -> Result<Cow<'repo, BStr>, Error> {
Ok(self.gix.message()?.summary())
}
pub fn body(&'repo self) -> Result<&'repo BStr, Error> {
Ok(self.gix.message()?.body.unwrap_or(BStr::new("")))
}
pub fn branch_name(&self, repo: &Repository) -> Result<Option<String>, Error> {
let mut branch_name: Option<String> = None;
let gix_repo = repo.gix();
let references = gix_repo.references()?;
let local_branches = references.local_branches()?;
for branch in local_branches {
let mut branch = branch?;
let commit_id = branch.peel_to_commit()?.id().to_string();
if commit_id == self.id {
branch_name = Some(branch.name().shorten().to_string())
}
}
Ok(branch_name)
}
pub fn branch_tips(&self, repo: &Repository) -> Result<Vec<String>, Error> {
let branch_tips = repo.branch_tips_by_commit()?;
Ok(branch_tips.get(&self.id).cloned().unwrap_or_default())
}
pub fn is_head(&self, repo: &Repository) -> Result<bool, Error> {
let head_commit_id: Option<String> =
repo.gix().head_commit().ok().map(|c| c.id().to_string());
Ok(head_commit_id.as_deref() == Some(&self.id))
}
}
impl Repository {
pub fn find_commit<'repo>(
&self,
gix_repo: &'repo gix::Repository,
id: &str,
) -> Result<Commit<'repo>, Error> {
Commit::from_gix(
gix_repo
.find_commit(gix::ObjectId::from_str(id)?)?
.to_owned(),
)
}
pub fn last_commit<'repo>(
&self,
gix_repo: &'repo gix::Repository,
) -> Result<Option<Commit<'repo>>, Error> {
for reference in gix_repo.references()?.all()? {
let Ok(commit) = reference?.peel_to_commit() else {
continue;
};
return Ok(Some(Commit::from_gix(commit)?));
}
Ok(None)
}
pub fn branch_tips_by_commit(&self) -> Result<HashMap<String, Vec<String>>, Error> {
let gix_repo = self.gix();
let references = gix_repo.references()?;
let local_branches = references.local_branches()?;
let mut map: HashMap<String, Vec<String>> = HashMap::new();
for branch in local_branches {
let mut branch = branch?;
let commit_id = branch.peel_to_commit()?.id().to_string();
map.entry(commit_id)
.or_default()
.push(branch.name().shorten().to_string());
}
Ok(map)
}
pub fn commits<'repo>(
&self,
gix_repo: &'repo gix::Repository,
current_ref: &Ref,
offset: usize,
limit: usize,
filter: Option<&dyn Fn(&Commit) -> bool>,
) -> Result<(Vec<Commit<'repo>>, bool), Error> {
let start = gix_repo.rev_parse_single(current_ref.name.as_bstr())?;
let revwalk = gix_repo.rev_walk([start]).all()?;
let mut commits: Vec<Commit> = Vec::new();
let mut has_next = false;
let mut matched = 0usize;
for rev in revwalk {
let rev = rev?;
let object = rev.object()?;
let commit = Commit::from_gix(object)?;
if let Some(f) = filter
&& !f(&commit)
{
continue;
}
if matched < offset {
matched += 1;
continue;
}
if commits.len() >= limit {
has_next = true;
break;
}
commits.push(commit);
}
Ok((commits, has_next))
}
}
@@ -1,0 +1,612 @@
use std::fmt::{self, Display, Write};
use gix::{
bstr::{BStr, ByteSlice},
diff::blob::platform::prepare_diff::Operation,
};
use crate::prelude::*;
#[derive(Default)]
pub struct Diff {
pub file_diffs: Vec<FileDiff>,
pub output: String,
pub stats: String,
pub files_changed: usize,
pub insertions: usize,
pub deletions: usize,
pub total: usize,
}
#[derive(Default)]
pub enum FileState {
Added,
Removed,
#[default]
Changed,
}
impl Display for FileState {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
match self {
Self::Added => write!(f, "diffstat-added"),
Self::Removed => write!(f, "diffstat-removed"),
Self::Changed => write!(f, "diffstat-changed"),
}
}
}
#[derive(Default)]
pub struct FileDiff {
pub path: String,
pub state: FileState,
pub mode: String,
pub insertions: usize,
pub deletions: usize,
pub total: usize,
pub insertions_percentage: f64,
pub deletions_percentage: f64,
pub total_percentage: f64,
}
#[derive(PartialEq)]
pub enum DiffFormat {
Plain,
Patch,
}
impl<'repo> Commit<'repo> {
pub fn diff(
&self,
repo: &Repository,
limit_file: Option<String>,
format: DiffFormat,
) -> Result<Diff, Error> {
match format {
DiffFormat::Plain => self.diff_with(repo, limit_file, PlainDiffFormatter),
DiffFormat::Patch => self.diff_with(repo, limit_file, PatchDiffFormatter),
}
}
fn diff_with<F: DiffFormatter>(
&self,
repo: &Repository,
limit_file: Option<String>,
formatter: F,
) -> Result<Diff, Error> {
const WIDTH: usize = 80;
let mut diff = Diff::default();
let gix_repo = repo.gix();
let current_tree = self.gix.tree()?;
let parent_tree = self
.gix
.ancestors()
.first_parent_only()
.all()?
.nth(1)
.transpose()?
.map(|v| v.object())
.transpose()?
.map(|v| v.tree())
.transpose()?
.unwrap_or_else(|| gix_repo.empty_tree());
// hoisted out of the per-change closure — it's the same for every
// file in this commit, no need to recompute it each time.
let parent_id = self.gix.parent_ids().next().map(|id| id.to_string());
let commit_id = self.gix.id.to_string();
let mut resource_cache = repo.gix().diff_resource_cache_for_tree_diff()?;
let mut changes = parent_tree.changes()?;
changes.options(|opts| {
opts.track_path().track_rewrites(None);
});
changes.for_each_to_obtain_tree_with_cache(
¤t_tree,
&mut gix_repo.diff_resource_cache_for_tree_diff()?,
|change| {
DiffBuilder {
output: &mut diff.output,
resource_cache: &mut resource_cache,
diffs: &mut diff.file_diffs,
formatter: &formatter,
}
.handle(
change,
repo,
parent_id.as_deref(),
&commit_id,
limit_file.clone(),
)
},
)?;
let files_changed = diff.file_diffs.len();
let insertions: usize = diff.file_diffs.iter().map(|f| f.insertions).sum();
let deletions: usize = diff.file_diffs.iter().map(|f| f.deletions).sum();
diff.files_changed = files_changed;
diff.insertions = insertions;
diff.deletions = deletions;
diff.total = diff.deletions.saturating_add(diff.insertions);
if formatter.format() == DiffFormat::Patch {
let (max_file_name_length, max_change_length) = diff.file_diffs.iter().fold(
(0, 0),
|(max_file_name_length, max_change_length), stats| {
(
max_file_name_length.max(stats.path.len()),
max_change_length
.max(((stats.insertions + stats.deletions + 1).ilog10() + 1) as usize),
)
},
);
for file_diff in &diff.file_diffs {
let local_changes = file_diff.insertions + file_diff.deletions;
let width = WIDTH.min(local_changes);
let addition_width = (width * file_diff.insertions) / diff.total;
let deletion_width = (width * file_diff.deletions) / diff.total;
// Handle edge case where total width is less than total changes
let remaining_width = width - (addition_width + deletion_width);
let adjusted_addition_width = addition_width + remaining_width.min(diff.insertions);
let adjusted_deletion_width =
deletion_width + (remaining_width - remaining_width.min(diff.insertions));
// Generate the string representation
let plus_str = "+".repeat(adjusted_addition_width);
let minus_str = "-".repeat(adjusted_deletion_width);
let file = file_diff.path.as_str();
writeln!(diff.stats, " {file:max_file_name_length$} | {local_changes:max_change_length$} {plus_str}{minus_str}").unwrap();
}
}
for (i, (singular_desc, plural_desc, amount)) in [
("file changed", "files changed", files_changed),
("insertion(+)", "insertions(+)", insertions),
("deletion(-)", "deletions(-)", deletions),
]
.into_iter()
.enumerate()
{
if amount == 0 {
continue;
}
let prefix = if i == 0 { "" } else { "," };
let desc = if amount == 1 {
singular_desc
} else {
plural_desc
};
write!(diff.stats, "{prefix} {amount} {desc}")?;
}
writeln!(diff.stats)?;
diff.file_diffs = diff
.file_diffs
.into_iter()
.map(|f| {
let total_percentage = if diff.total < 100 && diff.total > 0 {
diff.total as f64
} else if diff.total > 0 {
(f.total as f64) * 100.0 / (diff.total as f64)
} else {
0.0
};
let (insertions_percentage, deletions_percentage) = if f.total > 0 {
(
(f.insertions as f64) * 100.0 / (f.total as f64),
(f.deletions as f64) * 100.0 / (f.total as f64),
)
} else {
(0.0, 0.0)
};
FileDiff {
total_percentage,
insertions_percentage,
deletions_percentage,
..f
}
})
.collect();
Ok(diff)
}
}
trait DiffFormatter {
fn file_header(&self, output: &mut String, data: fmt::Arguments<'_>);
fn write(&self, output: &mut String, class: &str, data: &str);
fn binary(
&self,
output: &mut String,
left: &str,
right: &str,
left_content: &[u8],
right_content: &[u8],
);
fn path_line(
&self,
prefix: char,
is_null: bool,
state: &FileState,
repo_name: &str,
rela_path: &BStr,
rev_id: &str,
) -> String;
fn format(&self) -> DiffFormat;
}
struct DiffBuilder<'a, F> {
output: &'a mut String,
resource_cache: &'a mut gix::diff::blob::Platform,
diffs: &'a mut Vec<FileDiff>,
formatter: &'a F,
}
impl<F: DiffFormatter> DiffBuilder<'_, F> {
fn handle(
&mut self,
change: gix::object::tree::diff::Change<'_, '_, '_>,
repo: &Repository,
parent_id: Option<&str>,
commit_id: &str,
limit_file: Option<String>,
) -> anyhow::Result<gix::object::tree::diff::Action> {
if !change.entry_mode().is_blob_or_symlink() {
return Ok(gix::object::tree::diff::Action::Continue(()));
}
let path = change.location().to_string();
if let Some(limit_file) = limit_file
&& limit_file != path
&& !limit_file.is_empty()
{
return Ok(gix::object::tree::diff::Action::Continue(()));
}
let mut diff = FileDiff {
path,
..Default::default()
};
let change = change.diff(self.resource_cache)?;
let prep = change.resource_cache.prepare_diff()?;
self.formatter.file_header(
self.output,
format_args!(
"diff --git a/{} b/{}",
prep.old.rela_path, prep.new.rela_path
),
);
if prep.old.id.is_null() {
self.formatter.file_header(
self.output,
format_args!("new file mode {}", prep.new.mode.as_octal_str()),
);
diff.state = FileState::Added;
} else if prep.new.id.is_null() {
self.formatter.file_header(
self.output,
format_args!("deleted file mode {}", prep.old.mode.as_octal_str()),
);
diff.state = FileState::Removed;
} else if prep.new.mode != prep.old.mode {
self.formatter.file_header(
self.output,
format_args!("old mode {}", prep.old.mode.as_octal_str()),
);
self.formatter.file_header(
self.output,
format_args!("new mode {}", prep.new.mode.as_octal_str()),
);
}
// mode shown in the diffstat table: whichever side still exists
let mode_source = if matches!(diff.state, FileState::Removed) {
prep.old.mode
} else {
prep.new.mode
};
let raw_mode = u32::from_str_radix(mode_source.as_octal_str().to_str()?, 8)?;
diff.mode = format_mode(raw_mode);
// copy from / copy to / rename old / rename new / rename from /
// rename to / similarity index / dissimilarity index — TODO
let (index_suffix_sep, index_suffix) = if prep.old.mode == prep.new.mode {
(" ", prep.new.mode.as_octal_str())
} else {
("", BStr::new(&[]))
};
let old_path = self.formatter.path_line(
'a',
prep.old.id.is_null(),
&diff.state,
&repo.name,
prep.old.rela_path,
parent_id.unwrap_or_default(),
);
let new_path = self.formatter.path_line(
'b',
prep.new.id.is_null(),
&diff.state,
&repo.name,
prep.new.rela_path,
commit_id,
);
match prep.operation {
Operation::InternalDiff { algorithm } => {
self.formatter.file_header(
self.output,
format_args!(
"index {}..{}{index_suffix_sep}{index_suffix}",
prep.old.id.to_hex_with_len(7),
prep.new.id.to_hex_with_len(7)
),
);
self.formatter
.file_header(self.output, format_args!("--- {old_path}"));
self.formatter
.file_header(self.output, format_args!("+++ {new_path}"));
let old_source = gix::diff::blob::sources::lines(str::from_utf8(
prep.old.data.as_slice().unwrap_or_default(),
)?);
let new_source = gix::diff::blob::sources::lines(str::from_utf8(
prep.new.data.as_slice().unwrap_or_default(),
)?);
let input = gix::diff::blob::InternedInput::new(old_source, new_source);
let output = gix::diff::blob::Diff::compute(algorithm, &input);
diff.deletions += output.count_removals() as usize;
diff.insertions += output.count_additions() as usize;
diff.total = diff.deletions.saturating_add(diff.insertions);
Self::write_hunks(self.formatter, self.output, &input, &output);
}
Operation::ExternalCommand { .. } => {}
Operation::SourceOrDestinationIsBinary => {
self.formatter.file_header(
self.output,
format_args!(
"index {}..{}{index_suffix_sep}{index_suffix}",
prep.old.id, prep.new.id,
),
);
self.formatter.binary(
self.output,
old_path.as_ref(),
new_path.as_ref(),
prep.old.data.as_slice().unwrap_or_default(),
prep.new.data.as_slice().unwrap_or_default(),
);
}
}
self.diffs.push(diff);
self.resource_cache.clear_resource_cache_keep_allocation();
Ok(gix::object::tree::diff::Action::Continue(()))
}
fn write_hunks(
formatter: &F,
output: &mut String,
input: &gix::diff::blob::InternedInput<&str>,
diff: &gix::diff::blob::Diff,
) {
const CONTEXT_LINES: u32 = 3;
let hunks: Vec<_> = diff.hunks().collect();
let mut i = 0;
while i < hunks.len() {
let start = i;
let mut end = i + 1;
while end < hunks.len()
&& hunks[end]
.before
.start
.saturating_sub(hunks[end - 1].before.end)
<= CONTEXT_LINES * 2
{
end += 1;
}
i = end;
let first = &hunks[start];
let last = &hunks[end - 1];
let before_start = first.before.start.saturating_sub(CONTEXT_LINES);
let before_end = (last.before.end + CONTEXT_LINES).min(input.before.len() as u32);
let after_start = first.after.start.saturating_sub(CONTEXT_LINES);
let after_end = (last.after.end + CONTEXT_LINES).min(input.after.len() as u32);
formatter.write(
output,
"hunk",
&format!(
"@@ -{},{} +{},{} @@\n",
before_start + 1,
before_end - before_start,
after_start + 1,
after_end - after_start,
),
);
let mut before_pos = before_start;
let mut _after_pos = after_start;
for hunk in &hunks[start..end] {
while before_pos < hunk.before.start {
let line = input.interner[input.before[before_pos as usize]];
formatter.write(output, "context", line);
before_pos += 1;
_after_pos += 1;
}
for pos in hunk.before.clone() {
let line = input.interner[input.before[pos as usize]];
formatter.write(output, "deletion", line);
}
before_pos = hunk.before.end;
for pos in hunk.after.clone() {
let line = input.interner[input.after[pos as usize]];
formatter.write(output, "addition", line);
}
_after_pos = hunk.after.end;
}
while before_pos < before_end {
let line = input.interner[input.before[before_pos as usize]];
formatter.write(output, "context", line);
before_pos += 1;
_after_pos += 1;
}
}
}
}
// ---- unchanged, per your request ----
struct PlainDiffFormatter;
impl DiffFormatter for PlainDiffFormatter {
fn file_header(&self, output: &mut String, data: fmt::Arguments<'_>) {
write!(output, r#"<span class="diff-file-header">"#).unwrap();
write!(output, "{data}").unwrap();
output.push_str("</span>\n");
}
fn write(&self, output: &mut String, class: &str, data: &str) {
write!(output, r#"<span class="diff-{class}">"#).unwrap();
v_htmlescape::b_escape(data.as_bytes(), output);
output.push_str("</span>");
}
fn binary(
&self,
output: &mut String,
left: &str,
right: &str,
_left_content: &[u8],
_right_content: &[u8],
) {
// todo: actually perform the diff and write a `GIT binary patch` out
writeln!(output, "Binary files {left} and {right} differ").unwrap();
}
fn path_line(
&self,
prefix: char,
is_null: bool,
state: &FileState,
repo_name: &str,
rela_path: &BStr,
rev_id: &str,
) -> String {
if is_null {
"/dev/null".to_string()
} else {
format!(
"{prefix}/<a class='{state}' href='/{repo_name}/diff/{rela_path}?id={rev_id}'>{rela_path}</a>"
)
}
}
fn format(&self) -> DiffFormat {
DiffFormat::Plain
}
}
// ---- new: plain unified diff, git-apply compatible ----
struct PatchDiffFormatter;
impl DiffFormatter for PatchDiffFormatter {
fn file_header(&self, output: &mut String, data: fmt::Arguments<'_>) {
writeln!(output, "{data}").unwrap();
}
fn write(&self, output: &mut String, class: &str, data: &str) {
// unified diff requires a literal leading +/-/space on every
// content line — this is what the Plain (CSS-classed) formatter
// can skip but a real patch cannot.
let prefix = match class {
"addition" => "+",
"deletion" => "-",
"context" => " ",
_ => "", // hunk header line, no prefix
};
output.push_str(prefix);
output.push_str(data);
}
fn binary(
&self,
output: &mut String,
left: &str,
right: &str,
_left_content: &[u8],
_right_content: &[u8],
) {
// todo: emit an actual `GIT binary patch` block
writeln!(output, "Binary files {left} and {right} differ").unwrap();
}
fn path_line(
&self,
prefix: char,
is_null: bool,
_state: &FileState,
_repo_name: &str,
rela_path: &BStr,
_rev_id: &str,
) -> String {
if is_null {
"/dev/null".to_string()
} else {
format!("{prefix}/{rela_path}")
}
}
fn format(&self) -> DiffFormat {
DiffFormat::Patch
}
}
pub fn format_mode(mode: u32) -> String {
let file_type = match mode & 0o170000 {
0o040000 => 'd',
0o120000 => 'l',
0o160000 => 'm',
0o100000 => '-',
_ => '?',
};
let perms = mode & 0o777;
let mut out = String::with_capacity(10);
out.push(file_type);
for &shift in &[6, 3, 0] {
let bits = (perms >> shift) & 0o7;
out.push(if bits & 0o4 != 0 { 'r' } else { '-' });
out.push(if bits & 0o2 != 0 { 'w' } else { '-' });
out.push(if bits & 0o1 != 0 { 'x' } else { '-' });
}
out
}
@@ -1,0 +1,10 @@
pub mod branch;
pub mod commit;
pub mod diff;
pub mod refs;
pub mod repository;
pub mod signature;
pub mod tag;
pub mod tree;
pub use signature::GitSignature;
@@ -1,0 +1,22 @@
use crate::{prelude::*, routes::PageQuery};
pub struct Ref {
pub name: String,
pub is_head: bool,
}
impl Ref {
pub fn resolve(repo: &Repository, query: &PageQuery) -> Result<Ref, Error> {
let head_branch_name = repo.head_branch_name()?;
match &query.head {
Some(h) if !h.is_empty() => Ok(Ref {
name: h.clone(),
is_head: *h == head_branch_name,
}),
_ => Ok(Ref {
name: head_branch_name,
is_head: true,
}),
}
}
}
@@ -1,0 +1,216 @@
use std::{
ffi::OsStr,
path::{Path, PathBuf},
};
use anyhow::Context;
use flate2::{Compression, write::GzEncoder};
use gix::objs::tree::EntryKind;
use tar::Builder;
use crate::{
error::Error,
git::{
commit::Commit,
refs::Ref,
tree::{Blob, PathView},
},
};
#[derive(Clone)]
pub struct Repository {
pub name: String,
pub description: String,
pub owner: Option<String>,
// So clients dont see the path
pub path: PathBuf,
pub gix: gix::ThreadSafeRepository,
}
impl Repository {
pub fn open(path: &Path) -> Result<Self, Error> {
let Some(name) = path.file_name().and_then(OsStr::to_str) else {
return Err(Error::Failed);
};
let description = std::fs::read(path.join("description")).unwrap_or_default();
let description = match String::from_utf8(description) {
Ok(v) => {
if !v.is_empty() {
v
} else {
"There is no description!".to_string()
}
}
Err(_) => "Failed to get the description!".to_string(),
};
let gix = match gix::ThreadSafeRepository::open(path) {
Ok(repo) => repo,
Err(_) => return Err(Error::Failed),
};
let owner = gix
.to_thread_local()
.config_snapshot()
.string("gitweb.owner")
.map(|v| v.to_string());
Ok(Self {
name: name.to_string(),
description,
owner,
path: path.to_path_buf(),
gix,
})
}
pub fn gix(&self) -> gix::Repository {
self.gix.to_thread_local()
}
pub fn readme(&self) -> Option<String> {
let gix_repo = self.gix();
let commit = gix_repo.head().ok()?.peel_to_commit().ok()?;
let tree = commit.tree().ok()?;
let entry = tree.iter().find(|entry| {
entry
.as_ref()
.unwrap()
.filename()
.to_string()
.to_lowercase()
.starts_with("readme")
})?;
let blob = entry.unwrap().object().unwrap().into_blob();
Some(String::from_utf8_lossy(&blob.data).into_owned())
}
pub fn archive(
&self,
current_ref: &Ref,
commit: &Option<String>,
) -> Result<(Vec<u8>, String), anyhow::Error> {
let gix_repo = self.gix();
let (tree, filename) = if let Some(commit) = commit {
(
self.find_commit(&gix_repo, commit)?.gix.tree()?,
format!("{}.tar.gz", commit),
)
} else {
(
gix_repo.find_reference(¤t_ref.name)?.peel_to_tree()?,
format!("{}.tar.gz", current_ref.name.replace('/', "-")),
)
};
let encoder = GzEncoder::new(Vec::new(), Compression::default());
let mut builder = Builder::new(encoder);
Self::add_tree_to_archive(&tree, "", &mut builder)?;
// finish() flushes the tar footer, then finish() on the gz encoder
// flushes the gzip footer and gives you the final Vec<u8>.
let encoder = builder.into_inner()?;
let bytes = encoder.finish()?;
Ok((bytes, filename))
}
fn add_tree_to_archive(
tree: &gix::Tree<'_>,
prefix: &str,
builder: &mut Builder<GzEncoder<Vec<u8>>>,
) -> anyhow::Result<()> {
for entry in tree.iter() {
let entry = entry?;
let mode = entry.mode();
let name = entry.filename().to_string();
let path = if prefix.is_empty() {
name
} else {
format!("{prefix}/{name}")
};
if mode.is_tree() {
let subtree = entry.object()?.into_tree();
Self::add_tree_to_archive(&subtree, &path, builder)?;
} else if mode.is_blob() || mode.is_executable() {
let blob = entry.object()?.into_blob();
let data = &blob.data;
let mut header = tar::Header::new_gnu();
header.set_size(data.len() as u64);
header.set_mode(if mode.is_executable() { 0o755 } else { 0o644 });
header.set_cksum();
builder.append_data(&mut header, &path, &data[..])?;
}
// symlinks (mode.is_link()) intentionally skipped here — add
// handling if you need them (header.set_entry_type(EntryType::Symlink)
// + set_link_name to the blob content as the target path).
}
Ok(())
}
pub fn resolve_path(&self, current_ref: &Ref, path: &str) -> anyhow::Result<PathView> {
let gix_repo = self.gix();
let commit = Commit::from_gix(
gix_repo
.find_reference(¤t_ref.name.to_string())?
.peel_to_commit()?,
)?; // however you currently get a Commit from a Ref
let path = path.trim_matches('/');
if path.is_empty() {
// root of the tree
let entries = commit.tree("")?;
return Ok(PathView::Tree(entries));
}
let tree = commit.gix.tree().context("failed to get root tree")?;
let entry = tree
.lookup_entry_by_path(path)
.with_context(|| format!("failed lookup for path: {path}"))?
.with_context(|| format!("path not found: {path}"))?;
let mode = entry.mode();
let kind = mode.kind();
match kind {
EntryKind::Tree => {
let entries = commit.tree(path)?;
Ok(PathView::Tree(entries))
}
EntryKind::Blob | EntryKind::BlobExecutable => {
let object = entry.object().context("failed to load blob object")?;
let blob = object
.try_into_blob()
.map_err(|_| anyhow::anyhow!("entry is not a blob"))?;
let id = entry.oid().to_string();
let size = blob.data.len() as u64;
// try to decode as UTF-8 text; if it fails, treat as binary
let lines = std::str::from_utf8(&blob.data)
.ok()
.map(|s| s.lines().map(|l| l.to_string()).collect());
Ok(PathView::Blob(Blob {
id,
mode: mode.value() as u32,
size,
lines,
}))
}
EntryKind::Link => {
anyhow::bail!("symlinks are not yet supported for direct viewing")
}
EntryKind::Commit => {
anyhow::bail!("path resolves to a submodule, not a viewable file/dir")
}
}
}
}
@@ -1,0 +1,29 @@
use gix::actor::SignatureRef;
use crate::time::Time;
#[derive(Clone)]
pub struct GitSignature {
pub name: String,
pub email: String,
pub time: Time,
}
impl GitSignature {
pub fn from_gix(sig: SignatureRef) -> Self {
GitSignature {
name: sig.name.to_string(),
email: sig.email.to_string(),
time: Time::new(sig.time().unwrap()),
}
}
pub fn avatar_url(&self, size: u32) -> String {
let normalized = self.email.trim().to_lowercase();
let hash = md5::compute(normalized.as_bytes());
format!(
"https://www.gravatar.com/avatar/{:x}?s={}&d=retro",
hash, size
)
}
}
@@ -1,0 +1,106 @@
use anyhow::Context;
use gix::objs::{Kind, TagRef};
use crate::prelude::*;
pub enum TaggedObject {
Commit(String),
Tree(String),
}
pub struct Tag {
pub name: String,
pub id: String,
pub message: String,
pub tagger: Option<GitSignature>,
pub tagged_object: Option<TaggedObject>,
pub time: Time,
}
impl Tag {
pub fn from_gix(mut gix: gix::Reference<'_>) -> anyhow::Result<Tag> {
let tag = match gix.peel_to_tag() {
Ok(tag) => tag.detach().data,
Err(error) => Self::lightweight_tag_object_data(&mut gix).with_context(|| {
format!("Couldn't get to a tag from the given reference: {error}")
})?,
};
let tag_ref = TagRef::from_bytes(&tag, gix::hash::Kind::shortest())?;
let message = tag_ref.message.to_string();
let tagged_object = match tag_ref.target_kind {
Kind::Commit => Some(TaggedObject::Commit(tag_ref.target.to_string())),
Kind::Tree => Some(TaggedObject::Tree(tag_ref.target.to_string())),
_ => None,
};
let time: Time;
let mut tagger: Option<GitSignature> = None;
if let Some(sig) = tag_ref.tagger()? {
tagger = Some(GitSignature::from_gix(sig))
}
if let Some(ref tagger) = tagger {
time = tagger.time.clone()
} else {
time = Time::new(
gix.peel_to_commit()
.with_context(|| "Couldn't get to a commit from the given reference!")?
.time()?,
)
}
Ok(Tag {
name: gix.name().shorten().to_string(),
id: gix.id().to_string(),
message,
tagger,
tagged_object,
time,
})
}
fn lightweight_tag_object_data(reference: &mut gix::Reference) -> anyhow::Result<Vec<u8>> {
let target = reference
.follow_to_object()
.context("Failed to resolve lightweight tag target")?;
let tag_name = reference.name().shorten();
let target_kind = target.header()?.kind();
if target_kind == Kind::Tag {
anyhow::bail!("reference resolves to an annotated tag object");
}
Ok(format!("object {target}\ntype {target_kind}\ntag {tag_name}\n\n").into_bytes())
}
}
impl Repository {
pub fn find_tag(&self, name: &str) -> anyhow::Result<Tag> {
let gix_repo = self.gix();
Tag::from_gix(
gix_repo
.find_reference(&format!("tags/{}", name))?
.to_owned(),
)
}
pub fn tags(&self, offset: usize, limit: usize) -> anyhow::Result<(Vec<Tag>, bool)> {
let gix_repo = self.gix();
let references = gix_repo.references()?;
let gix_tags = references.tags()?;
let mut tags: Vec<Tag> = Vec::new();
let mut has_next = false;
for (i, rev) in gix_tags.skip(offset).enumerate() {
if i >= limit {
has_next = true;
break;
}
let rev = rev.unwrap();
tags.push(Tag::from_gix(rev)?);
}
Ok((tags, has_next))
}
}
@@ -1,0 +1,169 @@
use crate::prelude::*;
use anyhow::Context;
use gix::objs::tree::EntryKind;
use serde::Serialize;
#[derive(Clone)]
pub struct TreeEntry {
pub name: String,
pub path: String, // full path from repo root, for building links
pub kind: EntryKind,
pub size: Option<u64>, // only set for files
pub mode: u32,
pub id: String,
}
impl TreeEntry {
pub fn size_display(&self) -> String {
match self.size {
Some(bytes) => format_size(bytes),
None => "—".to_string(),
}
}
pub fn mode_display(&self) -> String {
format_mode(self.mode, &self.kind)
}
}
impl<'repo> Commit<'repo> {
pub fn tree(&self, dir_path: &str) -> anyhow::Result<Vec<TreeEntry>> {
let mut entries: Vec<TreeEntry> = Vec::new();
let base_tree = if dir_path.is_empty() {
self.gix.tree().context("failed to get root tree")?
} else {
self.gix
.tree()
.context("failed to get root tree")?
.lookup_entry_by_path(dir_path)
.with_context(|| format!("failed lookup for path: {dir_path}"))?
.with_context(|| format!("path not found: {dir_path}"))?
.object()
.context("failed to load object")?
.try_into_tree()
.context("path did not resolve to a tree")?
};
for entry in base_tree.iter() {
let entry = entry.context("failed to read tree entry")?;
let name = entry.filename().to_string();
let full_path = if dir_path.is_empty() {
name.clone()
} else {
format!("{dir_path}/{name}")
};
let id = entry.oid().to_string();
let mode = entry.mode();
let kind = mode.kind();
let size = if matches!(kind, EntryKind::Blob | EntryKind::BlobExecutable) {
entry
.object()
.context("failed to load blob object")?
.try_into_blob()
.ok()
.map(|blob| blob.data.len() as u64)
} else {
None
};
entries.push(TreeEntry {
name,
path: full_path,
kind,
size,
mode: mode.value() as u32,
id,
});
}
Ok(entries)
}
}
#[derive(Clone, Serialize)]
pub struct Blob {
pub id: String,
pub mode: u32,
pub size: u64,
pub lines: Option<Vec<String>>, // None => binary, can't show as text
}
impl Blob {
pub fn mode_display(&self) -> String {
format_mode(self.mode, &EntryKind::Blob)
}
}
pub enum PathView {
Tree(Vec<TreeEntry>),
Blob(Blob),
}
#[derive(Clone, Serialize)]
pub struct Breadcrumb {
pub name: String,
pub path: String, // cumulative path up to and including this segment
}
pub fn build_breadcrumbs(path: &str) -> Vec<Breadcrumb> {
let mut crumbs = Vec::new();
let mut acc = String::new();
for segment in path.split('/').filter(|s| !s.is_empty()) {
if !acc.is_empty() {
acc.push('/');
}
acc.push_str(segment);
crumbs.push(Breadcrumb {
name: segment.to_string(),
path: acc.clone(),
});
}
crumbs
}
pub fn parent_path(path: &str) -> Option<String> {
if path.is_empty() {
return None;
}
match path.rsplit_once('/') {
Some((parent, _)) => Some(parent.to_string()),
None => Some(String::new()), // one level deep -> parent is root
}
}
pub fn format_mode(mode: u32, kind: &EntryKind) -> String {
match kind {
EntryKind::Tree => "drwxr-xr-x".to_string(),
EntryKind::Link => "lrwxrwxrwx".to_string(),
EntryKind::Commit => "m---------".to_string(), // submodule / gitlink
EntryKind::Blob | EntryKind::BlobExecutable => {
let perm = mode & 0o777;
let mut s = String::from("-");
for shift in [6, 3, 0] {
let bits = (perm >> shift) & 0o7;
s.push(if bits & 0o4 != 0 { 'r' } else { '-' });
s.push(if bits & 0o2 != 0 { 'w' } else { '-' });
s.push(if bits & 0o1 != 0 { 'x' } else { '-' });
}
s
}
}
}
fn format_size(bytes: u64) -> String {
const UNITS: [&str; 5] = ["B", "KB", "MB", "GB", "TB"];
let mut size = bytes as f64;
let mut unit = 0;
while size >= 1024.0 && unit < UNITS.len() - 1 {
size /= 1024.0;
unit += 1;
}
if unit == 0 {
format!("{bytes} B")
} else {
format!("{size:.1} {}", UNITS[unit])
}
}
@@ -1,0 +1,15 @@
use crate::prelude::*;
#[derive(Template)]
#[template(path = "about.html")]
struct About {}
#[get("/about")]
pub async fn page() -> ActixResult<HttpResponse> {
let rendered = About {}.render();
match rendered {
Ok(html) => Ok(HttpResponse::Ok().content_type("text/html").body(html)),
Err(e) => Ok(HttpResponse::InternalServerError().body(e.to_string())),
}
}
@@ -1,0 +1,107 @@
use std::{
collections::HashMap,
io::Write,
process::{Command, Stdio},
};
use actix_web::web::Bytes;
use crate::prelude::*;
#[get("/{repo}/info/refs")]
pub async fn git_info_refs(
path: web::Path<String>,
req_query: web::Query<HashMap<String, String>>,
data: web::Data<App>,
) -> ActixResult<HttpResponse> {
let service = match req_query.get("service") {
Some(s) => s,
None => return Ok(HttpResponse::BadRequest().body("Missing service parameter")),
};
if service != "git-upload-pack" && service != "git-receive-pack" {
return Ok(HttpResponse::BadRequest().body("Unsupported service"));
}
let name = path.into_inner();
let repo = match data.find_repo(name) {
Some(r) => r,
None => return Ok(HttpResponse::NotFound().body("Repo not found")),
};
let first_line = format!("# service={}\n", service);
let pkt_line = format!("{:04x}{}", first_line.len() + 4, first_line);
let zero_line = "0000";
let output = Command::new("git")
.arg(service.strip_prefix("git-").unwrap())
.arg("--stateless-rpc")
.arg("--advertise-refs")
.arg(&repo.path)
.output();
match output {
Ok(out) => {
let mut body = Vec::new();
body.extend_from_slice(pkt_line.as_bytes());
body.extend_from_slice(zero_line.as_bytes());
body.extend_from_slice(&out.stdout);
Ok(HttpResponse::Ok()
.content_type(format!("application/x-{}-advertisement", service))
.body(body))
}
Err(_) => Ok(HttpResponse::InternalServerError().body("Git command failed")),
}
}
#[post("/{repo}/git-upload-pack")]
pub async fn git_upload_pack(
path: web::Path<String>,
data: web::Data<App>,
body: Bytes,
) -> ActixResult<HttpResponse> {
let name = path.into_inner();
let repo = match data.find_repo(name) {
Some(r) => r,
None => return Ok(HttpResponse::NotFound().body("Repo not found")),
};
Ok(handle_git_rpc("upload-pack", repo, body).await)
}
#[post("/{repo}/git-receive-pack")]
pub async fn git_receive_pack(
path: web::Path<String>,
data: web::Data<App>,
body: Bytes,
) -> ActixResult<HttpResponse> {
let name = path.into_inner();
let repo = match data.find_repo(name) {
Some(r) => r,
None => return Ok(HttpResponse::NotFound().body("Repo not found")),
};
Ok(handle_git_rpc("receive-pack", repo, body).await)
}
async fn handle_git_rpc(service: &str, repo: Repository, body: Bytes) -> HttpResponse {
let mut child = Command::new("git")
.arg(service)
.arg("--stateless-rpc")
.arg(&repo.path)
.stdin(Stdio::piped())
.stdout(Stdio::piped())
.spawn()
.unwrap();
if let Some(mut stdin) = child.stdin.take() {
stdin.write_all(&body).unwrap();
}
let output = child.wait_with_output().unwrap();
HttpResponse::Ok()
.content_type(format!("application/x-{}-result", service))
.body(output.stdout)
}
@@ -1,0 +1,95 @@
use serde::Deserialize;
use crate::{prelude::*, time::Recency};
pub mod about;
pub mod git;
pub mod repository;
pub mod r#static;
const PAGE_SIZE: usize = 50;
#[derive(Clone, Deserialize)]
pub struct PageQuery {
#[serde(rename = "h")]
pub head: Option<String>,
#[serde(rename = "qt")]
pub query_type: Option<String>,
#[serde(rename = "v")]
pub value: Option<String>,
pub id: Option<String>,
#[serde(rename = "ofs")]
pub offset: Option<usize>,
}
#[derive(Template)]
#[template(path = "repositorys.html")]
struct ReposPage {
repos: Vec<Repository>,
}
#[get("/")]
pub async fn page(query: web::Query<PageQuery>, data: web::Data<App>) -> ActixResult<HttpResponse> {
let rendered = {
let mut repos: Vec<Repository> = {
let guard = match data.repos.read() {
Ok(g) => g,
Err(e) => return Ok(HttpResponse::InternalServerError().body(e.to_string())),
};
match (query.query_type.as_deref(), query.value.as_deref()) {
(Some(qt), Some(value)) => {
let value_lower = value.to_lowercase();
guard
.iter()
.filter(|r| {
field_for(r, Some(qt))
.map(|f| f.to_lowercase().contains(&value_lower))
.unwrap_or(false)
})
.cloned()
.collect()
}
_ => guard.clone(),
}
}; // guard dropped here
if let (qt, Some(value)) = (query.query_type.as_deref(), query.value.as_deref()) {
let value_lower = value.to_lowercase();
repos.sort_by_key(|a| relevance(a, qt, &value_lower));
}
ReposPage { repos }.render()
};
match rendered {
Ok(html) => Ok(HttpResponse::Ok().content_type("text/html").body(html)),
Err(e) => Ok(HttpResponse::InternalServerError().body(e.to_string())),
}
}
fn field_for<'a>(repo: &'a Repository, qt: Option<&str>) -> Option<&'a str> {
match qt {
Some("description") => Some(&repo.description),
_ => Some(&repo.name),
}
}
// Lower rank = better match, sorted first
fn relevance(repo: &Repository, qt: Option<&str>, value_lower: &str) -> u8 {
match field_for(repo, qt) {
Some(field) => {
let field_lower = field.to_lowercase();
if field_lower == value_lower {
0
} else if field_lower.starts_with(value_lower) {
1
} else {
2 // must be a contains-match since we already filtered
}
}
None => 3,
}
}
@@ -1,0 +1,26 @@
use rust_embed::RustEmbed;
use crate::prelude::*;
#[derive(RustEmbed)]
#[folder = "static/"]
struct Static;
#[get("/static/{filename:.*}")]
pub async fn files(path: web::Path<String>) -> ActixResult<HttpResponse> {
let path = path.into_inner();
if path.is_empty() {
return Ok(HttpResponse::NotFound().body("Not Found"));
}
match Static::get(&path) {
Some(content) => {
let mime_type = mime_guess::from_path(&path).first_or_octet_stream();
Ok(HttpResponse::Ok()
.content_type(mime_type.as_ref())
.body(content.data.into_owned()))
}
None => Ok(HttpResponse::NotFound().body("Not Found")),
}
}
@@ -1,0 +1,19 @@
{% extends "base.html" %}
{% block title %}{{ repo.name }} — {{ repo.description }}{% endblock %}
{% block header %}
{{ macros::header(Some(repo), branch_names, Some(current_ref)) }}
{% endblock %}
{% block tabs %}
{{ macros::repo_tabs(repo, current_ref, query, "about") }}
{% endblock %}
{% block content %}
{% if let Some(html) = readme_html %}
<div class="readme">
{{ html|safe }}
</div>
{% endif %}
{% endblock %}
@@ -1,0 +1,95 @@
{% extends "base.html" %}
{% block title %}{{ repo.name }} — {{ repo.description }}{% endblock %}
{% block header %}
{{ macros::header(Some(repo), branch_names, Some(current_ref)) }}
{% endblock %}
{% block tabs %}
{{ macros::repo_tabs(repo, current_ref, query, "commit") }}
{% endblock %}
{% block content %}
<table class="commit-info">
<tbody>
<tr>
<td>author</td>
<td>{{ commit.author.name }} <{{ commit.author.email }}></td>
<td>{{ commit.author.time.format() }}</td>
</tr>
<tr>
<td>committer</td>
<td>{{ commit.committer.name }} <{{ commit.committer.email }}></td>
<td>{{ commit.committer.time.format() }}</td>
</tr>
<tr>
<td>commit</td>
<td colspan="2">
<a href="/{{ repo.name }}/commit/?id={{ commit.id }}">{{ commit.id }}</a>
<a href="/{{ repo.name }}/patch/?id={{ commit.id }}">[patch]</a>
</td>
</tr>
<tr>
<td>tree</td>
<td colspan="2"><a href="/{{ repo.name }}/commit/?id={{ commit.id }}">{{ commit.id }}</a></td>
</tr>
{% for parent in commit.parents %}
<tr>
<td>parent</td>
<td colspan="2"><a href="/{{ repo.name }}/commit/?id={{ parent }}">{{ parent }}</a></td>
</tr>
{% endfor %}
<tr>
<td>download</td>
{% if let Some(branch) = commit.branch_name(repo)? %}
<td colspan="2"><a href="/{{ repo.name }}/snapshot/?h={{ branch }}">{{ branch }}.tar.gz</a></td>
{% else %}
<td colspan="2"><a href="/{{ repo.name }}/snapshot/?id={{ commit.id }}">{{ commit.id }}.tar.gz</a></td>
{% endif %}
</tr>
</tbody>
</table>
<div class="commit-subject">
<h1>{{ commit.summary()? }}
{% if commit.is_head(repo)? %}<a href="/{{ repo.name }}/commit/?id={{ commit.id }}" class="badge_head">HEAD</a>{% endif %}
{% for branch in commit.branch_tips(repo)? %}
<a href="/{{ repo.name }}/log?h={{ branch }}" class="badge_branch">{{ branch }}</a>
{% endfor %}
</h1>
<h4>{{ commit.body()? }}</h4>
</div>
<h3><a href="/{{ repo.name }}/diff/?id={{ commit.id }}">Diffstat</a></h3>
<table class="diffstat">
<tbody>
{% for file_diff in diff.file_diffs %}
<tr>
<td class="mode">{{ file_diff.mode }}</td>
<td class="upd">
<a href="/{{ repo.name }}/diff/{{ file_diff.path }}{% if let Some(id) = query.id %}?id={{ id }}{% endif %}" class="{{ file_diff.state }}">{{ file_diff.path }}</a>
</td>
<td class="right">{{ file_diff.total }}</td>
<td class="graph">
<table summary="file diffstat" style="width: {{ file_diff.total_percentage }}%">
<tbody>
<tr>
{% if file_diff.total != 0 %}
{% if file_diff.insertions_percentage > 0.0 %}
<td class="diffstat-addition" style="width: {{ file_diff.insertions_percentage }}%;"></td>
{% endif %}
{% if file_diff.deletions_percentage > 0.0 %}
<td class="diffstat-deletion" style="width: {{ file_diff.deletions_percentage }}%;"></td>
{% endif %}
{% endif %}
</tr>
</tbody>
</table>
</td>
</tr>
{% endfor %}
</tbody>
</table>
<pre class="diff">{{ diff.stats }}
{{ diff.output|safe }}</pre>
{% endblock %}
@@ -1,0 +1,46 @@
{% extends "base.html" %}
{% block title %}{{ repo.name }} — {{ repo.description }}{% endblock %}
{% block header %}
{{ macros::header(Some(repo), branch_names, Some(current_ref)) }}
{% endblock %}
{% block tabs %}
{{ macros::repo_tabs(repo, current_ref, query, "diff") }}
{% endblock %}
{% block content %}
<h3><a href="/{{ repo.name }}/diff/">Diffstat</a>{% if let Some(file_path) = file_path %} <strong>(limited to '{{ file_path }}')</strong>{% endif %}</h3>
<table class="diffstat">
<tbody>
{% for file_diff in diff.file_diffs %}
<tr>
<td class="mode">{{ file_diff.mode }}</td>
<td class="upd">
<a href="/{{ repo.name }}/diff/{{ file_diff.path }}{% if let Some(id) = query.id %}?id={{ id }}{% endif %}" class="{{ file_diff.state }}">{{ file_diff.path }}</a>
</td>
<td class="right">{{ file_diff.total }}</td>
<td class="graph">
<table summary="file diffstat" style="width: {{ file_diff.total_percentage }}%">
<tbody>
<tr>
{% if file_diff.total != 0 %}
{% if file_diff.insertions_percentage > 0.0 %}
<td class="diffstat-addition" style="width: {{ file_diff.insertions_percentage }}%;"></td>
{% endif %}
{% if file_diff.deletions_percentage > 0.0 %}
<td class="diffstat-deletion" style="width: {{ file_diff.deletions_percentage }}%;"></td>
{% endif %}
{% endif %}
</tr>
</tbody>
</table>
</td>
</tr>
{% endfor %}
</tbody>
</table>
<pre class="diff">{{ diff.stats }}
{{ diff.output|safe }}</pre>
{% endblock %}
@@ -1,0 +1,21 @@
{% extends "base.html" %}
{% block title %}{{ repo.name }} — {{ repo.description }}{% endblock %}
{% block header %}
{{ macros::header(Some(repo), branch_names, Some(current_ref)) }}
{% endblock %}
{% block tabs %}
{{ macros::repo_tabs(repo, current_ref, query, "log") }}
{% endblock %}
{% block content %}
{% if !commits.is_empty() %}
<table>
{{ macros::commits(commits, has_next, has_prev, page, "log") }}
</table>
{% else %}
There is no commits!
{% endif %}
{% endblock %}
@@ -1,0 +1,23 @@
{% extends "base.html" %}
{% block title %}{{ repo.name }} — {{ repo.description }}{% endblock %}
{% block header %}
{{ macros::header(Some(repo), branch_names, Some(current_ref)) }}
{% endblock %}
{% block tabs %}
{{ macros::repo_tabs(repo, current_ref, query, "refs") }}
{% endblock %}
{% block content %}
<table>
{% if !branches.is_empty() %}
{{ macros::branches(branches, branches_has_more, has_prev, page, mode) }}
{% endif %}
{% if !tags.is_empty() %}
{{ macros::tags(tags, tags_has_more, has_prev, page, mode) }}
{% endif %}
</table>
{% endblock %}
@@ -1,0 +1,48 @@
{% extends "base.html" %}
{% block title %}{{ repo.name }} — {{ repo.description }}{% endblock %}
{% block header %}
{{ macros::header(Some(repo), branch_names, Some(current_ref)) }}
{% endblock %}
{% block tabs %}
{{ macros::repo_tabs(repo, current_ref, query, "summary") }}
{% endblock %}
{% block content %}
<table>
{% if !branches.is_empty() %}
{{ macros::branches(branches, branches_has_more, false, page, "") }}
{% endif %}
<tbody>
<tr class="no-background">
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
</tbody>
{% if !tags.is_empty() %}
{{ macros::tags(tags, tags_has_more, false, page, "") }}
{% endif %}
<tbody>
<tr class="no-background">
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
</tbody>
{% if !commits.is_empty() %}
{{ macros::commits(commits, commits_has_more, false, page, "") }}
{% endif %}
</table>
<h3>Clone</h3>
<pre>https://git.y2w8.online/{{ repo.name }}</pre>
{% endblock %}
@@ -1,0 +1,49 @@
{% extends "base.html" %}
{% block title %}{{ repo.name }} — {{ repo.description }}{% endblock %}
{% block header %}
{{ macros::header(Some(repo), branch_names, Some(current_ref)) }}
{% endblock %}
{% block tabs %}
{{ macros::repo_tabs(repo, current_ref, query, "refs") }}
{% endblock %}
{% block content %}
<table class="commit-info">
<tbody>
<tr>
<td>tag name</td>
<td>{{ tag.name }}</td>
</tr>
<tr>
<td>tag date</td>
<td>{{ tag.time.format() }}</td>
</tr>
{% if let Some(tagger) = tag.tagger %}
<tr>
<td>tagged by</td>
<td>{{ tagger.name }} <{{ tagger.email }}></td>
</tr>
{% endif %}
{% if let Some(tagged_object) = tag.tagged_object %}
<tr>
<td>tagged object</td>
<td>
{% match tagged_object %}
{% when TaggedObject::Commit with (commit) %}
commit <a href="/{{ repo.name }}/commit/?id={{ commit }}">{{ commit|truncate(10) }}</a>
{% when TaggedObject::Tree with (tree) %}
tree {{ tree }}
{% endmatch %}
</td>
{% endif %}
</tr>
</tbody>
</table>
<div class="commit-subject">
{{ tag.message }}
</div>
{% endblock %}
@@ -1,0 +1,89 @@
{% extends "base.html" %}
{% block title %}{{ repo.name }} — {{ repo.description }}{% endblock %}
{% block header %}
{{ macros::header(Some(repo), branch_names, Some(current_ref)) }}
{% endblock %}
{% block tabs %}
{{ macros::repo_tabs(repo, current_ref, query, "tree") }}
{% endblock %}
{% decl parameters %}
{% if !current_ref.is_head %}
{% let parameters %}?h={{ current_ref.name }}{% endlet %}
{% else %}
{% let parameters = "".to_string() %}
{% endif %}
{% block breadcrumb %}
<div class="tree-breadcrumb">
<a href="/{{ repo.name }}/tree/{{ parameters }}">{{ repo.name }}</a>
{% for crumb in breadcrumbs %}
/
<a href="/{{ repo.name }}/tree/{{ crumb.path }}{{ parameters }}">{{ crumb.name }}</a>
{% endfor %}
</div>
{% endblock %}
{% block content %}
{% match kind %}
{% when PathView::Tree(entries) %}
<table class="tree-table">
<thead>
<tr>
<th class="mode">Mode</th>
<th>Name</th>
<th>Size</th>
</tr>
</thead>
<tbody>
{% if let Some(up) = parent_path %}
<tr class="tree-parent">
<td></td>
<td><a href="/{{ repo.name }}/tree/{{ up }}{{ parameters }}">..</a></td>
<td></td>
</tr>
{% endif %}
{% for entry in entries %}
<tr>
<td class="mode">{{ entry.mode_display() }}</td>
<td>
{% match entry.kind %}
{% when EntryKind::Tree %}
<a class="folder" href="/{{ repo.name }}/tree/{{ entry.path }}/{{ parameters }}">{{ entry.name }}</a>
{% when EntryKind::Commit %}
<span class="submodule">{{ entry.name }} @ {{ entry.id }}</span>
{% when _ %}
<a href="/{{ repo.name }}/tree/{{ entry.path }}{{ parameters }}">{{ entry.name }}</a>
{% endmatch %}
</td>
<td class="size">{{ entry.size_display() }}</td>
</tr>
{% endfor %}
</tbody>
</table>
{% when PathView::Blob(blob) %}
<div class="blob-meta">
<span class="mode">{{ blob.mode_display() }}</span>
<span class="blob-id">blob {{ blob.id }}</span>
<span class="size">{{ blob.size }} bytes</span>
(<a href="/{{ repo.name }}/raw/{{ filepath }}?h={{ current_ref.name }}">plain</a>)
</div>
{% if let Some(lines) = blob.lines %}
<table class="blob-table">
<tbody>
{% for line in lines %}
<tr>
<td class="line-no">{{ loop.index }}</td>
<td class="line-content"><pre>{{ line }}</pre></td>
</tr>
{% endfor %}
</tbody>
</table>
{% else %}
<p>Binary file not shown. <a href="/{{ repo.name }}/raw/{{ filepath }}?h={{ current_ref.name }}">Download raw</a>.</p>
{% endif %}
{% endmatch %}
{% endblock %}
@@ -1,0 +1,49 @@
use crate::{markdown, prelude::*, routes::PageQuery};
#[derive(Template)]
#[template(path = "repository/about.html")]
struct AboutPage {
repo: Repository,
current_ref: Ref,
branch_names: Vec<String>,
readme_html: Option<String>,
query: web::Query<PageQuery>,
}
#[get("/{repo}/about/")]
pub async fn page(
path: web::Path<String>,
query: web::Query<PageQuery>,
data: web::Data<App>,
) -> ActixResult<HttpResponse> {
let name = path.into_inner();
let repo = match data.find_repo(name) {
Some(r) => r,
None => return Ok(HttpResponse::NotFound().body("Repo not found")),
};
let current_ref = match Ref::resolve(&repo, &query) {
Ok(r) => r,
Err(e) => return Ok(HttpResponse::InternalServerError().body(e.to_string())),
};
let branch_names = match repo.branch_names() {
Ok(b) => b,
Err(e) => return Ok(HttpResponse::InternalServerError().body(e.to_string())),
};
let readme_html = repo.readme().map(|raw| markdown::render(&raw));
let rendered = AboutPage {
repo,
current_ref,
branch_names,
readme_html,
query,
}
.render();
match rendered {
Ok(html) => Ok(HttpResponse::Ok().content_type("text/html").body(html)),
Err(e) => Ok(HttpResponse::InternalServerError().body(e.to_string())),
}
}
@@ -1,0 +1,72 @@
use crate::{
git::diff::{Diff, DiffFormat},
prelude::*,
routes::PageQuery,
};
#[derive(Template)]
#[template(path = "repository/commit.html")]
struct CommitPage<'repo> {
repo: &'repo Repository,
branch_names: Vec<String>,
current_ref: Ref,
commit: Commit<'repo>,
diff: Diff,
query: web::Query<PageQuery>,
}
#[get("/{repo}/commit/")]
pub async fn page(
path: web::Path<String>,
query: web::Query<PageQuery>,
data: web::Data<App>,
) -> ActixResult<HttpResponse> {
let name = path.into_inner();
let repo = match data.find_repo(name) {
Some(r) => r,
None => return Ok(HttpResponse::NotFound().body("Repo not found")),
};
let gix_repo = repo.gix();
let current_ref = match Ref::resolve(&repo, &query) {
Ok(r) => r,
Err(e) => return Ok(HttpResponse::InternalServerError().body(e.to_string())),
};
let branch_names = match repo.branch_names() {
Ok(b) => b,
Err(e) => return Ok(HttpResponse::InternalServerError().body(e.to_string())),
};
let commit: Commit = if let Some(id) = query.clone().into_inner().id {
match repo.find_commit(&gix_repo, &id) {
Ok(c) => c,
Err(e) => return Ok(HttpResponse::InternalServerError().body(e.to_string())),
}
} else {
match gix_repo.find_reference(¤t_ref.name.to_string()) {
Ok(mut r) => match r.peel_to_commit() {
Ok(c) => Commit::from_gix(c).unwrap(),
Err(e) => return Ok(HttpResponse::InternalServerError().body(e.to_string())),
},
Err(e) => return Ok(HttpResponse::InternalServerError().body(e.to_string())),
}
};
let diff: Diff = match commit.diff(&repo, None, DiffFormat::Plain) {
Ok(d) => d,
Err(e) => return Ok(HttpResponse::InternalServerError().body(e.to_string())),
};
let rendered = CommitPage {
repo: &repo,
branch_names,
current_ref,
commit,
diff,
query,
}
.render();
match rendered {
Ok(html) => Ok(HttpResponse::Ok().content_type("text/html").body(html)),
Err(e) => Ok(HttpResponse::InternalServerError().body(e.to_string())),
}
}
@@ -1,0 +1,143 @@
use bytes::{BufMut, BytesMut};
use clap::crate_version;
use std::fmt::Write;
use crate::{
git::diff::{Diff, DiffFormat},
prelude::*,
routes::PageQuery,
};
#[derive(Template)]
#[template(path = "repository/diff.html")]
struct DiffPage<'repo> {
repo: &'repo Repository,
branch_names: Vec<String>,
current_ref: Ref,
file_path: Option<String>,
diff: Diff,
query: web::Query<PageQuery>,
}
#[get("/{repo}/diff/{file_path:.*}")]
pub async fn page(
path: web::Path<(String, Option<String>)>,
query: web::Query<PageQuery>,
data: web::Data<App>,
) -> ActixResult<HttpResponse> {
let (name, file_path) = path.into_inner();
let repo = match data.find_repo(name) {
Some(r) => r,
None => return Ok(HttpResponse::NotFound().body("Repo not found")),
};
let gix_repo = repo.gix();
let current_ref = match Ref::resolve(&repo, &query) {
Ok(r) => r,
Err(e) => return Ok(HttpResponse::InternalServerError().body(e.to_string())),
};
let branch_names = match repo.branch_names() {
Ok(b) => b,
Err(e) => return Ok(HttpResponse::InternalServerError().body(e.to_string())),
};
let commit: Commit = if let Some(id) = query.clone().into_inner().id {
match repo.find_commit(&gix_repo, &id) {
Ok(c) => c,
Err(e) => return Ok(HttpResponse::InternalServerError().body(e.to_string())),
}
} else {
match gix_repo.find_reference(&format!("heads/{}", current_ref.name)) {
Ok(mut r) => match r.peel_to_commit() {
Ok(c) => Commit::from_gix(c).unwrap(),
Err(e) => return Ok(HttpResponse::InternalServerError().body(e.to_string())),
},
Err(e) => return Ok(HttpResponse::InternalServerError().body(e.to_string())),
}
};
let diff: Diff = match commit.diff(&repo, file_path.clone(), DiffFormat::Plain) {
Ok(d) => d,
Err(e) => return Ok(HttpResponse::InternalServerError().body(e.to_string())),
};
let rendered = DiffPage {
repo: &repo,
branch_names,
current_ref,
file_path,
diff,
query,
}
.render();
match rendered {
Ok(html) => Ok(HttpResponse::Ok().content_type("text/html").body(html)),
Err(e) => Ok(HttpResponse::InternalServerError().body(e.to_string())),
}
}
#[get("/{repo}/patch/")]
pub async fn patch(
path: web::Path<String>,
query: web::Query<PageQuery>,
data: web::Data<App>,
) -> ActixResult<HttpResponse> {
let name = path.into_inner();
let repo = match data.find_repo(name) {
Some(r) => r,
None => return Ok(HttpResponse::NotFound().body("Repo not found")),
};
let gix_repo = repo.gix();
let current_ref = match Ref::resolve(&repo, &query) {
Ok(r) => r,
Err(e) => return Ok(HttpResponse::InternalServerError().body(e.to_string())),
};
let commit: Commit = if let Some(id) = query.clone().into_inner().id {
match repo.find_commit(&gix_repo, &id) {
Ok(c) => c,
Err(e) => return Ok(HttpResponse::InternalServerError().body(e.to_string())),
}
} else {
match gix_repo.find_reference(&format!("heads/{}", current_ref.name)) {
Ok(mut r) => match r.peel_to_commit() {
Ok(c) => Commit::from_gix(c).unwrap(),
Err(e) => return Ok(HttpResponse::InternalServerError().body(e.to_string())),
},
Err(e) => return Ok(HttpResponse::InternalServerError().body(e.to_string())),
}
};
let diff: Diff = match commit.diff(&repo, None, DiffFormat::Patch) {
Ok(d) => d,
Err(e) => return Ok(HttpResponse::InternalServerError().body(e.to_string())),
};
let mut data = BytesMut::new();
writeln!(data, "From {} Mon Sep 17 00:00:00 2001", commit.id).unwrap();
writeln!(
data,
"From: {} <{}>",
commit.author.name, commit.author.email
)
.unwrap();
write!(data, "Date: ").unwrap();
let mut writer = data.writer();
commit.author.time.format_rfc(&mut writer);
let mut data = writer.into_inner();
writeln!(data).unwrap();
writeln!(data, "Subject: [PATCH] {}\n", commit.summary().unwrap()).unwrap();
write!(data, "{}", commit.body().unwrap()).unwrap();
writeln!(data, "---").unwrap();
data.extend_from_slice(diff.stats.as_bytes());
data.extend_from_slice(b"\n");
data.extend_from_slice(diff.output.as_bytes());
writeln!(data, "--\ngit-rs {}", crate_version!()).unwrap();
Ok(HttpResponse::Ok().content_type("text").body(data))
}
@@ -1,0 +1,137 @@
use crate::{
prelude::*,
routes::{PAGE_SIZE, PageQuery},
};
#[derive(Template)]
#[template(path = "repository/log.html")]
struct LogPage<'repo> {
repo: &'repo Repository,
branch_names: Vec<String>,
current_ref: Ref,
commits: Vec<Commit<'repo>>,
offset: usize,
has_prev: bool,
has_next: bool,
query: PageQuery,
}
#[get("/{repo}/log/")]
pub async fn page(
path: web::Path<String>,
query: web::Query<PageQuery>,
data: web::Data<App>,
) -> ActixResult<HttpResponse> {
let name = path.into_inner();
let query = query.into_inner();
let repo = match data.find_repo(name) {
Some(r) => r,
None => return Ok(HttpResponse::NotFound().body("Repo not found")),
};
let gix_repo = repo.gix();
let current_ref = match Ref::resolve(&repo, &query) {
Ok(r) => r,
Err(e) => return Ok(HttpResponse::InternalServerError().body(e.to_string())),
};
let branch_names = match repo.branch_names() {
Ok(b) => b,
Err(e) => return Ok(HttpResponse::InternalServerError().body(e.to_string())),
};
let offset = query.offset.unwrap_or(0);
let has_prev = offset >= 1;
let (mut commits, mut has_next): (Vec<Commit<'_>>, bool) = (Vec::new(), false);
if let Some(ref qt) = query.query_type {
match qt.as_str() {
"msg" => {
if let Some(ref v) = query.value {
(commits, has_next) = match repo.commits(
&gix_repo,
¤t_ref,
offset,
PAGE_SIZE,
Some(&|c| {
c.summary()
.unwrap()
.to_string()
.to_lowercase()
.contains(&v.to_lowercase())
}),
) {
Ok(c) => c,
Err(e) => {
return Ok(HttpResponse::InternalServerError().body(e.to_string()));
}
};
}
}
"author" => {
if let Some(ref v) = query.value {
(commits, has_next) = match repo.commits(
&gix_repo,
¤t_ref,
offset,
PAGE_SIZE,
Some(&|c| c.author.name.to_lowercase().contains(&v.to_lowercase())),
) {
Ok(c) => c,
Err(e) => {
return Ok(HttpResponse::InternalServerError().body(e.to_string()));
}
};
}
}
"committer" => {
if let Some(ref v) = query.value {
(commits, has_next) = match repo.commits(
&gix_repo,
¤t_ref,
offset,
PAGE_SIZE,
Some(&|c| c.committer.name.to_lowercase().contains(&v.to_lowercase())),
) {
Ok(c) => c,
Err(e) => {
return Ok(HttpResponse::InternalServerError().body(e.to_string()));
}
};
}
}
_ => {
(commits, has_next) =
match repo.commits(&gix_repo, ¤t_ref, offset, PAGE_SIZE, None) {
Ok(c) => c,
Err(e) => {
return Ok(HttpResponse::InternalServerError().body(e.to_string()));
}
}
}
};
} else {
(commits, has_next) = match repo.commits(&gix_repo, ¤t_ref, offset, PAGE_SIZE, None) {
Ok(c) => c,
Err(e) => return Ok(HttpResponse::InternalServerError().body(e.to_string())),
};
}
let rendered = LogPage {
repo: &repo,
branch_names,
current_ref,
commits,
offset,
has_prev,
has_next,
query,
}
.render();
match rendered {
Ok(html) => Ok(HttpResponse::Ok().content_type("text/html").body(html)),
Err(e) => Ok(HttpResponse::InternalServerError().body(e.to_string())),
}
}
@@ -1,0 +1,9 @@
pub mod about;
pub mod commit;
pub mod diff;
pub mod log;
pub mod refs;
pub mod snapshot;
pub mod summary;
pub mod tag;
pub mod tree;
@@ -1,0 +1,171 @@
use crate::{
git::tag::Tag,
prelude::*,
routes::{PAGE_SIZE, PageQuery},
};
#[derive(Template)]
#[template(path = "repository/refs.html")]
struct RefsPage<'repo> {
repo: &'repo Repository,
current_ref: Ref,
offset: usize,
mode: String,
branch_names: Vec<String>,
branches: Vec<Branch<'repo>>,
tags: Vec<Tag>,
has_prev: bool,
branches_has_more: bool,
tags_has_more: bool,
query: web::Query<PageQuery>,
}
#[get("/{repo}/refs/{mode:.*}")]
pub async fn page(
path: web::Path<(String, String)>,
query: web::Query<PageQuery>,
data: web::Data<App>,
) -> ActixResult<HttpResponse> {
let (name, mode) = path.into_inner();
let repo = match data.find_repo(name) {
Some(r) => r,
None => return Ok(HttpResponse::NotFound().body("Repo not found")),
};
let gix_repo = repo.gix();
let current_ref = match Ref::resolve(&repo, &query) {
Ok(r) => r,
Err(e) => return Ok(HttpResponse::InternalServerError().body(e.to_string())),
};
let branch_names = match repo.branch_names() {
Ok(b) => b,
Err(e) => return Ok(HttpResponse::InternalServerError().body(e.to_string())),
};
let offset = query.offset.unwrap_or(0);
let has_prev = offset >= 1;
let rendered = match mode.as_ref() {
"heads" => {
let (branches, branches_has_more) = match repo.branches(&gix_repo, offset, PAGE_SIZE) {
Ok(b) => b,
Err(e) => return Ok(HttpResponse::InternalServerError().body(e.to_string())),
};
RefsPage {
repo: &repo,
current_ref,
offset,
mode,
branch_names,
branches,
tags: Vec::new(),
has_prev,
branches_has_more,
tags_has_more: false,
query,
}
.render()
}
"tags" => {
let (tags, tags_has_more) = match repo.tags(offset, PAGE_SIZE) {
Ok(t) => t,
Err(e) => return Ok(HttpResponse::InternalServerError().body(e.to_string())),
};
RefsPage {
repo: &repo,
current_ref,
offset,
mode,
branch_names,
branches: Vec::new(),
tags,
has_prev,
branches_has_more: false,
tags_has_more,
query,
}
.render()
}
&_ => {
let (branches, branches_has_more) = match repo.branches(&gix_repo, 0, PAGE_SIZE / 2) {
Ok(b) => b,
Err(e) => return Ok(HttpResponse::InternalServerError().body(e.to_string())),
};
let (tags, tags_has_more) = match repo.tags(0, PAGE_SIZE / 2) {
Ok(t) => t,
Err(e) => return Ok(HttpResponse::InternalServerError().body(e.to_string())),
};
RefsPage {
repo: &repo,
current_ref,
offset,
mode,
branch_names,
branches,
tags,
has_prev: false,
branches_has_more,
tags_has_more,
query,
}
.render()
}
};
match rendered {
Ok(html) => Ok(HttpResponse::Ok().content_type("text/html").body(html)),
Err(e) => Ok(HttpResponse::InternalServerError().body(e.to_string())),
}
}
// #[get("/{repo}/archive/{tag}.tar.gz")]
// pub async fn archive_tar_gz(
// path: web::Path<(String, String)>,
// data: web::Data<App>,
// ) -> ActixResult<HttpResponse> {
// let (name, tag) = path.into_inner();
// let repo = match data.find_repo(name) {
// Some(r) => r,
// None => return Ok(HttpResponse::NotFound().body("Repo not found")),
// };
//
// match repo.archive_tar_gz(&tag) {
// Ok(bytes) => Ok(HttpResponse::Ok()
// .content_type("application/gzip")
// .append_header((
// "Content-Disposition",
// format!("attachment; filename=\"{}-{}.tar.gz\"", repo.name, tag),
// ))
// .body(bytes)),
// // Most failures here are "no such tag" rather than a real server
// // fault — 404 reads truer than 500 for a download endpoint.
// Err(e) => Ok(HttpResponse::NotFound().body(e.to_string())),
// }
// }
//
// #[get("/{repo}/archive/{tag}.zip")]
// pub async fn archive_zip(
// path: web::Path<(String, String)>,
// data: web::Data<App>,
// ) -> ActixResult<HttpResponse> {
// let (name, tag) = path.into_inner();
// let repo = match data.find_repo(&name) {
// Some(r) => r,
// None => return Ok(HttpResponse::NotFound().body("Repo not found")),
// };
//
// match repo.archive_zip(&tag) {
// Ok(bytes) => Ok(HttpResponse::Ok()
// .content_type("application/zip")
// .append_header((
// "Content-Disposition",
// format!("attachment; filename=\"{}-{}.zip\"", repo.name, tag),
// ))
// .body(bytes)),
// Err(e) => Ok(HttpResponse::NotFound().body(e.to_string())),
// }
// }
@@ -1,0 +1,80 @@
use crate::{prelude::*, routes::PageQuery};
#[get("/{repo}/snapshot/")]
pub async fn download(
path: web::Path<String>,
query: web::Query<PageQuery>,
data: web::Data<App>,
) -> ActixResult<HttpResponse> {
let name = path.into_inner();
let repo = match data.find_repo(name) {
Some(r) => r,
None => return Ok(HttpResponse::NotFound().body("Repo not found")),
};
let current_ref = match Ref::resolve(&repo, &query) {
Ok(r) => r,
Err(e) => return Ok(HttpResponse::InternalServerError().body(e.to_string())),
};
let (bytes, filename) = match repo.archive(¤t_ref, &query.id) {
Ok(result) => (result.0, result.1),
Err(e) => return Ok(HttpResponse::InternalServerError().body(e.to_string())),
};
Ok(HttpResponse::Ok()
.content_type("application/gzip")
.append_header((
"Content-Disposition",
format!(r#"attachment; filename="{filename}""#),
))
.body(bytes))
}
// #[get("/{repo}/archive/{tag}.tar.gz")]
// pub async fn archive_tar_gz(
// path: web::Path<(String, String)>,
// data: web::Data<App>,
// ) -> ActixResult<HttpResponse> {
// let (name, tag) = path.into_inner();
// let repo = match data.find_repo(name) {
// Some(r) => r,
// None => return Ok(HttpResponse::NotFound().body("Repo not found")),
// };
//
// match repo.archive_tar_gz(&tag) {
// Ok(bytes) => Ok(HttpResponse::Ok()
// .content_type("application/gzip")
// .append_header((
// "Content-Disposition",
// format!("attachment; filename=\"{}-{}.tar.gz\"", repo.name, tag),
// ))
// .body(bytes)),
// // Most failures here are "no such tag" rather than a real server
// // fault — 404 reads truer than 500 for a download endpoint.
// Err(e) => Ok(HttpResponse::NotFound().body(e.to_string())),
// }
// }
//
// #[get("/{repo}/archive/{tag}.zip")]
// pub async fn archive_zip(
// path: web::Path<(String, String)>,
// data: web::Data<App>,
// ) -> ActixResult<HttpResponse> {
// let (name, tag) = path.into_inner();
// let repo = match data.find_repo(&name) {
// Some(r) => r,
// None => return Ok(HttpResponse::NotFound().body("Repo not found")),
// };
//
// match repo.archive_zip(&tag) {
// Ok(bytes) => Ok(HttpResponse::Ok()
// .content_type("application/zip")
// .append_header((
// "Content-Disposition",
// format!("attachment; filename=\"{}-{}.zip\"", repo.name, tag),
// ))
// .body(bytes)),
// Err(e) => Ok(HttpResponse::NotFound().body(e.to_string())),
// }
// }
@@ -1,0 +1,81 @@
use crate::{
prelude::*,
routes::{PAGE_SIZE, PageQuery},
};
const SUMMARY_LIMIT: usize = 10;
#[derive(Template)]
#[template(path = "repository/summary.html")]
struct SummaryPage<'repo> {
repo: &'repo Repository,
current_ref: Ref,
offset: usize,
branch_names: Vec<String>,
branches: Vec<Branch<'repo>>,
branches_has_more: bool,
tags: Vec<Tag>,
tags_has_more: bool,
commits: Vec<Commit<'repo>>,
commits_has_more: bool,
query: web::Query<PageQuery>,
}
#[get("/{repo}/")]
pub async fn page(
path: web::Path<String>,
query: web::Query<PageQuery>,
data: web::Data<App>,
) -> ActixResult<HttpResponse> {
let name = path.into_inner();
let repo = match data.find_repo(name) {
Some(r) => r,
None => return Ok(HttpResponse::NotFound().body("Repo not found")),
};
let gix_repo = repo.gix();
let current_ref = match Ref::resolve(&repo, &query) {
Ok(r) => r,
Err(e) => return Ok(HttpResponse::InternalServerError().body(e.to_string())),
};
let branch_names = match repo.branch_names() {
Ok(b) => b,
Err(e) => return Ok(HttpResponse::InternalServerError().body(e.to_string())),
};
let (branches, branches_has_more) = match repo.branches(&gix_repo, 0, SUMMARY_LIMIT) {
Ok(c) => c,
Err(e) => return Ok(HttpResponse::InternalServerError().body(e.to_string())),
};
let (tags, tags_has_more) = match repo.tags(0, SUMMARY_LIMIT) {
Ok(t) => t,
Err(e) => return Ok(HttpResponse::InternalServerError().body(e.to_string())),
};
let (commits, commits_has_more) =
match repo.commits(&gix_repo, ¤t_ref, 0, SUMMARY_LIMIT, None) {
Ok(c) => c,
Err(e) => return Ok(HttpResponse::InternalServerError().body(e.to_string())),
};
let rendered = SummaryPage {
repo: &repo,
current_ref,
offset: 0,
branch_names,
branches,
branches_has_more,
tags,
tags_has_more,
commits,
commits_has_more,
query,
}
.render();
match rendered {
Ok(html) => Ok(HttpResponse::Ok().content_type("text/html").body(html)),
Err(e) => Ok(HttpResponse::InternalServerError().body(e.to_string())),
}
}
@@ -1,0 +1,58 @@
use crate::{git::tag::TaggedObject, prelude::*, routes::PageQuery};
#[derive(Template)]
#[template(path = "repository/tag.html")]
struct TagPage<'repo> {
repo: &'repo Repository,
branch_names: Vec<String>,
current_ref: Ref,
tag: Tag,
query: web::Query<PageQuery>,
}
#[get("/{repo}/tag/")]
pub async fn page(
path: web::Path<String>,
query: web::Query<PageQuery>,
data: web::Data<App>,
) -> ActixResult<HttpResponse> {
let name = path.into_inner();
let repo = match data.find_repo(name) {
Some(r) => r,
None => return Ok(HttpResponse::NotFound().body("Repo not found")),
};
let gix_repo = repo.gix();
let current_ref = match Ref::resolve(&repo, &query) {
Ok(r) => r,
Err(e) => return Ok(HttpResponse::InternalServerError().body(e.to_string())),
};
let branch_names = match repo.branch_names() {
Ok(b) => b,
Err(e) => return Ok(HttpResponse::InternalServerError().body(e.to_string())),
};
let tag: Tag = if let Some(head) = query.clone().into_inner().head {
match repo.find_tag(&head) {
Ok(c) => c,
Err(e) => return Ok(HttpResponse::InternalServerError().body(e.to_string())),
}
} else {
match gix_repo.find_reference(&format!("heads/{}", current_ref.name)) {
Ok(r) => Tag::from_gix(r).unwrap(),
Err(e) => return Ok(HttpResponse::InternalServerError().body(e.to_string())),
}
};
let rendered = TagPage {
repo: &repo,
branch_names,
current_ref,
tag,
query,
}
.render();
match rendered {
Ok(html) => Ok(HttpResponse::Ok().content_type("text/html").body(html)),
Err(e) => Ok(HttpResponse::InternalServerError().body(e.to_string())),
}
}
@@ -1,0 +1,119 @@
use crate::{
git::tree::{self, Breadcrumb, PathView},
prelude::*,
routes::PageQuery,
};
use gix::objs::tree::EntryKind;
#[derive(Template)]
#[template(path = "repository/tree.html")]
struct TreePage {
repo: Repository,
branch_names: Vec<String>,
current_ref: Ref,
filepath: String,
breadcrumbs: Vec<Breadcrumb>,
parent_path: Option<String>,
kind: PathView,
query: web::Query<PageQuery>,
}
#[get("/{repo}/tree/{filepath:.*}")]
pub async fn page(
path: web::Path<(String, String)>,
query: web::Query<PageQuery>,
data: web::Data<App>,
) -> ActixResult<HttpResponse> {
let (name, filepath) = path.into_inner();
let filepath = filepath.trim_matches('/').to_string(); // fixes the double-slash bug from before
let repo = match data.find_repo(name) {
Some(r) => r,
None => return Ok(HttpResponse::NotFound().body("Repo not found")),
};
let current_ref = match Ref::resolve(&repo, &query) {
Ok(r) => r,
Err(e) => return Ok(HttpResponse::InternalServerError().body(e.to_string())),
};
let branch_names = match repo.branch_names() {
Ok(b) => b,
Err(e) => return Ok(HttpResponse::InternalServerError().body(e.to_string())),
};
// was `&ref_name` (undefined) — should reference the resolved ref
let kind = match repo.resolve_path(¤t_ref, &filepath) {
Ok(k) => k,
Err(e) => return Ok(HttpResponse::InternalServerError().body(e.to_string())),
};
let rendered = TreePage {
repo,
branch_names,
current_ref,
breadcrumbs: tree::build_breadcrumbs(&filepath),
parent_path: tree::parent_path(&filepath),
filepath,
kind,
query,
}
.render();
match rendered {
Ok(html) => Ok(HttpResponse::Ok().content_type("text/html").body(html)),
Err(e) => Ok(HttpResponse::InternalServerError().body(e.to_string())),
}
}
#[get("/{repo}/raw/{path:.*}")]
pub async fn raw(
info: web::Path<(String, String)>,
query: web::Query<PageQuery>,
data: web::Data<App>,
) -> ActixResult<HttpResponse> {
let (name, path) = info.into_inner();
let path = path.trim_matches('/');
let repo = match data.find_repo(name) {
Some(r) => r,
None => return Ok(HttpResponse::NotFound().body("Repo not found")),
};
let gix_repo = repo.gix();
let current_ref = match Ref::resolve(&repo, &query) {
Ok(r) => r,
Err(e) => return Ok(HttpResponse::InternalServerError().body(e.to_string())),
};
match repo.resolve_path(¤t_ref, path) {
Ok(PathView::Blob(blob)) => {
// Re-read content rather than store it on Blob — keeps Blob
// light for the tree-view case, which only needs metadata + lines.
let object_id = match gix::ObjectId::from_hex(blob.id.as_bytes()) {
Ok(id) => id,
Err(e) => {
return Ok(
HttpResponse::InternalServerError().body(format!("invalid object id: {e}"))
);
}
};
let object = match gix_repo.find_object(object_id) {
Ok(o) => o,
Err(e) => return Ok(HttpResponse::InternalServerError().body(e.to_string())),
};
let blob_obj = match object.try_into_blob() {
Ok(b) => b,
Err(e) => return Ok(HttpResponse::InternalServerError().body(e.to_string())),
};
Ok(HttpResponse::Ok()
.content_type("text/plain; charset=utf-8")
.body(blob_obj.data.clone()))
}
Ok(PathView::Tree(_)) => Ok(HttpResponse::BadRequest().body("path is a directory")),
Err(e) => Ok(HttpResponse::InternalServerError().body(e.to_string())),
}
}