diff --git a/.gitignore b/.gitignore index ea8c4bf..a727c0a 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,2 @@ /target +/data diff --git a/Cargo.lock b/Cargo.lock index dd07cbf..87b6a39 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -19,9 +19,9 @@ checksum = "f26201604c87b1e01bd3d98f8d5d9a8fcbb815e8cedb41ffccbeb4bf593a35fe" [[package]] name = "ahash" -version = "0.8.6" +version = "0.8.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "91429305e9f0a25f6205c5b8e0d2db09e0708a7a6df0f42212bb56c32c8ac97a" +checksum = "e89da841a80418a9b391ebaea17f5c112ffaaa96f621d2c285b5174da76b9011" dependencies = [ "cfg-if", "once_cell", @@ -31,9 +31,9 @@ dependencies = [ [[package]] name = "aho-corasick" -version = "1.1.2" +version = "1.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b2969dcb958b36655471fc61f7e416fa76033bdd4bfed0678d8fee1e2d07a1f0" +checksum = "8e60d3430d3a69478ad0993f19238d2df97c507009a52b3c10addcd7f6bcb916" dependencies = [ "memchr", ] @@ -55,9 +55,9 @@ dependencies = [ [[package]] name = "allocator-api2" -version = "0.2.16" +version = "0.2.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0942ffc6dcaadf03badf6e6a2d0228460359d5e34b57ccdc720b7382dfbd5ec5" +checksum = "5c6cb57a04249c6480766f7f7cef5467412af1490f8d1e243141daddada3264f" [[package]] name = "android-tzdata" @@ -85,9 +85,9 @@ dependencies = [ [[package]] name = "async-compression" -version = "0.4.4" +version = "0.4.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f658e2baef915ba0f26f1f7c42bfb8e12f532a01f449a090ded75ae7a07e9ba2" +checksum = "07dbbf24db18d609b1462965249abdf49129ccad073ec257da372adc83259c60" dependencies = [ "brotli", "flate2", @@ -118,25 +118,25 @@ checksum = "16e62a023e7c117e27523144c5d2459f4397fcc3cab0085af8e2224f643a0193" dependencies = [ "proc-macro2", "quote", - "syn 2.0.39", + "syn 2.0.60", ] [[package]] name = "async-trait" -version = "0.1.74" +version = "0.1.80" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a66537f1bb974b254c98ed142ff995236e81b9d0fe4db0575f46612cb15eb0f9" +checksum = "c6fa2087f2753a7da8cc1c0dbfcf89579dd57458e36769de5ac750b4671737ca" dependencies = [ "proc-macro2", "quote", - "syn 2.0.39", + "syn 2.0.60", ] [[package]] name = "autocfg" -version = "1.1.0" +version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d468802bab17cbc0cc575e9b053f41e72aa36bfa6b7f55e3529ffa43161b97fa" +checksum = "f1fdabc7756949593fe60f30ec81974b613357de856987752631dea1e3394c80" [[package]] name = "axum" @@ -240,9 +240,9 @@ dependencies = [ [[package]] name = "backtrace" -version = "0.3.69" +version = "0.3.71" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2089b7e3f35b9dd2d0ed921ead4f6d318c27680d4a5bd167b3ee120edb105837" +checksum = "26b05800d2e817c8b3b4b54abd461726265fa9789ae34330622f2db9ee696f9d" dependencies = [ "addr2line", "cc", @@ -255,9 +255,9 @@ dependencies = [ [[package]] name = "base64" -version = "0.21.5" +version = "0.21.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "35636a1494ede3b646cc98f74f8e62c773a38a659ebc777a2cf26b9b74171df9" +checksum = "9d297deb1925b89f2ccc13d7635fa0714f12c87adce1c75356b39ca9b7178567" [[package]] name = "bincode" @@ -276,9 +276,9 @@ checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" [[package]] name = "bitflags" -version = "2.4.1" +version = "2.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "327762f6e5a765692301e5bb513e0d9fef63be86bbc14528052b1cd3e6f03e07" +checksum = "cf4b9d6a944f767f8e5e0db018570623c85f3d925ac718db4e06d0187adb21c1" dependencies = [ "serde", ] @@ -294,9 +294,9 @@ dependencies = [ [[package]] name = "brotli" -version = "3.4.0" +version = "4.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "516074a47ef4bce09577a3b379392300159ce5b1ba2e501ff1c819950066100f" +checksum = "125740193d7fee5cc63ab9e16c2fdc4e07c74ba755cc53b327d6ea029e9fc569" dependencies = [ "alloc-no-stdlib", "alloc-stdlib", @@ -305,9 +305,9 @@ dependencies = [ [[package]] name = "brotli-decompressor" -version = "2.5.1" +version = "3.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4e2e4afe60d7dd600fdd3de8d0f08c2b7ec039712e3b6137ff98b7004e82de4f" +checksum = "65622a320492e09b5e0ac436b14c54ff68199bac392d0e89a6832c4518eea525" dependencies = [ "alloc-no-stdlib", "alloc-stdlib", @@ -315,9 +315,9 @@ dependencies = [ [[package]] name = "bstr" -version = "1.8.0" +version = "1.9.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "542f33a8835a0884b006a0c3df3dadd99c0c3f296ed26c2fdc8028e01ad6230c" +checksum = "05efc5cfd9110c8416e471df0e96702d58690178e206e61b7173706673c93706" dependencies = [ "memchr", "serde", @@ -325,9 +325,9 @@ dependencies = [ [[package]] name = "bumpalo" -version = "3.14.0" +version = "3.16.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7f30e7476521f6f8af1a1c4c0b8cc94f0bee37d91763d0ca2665f299b6cd8aec" +checksum = "79296716171880943b8470b5f8d03aa55eb2e645a4874bdbb28adb49162e012c" [[package]] name = "byteorder" @@ -337,9 +337,9 @@ checksum = "1fd0f2584146f6f2ef48085050886acf353beff7305ebd1ae69500e27c67f64b" [[package]] name = "bytes" -version = "1.5.0" +version = "1.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a2bd12c1caf447e69cd4528f47f94d203fd2582878ecb9e9465484c4148a8223" +checksum = "514de17de45fdb8dc022b1a7975556c53c86f9f0aa5f534b98977b171857c2c9" [[package]] name = "cached" @@ -350,7 +350,7 @@ dependencies = [ "ahash", "cached_proc_macro", "cached_proc_macro_types", - "hashbrown 0.14.2", + "hashbrown 0.14.3", "instant", "once_cell", "thiserror", @@ -376,9 +376,9 @@ checksum = "ade8366b8bd5ba243f0a58f036cc0ca8a2f069cff1a2351ef1cac6b083e16fc0" [[package]] name = "cc" -version = "1.0.83" +version = "1.0.94" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f1174fb0b6ec23863f8b971027804a42614e347eafb0a95bf0b12cdae21fc4d0" +checksum = "17f6e324229dc011159fcc089755d1e2e216a90d43a7dea6853ca740b84f35e7" dependencies = [ "jobserver", "libc", @@ -392,9 +392,9 @@ checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" [[package]] name = "chrono" -version = "0.4.31" +version = "0.4.38" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7f2c685bad3eb3d45a01354cedb7d5faa66194d1d58ba6e267a8de788f79db38" +checksum = "a21f936df1771bf62b77f047b726c4625ff2e8aa607c01ec06e5a05bd8463401" dependencies = [ "android-tzdata", "iana-time-zone", @@ -402,14 +402,14 @@ dependencies = [ "num-traits", "serde", "wasm-bindgen", - "windows-targets 0.48.5", + "windows-targets 0.52.5", ] [[package]] name = "chrono-tz" -version = "0.8.4" +version = "0.8.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e23185c0e21df6ed832a12e2bda87c7d1def6842881fb634a8511ced741b0d76" +checksum = "d59ae0466b83e838b81a54256c39d5d7c20b9d7daa10510a242d9b75abd5936e" dependencies = [ "chrono", "chrono-tz-build", @@ -478,46 +478,61 @@ dependencies = [ [[package]] name = "core-foundation-sys" -version = "0.8.4" +version = "0.8.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e496a50fda8aacccc86d7529e2c1e0892dbd0f898a6b5645b5561b89c3210efa" +checksum = "06ea2b9bc92be3c2baa9334a323ebca2d6f074ff852cd1d7b11064035cd3868f" [[package]] name = "cpufeatures" -version = "0.2.11" +version = "0.2.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ce420fe07aecd3e67c5f910618fe65e94158f6dcc0adf44e00d69ce2bdfe0fd0" +checksum = "53fe5e26ff1b7aef8bca9c6080520cfb8d9333c7568e1829cef191a9723e5504" dependencies = [ "libc", ] [[package]] name = "crc32fast" -version = "1.3.2" +version = "1.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b540bd8bc810d3885c6ea91e2018302f68baba2129ab3e88f32389ee9370880d" +checksum = "b3855a8a784b474f333699ef2bbca9db2c4a1f6d9088a90a2d25b1eb53111eaa" dependencies = [ "cfg-if", ] [[package]] name = "crossbeam-channel" -version = "0.5.8" +version = "0.5.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a33c2bf77f2df06183c3aa30d1e96c0695a313d4f9c453cc3762a6db39f99200" +checksum = "ab3db02a9c5b5121e1e42fbdb1aeb65f5e02624cc58c43f2884c6ccac0b82f95" +dependencies = [ + "crossbeam-utils", +] + +[[package]] +name = "crossbeam-deque" +version = "0.8.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "613f8cc01fe9cf1a3eb3d7f488fd2fa8388403e97039e2f73692932e291a770d" +dependencies = [ + "crossbeam-epoch", + "crossbeam-utils", +] + +[[package]] +name = "crossbeam-epoch" +version = "0.9.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5b82ac4a3c2ca9c3460964f020e1402edd5753411d7737aa39c3714ad1b5420e" dependencies = [ - "cfg-if", "crossbeam-utils", ] [[package]] name = "crossbeam-utils" -version = "0.8.16" +version = "0.8.19" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5a22b2d63d4d1dc0b7f1b6b2747dd0088008a9be28b6ddf0b1e7d335e3037294" -dependencies = [ - "cfg-if", -] +checksum = "248e3bacc7dc6baa3b21e405ee045c3047101a49145e7e9eca583ab4c2ca5345" [[package]] name = "crunchy" @@ -572,18 +587,18 @@ dependencies = [ [[package]] name = "deranged" -version = "0.3.9" +version = "0.3.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0f32d04922c60427da6f9fef14d042d9edddef64cb9d4ce0d64d0685fbeb1fd3" +checksum = "b42b6fa04a440b495c8b04d0e71b707c585f83cb9cb28cf8cd0d976c315e31b4" dependencies = [ "powerfmt", ] [[package]] name = "deunicode" -version = "1.4.1" +version = "1.4.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6a1abaf4d861455be59f64fd2b55606cb151fce304ede7165f410243ce96bde6" +checksum = "322ef0094744e63628e6f0eb2295517f79276a5b342a4c2ff3042566ca181d4e" [[package]] name = "digest" @@ -616,16 +631,6 @@ version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5443807d6dff69373d433ab9ef5378ad8df50ca6298caf15de6e52e24aaf54d5" -[[package]] -name = "errno" -version = "0.3.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7c18ee0ed65a5f1f81cac6b1d213b69c35fa47d4252ad41f1486dbd8226fe36e" -dependencies = [ - "libc", - "windows-sys 0.48.0", -] - [[package]] name = "flate2" version = "1.0.28" @@ -644,33 +649,33 @@ checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" [[package]] name = "form_urlencoded" -version = "1.2.0" +version = "1.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a62bc1cf6f830c2ec14a513a9fb124d0a213a629668a4186f329db21fe045652" +checksum = "e13624c2627564efccf4934284bdd98cbaa14e79b0b5a141218e507b3a823456" dependencies = [ "percent-encoding", ] [[package]] name = "futures-channel" -version = "0.3.29" +version = "0.3.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ff4dd66668b557604244583e3e1e1eada8c5c2e96a6d0d6653ede395b78bbacb" +checksum = "eac8f7d7865dcb88bd4373ab671c8cf4508703796caa2b1985a9ca867b3fcb78" dependencies = [ "futures-core", ] [[package]] name = "futures-core" -version = "0.3.29" +version = "0.3.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eb1d22c66e66d9d72e1758f0bd7d4fd0bee04cad842ee34587d68c07e45d088c" +checksum = "dfc6580bb841c5a68e9ef15c77ccc837b40a7504914d52e47b8b0e9bbda25a1d" [[package]] name = "futures-executor" -version = "0.3.29" +version = "0.3.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0f4fb8693db0cf099eadcca0efe2a5a22e4550f98ed16aba6c48700da29597bc" +checksum = "a576fc72ae164fca6b9db127eaa9a9dda0d61316034f33a0a0d4eda41f02b01d" dependencies = [ "futures-core", "futures-task", @@ -679,32 +684,32 @@ dependencies = [ [[package]] name = "futures-macro" -version = "0.3.29" +version = "0.3.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "53b153fd91e4b0147f4aced87be237c98248656bb01050b96bf3ee89220a8ddb" +checksum = "87750cf4b7a4c0625b1529e4c543c2182106e4dedc60a2a6455e00d212c489ac" dependencies = [ "proc-macro2", "quote", - "syn 2.0.39", + "syn 2.0.60", ] [[package]] name = "futures-sink" -version = "0.3.29" +version = "0.3.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e36d3378ee38c2a36ad710c5d30c2911d752cb941c00c72dbabfb786a7970817" +checksum = "9fb8e00e87438d937621c1c6269e53f536c14d3fbd6a042bb24879e57d474fb5" [[package]] name = "futures-task" -version = "0.3.29" +version = "0.3.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "efd193069b0ddadc69c46389b740bbccdd97203899b48d09c5f7969591d6bae2" +checksum = "38d84fa142264698cdce1a9f9172cf383a0c82de1bddcf3092901442c4097004" [[package]] name = "futures-util" -version = "0.3.29" +version = "0.3.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a19526d624e703a3179b3d322efec918b6246ea0fa51d41124525f00f1cc8104" +checksum = "3d6401deb83407ab3da39eba7e33987a73c3df0c82b4bb5813ee871c19c41d48" dependencies = [ "futures-core", "futures-macro", @@ -736,9 +741,9 @@ dependencies = [ [[package]] name = "getrandom" -version = "0.2.11" +version = "0.2.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fe9006bed769170c11f845cf00c7c1e9092aeb3f268e007c3e760ac68008070f" +checksum = "94b22e06ecb0110981051723910cbf0b5f5e09a2062dd7663334ee79a9d1286c" dependencies = [ "cfg-if", "libc", @@ -747,9 +752,9 @@ dependencies = [ [[package]] name = "gimli" -version = "0.28.0" +version = "0.28.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6fb8d784f27acf97159b40fc4db5ecd8aa23b9ad5ef69cdd136d3bc80665f0c0" +checksum = "4271d37baee1b8c7e4b708028c57d816cf9d2434acb33a549475f78c181f6253" [[package]] name = "glob" @@ -759,15 +764,15 @@ checksum = "d2fabcfbdc87f4758337ca535fb41a6d701b65693ce38287d856d1674551ec9b" [[package]] name = "globset" -version = "0.4.13" +version = "0.4.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "759c97c1e17c55525b57192c06a267cda0ac5210b222d6b82189a2338fa1c13d" +checksum = "57da3b9b5b85bd66f31093f8c408b90a74431672542466497dcbdfdc02034be1" dependencies = [ "aho-corasick", "bstr", - "fnv", "log", - "regex", + "regex-automata 0.4.6", + "regex-syntax 0.8.3", ] [[package]] @@ -793,7 +798,7 @@ dependencies = [ "futures-sink", "futures-util", "http 0.2.12", - "indexmap 2.1.0", + "indexmap 2.2.6", "slab", "tokio", "tokio-util", @@ -812,7 +817,7 @@ dependencies = [ "futures-sink", "futures-util", "http 1.1.0", - "indexmap 2.1.0", + "indexmap 2.2.6", "slab", "tokio", "tokio-util", @@ -833,9 +838,9 @@ checksum = "43a3c133739dddd0d2990f9a4bdf8eb4b21ef50e4851ca85ab661199821d510e" [[package]] name = "hashbrown" -version = "0.14.2" +version = "0.14.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f93e7192158dbcda357bdec5fb5788eebf8bbac027f3f33e719d29135ae84156" +checksum = "290f1a1d9242c78d09ce40a5e87e7554ee637af1351968159f4952f028f75604" dependencies = [ "ahash", "allocator-api2", @@ -843,9 +848,9 @@ dependencies = [ [[package]] name = "hdrhistogram" -version = "7.5.2" +version = "7.5.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7f19b9f54f7c7f55e31401bb647626ce0cf0f67b0004982ce815b3ee72a02aa8" +checksum = "765c9198f173dd59ce26ff9f95ef0aafd0a0fe01fb9d72841bc5066a4c06511d" dependencies = [ "byteorder", "num-traits", @@ -853,15 +858,9 @@ dependencies = [ [[package]] name = "hermit-abi" -version = "0.3.3" +version = "0.3.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d77f7ec81a6d05a3abb01ab6eb7590f6083d08449fe5a1c8b1e620283546ccb7" - -[[package]] -name = "hex" -version = "0.4.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7f24254aa9a54b5c858eaee2f5bccdb46aaf0e486a595ed5fd8f86ba55232a70" +checksum = "d231dfb89cfffdbc30e7fc41579ed6066ad03abda9e567ccafae602b97ec5024" [[package]] name = "http" @@ -1020,9 +1019,9 @@ dependencies = [ [[package]] name = "iana-time-zone" -version = "0.1.58" +version = "0.1.60" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8326b86b6cff230b97d0d312a6c40a60726df3332e721f72a1b035f451663b20" +checksum = "e7ffbb5a1b541ea2561f8c41c087286cc091e21e556a4f09a8f6cbf17b69b141" dependencies = [ "android_system_properties", "core-foundation-sys", @@ -1049,17 +1048,16 @@ checksum = "b9e0384b61958566e926dc50660321d12159025e767c18e043daf26b70104c39" [[package]] name = "ignore" -version = "0.4.20" +version = "0.4.22" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dbe7873dab538a9a44ad79ede1faf5f30d49f9a5c883ddbab48bce81b64b7492" +checksum = "b46810df39e66e925525d6e38ce1e7f6e1d208f72dc39757880fcb66e2c58af1" dependencies = [ + "crossbeam-deque", "globset", - "lazy_static", "log", "memchr", - "regex", + "regex-automata 0.4.6", "same-file", - "thread_local", "walkdir", "winapi-util", ] @@ -1076,12 +1074,12 @@ dependencies = [ [[package]] name = "indexmap" -version = "2.1.0" +version = "2.2.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d530e1a18b1cb4c484e6e34556a0d948706958449fca0cab753d649f2bce3d1f" +checksum = "168fb715dda47215e360912c096649d23d58bf392ac62f73919e831745e40f26" dependencies = [ "equivalent", - "hashbrown 0.14.2", + "hashbrown 0.14.3", ] [[package]] @@ -1093,22 +1091,11 @@ dependencies = [ "cfg-if", ] -[[package]] -name = "io-lifetimes" -version = "1.0.11" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eae7b9aee968036d54dce06cebaefd919e4472e753296daccd6d344e3e2df0c2" -dependencies = [ - "hermit-abi", - "libc", - "windows-sys 0.48.0", -] - [[package]] name = "iri-string" -version = "0.7.0" +version = "0.7.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "21859b667d66a4c1dacd9df0863b3efb65785474255face87f5bca39dd8407c0" +checksum = "7f5f6c2df22c009ac44f6f1499308e7a3ac7ba42cd2378475cc691510e1eef1b" dependencies = [ "memchr", "serde", @@ -1125,24 +1112,24 @@ dependencies = [ [[package]] name = "itoa" -version = "1.0.9" +version = "1.0.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "af150ab688ff2122fcef229be89cb50dd66af9e01a4ff320cc137eecc9bacc38" +checksum = "49f1f14873335454500d59611f1cf4a4b0f786f9ac11f4312a78e4cf2566695b" [[package]] name = "jobserver" -version = "0.1.27" +version = "0.1.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8c37f63953c4c63420ed5fd3d6d398c719489b9f872b9fa683262f8edd363c7d" +checksum = "685a7d121ee3f65ae4fddd72b25a04bb36b6af81bc0828f7d5434c0fe60fa3a2" dependencies = [ "libc", ] [[package]] name = "js-sys" -version = "0.3.65" +version = "0.3.69" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "54c0c35952f67de54bb584e9fd912b3023117cbafc0a77d8f3dee1fb5f572fe8" +checksum = "29c15563dc2726973df627357ce0c9ddddbea194836909d655df6a75d2cf296d" dependencies = [ "wasm-bindgen", ] @@ -1166,9 +1153,9 @@ checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" [[package]] name = "libc" -version = "0.2.150" +version = "0.2.153" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "89d92a4743f9a61002fae18374ed11e7973f530cb3a3255fb354818118b2203c" +checksum = "9c198f91728a82281a64e1f4f9eeb25d82cb32a5de251c6bd1b5154d63a8e7bd" [[package]] name = "libm" @@ -1178,12 +1165,9 @@ checksum = "4ec2a862134d2a7d32d7983ddcdd1c4923530833c9f2ea1a44fc5fa473989058" [[package]] name = "line-wrap" -version = "0.1.1" +version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f30344350a2a51da54c1d53be93fade8a237e545dbcc4bdbe635413f2117cab9" -dependencies = [ - "safemem", -] +checksum = "dd1bc4d24ad230d21fb898d1116b1801d7adfc449d42026475862ab48b11e70e" [[package]] name = "linked-hash-map" @@ -1191,12 +1175,6 @@ version = "0.5.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0717cef1bc8b636c6e1c1bbdefc09e6322da8a9321966e8928ef80d20f7f770f" -[[package]] -name = "linux-raw-sys" -version = "0.1.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f051f77a7c8e6957c0696eac88f26b0117e54f52d3fc682ab19397a8812846a4" - [[package]] name = "lock_api" version = "0.4.11" @@ -1209,9 +1187,9 @@ dependencies = [ [[package]] name = "log" -version = "0.4.20" +version = "0.4.21" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b5e6163cb8c49088c2c36f57875e58ccd8c87c7427f7fbd50ea6710b2f3f2e8f" +checksum = "90ed8c1e510134f979dbc4f070f87d4313098b704861a105fe34231c70a3901c" [[package]] name = "matchers" @@ -1230,9 +1208,9 @@ checksum = "0e7465ac9959cc2b1404e8e2367b43684a6d13790fe23056cc8c6c5a6b7bcb94" [[package]] name = "memchr" -version = "2.6.4" +version = "2.7.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f665ee40bc4a3c5590afb1e9677db74a508659dfd71e126420da8274909a0167" +checksum = "6c8640c5d730cb13ebd907d8d04b52f55ac9a2eec55b440c8892f40d56c76c1d" [[package]] name = "mime" @@ -1258,18 +1236,18 @@ checksum = "68354c5c6bd36d73ff3feceb05efa59b6acb7626617f4962be322a825e61f79a" [[package]] name = "miniz_oxide" -version = "0.7.1" +version = "0.7.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e7810e0be55b428ada41041c41f32c9f1a42817901b4ccf45fa3d4b6561e74c7" +checksum = "9d811f3e15f28568be3407c8e7fdb6514c1cda3cb30683f15b6a1a1dc4ea14a7" dependencies = [ "adler", ] [[package]] name = "mio" -version = "0.8.9" +version = "0.8.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3dce281c5e46beae905d4de1870d8b1509a9142b62eedf18b443b011ca8343d0" +checksum = "a4a650543ca06a924e8b371db273b2756685faae30f8487da1b56505a8f78b0c" dependencies = [ "libc", "wasi", @@ -1297,10 +1275,16 @@ dependencies = [ ] [[package]] -name = "num-traits" -version = "0.2.17" +name = "num-conv" +version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "39e3200413f237f41ab11ad6d161bc7239c84dcb631773ccd7de3dfe4b5c267c" +checksum = "51d515d32fb182ee37cda2ccdcb92950d6a3c2893aa280e540671c2cd0f3b1d9" + +[[package]] +name = "num-traits" +version = "0.2.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "da0df0e5185db44f69b44f26786fe401b6c293d1907744beaa7fa62b2e5a517a" dependencies = [ "autocfg", ] @@ -1317,18 +1301,18 @@ dependencies = [ [[package]] name = "object" -version = "0.32.1" +version = "0.32.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9cf5f9dd3933bd50a9e1f149ec995f39ae2c496d31fd772c1fd45ebc27e902b0" +checksum = "a6a622008b6e321afc04970976f62ee297fdbaa6f95318ca343e3eebb9648441" dependencies = [ "memchr", ] [[package]] name = "once_cell" -version = "1.18.0" +version = "1.19.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dd8b5dd2ae5ed71462c540258bedcb51965123ad7e7ccf4b9a8cafaa4a63576d" +checksum = "3fdb12b2476b595f9358c5161aa467c2438859caa136dec86c26fdd2efe17b92" [[package]] name = "onig" @@ -1421,6 +1405,7 @@ dependencies = [ "ordered-float", "percent-encoding", "rand", + "serde_json", "thiserror", "tokio", "tokio-stream", @@ -1428,9 +1413,9 @@ dependencies = [ [[package]] name = "ordered-float" -version = "4.1.1" +version = "4.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "536900a8093134cf9ccf00a27deb3532421099e958d9dd431135d0c7543ca1e8" +checksum = "a76df7075c7d4d01fdcb46c912dd17fba5b60c78ea480b475f2b6ab6f666584e" dependencies = [ "num-traits", ] @@ -1491,15 +1476,15 @@ checksum = "8835116a5c179084a830efb3adc117ab007512b535bc1a21c991d3b32a6b44dd" [[package]] name = "percent-encoding" -version = "2.3.0" +version = "2.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9b2a4787296e9989611394c33f193f676704af1686e70b8f8033ab5ba9a35a94" +checksum = "e3148f5046208a5d56bcfc03053e3ca6334e51da8dfb19b6cdc8b306fae3283e" [[package]] name = "pest" -version = "2.7.5" +version = "2.7.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ae9cee2a55a544be8b89dc6848072af97a20f2422603c10865be2a42b580fff5" +checksum = "311fb059dee1a7b802f036316d790138c613a4e8b180c822e3925a662e9f0c95" dependencies = [ "memchr", "thiserror", @@ -1508,9 +1493,9 @@ dependencies = [ [[package]] name = "pest_derive" -version = "2.7.5" +version = "2.7.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "81d78524685f5ef2a3b3bd1cafbc9fcabb036253d9b1463e726a91cd16e2dfc2" +checksum = "f73541b156d32197eecda1a4014d7f868fd2bcb3c550d5386087cfba442bf69c" dependencies = [ "pest", "pest_generator", @@ -1518,22 +1503,22 @@ dependencies = [ [[package]] name = "pest_generator" -version = "2.7.5" +version = "2.7.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "68bd1206e71118b5356dae5ddc61c8b11e28b09ef6a31acbd15ea48a28e0c227" +checksum = "c35eeed0a3fab112f75165fdc026b3913f4183133f19b49be773ac9ea966e8bd" dependencies = [ "pest", "pest_meta", "proc-macro2", "quote", - "syn 2.0.39", + "syn 2.0.60", ] [[package]] name = "pest_meta" -version = "2.7.5" +version = "2.7.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7c747191d4ad9e4a4ab9c8798f1e82a39affe7ef9648390b7e5548d18e099de6" +checksum = "2adbf29bb9776f28caece835398781ab24435585fe0d4dc1374a61db5accedca" dependencies = [ "once_cell", "pest", @@ -1580,29 +1565,29 @@ dependencies = [ [[package]] name = "pin-project" -version = "1.1.3" +version = "1.1.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fda4ed1c6c173e3fc7a83629421152e01d7b1f9b7f65fb301e490e8cfc656422" +checksum = "b6bf43b791c5b9e34c3d182969b4abb522f9343702850a2e57f460d00d09b4b3" dependencies = [ "pin-project-internal", ] [[package]] name = "pin-project-internal" -version = "1.1.3" +version = "1.1.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4359fd9c9171ec6e8c62926d6faaf553a8dc3f64e1507e76da7911b4f6a04405" +checksum = "2f38a4412a78282e09a2cf38d195ea5420d15ba0602cb375210efbc877243965" dependencies = [ "proc-macro2", "quote", - "syn 2.0.39", + "syn 2.0.60", ] [[package]] name = "pin-project-lite" -version = "0.2.13" +version = "0.2.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8afb450f006bf6385ca15ef45d71d2288452bc3683ce2e2cacc0d18e4be60b58" +checksum = "bda66fc9667c18cb2758a2ac84d1167245054bcf85d5d1aaa6923f45801bdd02" [[package]] name = "pin-utils" @@ -1612,18 +1597,18 @@ checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184" [[package]] name = "pkg-config" -version = "0.3.27" +version = "0.3.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "26072860ba924cbfa98ea39c8c19b4dd6a4a25423dbdf219c1eca91aa0cf6964" +checksum = "d231b230927b5e4ad203db57bbcbee2802f6bce620b1e4a9024a07d94e2907ec" [[package]] name = "plist" -version = "1.6.0" +version = "1.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e5699cc8a63d1aa2b1ee8e12b9ad70ac790d65788cd36101fa37f87ea46c4cef" +checksum = "d9d34169e64b3c7a80c8621a48adaf44e0cf62c78a9b25dd9dd35f1881a17cf9" dependencies = [ "base64", - "indexmap 2.1.0", + "indexmap 2.2.6", "line-wrap", "quick-xml", "serde", @@ -1644,43 +1629,13 @@ checksum = "5b40af805b3121feab8a3c29f04d8ad262fa8e0561883e7653e024ae4479e6de" [[package]] name = "proc-macro2" -version = "1.0.69" +version = "1.0.81" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "134c189feb4956b20f6f547d2cf727d4c0fe06722b20a0eec87ed445a97f92da" +checksum = "3d1597b0c024618f09a9c3b8655b7e430397a36d23fdafec26d6965e9eec3eba" dependencies = [ "unicode-ident", ] -[[package]] -name = "procfs" -version = "0.14.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b1de8dacb0873f77e6aefc6d71e044761fcc68060290f5b1089fcdf84626bb69" -dependencies = [ - "bitflags 1.3.2", - "byteorder", - "hex", - "lazy_static", - "rustix", -] - -[[package]] -name = "prometheus" -version = "0.13.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "449811d15fbdf5ceb5c1144416066429cf82316e2ec8ce0c1f6f8a02e7bbcf8c" -dependencies = [ - "cfg-if", - "fnv", - "lazy_static", - "libc", - "memchr", - "parking_lot", - "procfs", - "protobuf", - "thiserror", -] - [[package]] name = "prost" version = "0.12.4" @@ -1701,22 +1656,16 @@ dependencies = [ "itertools", "proc-macro2", "quote", - "syn 2.0.39", + "syn 2.0.60", ] -[[package]] -name = "protobuf" -version = "2.28.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "106dd99e98437432fed6519dedecfade6a06a73bb7b2a1e019fdd2bee5778d94" - [[package]] name = "pulldown-cmark" version = "0.10.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5f0530d13d87d1f549b66a3e8d0c688952abe5994e204ed62615baaf25dc029c" dependencies = [ - "bitflags 2.4.1", + "bitflags 2.5.0", "getopts", "memchr", "pulldown-cmark-escape", @@ -1740,9 +1689,9 @@ dependencies = [ [[package]] name = "quote" -version = "1.0.33" +version = "1.0.36" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5267fca4496028628a95160fc423a33e8b2e6af8a5302579e322e4b520293cae" +checksum = "0fa76aaf39101c457836aec0ce2316dbdc3ab723cdda1c6bd4e6ad4208acaca7" dependencies = [ "proc-macro2", ] @@ -1788,14 +1737,14 @@ dependencies = [ [[package]] name = "regex" -version = "1.10.2" +version = "1.10.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "380b951a9c5e80ddfd6136919eef32310721aa4aacd4889a8d39124b026ab343" +checksum = "c117dbdfde9c8308975b6a18d71f3f385c89461f7b3fb054288ecf2a2058ba4c" dependencies = [ "aho-corasick", "memchr", - "regex-automata 0.4.3", - "regex-syntax 0.8.2", + "regex-automata 0.4.6", + "regex-syntax 0.8.3", ] [[package]] @@ -1809,13 +1758,13 @@ dependencies = [ [[package]] name = "regex-automata" -version = "0.4.3" +version = "0.4.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5f804c7828047e88b2d32e2d7fe5a105da8ee3264f01902f796c8e067dc2483f" +checksum = "86b83b8b9847f9bf95ef68afb0b8e6cdb80f498442f5179a29fad448fcc1eaea" dependencies = [ "aho-corasick", "memchr", - "regex-syntax 0.8.2", + "regex-syntax 0.8.3", ] [[package]] @@ -1826,15 +1775,9 @@ checksum = "f162c6dd7b008981e4d40210aca20b4bd0f9b60ca9271061b07f78537722f2e1" [[package]] name = "regex-syntax" -version = "0.7.5" +version = "0.8.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dbb5fb1acd8a1a18b3dd5be62d25485eb770e05afb408a9627d14d451bae12da" - -[[package]] -name = "regex-syntax" -version = "0.8.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c08c74e62047bb2de4ff487b251e4a92e24f48745648451635cec7d591162d9f" +checksum = "adad44e29e4c806119491a7f06f03de4d1af22c3a680dd47f1e6e179439d1f56" [[package]] name = "ron" @@ -1843,7 +1786,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b91f7eff05f748767f183df4320a63d6936e9c6107d97c9e6bdd9784f4289c94" dependencies = [ "base64", - "bitflags 2.4.1", + "bitflags 2.5.0", "serde", "serde_derive", ] @@ -1864,37 +1807,17 @@ version = "0.1.23" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d626bb9dae77e28219937af045c257c28bfd3f69333c512553507f5f9798cb76" -[[package]] -name = "rustix" -version = "0.36.17" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "305efbd14fde4139eb501df5f136994bb520b033fa9fbdce287507dc23b8c7ed" -dependencies = [ - "bitflags 1.3.2", - "errno", - "io-lifetimes", - "libc", - "linux-raw-sys", - "windows-sys 0.45.0", -] - [[package]] name = "rustversion" -version = "1.0.14" +version = "1.0.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7ffc183a10b4478d04cbbbfc96d0873219d962dd5accaff2ffbd4ceb7df837f4" +checksum = "80af6f9131f277a45a3fba6ce8e2258037bb0477a67e610d3c1fe046ab31de47" [[package]] name = "ryu" -version = "1.0.15" +version = "1.0.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1ad4cc8da4ef723ed60bced201181d83791ad433213d8c24efffda1eec85d741" - -[[package]] -name = "safemem" -version = "0.3.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ef703b7cb59335eae2eb93ceb664c0eb7ea6bf567079d843e09420219668e072" +checksum = "e86697c916019a8588c99b5fac3cead74ec0b4b819707a682fd4d23fa0ce1ba1" [[package]] name = "same-file" @@ -1913,29 +1836,29 @@ checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49" [[package]] name = "serde" -version = "1.0.192" +version = "1.0.198" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bca2a08484b285dcb282d0f67b26cadc0df8b19f8c12502c13d966bf9482f001" +checksum = "9846a40c979031340571da2545a4e5b7c4163bdae79b301d5f86d03979451fcc" dependencies = [ "serde_derive", ] [[package]] name = "serde_derive" -version = "1.0.192" +version = "1.0.198" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d6c7207fbec9faa48073f3e3074cbe553af6ea512d7c21ba46e434e70ea9fbc1" +checksum = "e88edab869b01783ba905e7d0153f9fc1a6505a96e4ad3018011eedb838566d9" dependencies = [ "proc-macro2", "quote", - "syn 2.0.39", + "syn 2.0.60", ] [[package]] name = "serde_json" -version = "1.0.108" +version = "1.0.116" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3d1c7e3eac408d115102c4c24ad393e0821bb3a5df4d506a80f85f7a742a526b" +checksum = "3e17db7126d17feb94eb3fad46bf1a96b034e8aacbc2e775fe81505f8b0b2813" dependencies = [ "itoa", "ryu", @@ -1944,9 +1867,9 @@ dependencies = [ [[package]] name = "serde_path_to_error" -version = "0.1.14" +version = "0.1.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4beec8bce849d58d06238cb50db2e1c417cfeafa4c63f692b15c82b7c80f8335" +checksum = "af99884400da37c88f5e9146b7f1fd0fbcae8f6eec4e9da38b67d05486f814a6" dependencies = [ "itoa", "serde", @@ -1954,9 +1877,9 @@ dependencies = [ [[package]] name = "serde_spanned" -version = "0.6.4" +version = "0.6.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "12022b835073e5b11e90a14f86838ceb1c8fb0325b72416845c487ac0fa95e80" +checksum = "eb3622f419d1296904700073ea6cc23ad690adbd66f13ea683df73298736f0c1" dependencies = [ "serde", ] @@ -2035,12 +1958,12 @@ checksum = "3c5e1a9a646d36c3599cd173a41282daf47c44583ad367b8e6837255952e5c67" [[package]] name = "socket2" -version = "0.5.5" +version = "0.5.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7b5fac59a5cb5dd637972e5fca70daf0523c9067fcdc4842f053dae04a18f8e9" +checksum = "05ffd9c0a93b7543e062e759284fcf5f5e3b098501104bfbdde4d404db792871" dependencies = [ "libc", - "windows-sys 0.48.0", + "windows-sys 0.52.0", ] [[package]] @@ -2062,9 +1985,9 @@ dependencies = [ [[package]] name = "syn" -version = "2.0.39" +version = "2.0.60" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "23e78b90f2fcf45d3e842032ce32e3f2d1545ba6636271dcbf24fa306d87be7a" +checksum = "909518bc7b1c9b779f1bbf07f2929d35af9f0f37e47c6e9ef7f9dddc1e1821f3" dependencies = [ "proc-macro2", "quote", @@ -2085,9 +2008,9 @@ checksum = "a7065abeca94b6a8a577f9bd45aa0867a2238b74e8eb67cf10d492bc39351394" [[package]] name = "syntect" -version = "5.1.0" +version = "5.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e02b4b303bf8d08bfeb0445cba5068a3d306b6baece1d5582171a9bf49188f91" +checksum = "874dcfa363995604333cf947ae9f751ca3af4522c60886774c4963943b4746b1" dependencies = [ "bincode", "bitflags 1.3.2", @@ -2096,8 +2019,9 @@ dependencies = [ "once_cell", "onig", "plist", - "regex-syntax 0.7.5", + "regex-syntax 0.8.3", "serde", + "serde_derive", "serde_json", "thiserror", "walkdir", @@ -2128,29 +2052,29 @@ dependencies = [ [[package]] name = "thiserror" -version = "1.0.50" +version = "1.0.58" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f9a7210f5c9a7156bb50aa36aed4c95afb51df0df00713949448cf9e97d382d2" +checksum = "03468839009160513471e86a034bb2c5c0e4baae3b43f79ffc55c4a5427b3297" dependencies = [ "thiserror-impl", ] [[package]] name = "thiserror-impl" -version = "1.0.50" +version = "1.0.58" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "266b2e40bc00e5a6c09c3584011e08b06f123c00362c92b975ba9843aaaa14b8" +checksum = "c61f3ba182994efc43764a46c018c347bc492c79f024e705f46567b418f6d4f7" dependencies = [ "proc-macro2", "quote", - "syn 2.0.39", + "syn 2.0.60", ] [[package]] name = "thread_local" -version = "1.1.7" +version = "1.1.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3fdd6f064ccff2d6567adcb3873ca630700f00b5ad3f060c25b5dcfd9a4ce152" +checksum = "8b9ef9bad013ada3808854ceac7b46812a6465ba368859a37e2100283d2d719c" dependencies = [ "cfg-if", "once_cell", @@ -2158,12 +2082,13 @@ dependencies = [ [[package]] name = "time" -version = "0.3.30" +version = "0.3.36" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c4a34ab300f2dee6e562c10a046fc05e358b29f9bf92277f30c3c8d82275f6f5" +checksum = "5dfd88e563464686c916c7e46e623e520ddc6d79fa6641390f2e3fa86e83e885" dependencies = [ "deranged", "itoa", + "num-conv", "powerfmt", "serde", "time-core", @@ -2178,10 +2103,11 @@ checksum = "ef927ca75afb808a4d64dd374f00a2adf8d0fcff8e7b184af886c3c87ec4a3f3" [[package]] name = "time-macros" -version = "0.2.15" +version = "0.2.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4ad70d68dba9e1f8aceda7aa6711965dfec1cac869f311a51bd08b3a2ccbce20" +checksum = "3f252a68540fde3a3877aeea552b832b40ab9a69e318efd078774a01ddee1ccf" dependencies = [ + "num-conv", "time-core", ] @@ -2196,9 +2122,9 @@ dependencies = [ [[package]] name = "tokio" -version = "1.34.0" +version = "1.37.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d0c014766411e834f7af5b8f4cf46257aab4036ca95e9d2c144a10f59ad6f5b9" +checksum = "1adbebffeca75fcfd058afa480fb6c0b81e165a0323f9c9d39c9697e37c46787" dependencies = [ "backtrace", "bytes", @@ -2232,7 +2158,7 @@ checksum = "5b8a1e28f2deaa14e508979454cb3a223b10b938b45af148bc0986de36f1923b" dependencies = [ "proc-macro2", "quote", - "syn 2.0.39", + "syn 2.0.60", ] [[package]] @@ -2262,9 +2188,9 @@ dependencies = [ [[package]] name = "toml" -version = "0.8.8" +version = "0.8.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a1a195ec8c9da26928f773888e0742ca3ca1040c6cd859c919c9f59c1954ab35" +checksum = "e9dd1545e8208b4a5af1aa9bbd0b4cf7e9ea08fabc5d0a5c67fcaafa17433aa3" dependencies = [ "serde", "serde_spanned", @@ -2283,11 +2209,11 @@ dependencies = [ [[package]] name = "toml_edit" -version = "0.21.0" +version = "0.22.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d34d383cd00a163b4a5b85053df514d45bc330f6de7737edfe0a93311d1eaa03" +checksum = "d3328d4f68a705b2a4498da1d580585d39a6510f98318a2cec3018a7ec61ddef" dependencies = [ - "indexmap 2.1.0", + "indexmap 2.2.6", "serde", "serde_spanned", "toml_datetime", @@ -2350,7 +2276,7 @@ checksum = "1e9cd434a998747dd2c4276bc96ee2e0c7a2eadf3cae88e52be55a05fa9053f5" dependencies = [ "async-compression", "base64", - "bitflags 2.4.1", + "bitflags 2.5.0", "bytes", "futures-core", "futures-util", @@ -2405,7 +2331,7 @@ checksum = "34704c8d6ebcbc939824180af020566b01a7c01f80641264eba0999f6c2b6be7" dependencies = [ "proc-macro2", "quote", - "syn 2.0.39", + "syn 2.0.60", ] [[package]] @@ -2418,17 +2344,6 @@ dependencies = [ "valuable", ] -[[package]] -name = "tracing-log" -version = "0.1.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f751112709b4e791d8ce53e32c4ed2d353565a795ce84da2285393f41557bdf2" -dependencies = [ - "log", - "once_cell", - "tracing-core", -] - [[package]] name = "tracing-log" version = "0.2.0" @@ -2453,7 +2368,7 @@ dependencies = [ "smallvec", "tracing", "tracing-core", - "tracing-log 0.2.0", + "tracing-log", "tracing-subscriber", "web-time", ] @@ -2470,9 +2385,9 @@ dependencies = [ [[package]] name = "tracing-subscriber" -version = "0.3.17" +version = "0.3.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "30a651bc37f915e81f087d86e62a18eec5f79550c7faff886f7090b4ea757c77" +checksum = "ad0f048c97dbd9faa9b7df56362b8ebcaa52adb06b498c050d2f4e32f90a7a8b" dependencies = [ "matchers", "nu-ansi-term", @@ -2485,7 +2400,7 @@ dependencies = [ "thread_local", "tracing", "tracing-core", - "tracing-log 0.1.4", + "tracing-log", "tracing-serde", ] @@ -2592,9 +2507,9 @@ checksum = "daf8dba3b7eb870caf1ddeed7bc9d2a049f3cfdfae7cb521b087cc33ae4c49da" [[package]] name = "uuid" -version = "1.5.0" +version = "1.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "88ad59a7560b41a70d191093a945f0b87bc1deeda46fb237479708a1d6b6cdfc" +checksum = "a183cf7feeba97b4dd1c0d46788634f6221d87fa961b305bed08c851829efcc0" dependencies = [ "getrandom", ] @@ -2613,9 +2528,9 @@ checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f" [[package]] name = "walkdir" -version = "2.4.0" +version = "2.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d71d857dc86794ca4c280d616f7da00d2dbfd8cd788846559a6813e6aa4b54ee" +checksum = "29790946404f91d9c5d06f9874efddea1dc06c5efe94541a7d6863108e3a5e4b" dependencies = [ "same-file", "winapi-util", @@ -2638,9 +2553,9 @@ checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" [[package]] name = "wasm-bindgen" -version = "0.2.88" +version = "0.2.92" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7daec296f25a1bae309c0cd5c29c4b260e510e6d813c286b19eaadf409d40fce" +checksum = "4be2531df63900aeb2bca0daaaddec08491ee64ceecbee5076636a3b026795a8" dependencies = [ "cfg-if", "wasm-bindgen-macro", @@ -2648,24 +2563,24 @@ dependencies = [ [[package]] name = "wasm-bindgen-backend" -version = "0.2.88" +version = "0.2.92" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e397f4664c0e4e428e8313a469aaa58310d302159845980fd23b0f22a847f217" +checksum = "614d787b966d3989fa7bb98a654e369c762374fd3213d212cfc0251257e747da" dependencies = [ "bumpalo", "log", "once_cell", "proc-macro2", "quote", - "syn 2.0.39", + "syn 2.0.60", "wasm-bindgen-shared", ] [[package]] name = "wasm-bindgen-macro" -version = "0.2.88" +version = "0.2.92" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5961017b3b08ad5f3fe39f1e79877f8ee7c23c5e5fd5eb80de95abc41f1f16b2" +checksum = "a1f8823de937b71b9460c0c34e25f3da88250760bec0ebac694b49997550d726" dependencies = [ "quote", "wasm-bindgen-macro-support", @@ -2673,22 +2588,22 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro-support" -version = "0.2.88" +version = "0.2.92" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c5353b8dab669f5e10f5bd76df26a9360c748f054f862ff5f3f8aae0c7fb3907" +checksum = "e94f17b526d0a461a191c78ea52bbce64071ed5c04c9ffe424dcb38f74171bb7" dependencies = [ "proc-macro2", "quote", - "syn 2.0.39", + "syn 2.0.60", "wasm-bindgen-backend", "wasm-bindgen-shared", ] [[package]] name = "wasm-bindgen-shared" -version = "0.2.88" +version = "0.2.92" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0d046c5d029ba91a1ed14da14dca44b68bf2f124cfbaf741c54151fdb3e0750b" +checksum = "af190c94f2773fdb3729c55b007a722abb5384da03bc0986df4c289bf5567e96" [[package]] name = "web-time" @@ -2713,7 +2628,6 @@ dependencies = [ "opentelemetry", "opentelemetry-otlp", "opentelemetry_sdk", - "prometheus", "pulldown-cmark", "regex", "serde", @@ -2723,6 +2637,7 @@ dependencies = [ "tera", "tokio", "toml", + "tonic", "tower", "tower-http", "tracing", @@ -2763,20 +2678,11 @@ checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" [[package]] name = "windows-core" -version = "0.51.1" +version = "0.52.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f1f8cf84f35d2db49a46868f947758c7a1138116f7fac3bc844f43ade1292e64" +checksum = "33ab640c8d7e35bf8ba19b884ba838ceb4fba93a4e8c65a9059d08afcfc683d9" dependencies = [ - "windows-targets 0.48.5", -] - -[[package]] -name = "windows-sys" -version = "0.45.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "75283be5efb2831d37ea142365f009c02ec203cd29a3ebecbc093d52315b66d0" -dependencies = [ - "windows-targets 0.42.2", + "windows-targets 0.52.5", ] [[package]] @@ -2789,18 +2695,12 @@ dependencies = [ ] [[package]] -name = "windows-targets" -version = "0.42.2" +name = "windows-sys" +version = "0.52.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8e5180c00cd44c9b1c88adb3693291f1cd93605ded80c250a75d472756b4d071" +checksum = "282be5f36a8ce781fad8c8ae18fa3f9beff57ec1b52cb3de0789201425d9a33d" dependencies = [ - "windows_aarch64_gnullvm 0.42.2", - "windows_aarch64_msvc 0.42.2", - "windows_i686_gnu 0.42.2", - "windows_i686_msvc 0.42.2", - "windows_x86_64_gnu 0.42.2", - "windows_x86_64_gnullvm 0.42.2", - "windows_x86_64_msvc 0.42.2", + "windows-targets 0.52.5", ] [[package]] @@ -2819,10 +2719,20 @@ dependencies = [ ] [[package]] -name = "windows_aarch64_gnullvm" -version = "0.42.2" +name = "windows-targets" +version = "0.52.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "597a5118570b68bc08d8d59125332c54f1ba9d9adeedeef5b99b02ba2b0698f8" +checksum = "6f0713a46559409d202e70e28227288446bf7841d3211583a4b53e3f6d96e7eb" +dependencies = [ + "windows_aarch64_gnullvm 0.52.5", + "windows_aarch64_msvc 0.52.5", + "windows_i686_gnu 0.52.5", + "windows_i686_gnullvm", + "windows_i686_msvc 0.52.5", + "windows_x86_64_gnu 0.52.5", + "windows_x86_64_gnullvm 0.52.5", + "windows_x86_64_msvc 0.52.5", +] [[package]] name = "windows_aarch64_gnullvm" @@ -2831,10 +2741,10 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2b38e32f0abccf9987a4e3079dfb67dcd799fb61361e53e2882c3cbaf0d905d8" [[package]] -name = "windows_aarch64_msvc" -version = "0.42.2" +name = "windows_aarch64_gnullvm" +version = "0.52.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e08e8864a60f06ef0d0ff4ba04124db8b0fb3be5776a5cd47641e942e58c4d43" +checksum = "7088eed71e8b8dda258ecc8bac5fb1153c5cffaf2578fc8ff5d61e23578d3263" [[package]] name = "windows_aarch64_msvc" @@ -2843,10 +2753,10 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "dc35310971f3b2dbbf3f0690a219f40e2d9afcf64f9ab7cc1be722937c26b4bc" [[package]] -name = "windows_i686_gnu" -version = "0.42.2" +name = "windows_aarch64_msvc" +version = "0.52.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c61d927d8da41da96a81f029489353e68739737d3beca43145c8afec9a31a84f" +checksum = "9985fd1504e250c615ca5f281c3f7a6da76213ebd5ccc9561496568a2752afb6" [[package]] name = "windows_i686_gnu" @@ -2855,10 +2765,16 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a75915e7def60c94dcef72200b9a8e58e5091744960da64ec734a6c6e9b3743e" [[package]] -name = "windows_i686_msvc" -version = "0.42.2" +name = "windows_i686_gnu" +version = "0.52.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "44d840b6ec649f480a41c8d80f9c65108b92d89345dd94027bfe06ac444d1060" +checksum = "88ba073cf16d5372720ec942a8ccbf61626074c6d4dd2e745299726ce8b89670" + +[[package]] +name = "windows_i686_gnullvm" +version = "0.52.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "87f4261229030a858f36b459e748ae97545d6f1ec60e5e0d6a3d32e0dc232ee9" [[package]] name = "windows_i686_msvc" @@ -2867,10 +2783,10 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8f55c233f70c4b27f66c523580f78f1004e8b5a8b659e05a4eb49d4166cca406" [[package]] -name = "windows_x86_64_gnu" -version = "0.42.2" +name = "windows_i686_msvc" +version = "0.52.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8de912b8b8feb55c064867cf047dda097f92d51efad5b491dfb98f6bbb70cb36" +checksum = "db3c2bf3d13d5b658be73463284eaf12830ac9a26a90c717b7f771dfe97487bf" [[package]] name = "windows_x86_64_gnu" @@ -2879,10 +2795,10 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "53d40abd2583d23e4718fddf1ebec84dbff8381c07cae67ff7768bbf19c6718e" [[package]] -name = "windows_x86_64_gnullvm" -version = "0.42.2" +name = "windows_x86_64_gnu" +version = "0.52.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "26d41b46a36d453748aedef1486d5c7a85db22e56aff34643984ea85514e94a3" +checksum = "4e4246f76bdeff09eb48875a0fd3e2af6aada79d409d33011886d3e1581517d9" [[package]] name = "windows_x86_64_gnullvm" @@ -2891,10 +2807,10 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0b7b52767868a23d5bab768e390dc5f5c55825b6d30b86c844ff2dc7414044cc" [[package]] -name = "windows_x86_64_msvc" -version = "0.42.2" +name = "windows_x86_64_gnullvm" +version = "0.52.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9aec5da331524158c6d1a4ac0ab1541149c0b9505fde06423b02f5ef0106b9f0" +checksum = "852298e482cd67c356ddd9570386e2862b5673c85bd5f88df9ab6802b334c596" [[package]] name = "windows_x86_64_msvc" @@ -2903,10 +2819,16 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ed94fce61571a4006852b7389a063ab983c02eb1bb37b47f8272ce92d06d9538" [[package]] -name = "winnow" -version = "0.5.19" +name = "windows_x86_64_msvc" +version = "0.52.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "829846f3e3db426d4cee4510841b71a8e58aa2a76b1132579487ae430ccd9c7b" +checksum = "bec47e5bfd1bff0eeaf6d8b485cc1074891a197ab4225d504cb7a1ab88b02bf0" + +[[package]] +name = "winnow" +version = "0.6.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f0c976aaaa0e1f90dbb21e9587cdaf1d9679a1cde8875c0d6bd83ab96a208352" dependencies = [ "memchr", ] @@ -2922,47 +2844,47 @@ dependencies = [ [[package]] name = "zerocopy" -version = "0.7.25" +version = "0.7.32" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8cd369a67c0edfef15010f980c3cbe45d7f651deac2cd67ce097cd801de16557" +checksum = "74d4d3961e53fa4c9a25a8637fc2bfaf2595b3d3ae34875568a5cf64787716be" dependencies = [ "zerocopy-derive", ] [[package]] name = "zerocopy-derive" -version = "0.7.25" +version = "0.7.32" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c2f140bda219a26ccc0cdb03dba58af72590c53b22642577d88a927bc5c87d6b" +checksum = "9ce1b18ccd8e73a9321186f97e46f9f04b778851177567b1975109d26a08d2a6" dependencies = [ "proc-macro2", "quote", - "syn 2.0.39", + "syn 2.0.60", ] [[package]] name = "zstd" -version = "0.13.0" +version = "0.13.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bffb3309596d527cfcba7dfc6ed6052f1d39dfbd7c867aa2e865e4a449c10110" +checksum = "2d789b1514203a1120ad2429eae43a7bd32b90976a7bb8a05f7ec02fa88cc23a" dependencies = [ "zstd-safe", ] [[package]] name = "zstd-safe" -version = "7.0.0" +version = "7.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "43747c7422e2924c11144d5229878b98180ef8b06cca4ab5af37afc8a8d8ea3e" +checksum = "1cd99b45c6bc03a018c8b8a86025678c87e55526064e38f9df301989dce7ec0a" dependencies = [ "zstd-sys", ] [[package]] name = "zstd-sys" -version = "2.0.9+zstd.1.5.5" +version = "2.0.10+zstd.1.5.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9e16efa8a874a0481a574084d34cc26fdb3b99627480f785888deb6386506656" +checksum = "c253a4914af5bafc8fa8c86ee400827e83cf6ec01195ec1f1ed8441bf00d65aa" dependencies = [ "cc", "pkg-config", diff --git a/Cargo.toml b/Cargo.toml index 6af1eb9..5adec3a 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -13,9 +13,8 @@ chrono = { version = "0.4.31", features = ["serde"] } config = "0.14.0" glob = "0.3.0" opentelemetry = { version = "0.22.0", features = ["trace", "metrics"] } -opentelemetry-otlp = { version = "0.15.0", features = ["trace", "metrics"] } +opentelemetry-otlp = { version = "0.15.0", features = ["trace", "metrics", "logs"] } opentelemetry_sdk = { version = "0.22.1", features = ["rt-tokio", "trace", "metrics"] } -prometheus = { version = "0.13.3", features = ["process"] } pulldown-cmark = "0.10.2" regex = "1.7.2" serde = "1.0.144" @@ -25,6 +24,7 @@ syntect = "5.0.0" tera = { version = "1.19.1", features = ["builtins"] } tokio = { version = "1.34.0", features = ["full", "tracing"] } toml = "0.8.8" +tonic = "0.11.0" tower = { version = "0.4.13", features = ["full"] } tower-http = { version = "0.5.2", features = ["full"] } tracing = "0.1.35" diff --git a/Dockerfile b/Dockerfile index f259a68..3061f94 100644 --- a/Dockerfile +++ b/Dockerfile @@ -63,6 +63,7 @@ COPY --from=builder /app/target/x86_64-unknown-linux-musl/release/website ./ COPY ./static ./static COPY ./templates ./templates COPY ./posts ./posts +COPY ./config.toml ./config.toml EXPOSE 8180 @@ -71,4 +72,4 @@ USER website:website ENV RUST_LOG="debug" -CMD ["./website"] \ No newline at end of file +ENTRYPOINT ["/app/website"] \ No newline at end of file diff --git a/compose.yaml b/compose.yaml new file mode 100644 index 0000000..dd791b8 --- /dev/null +++ b/compose.yaml @@ -0,0 +1,35 @@ +name: "tlxite" +services: + web: + build: . + ports: + - "8080:8080" + depends_on: + - otel-collector + otel-collector: + image: otel/opentelemetry-collector:latest + restart: always + command: ["--config=/etc/otel-collector-config.yaml", "${OTELCOL_ARGS}"] + volumes: + - ./otel-collector-config.yaml:/etc/otel-collector-config.yaml + ports: + - "1888:1888" # pprof extension + - "8888:8888" # Prometheus metrics exposed by the collector + - "8889:8889" # Prometheus exporter metrics + - "13133:13133" # health_check extension + - "4317:4317" # OTLP gRPC receiver + - "55679:55679" # zpages extension + depends_on: + - openobserve + openobserve: + image: public.ecr.aws/zinclabs/openobserve:latest + restart: unless-stopped + environment: + ZO_ROOT_USER_EMAIL: "adrian@tollyx.net" + ZO_ROOT_USER_PASSWORD: "Planka" + ports: + - "5080:5080" + volumes: + - ./data:/data +volumes: + data: \ No newline at end of file diff --git a/config.toml b/config.toml index 39d7948..40cd57a 100644 --- a/config.toml +++ b/config.toml @@ -1,3 +1,11 @@ base_url = "http://localhost:8080/" bind_address = "0.0.0.0:8080" logging = "info,website=debug" + +[otlp] +enabled = false +endpoint = "http://otel-collector:4317" +authorization = "Basic YWRyaWFuQHRvbGx5eC5uZXQ6N3VHVDU1NGpudGdxVE5LMg==" +organization = "default" +stream_name = "default" +tls_insecure = true diff --git a/otel-collector-config.yaml b/otel-collector-config.yaml new file mode 100644 index 0000000..8dd9f73 --- /dev/null +++ b/otel-collector-config.yaml @@ -0,0 +1,39 @@ +receivers: + otlp: + protocols: + grpc: + +exporters: + + debug: + + otlp/openobserve: + endpoint: openobserve:5081 + headers: + Authorization: "Basic YWRyaWFuQHRvbGx5eC5uZXQ6bDVVV21IVHlSd0lmSTJ4Qg==" + organization: default + stream-name: default + tls: + insecure: true + +processors: + batch: + +extensions: + health_check: + pprof: + endpoint: :1888 + zpages: + endpoint: :55679 + +service: + extensions: [pprof, zpages, health_check] + pipelines: + traces: + receivers: [otlp] + processors: [batch] + exporters: [debug, otlp/openobserve] + metrics: + receivers: [otlp] + processors: [batch] + exporters: [debug, otlp/openobserve] \ No newline at end of file diff --git a/posts/foldertest/index.md b/posts/foldertest/index.md index 5a1cfa3..84ff2fd 100644 --- a/posts/foldertest/index.md +++ b/posts/foldertest/index.md @@ -15,6 +15,8 @@ modified post test, see if docker skips build using testing "smart" punctuation --- I don't know if I want it. 'it should' do some fancy stuff. +Here's a foornote for testing[^footnote] + code hilighting test: ```rs @@ -23,10 +25,14 @@ fn main() { } ``` -uh oh, here comes a screenshot from a different post! +uh oh, here comes a screenshot from a different post![^2] ![dungeon screenshot](../dungeon/screenshot.png) and here it is again, except it should 404! ![missing dungeon screenshot](../dungeon/screenshot.jpeg) + +[^footnote]: Who is this anyway! + +[^2]: a second footnote oh my! diff --git a/src/feed.rs b/src/feed.rs index 317f8cd..63d8351 100644 --- a/src/feed.rs +++ b/src/feed.rs @@ -3,7 +3,7 @@ use serde_derive::Serialize; use tracing::instrument; -use crate::{post::Post, tag::Tag, AppState}; +use crate::{page::Page, tag::Tag, AppState}; #[derive(Serialize)] struct FeedContext<'a> { @@ -11,13 +11,13 @@ struct FeedContext<'a> { base_url: &'a str, last_updated: &'a str, tag: Option<&'a Tag>, - posts: &'a [&'a Post], + posts: &'a [&'a Page], } #[instrument(skip(state))] pub fn render_atom_feed(state: &AppState) -> Result { let mut posts: Vec<_> = state - .posts + .pages .values() .filter(|p| !p.draft && p.is_published()) .collect(); @@ -43,7 +43,7 @@ pub fn render_atom_feed(state: &AppState) -> Result { #[instrument(skip(tag, state))] pub fn render_atom_tag_feed(tag: &Tag, state: &AppState) -> Result { let mut posts: Vec<_> = state - .posts + .pages .values() .filter(|p| !p.draft && p.is_published() && p.tags.contains(&tag.slug)) .collect(); diff --git a/src/handlers/mod.rs b/src/handlers/mod.rs index 249a140..b356691 100644 --- a/src/handlers/mod.rs +++ b/src/handlers/mod.rs @@ -1,5 +1,4 @@ use axum::{ - body::Body, extract::{Request, State}, http::{header, HeaderMap, StatusCode}, middleware::Next, @@ -7,9 +6,9 @@ use axum::{ routing::get, Router, }; -use cached::once_cell::sync::Lazy; use chrono::{DateTime, FixedOffset}; -use prometheus::{opts, Encoder, IntCounterVec, TextEncoder}; +use opentelemetry::{global, metrics::Counter, KeyValue}; +use tokio::sync::OnceCell; use std::sync::Arc; use tower_http::services::ServeDir; use tracing::{ @@ -19,31 +18,29 @@ use tracing::{ use crate::{AppState, WebsiteError}; -pub mod posts; +pub mod pages; pub mod tags; -pub static HIT_COUNTER: Lazy = Lazy::new(|| { - prometheus::register_int_counter_vec!( - opts!( - "http_requests_total", - "Total amount of http requests received" - ), - &["route", "method", "status"] - ) - .unwrap() -}); +pub static HIT_COUNTER: OnceCell> = OnceCell::const_new(); + +async fn record_hit(method: String, path: String) { + let counter = HIT_COUNTER.get_or_init(|| async { + global::meter("tlxite").u64_counter("page_hit_count").init() + }).await; + + counter.add(1, &[KeyValue::new("path", format!("{method} {path}"))]); +} pub fn routes(state: &Arc) -> Router> { Router::new() .route("/", get(index)) - .merge(posts::router()) + .merge(pages::router()) .merge(tags::router()) - .merge(posts::alias_router(state.posts.values())) + .merge(pages::alias_router(state.pages.values())) .route("/healthcheck", get(healthcheck)) .route_service("/posts/:slug/*path", ServeDir::new("./")) .route_service("/static/*path", ServeDir::new("./")) .layer(axum::middleware::from_fn(metrics_middleware)) - .route("/metrics", get(metrics)) } #[instrument(skip(state))] @@ -72,20 +69,6 @@ async fn healthcheck() -> &'static str { "OK" } -#[instrument] -async fn metrics() -> impl IntoResponse { - let encoder = TextEncoder::new(); - let metric_families = prometheus::gather(); - let mut buffer = vec![]; - encoder.encode(&metric_families, &mut buffer).unwrap(); - - Response::builder() - .status(200) - .header(header::CONTENT_TYPE, encoder.format_type()) - .body(Body::from(buffer)) - .unwrap() -} - pub async fn not_found() -> impl IntoResponse { (StatusCode::NOT_FOUND, ()) } @@ -98,13 +81,7 @@ pub async fn metrics_middleware(request: Request, next: Next) -> Response { let response = next.run(request).await; if !response.status().is_client_error() { - HIT_COUNTER - .with_label_values(&[&path, method.as_str(), response.status().as_str()]) - .inc(); - } else if response.status() == StatusCode::NOT_FOUND { - HIT_COUNTER - .with_label_values(&["not found", method.as_str(), response.status().as_str()]) - .inc(); + record_hit(method.to_string(), path).await; } response @@ -171,9 +148,9 @@ mod tests { }; // Load the actual posts, just to make this test fail if // aliases overlap with themselves or other routes - let posts = crate::post::load_all(&state).await.unwrap(); + let posts = crate::page::load_all(&state, "posts/".into()).await.unwrap(); state.tags = crate::tag::get_tags(posts.values()); - state.posts = posts; + state.pages = posts; let state = Arc::new(state); super::routes(&state).with_state(state).into_make_service(); diff --git a/src/handlers/posts.rs b/src/handlers/pages.rs similarity index 92% rename from src/handlers/posts.rs rename to src/handlers/pages.rs index f61fdb5..949ac31 100644 --- a/src/handlers/posts.rs +++ b/src/handlers/pages.rs @@ -12,7 +12,7 @@ use serde_derive::Serialize; use tracing::{instrument, log::warn}; use crate::{ - post::{render_post, Post}, + page::{render_post, Page}, AppState, WebsiteError, }; @@ -28,7 +28,7 @@ pub fn router() -> Router> { .route("/posts/:slug/index.md", get(super::not_found)) } -pub fn alias_router<'a>(posts: impl IntoIterator) -> Router> { +pub fn alias_router<'a>(posts: impl IntoIterator) -> Router> { let mut router = Router::new(); for post in posts { @@ -52,12 +52,12 @@ struct PageContext<'a> { } #[instrument(skip(state))] -pub async fn index( +async fn index( State(state): State>, headers: HeaderMap, ) -> Result { - let mut posts: Vec<&Post> = state - .posts + let mut posts: Vec<&Page> = state + .pages .values() .filter(|p| !p.draft && p.is_published()) .collect(); @@ -92,12 +92,12 @@ pub async fn index( } #[instrument(skip(state))] -pub async fn view( +async fn view( Path(slug): Path, State(state): State>, headers: HeaderMap, ) -> Result { - let post = state.posts.get(&slug).ok_or(WebsiteError::NotFound)?; + let post = state.pages.get(&slug).ok_or(WebsiteError::NotFound)?; let last_changed = post.last_modified(); @@ -128,8 +128,8 @@ pub async fn feed( State(state): State>, headers: HeaderMap, ) -> Result { - let mut posts: Vec<&Post> = state - .posts + let mut posts: Vec<&Page> = state + .pages .values() .filter(|p| !p.draft && p.is_published()) .collect(); @@ -163,7 +163,7 @@ pub async fn redirect( Path(slug): Path, State(state): State>, ) -> Result { - if state.posts.contains_key(&slug) { + if state.pages.contains_key(&slug) { Ok(Redirect::permanent(&format!("/posts/{slug}/"))) } else { Err(WebsiteError::NotFound) @@ -174,21 +174,21 @@ pub async fn redirect( mod tests { use chrono::DateTime; - use crate::post::Post; + use crate::page::Page; use super::PageContext; #[test] fn render_index() { let posts = vec![ - Post { + Page { title: "test".into(), slug: "test".into(), tags: vec!["abc".into(), "def".into()], date: Some(DateTime::parse_from_rfc3339("2023-03-26T13:04:01+02:00").unwrap()), ..Default::default() }, - Post { + Page { title: "test2".into(), slug: "test2".into(), date: None, diff --git a/src/handlers/tags.rs b/src/handlers/tags.rs index 0f1e25f..4ec2f68 100644 --- a/src/handlers/tags.rs +++ b/src/handlers/tags.rs @@ -11,7 +11,7 @@ use axum::{ use serde_derive::Serialize; use tracing::instrument; -use crate::{post::Post, AppState, WebsiteError}; +use crate::{page::Page, AppState, WebsiteError}; use super::should_return_304; @@ -54,8 +54,8 @@ pub async fn view( State(state): State>, headers: HeaderMap, ) -> Result { - let mut posts: Vec<&Post> = state - .posts + let mut posts: Vec<&Page> = state + .pages .values() .filter(|p| !p.draft && p.is_published() && p.tags.contains(&tag)) .collect(); @@ -100,8 +100,8 @@ pub async fn feed( ) -> Result { let tag = state.tags.get(&slug).ok_or(WebsiteError::NotFound)?; - let mut posts: Vec<&Post> = state - .posts + let mut posts: Vec<&Page> = state + .pages .values() .filter(|p| p.is_published() && p.tags.contains(&slug)) .collect(); diff --git a/src/main.rs b/src/main.rs index 9258269..ee3f58c 100644 --- a/src/main.rs +++ b/src/main.rs @@ -4,12 +4,13 @@ use std::{collections::HashMap, fmt::Display, sync::Arc}; use axum::http::Uri; use chrono::DateTime; -use config::Config; -use post::Post; +use page::Page; +use settings::Settings; use tag::Tag; use tera::Tera; +use tokio::net::TcpListener; use tower_http::{compression::CompressionLayer, cors::CorsLayer}; use tracing::{instrument, log::info}; @@ -21,38 +22,38 @@ mod helpers; mod hilighting; mod markdown; mod observability; -mod post; +mod page; +mod settings; mod tag; #[derive(Default)] pub struct AppState { startup_time: DateTime, base_url: Uri, - posts: HashMap, + pages: HashMap, tags: HashMap, tera: Tera, } #[tokio::main] async fn main() -> Result<()> { - let cfg = Config::builder() - .add_source(config::File::with_name("config.toml")) - .add_source(config::Environment::with_prefix("WEBSITE")) - .build()?; + let cfg = settings::get()?; + println!("{cfg:?}"); - observability::init_tracing(&cfg); + observability::init(&cfg)?; info!("Starting server..."); - let addr = cfg.get_string("bind_address")?; let app = init_app(&cfg).await?; - let listener = tokio::net::TcpListener::bind(addr).await.unwrap(); + let listener = TcpListener::bind(&cfg.bind_address).await.unwrap(); axum::serve(listener, app.into_make_service()).await?; + opentelemetry::global::shutdown_tracer_provider(); + Ok(()) } -#[instrument] -async fn init_app(cfg: &Config) -> Result { - let base_url: Uri = cfg.get_string("base_url")?.parse().unwrap(); +#[instrument(skip(cfg))] +async fn init_app(cfg: &Settings) -> Result { + let base_url: Uri = cfg.base_url.parse().unwrap(); let tera = Tera::new("templates/**/*")?; let mut state = AppState { @@ -62,9 +63,9 @@ async fn init_app(cfg: &Config) -> Result { ..Default::default() }; - let posts = post::load_all(&state).await?; + let posts = page::load_all(&state, "pages/".into()).await?; let tags = tag::get_tags(posts.values()); - state.posts = posts; + state.pages = posts; state.tags = tags; let state = Arc::new(state); diff --git a/src/markdown.rs b/src/markdown.rs index bd3cb6c..3183955 100644 --- a/src/markdown.rs +++ b/src/markdown.rs @@ -4,6 +4,7 @@ use axum::http::Uri; use cached::once_cell::sync::Lazy; use pulldown_cmark::CodeBlockKind; use pulldown_cmark::Event; +use pulldown_cmark::LinkType; use pulldown_cmark::Tag; use pulldown_cmark::TagEnd; use pulldown_cmark::{Options, Parser}; @@ -13,8 +14,13 @@ use tracing::instrument; static STARTS_WITH_SCHEMA_RE: Lazy = Lazy::new(|| Regex::new(r"^\w+:").unwrap()); static EMAIL_RE: Lazy = Lazy::new(|| Regex::new(r"^.+?@\w+(\.\w+)*$").unwrap()); +pub struct RenderResult { + pub content_html: String, + pub metadata: String +} + #[instrument(skip(markdown))] -pub fn render_markdown_to_html(base_uri: Option<&Uri>, markdown: &str) -> String { +pub fn render_markdown_to_html(base_uri: Option<&Uri>, markdown: &str) -> RenderResult { let mut opt = Options::empty(); opt.insert(Options::ENABLE_FOOTNOTES); opt.insert(Options::ENABLE_HEADING_ATTRIBUTES); @@ -22,22 +28,33 @@ pub fn render_markdown_to_html(base_uri: Option<&Uri>, markdown: &str) -> String opt.insert(Options::ENABLE_TABLES); opt.insert(Options::ENABLE_TASKLISTS); opt.insert(Options::ENABLE_SMART_PUNCTUATION); + opt.insert(Options::ENABLE_PLUSES_DELIMITED_METADATA_BLOCKS); let mut content_html = String::new(); let parser = Parser::new_ext(markdown, opt); let mut code_lang = None; let mut code_accumulator = String::new(); + let mut meta_kind = None; + let mut meta_accumulator = String::new(); let mut events = Vec::new(); for event in parser { match event { Event::Text(text) => { if code_lang.is_some() { code_accumulator.push_str(&text); + } else if meta_kind.is_some() { + meta_accumulator.push_str(&text); } else { events.push(Event::Text(text)); } } + Event::Start(Tag::MetadataBlock(kind)) => { + meta_kind = Some(kind); + } + Event::End(TagEnd::MetadataBlock(_)) => { + meta_kind = None; + } Event::Start(Tag::Link { mut dest_url, link_type, @@ -45,7 +62,7 @@ pub fn render_markdown_to_html(base_uri: Option<&Uri>, markdown: &str) -> String id, }) => { if let Some(uri) = base_uri { - if !dest_url.starts_with('#') + if link_type != LinkType::Email && !STARTS_WITH_SCHEMA_RE.is_match(&dest_url) && !EMAIL_RE.is_match(&dest_url) { @@ -104,5 +121,8 @@ pub fn render_markdown_to_html(base_uri: Option<&Uri>, markdown: &str) -> String pulldown_cmark::html::push_html(&mut content_html, events.into_iter()); - content_html + RenderResult { + content_html, + metadata: meta_accumulator, + } } diff --git a/src/observability.rs b/src/observability.rs index d0b2c17..c2c83ba 100644 --- a/src/observability.rs +++ b/src/observability.rs @@ -1,70 +1,158 @@ -use std::time::Duration; +use std::{borrow::Cow, net::SocketAddr, time::Duration}; +use anyhow::{Error, Result}; use axum::{ - extract::{MatchedPath, OriginalUri, Request}, - http::uri::PathAndQuery, + extract::{ConnectInfo, MatchedPath, OriginalUri, Request}, + http::{header, uri::PathAndQuery, HeaderMap}, response::Response, }; -use config::Config; -use opentelemetry::global; -use opentelemetry_sdk::propagation::TraceContextPropagator; +use opentelemetry::{global, KeyValue}; +use opentelemetry_otlp::WithExportConfig; +use opentelemetry_sdk::{ + metrics::reader::{DefaultAggregationSelector, DefaultTemporalitySelector}, propagation::TraceContextPropagator, trace::{RandomIdGenerator, Sampler}, Resource +}; use tracing::{field::Empty, info_span, Span}; use tracing_subscriber::{layer::SubscriberExt, util::SubscriberInitExt, EnvFilter}; -pub fn init_tracing(cfg: &Config) { - let filter = if let Ok(filter) = cfg.get_string("logging") { - EnvFilter::builder() - .with_default_directive("info".parse().unwrap()) - .parse_lossy(filter) - } else { - EnvFilter::builder() - .with_default_directive("info".parse().unwrap()) - .from_env_lossy() - }; +use crate::settings::Settings; - global::set_text_map_propagator(TraceContextPropagator::new()); +pub fn init(cfg: &Settings) -> Result<(), Error> { + let filter = EnvFilter::builder() + .with_default_directive("info".parse()?) + .parse_lossy(&cfg.logging); - let tracer = opentelemetry_otlp::new_pipeline() - .tracing() - .with_exporter(opentelemetry_otlp::new_exporter().tonic()) - .install_batch(opentelemetry_sdk::runtime::Tokio) - .unwrap(); - let otel = tracing_opentelemetry::layer().with_tracer(tracer); - tracing_subscriber::registry() - .with(filter) - .with(otel) - .with(tracing_subscriber::fmt::layer()) - .init(); + if cfg.otlp.enabled { + let tracer = opentelemetry_otlp::new_pipeline() + .tracing() + .with_trace_config( + opentelemetry_sdk::trace::config() + .with_sampler(Sampler::AlwaysOn) + .with_id_generator(RandomIdGenerator::default()) + .with_resource(Resource::new(vec![KeyValue::new("service.name", "tlxite")])), + ) + .with_exporter( + opentelemetry_otlp::new_exporter() + .tonic() + .with_endpoint(&cfg.otlp.endpoint), + ) + .install_batch(opentelemetry_sdk::runtime::Tokio)?; + + global::set_text_map_propagator(TraceContextPropagator::new()); + let otel_tracer = tracing_opentelemetry::layer().with_tracer(tracer); + + + let meter = opentelemetry_otlp::new_pipeline() + .metrics(opentelemetry_sdk::runtime::Tokio) + .with_exporter( + opentelemetry_otlp::new_exporter() + .tonic() + .with_endpoint(&cfg.otlp.endpoint), + ) + .with_resource(Resource::new(vec![KeyValue::new("service.name", "tlxite")])) + .with_period(Duration::from_secs(3)) + .with_timeout(Duration::from_secs(10)) + .with_aggregation_selector(DefaultAggregationSelector::new()) + .with_temporality_selector(DefaultTemporalitySelector::new()) + .build()?; + + global::set_meter_provider(meter); + + + + // let logger = opentelemetry_otlp::new_pipeline() + // .logging() + // .with_exporter( + // opentelemetry_otlp::new_exporter() + // .tonic() + // .with_endpoint(&cfg.otlp.endpoint), + + // ) + // .install_batch(opentelemetry_sdk::runtime::Tokio)?; + + tracing_subscriber::registry() + .with(filter) + .with(otel_tracer) + .with(tracing_subscriber::fmt::layer().compact()) + .init(); + } + else { + tracing_subscriber::registry() + .with(filter) + .with(tracing_subscriber::fmt::layer().compact()) + .init(); + } + + + + + Ok(()) } -pub fn make_span(request: &Request) -> Span { - let uri = if let Some(OriginalUri(uri)) = request.extensions().get::() { +pub fn make_span(req: &Request) -> Span { + let uri = if let Some(OriginalUri(uri)) = req.extensions().get::() { uri } else { - request.uri() + req.uri() }; - let route = request + let route = req .extensions() .get::() .map_or(uri.path(), axum::extract::MatchedPath::as_str); - let method = request.method().as_str(); + let method = req.method().as_str(); + let scheme = req.uri().scheme().map_or("HTTP", |s| s.as_str()); let target = uri .path_and_query() .map_or(uri.path(), PathAndQuery::as_str); + + let user_agent = req + .headers() + .get(header::USER_AGENT) + .map_or("", |h| h.to_str().unwrap_or("")); + let name = format!("{method} {route}"); + let client_ip = parse_x_forwarded_for(req.headers()) + .or_else(|| { + req.extensions() + .get::>() + .map(|ConnectInfo(client_ip)| Cow::from(client_ip.to_string())) + }) + .unwrap_or_default(); + info_span!( "request", otel.name = %name, + otel.kind = &"server", + http.client_ip = %client_ip, http.route = %route, http.method = %method, http.target = %target, - http.status_code = Empty + http.scheme = %scheme, + http.user_agent = %user_agent, + http.status_code = Empty, + otel.status_code = Empty, ) } +fn parse_x_forwarded_for(headers: &HeaderMap) -> Option> { + let value = headers.get("x-forwarded-for")?; + let value = value.to_str().ok()?; + let mut ips = value.split(','); + Some(ips.next()?.trim().into()) +} + pub fn on_response(response: &Response, _latency: Duration, span: &Span) { span.record("http.status_code", response.status().as_str()); + if response.status().is_server_error() { + span.record( + "otel.status_code", + if response.status().is_server_error() { + "ERROR" + } else { + "OK" + }, + ); + } } diff --git a/src/post.rs b/src/page.rs similarity index 53% rename from src/post.rs rename to src/page.rs index 50ea5fe..b830e6d 100644 --- a/src/post.rs +++ b/src/page.rs @@ -1,26 +1,19 @@ -use std::{collections::HashMap, path::Path}; +use std::{collections::HashMap, fmt::Debug, path::{Path, PathBuf}}; use anyhow::Result; -use cached::once_cell::sync::Lazy; use chrono::{DateTime, FixedOffset}; -use glob::glob; -use regex::Regex; use serde_derive::{Deserialize, Serialize}; use tokio::fs; use tracing::{ instrument, - log::{debug, warn}, + log::debug, }; use crate::{helpers, markdown, AppState, WebsiteError}; -static FRONTMATTER_REGEX: Lazy = Lazy::new(|| { - Regex::new(r"^[\s]*\+{3}(\r?\n(?s).*?(?-s))\+{3}[\s]*(?:$|(?:\r?\n((?s).*(?-s))$))").unwrap() -}); - #[derive(Deserialize, Debug, Default)] pub struct TomlFrontMatter { pub title: String, @@ -32,7 +25,7 @@ pub struct TomlFrontMatter { } #[derive(Serialize, Clone, Debug, Default)] -pub struct Post { +pub struct Page { pub title: String, pub draft: bool, pub date: Option>, @@ -44,9 +37,9 @@ pub struct Post { pub absolute_path: String, } -impl Post { - pub fn new(slug: String, content: String, fm: TomlFrontMatter) -> Post { - Post { +impl Page { + pub fn new(slug: String, content: String, fm: TomlFrontMatter) -> Page { + Page { absolute_path: format!("/posts/{slug}/"), slug, content, @@ -77,70 +70,70 @@ impl Post { } #[instrument(skip(state))] -pub async fn load_all(state: &AppState) -> Result> { - let mut res = HashMap::::new(); - for path in glob("posts/**/*.md")? { - let path = path.unwrap(); - debug!("found page: {}", path.display()); +pub async fn load_all(state: &AppState, folder: PathBuf) -> Result> { + let mut pages = HashMap::::new(); + let mut dirs: Vec = vec![folder]; - let path = path.to_string_lossy().replace('\\', "/"); - let slug = path - .trim_start_matches("posts") - .trim_start_matches('/') - .trim_start_matches('\\') - .trim_end_matches(".html") - .trim_end_matches(".md") - .trim_end_matches("index") - .trim_end_matches('\\') - .trim_end_matches('/'); + while let Some(dir) = dirs.pop() { + let mut read_dir = fs::read_dir(dbg!(dir)).await?; - let post = load_post(state, slug).await?; - - res.insert(slug.to_string(), post); + while let Some(entry) = read_dir.next_entry().await? { + let path = entry.path(); + if path.is_dir() { + dirs.push(path); + } + else if let Some(ext) = path.extension() { + if ext == "md" { + // it's a page to load + let page = load_page(state, &path).await?; + pages.insert(page.slug.clone(), page); + } + } + } } - Ok(res) + + // for path in --- { + // let path = path.unwrap(); + // debug!("found page: {}", path.display()); + + // let post = load_post(state, &path).await?; + + // res.insert(post.slug.clone(), post); + // } + Ok(pages) } #[instrument(skip(state))] -pub async fn load_post(state: &AppState, slug: &str) -> Result { - debug!("loading post: {slug}"); +pub async fn load_page(state: &AppState, path: &Path) -> Result { + debug!("loading post: {path:?}"); - let file_path = Path::new("posts").join(slug); + let content = fs::read_to_string(path).await?; - let content = if let Ok(content) = fs::read_to_string(file_path.with_extension("md")).await { - content - } else { - fs::read_to_string(file_path.join("index.md")).await? - }; - let (tomlfm, content) = parse_frontmatter(content)?; - let tomlfm = tomlfm.expect("Missing frontmatter"); - let base_uri = helpers::uri_with_path(&state.base_url, &format!("/posts/{slug}/")); + let path_str = path.to_string_lossy().replace('\\', "/"); - let content = content.map(|c| markdown::render_markdown_to_html(Some(&base_uri), &c)); + let slug = path_str + .trim_start_matches("posts/") + .trim_start_matches('/') + .trim_end_matches(".html") + .trim_end_matches(".md") + .trim_end_matches("index") + .trim_end_matches('/'); - Ok(Post::new( + let base_uri = helpers::uri_with_path(&state.base_url, &format!("/{slug}/")); + + let content = markdown::render_markdown_to_html(Some(&base_uri), &content); + + Ok(Page::new( slug.to_string(), - content.unwrap_or_default(), - tomlfm, + content.content_html, + toml::from_str(&content.metadata)?, )) } -#[instrument(skip(src))] -fn parse_frontmatter(src: String) -> Result<(Option, Option)> { - Ok(if let Some(captures) = FRONTMATTER_REGEX.captures(&src) { - ( - Some(toml::from_str(captures.get(1).unwrap().as_str())?), - captures.get(2).map(|m| m.as_str().to_owned()), - ) - } else { - (None, Some(src)) - }) -} - #[instrument(skip(state, post))] -pub async fn render_post(state: &AppState, post: &Post) -> Result { +pub async fn render_post(state: &AppState, post: &Page) -> Result { let mut ctx = tera::Context::new(); ctx.insert("page", &post); ctx.insert("base_url", &state.base_url.to_string()); @@ -165,8 +158,8 @@ mod tests { ..Default::default() }; - state.posts = super::load_all(&state).await.unwrap(); - for post in state.posts.values() { + state.pages = super::load_all(&state, "posts/".into()).await.unwrap(); + for post in state.pages.values() { super::render_post(&state, post).await.unwrap(); } } diff --git a/src/settings.rs b/src/settings.rs new file mode 100644 index 0000000..78e03a5 --- /dev/null +++ b/src/settings.rs @@ -0,0 +1,30 @@ +use anyhow::{Error, Result}; +use config::Config; +use serde::Deserialize; + +#[derive(Deserialize, Debug)] +pub struct Settings { + pub base_url: String, + pub bind_address: String, + pub logging: String, + pub otlp: Otlp, +} + +#[derive(Deserialize, Debug)] +pub struct Otlp { + pub enabled: bool, + pub endpoint: String, + pub authorization: String, + pub organization: String, + pub stream_name: String, + pub tls_insecure: bool, +} + +pub fn get() -> Result { + let settings = Config::builder() + .add_source(config::File::with_name("config.toml")) + .add_source(config::Environment::with_prefix("TLX")) + .build()? + .try_deserialize()?; + Ok(settings) +} diff --git a/src/tag.rs b/src/tag.rs index 0fb7f02..ca824c3 100644 --- a/src/tag.rs +++ b/src/tag.rs @@ -3,7 +3,7 @@ use std::collections::HashMap; use serde_derive::Serialize; use tracing::instrument; -use crate::post::Post; +use crate::page::Page; #[derive(Serialize, Debug)] pub struct Tag { @@ -13,7 +13,7 @@ pub struct Tag { } #[instrument(skip(posts))] -pub fn get_tags<'a>(posts: impl IntoIterator) -> HashMap { +pub fn get_tags<'a>(posts: impl IntoIterator) -> HashMap { let mut tags: HashMap = HashMap::new(); for post in posts { diff --git a/static/site.css b/static/site.css index 7b7283e..eb960c1 100644 --- a/static/site.css +++ b/static/site.css @@ -29,3 +29,11 @@ pre { margin-bottom: -0.5em; } +.footnote-definition { + margin: 1em 0; +} + +.footnote-definition p { + display: inline-block; + margin: 0; +}