From 339c6e4f25713722a467ebf29f6b0f02710c5c16 Mon Sep 17 00:00:00 2001 From: Antoine Martin Date: Tue, 30 Mar 2021 01:08:55 +0200 Subject: [PATCH 01/61] cargo: add repo and homepage metadata --- Cargo.toml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Cargo.toml b/Cargo.toml index ac4f995..7cb92a9 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -5,6 +5,8 @@ authors = ["Antoine Martin "] edition = "2018" license = "Apache-2.0 OR MIT" description = "A Git mirroring daemon" +homepage = "https://github.com/alarsyo/lohr" +repository = "https://github.com/alarsyo/lohr" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html From 7134b7700f3d7074d0f5b6b609bd77cedec24f3b Mon Sep 17 00:00:00 2001 From: Antoine Martin Date: Tue, 30 Mar 2021 01:11:36 +0200 Subject: [PATCH 02/61] lohr: v0.2.1 --- Cargo.lock | 2 +- Cargo.toml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 380bd66..4d7e32b 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -491,7 +491,7 @@ dependencies = [ [[package]] name = "lohr" -version = "0.2.0" +version = "0.2.1" dependencies = [ "anyhow", "log 0.4.14", diff --git a/Cargo.toml b/Cargo.toml index 7cb92a9..17fbb0d 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "lohr" -version = "0.2.0" +version = "0.2.1" authors = ["Antoine Martin "] edition = "2018" license = "Apache-2.0 OR MIT" From 7e3c8b8f28caa75d9f19843ac0ef7ad9b045f8a1 Mon Sep 17 00:00:00 2001 From: Antoine Martin Date: Tue, 30 Mar 2021 11:23:09 +0200 Subject: [PATCH 03/61] lohr: validate webhook signature Previously lohr was unusable in a production setting, anyone could forge a malicious webhook and either: - mirror a private repo of yours to another remote they own - wipe a repo of yours by forcing mirroring from an empty mirror This is no longer the case! --- Cargo.lock | 10 ++++ Cargo.toml | 4 ++ README.org | 14 ++++-- src/main.rs | 11 ++++- src/signature.rs | 122 +++++++++++++++++++++++++++++++++++++++++++++++ 5 files changed, 156 insertions(+), 5 deletions(-) create mode 100644 src/signature.rs diff --git a/Cargo.lock b/Cargo.lock index 4d7e32b..4623823 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -336,6 +336,12 @@ dependencies = [ "libc", ] +[[package]] +name = "hex" +version = "0.4.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7f24254aa9a54b5c858eaee2f5bccdb46aaf0e486a595ed5fd8f86ba55232a70" + [[package]] name = "hkdf" version = "0.10.0" @@ -494,11 +500,15 @@ name = "lohr" version = "0.2.1" dependencies = [ "anyhow", + "hex", + "hmac", "log 0.4.14", "rocket", "rocket_contrib", "serde", + "serde_json", "serde_yaml", + "sha2", ] [[package]] diff --git a/Cargo.toml b/Cargo.toml index 17fbb0d..fac1516 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -12,8 +12,12 @@ repository = "https://github.com/alarsyo/lohr" [dependencies] anyhow = "1.0.40" +hex = "0.4.3" +hmac = "0.10.1" log = "0.4.14" rocket = "0.4.7" rocket_contrib = { version = "0.4.7", features = [ "json" ] } serde = { version = "1.0.125", features = [ "derive" ] } +serde_json = "1.0.64" serde_yaml = "0.8.17" +sha2 = "0.9.3" diff --git a/README.org b/README.org index cbe07d6..f1b102f 100644 --- a/README.org +++ b/README.org @@ -29,20 +29,28 @@ Setting up =lohr= should be quite simple: 1. Create a =Rocket.toml= file and [[https://rocket.rs/v0.4/guide/configuration/][add your configuration]]. -2. Run =lohr=: +2. Export a secret variable: + + #+begin_src sh + $ export LOHR_SECRET=42 # please don't use this secret + #+end_src + +3. Run =lohr=: #+begin_src sh $ cargo run # or `cargo run --release` for production usage #+end_src -3. Configure your favorite git server to send a webhook to =lohr='s address on +4. Configure your favorite git server to send a webhook to =lohr='s address on every push event. I used [[https://docs.gitea.io/en-us/webhooks/][Gitea's webhooks format]], but I *think* they're similar to GitHub and GitLab's webhooks, so these should work too! (If they don't, *please* file an issue!) -4. Add a =.lohr= file containing the remotes you want to mirror this repo to: + Don't forget to set the webhook secret to the one you chose above. + +5. Add a =.lohr= file containing the remotes you want to mirror this repo to: #+begin_example git@github.com:you/your_repo diff --git a/src/main.rs b/src/main.rs index 6bb3613..4c7fc25 100644 --- a/src/main.rs +++ b/src/main.rs @@ -10,7 +10,6 @@ use std::sync::{ use std::thread; use rocket::{http::Status, post, routes, State}; -use rocket_contrib::json::Json; use log::error; @@ -23,10 +22,14 @@ use job::Job; mod settings; use settings::GlobalSettings; +mod signature; +use signature::SignedJson; + struct JobSender(Mutex>); +struct Secret(String); #[post("/", data = "")] -fn gitea_webhook(payload: Json, sender: State) -> Status { +fn gitea_webhook(payload: SignedJson, sender: State) -> Status { // TODO: validate Gitea signature { @@ -66,6 +69,9 @@ fn main() -> anyhow::Result<()> { let homedir: PathBuf = homedir.into(); let homedir = homedir.canonicalize().expect("LOHR_HOME isn't valid!"); + let secret = env::var("LOHR_SECRET") + .expect("please provide a secret, otherwise anyone can send you a malicious webhook"); + let config = parse_config(homedir.clone())?; thread::spawn(move || { @@ -75,6 +81,7 @@ fn main() -> anyhow::Result<()> { rocket::ignite() .mount("/", routes![gitea_webhook]) .manage(JobSender(Mutex::new(sender))) + .manage(Secret(secret)) .launch(); Ok(()) diff --git a/src/signature.rs b/src/signature.rs new file mode 100644 index 0000000..48129de --- /dev/null +++ b/src/signature.rs @@ -0,0 +1,122 @@ +use std::{ + io::{Read, Write}, + ops::{Deref, DerefMut}, +}; + +use rocket::{ + data::{FromData, Outcome}, + http::ContentType, + State, +}; +use rocket::{ + data::{Transform, Transformed}, + http::Status, +}; +use rocket::{Data, Request}; + +use anyhow::anyhow; +use serde::Deserialize; + +use crate::Secret; + +const X_GITEA_SIGNATURE: &str = "X-Gitea-Signature"; + +fn validate_signature(secret: &str, signature: &str, data: &str) -> bool { + use hmac::{Hmac, Mac, NewMac}; + use sha2::Sha256; + + type HmacSha256 = Hmac; + + let mut mac = HmacSha256::new_varkey(secret.as_bytes()).expect("this should never fail"); + + mac.update(data.as_bytes()); + + match hex::decode(signature) { + Ok(bytes) => mac.verify(&bytes).is_ok(), + Err(_) => false, + } +} + +pub struct SignedJson(pub T); + +impl Deref for SignedJson { + type Target = T; + + fn deref(&self) -> &T { + &self.0 + } +} + +impl DerefMut for SignedJson { + fn deref_mut(&mut self) -> &mut T { + &mut self.0 + } +} + +const LIMIT: u64 = 1 << 20; + +// This is a one to one implementation of request_contrib::Json's FromData, but with HMAC +// validation. +// +// Tracking issue for chaining Data guards to avoid this: +// https://github.com/SergioBenitez/Rocket/issues/775 +impl<'a, T> FromData<'a> for SignedJson +where + T: Deserialize<'a>, +{ + type Error = anyhow::Error; + type Owned = String; + type Borrowed = str; + + fn transform( + request: &Request, + data: Data, + ) -> rocket::data::Transform> { + let size_limit = request.limits().get("json").unwrap_or(LIMIT); + let mut s = String::with_capacity(512); + match data.open().take(size_limit).read_to_string(&mut s) { + Ok(_) => Transform::Borrowed(Outcome::Success(s)), + Err(e) => Transform::Borrowed(Outcome::Failure(( + Status::BadRequest, + anyhow!("couldn't read json: {}", e), + ))), + } + } + + fn from_data(request: &Request, o: Transformed<'a, Self>) -> Outcome { + let json_ct = ContentType::new("application", "json"); + if request.content_type() != Some(&json_ct) { + return Outcome::Failure((Status::BadRequest, anyhow!("wrong content type"))); + } + + let signatures = request.headers().get(X_GITEA_SIGNATURE).collect::>(); + if signatures.len() != 1 { + return Outcome::Failure(( + Status::BadRequest, + anyhow!("request header needs exactly one signature"), + )); + } + + let signature = signatures[0]; + + let content = o.borrowed()?; + + let secret = request.guard::>().unwrap(); + + if !validate_signature(&secret.0, &signature, content) { + return Outcome::Failure((Status::BadRequest, anyhow!("couldn't verify signature"))); + } + + let content = match serde_json::from_str(content) { + Ok(content) => content, + Err(e) => { + return Outcome::Failure(( + Status::BadRequest, + anyhow!("couldn't parse json: {}", e), + )) + } + }; + + Outcome::Success(SignedJson(content)) + } +} From 682e9c5bcc9070c81156667c96f06544ed98f29b Mon Sep 17 00:00:00 2001 From: Antoine Martin Date: Tue, 30 Mar 2021 11:31:26 +0200 Subject: [PATCH 04/61] lohr: v0.3.0 This brings support for webhook signature verification, making lohr usable in a production setting. --- Cargo.lock | 2 +- Cargo.toml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 4623823..72a6705 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -497,7 +497,7 @@ dependencies = [ [[package]] name = "lohr" -version = "0.2.1" +version = "0.3.0" dependencies = [ "anyhow", "hex", diff --git a/Cargo.toml b/Cargo.toml index fac1516..896e01a 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "lohr" -version = "0.2.1" +version = "0.3.0" authors = ["Antoine Martin "] edition = "2018" license = "Apache-2.0 OR MIT" From ade177de543b713eaf6ffad94e838293a901b16d Mon Sep 17 00:00:00 2001 From: Antoine Martin Date: Tue, 30 Mar 2021 11:38:58 +0200 Subject: [PATCH 05/61] README: mention shared secret in configuration --- README.org | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/README.org b/README.org index f1b102f..8231f47 100644 --- a/README.org +++ b/README.org @@ -66,6 +66,11 @@ Setting up =lohr= should be quite simple: current directory, but you can set the =LOHR_HOME= environment variable to customize it. +**** Shared secret + +As shown in the quickstart guide, you *must* set the =LOHR_SECRET= environment +variable. + **** Extra remote configuration =lohr= looks for a =lohr-config.yaml= file in its =LOHR_HOME= directory. This From fea9d61d2b76d6ef7299a3441aca78b3e9d362b4 Mon Sep 17 00:00:00 2001 From: Antoine Martin Date: Tue, 30 Mar 2021 11:41:16 +0200 Subject: [PATCH 06/61] signature: fix unused trait warning --- src/signature.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/signature.rs b/src/signature.rs index 48129de..c917db6 100644 --- a/src/signature.rs +++ b/src/signature.rs @@ -1,5 +1,5 @@ use std::{ - io::{Read, Write}, + io::Read, ops::{Deref, DerefMut}, }; From cc75f90a9ad00e141164ad783f5e97a30a31b173 Mon Sep 17 00:00:00 2001 From: Antoine Martin Date: Tue, 30 Mar 2021 11:47:14 +0200 Subject: [PATCH 07/61] ci: fail on clippy warnings --- .github/workflows/ci.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index a88c608..d450a8b 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -66,4 +66,4 @@ jobs: uses: actions-rs/clippy-check@v1 with: token: ${{ secrets.GITHUB_TOKEN }} - args: --all-features + args: --all-features -- -D warnings From 1be64262b2b27a6a4ce20ee3b97bb2e0509966d7 Mon Sep 17 00:00:00 2001 From: Antoine Martin Date: Tue, 30 Mar 2021 14:45:43 +0200 Subject: [PATCH 08/61] main: remove solved TODO item --- src/main.rs | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/main.rs b/src/main.rs index 4c7fc25..e71ec3d 100644 --- a/src/main.rs +++ b/src/main.rs @@ -30,8 +30,6 @@ struct Secret(String); #[post("/", data = "")] fn gitea_webhook(payload: SignedJson, sender: State) -> Status { - // TODO: validate Gitea signature - { let sender = sender.0.lock().unwrap(); let repo = &payload.repository; From 209e1e58c7015dc2e503a4c096dc5a3bc840931e Mon Sep 17 00:00:00 2001 From: Antoine Martin Date: Tue, 30 Mar 2021 15:25:26 +0200 Subject: [PATCH 09/61] job: filter out empty lines from .lohr file --- src/job.rs | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/job.rs b/src/job.rs index 1a15233..2e91cf1 100644 --- a/src/job.rs +++ b/src/job.rs @@ -125,7 +125,13 @@ impl Job { let output = String::from_utf8(output.stdout)?; - Ok(Some(output.lines().map(String::from).collect())) + Ok(Some( + output + .lines() + .map(String::from) + .filter(|s| !s.is_empty()) + .collect(), + )) } fn get_remotes(&self, config: &GlobalSettings) -> anyhow::Result> { From 9de7c783ae6d3a92ea742d9aa20da7d8c01a3a8f Mon Sep 17 00:00:00 2001 From: Bruno BELANYI Date: Tue, 30 Mar 2021 16:11:36 +0000 Subject: [PATCH 10/61] job: add processing blacklist to global config --- Cargo.lock | 38 ++++++++++++++++++++++++++++++++++++++ Cargo.toml | 2 ++ src/job.rs | 7 +++++++ src/settings.rs | 4 ++++ 4 files changed, 51 insertions(+) diff --git a/Cargo.lock b/Cargo.lock index 72a6705..c0de7d0 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -56,6 +56,15 @@ dependencies = [ "opaque-debug", ] +[[package]] +name = "aho-corasick" +version = "0.7.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7404febffaa47dac81aa44dba71523c9d069b1bdc50a77db41195149e17f68e5" +dependencies = [ + "memchr", +] + [[package]] name = "anyhow" version = "1.0.40" @@ -503,10 +512,12 @@ dependencies = [ "hex", "hmac", "log 0.4.14", + "regex", "rocket", "rocket_contrib", "serde", "serde_json", + "serde_regex", "serde_yaml", "sha2", ] @@ -756,6 +767,23 @@ dependencies = [ "bitflags", ] +[[package]] +name = "regex" +version = "1.4.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "957056ecddbeba1b26965114e191d2e8589ce74db242b6ea25fc4062427a5c19" +dependencies = [ + "aho-corasick", + "memchr", + "regex-syntax", +] + +[[package]] +name = "regex-syntax" +version = "0.6.23" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "24d5f089152e60f62d28b835fbff2cd2e8dc0baf1ac13343bef92ab7eed84548" + [[package]] name = "rocket" version = "0.4.7" @@ -874,6 +902,16 @@ dependencies = [ "serde", ] +[[package]] +name = "serde_regex" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a8136f1a4ea815d7eac4101cfd0b16dc0cb5e1fe1b8609dfd728058656b7badf" +dependencies = [ + "regex", + "serde", +] + [[package]] name = "serde_yaml" version = "0.8.17" diff --git a/Cargo.toml b/Cargo.toml index 896e01a..cbbb9ae 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -15,9 +15,11 @@ anyhow = "1.0.40" hex = "0.4.3" hmac = "0.10.1" log = "0.4.14" +regex = "1" rocket = "0.4.7" rocket_contrib = { version = "0.4.7", features = [ "json" ] } serde = { version = "1.0.125", features = [ "derive" ] } serde_json = "1.0.64" +serde_regex = "1.1.0" serde_yaml = "0.8.17" sha2 = "0.9.3" diff --git a/src/job.rs b/src/job.rs index 2e91cf1..0477704 100644 --- a/src/job.rs +++ b/src/job.rs @@ -190,6 +190,13 @@ impl Job { } pub(crate) fn run(&mut self, homedir: &Path, config: &GlobalSettings) -> anyhow::Result<()> { + if config + .blacklist + .iter() + .any(|re| re.is_match(&self.repo.full_name)) + { + return Ok(()); + } let local_path = homedir.join(&self.repo.full_name); assert!(local_path.is_absolute()); self.local_path = Some(local_path); diff --git a/src/settings.rs b/src/settings.rs index bfe7744..976264f 100644 --- a/src/settings.rs +++ b/src/settings.rs @@ -10,4 +10,8 @@ pub(crate) struct GlobalSettings { /// List of remote stems to use for every repository #[serde(default)] pub additional_remotes: Vec, + /// List of regexes, if a repository's name matches any of the, it is not mirrored by `lohr` + /// even if it contains a `.lorh` file. + #[serde(with = "serde_regex")] + pub blacklist: Vec, } From d38e4556e14073a786ff282fcabd870f0fd24286 Mon Sep 17 00:00:00 2001 From: Bruno BELANYI Date: Tue, 30 Mar 2021 18:09:11 +0000 Subject: [PATCH 11/61] nix: flake: add meta information in package --- flake.nix | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/flake.nix b/flake.nix index 330d2ff..2b631d1 100644 --- a/flake.nix +++ b/flake.nix @@ -37,6 +37,13 @@ defaultPackage = naersk-lib.buildPackage { src = ./.; pname = "lohr"; + + meta = with pkgs.lib; { + description = "A Git mirroring tool"; + homepage = "https://github.com/alarsyo/lohr"; + license = with licenses; [ mit asl20 ]; + platforms = platforms.unix; + }; }; defaultApp = flake-utils.lib.mkApp { From 6f63b4c95c26b85b040822cab5678772db42edc4 Mon Sep 17 00:00:00 2001 From: Bruno BELANYI Date: Tue, 30 Mar 2021 18:46:14 +0000 Subject: [PATCH 12/61] main: add LOHR_CONFIG variable --- src/main.rs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/main.rs b/src/main.rs index e71ec3d..ce09507 100644 --- a/src/main.rs +++ b/src/main.rs @@ -52,6 +52,9 @@ fn repo_updater(rx: Receiver, homedir: PathBuf, config: GlobalSettings) { fn parse_config(mut path: PathBuf) -> anyhow::Result { path.push("lohr-config"); path.set_extension("yaml"); + let path = env::var("LOHR_CONFIG") + .map(Into::into) + .unwrap_or_else(|_| path); let config = if let Ok(file) = File::open(path.as_path()) { serde_yaml::from_reader(file)? } else { From 8e7e0e9a84d12653f704ce7e203af27400c40634 Mon Sep 17 00:00:00 2001 From: Bruno BELANYI Date: Tue, 30 Mar 2021 18:46:33 +0000 Subject: [PATCH 13/61] README: mention 'LOHR_CONFIG' --- README.org | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/README.org b/README.org index 8231f47..ce868c4 100644 --- a/README.org +++ b/README.org @@ -73,8 +73,9 @@ variable. **** Extra remote configuration -=lohr= looks for a =lohr-config.yaml= file in its =LOHR_HOME= directory. This -file takes the following format: +=lohr= looks for a =lohr-config.yaml= file in its =LOHR_HOME= directory. The +=LOHR_CONFIG= variable takes precedence over looking into the state directory. +This file takes the following format: #+begin_src yaml default_remotes: @@ -83,12 +84,18 @@ default_remotes: additional_remotes: - "git@git.sr.ht:~user" + +blacklist: + - "private-.*" #+end_src - ~default_remotes~ is a list of remotes to use if no ~.lohr~ file is found in a repository. - ~additional_remotes~ is a list of remotes to add in any case, whether the original set of remotes is set via ~default_remotes~ or via a =.lohr= file. +- ~blacklist~ is a list of regular expressions to match against the full + repository names. Any that matches will not be mirrored, even if it contains a + `.lohr` file. Both settings take as input a list of "stems", i.e. incomplete remote addresses, to which the repo's name will be appended (so for example, if my From ff90b5fb2de9c389604117b809a2d9539ac3de1f Mon Sep 17 00:00:00 2001 From: Antoine Martin Date: Tue, 30 Mar 2021 22:00:59 +0200 Subject: [PATCH 14/61] job: move blacklist processing to request --- src/job.rs | 7 ------- src/main.rs | 16 +++++++++++++++- src/settings.rs | 2 +- 3 files changed, 16 insertions(+), 9 deletions(-) diff --git a/src/job.rs b/src/job.rs index 0477704..2e91cf1 100644 --- a/src/job.rs +++ b/src/job.rs @@ -190,13 +190,6 @@ impl Job { } pub(crate) fn run(&mut self, homedir: &Path, config: &GlobalSettings) -> anyhow::Result<()> { - if config - .blacklist - .iter() - .any(|re| re.is_match(&self.repo.full_name)) - { - return Ok(()); - } let local_path = homedir.join(&self.repo.full_name); assert!(local_path.is_absolute()); self.local_path = Some(local_path); diff --git a/src/main.rs b/src/main.rs index ce09507..812615d 100644 --- a/src/main.rs +++ b/src/main.rs @@ -29,7 +29,19 @@ struct JobSender(Mutex>); struct Secret(String); #[post("/", data = "")] -fn gitea_webhook(payload: SignedJson, sender: State) -> Status { +fn gitea_webhook( + payload: SignedJson, + sender: State, + config: State, +) -> Status { + if config + .blacklist + .iter() + .any(|re| re.is_match(&payload.repository.full_name)) + { + return Status::Ok; + } + { let sender = sender.0.lock().unwrap(); let repo = &payload.repository; @@ -74,6 +86,7 @@ fn main() -> anyhow::Result<()> { .expect("please provide a secret, otherwise anyone can send you a malicious webhook"); let config = parse_config(homedir.clone())?; + let config_state = config.clone(); thread::spawn(move || { repo_updater(receiver, homedir, config); @@ -83,6 +96,7 @@ fn main() -> anyhow::Result<()> { .mount("/", routes![gitea_webhook]) .manage(JobSender(Mutex::new(sender))) .manage(Secret(secret)) + .manage(config_state) .launch(); Ok(()) diff --git a/src/settings.rs b/src/settings.rs index 976264f..8dc71f9 100644 --- a/src/settings.rs +++ b/src/settings.rs @@ -2,7 +2,7 @@ use serde::Deserialize; pub(crate) type RepoUrl = String; // FIXME: probably needs a better type than this -#[derive(Default, Deserialize)] +#[derive(Clone, Default, Deserialize)] pub(crate) struct GlobalSettings { /// List of remote stems to use when no `.lohr` file is found #[serde(default)] From 422024d9193a4218383e7b7e34f7c9d18c40461a Mon Sep 17 00:00:00 2001 From: Antoine Martin Date: Tue, 30 Mar 2021 22:51:51 +0200 Subject: [PATCH 15/61] main: support config override with CLI flag --- Cargo.lock | 52 +++++++++++++++++++++++++++++++++++++++++++++++++ Cargo.toml | 1 + src/main.rs | 56 +++++++++++++++++++++++++++++++++++++++-------------- 3 files changed, 94 insertions(+), 15 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index c0de7d0..316ab18 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -65,6 +65,15 @@ dependencies = [ "memchr", ] +[[package]] +name = "ansi_term" +version = "0.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ee49baf6cb617b853aa8d93bf420db2383fab46d314482ca2803b40d5fde979b" +dependencies = [ + "winapi 0.3.9", +] + [[package]] name = "anyhow" version = "1.0.40" @@ -152,6 +161,21 @@ dependencies = [ "generic-array", ] +[[package]] +name = "clap" +version = "2.33.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "37e58ac78573c40708d45522f0d80fa2f01cc4f9b4e2bf749807255454312002" +dependencies = [ + "ansi_term", + "atty", + "bitflags", + "strsim", + "textwrap", + "unicode-width", + "vec_map", +] + [[package]] name = "cookie" version = "0.11.4" @@ -509,6 +533,7 @@ name = "lohr" version = "0.3.0" dependencies = [ "anyhow", + "clap", "hex", "hmac", "log 0.4.14", @@ -955,6 +980,12 @@ version = "0.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3015a7d0a5fd5105c91c3710d42f9ccf0abfb287d62206484dcc67f9569a6483" +[[package]] +name = "strsim" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8ea5119cdb4c55b55d432abb513a0429384878c15dde60cc77b1c99de1a95a6a" + [[package]] name = "subtle" version = "2.4.0" @@ -983,6 +1014,15 @@ dependencies = [ "unicode-xid 0.2.1", ] +[[package]] +name = "textwrap" +version = "0.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d326610f408c7a4eb6f51c37c330e496b08506c9457c9d34287ecc38809fb060" +dependencies = [ + "unicode-width", +] + [[package]] name = "time" version = "0.1.43" @@ -1062,6 +1102,12 @@ dependencies = [ "tinyvec", ] +[[package]] +name = "unicode-width" +version = "0.1.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9337591893a19b88d8d87f2cec1e73fad5cdfd10e5a6f349f498ad6ea2ffb1e3" + [[package]] name = "unicode-xid" version = "0.1.0" @@ -1095,6 +1141,12 @@ dependencies = [ "percent-encoding 1.0.1", ] +[[package]] +name = "vec_map" +version = "0.8.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f1bddf1187be692e79c5ffeab891132dfb0f236ed36a43c7ed39f1165ee20191" + [[package]] name = "version_check" version = "0.1.5" diff --git a/Cargo.toml b/Cargo.toml index cbbb9ae..f68cf99 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -12,6 +12,7 @@ repository = "https://github.com/alarsyo/lohr" [dependencies] anyhow = "1.0.40" +clap = "2.33.3" hex = "0.4.3" hmac = "0.10.1" log = "0.4.14" diff --git a/src/main.rs b/src/main.rs index 812615d..bedcdf7 100644 --- a/src/main.rs +++ b/src/main.rs @@ -2,16 +2,17 @@ use std::env; use std::fs::File; -use std::path::PathBuf; +use std::path::{Path, PathBuf}; use std::sync::{ mpsc::{channel, Receiver, Sender}, Mutex, }; use std::thread; -use rocket::{http::Status, post, routes, State}; - +use anyhow::Context; +use clap::{App, Arg}; use log::error; +use rocket::{http::Status, post, routes, State}; mod gitea; use gitea::GiteaWebHook; @@ -61,21 +62,46 @@ fn repo_updater(rx: Receiver, homedir: PathBuf, config: GlobalSettings) { } } -fn parse_config(mut path: PathBuf) -> anyhow::Result { - path.push("lohr-config"); - path.set_extension("yaml"); - let path = env::var("LOHR_CONFIG") - .map(Into::into) - .unwrap_or_else(|_| path); - let config = if let Ok(file) = File::open(path.as_path()) { - serde_yaml::from_reader(file)? - } else { - Default::default() +fn parse_config(home: &Path, flags: &clap::ArgMatches) -> anyhow::Result { + // prioritize CLI flag, then env var + let config_path = flags.value_of("config").map(PathBuf::from); + let config_path = config_path.or_else(|| env::var("LOHR_CONFIG").map(PathBuf::from).ok()); + + let file = match config_path { + Some(config_path) => File::open(&config_path).with_context(|| { + format!( + "could not open provided configuration file at {}", + config_path.display() + ) + })?, + None => { + // check if file exists in lohr home + let config_path = home.join("lohr-config.yaml"); + if !config_path.is_file() { + return Ok(Default::default()); + } + + File::open(config_path).context("failed to open configuration file in LOHR_HOME")? + } }; - Ok(config) + + serde_yaml::from_reader(file).context("could not parse configuration file") } fn main() -> anyhow::Result<()> { + let matches = App::new("lohr") + .version("0.3.0") + .about("Git mirroring daemon") + .arg( + Arg::with_name("config") + .short("c") + .long("config") + .value_name("FILE") + .help("Use a custom config file") + .takes_value(true), + ) + .get_matches(); + let (sender, receiver) = channel(); let homedir = env::var("LOHR_HOME").unwrap_or_else(|_| "./".to_string()); @@ -85,7 +111,7 @@ fn main() -> anyhow::Result<()> { let secret = env::var("LOHR_SECRET") .expect("please provide a secret, otherwise anyone can send you a malicious webhook"); - let config = parse_config(homedir.clone())?; + let config = parse_config(&homedir, &matches)?; let config_state = config.clone(); thread::spawn(move || { From aba153726ba4071136ffbe4a22fb2f19888fdb8a Mon Sep 17 00:00:00 2001 From: Antoine Martin Date: Tue, 30 Mar 2021 22:53:33 +0200 Subject: [PATCH 16/61] main: log when skipping blacklisted repo --- src/main.rs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/main.rs b/src/main.rs index bedcdf7..3856ee1 100644 --- a/src/main.rs +++ b/src/main.rs @@ -11,7 +11,7 @@ use std::thread; use anyhow::Context; use clap::{App, Arg}; -use log::error; +use log::{error, info}; use rocket::{http::Status, post, routes, State}; mod gitea; @@ -40,6 +40,10 @@ fn gitea_webhook( .iter() .any(|re| re.is_match(&payload.repository.full_name)) { + info!( + "Ignoring webhook for repo {} which is blacklisted", + payload.repository.full_name + ); return Status::Ok; } From 54fafc6a463399646b3b073b8cbff08cfd8abd25 Mon Sep 17 00:00:00 2001 From: Antoine Martin Date: Tue, 30 Mar 2021 22:57:27 +0200 Subject: [PATCH 17/61] README: mention cli flag for configuration --- README.org | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/README.org b/README.org index ce868c4..341d31b 100644 --- a/README.org +++ b/README.org @@ -73,8 +73,12 @@ variable. **** Extra remote configuration -=lohr= looks for a =lohr-config.yaml= file in its =LOHR_HOME= directory. The -=LOHR_CONFIG= variable takes precedence over looking into the state directory. +You can provide =lohr= with a YAML file containing additional configuration. You +can pass its path to the =--config= flag when launching =lohr=. If no +configuration is provided via a CLI flag, =lohr= will check the =LOHR_CONFIG= +environment variable. If the environment variable isn't set either, it will +check in =LOHR_HOME= is a =lohr-config.yaml= file exists, and try to load it. + This file takes the following format: #+begin_src yaml From 78194b69ad230a3bf6d679d17504a9cb40b16991 Mon Sep 17 00:00:00 2001 From: Antoine Martin Date: Tue, 30 Mar 2021 22:59:39 +0200 Subject: [PATCH 18/61] cargo: bump lockfile --- Cargo.lock | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 316ab18..cc1a8dc 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -500,9 +500,9 @@ checksum = "830d08ce1d1d941e6b30645f1a0eb5643013d835ce3779a5fc208261dbe10f55" [[package]] name = "libc" -version = "0.2.91" +version = "0.2.92" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8916b1f6ca17130ec6568feccee27c156ad12037880833a3b842a823236502e7" +checksum = "56d855069fafbb9b344c0f962150cd2c1187975cb1c22c1522c240d8c4986714" [[package]] name = "linked-hash-map" @@ -913,7 +913,7 @@ checksum = "b093b7a2bb58203b5da3056c05b4ec1fed827dcfdb37347a8841695263b3d06d" dependencies = [ "proc-macro2 1.0.24", "quote 1.0.9", - "syn 1.0.65", + "syn 1.0.67", ] [[package]] @@ -1005,9 +1005,9 @@ dependencies = [ [[package]] name = "syn" -version = "1.0.65" +version = "1.0.67" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f3a1d708c221c5a612956ef9f75b37e454e88d1f7b899fbd3a18d4252012d663" +checksum = "6498a9efc342871f91cc2d0d694c674368b4ceb40f62b65a7a08c3792935e702" dependencies = [ "proc-macro2 1.0.24", "quote 1.0.9", From a516d841e1642f31c5e563d86d3730c12efec82a Mon Sep 17 00:00:00 2001 From: Antoine Martin Date: Tue, 30 Mar 2021 23:02:32 +0200 Subject: [PATCH 19/61] lohr: v0.3.1 --- Cargo.lock | 2 +- Cargo.toml | 2 +- src/main.rs | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index cc1a8dc..4cb1ed2 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -530,7 +530,7 @@ dependencies = [ [[package]] name = "lohr" -version = "0.3.0" +version = "0.3.1" dependencies = [ "anyhow", "clap", diff --git a/Cargo.toml b/Cargo.toml index f68cf99..6b81399 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "lohr" -version = "0.3.0" +version = "0.3.1" authors = ["Antoine Martin "] edition = "2018" license = "Apache-2.0 OR MIT" diff --git a/src/main.rs b/src/main.rs index 3856ee1..0bfbd61 100644 --- a/src/main.rs +++ b/src/main.rs @@ -94,7 +94,7 @@ fn parse_config(home: &Path, flags: &clap::ArgMatches) -> anyhow::Result anyhow::Result<()> { let matches = App::new("lohr") - .version("0.3.0") + .version("0.3.1") .about("Git mirroring daemon") .arg( Arg::with_name("config") From 933e164259904959cc8ef2d1e01428214d99429b Mon Sep 17 00:00:00 2001 From: Antoine Martin Date: Tue, 30 Mar 2021 23:11:52 +0200 Subject: [PATCH 20/61] README: add section about installing lohr --- README.org | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/README.org b/README.org index 341d31b..a1f250c 100644 --- a/README.org +++ b/README.org @@ -21,6 +21,22 @@ file at the repo root. This is a very destructive process: anything removed from the single source of truth is effectively removed from any mirror as well. +** Installing + +=lohr= is [[https://crates.io/crates/lohr][published on crates.io]], so you can install it with ~cargo install~: + +#+begin_src sh +$ cargo +nightly install lohr +#+end_src + +We currently require a nightly compiler because [[https://github.com/SergioBenitez/Rocket][Rocket]] needs one to compile (a +0.5.0 which compiles on stable Rust is in the making, stay tuned!). You can +install a nightly toolchain with the following command: + +#+begin_src sh +$ rustup install nightly +#+end_src + ** Setup *** Quickstart From 6a79949e28ae46475ef7810e4dd36eded3af19c3 Mon Sep 17 00:00:00 2001 From: Antoine Martin Date: Tue, 30 Mar 2021 23:32:07 +0200 Subject: [PATCH 21/61] cargo: try to reduce number of dependencies serde_regex unconditionally uses all features of the regex crate, which prevents optimizing the dependency graph further --- Cargo.lock | 479 +---------------------------------------------------- Cargo.toml | 13 +- 2 files changed, 15 insertions(+), 477 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 4cb1ed2..cd3e22f 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2,60 +2,6 @@ # It is not intended for manual editing. version = 3 -[[package]] -name = "aead" -version = "0.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7fc95d1bdb8e6666b2b217308eeeb09f2d6728d104be3e31916cc74d15420331" -dependencies = [ - "generic-array", -] - -[[package]] -name = "aes" -version = "0.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "884391ef1066acaa41e766ba8f596341b96e93ce34f9a43e7d24bf0a0eaf0561" -dependencies = [ - "aes-soft", - "aesni", - "cipher", -] - -[[package]] -name = "aes-gcm" -version = "0.8.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5278b5fabbb9bd46e24aa69b2fdea62c99088e0a950a9be40e3e0101298f88da" -dependencies = [ - "aead", - "aes", - "cipher", - "ctr", - "ghash", - "subtle", -] - -[[package]] -name = "aes-soft" -version = "0.6.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "be14c7498ea50828a38d0e24a765ed2effe92a705885b57d029cd67d45744072" -dependencies = [ - "cipher", - "opaque-debug", -] - -[[package]] -name = "aesni" -version = "0.10.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ea2e11f5e94c2f7d386164cc2aa1f97823fed6f259e486940a71c174dd01b0ce" -dependencies = [ - "cipher", - "opaque-debug", -] - [[package]] name = "aho-corasick" version = "0.7.15" @@ -65,15 +11,6 @@ dependencies = [ "memchr", ] -[[package]] -name = "ansi_term" -version = "0.11.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ee49baf6cb617b853aa8d93bf420db2383fab46d314482ca2803b40d5fde979b" -dependencies = [ - "winapi 0.3.9", -] - [[package]] name = "anyhow" version = "1.0.40" @@ -88,7 +25,7 @@ checksum = "d9b39be18770d11421cdb1b9947a45dd3f37e93092cbf377614828a319d5fee8" dependencies = [ "hermit-abi", "libc", - "winapi 0.3.9", + "winapi", ] [[package]] @@ -113,12 +50,6 @@ version = "0.12.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3441f0f7b02788e948e47f457ca01f1d7e6d92c693bc132c22b087d3141c03ff" -[[package]] -name = "base64" -version = "0.13.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "904dfeac50f3cdaba28fc6f57fdcddb75f49ed61346676a78c4ffe55877802fd" - [[package]] name = "bitflags" version = "1.2.1" @@ -140,40 +71,21 @@ version = "1.4.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "14c189c53d098945499cdfa7ecc63567cf3886b3332b312a5b4585d8d3a6a610" -[[package]] -name = "cfg-if" -version = "0.1.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4785bdd1c96b2a846b2bd7cc02e86b6b3dbf14e7e53446c4f54c92a361040822" - [[package]] name = "cfg-if" version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" -[[package]] -name = "cipher" -version = "0.2.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "12f8e7987cbd042a63249497f41aed09f8e65add917ea6566effbc56578d6801" -dependencies = [ - "generic-array", -] - [[package]] name = "clap" version = "2.33.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "37e58ac78573c40708d45522f0d80fa2f01cc4f9b4e2bf749807255454312002" dependencies = [ - "ansi_term", - "atty", "bitflags", - "strsim", "textwrap", "unicode-width", - "vec_map", ] [[package]] @@ -182,13 +94,7 @@ version = "0.11.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "80f6044740a4a516b8aac14c140cdf35c1a640b1bd6b98b6224e49143b2f1566" dependencies = [ - "aes-gcm", - "base64 0.13.0", - "hkdf", - "hmac", "percent-encoding 2.1.0", - "rand", - "sha2", "time", ] @@ -198,12 +104,6 @@ version = "0.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8aebca1129a03dc6dc2b127edd729435bbc4a37e1d5f4d7513165089ceb02634" -[[package]] -name = "cpuid-bool" -version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dcb25d077389e53838a8158c8e99174c5a9d902dee4904320db714f3c653ffba" - [[package]] name = "crypto-mac" version = "0.10.0" @@ -214,15 +114,6 @@ dependencies = [ "subtle", ] -[[package]] -name = "ctr" -version = "0.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fb4a30d54f7443bf3d6191dcd486aca19e67cb3c49fa7a06a319966346707e7f" -dependencies = [ - "cipher", -] - [[package]] name = "devise" version = "0.2.0" @@ -270,53 +161,6 @@ version = "0.4.8" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "56899898ce76aaf4a0f24d914c97ea6ed976d42fec6ad33fcbb0a1103e07b2b0" -[[package]] -name = "filetime" -version = "0.2.14" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1d34cfa13a63ae058bfa601fe9e313bbdb3746427c1459185464ce0fcf62e1e8" -dependencies = [ - "cfg-if 1.0.0", - "libc", - "redox_syscall", - "winapi 0.3.9", -] - -[[package]] -name = "fsevent" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5ab7d1bd1bd33cc98b0889831b72da23c0aa4df9cec7e0702f46ecea04b35db6" -dependencies = [ - "bitflags", - "fsevent-sys", -] - -[[package]] -name = "fsevent-sys" -version = "2.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f41b048a94555da0f42f1d632e2e19510084fb8e303b0daa2816e733fb3644a0" -dependencies = [ - "libc", -] - -[[package]] -name = "fuchsia-zircon" -version = "0.3.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2e9763c69ebaae630ba35f74888db465e49e259ba1bc0eda7d06f4a067615d82" -dependencies = [ - "bitflags", - "fuchsia-zircon-sys", -] - -[[package]] -name = "fuchsia-zircon-sys" -version = "0.3.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3dcaa9ae7725d12cdb85b3ad99a434db70b468c09ded17e012d86b5c1010f7a7" - [[package]] name = "generic-array" version = "0.14.4" @@ -327,27 +171,6 @@ dependencies = [ "version_check 0.9.3", ] -[[package]] -name = "getrandom" -version = "0.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c9495705279e7140bf035dde1f6e750c162df8b625267cd52cc44e0b156732c8" -dependencies = [ - "cfg-if 1.0.0", - "libc", - "wasi", -] - -[[package]] -name = "ghash" -version = "0.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "97304e4cd182c3846f7575ced3890c53012ce534ad9114046b0a9e00bb30a375" -dependencies = [ - "opaque-debug", - "polyval", -] - [[package]] name = "glob" version = "0.3.0" @@ -375,16 +198,6 @@ version = "0.4.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7f24254aa9a54b5c858eaee2f5bccdb46aaf0e486a595ed5fd8f86ba55232a70" -[[package]] -name = "hkdf" -version = "0.10.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "51ab2f639c231793c5f6114bdb9bbe50a7dbbfcd7c7c6bd8475dec2d991e964f" -dependencies = [ - "digest", - "hmac", -] - [[package]] name = "hmac" version = "0.10.1" @@ -441,63 +254,18 @@ dependencies = [ "hashbrown", ] -[[package]] -name = "inotify" -version = "0.7.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4816c66d2c8ae673df83366c18341538f234a26d65a9ecea5c348b453ac1d02f" -dependencies = [ - "bitflags", - "inotify-sys", - "libc", -] - -[[package]] -name = "inotify-sys" -version = "0.1.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e05c02b5e89bff3b946cedeca278abc628fe811e604f027c45a8aa3cf793d0eb" -dependencies = [ - "libc", -] - -[[package]] -name = "iovec" -version = "0.1.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b2b3ea6ff95e175473f8ffe6a7eb7c00d054240321b84c57051175fe3c1e075e" -dependencies = [ - "libc", -] - [[package]] name = "itoa" version = "0.4.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "dd25036021b0de88a0aff6b850051563c6516d0bf53f8638938edbb9de732736" -[[package]] -name = "kernel32-sys" -version = "0.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7507624b29483431c0ba2d82aece8ca6cdba9382bff4ddd0f7490560c056098d" -dependencies = [ - "winapi 0.2.8", - "winapi-build", -] - [[package]] name = "language-tags" version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a91d884b6667cd606bb5a69aa0c99ba811a115fc68915e7056ec08a46e93199a" -[[package]] -name = "lazycell" -version = "1.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "830d08ce1d1d941e6b30645f1a0eb5643013d835ce3779a5fc208261dbe10f55" - [[package]] name = "libc" version = "0.2.92" @@ -525,7 +293,7 @@ version = "0.4.14" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "51b9bbe6c47d51fc3e1a9b945965946b4c44142ab8792c50835a980d362c2710" dependencies = [ - "cfg-if 1.0.0", + "cfg-if", ] [[package]] @@ -539,7 +307,6 @@ dependencies = [ "log 0.4.14", "regex", "rocket", - "rocket_contrib", "serde", "serde_json", "serde_regex", @@ -568,78 +335,6 @@ dependencies = [ "log 0.3.9", ] -[[package]] -name = "mio" -version = "0.6.23" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4afd66f5b91bf2a3bc13fad0e21caedac168ca4c707504e75585648ae80e4cc4" -dependencies = [ - "cfg-if 0.1.10", - "fuchsia-zircon", - "fuchsia-zircon-sys", - "iovec", - "kernel32-sys", - "libc", - "log 0.4.14", - "miow", - "net2", - "slab", - "winapi 0.2.8", -] - -[[package]] -name = "mio-extras" -version = "2.0.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "52403fe290012ce777c4626790c8951324a2b9e3316b3143779c72b029742f19" -dependencies = [ - "lazycell", - "log 0.4.14", - "mio", - "slab", -] - -[[package]] -name = "miow" -version = "0.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ebd808424166322d4a38da87083bfddd3ac4c131334ed55856112eb06d46944d" -dependencies = [ - "kernel32-sys", - "net2", - "winapi 0.2.8", - "ws2_32-sys", -] - -[[package]] -name = "net2" -version = "0.2.37" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "391630d12b68002ae1e25e8f974306474966550ad82dac6886fb8910c19568ae" -dependencies = [ - "cfg-if 0.1.10", - "libc", - "winapi 0.3.9", -] - -[[package]] -name = "notify" -version = "4.0.15" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "80ae4a7688d1fab81c5bf19c64fc8db920be8d519ce6336ed4e7efe024724dbd" -dependencies = [ - "bitflags", - "filetime", - "fsevent", - "fsevent-sys", - "inotify", - "libc", - "mio", - "mio-extras", - "walkdir", - "winapi 0.3.9", -] - [[package]] name = "num_cpus" version = "1.13.0" @@ -690,23 +385,6 @@ version = "2.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d4fd5641d01c8f18a23da7b6fe29298ff4b55afcccdf78973b24cf3175fee32e" -[[package]] -name = "polyval" -version = "0.4.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eebcc4aa140b9abd2bc40d9c3f7ccec842679cd79045ac3a7ac698c1a064b7cd" -dependencies = [ - "cpuid-bool 0.2.0", - "opaque-debug", - "universal-hash", -] - -[[package]] -name = "ppv-lite86" -version = "0.2.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ac74c624d6b2d21f425f752262f42188365d7b8ff1aff74c82e45136510a4857" - [[package]] name = "proc-macro2" version = "0.4.30" @@ -743,55 +421,6 @@ dependencies = [ "proc-macro2 1.0.24", ] -[[package]] -name = "rand" -version = "0.8.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0ef9e7e66b4468674bfcb0c81af8b7fa0bb154fa9f28eb840da5c447baeb8d7e" -dependencies = [ - "libc", - "rand_chacha", - "rand_core", - "rand_hc", -] - -[[package]] -name = "rand_chacha" -version = "0.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e12735cf05c9e10bf21534da50a147b924d555dc7a547c42e6bb2d5b6017ae0d" -dependencies = [ - "ppv-lite86", - "rand_core", -] - -[[package]] -name = "rand_core" -version = "0.6.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "34cf66eb183df1c5876e2dcf6b13d57340741e8dc255b48e40a26de954d06ae7" -dependencies = [ - "getrandom", -] - -[[package]] -name = "rand_hc" -version = "0.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3190ef7066a446f2e7f42e239d161e905420ccab01eb967c9eb27d21b2322a73" -dependencies = [ - "rand_core", -] - -[[package]] -name = "redox_syscall" -version = "0.2.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "94341e4e44e24f6b591b59e47a8a027df12e008d73fd5672dbea9cc22f4507d9" -dependencies = [ - "bitflags", -] - [[package]] name = "regex" version = "1.4.5" @@ -845,19 +474,6 @@ dependencies = [ "yansi", ] -[[package]] -name = "rocket_contrib" -version = "0.4.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d7954a707f9ca18aa74ca8c1f5d1f900f52a4dceb68e96e3112143f759cfd20e" -dependencies = [ - "log 0.4.14", - "notify", - "rocket", - "serde", - "serde_json", -] - [[package]] name = "rocket_http" version = "0.4.7" @@ -887,15 +503,6 @@ version = "0.3.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ef703b7cb59335eae2eb93ceb664c0eb7ea6bf567079d843e09420219668e072" -[[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 = "serde" version = "1.0.125" @@ -956,18 +563,12 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "fa827a14b29ab7f44778d14a88d3cb76e949c45083f7dbfa507d0cb699dc12de" dependencies = [ "block-buffer", - "cfg-if 1.0.0", - "cpuid-bool 0.1.2", + "cfg-if", + "cpuid-bool", "digest", "opaque-debug", ] -[[package]] -name = "slab" -version = "0.4.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c111b5bd5695e56cffe5129854aa230b39c93a305372fdbb2668ca2394eea9f8" - [[package]] name = "smallvec" version = "1.6.1" @@ -980,12 +581,6 @@ version = "0.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3015a7d0a5fd5105c91c3710d42f9ccf0abfb287d62206484dcc67f9569a6483" -[[package]] -name = "strsim" -version = "0.8.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8ea5119cdb4c55b55d432abb513a0429384878c15dde60cc77b1c99de1a95a6a" - [[package]] name = "subtle" version = "2.4.0" @@ -1030,7 +625,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ca8a50ef2360fbd1eeb0ecd46795a87a19024eb4b53c5dc916ca1fd95fe62438" dependencies = [ "libc", - "winapi 0.3.9", + "winapi", ] [[package]] @@ -1120,16 +715,6 @@ version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f7fe0bb3479651439c9112f72b6c505038574c9fbb575ed1bf3b797fa39dd564" -[[package]] -name = "universal-hash" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8326b2c654932e3e4f9196e69d08fdf7cfd718e1dc6f66b347e6024a0c961402" -dependencies = [ - "generic-array", - "subtle", -] - [[package]] name = "url" version = "1.7.2" @@ -1141,12 +726,6 @@ dependencies = [ "percent-encoding 1.0.1", ] -[[package]] -name = "vec_map" -version = "0.8.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f1bddf1187be692e79c5ffeab891132dfb0f236ed36a43c7ed39f1165ee20191" - [[package]] name = "version_check" version = "0.1.5" @@ -1159,29 +738,6 @@ version = "0.9.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5fecdca9a5291cc2b8dcf7dc02453fee791a280f3743cb0905f8822ae463b3fe" -[[package]] -name = "walkdir" -version = "2.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "808cf2735cd4b6866113f648b791c6adc5714537bc222d9347bb203386ffda56" -dependencies = [ - "same-file", - "winapi 0.3.9", - "winapi-util", -] - -[[package]] -name = "wasi" -version = "0.10.2+wasi-snapshot-preview1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fd6fbd9a79829dd1ad0cc20627bf1ed606756a7f77edff7b66b7064f9cb327c6" - -[[package]] -name = "winapi" -version = "0.2.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "167dc9d6949a9b857f3451275e911c3f44255842c1f7a76f33c55103a909087a" - [[package]] name = "winapi" version = "0.3.9" @@ -1192,43 +748,18 @@ dependencies = [ "winapi-x86_64-pc-windows-gnu", ] -[[package]] -name = "winapi-build" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2d315eee3b34aca4797b2da6b13ed88266e6d612562a0c46390af8299fc699bc" - [[package]] name = "winapi-i686-pc-windows-gnu" version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" -[[package]] -name = "winapi-util" -version = "0.1.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "70ec6ce85bb158151cae5e5c87f95a8e97d2c0c4b001223f33a334e3ce5de178" -dependencies = [ - "winapi 0.3.9", -] - [[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 = "ws2_32-sys" -version = "0.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d59cefebd0c892fa2dd6de581e937301d8552cb44489cdff035c6187cb63fa5e" -dependencies = [ - "winapi 0.2.8", - "winapi-build", -] - [[package]] name = "yaml-rust" version = "0.4.5" diff --git a/Cargo.toml b/Cargo.toml index 6b81399..6af939b 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -12,15 +12,22 @@ repository = "https://github.com/alarsyo/lohr" [dependencies] anyhow = "1.0.40" -clap = "2.33.3" hex = "0.4.3" hmac = "0.10.1" log = "0.4.14" regex = "1" -rocket = "0.4.7" -rocket_contrib = { version = "0.4.7", features = [ "json" ] } serde = { version = "1.0.125", features = [ "derive" ] } serde_json = "1.0.64" serde_regex = "1.1.0" serde_yaml = "0.8.17" sha2 = "0.9.3" + +[dependencies.rocket] +version = "0.4.7" +# don't need private-cookies +default-features = false + +[dependencies.clap] +version = "2.33.3" +# no need for suggestions or color with only one argument +default-features = false From e68fcf3e522fc055c1a42ad10ac24c97ee068742 Mon Sep 17 00:00:00 2001 From: Antoine Martin Date: Wed, 31 Mar 2021 18:57:50 +0200 Subject: [PATCH 22/61] settings: blacklist isn't required --- src/settings.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/settings.rs b/src/settings.rs index 8dc71f9..ef55940 100644 --- a/src/settings.rs +++ b/src/settings.rs @@ -12,6 +12,6 @@ pub(crate) struct GlobalSettings { pub additional_remotes: Vec, /// List of regexes, if a repository's name matches any of the, it is not mirrored by `lohr` /// even if it contains a `.lorh` file. - #[serde(with = "serde_regex")] + #[serde(with = "serde_regex", default)] pub blacklist: Vec, } From fe52787f4d176fe8000dfe095d60f70a4c50f9d0 Mon Sep 17 00:00:00 2001 From: Antoine Martin Date: Wed, 31 Mar 2021 19:06:36 +0200 Subject: [PATCH 23/61] lohr: v0.3.2 --- Cargo.lock | 2 +- Cargo.toml | 2 +- src/main.rs | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index cd3e22f..60bf2b6 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -298,7 +298,7 @@ dependencies = [ [[package]] name = "lohr" -version = "0.3.1" +version = "0.3.2" dependencies = [ "anyhow", "clap", diff --git a/Cargo.toml b/Cargo.toml index 6af939b..ac90f78 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "lohr" -version = "0.3.1" +version = "0.3.2" authors = ["Antoine Martin "] edition = "2018" license = "Apache-2.0 OR MIT" diff --git a/src/main.rs b/src/main.rs index 0bfbd61..97dadc8 100644 --- a/src/main.rs +++ b/src/main.rs @@ -94,7 +94,7 @@ fn parse_config(home: &Path, flags: &clap::ArgMatches) -> anyhow::Result anyhow::Result<()> { let matches = App::new("lohr") - .version("0.3.1") + .version("0.3.2") .about("Git mirroring daemon") .arg( Arg::with_name("config") From 1506ce1dac192e895e01330636e1e95deb8e75a3 Mon Sep 17 00:00:00 2001 From: Antoine Martin Date: Wed, 31 Mar 2021 19:28:24 +0200 Subject: [PATCH 24/61] README: switch to Markdown Unfortunately crates.io doesn't show Org READMEs, and GitHub's Org-mode renderer isn't amazing either. So might as well switch to a well supported format, even though I liked Org better. --- README.md | 141 ++++++++++++++++++++++++++++++++++++++++++++++++++++ README.org | 143 ----------------------------------------------------- 2 files changed, 141 insertions(+), 143 deletions(-) create mode 100644 README.md delete mode 100644 README.org diff --git a/README.md b/README.md new file mode 100644 index 0000000..ff6176b --- /dev/null +++ b/README.md @@ -0,0 +1,141 @@ +# lohr + +`lohr` is a Git mirroring tool. + +I created it to solve a simple problem I had: I host my own git server at +, but want to mirror my public projects to GitHub / +GitLab, for backup and visibility purposes. + +GitLab has a mirroring setting, but it doesn't allow for multiple mirrors, as +far as I know. I also wanted my instance to be the single source of truth. + +## How it works + +Gitea is setup to send webhooks to my `lohr` server on every push update. When +`lohr` receives a push, it clones the concerned repository, or updates it if +already cloned. Then it pushes the update to **all remotes listed** in the +[.lohr](.lohr) file at the repo root. + +### Destructive + +This is a very destructive process: anything removed from the single source of +truth is effectively removed from any mirror as well. + +## Installing + +`lohr` is [published on crates.io](https://crates.io/crates/lohr), so you can +install it with `cargo install`: + + $ cargo +nightly install lohr + +We currently require a nightly compiler because +[Rocket](https://github.com/SergioBenitez/Rocket) needs one to compile (a 0.5.0 +which compiles on stable Rust is in the making, stay tuned!). You can install a +nightly toolchain with the following command: + + $ rustup install nightly + +## Setup + +### Quickstart + +Setting up `lohr` should be quite simple: + +1. Create a `Rocket.toml` file and [add your + configuration](https://rocket.rs/v0.4/guide/configuration/). + +2. Export a secret variable: + + $ export LOHR_SECRET=42 # please don't use this secret + +3. Run `lohr`: + + $ cargo run # or `cargo run --release` for production usage + +4. Configure your favorite git server to send a webhook to `lohr`'s address on + every push event. + + I used [Gitea's webhooks format](https://docs.gitea.io/en-us/webhooks/), but + I **think** they're similar to GitHub and GitLab's webhooks, so these should + work too! (If they don't, **please** file an issue!) + + Don't forget to set the webhook secret to the one you chose above. + +5. Add a `.lohr` file containing the remotes you want to mirror this repo to: + + git@github.com:you/your_repo + + and push it. That's it! `lohr` is mirroring your repo now. + + +### Configuration + +#### Home directory + +`lohr` needs a place to clone repos and store its data. By default, it's the +current directory, but you can set the `LOHR_HOME` environment variable to +customize it. + +#### Shared secret + +As shown in the quickstart guide, you **must** set the `LOHR_SECRET` environment +variable. + +#### Extra remote configuration + +You can provide `lohr` with a YAML file containing additional configuration. You +can pass its path to the `--config` flag when launching `lohr`. If no +configuration is provided via a CLI flag, `lohr` will check the `LOHR_CONFIG` +environment variable. If the environment variable isn't set either, it will +check in `LOHR_HOME` is a `lohr-config.yaml` file exists, and try to load it. + +This file takes the following format: + +``` yaml +default_remotes: + - "git@github:user" + - "git@gitlab:user" + +additional_remotes: + - "git@git.sr.ht:~user" + +blacklist: + - "private-.*" +``` + +- `default_remotes` is a list of remotes to use if no `.lohr` file is found in a + repository. +- `additional_remotes` is a list of remotes to add in any case, whether the + original set of remotes is set via `default_remotes` or via a `.lohr` file. +- `blacklist` is a list of regular expressions to match against the full + repository names. Any that matches will not be mirrored, even if it contains a + `.lohr` file. + +Both settings take as input a list of "stems", i.e. incomplete remote addresses, +to which the repo's name will be appended (so for example, if my +`default_remotes` contains `git@github.com:alarsyo`, and a push event webhook is +received for repository `git@gitlab.com:some/long/path/repo_name`, then the +mirror destination will be `git@github.com:alarsyo/repo_name`. + +## Contributing + +I accept patches anywhere! Feel free to [open a GitHub Pull +Request](https://github.com/alarsyo/lohr/pulls), [a GitLab Merge +Request](https://gitlab.com/alarsyo/lohr/-/merge_requests), or [send me a patch +by email](https://lists.sr.ht/~alarsyo/lohr-dev)! + +## Why lohr? + +I was looking for a cool name, and thought about the Magic Mirror in Snow White. +Some **[furious wikipedia +searching](https://en.wikipedia.org/wiki/Magic_Mirror_(Snow_White))** later, I +found that the Magic Mirror was probably inspired by [the Talking Mirror in Lohr +am Main](http://spessartmuseum.de/seiten/schneewittchen_engl.html). That's it, +that's the story. + +## License + +`lohr` is distributed under the terms of both the MIT license and the Apache +License (Version 2.0). + +See [LICENSE-APACHE](LICENSE-APACHE) and [LICENSE-MIT](LICENSE-MIT) for details. diff --git a/README.org b/README.org deleted file mode 100644 index a1f250c..0000000 --- a/README.org +++ /dev/null @@ -1,143 +0,0 @@ -#+title: lohr - -=lohr= is a Git mirroring tool. - -I created it to solve a simple problem I had: I host my own git server at -[[https://git.alarsyo.net]], but want to mirror my public projects to GitHub / -GitLab, for backup and visibility purposes. - -GitLab has a mirroring setting, but it doesn't allow for multiple mirrors, as -far as I know. I also wanted my instance to be the single source of truth. - -** How it works - -Gitea is setup to send webhooks to my =lohr= server on every push update. When -=lohr= receives a push, it clones the concerned repository, or updates it if -already cloned. Then it pushes the update to *all remotes listed* in the [[file:.lohr][.lohr]] -file at the repo root. - -*** Destructive - -This is a very destructive process: anything removed from the single source of -truth is effectively removed from any mirror as well. - -** Installing - -=lohr= is [[https://crates.io/crates/lohr][published on crates.io]], so you can install it with ~cargo install~: - -#+begin_src sh -$ cargo +nightly install lohr -#+end_src - -We currently require a nightly compiler because [[https://github.com/SergioBenitez/Rocket][Rocket]] needs one to compile (a -0.5.0 which compiles on stable Rust is in the making, stay tuned!). You can -install a nightly toolchain with the following command: - -#+begin_src sh -$ rustup install nightly -#+end_src - -** Setup - -*** Quickstart - -Setting up =lohr= should be quite simple: - -1. Create a =Rocket.toml= file and [[https://rocket.rs/v0.4/guide/configuration/][add your configuration]]. - -2. Export a secret variable: - - #+begin_src sh - $ export LOHR_SECRET=42 # please don't use this secret - #+end_src - -3. Run =lohr=: - - #+begin_src sh - $ cargo run # or `cargo run --release` for production usage - #+end_src - -4. Configure your favorite git server to send a webhook to =lohr='s address on - every push event. - - I used [[https://docs.gitea.io/en-us/webhooks/][Gitea's webhooks format]], but I *think* they're similar to GitHub and - GitLab's webhooks, so these should work too! (If they don't, *please* file an - issue!) - - Don't forget to set the webhook secret to the one you chose above. - -5. Add a =.lohr= file containing the remotes you want to mirror this repo to: - - #+begin_example - git@github.com:you/your_repo - #+end_example - - and push it. That's it! =lohr= is mirroring your repo now. - -*** Configuration - -**** Home directory - -=lohr= needs a place to clone repos and store its data. By default, it's the -current directory, but you can set the =LOHR_HOME= environment variable to -customize it. - -**** Shared secret - -As shown in the quickstart guide, you *must* set the =LOHR_SECRET= environment -variable. - -**** Extra remote configuration - -You can provide =lohr= with a YAML file containing additional configuration. You -can pass its path to the =--config= flag when launching =lohr=. If no -configuration is provided via a CLI flag, =lohr= will check the =LOHR_CONFIG= -environment variable. If the environment variable isn't set either, it will -check in =LOHR_HOME= is a =lohr-config.yaml= file exists, and try to load it. - -This file takes the following format: - -#+begin_src yaml -default_remotes: - - "git@github:user" - - "git@gitlab:user" - -additional_remotes: - - "git@git.sr.ht:~user" - -blacklist: - - "private-.*" -#+end_src - -- ~default_remotes~ is a list of remotes to use if no ~.lohr~ file is found in a - repository. -- ~additional_remotes~ is a list of remotes to add in any case, whether the - original set of remotes is set via ~default_remotes~ or via a =.lohr= file. -- ~blacklist~ is a list of regular expressions to match against the full - repository names. Any that matches will not be mirrored, even if it contains a - `.lohr` file. - -Both settings take as input a list of "stems", i.e. incomplete remote addresses, -to which the repo's name will be appended (so for example, if my -~default_remotes~ contains ~git@github.com:alarsyo~, and a push event webhook -is received for repository =git@gitlab.com:some/long/path/repo_name=, then the -mirror destination will be =git@github.com:alarsyo/repo_name=. - -** Contributing - -I accept patches anywhere! Feel free to [[https://github.com/alarsyo/lohr/pulls][open a GitHub Pull Request]], [[https://gitlab.com/alarsyo/lohr/-/merge_requests][a GitLab -Merge Request]], or [[https://lists.sr.ht/~alarsyo/lohr-dev][send me a patch by email]]! - -** Why lohr? - -I was looking for a cool name, and thought about the Magic Mirror in Snow White. -Some *[[https://en.wikipedia.org/wiki/Magic_Mirror_(Snow_White)][furious wikipedia searching]]* later, I found that the Magic Mirror was -probably inspired by [[http://spessartmuseum.de/seiten/schneewittchen_engl.html][the Talking Mirror in Lohr am Main]]. That's it, that's the -story. - -** License - -=lohr= is distributed under the terms of both the MIT license and the Apache -License (Version 2.0). - -See [[file:LICENSE-APACHE][LICENSE-APACHE]] and [[file:LICENSE-MIT][LICENSE-MIT]] for details. From 29c0a4abdfa8fc9c29a5588d2dc3bc4c65070625 Mon Sep 17 00:00:00 2001 From: Antoine Martin Date: Wed, 31 Mar 2021 19:39:04 +0200 Subject: [PATCH 25/61] lohr: v0.3.3 --- Cargo.lock | 2 +- Cargo.toml | 2 +- src/main.rs | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 60bf2b6..4e6aaa2 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -298,7 +298,7 @@ dependencies = [ [[package]] name = "lohr" -version = "0.3.2" +version = "0.3.3" dependencies = [ "anyhow", "clap", diff --git a/Cargo.toml b/Cargo.toml index ac90f78..b947936 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "lohr" -version = "0.3.2" +version = "0.3.3" authors = ["Antoine Martin "] edition = "2018" license = "Apache-2.0 OR MIT" diff --git a/src/main.rs b/src/main.rs index 97dadc8..38478e1 100644 --- a/src/main.rs +++ b/src/main.rs @@ -10,7 +10,7 @@ use std::sync::{ use std::thread; use anyhow::Context; -use clap::{App, Arg}; +use clap::{App, Arg, crate_version}; use log::{error, info}; use rocket::{http::Status, post, routes, State}; @@ -94,7 +94,7 @@ fn parse_config(home: &Path, flags: &clap::ArgMatches) -> anyhow::Result anyhow::Result<()> { let matches = App::new("lohr") - .version("0.3.2") + .version(crate_version!()) .about("Git mirroring daemon") .arg( Arg::with_name("config") From da20e2c9ac27aa5c359e8edf18cbfc40d9819af9 Mon Sep 17 00:00:00 2001 From: Antoine Martin Date: Wed, 31 Mar 2021 21:04:30 +0200 Subject: [PATCH 26/61] cargo fmt whoops --- src/main.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main.rs b/src/main.rs index 38478e1..3d0eff9 100644 --- a/src/main.rs +++ b/src/main.rs @@ -10,7 +10,7 @@ use std::sync::{ use std::thread; use anyhow::Context; -use clap::{App, Arg, crate_version}; +use clap::{crate_version, App, Arg}; use log::{error, info}; use rocket::{http::Status, post, routes, State}; From 3a93d9f9948f918a3d876df7e0b63577417206e2 Mon Sep 17 00:00:00 2001 From: Antoine Martin Date: Wed, 31 Mar 2021 13:46:03 +0200 Subject: [PATCH 27/61] lohr: build on rust stable Switching to Rocket's master branch (soon to be 0.5.0) allows building with a stable Rust compiler, yay! --- Cargo.lock | 1139 ++++++++++++++++++++++++++++++++++++++-------- Cargo.toml | 5 +- rust-toolchain | 2 +- src/main.rs | 8 +- src/signature.rs | 78 ++-- 5 files changed, 997 insertions(+), 235 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 4e6aaa2..d4cb064 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -17,6 +17,26 @@ version = "1.0.40" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "28b2cd92db5cbd74e8e5028f7e27dd7aa3090e89e4f2a197cc7c8dfb69c7063b" +[[package]] +name = "async-trait" +version = "0.1.48" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "36ea56748e10732c49404c153638a15ec3d6211ec5ff35d9bb20e13b93576adf" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "atomic" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c3410529e8288c463bedb5930f82833bc0c90e5d2fe639a56582a4d09220b281" +dependencies = [ + "autocfg", +] + [[package]] name = "atty" version = "0.2.14" @@ -35,20 +55,16 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "cdb031dd78e28731d87d56cc8ffef4a8f36ca26c38fe2de700543e627f8a464a" [[package]] -name = "base64" -version = "0.9.3" +name = "base-x" +version = "0.2.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "489d6c0ed21b11d038c31b6ceccca973e65d73ba3bd8ecb9a2babf5546164643" -dependencies = [ - "byteorder", - "safemem", -] +checksum = "a4521f3e3d031370679b3b140beb36dfe4801b09ac77e30c61941f97df3ef28b" [[package]] -name = "base64" -version = "0.12.3" +name = "binascii" +version = "0.1.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3441f0f7b02788e948e47f457ca01f1d7e6d92c693bc132c22b087d3141c03ff" +checksum = "383d29d513d8764dcdc42ea295d979eb99c3c9f00607b3692cf68a431f7dca72" [[package]] name = "bitflags" @@ -66,10 +82,28 @@ dependencies = [ ] [[package]] -name = "byteorder" -version = "1.4.3" +name = "bumpalo" +version = "3.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "14c189c53d098945499cdfa7ecc63567cf3886b3332b312a5b4585d8d3a6a610" +checksum = "63396b8a4b9de3f4fdfb320ab6080762242f66a8ef174c49d8e19b674db4cdbe" + +[[package]] +name = "bytes" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b700ce4376041dcd0a327fd0097c41095743c4c8af8887265942faf1100bd040" + +[[package]] +name = "cc" +version = "1.0.67" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e3c69b077ad434294d3ce9f1f6143a2a4b89a8a2d54ef813d85003a4fd1137fd" + +[[package]] +name = "cfg-if" +version = "0.1.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4785bdd1c96b2a846b2bd7cc02e86b6b3dbf14e7e53446c4f54c92a361040822" [[package]] name = "cfg-if" @@ -89,13 +123,26 @@ dependencies = [ ] [[package]] -name = "cookie" -version = "0.11.4" +name = "const_fn" +version = "0.4.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "80f6044740a4a516b8aac14c140cdf35c1a640b1bd6b98b6224e49143b2f1566" +checksum = "076a6803b0dacd6a88cfe64deba628b01533ff5ef265687e6938280c1afd0a28" + +[[package]] +name = "convert_case" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6245d59a3e82a7fc217c5828a6692dbc6dfb63a0c8c90495621f7b9d79704a0e" + +[[package]] +name = "cookie" +version = "0.15.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ffdf8865bac3d9a3bde5bde9088ca431b11f5d37c7a578b8086af77248b76627" dependencies = [ - "percent-encoding 2.1.0", + "percent-encoding", "time", + "version_check", ] [[package]] @@ -115,10 +162,21 @@ dependencies = [ ] [[package]] -name = "devise" -version = "0.2.0" +name = "derive_more" +version = "0.99.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "74e04ba2d03c5fa0d954c061fc8c9c288badadffc272ebb87679a89846de3ed3" +checksum = "f82b1b72f1263f214c0f823371768776c4f5841b942c9883aa8e5ec584fd0ba6" +dependencies = [ + "convert_case", + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "devise" +version = "0.3.0" +source = "git+https://github.com/SergioBenitez/Devise.git?rev=3ebe83#3ebe83823241c7979e6d2ccd18f889968a01985f" dependencies = [ "devise_codegen", "devise_core", @@ -126,24 +184,23 @@ dependencies = [ [[package]] name = "devise_codegen" -version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "066ceb7928ca93a9bedc6d0e612a8a0424048b0ab1f75971b203d01420c055d7" +version = "0.3.0" +source = "git+https://github.com/SergioBenitez/Devise.git?rev=3ebe83#3ebe83823241c7979e6d2ccd18f889968a01985f" dependencies = [ "devise_core", - "quote 0.6.13", + "quote", ] [[package]] name = "devise_core" -version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cf41c59b22b5e3ec0ea55c7847e5f358d340f3a8d6d53a5cf4f1564967f96487" +version = "0.3.0" +source = "git+https://github.com/SergioBenitez/Devise.git?rev=3ebe83#3ebe83823241c7979e6d2ccd18f889968a01985f" dependencies = [ "bitflags", - "proc-macro2 0.4.30", - "quote 0.6.13", - "syn 0.15.44", + "proc-macro2", + "proc-macro2-diagnostics", + "quote", + "syn", ] [[package]] @@ -155,12 +212,158 @@ dependencies = [ "generic-array", ] +[[package]] +name = "discard" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "212d0f5754cb6769937f4501cc0e67f4f4483c8d2c3e1e922ee9edbe4ab4c7c0" + [[package]] name = "dtoa" version = "0.4.8" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "56899898ce76aaf4a0f24d914c97ea6ed976d42fec6ad33fcbb0a1103e07b2b0" +[[package]] +name = "either" +version = "1.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e78d4f1cc4ae33bbfc157ed5d5a5ef3bc29227303d595861deb238fcec4e9457" + +[[package]] +name = "encoding_rs" +version = "0.8.28" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "80df024fbc5ac80f87dfef0d9f5209a252f2a497f7f42944cff24d8253cac065" +dependencies = [ + "cfg-if 1.0.0", +] + +[[package]] +name = "figment" +version = "0.10.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "708a94ecb9ca72e347442fef4563e459035b950c78091a355ed8a40180b33367" +dependencies = [ + "atomic", + "pear", + "serde", + "toml", + "uncased", + "version_check", +] + +[[package]] +name = "fnv" +version = "1.0.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" + +[[package]] +name = "futures" +version = "0.3.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7f55667319111d593ba876406af7c409c0ebb44dc4be6132a783ccf163ea14c1" +dependencies = [ + "futures-channel", + "futures-core", + "futures-executor", + "futures-io", + "futures-sink", + "futures-task", + "futures-util", +] + +[[package]] +name = "futures-channel" +version = "0.3.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8c2dd2df839b57db9ab69c2c9d8f3e8c81984781937fe2807dc6dcf3b2ad2939" +dependencies = [ + "futures-core", + "futures-sink", +] + +[[package]] +name = "futures-core" +version = "0.3.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "15496a72fabf0e62bdc3df11a59a3787429221dd0710ba8ef163d6f7a9112c94" + +[[package]] +name = "futures-executor" +version = "0.3.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "891a4b7b96d84d5940084b2a37632dd65deeae662c114ceaa2c879629c9c0ad1" +dependencies = [ + "futures-core", + "futures-task", + "futures-util", +] + +[[package]] +name = "futures-io" +version = "0.3.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d71c2c65c57704c32f5241c1223167c2c3294fd34ac020c807ddbe6db287ba59" + +[[package]] +name = "futures-macro" +version = "0.3.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ea405816a5139fb39af82c2beb921d52143f556038378d6db21183a5c37fbfb7" +dependencies = [ + "proc-macro-hack", + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "futures-sink" +version = "0.3.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "85754d98985841b7d4f5e8e6fbfa4a4ac847916893ec511a2917ccd8525b8bb3" + +[[package]] +name = "futures-task" +version = "0.3.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fa189ef211c15ee602667a6fcfe1c1fd9e07d42250d2156382820fba33c9df80" + +[[package]] +name = "futures-util" +version = "0.3.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1812c7ab8aedf8d6f2701a43e1243acdbcc2b36ab26e2ad421eb99ac963d96d1" +dependencies = [ + "futures-channel", + "futures-core", + "futures-io", + "futures-macro", + "futures-sink", + "futures-task", + "memchr", + "pin-project-lite", + "pin-utils", + "proc-macro-hack", + "proc-macro-nested", + "slab", +] + +[[package]] +name = "generator" +version = "0.6.25" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "061d3be1afec479d56fa3bd182bf966c7999ec175fcfdb87ac14d417241366c6" +dependencies = [ + "cc", + "libc", + "log", + "rustversion", + "winapi", +] + [[package]] name = "generic-array" version = "0.14.4" @@ -168,7 +371,18 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "501466ecc8a30d1d3b7fc9229b122b2ce8ed6e9d9223f1138d4babb253e51817" dependencies = [ "typenum", - "version_check 0.9.3", + "version_check", +] + +[[package]] +name = "getrandom" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c9495705279e7140bf035dde1f6e750c162df8b625267cd52cc44e0b156732c8" +dependencies = [ + "cfg-if 1.0.0", + "libc", + "wasi", ] [[package]] @@ -177,6 +391,25 @@ version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9b919933a397b79c37e33b77bb2aa3dc8eb6e165ad809e58ff75bc7db2e34574" +[[package]] +name = "h2" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fc018e188373e2777d0ef2467ebff62a08e66c3f5857b23c8fbec3018210dc00" +dependencies = [ + "bytes", + "fnv", + "futures-core", + "futures-sink", + "futures-util", + "http", + "indexmap", + "slab", + "tokio", + "tokio-util", + "tracing", +] + [[package]] name = "hashbrown" version = "0.9.1" @@ -208,6 +441,28 @@ dependencies = [ "digest", ] +[[package]] +name = "http" +version = "0.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7245cd7449cc792608c3c8a9eaf69bd4eabbabf802713748fd739c98b82f0747" +dependencies = [ + "bytes", + "fnv", + "itoa", +] + +[[package]] +name = "http-body" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5dfb77c123b4e2f72a2069aeae0b4b4949cc7e966df277813fc16347e7549737" +dependencies = [ + "bytes", + "http", + "pin-project-lite", +] + [[package]] name = "httparse" version = "1.3.5" @@ -215,33 +470,33 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "615caabe2c3160b313d52ccc905335f4ed5f10881dd63dc5699d47e90be85691" [[package]] -name = "hyper" -version = "0.10.16" +name = "httpdate" +version = "0.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0a0652d9a2609a968c14be1a9ea00bf4b1d64e2e1f53a1b51b6fff3a6e829273" -dependencies = [ - "base64 0.9.3", - "httparse", - "language-tags", - "log 0.3.9", - "mime", - "num_cpus", - "time", - "traitobject", - "typeable", - "unicase", - "url", -] +checksum = "494b4d60369511e7dea41cf646832512a94e542f68bb9c49e54518e0f468eb47" [[package]] -name = "idna" -version = "0.1.5" +name = "hyper" +version = "0.14.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "38f09e0f0b1fb55fdee1f17470ad800da77af5186a1a76c026b679358b7e844e" +checksum = "8bf09f61b52cfcf4c00de50df88ae423d6c02354e385a86341133b5338630ad1" dependencies = [ - "matches", - "unicode-bidi", - "unicode-normalization", + "bytes", + "futures-channel", + "futures-core", + "futures-util", + "h2", + "http", + "http-body", + "httparse", + "httpdate", + "itoa", + "pin-project", + "socket2", + "tokio", + "tower-service", + "tracing", + "want", ] [[package]] @@ -252,6 +507,22 @@ checksum = "824845a0bf897a9042383849b02c1bc219c2383772efcd5c6f9766fa4b81aef3" dependencies = [ "autocfg", "hashbrown", + "serde", +] + +[[package]] +name = "inlinable_string" +version = "0.1.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3094308123a0e9fd59659ce45e22de9f53fc1d2ac6e1feb9fef988e4f76cad77" + +[[package]] +name = "instant" +version = "0.1.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "61124eeebbd69b8190558df225adf7e4caafce0d743919e5d6b19652314ec5ec" +dependencies = [ + "cfg-if 1.0.0", ] [[package]] @@ -261,10 +532,10 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "dd25036021b0de88a0aff6b850051563c6516d0bf53f8638938edbb9de732736" [[package]] -name = "language-tags" -version = "0.2.2" +name = "lazy_static" +version = "1.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a91d884b6667cd606bb5a69aa0c99ba811a115fc68915e7056ec08a46e93199a" +checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" [[package]] name = "libc" @@ -279,12 +550,12 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7fb9b38af92608140b86b693604b9ffcc5824240a484d1ecd4795bacb2fe88f3" [[package]] -name = "log" -version = "0.3.9" +name = "lock_api" +version = "0.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e19e8d5c34a3e0e2223db8e060f9e8264aeeb5c5fc64a4ee9965c062211c024b" +checksum = "dd96ffd135b2fd7b973ac026d28085defbe8983df057ced3eb4f2130b0831312" dependencies = [ - "log 0.4.14", + "scopeguard", ] [[package]] @@ -293,7 +564,7 @@ version = "0.4.14" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "51b9bbe6c47d51fc3e1a9b945965946b4c44142ab8792c50835a980d362c2710" dependencies = [ - "cfg-if", + "cfg-if 1.0.0", ] [[package]] @@ -304,7 +575,7 @@ dependencies = [ "clap", "hex", "hmac", - "log 0.4.14", + "log", "regex", "rocket", "serde", @@ -315,10 +586,17 @@ dependencies = [ ] [[package]] -name = "matches" -version = "0.1.8" +name = "loom" +version = "0.3.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7ffc5c5338469d4d3ea17d269fa8ea3512ad247247c30bd2df69e68309ed0a08" +checksum = "a0e8460f2f2121162705187214720353c517b97bdfb3494c0b1e33d83ebe4bed" +dependencies = [ + "cfg-if 0.1.10", + "generator", + "scoped-tls", + "serde", + "serde_json", +] [[package]] name = "memchr" @@ -328,11 +606,58 @@ checksum = "0ee1c47aaa256ecabcaea351eae4a9b01ef39ed810004e298d2511ed284b1525" [[package]] name = "mime" -version = "0.2.6" +version = "0.3.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ba626b8a6de5da682e1caa06bdb42a335aee5a84db8e5046a3e8ab17ba0a3ae0" +checksum = "2a60c7ce501c71e03a9c9c0d35b861413ae925bd979cc7a4e30d060069aaac8d" + +[[package]] +name = "mio" +version = "0.7.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cf80d3e903b34e0bd7282b218398aec54e082c840d9baf8339e0080a0c542956" dependencies = [ - "log 0.3.9", + "libc", + "log", + "miow", + "ntapi", + "winapi", +] + +[[package]] +name = "miow" +version = "0.3.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b9f1c5b025cda876f66ef43a113f91ebc9f4ccef34843000e0adf6ebbab84e21" +dependencies = [ + "winapi", +] + +[[package]] +name = "multer" +version = "1.2.2" +source = "git+https://github.com/rousan/multer-rs.git?rev=7e4f0c5f#7e4f0c5fe14e4c531f503922bfe04f68b32ddf17" +dependencies = [ + "bytes", + "derive_more", + "encoding_rs", + "futures-util", + "http", + "httparse", + "log", + "mime", + "tokio", + "tokio-util", + "twoway", + "version_check", +] + +[[package]] +name = "ntapi" +version = "0.3.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3f6bb902e437b6d86e03cce10a7e2af662292c5dfef23b65899ea3ac9354ad44" +dependencies = [ + "winapi", ] [[package]] @@ -345,6 +670,12 @@ dependencies = [ "libc", ] +[[package]] +name = "once_cell" +version = "1.7.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "af8b08b04175473088b46763e51ee54da5f9a164bc162f615b91bc179dbf15a3" + [[package]] name = "opaque-debug" version = "0.3.0" @@ -352,32 +683,52 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "624a8340c38c1b80fd549087862da4ba43e08858af025b236e509b6649fc13d5" [[package]] -name = "pear" -version = "0.1.4" +name = "parking_lot" +version = "0.11.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5320f212db967792b67cfe12bd469d08afd6318a249bd917d5c19bc92200ab8a" +checksum = "6d7744ac029df22dca6284efe4e898991d28e3085c706c972bcd7da4a27a15eb" dependencies = [ - "pear_codegen", + "instant", + "lock_api", + "parking_lot_core", ] [[package]] -name = "pear_codegen" -version = "0.1.4" +name = "parking_lot_core" +version = "0.8.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bfc1c836fdc3d1ef87c348b237b5b5c4dff922156fb2d968f57734f9669768ca" +checksum = "fa7a782938e745763fe6907fc6ba86946d72f49fe7e21de074e08128a99fb018" dependencies = [ - "proc-macro2 0.4.30", - "quote 0.6.13", - "syn 0.15.44", - "version_check 0.9.3", + "cfg-if 1.0.0", + "instant", + "libc", + "redox_syscall", + "smallvec", + "winapi", +] + +[[package]] +name = "pear" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "86ab3a2b792945ed67eadbbdcbd2898f8dd2319392b2a45ac21adea5245cb113" +dependencies = [ + "inlinable_string", + "pear_codegen", "yansi", ] [[package]] -name = "percent-encoding" -version = "1.0.1" +name = "pear_codegen" +version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "31010dd2e1ac33d5b46a5b413495239882813e0369f8ed8a5e266f173602f831" +checksum = "620c9c4776ba41b59ab101360c9b1419c0c8c81cd2e6e39fae7109e7425994cb" +dependencies = [ + "proc-macro2", + "proc-macro2-diagnostics", + "quote", + "syn", +] [[package]] name = "percent-encoding" @@ -386,30 +737,75 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d4fd5641d01c8f18a23da7b6fe29298ff4b55afcccdf78973b24cf3175fee32e" [[package]] -name = "proc-macro2" -version = "0.4.30" +name = "pin-project" +version = "1.0.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cf3d2011ab5c909338f7887f4fc896d35932e29146c12c8d01da6b22a80ba759" +checksum = "bc174859768806e91ae575187ada95c91a29e96a98dc5d2cd9a1fed039501ba6" dependencies = [ - "unicode-xid 0.1.0", + "pin-project-internal", ] +[[package]] +name = "pin-project-internal" +version = "1.0.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a490329918e856ed1b083f244e3bfe2d8c4f336407e4ea9e1a9f479ff09049e5" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "pin-project-lite" +version = "0.2.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dc0e1f259c92177c30a4c9d177246edd0a3568b25756a977d0632cf8fa37e905" + +[[package]] +name = "pin-utils" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184" + +[[package]] +name = "ppv-lite86" +version = "0.2.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ac74c624d6b2d21f425f752262f42188365d7b8ff1aff74c82e45136510a4857" + +[[package]] +name = "proc-macro-hack" +version = "0.5.19" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dbf0c48bc1d91375ae5c3cd81e3722dff1abcf81a30960240640d223f59fe0e5" + +[[package]] +name = "proc-macro-nested" +version = "0.1.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bc881b2c22681370c6a780e47af9840ef841837bc98118431d4e1868bd0c1086" + [[package]] name = "proc-macro2" version = "1.0.24" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1e0704ee1a7e00d7bb417d0770ea303c1bccbabf0ef1667dae92b5967f5f8a71" dependencies = [ - "unicode-xid 0.2.1", + "unicode-xid", ] [[package]] -name = "quote" -version = "0.6.13" +name = "proc-macro2-diagnostics" +version = "0.9.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6ce23b6b870e8f94f81fb0a363d65d86675884b34a09043c81e5562f11c1f8e1" +checksum = "4bf29726d67464d49fa6224a1d07936a8c08bb3fba727c7493f6cf1616fdaada" dependencies = [ - "proc-macro2 0.4.30", + "proc-macro2", + "quote", + "syn", + "version_check", + "yansi", ] [[package]] @@ -418,7 +814,76 @@ version = "1.0.9" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c3d0b9745dc2debf507c8422de05d7226cc1f0644216dfdfead988f9b1ab32a7" dependencies = [ - "proc-macro2 1.0.24", + "proc-macro2", +] + +[[package]] +name = "rand" +version = "0.8.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0ef9e7e66b4468674bfcb0c81af8b7fa0bb154fa9f28eb840da5c447baeb8d7e" +dependencies = [ + "libc", + "rand_chacha", + "rand_core", + "rand_hc", +] + +[[package]] +name = "rand_chacha" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e12735cf05c9e10bf21534da50a147b924d555dc7a547c42e6bb2d5b6017ae0d" +dependencies = [ + "ppv-lite86", + "rand_core", +] + +[[package]] +name = "rand_core" +version = "0.6.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "34cf66eb183df1c5876e2dcf6b13d57340741e8dc255b48e40a26de954d06ae7" +dependencies = [ + "getrandom", +] + +[[package]] +name = "rand_hc" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3190ef7066a446f2e7f42e239d161e905420ccab01eb967c9eb27d21b2322a73" +dependencies = [ + "rand_core", +] + +[[package]] +name = "redox_syscall" +version = "0.2.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "94341e4e44e24f6b591b59e47a8a027df12e008d73fd5672dbea9cc22f4507d9" +dependencies = [ + "bitflags", +] + +[[package]] +name = "ref-cast" +version = "1.0.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "300f2a835d808734ee295d45007adacb9ebb29dd3ae2424acfa17930cae541da" +dependencies = [ + "ref-cast-impl", +] + +[[package]] +name = "ref-cast-impl" +version = "1.0.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4c38e3aecd2b21cb3959637b883bb3714bc7e43f0268b9a29d3743ee3e55cdd2" +dependencies = [ + "proc-macro2", + "quote", + "syn", ] [[package]] @@ -439,58 +904,102 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "24d5f089152e60f62d28b835fbff2cd2e8dc0baf1ac13343bef92ab7eed84548" [[package]] -name = "rocket" -version = "0.4.7" +name = "remove_dir_all" +version = "0.5.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7febfdfd4d43facfc7daba20349ebe2c310c6735bd6a2a9255ea8bc425b4cb13" +checksum = "3acd125665422973a33ac9d3dd2df85edad0f4ae9b00dafb1a05e43a9f5ef8e7" dependencies = [ + "winapi", +] + +[[package]] +name = "rocket" +version = "0.5.0-dev" +source = "git+https://github.com/SergioBenitez/Rocket?rev=2893ce754d6535e0a752586e60d7e292343016c0#2893ce754d6535e0a752586e60d7e292343016c0" +dependencies = [ + "async-trait", + "atomic", "atty", - "base64 0.12.3", - "log 0.4.14", + "binascii", + "either", + "figment", + "futures", + "indexmap", + "log", "memchr", + "multer", "num_cpus", - "pear", + "parking_lot", + "pin-project-lite", + "rand", + "ref-cast", "rocket_codegen", "rocket_http", + "serde", "state", + "tempfile", "time", - "toml", - "version_check 0.9.3", + "tokio", + "ubyte", + "version_check", "yansi", ] [[package]] name = "rocket_codegen" -version = "0.4.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ceac2c55b2c8b1cdc53add64332defa5fc227f64263b86b4114d1386286d42a3" +version = "0.5.0-dev" +source = "git+https://github.com/SergioBenitez/Rocket?rev=2893ce754d6535e0a752586e60d7e292343016c0#2893ce754d6535e0a752586e60d7e292343016c0" dependencies = [ "devise", "glob", "indexmap", - "quote 0.6.13", + "quote", "rocket_http", - "version_check 0.9.3", - "yansi", + "unicode-xid", ] [[package]] name = "rocket_http" -version = "0.4.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ce364100ed7a1bf39257b69ebd014c1d5b4979b0d365d8c9ab0aa9c79645493d" +version = "0.5.0-dev" +source = "git+https://github.com/SergioBenitez/Rocket?rev=2893ce754d6535e0a752586e60d7e292343016c0#2893ce754d6535e0a752586e60d7e292343016c0" dependencies = [ "cookie", + "either", + "http", "hyper", "indexmap", + "log", + "memchr", + "mime", + "parking_lot", "pear", - "percent-encoding 1.0.1", + "percent-encoding", + "pin-project-lite", + "ref-cast", + "serde", "smallvec", + "stable-pattern", "state", "time", - "unicode-xid 0.1.0", + "tokio", + "uncased", ] +[[package]] +name = "rustc_version" +version = "0.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "138e3e0acb6c9fb258b19b67cb8abd63c00679d2851805ea151465464fe9030a" +dependencies = [ + "semver", +] + +[[package]] +name = "rustversion" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cb5d2a036dc6d2d8fd16fde3498b04306e29bd193bf306a57427019b823d5acd" + [[package]] name = "ryu" version = "1.0.5" @@ -498,10 +1007,31 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "71d301d4193d031abdd79ff7e3dd721168a9572ef3fe51a1517aba235bd8f86e" [[package]] -name = "safemem" -version = "0.3.3" +name = "scoped-tls" +version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ef703b7cb59335eae2eb93ceb664c0eb7ea6bf567079d843e09420219668e072" +checksum = "ea6a9290e3c9cf0f18145ef7ffa62d68ee0bf5fcd651017e586dc7fd5da448c2" + +[[package]] +name = "scopeguard" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d29ab0c6d3fc0ee92fe66e2d99f700eab17a8d57d1c1d3b748380fb20baa78cd" + +[[package]] +name = "semver" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1d7eb9ef2c18661902cc47e535f9bc51b78acd254da71d375c2f6720d9a40403" +dependencies = [ + "semver-parser", +] + +[[package]] +name = "semver-parser" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "388a1df253eca08550bef6c72392cfe7c30914bf41df5269b68cbd6ff8f570a3" [[package]] name = "serde" @@ -518,9 +1048,9 @@ version = "1.0.125" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b093b7a2bb58203b5da3056c05b4ec1fed827dcfdb37347a8841695263b3d06d" dependencies = [ - "proc-macro2 1.0.24", - "quote 1.0.9", - "syn 1.0.67", + "proc-macro2", + "quote", + "syn", ] [[package]] @@ -556,6 +1086,12 @@ dependencies = [ "yaml-rust", ] +[[package]] +name = "sha1" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2579985fda508104f7587689507983eadd6a6e84dd35d6d115361f530916fa0d" + [[package]] name = "sha2" version = "0.9.3" @@ -563,23 +1099,117 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "fa827a14b29ab7f44778d14a88d3cb76e949c45083f7dbfa507d0cb699dc12de" dependencies = [ "block-buffer", - "cfg-if", + "cfg-if 1.0.0", "cpuid-bool", "digest", "opaque-debug", ] +[[package]] +name = "signal-hook-registry" +version = "1.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "16f1d0fef1604ba8f7a073c7e701f213e056707210e9020af4528e0101ce11a6" +dependencies = [ + "libc", +] + +[[package]] +name = "slab" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c111b5bd5695e56cffe5129854aa230b39c93a305372fdbb2668ca2394eea9f8" + [[package]] name = "smallvec" version = "1.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "fe0f37c9e8f3c5a4a66ad655a93c74daac4ad00c441533bf5c6e7990bb42604e" +[[package]] +name = "socket2" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9e3dfc207c526015c632472a77be09cf1b6e46866581aecae5cc38fb4235dea2" +dependencies = [ + "libc", + "winapi", +] + +[[package]] +name = "stable-pattern" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4564168c00635f88eaed410d5efa8131afa8d8699a612c80c455a0ba05c21045" +dependencies = [ + "memchr", +] + +[[package]] +name = "standback" +version = "0.2.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e113fb6f3de07a243d434a56ec6f186dfd51cb08448239fe7bcae73f87ff28ff" +dependencies = [ + "version_check", +] + [[package]] name = "state" version = "0.4.2" +source = "git+https://github.com/SergioBenitez/state.git?rev=504ef71a#504ef71ae39310107a5ebad5f23c6e4c8c9b3ae9" +dependencies = [ + "loom", +] + +[[package]] +name = "stdweb" +version = "0.4.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3015a7d0a5fd5105c91c3710d42f9ccf0abfb287d62206484dcc67f9569a6483" +checksum = "d022496b16281348b52d0e30ae99e01a73d737b2f45d38fed4edf79f9325a1d5" +dependencies = [ + "discard", + "rustc_version", + "stdweb-derive", + "stdweb-internal-macros", + "stdweb-internal-runtime", + "wasm-bindgen", +] + +[[package]] +name = "stdweb-derive" +version = "0.5.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c87a60a40fccc84bef0652345bbbbbe20a605bf5d0ce81719fc476f5c03b50ef" +dependencies = [ + "proc-macro2", + "quote", + "serde", + "serde_derive", + "syn", +] + +[[package]] +name = "stdweb-internal-macros" +version = "0.2.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "58fa5ff6ad0d98d1ffa8cb115892b6e69d67799f6763e162a1c9db421dc22e11" +dependencies = [ + "base-x", + "proc-macro2", + "quote", + "serde", + "serde_derive", + "serde_json", + "sha1", + "syn", +] + +[[package]] +name = "stdweb-internal-runtime" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "213701ba3370744dcd1a12960caa4843b3d68b4d1c0a5d575e0d65b2ee9d16c0" [[package]] name = "subtle" @@ -587,26 +1217,29 @@ version = "2.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1e81da0851ada1f3e9d4312c704aa4f8806f0f9d69faaf8df2f3464b4a9437c2" -[[package]] -name = "syn" -version = "0.15.44" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9ca4b3b69a77cbe1ffc9e198781b7acb0c7365a883670e8f1c1bc66fba79a5c5" -dependencies = [ - "proc-macro2 0.4.30", - "quote 0.6.13", - "unicode-xid 0.1.0", -] - [[package]] name = "syn" version = "1.0.67" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6498a9efc342871f91cc2d0d694c674368b4ceb40f62b65a7a08c3792935e702" dependencies = [ - "proc-macro2 1.0.24", - "quote 1.0.9", - "unicode-xid 0.2.1", + "proc-macro2", + "quote", + "unicode-xid", +] + +[[package]] +name = "tempfile" +version = "3.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dac1c663cfc93810f88aed9b8941d48cabf856a1b111c29a40439018d870eb22" +dependencies = [ + "cfg-if 1.0.0", + "libc", + "rand", + "redox_syscall", + "remove_dir_all", + "winapi", ] [[package]] @@ -620,49 +1253,136 @@ dependencies = [ [[package]] name = "time" -version = "0.1.43" +version = "0.2.26" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ca8a50ef2360fbd1eeb0ecd46795a87a19024eb4b53c5dc916ca1fd95fe62438" +checksum = "08a8cbfbf47955132d0202d1662f49b2423ae35862aee471f3ba4b133358f372" dependencies = [ + "const_fn", "libc", + "standback", + "stdweb", + "time-macros", + "version_check", "winapi", ] [[package]] -name = "tinyvec" -version = "1.1.1" +name = "time-macros" +version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "317cca572a0e89c3ce0ca1f1bdc9369547fe318a683418e42ac8f59d14701023" +checksum = "957e9c6e26f12cb6d0dd7fc776bb67a706312e7299aed74c8dd5b17ebb27e2f1" dependencies = [ - "tinyvec_macros", + "proc-macro-hack", + "time-macros-impl", ] [[package]] -name = "tinyvec_macros" -version = "0.1.0" +name = "time-macros-impl" +version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cda74da7e1a664f795bb1f8a87ec406fb89a02522cf6e50620d016add6dbbf5c" +checksum = "e5c3be1edfad6027c69f5491cf4cb310d1a71ecd6af742788c6ff8bced86b8fa" +dependencies = [ + "proc-macro-hack", + "proc-macro2", + "quote", + "standback", + "syn", +] + +[[package]] +name = "tokio" +version = "1.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "134af885d758d645f0f0505c9a8b3f9bf8a348fd822e112ab5248138348f1722" +dependencies = [ + "autocfg", + "bytes", + "libc", + "memchr", + "mio", + "num_cpus", + "once_cell", + "pin-project-lite", + "signal-hook-registry", + "tokio-macros", + "winapi", +] + +[[package]] +name = "tokio-macros" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "caf7b11a536f46a809a8a9f0bb4237020f70ecbf115b842360afb127ea2fda57" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "tokio-util" +version = "0.6.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5143d049e85af7fbc36f5454d990e62c2df705b3589f123b71f441b6b59f443f" +dependencies = [ + "bytes", + "futures-core", + "futures-sink", + "log", + "pin-project-lite", + "tokio", +] [[package]] name = "toml" -version = "0.4.10" +version = "0.5.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "758664fc71a3a69038656bee8b6be6477d2a6c315a6b81f7081f591bffa4111f" +checksum = "a31142970826733df8241ef35dc040ef98c679ab14d7c3e54d827099b3acecaa" dependencies = [ "serde", ] [[package]] -name = "traitobject" -version = "0.1.0" +name = "tower-service" +version = "0.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "efd1f82c56340fdf16f2a953d7bda4f8fdffba13d93b00844c25572110b26079" +checksum = "360dfd1d6d30e05fda32ace2c8c70e9c0a9da713275777f5a4dbb8a1893930c6" [[package]] -name = "typeable" -version = "0.1.2" +name = "tracing" +version = "0.1.25" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1410f6f91f21d1612654e7cc69193b0334f909dcf2c790c4826254fbb86f8887" +checksum = "01ebdc2bb4498ab1ab5f5b73c5803825e60199229ccba0698170e3be0e7f959f" +dependencies = [ + "cfg-if 1.0.0", + "pin-project-lite", + "tracing-core", +] + +[[package]] +name = "tracing-core" +version = "0.1.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f50de3927f93d202783f4513cda820ab47ef17f624b03c096e86ef00c67e6b5f" +dependencies = [ + "lazy_static", +] + +[[package]] +name = "try-lock" +version = "0.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "59547bce71d9c38b83d9c0e92b6066c4253371f15005def0c30d9657f50c7642" + +[[package]] +name = "twoway" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6b40075910de3a912adbd80b5d8bad6ad10a23eeb1f5bf9d4006839e899ba5bc" +dependencies = [ + "memchr", + "unchecked-index", +] [[package]] name = "typenum" @@ -671,31 +1391,29 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "879f6906492a7cd215bfa4cf595b600146ccfac0c79bcbd1f3000162af5e8b06" [[package]] -name = "unicase" -version = "1.4.2" +name = "ubyte" +version = "0.10.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7f4765f83163b74f957c797ad9253caf97f103fb064d3999aea9568d09fc8a33" +checksum = "42756bb9e708855de2f8a98195643dff31a97f0485d90d8467b39dc24be9e8fe" dependencies = [ - "version_check 0.1.5", + "serde", ] [[package]] -name = "unicode-bidi" -version = "0.3.4" +name = "uncased" +version = "0.9.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "49f2bd0c6468a8230e1db229cff8029217cf623c767ea5d60bfbd42729ea54d5" +checksum = "300932469d646d39929ffe84ad5c1837beecf602519ef5695e485b472de4082b" dependencies = [ - "matches", + "serde", + "version_check", ] [[package]] -name = "unicode-normalization" -version = "0.1.17" +name = "unchecked-index" +version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "07fbfce1c8a97d547e8b5334978438d9d6ec8c20e38f56d4a4374d181493eaef" -dependencies = [ - "tinyvec", -] +checksum = "eeba86d422ce181a719445e51872fa30f1f7413b62becb52e95ec91aa262d85c" [[package]] name = "unicode-width" @@ -703,41 +1421,88 @@ version = "0.1.8" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9337591893a19b88d8d87f2cec1e73fad5cdfd10e5a6f349f498ad6ea2ffb1e3" -[[package]] -name = "unicode-xid" -version = "0.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fc72304796d0818e357ead4e000d19c9c174ab23dc11093ac919054d20a6a7fc" - [[package]] name = "unicode-xid" version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f7fe0bb3479651439c9112f72b6c505038574c9fbb575ed1bf3b797fa39dd564" -[[package]] -name = "url" -version = "1.7.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dd4e7c0d531266369519a4aa4f399d748bd37043b00bde1e4ff1f60a120b355a" -dependencies = [ - "idna", - "matches", - "percent-encoding 1.0.1", -] - -[[package]] -name = "version_check" -version = "0.1.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "914b1a6776c4c929a602fafd8bc742e06365d4bcbe48c30f9cca5824f70dc9dd" - [[package]] name = "version_check" version = "0.9.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5fecdca9a5291cc2b8dcf7dc02453fee791a280f3743cb0905f8822ae463b3fe" +[[package]] +name = "want" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1ce8a968cb1cd110d136ff8b819a556d6fb6d919363c61534f6860c7eb172ba0" +dependencies = [ + "log", + "try-lock", +] + +[[package]] +name = "wasi" +version = "0.10.2+wasi-snapshot-preview1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fd6fbd9a79829dd1ad0cc20627bf1ed606756a7f77edff7b66b7064f9cb327c6" + +[[package]] +name = "wasm-bindgen" +version = "0.2.73" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "83240549659d187488f91f33c0f8547cbfef0b2088bc470c116d1d260ef623d9" +dependencies = [ + "cfg-if 1.0.0", + "wasm-bindgen-macro", +] + +[[package]] +name = "wasm-bindgen-backend" +version = "0.2.73" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ae70622411ca953215ca6d06d3ebeb1e915f0f6613e3b495122878d7ebec7dae" +dependencies = [ + "bumpalo", + "lazy_static", + "log", + "proc-macro2", + "quote", + "syn", + "wasm-bindgen-shared", +] + +[[package]] +name = "wasm-bindgen-macro" +version = "0.2.73" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3e734d91443f177bfdb41969de821e15c516931c3c3db3d318fa1b68975d0f6f" +dependencies = [ + "quote", + "wasm-bindgen-macro-support", +] + +[[package]] +name = "wasm-bindgen-macro-support" +version = "0.2.73" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d53739ff08c8a68b0fdbcd54c372b8ab800b1449ab3c9d706503bc7dd1621b2c" +dependencies = [ + "proc-macro2", + "quote", + "syn", + "wasm-bindgen-backend", + "wasm-bindgen-shared", +] + +[[package]] +name = "wasm-bindgen-shared" +version = "0.2.73" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d9a543ae66aa233d14bb765ed9af4a33e81b8b58d1584cf1b47ff8cd0b9e4489" + [[package]] name = "winapi" version = "0.3.9" diff --git a/Cargo.toml b/Cargo.toml index b947936..e628958 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -23,7 +23,7 @@ serde_yaml = "0.8.17" sha2 = "0.9.3" [dependencies.rocket] -version = "0.4.7" +version = "0.5.0-dev" # don't need private-cookies default-features = false @@ -31,3 +31,6 @@ default-features = false version = "2.33.3" # no need for suggestions or color with only one argument default-features = false + +[patch.crates-io] +rocket = { git = "https://github.com/SergioBenitez/Rocket", rev = "2893ce754d6535e0a752586e60d7e292343016c0" } diff --git a/rust-toolchain b/rust-toolchain index bf867e0..2bf5ad0 100644 --- a/rust-toolchain +++ b/rust-toolchain @@ -1 +1 @@ -nightly +stable diff --git a/src/main.rs b/src/main.rs index 3d0eff9..46ee9f0 100644 --- a/src/main.rs +++ b/src/main.rs @@ -1,5 +1,3 @@ -#![feature(proc_macro_hygiene, decl_macro)] - use std::env; use std::fs::File; use std::path::{Path, PathBuf}; @@ -92,7 +90,8 @@ fn parse_config(home: &Path, flags: &clap::ArgMatches) -> anyhow::Result anyhow::Result<()> { +#[rocket::main] +async fn main() -> anyhow::Result<()> { let matches = App::new("lohr") .version(crate_version!()) .about("Git mirroring daemon") @@ -127,7 +126,8 @@ fn main() -> anyhow::Result<()> { .manage(JobSender(Mutex::new(sender))) .manage(Secret(secret)) .manage(config_state) - .launch(); + .launch() + .await?; Ok(()) } diff --git a/src/signature.rs b/src/signature.rs index c917db6..89e0946 100644 --- a/src/signature.rs +++ b/src/signature.rs @@ -1,20 +1,17 @@ use std::{ - io::Read, + io, ops::{Deref, DerefMut}, }; use rocket::{ - data::{FromData, Outcome}, + data::{ByteUnit, FromData, Outcome}, http::ContentType, State, }; -use rocket::{ - data::{Transform, Transformed}, - http::Status, -}; +use rocket::{http::Status, local_cache}; use rocket::{Data, Request}; -use anyhow::anyhow; +use anyhow::{anyhow, Context}; use serde::Deserialize; use crate::Secret; @@ -53,37 +50,29 @@ impl DerefMut for SignedJson { } } -const LIMIT: u64 = 1 << 20; +const LIMIT: ByteUnit = ByteUnit::Mebibyte(1); + +impl<'r, T: Deserialize<'r>> SignedJson { + fn from_str(s: &'r str) -> anyhow::Result { + serde_json::from_str(s) + .map(SignedJson) + .context("could not parse json") + } +} // This is a one to one implementation of request_contrib::Json's FromData, but with HMAC // validation. // // Tracking issue for chaining Data guards to avoid this: // https://github.com/SergioBenitez/Rocket/issues/775 -impl<'a, T> FromData<'a> for SignedJson +#[rocket::async_trait] +impl<'r, T> FromData<'r> for SignedJson where - T: Deserialize<'a>, + T: Deserialize<'r>, { type Error = anyhow::Error; - type Owned = String; - type Borrowed = str; - fn transform( - request: &Request, - data: Data, - ) -> rocket::data::Transform> { - let size_limit = request.limits().get("json").unwrap_or(LIMIT); - let mut s = String::with_capacity(512); - match data.open().take(size_limit).read_to_string(&mut s) { - Ok(_) => Transform::Borrowed(Outcome::Success(s)), - Err(e) => Transform::Borrowed(Outcome::Failure(( - Status::BadRequest, - anyhow!("couldn't read json: {}", e), - ))), - } - } - - fn from_data(request: &Request, o: Transformed<'a, Self>) -> Outcome { + async fn from_data(request: &'r Request<'_>, data: Data) -> Outcome { let json_ct = ContentType::new("application", "json"); if request.content_type() != Some(&json_ct) { return Outcome::Failure((Status::BadRequest, anyhow!("wrong content type"))); @@ -97,26 +86,31 @@ where )); } + let size_limit = request.limits().get("json").unwrap_or(LIMIT); + let content = match data.open(size_limit).into_string().await { + Ok(s) if s.is_complete() => s.into_inner(), + Ok(_) => { + let eof = io::ErrorKind::UnexpectedEof; + return Outcome::Failure(( + Status::PayloadTooLarge, + io::Error::new(eof, "data limit exceeded").into(), + )); + } + Err(e) => return Outcome::Failure((Status::BadRequest, e.into())), + }; + let signature = signatures[0]; + let secret = request.guard::>().await.unwrap(); - let content = o.borrowed()?; - - let secret = request.guard::>().unwrap(); - - if !validate_signature(&secret.0, &signature, content) { + if !validate_signature(&secret.0, &signature, &content) { return Outcome::Failure((Status::BadRequest, anyhow!("couldn't verify signature"))); } - let content = match serde_json::from_str(content) { - Ok(content) => content, - Err(e) => { - return Outcome::Failure(( - Status::BadRequest, - anyhow!("couldn't parse json: {}", e), - )) - } + let content = match Self::from_str(local_cache!(request, content)) { + Ok(content) => Outcome::Success(content), + Err(e) => Outcome::Failure((Status::BadRequest, e)), }; - Outcome::Success(SignedJson(content)) + content } } From 56f82c64672aaa981a7f27292230471abf8a4f3d Mon Sep 17 00:00:00 2001 From: Antoine Martin Date: Wed, 31 Mar 2021 13:46:46 +0200 Subject: [PATCH 28/61] README: remove mention of nightly compiler --- README.md | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/README.md b/README.md index ff6176b..7a0b30f 100644 --- a/README.md +++ b/README.md @@ -26,14 +26,7 @@ truth is effectively removed from any mirror as well. `lohr` is [published on crates.io](https://crates.io/crates/lohr), so you can install it with `cargo install`: - $ cargo +nightly install lohr - -We currently require a nightly compiler because -[Rocket](https://github.com/SergioBenitez/Rocket) needs one to compile (a 0.5.0 -which compiles on stable Rust is in the making, stay tuned!). You can install a -nightly toolchain with the following command: - - $ rustup install nightly + $ cargo install lohr ## Setup From 378823a1fb86e3e710d6765a1a55a577e6dcb491 Mon Sep 17 00:00:00 2001 From: Antoine Martin Date: Wed, 31 Mar 2021 13:48:15 +0200 Subject: [PATCH 29/61] ci: switch to stable toolchain --- .github/workflows/ci.yaml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index d450a8b..91d8a67 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -10,11 +10,11 @@ jobs: - name: Checkout sources uses: actions/checkout@v2 - - name: Install nightly toolchain + - name: Install stable toolchain uses: actions-rs/toolchain@v1 with: profile: minimal - toolchain: nightly + toolchain: stable override: true - name: Run cargo check @@ -29,11 +29,11 @@ jobs: - name: Checkout sources uses: actions/checkout@v2 - - name: Install nightly toolchain + - name: Install stable toolchain uses: actions-rs/toolchain@v1 with: profile: minimal - toolchain: nightly + toolchain: stable override: true - name: Run cargo test @@ -48,11 +48,11 @@ jobs: - name: Checkout sources uses: actions/checkout@v2 - - name: Install nightly toolchain + - name: Install stable toolchain uses: actions-rs/toolchain@v1 with: profile: minimal - toolchain: nightly + toolchain: stable override: true components: rustfmt, clippy From 3fedfa3342bf8bfd55a0abd2de291d1d178ec757 Mon Sep 17 00:00:00 2001 From: Bruno BELANYI Date: Wed, 31 Mar 2021 16:03:24 +0000 Subject: [PATCH 30/61] nix: flake: build package with vanilla 'nixpkgs' --- flake.lock | 39 --------------------------------------- flake.nix | 34 ++++++++++------------------------ 2 files changed, 10 insertions(+), 63 deletions(-) diff --git a/flake.lock b/flake.lock index c0cf2ff..fba4758 100644 --- a/flake.lock +++ b/flake.lock @@ -31,43 +31,6 @@ "type": "github" } }, - "mozillapkgs": { - "flake": false, - "locked": { - "lastModified": 1603906276, - "narHash": "sha256-RsNPnEKd7BcogwkqhaV5kI/HuNC4flH/OQCC/4W5y/8=", - "owner": "mozilla", - "repo": "nixpkgs-mozilla", - "rev": "8c007b60731c07dd7a052cce508de3bb1ae849b4", - "type": "github" - }, - "original": { - "owner": "mozilla", - "repo": "nixpkgs-mozilla", - "type": "github" - } - }, - "naersk": { - "inputs": { - "nixpkgs": [ - "nixpkgs" - ] - }, - "locked": { - "lastModified": 1614785451, - "narHash": "sha256-TPw8kQvr2UNCuvndtY+EjyXp6Q5GEW2l9UafXXh1XmI=", - "owner": "nmattia", - "repo": "naersk", - "rev": "e0fe990b478a66178a58c69cf53daec0478ca6f9", - "type": "github" - }, - "original": { - "owner": "nmattia", - "ref": "master", - "repo": "naersk", - "type": "github" - } - }, "nixpkgs": { "locked": { "lastModified": 1616670887, @@ -88,8 +51,6 @@ "inputs": { "flake-compat": "flake-compat", "flake-utils": "flake-utils", - "mozillapkgs": "mozillapkgs", - "naersk": "naersk", "nixpkgs": "nixpkgs" } } diff --git a/flake.nix b/flake.nix index 2b631d1..b87c588 100644 --- a/flake.nix +++ b/flake.nix @@ -1,13 +1,5 @@ { inputs = { - naersk = { - url = "github:nmattia/naersk/master"; - inputs.nixpkgs.follows = "nixpkgs"; - }; - mozillapkgs = { - url = "github:mozilla/nixpkgs-mozilla"; - flake = false; - }; nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable"; flake-utils.url = "github:numtide/flake-utils"; flake-compat = { @@ -16,27 +8,19 @@ }; }; - outputs = { self, naersk, mozillapkgs, nixpkgs, flake-utils, ... }: + outputs = { self, nixpkgs, flake-utils, ... }: flake-utils.lib.eachDefaultSystem (system: let pkgs = import nixpkgs { inherit system; }; - - mozilla = pkgs.callPackage (mozillapkgs + "/package-set.nix") { }; - rustNightly = (mozilla.rustChannelOf { - date = "2021-03-29"; - channel = "nightly"; - sha256 = "sha256-Y94CnslybZgiZlNVV6Cg0TUPV2OeDXakPev1kqdt9Kk="; - }).rust; - - naersk-lib = pkgs.callPackage naersk { - cargo = rustNightly; - rustc = rustNightly; - }; in { - defaultPackage = naersk-lib.buildPackage { - src = ./.; + defaultPackage = pkgs.rustPlatform.buildRustPackage { pname = "lohr"; + version = "0.3.1"; + + src = ./.; + + cargoSha256 = "sha256-XnBvb13Pv7bNTLCL3WV+bxRK0/uMEKA1/Bk0Tfua3Rs="; meta = with pkgs.lib; { description = "A Git mirroring tool"; @@ -52,10 +36,12 @@ devShell = pkgs.mkShell { buildInputs = with pkgs; [ + cargo + clippy nixpkgs-fmt pre-commit rustPackages.clippy - rustNightly + rustc rustfmt ]; From 776876233f48d431c73200f875e0118a911dcfc5 Mon Sep 17 00:00:00 2001 From: Antoine Martin Date: Thu, 8 Apr 2021 01:46:52 +0200 Subject: [PATCH 31/61] gitea: use ssh_url instead of clone_url Fixes #2 --- src/gitea.rs | 2 +- src/job.rs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/gitea.rs b/src/gitea.rs index e4826e5..eae1528 100644 --- a/src/gitea.rs +++ b/src/gitea.rs @@ -4,7 +4,7 @@ use serde::Deserialize; pub(crate) struct Repository { pub(crate) name: String, pub(crate) full_name: String, - pub(crate) clone_url: String, + pub(crate) ssh_url: String, } #[derive(Deserialize)] diff --git a/src/job.rs b/src/job.rs index 2e91cf1..0e386c4 100644 --- a/src/job.rs +++ b/src/job.rs @@ -38,7 +38,7 @@ impl Job { let output = Command::new("git") .arg("clone") .arg("--mirror") - .arg(&self.repo.clone_url) + .arg(&self.repo.ssh_url) .arg(format!("{}", self.local_path.as_ref().unwrap().display())) .output()?; From 264b7baccdfc4e6ea669e188ccd74d432c9e0ec6 Mon Sep 17 00:00:00 2001 From: Antoine Martin Date: Thu, 8 Apr 2021 01:51:07 +0200 Subject: [PATCH 32/61] cargo: bump dependencies --- Cargo.lock | 38 +++++++++++++++++++------------------- Cargo.toml | 2 +- 2 files changed, 20 insertions(+), 20 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index d4cb064..01c4c93 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -241,9 +241,9 @@ dependencies = [ [[package]] name = "figment" -version = "0.10.4" +version = "0.10.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "708a94ecb9ca72e347442fef4563e459035b950c78091a355ed8a40180b33367" +checksum = "0ca029e813a72b7526d28273d25f3e4a2f365d1b7a1018a6f93ec9053a119763" dependencies = [ "atomic", "pear", @@ -443,9 +443,9 @@ dependencies = [ [[package]] name = "http" -version = "0.2.3" +version = "0.2.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7245cd7449cc792608c3c8a9eaf69bd4eabbabf802713748fd739c98b82f0747" +checksum = "527e8c9ac747e28542699a951517aa9a6945af506cd1f2e1b53a576c17b6cc11" dependencies = [ "bytes", "fnv", @@ -465,9 +465,9 @@ dependencies = [ [[package]] name = "httparse" -version = "1.3.5" +version = "1.3.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "615caabe2c3160b313d52ccc905335f4ed5f10881dd63dc5699d47e90be85691" +checksum = "bc35c995b9d93ec174cf9a27d425c7892722101e14993cd227fdb51d70cf9589" [[package]] name = "httpdate" @@ -539,9 +539,9 @@ checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" [[package]] name = "libc" -version = "0.2.92" +version = "0.2.93" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "56d855069fafbb9b344c0f962150cd2c1187975cb1c22c1522c240d8c4986714" +checksum = "9385f66bf6105b241aa65a61cb923ef20efc665cb9f9bb50ac2f0c4b7f378d41" [[package]] name = "linked-hash-map" @@ -551,9 +551,9 @@ checksum = "7fb9b38af92608140b86b693604b9ffcc5824240a484d1ecd4795bacb2fe88f3" [[package]] name = "lock_api" -version = "0.4.2" +version = "0.4.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dd96ffd135b2fd7b973ac026d28085defbe8983df057ced3eb4f2130b0831312" +checksum = "5a3c91c24eae6777794bb1997ad98bbb87daf92890acab859f7eaa4320333176" dependencies = [ "scopeguard", ] @@ -788,9 +788,9 @@ checksum = "bc881b2c22681370c6a780e47af9840ef841837bc98118431d4e1868bd0c1086" [[package]] name = "proc-macro2" -version = "1.0.24" +version = "1.0.26" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1e0704ee1a7e00d7bb417d0770ea303c1bccbabf0ef1667dae92b5967f5f8a71" +checksum = "a152013215dca273577e18d2bf00fa862b89b24169fb78c4c95aeb07992c9cec" dependencies = [ "unicode-xid", ] @@ -915,7 +915,7 @@ dependencies = [ [[package]] name = "rocket" version = "0.5.0-dev" -source = "git+https://github.com/SergioBenitez/Rocket?rev=2893ce754d6535e0a752586e60d7e292343016c0#2893ce754d6535e0a752586e60d7e292343016c0" +source = "git+https://github.com/SergioBenitez/Rocket?rev=8d4d01106e2e10b08100805d40bfa19a7357e900#8d4d01106e2e10b08100805d40bfa19a7357e900" dependencies = [ "async-trait", "atomic", @@ -948,7 +948,7 @@ dependencies = [ [[package]] name = "rocket_codegen" version = "0.5.0-dev" -source = "git+https://github.com/SergioBenitez/Rocket?rev=2893ce754d6535e0a752586e60d7e292343016c0#2893ce754d6535e0a752586e60d7e292343016c0" +source = "git+https://github.com/SergioBenitez/Rocket?rev=8d4d01106e2e10b08100805d40bfa19a7357e900#8d4d01106e2e10b08100805d40bfa19a7357e900" dependencies = [ "devise", "glob", @@ -961,7 +961,7 @@ dependencies = [ [[package]] name = "rocket_http" version = "0.5.0-dev" -source = "git+https://github.com/SergioBenitez/Rocket?rev=2893ce754d6535e0a752586e60d7e292343016c0#2893ce754d6535e0a752586e60d7e292343016c0" +source = "git+https://github.com/SergioBenitez/Rocket?rev=8d4d01106e2e10b08100805d40bfa19a7357e900#8d4d01106e2e10b08100805d40bfa19a7357e900" dependencies = [ "cookie", "either", @@ -1219,9 +1219,9 @@ checksum = "1e81da0851ada1f3e9d4312c704aa4f8806f0f9d69faaf8df2f3464b4a9437c2" [[package]] name = "syn" -version = "1.0.67" +version = "1.0.68" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6498a9efc342871f91cc2d0d694c674368b4ceb40f62b65a7a08c3792935e702" +checksum = "3ce15dd3ed8aa2f8eeac4716d6ef5ab58b6b9256db41d7e1a0224c2788e8fd87" dependencies = [ "proc-macro2", "quote", @@ -1401,9 +1401,9 @@ dependencies = [ [[package]] name = "uncased" -version = "0.9.5" +version = "0.9.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "300932469d646d39929ffe84ad5c1837beecf602519ef5695e485b472de4082b" +checksum = "5baeed7327e25054889b9bd4f975f32e5f4c5d434042d59ab6cd4142c0a76ed0" dependencies = [ "serde", "version_check", diff --git a/Cargo.toml b/Cargo.toml index e628958..788e06d 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -33,4 +33,4 @@ version = "2.33.3" default-features = false [patch.crates-io] -rocket = { git = "https://github.com/SergioBenitez/Rocket", rev = "2893ce754d6535e0a752586e60d7e292343016c0" } +rocket = { git = "https://github.com/SergioBenitez/Rocket", rev = "8d4d01106e2e10b08100805d40bfa19a7357e900" } From 6c4a496ede8d7209be13d2bd597eef0789992fc3 Mon Sep 17 00:00:00 2001 From: Antoine Martin Date: Thu, 8 Apr 2021 01:53:22 +0200 Subject: [PATCH 33/61] lohr: v0.4.0 This is the first lohr release that compiles on stable Rust, yay! --- Cargo.lock | 2 +- Cargo.toml | 2 +- flake.nix | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 01c4c93..365f914 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -569,7 +569,7 @@ dependencies = [ [[package]] name = "lohr" -version = "0.3.3" +version = "0.4.0" dependencies = [ "anyhow", "clap", diff --git a/Cargo.toml b/Cargo.toml index 788e06d..83eefef 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "lohr" -version = "0.3.3" +version = "0.4.0" authors = ["Antoine Martin "] edition = "2018" license = "Apache-2.0 OR MIT" diff --git a/flake.nix b/flake.nix index b87c588..cc866ad 100644 --- a/flake.nix +++ b/flake.nix @@ -16,11 +16,11 @@ { defaultPackage = pkgs.rustPlatform.buildRustPackage { pname = "lohr"; - version = "0.3.1"; + version = "0.4.0"; src = ./.; - cargoSha256 = "sha256-XnBvb13Pv7bNTLCL3WV+bxRK0/uMEKA1/Bk0Tfua3Rs="; + cargoSha256 = "sha256-5a2mK+E6LlR5RHDAhHDvnfPNG+0JdvpnL4kuTiz7vVg="; meta = with pkgs.lib; { description = "A Git mirroring tool"; From bc32f8a565faa2055c1bbfa8c2353ce4738208b2 Mon Sep 17 00:00:00 2001 From: Antoine Martin Date: Thu, 8 Apr 2021 01:57:55 +0200 Subject: [PATCH 34/61] README: add note about missing versions on crates.io --- README.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/README.md b/README.md index 7a0b30f..57ac61d 100644 --- a/README.md +++ b/README.md @@ -28,6 +28,10 @@ install it with `cargo install`: $ cargo install lohr +Note: currently this method won't get you the latest version of `lohr`, as it +depends on Rocket v0.5.0, which isn't released yet. Updated versions of `lohr` +will be published on crates.io as soon as Rocket v0.5.0 releases. + ## Setup ### Quickstart From d942dc1098a7d516982c751ce51296dc96f30262 Mon Sep 17 00:00:00 2001 From: Antoine Martin Date: Thu, 8 Apr 2021 04:05:49 +0200 Subject: [PATCH 35/61] ci: setup cachix build --- .github/workflows/cachix.yaml | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 .github/workflows/cachix.yaml diff --git a/.github/workflows/cachix.yaml b/.github/workflows/cachix.yaml new file mode 100644 index 0000000..3edb139 --- /dev/null +++ b/.github/workflows/cachix.yaml @@ -0,0 +1,19 @@ +name: "Cachix build" +on: [push] +jobs: + build: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2.3.4 + - uses: cachix/install-nix-action@v13 + with: + install_url: https://nixos-nix-install-tests.cachix.org/serve/lb41az54kzk6j12p81br4bczary7m145/install + install_options: '--tarball-url-prefix https://nixos-nix-install-tests.cachix.org/serve' + extra_nix_config: | + experimental-features = nix-command flakes + - uses: cachix/cachix-action@v8 + with: + name: alarsyo + authToken: '${{ secrets.CACHIX_AUTH_TOKEN }}' + - run: | + nix build --verbose From fd50523f11d44a9b9bd9ff69081b369400d277db Mon Sep 17 00:00:00 2001 From: Antoine Martin Date: Fri, 4 Jun 2021 15:58:00 +0200 Subject: [PATCH 36/61] flake.lock: Update Flake input changes: * Updated 'nixpkgs': 'github:NixOS/nixpkgs/c0e881852006b132236cbf0301bd1939bb50867e' -> 'github:NixOS/nixpkgs/7db379d016a9bad7b7da9b81103ab7454faa3344' --- flake.lock | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/flake.lock b/flake.lock index fba4758..fa6cef0 100644 --- a/flake.lock +++ b/flake.lock @@ -33,11 +33,11 @@ }, "nixpkgs": { "locked": { - "lastModified": 1616670887, - "narHash": "sha256-wn+l9qJfR5sj5Gq4DheJHAcBDfOs9K2p9seW2f35xzs=", + "lastModified": 1622653502, + "narHash": "sha256-GEuSmSdxSTJO7tZ9i3c+Jou+X9RSo6DC/SEEY997r3I=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "c0e881852006b132236cbf0301bd1939bb50867e", + "rev": "7db379d016a9bad7b7da9b81103ab7454faa3344", "type": "github" }, "original": { From 1f6fe74d03730d6e466ce8379f8165a33528f623 Mon Sep 17 00:00:00 2001 From: Antoine Martin Date: Fri, 4 Jun 2021 17:31:00 +0200 Subject: [PATCH 37/61] lohr: upgrade to latest Rocket master --- Cargo.lock | 285 ++++++++++++++++++++++++++++------------------- Cargo.toml | 3 +- src/main.rs | 6 +- src/signature.rs | 4 +- 4 files changed, 175 insertions(+), 123 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 365f914..32b7de6 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -4,9 +4,9 @@ version = 3 [[package]] name = "aho-corasick" -version = "0.7.15" +version = "0.7.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7404febffaa47dac81aa44dba71523c9d069b1bdc50a77db41195149e17f68e5" +checksum = "1e37cfd5e7657ada45f742d6e99ca5788580b5c529dc78faf11ece6dc702656f" dependencies = [ "memchr", ] @@ -18,10 +18,31 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "28b2cd92db5cbd74e8e5028f7e27dd7aa3090e89e4f2a197cc7c8dfb69c7063b" [[package]] -name = "async-trait" -version = "0.1.48" +name = "async-stream" +version = "0.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "36ea56748e10732c49404c153638a15ec3d6211ec5ff35d9bb20e13b93576adf" +checksum = "171374e7e3b2504e0e5236e3b59260560f9fe94bfe9ac39ba5e4e929c5590625" +dependencies = [ + "async-stream-impl", + "futures-core", +] + +[[package]] +name = "async-stream-impl" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "648ed8c8d2ce5409ccd57453d9d1b214b342a0d69376a6feda1fd6cae3299308" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "async-trait" +version = "0.1.50" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0b98e84bbb4cbcdd97da190ba0c58a1bb0de2c1fdf67d159e192ed766aeca722" dependencies = [ "proc-macro2", "quote", @@ -83,9 +104,9 @@ dependencies = [ [[package]] name = "bumpalo" -version = "3.6.1" +version = "3.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "63396b8a4b9de3f4fdfb320ab6080762242f66a8ef174c49d8e19b674db4cdbe" +checksum = "9c59e7af012c713f529e7a3ee57ce9b31ddd858d4b512923602f74608b009631" [[package]] name = "bytes" @@ -95,9 +116,9 @@ checksum = "b700ce4376041dcd0a327fd0097c41095743c4c8af8887265942faf1100bd040" [[package]] name = "cc" -version = "1.0.67" +version = "1.0.68" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e3c69b077ad434294d3ce9f1f6143a2a4b89a8a2d54ef813d85003a4fd1137fd" +checksum = "4a72c244c1ff497a746a7e1fb3d14bd08420ecda70c8f25c7112f2781652d787" [[package]] name = "cfg-if" @@ -124,9 +145,9 @@ dependencies = [ [[package]] name = "const_fn" -version = "0.4.6" +version = "0.4.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "076a6803b0dacd6a88cfe64deba628b01533ff5ef265687e6938280c1afd0a28" +checksum = "f92cfa0fd5690b3cf8c1ef2cabbd9b7ef22fa53cf5e1f92b05103f6d5d1cf6e7" [[package]] name = "convert_case" @@ -146,10 +167,13 @@ dependencies = [ ] [[package]] -name = "cpuid-bool" -version = "0.1.2" +name = "cpufeatures" +version = "0.1.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8aebca1129a03dc6dc2b127edd729435bbc4a37e1d5f4d7513165089ceb02634" +checksum = "ed00c67cb5d0a7d64a44f6ad2668db7e7530311dd53ea79bcd4fb022c64911c8" +dependencies = [ + "libc", +] [[package]] name = "crypto-mac" @@ -163,9 +187,9 @@ dependencies = [ [[package]] name = "derive_more" -version = "0.99.13" +version = "0.99.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f82b1b72f1263f214c0f823371768776c4f5841b942c9883aa8e5ec584fd0ba6" +checksum = "5cc7b9cef1e351660e5443924e4f43ab25fbbed3e9a5f052df3677deb4d6b320" dependencies = [ "convert_case", "proc-macro2", @@ -176,7 +200,7 @@ dependencies = [ [[package]] name = "devise" version = "0.3.0" -source = "git+https://github.com/SergioBenitez/Devise.git?rev=3ebe83#3ebe83823241c7979e6d2ccd18f889968a01985f" +source = "git+https://github.com/SergioBenitez/Devise.git?rev=f2431b#f2431bd122f55b03c3bc5b1c8d2267894d3c8142" dependencies = [ "devise_codegen", "devise_core", @@ -185,7 +209,7 @@ dependencies = [ [[package]] name = "devise_codegen" version = "0.3.0" -source = "git+https://github.com/SergioBenitez/Devise.git?rev=3ebe83#3ebe83823241c7979e6d2ccd18f889968a01985f" +source = "git+https://github.com/SergioBenitez/Devise.git?rev=f2431b#f2431bd122f55b03c3bc5b1c8d2267894d3c8142" dependencies = [ "devise_core", "quote", @@ -194,7 +218,7 @@ dependencies = [ [[package]] name = "devise_core" version = "0.3.0" -source = "git+https://github.com/SergioBenitez/Devise.git?rev=3ebe83#3ebe83823241c7979e6d2ccd18f889968a01985f" +source = "git+https://github.com/SergioBenitez/Devise.git?rev=f2431b#f2431bd122f55b03c3bc5b1c8d2267894d3c8142" dependencies = [ "bitflags", "proc-macro2", @@ -261,9 +285,9 @@ checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" [[package]] name = "futures" -version = "0.3.13" +version = "0.3.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7f55667319111d593ba876406af7c409c0ebb44dc4be6132a783ccf163ea14c1" +checksum = "0e7e43a803dae2fa37c1f6a8fe121e1f7bf9548b4dfc0522a42f34145dadfc27" dependencies = [ "futures-channel", "futures-core", @@ -276,9 +300,9 @@ dependencies = [ [[package]] name = "futures-channel" -version = "0.3.13" +version = "0.3.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8c2dd2df839b57db9ab69c2c9d8f3e8c81984781937fe2807dc6dcf3b2ad2939" +checksum = "e682a68b29a882df0545c143dc3646daefe80ba479bcdede94d5a703de2871e2" dependencies = [ "futures-core", "futures-sink", @@ -286,15 +310,15 @@ dependencies = [ [[package]] name = "futures-core" -version = "0.3.13" +version = "0.3.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "15496a72fabf0e62bdc3df11a59a3787429221dd0710ba8ef163d6f7a9112c94" +checksum = "0402f765d8a89a26043b889b26ce3c4679d268fa6bb22cd7c6aad98340e179d1" [[package]] name = "futures-executor" -version = "0.3.13" +version = "0.3.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "891a4b7b96d84d5940084b2a37632dd65deeae662c114ceaa2c879629c9c0ad1" +checksum = "badaa6a909fac9e7236d0620a2f57f7664640c56575b71a7552fbd68deafab79" dependencies = [ "futures-core", "futures-task", @@ -303,16 +327,17 @@ dependencies = [ [[package]] name = "futures-io" -version = "0.3.13" +version = "0.3.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d71c2c65c57704c32f5241c1223167c2c3294fd34ac020c807ddbe6db287ba59" +checksum = "acc499defb3b348f8d8f3f66415835a9131856ff7714bf10dadfc4ec4bdb29a1" [[package]] name = "futures-macro" -version = "0.3.13" +version = "0.3.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ea405816a5139fb39af82c2beb921d52143f556038378d6db21183a5c37fbfb7" +checksum = "a4c40298486cdf52cc00cd6d6987892ba502c7656a16a4192a9992b1ccedd121" dependencies = [ + "autocfg", "proc-macro-hack", "proc-macro2", "quote", @@ -321,22 +346,23 @@ dependencies = [ [[package]] name = "futures-sink" -version = "0.3.13" +version = "0.3.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "85754d98985841b7d4f5e8e6fbfa4a4ac847916893ec511a2917ccd8525b8bb3" +checksum = "a57bead0ceff0d6dde8f465ecd96c9338121bb7717d3e7b108059531870c4282" [[package]] name = "futures-task" -version = "0.3.13" +version = "0.3.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fa189ef211c15ee602667a6fcfe1c1fd9e07d42250d2156382820fba33c9df80" +checksum = "8a16bef9fc1a4dddb5bee51c989e3fbba26569cbb0e31f5b303c184e3dd33dae" [[package]] name = "futures-util" -version = "0.3.13" +version = "0.3.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1812c7ab8aedf8d6f2701a43e1243acdbcc2b36ab26e2ad421eb99ac963d96d1" +checksum = "feb5c238d27e2bf94ffdfd27b2c29e3df4a68c4193bb6427384259e2bf191967" dependencies = [ + "autocfg", "futures-channel", "futures-core", "futures-io", @@ -376,9 +402,9 @@ dependencies = [ [[package]] name = "getrandom" -version = "0.2.2" +version = "0.2.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c9495705279e7140bf035dde1f6e750c162df8b625267cd52cc44e0b156732c8" +checksum = "7fcd999463524c52659517fe2cea98493cfe485d10565e7b0fb07dbba7ad2753" dependencies = [ "cfg-if 1.0.0", "libc", @@ -393,9 +419,9 @@ checksum = "9b919933a397b79c37e33b77bb2aa3dc8eb6e165ad809e58ff75bc7db2e34574" [[package]] name = "h2" -version = "0.3.2" +version = "0.3.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fc018e188373e2777d0ef2467ebff62a08e66c3f5857b23c8fbec3018210dc00" +checksum = "825343c4eef0b63f541f8903f395dc5beb362a979b5799a84062527ef1e37726" dependencies = [ "bytes", "fnv", @@ -454,9 +480,9 @@ dependencies = [ [[package]] name = "http-body" -version = "0.4.1" +version = "0.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5dfb77c123b4e2f72a2069aeae0b4b4949cc7e966df277813fc16347e7549737" +checksum = "60daa14be0e0786db0f03a9e57cb404c9d756eed2b6c62b9ea98ec5743ec75a9" dependencies = [ "bytes", "http", @@ -465,21 +491,21 @@ dependencies = [ [[package]] name = "httparse" -version = "1.3.6" +version = "1.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bc35c995b9d93ec174cf9a27d425c7892722101e14993cd227fdb51d70cf9589" +checksum = "f3a87b616e37e93c22fb19bcd386f02f3af5ea98a25670ad0fce773de23c5e68" [[package]] name = "httpdate" -version = "0.3.2" +version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "494b4d60369511e7dea41cf646832512a94e542f68bb9c49e54518e0f468eb47" +checksum = "6456b8a6c8f33fee7d958fcd1b60d55b11940a79e63ae87013e6d22e26034440" [[package]] name = "hyper" -version = "0.14.5" +version = "0.14.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8bf09f61b52cfcf4c00de50df88ae423d6c02354e385a86341133b5338630ad1" +checksum = "d3f71a7eea53a3f8257a7b4795373ff886397178cd634430ea94e12d7fe4fe34" dependencies = [ "bytes", "futures-channel", @@ -539,9 +565,9 @@ checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" [[package]] name = "libc" -version = "0.2.93" +version = "0.2.95" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9385f66bf6105b241aa65a61cb923ef20efc665cb9f9bb50ac2f0c4b7f378d41" +checksum = "789da6d93f1b866ffe175afc5322a4d76c038605a1c3319bb57b06967ca98a36" [[package]] name = "linked-hash-map" @@ -551,9 +577,9 @@ checksum = "7fb9b38af92608140b86b693604b9ffcc5824240a484d1ecd4795bacb2fe88f3" [[package]] name = "lock_api" -version = "0.4.3" +version = "0.4.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5a3c91c24eae6777794bb1997ad98bbb87daf92890acab859f7eaa4320333176" +checksum = "0382880606dff6d15c9476c416d18690b72742aa7b605bb6dd6ec9030fbf07eb" dependencies = [ "scopeguard", ] @@ -600,9 +626,9 @@ dependencies = [ [[package]] name = "memchr" -version = "2.3.4" +version = "2.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0ee1c47aaa256ecabcaea351eae4a9b01ef39ed810004e298d2511ed284b1525" +checksum = "b16bd47d9e329435e309c58469fe0791c2d0d1ba96ec0954152a5ae2b04387dc" [[package]] name = "mime" @@ -634,8 +660,9 @@ dependencies = [ [[package]] name = "multer" -version = "1.2.2" -source = "git+https://github.com/rousan/multer-rs.git?rev=7e4f0c5f#7e4f0c5fe14e4c531f503922bfe04f68b32ddf17" +version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0fdd568fea4758b30d6423f013f7171e193c34aa97828d1bd9f924fb3af30a8c" dependencies = [ "bytes", "derive_more", @@ -645,6 +672,7 @@ dependencies = [ "httparse", "log", "mime", + "spin", "tokio", "tokio-util", "twoway", @@ -709,9 +737,9 @@ dependencies = [ [[package]] name = "pear" -version = "0.2.2" +version = "0.2.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "86ab3a2b792945ed67eadbbdcbd2898f8dd2319392b2a45ac21adea5245cb113" +checksum = "15e44241c5e4c868e3eaa78b7c1848cadd6344ed4f54d029832d32b415a58702" dependencies = [ "inlinable_string", "pear_codegen", @@ -720,9 +748,9 @@ dependencies = [ [[package]] name = "pear_codegen" -version = "0.2.2" +version = "0.2.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "620c9c4776ba41b59ab101360c9b1419c0c8c81cd2e6e39fae7109e7425994cb" +checksum = "82a5ca643c2303ecb740d506539deba189e16f2754040a42901cd8105d0282d0" dependencies = [ "proc-macro2", "proc-macro2-diagnostics", @@ -738,18 +766,18 @@ checksum = "d4fd5641d01c8f18a23da7b6fe29298ff4b55afcccdf78973b24cf3175fee32e" [[package]] name = "pin-project" -version = "1.0.6" +version = "1.0.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bc174859768806e91ae575187ada95c91a29e96a98dc5d2cd9a1fed039501ba6" +checksum = "c7509cc106041c40a4518d2af7a61530e1eed0e6285296a3d8c5472806ccc4a4" dependencies = [ "pin-project-internal", ] [[package]] name = "pin-project-internal" -version = "1.0.6" +version = "1.0.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a490329918e856ed1b083f244e3bfe2d8c4f336407e4ea9e1a9f479ff09049e5" +checksum = "48c950132583b500556b1efd71d45b319029f2b71518d979fcc208e16b42426f" dependencies = [ "proc-macro2", "quote", @@ -788,9 +816,9 @@ checksum = "bc881b2c22681370c6a780e47af9840ef841837bc98118431d4e1868bd0c1086" [[package]] name = "proc-macro2" -version = "1.0.26" +version = "1.0.27" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a152013215dca273577e18d2bf00fa862b89b24169fb78c4c95aeb07992c9cec" +checksum = "f0d8caf72986c1a598726adc988bb5984792ef84f5ee5aa50209145ee8077038" dependencies = [ "unicode-xid", ] @@ -859,9 +887,9 @@ dependencies = [ [[package]] name = "redox_syscall" -version = "0.2.5" +version = "0.2.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "94341e4e44e24f6b591b59e47a8a027df12e008d73fd5672dbea9cc22f4507d9" +checksum = "742739e41cd49414de871ea5e549afb7e2a3ac77b589bcbebe8c82fab37147fc" dependencies = [ "bitflags", ] @@ -888,9 +916,9 @@ dependencies = [ [[package]] name = "regex" -version = "1.4.5" +version = "1.5.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "957056ecddbeba1b26965114e191d2e8589ce74db242b6ea25fc4062427a5c19" +checksum = "d07a8629359eb56f1e2fb1652bb04212c072a87ba68546a04065d525673ac461" dependencies = [ "aho-corasick", "memchr", @@ -899,9 +927,9 @@ dependencies = [ [[package]] name = "regex-syntax" -version = "0.6.23" +version = "0.6.25" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "24d5f089152e60f62d28b835fbff2cd2e8dc0baf1ac13343bef92ab7eed84548" +checksum = "f497285884f3fcff424ffc933e56d7cbca511def0c9831a7f9b5f6153e3cc89b" [[package]] name = "remove_dir_all" @@ -915,12 +943,14 @@ dependencies = [ [[package]] name = "rocket" version = "0.5.0-dev" -source = "git+https://github.com/SergioBenitez/Rocket?rev=8d4d01106e2e10b08100805d40bfa19a7357e900#8d4d01106e2e10b08100805d40bfa19a7357e900" +source = "git+https://github.com/SergioBenitez/Rocket?rev=0d53e23bf6cb86f9136fa8b37a92ba8076aacf67#0d53e23bf6cb86f9136fa8b37a92ba8076aacf67" dependencies = [ + "async-stream", "async-trait", "atomic", "atty", "binascii", + "bytes", "either", "figment", "futures", @@ -940,6 +970,8 @@ dependencies = [ "tempfile", "time", "tokio", + "tokio-stream", + "tokio-util", "ubyte", "version_check", "yansi", @@ -948,20 +980,22 @@ dependencies = [ [[package]] name = "rocket_codegen" version = "0.5.0-dev" -source = "git+https://github.com/SergioBenitez/Rocket?rev=8d4d01106e2e10b08100805d40bfa19a7357e900#8d4d01106e2e10b08100805d40bfa19a7357e900" +source = "git+https://github.com/SergioBenitez/Rocket?rev=0d53e23bf6cb86f9136fa8b37a92ba8076aacf67#0d53e23bf6cb86f9136fa8b37a92ba8076aacf67" dependencies = [ "devise", "glob", "indexmap", + "proc-macro2", "quote", "rocket_http", + "syn", "unicode-xid", ] [[package]] name = "rocket_http" version = "0.5.0-dev" -source = "git+https://github.com/SergioBenitez/Rocket?rev=8d4d01106e2e10b08100805d40bfa19a7357e900#8d4d01106e2e10b08100805d40bfa19a7357e900" +source = "git+https://github.com/SergioBenitez/Rocket?rev=0d53e23bf6cb86f9136fa8b37a92ba8076aacf67#0d53e23bf6cb86f9136fa8b37a92ba8076aacf67" dependencies = [ "cookie", "either", @@ -996,9 +1030,9 @@ dependencies = [ [[package]] name = "rustversion" -version = "1.0.4" +version = "1.0.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cb5d2a036dc6d2d8fd16fde3498b04306e29bd193bf306a57427019b823d5acd" +checksum = "61b3909d758bb75c79f23d4736fac9433868679d3ad2ea7a61e3c25cfda9a088" [[package]] name = "ryu" @@ -1035,18 +1069,18 @@ checksum = "388a1df253eca08550bef6c72392cfe7c30914bf41df5269b68cbd6ff8f570a3" [[package]] name = "serde" -version = "1.0.125" +version = "1.0.126" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "558dc50e1a5a5fa7112ca2ce4effcb321b0300c0d4ccf0776a9f60cd89031171" +checksum = "ec7505abeacaec74ae4778d9d9328fe5a5d04253220a85c4ee022239fc996d03" dependencies = [ "serde_derive", ] [[package]] name = "serde_derive" -version = "1.0.125" +version = "1.0.126" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b093b7a2bb58203b5da3056c05b4ec1fed827dcfdb37347a8841695263b3d06d" +checksum = "963a7dbc9895aeac7ac90e74f34a5d5261828f79df35cbed41e10189d3804d43" dependencies = [ "proc-macro2", "quote", @@ -1094,31 +1128,31 @@ checksum = "2579985fda508104f7587689507983eadd6a6e84dd35d6d115361f530916fa0d" [[package]] name = "sha2" -version = "0.9.3" +version = "0.9.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fa827a14b29ab7f44778d14a88d3cb76e949c45083f7dbfa507d0cb699dc12de" +checksum = "b362ae5752fd2137731f9fa25fd4d9058af34666ca1966fb969119cc35719f12" dependencies = [ "block-buffer", "cfg-if 1.0.0", - "cpuid-bool", + "cpufeatures", "digest", "opaque-debug", ] [[package]] name = "signal-hook-registry" -version = "1.3.0" +version = "1.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "16f1d0fef1604ba8f7a073c7e701f213e056707210e9020af4528e0101ce11a6" +checksum = "e51e73328dc4ac0c7ccbda3a494dfa03df1de2f46018127f60c693f2648455b0" dependencies = [ "libc", ] [[package]] name = "slab" -version = "0.4.2" +version = "0.4.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c111b5bd5695e56cffe5129854aa230b39c93a305372fdbb2668ca2394eea9f8" +checksum = "f173ac3d1a7e3b28003f40de0b5ce7fe2710f9b9dc3fc38664cebee46b3b6527" [[package]] name = "smallvec" @@ -1136,6 +1170,12 @@ dependencies = [ "winapi", ] +[[package]] +name = "spin" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b87bbf98cb81332a56c1ee8929845836f85e8ddd693157c30d76660196014478" + [[package]] name = "stable-pattern" version = "0.1.0" @@ -1157,7 +1197,7 @@ dependencies = [ [[package]] name = "state" version = "0.4.2" -source = "git+https://github.com/SergioBenitez/state.git?rev=504ef71a#504ef71ae39310107a5ebad5f23c6e4c8c9b3ae9" +source = "git+https://github.com/SergioBenitez/state.git?rev=8f94dc#8f94dce673b7d4b0e7b96c808a84f5e2a4be4a60" dependencies = [ "loom", ] @@ -1219,9 +1259,9 @@ checksum = "1e81da0851ada1f3e9d4312c704aa4f8806f0f9d69faaf8df2f3464b4a9437c2" [[package]] name = "syn" -version = "1.0.68" +version = "1.0.72" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3ce15dd3ed8aa2f8eeac4716d6ef5ab58b6b9256db41d7e1a0224c2788e8fd87" +checksum = "a1e8cdbefb79a9a5a65e0db8b47b723ee907b7c7f8496c76a1770b5c310bab82" dependencies = [ "proc-macro2", "quote", @@ -1291,9 +1331,9 @@ dependencies = [ [[package]] name = "tokio" -version = "1.4.0" +version = "1.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "134af885d758d645f0f0505c9a8b3f9bf8a348fd822e112ab5248138348f1722" +checksum = "0a38d31d7831c6ed7aad00aa4c12d9375fd225a6dd77da1d25b707346319a975" dependencies = [ "autocfg", "bytes", @@ -1310,9 +1350,9 @@ dependencies = [ [[package]] name = "tokio-macros" -version = "1.1.0" +version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "caf7b11a536f46a809a8a9f0bb4237020f70ecbf115b842360afb127ea2fda57" +checksum = "c49e3df43841dafb86046472506755d8501c5615673955f6aa17181125d13c37" dependencies = [ "proc-macro2", "quote", @@ -1320,10 +1360,21 @@ dependencies = [ ] [[package]] -name = "tokio-util" -version = "0.6.5" +name = "tokio-stream" +version = "0.1.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5143d049e85af7fbc36f5454d990e62c2df705b3589f123b71f441b6b59f443f" +checksum = "f8864d706fdb3cc0843a49647ac892720dac98a6eeb818b77190592cf4994066" +dependencies = [ + "futures-core", + "pin-project-lite", + "tokio", +] + +[[package]] +name = "tokio-util" +version = "0.6.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1caa0b0c8d94a049db56b5acf8cba99dc0623aab1b26d5b5f5e2d945846b3592" dependencies = [ "bytes", "futures-core", @@ -1350,9 +1401,9 @@ checksum = "360dfd1d6d30e05fda32ace2c8c70e9c0a9da713275777f5a4dbb8a1893930c6" [[package]] name = "tracing" -version = "0.1.25" +version = "0.1.26" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "01ebdc2bb4498ab1ab5f5b73c5803825e60199229ccba0698170e3be0e7f959f" +checksum = "09adeb8c97449311ccd28a427f96fb563e7fd31aabf994189879d9da2394b89d" dependencies = [ "cfg-if 1.0.0", "pin-project-lite", @@ -1361,9 +1412,9 @@ dependencies = [ [[package]] name = "tracing-core" -version = "0.1.17" +version = "0.1.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f50de3927f93d202783f4513cda820ab47ef17f624b03c096e86ef00c67e6b5f" +checksum = "a9ff14f98b1a4b289c6248a023c1c2fa1491062964e9fed67ab29c4e4da4a052" dependencies = [ "lazy_static", ] @@ -1376,9 +1427,9 @@ checksum = "59547bce71d9c38b83d9c0e92b6066c4253371f15005def0c30d9657f50c7642" [[package]] name = "twoway" -version = "0.2.1" +version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6b40075910de3a912adbd80b5d8bad6ad10a23eeb1f5bf9d4006839e899ba5bc" +checksum = "c57ffb460d7c24cd6eda43694110189030a3d1dfe418416d9468fd1c1d290b47" dependencies = [ "memchr", "unchecked-index", @@ -1423,9 +1474,9 @@ checksum = "9337591893a19b88d8d87f2cec1e73fad5cdfd10e5a6f349f498ad6ea2ffb1e3" [[package]] name = "unicode-xid" -version = "0.2.1" +version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f7fe0bb3479651439c9112f72b6c505038574c9fbb575ed1bf3b797fa39dd564" +checksum = "8ccb82d61f80a663efe1f787a51b16b5a51e3314d6ac365b08639f52387b33f3" [[package]] name = "version_check" @@ -1451,9 +1502,9 @@ checksum = "fd6fbd9a79829dd1ad0cc20627bf1ed606756a7f77edff7b66b7064f9cb327c6" [[package]] name = "wasm-bindgen" -version = "0.2.73" +version = "0.2.74" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "83240549659d187488f91f33c0f8547cbfef0b2088bc470c116d1d260ef623d9" +checksum = "d54ee1d4ed486f78874278e63e4069fc1ab9f6a18ca492076ffb90c5eb2997fd" dependencies = [ "cfg-if 1.0.0", "wasm-bindgen-macro", @@ -1461,9 +1512,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-backend" -version = "0.2.73" +version = "0.2.74" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ae70622411ca953215ca6d06d3ebeb1e915f0f6613e3b495122878d7ebec7dae" +checksum = "3b33f6a0694ccfea53d94db8b2ed1c3a8a4c86dd936b13b9f0a15ec4a451b900" dependencies = [ "bumpalo", "lazy_static", @@ -1476,9 +1527,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro" -version = "0.2.73" +version = "0.2.74" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3e734d91443f177bfdb41969de821e15c516931c3c3db3d318fa1b68975d0f6f" +checksum = "088169ca61430fe1e58b8096c24975251700e7b1f6fd91cc9d59b04fb9b18bd4" dependencies = [ "quote", "wasm-bindgen-macro-support", @@ -1486,9 +1537,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro-support" -version = "0.2.73" +version = "0.2.74" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d53739ff08c8a68b0fdbcd54c372b8ab800b1449ab3c9d706503bc7dd1621b2c" +checksum = "be2241542ff3d9f241f5e2cb6dd09b37efe786df8851c54957683a49f0987a97" dependencies = [ "proc-macro2", "quote", @@ -1499,9 +1550,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-shared" -version = "0.2.73" +version = "0.2.74" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d9a543ae66aa233d14bb765ed9af4a33e81b8b58d1584cf1b47ff8cd0b9e4489" +checksum = "d7cff876b8f18eed75a66cf49b65e7f967cb354a7aa16003fb55dbfd25b44b4f" [[package]] name = "winapi" diff --git a/Cargo.toml b/Cargo.toml index 83eefef..a8d43e4 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -7,6 +7,7 @@ license = "Apache-2.0 OR MIT" description = "A Git mirroring daemon" homepage = "https://github.com/alarsyo/lohr" repository = "https://github.com/alarsyo/lohr" +resolve = "2" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html @@ -33,4 +34,4 @@ version = "2.33.3" default-features = false [patch.crates-io] -rocket = { git = "https://github.com/SergioBenitez/Rocket", rev = "8d4d01106e2e10b08100805d40bfa19a7357e900" } +rocket = { git = "https://github.com/SergioBenitez/Rocket", rev = "0d53e23bf6cb86f9136fa8b37a92ba8076aacf67" } diff --git a/src/main.rs b/src/main.rs index 46ee9f0..252c2a4 100644 --- a/src/main.rs +++ b/src/main.rs @@ -30,8 +30,8 @@ struct Secret(String); #[post("/", data = "")] fn gitea_webhook( payload: SignedJson, - sender: State, - config: State, + sender: &State, + config: &State, ) -> Status { if config .blacklist @@ -121,7 +121,7 @@ async fn main() -> anyhow::Result<()> { repo_updater(receiver, homedir, config); }); - rocket::ignite() + rocket::build() .mount("/", routes![gitea_webhook]) .manage(JobSender(Mutex::new(sender))) .manage(Secret(secret)) diff --git a/src/signature.rs b/src/signature.rs index 89e0946..4ea30bb 100644 --- a/src/signature.rs +++ b/src/signature.rs @@ -8,7 +8,7 @@ use rocket::{ http::ContentType, State, }; -use rocket::{http::Status, local_cache}; +use rocket::{http::Status, request::local_cache}; use rocket::{Data, Request}; use anyhow::{anyhow, Context}; @@ -100,7 +100,7 @@ where }; let signature = signatures[0]; - let secret = request.guard::>().await.unwrap(); + let secret = request.guard::<&State>().await.unwrap(); if !validate_signature(&secret.0, &signature, &content) { return Outcome::Failure((Status::BadRequest, anyhow!("couldn't verify signature"))); From 5f7d140b616c4e92318ea09f3438ee2dcc061236 Mon Sep 17 00:00:00 2001 From: Antoine Martin Date: Fri, 4 Jun 2021 17:38:37 +0200 Subject: [PATCH 38/61] lohr: v0.4.1 --- Cargo.lock | 2 +- Cargo.toml | 2 +- flake.nix | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 32b7de6..33a7610 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -595,7 +595,7 @@ dependencies = [ [[package]] name = "lohr" -version = "0.4.0" +version = "0.4.1" dependencies = [ "anyhow", "clap", diff --git a/Cargo.toml b/Cargo.toml index a8d43e4..ee7ceb9 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "lohr" -version = "0.4.0" +version = "0.4.1" authors = ["Antoine Martin "] edition = "2018" license = "Apache-2.0 OR MIT" diff --git a/flake.nix b/flake.nix index cc866ad..1df1624 100644 --- a/flake.nix +++ b/flake.nix @@ -16,11 +16,11 @@ { defaultPackage = pkgs.rustPlatform.buildRustPackage { pname = "lohr"; - version = "0.4.0"; + version = "0.4.1"; src = ./.; - cargoSha256 = "sha256-5a2mK+E6LlR5RHDAhHDvnfPNG+0JdvpnL4kuTiz7vVg="; + cargoSha256 = "sha256-cUxUTOp21NzYqmLQc3XmOly0k9xo5wRqsen4iiZfg/Y="; meta = with pkgs.lib; { description = "A Git mirroring tool"; From 7fad5a6a876ee2e4f686b8b37ea433499e029a05 Mon Sep 17 00:00:00 2001 From: Antoine Martin Date: Fri, 4 Jun 2021 17:48:39 +0200 Subject: [PATCH 39/61] github: only trigger cachix build on tag --- .github/workflows/cachix.yaml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.github/workflows/cachix.yaml b/.github/workflows/cachix.yaml index 3edb139..43c658e 100644 --- a/.github/workflows/cachix.yaml +++ b/.github/workflows/cachix.yaml @@ -1,5 +1,8 @@ name: "Cachix build" -on: [push] +on: + push: + tags: + - v* jobs: build: runs-on: ubuntu-latest From b78c486a0ed7cf1ab3dc05d6ab67faea5134b666 Mon Sep 17 00:00:00 2001 From: Antoine Martin Date: Thu, 10 Jun 2021 05:36:39 +0200 Subject: [PATCH 40/61] lohr: upgrade to Rocket v0.5.0-rc.1 --- Cargo.lock | 101 +++++++++++++++++++---------------------------- Cargo.toml | 7 +--- src/signature.rs | 2 +- 3 files changed, 44 insertions(+), 66 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 33a7610..9620fc0 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -120,12 +120,6 @@ version = "1.0.68" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4a72c244c1ff497a746a7e1fb3d14bd08420ecda70c8f25c7112f2781652d787" -[[package]] -name = "cfg-if" -version = "0.1.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4785bdd1c96b2a846b2bd7cc02e86b6b3dbf14e7e53446c4f54c92a361040822" - [[package]] name = "cfg-if" version = "1.0.0" @@ -200,7 +194,8 @@ dependencies = [ [[package]] name = "devise" version = "0.3.0" -source = "git+https://github.com/SergioBenitez/Devise.git?rev=f2431b#f2431bd122f55b03c3bc5b1c8d2267894d3c8142" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "411cf45ac38f00df3679689616649dc12607b846db171780bb790b514a042832" dependencies = [ "devise_codegen", "devise_core", @@ -209,7 +204,8 @@ dependencies = [ [[package]] name = "devise_codegen" version = "0.3.0" -source = "git+https://github.com/SergioBenitez/Devise.git?rev=f2431b#f2431bd122f55b03c3bc5b1c8d2267894d3c8142" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2cf7081f06822f1787e29359354426132cf832cc977d7a8ff747848631462ad1" dependencies = [ "devise_core", "quote", @@ -218,7 +214,8 @@ dependencies = [ [[package]] name = "devise_core" version = "0.3.0" -source = "git+https://github.com/SergioBenitez/Devise.git?rev=f2431b#f2431bd122f55b03c3bc5b1c8d2267894d3c8142" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "80c23631758736875d7ce08f847f296b4001b72cf90878e85b47df7ac5442147" dependencies = [ "bitflags", "proc-macro2", @@ -260,7 +257,7 @@ version = "0.8.28" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "80df024fbc5ac80f87dfef0d9f5209a252f2a497f7f42944cff24d8253cac065" dependencies = [ - "cfg-if 1.0.0", + "cfg-if", ] [[package]] @@ -379,9 +376,9 @@ dependencies = [ [[package]] name = "generator" -version = "0.6.25" +version = "0.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "061d3be1afec479d56fa3bd182bf966c7999ec175fcfdb87ac14d417241366c6" +checksum = "c1d9279ca822891c1a4dae06d185612cf8fc6acfe5dff37781b41297811b12ee" dependencies = [ "cc", "libc", @@ -406,7 +403,7 @@ version = "0.2.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7fcd999463524c52659517fe2cea98493cfe485d10565e7b0fb07dbba7ad2753" dependencies = [ - "cfg-if 1.0.0", + "cfg-if", "libc", "wasi", ] @@ -503,9 +500,9 @@ checksum = "6456b8a6c8f33fee7d958fcd1b60d55b11940a79e63ae87013e6d22e26034440" [[package]] name = "hyper" -version = "0.14.8" +version = "0.14.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d3f71a7eea53a3f8257a7b4795373ff886397178cd634430ea94e12d7fe4fe34" +checksum = "07d6baa1b441335f3ce5098ac421fb6547c46dda735ca1bc6d0153c838f9dd83" dependencies = [ "bytes", "futures-channel", @@ -517,7 +514,7 @@ dependencies = [ "httparse", "httpdate", "itoa", - "pin-project", + "pin-project-lite", "socket2", "tokio", "tower-service", @@ -548,7 +545,7 @@ version = "0.1.9" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "61124eeebbd69b8190558df225adf7e4caafce0d743919e5d6b19652314ec5ec" dependencies = [ - "cfg-if 1.0.0", + "cfg-if", ] [[package]] @@ -565,9 +562,9 @@ checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" [[package]] name = "libc" -version = "0.2.95" +version = "0.2.96" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "789da6d93f1b866ffe175afc5322a4d76c038605a1c3319bb57b06967ca98a36" +checksum = "5600b4e6efc5421841a2138a6b082e07fe12f9aaa12783d50e5d13325b26b4fc" [[package]] name = "linked-hash-map" @@ -590,7 +587,7 @@ version = "0.4.14" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "51b9bbe6c47d51fc3e1a9b945965946b4c44142ab8792c50835a980d362c2710" dependencies = [ - "cfg-if 1.0.0", + "cfg-if", ] [[package]] @@ -613,11 +610,11 @@ dependencies = [ [[package]] name = "loom" -version = "0.3.6" +version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a0e8460f2f2121162705187214720353c517b97bdfb3494c0b1e33d83ebe4bed" +checksum = "7aa5348dc45fa5f2419b6dd4ea20345e6b01b1fcc9d176a322eada1ac3f382ba" dependencies = [ - "cfg-if 0.1.10", + "cfg-if", "generator", "scoped-tls", "serde", @@ -727,7 +724,7 @@ version = "0.8.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "fa7a782938e745763fe6907fc6ba86946d72f49fe7e21de074e08128a99fb018" dependencies = [ - "cfg-if 1.0.0", + "cfg-if", "instant", "libc", "redox_syscall", @@ -764,26 +761,6 @@ version = "2.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d4fd5641d01c8f18a23da7b6fe29298ff4b55afcccdf78973b24cf3175fee32e" -[[package]] -name = "pin-project" -version = "1.0.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c7509cc106041c40a4518d2af7a61530e1eed0e6285296a3d8c5472806ccc4a4" -dependencies = [ - "pin-project-internal", -] - -[[package]] -name = "pin-project-internal" -version = "1.0.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "48c950132583b500556b1efd71d45b319029f2b71518d979fcc208e16b42426f" -dependencies = [ - "proc-macro2", - "quote", - "syn", -] - [[package]] name = "pin-project-lite" version = "0.2.6" @@ -859,9 +836,9 @@ dependencies = [ [[package]] name = "rand_chacha" -version = "0.3.0" +version = "0.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e12735cf05c9e10bf21534da50a147b924d555dc7a547c42e6bb2d5b6017ae0d" +checksum = "e6c10a63a0fa32252be49d21e7709d4d4baf8d231c2dbce1eaa8141b9b127d88" dependencies = [ "ppv-lite86", "rand_core", @@ -942,8 +919,9 @@ dependencies = [ [[package]] name = "rocket" -version = "0.5.0-dev" -source = "git+https://github.com/SergioBenitez/Rocket?rev=0d53e23bf6cb86f9136fa8b37a92ba8076aacf67#0d53e23bf6cb86f9136fa8b37a92ba8076aacf67" +version = "0.5.0-rc.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0a71c18c42a0eb15bf3816831caf0dad11e7966f2a41aaf486a701979c4dd1f2" dependencies = [ "async-stream", "async-trait", @@ -979,8 +957,9 @@ dependencies = [ [[package]] name = "rocket_codegen" -version = "0.5.0-dev" -source = "git+https://github.com/SergioBenitez/Rocket?rev=0d53e23bf6cb86f9136fa8b37a92ba8076aacf67#0d53e23bf6cb86f9136fa8b37a92ba8076aacf67" +version = "0.5.0-rc.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "66f5fa462f7eb958bba8710c17c5d774bbbd59809fa76fb1957af7e545aea8bb" dependencies = [ "devise", "glob", @@ -994,8 +973,9 @@ dependencies = [ [[package]] name = "rocket_http" -version = "0.5.0-dev" -source = "git+https://github.com/SergioBenitez/Rocket?rev=0d53e23bf6cb86f9136fa8b37a92ba8076aacf67#0d53e23bf6cb86f9136fa8b37a92ba8076aacf67" +version = "0.5.0-rc.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "23c8b7d512d2fcac2316ebe590cde67573844b99e6cc9ee0f53375fa16e25ebd" dependencies = [ "cookie", "either", @@ -1133,7 +1113,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b362ae5752fd2137731f9fa25fd4d9058af34666ca1966fb969119cc35719f12" dependencies = [ "block-buffer", - "cfg-if 1.0.0", + "cfg-if", "cpufeatures", "digest", "opaque-debug", @@ -1196,8 +1176,9 @@ dependencies = [ [[package]] name = "state" -version = "0.4.2" -source = "git+https://github.com/SergioBenitez/state.git?rev=8f94dc#8f94dce673b7d4b0e7b96c808a84f5e2a4be4a60" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0b54c22963194db84a59ee48e1fa9ed6c1fa9909ad5db92a700aa6fe956d632b" dependencies = [ "loom", ] @@ -1259,9 +1240,9 @@ checksum = "1e81da0851ada1f3e9d4312c704aa4f8806f0f9d69faaf8df2f3464b4a9437c2" [[package]] name = "syn" -version = "1.0.72" +version = "1.0.73" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a1e8cdbefb79a9a5a65e0db8b47b723ee907b7c7f8496c76a1770b5c310bab82" +checksum = "f71489ff30030d2ae598524f61326b902466f72a0fb1a8564c001cc63425bcc7" dependencies = [ "proc-macro2", "quote", @@ -1274,7 +1255,7 @@ version = "3.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "dac1c663cfc93810f88aed9b8941d48cabf856a1b111c29a40439018d870eb22" dependencies = [ - "cfg-if 1.0.0", + "cfg-if", "libc", "rand", "redox_syscall", @@ -1405,7 +1386,7 @@ version = "0.1.26" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "09adeb8c97449311ccd28a427f96fb563e7fd31aabf994189879d9da2394b89d" dependencies = [ - "cfg-if 1.0.0", + "cfg-if", "pin-project-lite", "tracing-core", ] @@ -1506,7 +1487,7 @@ version = "0.2.74" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d54ee1d4ed486f78874278e63e4069fc1ab9f6a18ca492076ffb90c5eb2997fd" dependencies = [ - "cfg-if 1.0.0", + "cfg-if", "wasm-bindgen-macro", ] diff --git a/Cargo.toml b/Cargo.toml index ee7ceb9..2e1282b 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -7,7 +7,7 @@ license = "Apache-2.0 OR MIT" description = "A Git mirroring daemon" homepage = "https://github.com/alarsyo/lohr" repository = "https://github.com/alarsyo/lohr" -resolve = "2" +resolver = "2" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html @@ -24,7 +24,7 @@ serde_yaml = "0.8.17" sha2 = "0.9.3" [dependencies.rocket] -version = "0.5.0-dev" +version = "0.5.0-rc.1" # don't need private-cookies default-features = false @@ -32,6 +32,3 @@ default-features = false version = "2.33.3" # no need for suggestions or color with only one argument default-features = false - -[patch.crates-io] -rocket = { git = "https://github.com/SergioBenitez/Rocket", rev = "0d53e23bf6cb86f9136fa8b37a92ba8076aacf67" } diff --git a/src/signature.rs b/src/signature.rs index 4ea30bb..9d37668 100644 --- a/src/signature.rs +++ b/src/signature.rs @@ -72,7 +72,7 @@ where { type Error = anyhow::Error; - async fn from_data(request: &'r Request<'_>, data: Data) -> Outcome { + async fn from_data(request: &'r Request<'_>, data: Data<'r>) -> Outcome<'r, Self> { let json_ct = ContentType::new("application", "json"); if request.content_type() != Some(&json_ct) { return Outcome::Failure((Status::BadRequest, anyhow!("wrong content type"))); From 964975bada5b7bfb9fa495f227737a26f70a389f Mon Sep 17 00:00:00 2001 From: Antoine Martin Date: Thu, 10 Jun 2021 05:40:15 +0200 Subject: [PATCH 41/61] lohr: v0.4.2 --- Cargo.lock | 2 +- Cargo.toml | 2 +- flake.nix | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 9620fc0..49c7a7e 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -592,7 +592,7 @@ dependencies = [ [[package]] name = "lohr" -version = "0.4.1" +version = "0.4.2" dependencies = [ "anyhow", "clap", diff --git a/Cargo.toml b/Cargo.toml index 2e1282b..885d794 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "lohr" -version = "0.4.1" +version = "0.4.2" authors = ["Antoine Martin "] edition = "2018" license = "Apache-2.0 OR MIT" diff --git a/flake.nix b/flake.nix index 1df1624..bc50f90 100644 --- a/flake.nix +++ b/flake.nix @@ -16,11 +16,11 @@ { defaultPackage = pkgs.rustPlatform.buildRustPackage { pname = "lohr"; - version = "0.4.1"; + version = "0.4.2"; src = ./.; - cargoSha256 = "sha256-cUxUTOp21NzYqmLQc3XmOly0k9xo5wRqsen4iiZfg/Y="; + cargoSha256 = "sha256-YHg4b6rKcnVJSDoWh9/o+p40NBog65Gd2/UwIDXiUe0="; meta = with pkgs.lib; { description = "A Git mirroring tool"; From cd85ace5662ebffb0076b80ef42252a15511bbce Mon Sep 17 00:00:00 2001 From: Antoine Martin Date: Sat, 4 Sep 2021 18:12:35 +0200 Subject: [PATCH 42/61] github: trigger cachix build on flake change This also covers version bumps because the version is in the flake --- .github/workflows/cachix.yaml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/.github/workflows/cachix.yaml b/.github/workflows/cachix.yaml index 43c658e..6fbe645 100644 --- a/.github/workflows/cachix.yaml +++ b/.github/workflows/cachix.yaml @@ -1,8 +1,10 @@ name: "Cachix build" on: push: - tags: - - v* + paths: + - 'flake.nix' + - 'flake.lock' + jobs: build: runs-on: ubuntu-latest From c37a390f6c4ad15078c204a17307e48042ba25de Mon Sep 17 00:00:00 2001 From: Antoine Martin Date: Sat, 4 Sep 2021 18:16:07 +0200 Subject: [PATCH 43/61] lohr: fix clippy lint --- src/signature.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/signature.rs b/src/signature.rs index 9d37668..3e7cc62 100644 --- a/src/signature.rs +++ b/src/signature.rs @@ -102,7 +102,7 @@ where let signature = signatures[0]; let secret = request.guard::<&State>().await.unwrap(); - if !validate_signature(&secret.0, &signature, &content) { + if !validate_signature(&secret.0, signature, &content) { return Outcome::Failure((Status::BadRequest, anyhow!("couldn't verify signature"))); } From a48e59bedcd41fbc5faa7a3c1170e0162aa626ab Mon Sep 17 00:00:00 2001 From: Antoine Martin Date: Sat, 4 Sep 2021 18:18:17 +0200 Subject: [PATCH 44/61] github: fix cachix ci --- .github/workflows/cachix.yaml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/cachix.yaml b/.github/workflows/cachix.yaml index 6fbe645..52d09c0 100644 --- a/.github/workflows/cachix.yaml +++ b/.github/workflows/cachix.yaml @@ -9,14 +9,14 @@ jobs: build: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2.3.4 + - uses: actions/checkout@v2 - uses: cachix/install-nix-action@v13 with: - install_url: https://nixos-nix-install-tests.cachix.org/serve/lb41az54kzk6j12p81br4bczary7m145/install + install_url: https://nixos-nix-install-tests.cachix.org/serve/i6laym9jw3wg9mw6ncyrk6gjx4l34vvx/install install_options: '--tarball-url-prefix https://nixos-nix-install-tests.cachix.org/serve' extra_nix_config: | experimental-features = nix-command flakes - - uses: cachix/cachix-action@v8 + - uses: cachix/cachix-action@v10 with: name: alarsyo authToken: '${{ secrets.CACHIX_AUTH_TOKEN }}' From 58503cc8b95c8b627f6ae7e56740609e91f323cd Mon Sep 17 00:00:00 2001 From: Antoine Martin Date: Sat, 4 Sep 2021 18:09:28 +0200 Subject: [PATCH 45/61] flake.lock: Update Flake input changes: * Updated 'flake-compat': 'github:edolstra/flake-compat/99f1c2157fba4bfe6211a321fd0ee43199025dbf' -> 'github:edolstra/flake-compat/12c64ca55c1014cdc1b16ed5a804aa8576601ff2' * Updated 'flake-utils': 'github:numtide/flake-utils/5466c5bbece17adaab2d82fae80b46e807611bf3' -> 'github:numtide/flake-utils/997f7efcb746a9c140ce1f13c72263189225f482' * Updated 'nixpkgs': 'github:NixOS/nixpkgs/7db379d016a9bad7b7da9b81103ab7454faa3344' -> 'github:NixOS/nixpkgs/08ef0f28e3a41424b92ba1d203de64257a9fca6a' --- flake.lock | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/flake.lock b/flake.lock index fa6cef0..e5aa41d 100644 --- a/flake.lock +++ b/flake.lock @@ -3,11 +3,11 @@ "flake-compat": { "flake": false, "locked": { - "lastModified": 1606424373, - "narHash": "sha256-oq8d4//CJOrVj+EcOaSXvMebvuTkmBJuT5tzlfewUnQ=", + "lastModified": 1627913399, + "narHash": "sha256-hY8g6H2KFL8ownSiFeMOjwPC8P0ueXpCVEbxgda3pko=", "owner": "edolstra", "repo": "flake-compat", - "rev": "99f1c2157fba4bfe6211a321fd0ee43199025dbf", + "rev": "12c64ca55c1014cdc1b16ed5a804aa8576601ff2", "type": "github" }, "original": { @@ -18,11 +18,11 @@ }, "flake-utils": { "locked": { - "lastModified": 1614513358, - "narHash": "sha256-LakhOx3S1dRjnh0b5Dg3mbZyH0ToC9I8Y2wKSkBaTzU=", + "lastModified": 1629481132, + "narHash": "sha256-JHgasjPR0/J1J3DRm4KxM4zTyAj4IOJY8vIl75v/kPI=", "owner": "numtide", "repo": "flake-utils", - "rev": "5466c5bbece17adaab2d82fae80b46e807611bf3", + "rev": "997f7efcb746a9c140ce1f13c72263189225f482", "type": "github" }, "original": { @@ -33,11 +33,11 @@ }, "nixpkgs": { "locked": { - "lastModified": 1622653502, - "narHash": "sha256-GEuSmSdxSTJO7tZ9i3c+Jou+X9RSo6DC/SEEY997r3I=", + "lastModified": 1630140382, + "narHash": "sha256-ntXepAHFlAEtaYIU5EzckRUODeeMgpu1u2Yug+4LFNc=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "7db379d016a9bad7b7da9b81103ab7454faa3344", + "rev": "08ef0f28e3a41424b92ba1d203de64257a9fca6a", "type": "github" }, "original": { From 26eefe2ebe8a82f40c0eeb3c4e68e73fc6a93c56 Mon Sep 17 00:00:00 2001 From: Antoine Martin Date: Tue, 12 Dec 2023 14:51:44 +0100 Subject: [PATCH 46/61] flake.lock: Update MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Flake lock file updates: • Updated input 'flake-compat': 'github:edolstra/flake-compat/12c64ca55c1014cdc1b16ed5a804aa8576601ff2' (2021-08-02) → 'github:edolstra/flake-compat/0f9255e01c2351cc7d116c072cb317785dd33b33' (2023-10-04) • Updated input 'flake-utils': 'github:numtide/flake-utils/997f7efcb746a9c140ce1f13c72263189225f482' (2021-08-20) → 'github:numtide/flake-utils/4022d587cbbfd70fe950c1e2083a02621806a725' (2023-12-04) • Added input 'flake-utils/systems': 'github:nix-systems/default/da67096a3b9bf56a91d16901293e51ba5b49a27e' (2023-04-09) • Updated input 'nixpkgs': 'github:NixOS/nixpkgs/08ef0f28e3a41424b92ba1d203de64257a9fca6a' (2021-08-28) → 'github:NixOS/nixpkgs/e97b3e4186bcadf0ef1b6be22b8558eab1cdeb5d' (2023-12-11) --- flake.lock | 36 +++++++++++++++++++++++++++--------- 1 file changed, 27 insertions(+), 9 deletions(-) diff --git a/flake.lock b/flake.lock index e5aa41d..cb189f6 100644 --- a/flake.lock +++ b/flake.lock @@ -3,11 +3,11 @@ "flake-compat": { "flake": false, "locked": { - "lastModified": 1627913399, - "narHash": "sha256-hY8g6H2KFL8ownSiFeMOjwPC8P0ueXpCVEbxgda3pko=", + "lastModified": 1696426674, + "narHash": "sha256-kvjfFW7WAETZlt09AgDn1MrtKzP7t90Vf7vypd3OL1U=", "owner": "edolstra", "repo": "flake-compat", - "rev": "12c64ca55c1014cdc1b16ed5a804aa8576601ff2", + "rev": "0f9255e01c2351cc7d116c072cb317785dd33b33", "type": "github" }, "original": { @@ -17,12 +17,15 @@ } }, "flake-utils": { + "inputs": { + "systems": "systems" + }, "locked": { - "lastModified": 1629481132, - "narHash": "sha256-JHgasjPR0/J1J3DRm4KxM4zTyAj4IOJY8vIl75v/kPI=", + "lastModified": 1701680307, + "narHash": "sha256-kAuep2h5ajznlPMD9rnQyffWG8EM/C73lejGofXvdM8=", "owner": "numtide", "repo": "flake-utils", - "rev": "997f7efcb746a9c140ce1f13c72263189225f482", + "rev": "4022d587cbbfd70fe950c1e2083a02621806a725", "type": "github" }, "original": { @@ -33,11 +36,11 @@ }, "nixpkgs": { "locked": { - "lastModified": 1630140382, - "narHash": "sha256-ntXepAHFlAEtaYIU5EzckRUODeeMgpu1u2Yug+4LFNc=", + "lastModified": 1702272962, + "narHash": "sha256-D+zHwkwPc6oYQ4G3A1HuadopqRwUY/JkMwHz1YF7j4Q=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "08ef0f28e3a41424b92ba1d203de64257a9fca6a", + "rev": "e97b3e4186bcadf0ef1b6be22b8558eab1cdeb5d", "type": "github" }, "original": { @@ -53,6 +56,21 @@ "flake-utils": "flake-utils", "nixpkgs": "nixpkgs" } + }, + "systems": { + "locked": { + "lastModified": 1681028828, + "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", + "owner": "nix-systems", + "repo": "default", + "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", + "type": "github" + }, + "original": { + "owner": "nix-systems", + "repo": "default", + "type": "github" + } } }, "root": "root", From 88609b24fe17e427a08ecec2cb299a5985066b58 Mon Sep 17 00:00:00 2001 From: Antoine Martin Date: Tue, 12 Dec 2023 14:57:37 +0100 Subject: [PATCH 47/61] flake: add rust-analyzer to devshell --- flake.nix | 1 + 1 file changed, 1 insertion(+) diff --git a/flake.nix b/flake.nix index bc50f90..f3e9647 100644 --- a/flake.nix +++ b/flake.nix @@ -43,6 +43,7 @@ rustPackages.clippy rustc rustfmt + rust-analyzer ]; RUST_SRC_PATH = pkgs.rustPlatform.rustLibSrc; From 25eba69b16ec41644ac2476220e4795380d0b0ff Mon Sep 17 00:00:00 2001 From: Antoine Martin Date: Tue, 12 Dec 2023 15:01:58 +0100 Subject: [PATCH 48/61] cargo: bump dependencies --- Cargo.lock | 1218 +++++++++++++++++++++++++++------------------------- 1 file changed, 629 insertions(+), 589 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 49c7a7e..3607639 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -3,35 +3,51 @@ version = 3 [[package]] -name = "aho-corasick" -version = "0.7.18" +name = "addr2line" +version = "0.20.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1e37cfd5e7657ada45f742d6e99ca5788580b5c529dc78faf11ece6dc702656f" +checksum = "f4fa78e18c64fce05e902adecd7a5eed15a5e0a3439f7b0e169f0252214865e3" +dependencies = [ + "gimli", +] + +[[package]] +name = "adler" +version = "1.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f26201604c87b1e01bd3d98f8d5d9a8fcbb815e8cedb41ffccbeb4bf593a35fe" + +[[package]] +name = "aho-corasick" +version = "0.7.20" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cc936419f96fa211c1b9166887b38e5e40b19958e5b895be7c1f93adec7071ac" dependencies = [ "memchr", ] [[package]] name = "anyhow" -version = "1.0.40" +version = "1.0.75" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "28b2cd92db5cbd74e8e5028f7e27dd7aa3090e89e4f2a197cc7c8dfb69c7063b" +checksum = "a4668cab20f66d8d020e1fbc0ebe47217433c1b6c8f2040faf858554e394ace6" [[package]] name = "async-stream" -version = "0.3.2" +version = "0.3.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "171374e7e3b2504e0e5236e3b59260560f9fe94bfe9ac39ba5e4e929c5590625" +checksum = "cd56dd203fef61ac097dd65721a419ddccb106b2d2b70ba60a6b529f03961a51" dependencies = [ "async-stream-impl", "futures-core", + "pin-project-lite", ] [[package]] name = "async-stream-impl" -version = "0.3.2" +version = "0.3.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "648ed8c8d2ce5409ccd57453d9d1b214b342a0d69376a6feda1fd6cae3299308" +checksum = "16e62a023e7c117e27523144c5d2459f4397fcc3cab0085af8e2224f643a0193" dependencies = [ "proc-macro2", "quote", @@ -40,9 +56,9 @@ dependencies = [ [[package]] name = "async-trait" -version = "0.1.50" +version = "0.1.74" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0b98e84bbb4cbcdd97da190ba0c58a1bb0de2c1fdf67d159e192ed766aeca722" +checksum = "a66537f1bb974b254c98ed142ff995236e81b9d0fe4db0575f46612cb15eb0f9" dependencies = [ "proc-macro2", "quote", @@ -51,35 +67,30 @@ dependencies = [ [[package]] name = "atomic" -version = "0.5.0" +version = "0.5.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c3410529e8288c463bedb5930f82833bc0c90e5d2fe639a56582a4d09220b281" -dependencies = [ - "autocfg", -] - -[[package]] -name = "atty" -version = "0.2.14" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d9b39be18770d11421cdb1b9947a45dd3f37e93092cbf377614828a319d5fee8" -dependencies = [ - "hermit-abi", - "libc", - "winapi", -] +checksum = "c59bdb34bc650a32731b31bd8f0829cc15d24a708ee31559e0bb34f2bc320cba" [[package]] name = "autocfg" -version = "1.0.1" +version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cdb031dd78e28731d87d56cc8ffef4a8f36ca26c38fe2de700543e627f8a464a" +checksum = "d468802bab17cbc0cc575e9b053f41e72aa36bfa6b7f55e3529ffa43161b97fa" [[package]] -name = "base-x" -version = "0.2.8" +name = "backtrace" +version = "0.3.68" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a4521f3e3d031370679b3b140beb36dfe4801b09ac77e30c61941f97df3ef28b" +checksum = "4319208da049c43661739c5fade2ba182f09d1dc2299b32298d3a31692b17e12" +dependencies = [ + "addr2line", + "cc", + "cfg-if", + "libc", + "miniz_oxide", + "object", + "rustc-demangle", +] [[package]] name = "binascii" @@ -89,9 +100,15 @@ checksum = "383d29d513d8764dcdc42ea295d979eb99c3c9f00607b3692cf68a431f7dca72" [[package]] name = "bitflags" -version = "1.2.1" +version = "1.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cf1de2fe8c75bc145a2f577add951f8134889b4795d47466a54a5c846d691693" +checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" + +[[package]] +name = "bitflags" +version = "2.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "327762f6e5a765692301e5bb513e0d9fef63be86bbc14528052b1cd3e6f03e07" [[package]] name = "block-buffer" @@ -102,23 +119,20 @@ dependencies = [ "generic-array", ] -[[package]] -name = "bumpalo" -version = "3.7.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9c59e7af012c713f529e7a3ee57ce9b31ddd858d4b512923602f74608b009631" - [[package]] name = "bytes" -version = "1.0.1" +version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b700ce4376041dcd0a327fd0097c41095743c4c8af8887265942faf1100bd040" +checksum = "a2bd12c1caf447e69cd4528f47f94d203fd2582878ecb9e9465484c4148a8223" [[package]] name = "cc" -version = "1.0.68" +version = "1.0.83" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4a72c244c1ff497a746a7e1fb3d14bd08420ecda70c8f25c7112f2781652d787" +checksum = "f1174fb0b6ec23863f8b971027804a42614e347eafb0a95bf0b12cdae21fc4d0" +dependencies = [ + "libc", +] [[package]] name = "cfg-if" @@ -128,32 +142,20 @@ checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" [[package]] name = "clap" -version = "2.33.3" +version = "2.34.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "37e58ac78573c40708d45522f0d80fa2f01cc4f9b4e2bf749807255454312002" +checksum = "a0610544180c38b88101fecf2dd634b174a62eef6946f84dfc6a7127512b381c" dependencies = [ - "bitflags", + "bitflags 1.3.2", "textwrap", "unicode-width", ] -[[package]] -name = "const_fn" -version = "0.4.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f92cfa0fd5690b3cf8c1ef2cabbd9b7ef22fa53cf5e1f92b05103f6d5d1cf6e7" - -[[package]] -name = "convert_case" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6245d59a3e82a7fc217c5828a6692dbc6dfb63a0c8c90495621f7b9d79704a0e" - [[package]] name = "cookie" -version = "0.15.0" +version = "0.17.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ffdf8865bac3d9a3bde5bde9088ca431b11f5d37c7a578b8086af77248b76627" +checksum = "7efb37c3e1ccb1ff97164ad95ac1606e8ccd35b3fa0a7d99a304c7f4a428cc24" dependencies = [ "percent-encoding", "time", @@ -162,40 +164,28 @@ dependencies = [ [[package]] name = "cpufeatures" -version = "0.1.4" +version = "0.2.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ed00c67cb5d0a7d64a44f6ad2668db7e7530311dd53ea79bcd4fb022c64911c8" +checksum = "ce420fe07aecd3e67c5f910618fe65e94158f6dcc0adf44e00d69ce2bdfe0fd0" dependencies = [ "libc", ] [[package]] name = "crypto-mac" -version = "0.10.0" +version = "0.10.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4857fd85a0c34b3c3297875b747c1e02e06b6a0ea32dd892d8192b9ce0813ea6" +checksum = "bff07008ec701e8028e2ceb8f83f0e4274ee62bd2dbdc4fefff2e9a91824081a" dependencies = [ "generic-array", "subtle", ] -[[package]] -name = "derive_more" -version = "0.99.14" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5cc7b9cef1e351660e5443924e4f43ab25fbbed3e9a5f052df3677deb4d6b320" -dependencies = [ - "convert_case", - "proc-macro2", - "quote", - "syn", -] - [[package]] name = "devise" -version = "0.3.0" +version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "411cf45ac38f00df3679689616649dc12607b846db171780bb790b514a042832" +checksum = "d6eacefd3f541c66fc61433d65e54e0e46e0a029a819a7dbbc7a7b489e8a85f8" dependencies = [ "devise_codegen", "devise_core", @@ -203,9 +193,9 @@ dependencies = [ [[package]] name = "devise_codegen" -version = "0.3.0" +version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2cf7081f06822f1787e29359354426132cf832cc977d7a8ff747848631462ad1" +checksum = "9c8cf4b8dd484ede80fd5c547592c46c3745a617c8af278e2b72bea86b2dfed6" dependencies = [ "devise_core", "quote", @@ -213,11 +203,11 @@ dependencies = [ [[package]] name = "devise_core" -version = "0.3.0" +version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "80c23631758736875d7ce08f847f296b4001b72cf90878e85b47df7ac5442147" +checksum = "35b50dba0afdca80b187392b24f2499a88c336d5a8493e4b4ccfb608708be56a" dependencies = [ - "bitflags", + "bitflags 2.4.1", "proc-macro2", "proc-macro2-diagnostics", "quote", @@ -233,38 +223,42 @@ dependencies = [ "generic-array", ] -[[package]] -name = "discard" -version = "1.0.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "212d0f5754cb6769937f4501cc0e67f4f4483c8d2c3e1e922ee9edbe4ab4c7c0" - -[[package]] -name = "dtoa" -version = "0.4.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "56899898ce76aaf4a0f24d914c97ea6ed976d42fec6ad33fcbb0a1103e07b2b0" - [[package]] name = "either" -version = "1.6.1" +version = "1.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e78d4f1cc4ae33bbfc157ed5d5a5ef3bc29227303d595861deb238fcec4e9457" +checksum = "a26ae43d7bcc3b814de94796a5e736d4029efb0ee900c12e2d54c993ad1a1e07" [[package]] name = "encoding_rs" -version = "0.8.28" +version = "0.8.33" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "80df024fbc5ac80f87dfef0d9f5209a252f2a497f7f42944cff24d8253cac065" +checksum = "7268b386296a025e474d5140678f75d6de9493ae55a5d709eeb9dd08149945e1" dependencies = [ "cfg-if", ] [[package]] -name = "figment" -version = "0.10.5" +name = "errno" +version = "0.3.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0ca029e813a72b7526d28273d25f3e4a2f365d1b7a1018a6f93ec9053a119763" +checksum = "a258e46cdc063eb8519c00b9fc845fc47bcfca4130e2f08e88665ceda8474245" +dependencies = [ + "libc", + "windows-sys 0.52.0", +] + +[[package]] +name = "fastrand" +version = "2.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "25cbce373ec4653f1a01a31e8a5e5ec0c622dc27ff9c4e6606eefef5cbbed4a5" + +[[package]] +name = "figment" +version = "0.10.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4e56602b469b2201400dec66a66aec5a9b8761ee97cd1b8c96ab2483fcc16cc9" dependencies = [ "atomic", "pear", @@ -282,13 +276,12 @@ checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" [[package]] name = "futures" -version = "0.3.15" +version = "0.3.29" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0e7e43a803dae2fa37c1f6a8fe121e1f7bf9548b4dfc0522a42f34145dadfc27" +checksum = "da0290714b38af9b4a7b094b8a37086d1b4e61f2df9122c3cad2577669145335" dependencies = [ "futures-channel", "futures-core", - "futures-executor", "futures-io", "futures-sink", "futures-task", @@ -297,9 +290,9 @@ dependencies = [ [[package]] name = "futures-channel" -version = "0.3.15" +version = "0.3.29" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e682a68b29a882df0545c143dc3646daefe80ba479bcdede94d5a703de2871e2" +checksum = "ff4dd66668b557604244583e3e1e1eada8c5c2e96a6d0d6653ede395b78bbacb" dependencies = [ "futures-core", "futures-sink", @@ -307,91 +300,63 @@ dependencies = [ [[package]] name = "futures-core" -version = "0.3.15" +version = "0.3.29" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0402f765d8a89a26043b889b26ce3c4679d268fa6bb22cd7c6aad98340e179d1" - -[[package]] -name = "futures-executor" -version = "0.3.15" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "badaa6a909fac9e7236d0620a2f57f7664640c56575b71a7552fbd68deafab79" -dependencies = [ - "futures-core", - "futures-task", - "futures-util", -] +checksum = "eb1d22c66e66d9d72e1758f0bd7d4fd0bee04cad842ee34587d68c07e45d088c" [[package]] name = "futures-io" -version = "0.3.15" +version = "0.3.29" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "acc499defb3b348f8d8f3f66415835a9131856ff7714bf10dadfc4ec4bdb29a1" - -[[package]] -name = "futures-macro" -version = "0.3.15" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a4c40298486cdf52cc00cd6d6987892ba502c7656a16a4192a9992b1ccedd121" -dependencies = [ - "autocfg", - "proc-macro-hack", - "proc-macro2", - "quote", - "syn", -] +checksum = "8bf34a163b5c4c52d0478a4d757da8fb65cabef42ba90515efee0f6f9fa45aaa" [[package]] name = "futures-sink" -version = "0.3.15" +version = "0.3.29" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a57bead0ceff0d6dde8f465ecd96c9338121bb7717d3e7b108059531870c4282" +checksum = "e36d3378ee38c2a36ad710c5d30c2911d752cb941c00c72dbabfb786a7970817" [[package]] name = "futures-task" -version = "0.3.15" +version = "0.3.29" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8a16bef9fc1a4dddb5bee51c989e3fbba26569cbb0e31f5b303c184e3dd33dae" +checksum = "efd193069b0ddadc69c46389b740bbccdd97203899b48d09c5f7969591d6bae2" [[package]] name = "futures-util" -version = "0.3.15" +version = "0.3.29" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "feb5c238d27e2bf94ffdfd27b2c29e3df4a68c4193bb6427384259e2bf191967" +checksum = "a19526d624e703a3179b3d322efec918b6246ea0fa51d41124525f00f1cc8104" dependencies = [ - "autocfg", "futures-channel", "futures-core", "futures-io", - "futures-macro", "futures-sink", "futures-task", "memchr", "pin-project-lite", "pin-utils", - "proc-macro-hack", - "proc-macro-nested", "slab", ] [[package]] name = "generator" -version = "0.7.0" +version = "0.7.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c1d9279ca822891c1a4dae06d185612cf8fc6acfe5dff37781b41297811b12ee" +checksum = "5cc16584ff22b460a382b7feec54b23d2908d858152e5739a120b949293bd74e" dependencies = [ "cc", "libc", "log", "rustversion", - "winapi", + "windows", ] [[package]] name = "generic-array" -version = "0.14.4" +version = "0.14.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "501466ecc8a30d1d3b7fc9229b122b2ce8ed6e9d9223f1138d4babb253e51817" +checksum = "85649ca51fd72272d7821adaf274ad91c288277713d9c18820d8499a7ff69e9a" dependencies = [ "typenum", "version_check", @@ -399,9 +364,9 @@ dependencies = [ [[package]] name = "getrandom" -version = "0.2.3" +version = "0.2.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7fcd999463524c52659517fe2cea98493cfe485d10565e7b0fb07dbba7ad2753" +checksum = "fe9006bed769170c11f845cf00c7c1e9092aeb3f268e007c3e760ac68008070f" dependencies = [ "cfg-if", "libc", @@ -409,44 +374,28 @@ dependencies = [ ] [[package]] -name = "glob" -version = "0.3.0" +name = "gimli" +version = "0.27.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9b919933a397b79c37e33b77bb2aa3dc8eb6e165ad809e58ff75bc7db2e34574" +checksum = "b6c80984affa11d98d1b88b66ac8853f143217b399d3c74116778ff8fdb4ed2e" [[package]] -name = "h2" -version = "0.3.3" +name = "glob" +version = "0.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "825343c4eef0b63f541f8903f395dc5beb362a979b5799a84062527ef1e37726" -dependencies = [ - "bytes", - "fnv", - "futures-core", - "futures-sink", - "futures-util", - "http", - "indexmap", - "slab", - "tokio", - "tokio-util", - "tracing", -] +checksum = "d2fabcfbdc87f4758337ca535fb41a6d701b65693ce38287d856d1674551ec9b" [[package]] name = "hashbrown" -version = "0.9.1" +version = "0.12.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d7afe4a420e3fe79967a00898cc1f4db7c8a49a9333a29f8a4bd76a253d5cd04" +checksum = "8a9ee70c43aaf417c914396645a0fa852624801b24ebb7ae78fe8272889ac888" [[package]] name = "hermit-abi" -version = "0.1.18" +version = "0.3.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "322f4de77956e22ed0e5032c359a0f1273f1f7f0d79bfa3b8ffbc730d7fbcc5c" -dependencies = [ - "libc", -] +checksum = "d77f7ec81a6d05a3abb01ab6eb7590f6083d08449fe5a1c8b1e620283546ccb7" [[package]] name = "hex" @@ -466,9 +415,9 @@ dependencies = [ [[package]] name = "http" -version = "0.2.4" +version = "0.2.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "527e8c9ac747e28542699a951517aa9a6945af506cd1f2e1b53a576c17b6cc11" +checksum = "8947b1a6fad4393052c7ba1f4cd97bed3e953a95c79c92ad9b051a04611d9fbb" dependencies = [ "bytes", "fnv", @@ -477,9 +426,9 @@ dependencies = [ [[package]] name = "http-body" -version = "0.4.2" +version = "0.4.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "60daa14be0e0786db0f03a9e57cb404c9d756eed2b6c62b9ea98ec5743ec75a9" +checksum = "7ceab25649e9960c0311ea418d17bee82c0dcec1bd053b5f9a66e265a693bed2" dependencies = [ "bytes", "http", @@ -488,34 +437,33 @@ dependencies = [ [[package]] name = "httparse" -version = "1.4.1" +version = "1.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f3a87b616e37e93c22fb19bcd386f02f3af5ea98a25670ad0fce773de23c5e68" +checksum = "d897f394bad6a705d5f4104762e116a75639e470d80901eed05a860a95cb1904" [[package]] name = "httpdate" -version = "1.0.1" +version = "1.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6456b8a6c8f33fee7d958fcd1b60d55b11940a79e63ae87013e6d22e26034440" +checksum = "df3b46402a9d5adb4c86a0cf463f42e19994e3ee891101b1841f30a545cb49a9" [[package]] name = "hyper" -version = "0.14.9" +version = "0.14.27" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "07d6baa1b441335f3ce5098ac421fb6547c46dda735ca1bc6d0153c838f9dd83" +checksum = "ffb1cfd654a8219eaef89881fdb3bb3b1cdc5fa75ded05d6933b2b382e395468" dependencies = [ "bytes", "futures-channel", "futures-core", "futures-util", - "h2", "http", "http-body", "httparse", "httpdate", "itoa", "pin-project-lite", - "socket2", + "socket2 0.4.10", "tokio", "tower-service", "tracing", @@ -524,9 +472,9 @@ dependencies = [ [[package]] name = "indexmap" -version = "1.6.2" +version = "1.9.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "824845a0bf897a9042383849b02c1bc219c2383772efcd5c6f9766fa4b81aef3" +checksum = "bd070e393353796e801d209ad339e89596eb4c8d430d18ede6a1cced8fafbd99" dependencies = [ "autocfg", "hashbrown", @@ -535,24 +483,26 @@ dependencies = [ [[package]] name = "inlinable_string" -version = "0.1.14" +version = "0.1.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3094308123a0e9fd59659ce45e22de9f53fc1d2ac6e1feb9fef988e4f76cad77" +checksum = "c8fae54786f62fb2918dcfae3d568594e50eb9b5c25bf04371af6fe7516452fb" [[package]] -name = "instant" -version = "0.1.9" +name = "is-terminal" +version = "0.4.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "61124eeebbd69b8190558df225adf7e4caafce0d743919e5d6b19652314ec5ec" +checksum = "cb0889898416213fab133e1d33a0e5858a48177452750691bde3666d0fdbaf8b" dependencies = [ - "cfg-if", + "hermit-abi", + "rustix", + "windows-sys 0.48.0", ] [[package]] name = "itoa" -version = "0.4.7" +version = "1.0.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dd25036021b0de88a0aff6b850051563c6516d0bf53f8638938edbb9de732736" +checksum = "b1a46d1a171d865aa5f83f92695765caa047a9b4cbae2cbf37dbd613a793fd4c" [[package]] name = "lazy_static" @@ -562,33 +512,37 @@ checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" [[package]] name = "libc" -version = "0.2.96" +version = "0.2.151" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5600b4e6efc5421841a2138a6b082e07fe12f9aaa12783d50e5d13325b26b4fc" +checksum = "302d7ab3130588088d277783b1e2d2e10c9e9e4a16dd9050e6ec93fb3e7048f4" [[package]] name = "linked-hash-map" -version = "0.5.4" +version = "0.5.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7fb9b38af92608140b86b693604b9ffcc5824240a484d1ecd4795bacb2fe88f3" +checksum = "0717cef1bc8b636c6e1c1bbdefc09e6322da8a9321966e8928ef80d20f7f770f" + +[[package]] +name = "linux-raw-sys" +version = "0.4.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c4cd1a83af159aa67994778be9070f0ae1bd732942279cabb14f86f986a21456" [[package]] name = "lock_api" -version = "0.4.4" +version = "0.4.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0382880606dff6d15c9476c416d18690b72742aa7b605bb6dd6ec9030fbf07eb" +checksum = "3c168f8615b12bc01f9c17e2eb0cc07dcae1940121185446edc3744920e8ef45" dependencies = [ + "autocfg", "scopeguard", ] [[package]] name = "log" -version = "0.4.14" +version = "0.4.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "51b9bbe6c47d51fc3e1a9b945965946b4c44142ab8792c50835a980d362c2710" -dependencies = [ - "cfg-if", -] +checksum = "b5e6163cb8c49088c2c36f57875e58ccd8c87c7427f7fbd50ea6710b2f3f2e8f" [[package]] name = "lohr" @@ -610,96 +564,123 @@ dependencies = [ [[package]] name = "loom" -version = "0.5.0" +version = "0.5.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7aa5348dc45fa5f2419b6dd4ea20345e6b01b1fcc9d176a322eada1ac3f382ba" +checksum = "ff50ecb28bb86013e935fb6683ab1f6d3a20016f123c76fd4c27470076ac30f5" dependencies = [ "cfg-if", "generator", "scoped-tls", "serde", "serde_json", + "tracing", + "tracing-subscriber", +] + +[[package]] +name = "matchers" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8263075bb86c5a1b1427b5ae862e8889656f126e9f77c484496e8b47cf5c5558" +dependencies = [ + "regex-automata", ] [[package]] name = "memchr" -version = "2.4.0" +version = "2.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b16bd47d9e329435e309c58469fe0791c2d0d1ba96ec0954152a5ae2b04387dc" +checksum = "2dffe52ecf27772e601905b7522cb4ef790d2cc203488bbd0e2fe85fcb74566d" [[package]] name = "mime" -version = "0.3.16" +version = "0.3.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2a60c7ce501c71e03a9c9c0d35b861413ae925bd979cc7a4e30d060069aaac8d" +checksum = "6877bb514081ee2a7ff5ef9de3281f14a4dd4bceac4c09388074a6b5df8a139a" [[package]] -name = "mio" -version = "0.7.11" +name = "miniz_oxide" +version = "0.7.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cf80d3e903b34e0bd7282b218398aec54e082c840d9baf8339e0080a0c542956" +checksum = "e7810e0be55b428ada41041c41f32c9f1a42817901b4ccf45fa3d4b6561e74c7" dependencies = [ - "libc", - "log", - "miow", - "ntapi", - "winapi", + "adler", ] [[package]] -name = "miow" -version = "0.3.7" +name = "mio" +version = "0.8.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b9f1c5b025cda876f66ef43a113f91ebc9f4ccef34843000e0adf6ebbab84e21" +checksum = "8f3d0b296e374a4e6f3c7b0a1f5a51d748a0d34c85e7dc48fc3fa9a87657fe09" dependencies = [ - "winapi", + "libc", + "wasi", + "windows-sys 0.48.0", ] [[package]] name = "multer" -version = "2.0.0" +version = "2.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0fdd568fea4758b30d6423f013f7171e193c34aa97828d1bd9f924fb3af30a8c" +checksum = "01acbdc23469fd8fe07ab135923371d5f5a422fbf9c522158677c8eb15bc51c2" dependencies = [ "bytes", - "derive_more", "encoding_rs", "futures-util", "http", "httparse", "log", + "memchr", "mime", "spin", "tokio", "tokio-util", - "twoway", "version_check", ] [[package]] -name = "ntapi" -version = "0.3.6" +name = "nu-ansi-term" +version = "0.46.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3f6bb902e437b6d86e03cce10a7e2af662292c5dfef23b65899ea3ac9354ad44" +checksum = "77a8165726e8236064dbb45459242600304b42a5ea24ee2948e18e023bf7ba84" dependencies = [ + "overload", "winapi", ] [[package]] name = "num_cpus" -version = "1.13.0" +version = "1.16.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "05499f3756671c15885fee9034446956fff3f243d6077b91e5767df161f766b3" +checksum = "4161fcb6d602d4d2081af7c3a45852d875a03dd337a6bfdd6e06407b61342a43" dependencies = [ "hermit-abi", "libc", ] [[package]] -name = "once_cell" -version = "1.7.2" +name = "num_threads" +version = "0.1.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "af8b08b04175473088b46763e51ee54da5f9a164bc162f615b91bc179dbf15a3" +checksum = "2819ce041d2ee131036f4fc9d6ae7ae125a3a40e97ba64d04fe799ad9dabbb44" +dependencies = [ + "libc", +] + +[[package]] +name = "object" +version = "0.31.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8bda667d9f2b5051b8833f59f3bf748b28ef54f850f4fcb389a252aa383866d1" +dependencies = [ + "memchr", +] + +[[package]] +name = "once_cell" +version = "1.17.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9670a07f94779e00908f3e686eab508878ebb390ba6e604d3a284c00e8d0487b" [[package]] name = "opaque-debug" @@ -708,46 +689,50 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "624a8340c38c1b80fd549087862da4ba43e08858af025b236e509b6649fc13d5" [[package]] -name = "parking_lot" -version = "0.11.1" +name = "overload" +version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6d7744ac029df22dca6284efe4e898991d28e3085c706c972bcd7da4a27a15eb" +checksum = "b15813163c1d831bf4a13c3610c05c0d03b39feb07f7e09fa234dac9b15aaf39" + +[[package]] +name = "parking_lot" +version = "0.12.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3742b2c103b9f06bc9fff0a37ff4912935851bee6d36f3c02bcc755bcfec228f" dependencies = [ - "instant", "lock_api", "parking_lot_core", ] [[package]] name = "parking_lot_core" -version = "0.8.3" +version = "0.9.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fa7a782938e745763fe6907fc6ba86946d72f49fe7e21de074e08128a99fb018" +checksum = "4c42a9226546d68acdd9c0a280d17ce19bfe27a46bf68784e4066115788d008e" dependencies = [ "cfg-if", - "instant", "libc", - "redox_syscall", + "redox_syscall 0.4.1", "smallvec", - "winapi", + "windows-targets 0.48.5", ] [[package]] name = "pear" -version = "0.2.3" +version = "0.2.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "15e44241c5e4c868e3eaa78b7c1848cadd6344ed4f54d029832d32b415a58702" +checksum = "61a386cd715229d399604b50d1361683fe687066f42d56f54be995bc6868f71c" dependencies = [ "inlinable_string", "pear_codegen", - "yansi", + "yansi 1.0.0-rc.1", ] [[package]] name = "pear_codegen" -version = "0.2.3" +version = "0.2.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "82a5ca643c2303ecb740d506539deba189e16f2754040a42901cd8105d0282d0" +checksum = "da9f0f13dac8069c139e8300a6510e3f4143ecf5259c60b116a9b271b4ca0d54" dependencies = [ "proc-macro2", "proc-macro2-diagnostics", @@ -757,15 +742,15 @@ dependencies = [ [[package]] name = "percent-encoding" -version = "2.1.0" +version = "2.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d4fd5641d01c8f18a23da7b6fe29298ff4b55afcccdf78973b24cf3175fee32e" +checksum = "e3148f5046208a5d56bcfc03053e3ca6334e51da8dfb19b6cdc8b306fae3283e" [[package]] name = "pin-project-lite" -version = "0.2.6" +version = "0.2.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dc0e1f259c92177c30a4c9d177246edd0a3568b25756a977d0632cf8fa37e905" +checksum = "8afb450f006bf6385ca15ef45d71d2288452bc3683ce2e2cacc0d18e4be60b58" [[package]] name = "pin-utils" @@ -775,63 +760,50 @@ checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184" [[package]] name = "ppv-lite86" -version = "0.2.10" +version = "0.2.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ac74c624d6b2d21f425f752262f42188365d7b8ff1aff74c82e45136510a4857" - -[[package]] -name = "proc-macro-hack" -version = "0.5.19" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dbf0c48bc1d91375ae5c3cd81e3722dff1abcf81a30960240640d223f59fe0e5" - -[[package]] -name = "proc-macro-nested" -version = "0.1.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bc881b2c22681370c6a780e47af9840ef841837bc98118431d4e1868bd0c1086" +checksum = "5b40af805b3121feab8a3c29f04d8ad262fa8e0561883e7653e024ae4479e6de" [[package]] name = "proc-macro2" -version = "1.0.27" +version = "1.0.70" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f0d8caf72986c1a598726adc988bb5984792ef84f5ee5aa50209145ee8077038" +checksum = "39278fbbf5fb4f646ce651690877f89d1c5811a3d4acb27700c1cb3cdb78fd3b" dependencies = [ - "unicode-xid", + "unicode-ident", ] [[package]] name = "proc-macro2-diagnostics" -version = "0.9.1" +version = "0.10.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4bf29726d67464d49fa6224a1d07936a8c08bb3fba727c7493f6cf1616fdaada" +checksum = "af066a9c399a26e020ada66a034357a868728e72cd426f3adcd35f80d88d88c8" dependencies = [ "proc-macro2", "quote", "syn", "version_check", - "yansi", + "yansi 1.0.0-rc.1", ] [[package]] name = "quote" -version = "1.0.9" +version = "1.0.33" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c3d0b9745dc2debf507c8422de05d7226cc1f0644216dfdfead988f9b1ab32a7" +checksum = "5267fca4496028628a95160fc423a33e8b2e6af8a5302579e322e4b520293cae" dependencies = [ "proc-macro2", ] [[package]] name = "rand" -version = "0.8.3" +version = "0.8.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0ef9e7e66b4468674bfcb0c81af8b7fa0bb154fa9f28eb840da5c447baeb8d7e" +checksum = "34af8d1a0e25924bc5b7c43c079c942339d8f0a8b57c39049bef581b46327404" dependencies = [ "libc", "rand_chacha", "rand_core", - "rand_hc", ] [[package]] @@ -846,45 +818,45 @@ dependencies = [ [[package]] name = "rand_core" -version = "0.6.2" +version = "0.6.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "34cf66eb183df1c5876e2dcf6b13d57340741e8dc255b48e40a26de954d06ae7" +checksum = "ec0be4795e2f6a28069bec0b5ff3e2ac9bafc99e6a9a7dc3547996c5c816922c" dependencies = [ "getrandom", ] [[package]] -name = "rand_hc" -version = "0.3.0" +name = "redox_syscall" +version = "0.3.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3190ef7066a446f2e7f42e239d161e905420ccab01eb967c9eb27d21b2322a73" +checksum = "567664f262709473930a4bf9e51bf2ebf3348f2e748ccc50dea20646858f8f29" dependencies = [ - "rand_core", + "bitflags 1.3.2", ] [[package]] name = "redox_syscall" -version = "0.2.8" +version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "742739e41cd49414de871ea5e549afb7e2a3ac77b589bcbebe8c82fab37147fc" +checksum = "4722d768eff46b75989dd134e5c353f0d6296e5aaa3132e776cbdb56be7731aa" dependencies = [ - "bitflags", + "bitflags 1.3.2", ] [[package]] name = "ref-cast" -version = "1.0.6" +version = "1.0.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "300f2a835d808734ee295d45007adacb9ebb29dd3ae2424acfa17930cae541da" +checksum = "acde58d073e9c79da00f2b5b84eed919c8326832648a5b109b3fce1bb1175280" dependencies = [ "ref-cast-impl", ] [[package]] name = "ref-cast-impl" -version = "1.0.6" +version = "1.0.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4c38e3aecd2b21cb3959637b883bb3714bc7e43f0268b9a29d3743ee3e55cdd2" +checksum = "7f7473c2cfcf90008193dd0e3e16599455cb601a9fce322b5bb55de799664925" dependencies = [ "proc-macro2", "quote", @@ -893,9 +865,9 @@ dependencies = [ [[package]] name = "regex" -version = "1.5.4" +version = "1.7.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d07a8629359eb56f1e2fb1652bb04212c072a87ba68546a04065d525673ac461" +checksum = "8b1f693b24f6ac912f4893ef08244d70b6067480d2f1a46e950c9691e6749d1d" dependencies = [ "aho-corasick", "memchr", @@ -903,36 +875,36 @@ dependencies = [ ] [[package]] -name = "regex-syntax" -version = "0.6.25" +name = "regex-automata" +version = "0.1.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f497285884f3fcff424ffc933e56d7cbca511def0c9831a7f9b5f6153e3cc89b" - -[[package]] -name = "remove_dir_all" -version = "0.5.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3acd125665422973a33ac9d3dd2df85edad0f4ae9b00dafb1a05e43a9f5ef8e7" +checksum = "6c230d73fb8d8c1b9c0b3135c5142a8acee3a0558fb8db5cf1cb65f8d7862132" dependencies = [ - "winapi", + "regex-syntax", ] [[package]] -name = "rocket" -version = "0.5.0-rc.1" +name = "regex-syntax" +version = "0.6.29" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0a71c18c42a0eb15bf3816831caf0dad11e7966f2a41aaf486a701979c4dd1f2" +checksum = "f162c6dd7b008981e4d40210aca20b4bd0f9b60ca9271061b07f78537722f2e1" + +[[package]] +name = "rocket" +version = "0.5.0-rc.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "58734f7401ae5cfd129685b48f61182331745b357b96f2367f01aebaf1cc9cc9" dependencies = [ "async-stream", "async-trait", "atomic", - "atty", "binascii", "bytes", "either", "figment", "futures", "indexmap", + "is-terminal", "log", "memchr", "multer", @@ -952,14 +924,14 @@ dependencies = [ "tokio-util", "ubyte", "version_check", - "yansi", + "yansi 0.5.1", ] [[package]] name = "rocket_codegen" -version = "0.5.0-rc.1" +version = "0.5.0-rc.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "66f5fa462f7eb958bba8710c17c5d774bbbd59809fa76fb1957af7e545aea8bb" +checksum = "7093353f14228c744982e409259fb54878ba9563d08214f2d880d59ff2fc508b" dependencies = [ "devise", "glob", @@ -973,19 +945,18 @@ dependencies = [ [[package]] name = "rocket_http" -version = "0.5.0-rc.1" +version = "0.5.0-rc.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "23c8b7d512d2fcac2316ebe590cde67573844b99e6cc9ee0f53375fa16e25ebd" +checksum = "936012c99162a03a67f37f9836d5f938f662e26f2717809761a9ac46432090f4" dependencies = [ "cookie", "either", + "futures", "http", "hyper", "indexmap", "log", "memchr", - "mime", - "parking_lot", "pear", "percent-encoding", "pin-project-lite", @@ -1000,67 +971,62 @@ dependencies = [ ] [[package]] -name = "rustc_version" -version = "0.2.3" +name = "rustc-demangle" +version = "0.1.23" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "138e3e0acb6c9fb258b19b67cb8abd63c00679d2851805ea151465464fe9030a" +checksum = "d626bb9dae77e28219937af045c257c28bfd3f69333c512553507f5f9798cb76" + +[[package]] +name = "rustix" +version = "0.38.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9bfe0f2582b4931a45d1fa608f8a8722e8b3c7ac54dd6d5f3b3212791fedef49" dependencies = [ - "semver", + "bitflags 2.4.1", + "errno", + "libc", + "linux-raw-sys", + "windows-sys 0.48.0", ] [[package]] name = "rustversion" -version = "1.0.5" +version = "1.0.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "61b3909d758bb75c79f23d4736fac9433868679d3ad2ea7a61e3c25cfda9a088" +checksum = "7ffc183a10b4478d04cbbbfc96d0873219d962dd5accaff2ffbd4ceb7df837f4" [[package]] name = "ryu" -version = "1.0.5" +version = "1.0.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "71d301d4193d031abdd79ff7e3dd721168a9572ef3fe51a1517aba235bd8f86e" +checksum = "f98d2aa92eebf49b69786be48e4477826b256916e84a57ff2a4f21923b48eb4c" [[package]] name = "scoped-tls" -version = "1.0.0" +version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ea6a9290e3c9cf0f18145ef7ffa62d68ee0bf5fcd651017e586dc7fd5da448c2" +checksum = "e1cf6437eb19a8f4a6cc0f7dca544973b0b78843adbfeb3683d1a94a0024a294" [[package]] name = "scopeguard" -version = "1.1.0" +version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d29ab0c6d3fc0ee92fe66e2d99f700eab17a8d57d1c1d3b748380fb20baa78cd" - -[[package]] -name = "semver" -version = "0.9.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1d7eb9ef2c18661902cc47e535f9bc51b78acd254da71d375c2f6720d9a40403" -dependencies = [ - "semver-parser", -] - -[[package]] -name = "semver-parser" -version = "0.7.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "388a1df253eca08550bef6c72392cfe7c30914bf41df5269b68cbd6ff8f570a3" +checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49" [[package]] name = "serde" -version = "1.0.126" +version = "1.0.193" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ec7505abeacaec74ae4778d9d9328fe5a5d04253220a85c4ee022239fc996d03" +checksum = "25dd9975e68d0cb5aa1120c288333fc98731bd1dd12f561e468ea4728c042b89" dependencies = [ "serde_derive", ] [[package]] name = "serde_derive" -version = "1.0.126" +version = "1.0.193" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "963a7dbc9895aeac7ac90e74f34a5d5261828f79df35cbed41e10189d3804d43" +checksum = "43576ca501357b9b071ac53cdc7da8ef0cbd9493d8df094cd821777ea6e894d3" dependencies = [ "proc-macro2", "quote", @@ -1069,9 +1035,9 @@ dependencies = [ [[package]] name = "serde_json" -version = "1.0.64" +version = "1.0.108" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "799e97dc9fdae36a5c8b8f2cae9ce2ee9fdce2058c57a93e6099d919fd982f79" +checksum = "3d1c7e3eac408d115102c4c24ad393e0821bb3a5df4d506a80f85f7a742a526b" dependencies = [ "itoa", "ryu", @@ -1090,27 +1056,21 @@ dependencies = [ [[package]] name = "serde_yaml" -version = "0.8.17" +version = "0.8.26" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "15654ed4ab61726bf918a39cb8d98a2e2995b002387807fa6ba58fdf7f59bb23" +checksum = "578a7433b776b56a35785ed5ce9a7e777ac0598aac5a6dd1b4b18a307c7fc71b" dependencies = [ - "dtoa", - "linked-hash-map", + "indexmap", + "ryu", "serde", "yaml-rust", ] -[[package]] -name = "sha1" -version = "0.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2579985fda508104f7587689507983eadd6a6e84dd35d6d115361f530916fa0d" - [[package]] name = "sha2" -version = "0.9.5" +version = "0.9.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b362ae5752fd2137731f9fa25fd4d9058af34666ca1966fb969119cc35719f12" +checksum = "4d58a1e1bf39749807d89cf2d98ac2dfa0ff1cb3faa38fbb64dd88ac8013d800" dependencies = [ "block-buffer", "cfg-if", @@ -1120,41 +1080,63 @@ dependencies = [ ] [[package]] -name = "signal-hook-registry" -version = "1.4.0" +name = "sharded-slab" +version = "0.1.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e51e73328dc4ac0c7ccbda3a494dfa03df1de2f46018127f60c693f2648455b0" +checksum = "f40ca3c46823713e0d4209592e8d6e826aa57e928f09752619fc696c499637f6" +dependencies = [ + "lazy_static", +] + +[[package]] +name = "signal-hook-registry" +version = "1.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d8229b473baa5980ac72ef434c4415e70c4b5e71b423043adb4ba059f89c99a1" dependencies = [ "libc", ] [[package]] name = "slab" -version = "0.4.3" +version = "0.4.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f173ac3d1a7e3b28003f40de0b5ce7fe2710f9b9dc3fc38664cebee46b3b6527" +checksum = "8f92a496fb766b417c996b9c5e57daf2f7ad3b0bebe1ccfca4856390e3d3bb67" +dependencies = [ + "autocfg", +] [[package]] name = "smallvec" -version = "1.6.1" +version = "1.11.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fe0f37c9e8f3c5a4a66ad655a93c74daac4ad00c441533bf5c6e7990bb42604e" +checksum = "4dccd0940a2dcdf68d092b8cbab7dc0ad8fa938bf95787e1b916b0e3d0e8e970" [[package]] name = "socket2" -version = "0.4.0" +version = "0.4.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9e3dfc207c526015c632472a77be09cf1b6e46866581aecae5cc38fb4235dea2" +checksum = "9f7916fc008ca5542385b89a3d3ce689953c143e9304a9bf8beec1de48994c0d" dependencies = [ "libc", "winapi", ] [[package]] -name = "spin" -version = "0.9.0" +name = "socket2" +version = "0.5.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b87bbf98cb81332a56c1ee8929845836f85e8ddd693157c30d76660196014478" +checksum = "7b5fac59a5cb5dd637972e5fca70daf0523c9067fcdc4842f053dae04a18f8e9" +dependencies = [ + "libc", + "windows-sys 0.48.0", +] + +[[package]] +name = "spin" +version = "0.9.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6980e8d7511241f8acf4aebddbb1ff938df5eebe98691418c4468d0b72a96a67" [[package]] name = "stable-pattern" @@ -1165,102 +1147,43 @@ dependencies = [ "memchr", ] -[[package]] -name = "standback" -version = "0.2.17" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e113fb6f3de07a243d434a56ec6f186dfd51cb08448239fe7bcae73f87ff28ff" -dependencies = [ - "version_check", -] - [[package]] name = "state" -version = "0.5.1" +version = "0.5.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0b54c22963194db84a59ee48e1fa9ed6c1fa9909ad5db92a700aa6fe956d632b" +checksum = "dbe866e1e51e8260c9eed836a042a5e7f6726bb2b411dffeaa712e19c388f23b" dependencies = [ "loom", ] -[[package]] -name = "stdweb" -version = "0.4.20" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d022496b16281348b52d0e30ae99e01a73d737b2f45d38fed4edf79f9325a1d5" -dependencies = [ - "discard", - "rustc_version", - "stdweb-derive", - "stdweb-internal-macros", - "stdweb-internal-runtime", - "wasm-bindgen", -] - -[[package]] -name = "stdweb-derive" -version = "0.5.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c87a60a40fccc84bef0652345bbbbbe20a605bf5d0ce81719fc476f5c03b50ef" -dependencies = [ - "proc-macro2", - "quote", - "serde", - "serde_derive", - "syn", -] - -[[package]] -name = "stdweb-internal-macros" -version = "0.2.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "58fa5ff6ad0d98d1ffa8cb115892b6e69d67799f6763e162a1c9db421dc22e11" -dependencies = [ - "base-x", - "proc-macro2", - "quote", - "serde", - "serde_derive", - "serde_json", - "sha1", - "syn", -] - -[[package]] -name = "stdweb-internal-runtime" -version = "0.1.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "213701ba3370744dcd1a12960caa4843b3d68b4d1c0a5d575e0d65b2ee9d16c0" - [[package]] name = "subtle" -version = "2.4.0" +version = "2.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1e81da0851ada1f3e9d4312c704aa4f8806f0f9d69faaf8df2f3464b4a9437c2" +checksum = "6bdef32e8150c2a081110b42772ffe7d7c9032b606bc226c8260fd97e0976601" [[package]] name = "syn" -version = "1.0.73" +version = "2.0.40" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f71489ff30030d2ae598524f61326b902466f72a0fb1a8564c001cc63425bcc7" +checksum = "13fa70a4ee923979ffb522cacce59d34421ebdea5625e1073c4326ef9d2dd42e" dependencies = [ "proc-macro2", "quote", - "unicode-xid", + "unicode-ident", ] [[package]] name = "tempfile" -version = "3.2.0" +version = "3.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dac1c663cfc93810f88aed9b8941d48cabf856a1b111c29a40439018d870eb22" +checksum = "cb94d2f3cc536af71caac6b6fcebf65860b347e7ce0cc9ebe8f70d3e521054ef" dependencies = [ "cfg-if", - "libc", - "rand", - "redox_syscall", - "remove_dir_all", - "winapi", + "fastrand", + "redox_syscall 0.3.5", + "rustix", + "windows-sys 0.48.0", ] [[package]] @@ -1273,67 +1196,56 @@ dependencies = [ ] [[package]] -name = "time" -version = "0.2.26" +name = "thread_local" +version = "1.1.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "08a8cbfbf47955132d0202d1662f49b2423ae35862aee471f3ba4b133358f372" +checksum = "3fdd6f064ccff2d6567adcb3873ca630700f00b5ad3f060c25b5dcfd9a4ce152" dependencies = [ - "const_fn", + "cfg-if", + "once_cell", +] + +[[package]] +name = "time" +version = "0.3.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d634a985c4d4238ec39cacaed2e7ae552fbd3c476b552c1deac3021b7d7eaf0c" +dependencies = [ + "itoa", "libc", - "standback", - "stdweb", + "num_threads", "time-macros", - "version_check", - "winapi", ] [[package]] name = "time-macros" -version = "0.1.1" +version = "0.2.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "957e9c6e26f12cb6d0dd7fc776bb67a706312e7299aed74c8dd5b17ebb27e2f1" -dependencies = [ - "proc-macro-hack", - "time-macros-impl", -] - -[[package]] -name = "time-macros-impl" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e5c3be1edfad6027c69f5491cf4cb310d1a71ecd6af742788c6ff8bced86b8fa" -dependencies = [ - "proc-macro-hack", - "proc-macro2", - "quote", - "standback", - "syn", -] +checksum = "42657b1a6f4d817cda8e7a0ace261fe0cc946cf3a80314390b22cc61ae080792" [[package]] name = "tokio" -version = "1.6.1" +version = "1.35.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0a38d31d7831c6ed7aad00aa4c12d9375fd225a6dd77da1d25b707346319a975" +checksum = "841d45b238a16291a4e1584e61820b8ae57d696cc5015c459c229ccc6990cc1c" dependencies = [ - "autocfg", + "backtrace", "bytes", "libc", - "memchr", "mio", "num_cpus", - "once_cell", "pin-project-lite", "signal-hook-registry", + "socket2 0.5.5", "tokio-macros", - "winapi", + "windows-sys 0.48.0", ] [[package]] name = "tokio-macros" -version = "1.2.0" +version = "2.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c49e3df43841dafb86046472506755d8501c5615673955f6aa17181125d13c37" +checksum = "5b8a1e28f2deaa14e508979454cb3a223b10b938b45af148bc0986de36f1923b" dependencies = [ "proc-macro2", "quote", @@ -1342,9 +1254,9 @@ dependencies = [ [[package]] name = "tokio-stream" -version = "0.1.6" +version = "0.1.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f8864d706fdb3cc0843a49647ac892720dac98a6eeb818b77190592cf4994066" +checksum = "397c988d37662c7dda6d2208364a706264bf3d6138b11d436cbac0ad38832842" dependencies = [ "futures-core", "pin-project-lite", @@ -1353,187 +1265,168 @@ dependencies = [ [[package]] name = "tokio-util" -version = "0.6.7" +version = "0.7.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1caa0b0c8d94a049db56b5acf8cba99dc0623aab1b26d5b5f5e2d945846b3592" +checksum = "5419f34732d9eb6ee4c3578b7989078579b7f039cbbb9ca2c4da015749371e15" dependencies = [ "bytes", "futures-core", "futures-sink", - "log", "pin-project-lite", "tokio", ] [[package]] name = "toml" -version = "0.5.8" +version = "0.5.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a31142970826733df8241ef35dc040ef98c679ab14d7c3e54d827099b3acecaa" +checksum = "f4f7f0dd8d50a853a531c426359045b1998f04219d88799810762cd4ad314234" dependencies = [ "serde", ] [[package]] name = "tower-service" -version = "0.3.1" +version = "0.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "360dfd1d6d30e05fda32ace2c8c70e9c0a9da713275777f5a4dbb8a1893930c6" +checksum = "b6bc1c9ce2b5135ac7f93c72918fc37feb872bdc6a5533a8b85eb4b86bfdae52" [[package]] name = "tracing" -version = "0.1.26" +version = "0.1.40" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "09adeb8c97449311ccd28a427f96fb563e7fd31aabf994189879d9da2394b89d" +checksum = "c3523ab5a71916ccf420eebdf5521fcef02141234bbc0b8a49f2fdc4544364ef" dependencies = [ - "cfg-if", "pin-project-lite", + "tracing-attributes", "tracing-core", ] [[package]] -name = "tracing-core" -version = "0.1.18" +name = "tracing-attributes" +version = "0.1.27" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a9ff14f98b1a4b289c6248a023c1c2fa1491062964e9fed67ab29c4e4da4a052" +checksum = "34704c8d6ebcbc939824180af020566b01a7c01f80641264eba0999f6c2b6be7" dependencies = [ - "lazy_static", + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "tracing-core" +version = "0.1.32" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c06d3da6113f116aaee68e4d601191614c9053067f9ab7f6edbcb161237daa54" +dependencies = [ + "once_cell", + "valuable", +] + +[[package]] +name = "tracing-log" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ee855f1f400bd0e5c02d150ae5de3840039a3f54b025156404e34c23c03f47c3" +dependencies = [ + "log", + "once_cell", + "tracing-core", +] + +[[package]] +name = "tracing-subscriber" +version = "0.3.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ad0f048c97dbd9faa9b7df56362b8ebcaa52adb06b498c050d2f4e32f90a7a8b" +dependencies = [ + "matchers", + "nu-ansi-term", + "once_cell", + "regex", + "sharded-slab", + "smallvec", + "thread_local", + "tracing", + "tracing-core", + "tracing-log", ] [[package]] name = "try-lock" -version = "0.2.3" +version = "0.2.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "59547bce71d9c38b83d9c0e92b6066c4253371f15005def0c30d9657f50c7642" - -[[package]] -name = "twoway" -version = "0.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c57ffb460d7c24cd6eda43694110189030a3d1dfe418416d9468fd1c1d290b47" -dependencies = [ - "memchr", - "unchecked-index", -] +checksum = "e421abadd41a4225275504ea4d6566923418b7f05506fbc9c0fe86ba7396114b" [[package]] name = "typenum" -version = "1.13.0" +version = "1.17.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "879f6906492a7cd215bfa4cf595b600146ccfac0c79bcbd1f3000162af5e8b06" +checksum = "42ff0bf0c66b8238c6f3b578df37d0b7848e55df8577b3f74f92a69acceeb825" [[package]] name = "ubyte" -version = "0.10.1" +version = "0.10.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "42756bb9e708855de2f8a98195643dff31a97f0485d90d8467b39dc24be9e8fe" +checksum = "f720def6ce1ee2fc44d40ac9ed6d3a59c361c80a75a7aa8e75bb9baed31cf2ea" dependencies = [ "serde", ] [[package]] name = "uncased" -version = "0.9.6" +version = "0.9.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5baeed7327e25054889b9bd4f975f32e5f4c5d434042d59ab6cd4142c0a76ed0" +checksum = "9b9bc53168a4be7402ab86c3aad243a84dd7381d09be0eddc81280c1da95ca68" dependencies = [ "serde", "version_check", ] [[package]] -name = "unchecked-index" -version = "0.2.2" +name = "unicode-ident" +version = "1.0.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eeba86d422ce181a719445e51872fa30f1f7413b62becb52e95ec91aa262d85c" +checksum = "3354b9ac3fae1ff6755cb6db53683adb661634f67557942dea4facebec0fee4b" [[package]] name = "unicode-width" -version = "0.1.8" +version = "0.1.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9337591893a19b88d8d87f2cec1e73fad5cdfd10e5a6f349f498ad6ea2ffb1e3" +checksum = "e51733f11c9c4f72aa0c160008246859e340b00807569a0da0e7a1079b27ba85" [[package]] name = "unicode-xid" -version = "0.2.2" +version = "0.2.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8ccb82d61f80a663efe1f787a51b16b5a51e3314d6ac365b08639f52387b33f3" +checksum = "f962df74c8c05a667b5ee8bcf162993134c104e96440b663c8daa176dc772d8c" + +[[package]] +name = "valuable" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "830b7e5d4d90034032940e4ace0d9a9a057e7a45cd94e6c007832e39edb82f6d" [[package]] name = "version_check" -version = "0.9.3" +version = "0.9.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5fecdca9a5291cc2b8dcf7dc02453fee791a280f3743cb0905f8822ae463b3fe" +checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f" [[package]] name = "want" -version = "0.3.0" +version = "0.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1ce8a968cb1cd110d136ff8b819a556d6fb6d919363c61534f6860c7eb172ba0" +checksum = "bfa7760aed19e106de2c7c0b581b509f2f25d3dacaf737cb82ac61bc6d760b0e" dependencies = [ - "log", "try-lock", ] [[package]] name = "wasi" -version = "0.10.2+wasi-snapshot-preview1" +version = "0.11.0+wasi-snapshot-preview1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fd6fbd9a79829dd1ad0cc20627bf1ed606756a7f77edff7b66b7064f9cb327c6" - -[[package]] -name = "wasm-bindgen" -version = "0.2.74" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d54ee1d4ed486f78874278e63e4069fc1ab9f6a18ca492076ffb90c5eb2997fd" -dependencies = [ - "cfg-if", - "wasm-bindgen-macro", -] - -[[package]] -name = "wasm-bindgen-backend" -version = "0.2.74" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3b33f6a0694ccfea53d94db8b2ed1c3a8a4c86dd936b13b9f0a15ec4a451b900" -dependencies = [ - "bumpalo", - "lazy_static", - "log", - "proc-macro2", - "quote", - "syn", - "wasm-bindgen-shared", -] - -[[package]] -name = "wasm-bindgen-macro" -version = "0.2.74" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "088169ca61430fe1e58b8096c24975251700e7b1f6fd91cc9d59b04fb9b18bd4" -dependencies = [ - "quote", - "wasm-bindgen-macro-support", -] - -[[package]] -name = "wasm-bindgen-macro-support" -version = "0.2.74" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "be2241542ff3d9f241f5e2cb6dd09b37efe786df8851c54957683a49f0987a97" -dependencies = [ - "proc-macro2", - "quote", - "syn", - "wasm-bindgen-backend", - "wasm-bindgen-shared", -] - -[[package]] -name = "wasm-bindgen-shared" -version = "0.2.74" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d7cff876b8f18eed75a66cf49b65e7f967cb354a7aa16003fb55dbfd25b44b4f" +checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" [[package]] name = "winapi" @@ -1557,6 +1450,147 @@ version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" +[[package]] +name = "windows" +version = "0.48.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e686886bc078bc1b0b600cac0147aadb815089b6e4da64016cbd754b6342700f" +dependencies = [ + "windows-targets 0.48.5", +] + +[[package]] +name = "windows-sys" +version = "0.48.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "677d2418bec65e3338edb076e806bc1ec15693c5d0104683f2efe857f61056a9" +dependencies = [ + "windows-targets 0.48.5", +] + +[[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.0", +] + +[[package]] +name = "windows-targets" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9a2fa6e2155d7247be68c096456083145c183cbbbc2764150dda45a87197940c" +dependencies = [ + "windows_aarch64_gnullvm 0.48.5", + "windows_aarch64_msvc 0.48.5", + "windows_i686_gnu 0.48.5", + "windows_i686_msvc 0.48.5", + "windows_x86_64_gnu 0.48.5", + "windows_x86_64_gnullvm 0.48.5", + "windows_x86_64_msvc 0.48.5", +] + +[[package]] +name = "windows-targets" +version = "0.52.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8a18201040b24831fbb9e4eb208f8892e1f50a37feb53cc7ff887feb8f50e7cd" +dependencies = [ + "windows_aarch64_gnullvm 0.52.0", + "windows_aarch64_msvc 0.52.0", + "windows_i686_gnu 0.52.0", + "windows_i686_msvc 0.52.0", + "windows_x86_64_gnu 0.52.0", + "windows_x86_64_gnullvm 0.52.0", + "windows_x86_64_msvc 0.52.0", +] + +[[package]] +name = "windows_aarch64_gnullvm" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2b38e32f0abccf9987a4e3079dfb67dcd799fb61361e53e2882c3cbaf0d905d8" + +[[package]] +name = "windows_aarch64_gnullvm" +version = "0.52.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cb7764e35d4db8a7921e09562a0304bf2f93e0a51bfccee0bd0bb0b666b015ea" + +[[package]] +name = "windows_aarch64_msvc" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dc35310971f3b2dbbf3f0690a219f40e2d9afcf64f9ab7cc1be722937c26b4bc" + +[[package]] +name = "windows_aarch64_msvc" +version = "0.52.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bbaa0368d4f1d2aaefc55b6fcfee13f41544ddf36801e793edbbfd7d7df075ef" + +[[package]] +name = "windows_i686_gnu" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a75915e7def60c94dcef72200b9a8e58e5091744960da64ec734a6c6e9b3743e" + +[[package]] +name = "windows_i686_gnu" +version = "0.52.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a28637cb1fa3560a16915793afb20081aba2c92ee8af57b4d5f28e4b3e7df313" + +[[package]] +name = "windows_i686_msvc" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8f55c233f70c4b27f66c523580f78f1004e8b5a8b659e05a4eb49d4166cca406" + +[[package]] +name = "windows_i686_msvc" +version = "0.52.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ffe5e8e31046ce6230cc7215707b816e339ff4d4d67c65dffa206fd0f7aa7b9a" + +[[package]] +name = "windows_x86_64_gnu" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "53d40abd2583d23e4718fddf1ebec84dbff8381c07cae67ff7768bbf19c6718e" + +[[package]] +name = "windows_x86_64_gnu" +version = "0.52.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3d6fa32db2bc4a2f5abeacf2b69f7992cd09dca97498da74a151a3132c26befd" + +[[package]] +name = "windows_x86_64_gnullvm" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0b7b52767868a23d5bab768e390dc5f5c55825b6d30b86c844ff2dc7414044cc" + +[[package]] +name = "windows_x86_64_gnullvm" +version = "0.52.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1a657e1e9d3f514745a572a6846d3c7aa7dbe1658c056ed9c3344c4109a6949e" + +[[package]] +name = "windows_x86_64_msvc" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ed94fce61571a4006852b7389a063ab983c02eb1bb37b47f8272ce92d06d9538" + +[[package]] +name = "windows_x86_64_msvc" +version = "0.52.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dff9641d1cd4be8d1a070daf9e3773c5f67e78b4d9d42263020c057706765c04" + [[package]] name = "yaml-rust" version = "0.4.5" @@ -1568,6 +1602,12 @@ dependencies = [ [[package]] name = "yansi" -version = "0.5.0" +version = "0.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9fc79f4a1e39857fc00c3f662cbf2651c771f00e9c15fe2abc341806bd46bd71" +checksum = "09041cd90cf85f7f8b2df60c646f853b7f535ce68f85244eb6731cf89fa498ec" + +[[package]] +name = "yansi" +version = "1.0.0-rc.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1367295b8f788d371ce2dbc842c7b709c73ee1364d30351dd300ec2203b12377" From 075ca9a23c51934cdb5da56cb32765bce34636ca Mon Sep 17 00:00:00 2001 From: Antoine Martin Date: Tue, 12 Dec 2023 15:06:59 +0100 Subject: [PATCH 49/61] fix clippy lints --- src/gitea.rs | 1 - src/signature.rs | 6 ++---- 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/src/gitea.rs b/src/gitea.rs index eae1528..0923483 100644 --- a/src/gitea.rs +++ b/src/gitea.rs @@ -2,7 +2,6 @@ use serde::Deserialize; #[derive(Clone, Deserialize)] pub(crate) struct Repository { - pub(crate) name: String, pub(crate) full_name: String, pub(crate) ssh_url: String, } diff --git a/src/signature.rs b/src/signature.rs index 3e7cc62..c062874 100644 --- a/src/signature.rs +++ b/src/signature.rs @@ -106,11 +106,9 @@ where return Outcome::Failure((Status::BadRequest, anyhow!("couldn't verify signature"))); } - let content = match Self::from_str(local_cache!(request, content)) { + match Self::from_str(local_cache!(request, content)) { Ok(content) => Outcome::Success(content), Err(e) => Outcome::Failure((Status::BadRequest, e)), - }; - - content + } } } From 708c350c9aa05f9e4ae7168e826e43ceb29e97a0 Mon Sep 17 00:00:00 2001 From: Antoine Martin Date: Tue, 12 Dec 2023 15:09:13 +0100 Subject: [PATCH 50/61] ci: bump cachix workflow actions --- .github/workflows/cachix.yaml | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/.github/workflows/cachix.yaml b/.github/workflows/cachix.yaml index 52d09c0..5180cb6 100644 --- a/.github/workflows/cachix.yaml +++ b/.github/workflows/cachix.yaml @@ -9,14 +9,9 @@ jobs: build: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 - - uses: cachix/install-nix-action@v13 - with: - install_url: https://nixos-nix-install-tests.cachix.org/serve/i6laym9jw3wg9mw6ncyrk6gjx4l34vvx/install - install_options: '--tarball-url-prefix https://nixos-nix-install-tests.cachix.org/serve' - extra_nix_config: | - experimental-features = nix-command flakes - - uses: cachix/cachix-action@v10 + - uses: actions/checkout@v4 + - uses: cachix/install-nix-action@v24 + - uses: cachix/cachix-action@v12 with: name: alarsyo authToken: '${{ secrets.CACHIX_AUTH_TOKEN }}' From 66d965beeeec6889e926f850bee90ed80d51985b Mon Sep 17 00:00:00 2001 From: Antoine Martin Date: Tue, 12 Dec 2023 15:15:56 +0100 Subject: [PATCH 51/61] ci: update rust actions --- .github/workflows/ci.yaml | 48 ++++++++------------------------------- 1 file changed, 10 insertions(+), 38 deletions(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 91d8a67..829a886 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -8,62 +8,34 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout sources - uses: actions/checkout@v2 + uses: actions/checkout@v4 - name: Install stable toolchain - uses: actions-rs/toolchain@v1 - with: - profile: minimal - toolchain: stable - override: true + uses: dtolnay/rust-toolchain@stable - - name: Run cargo check - uses: actions-rs/cargo@v1 - with: - command: check + - run: cargo check test: name: Test Suite runs-on: ubuntu-latest steps: - name: Checkout sources - uses: actions/checkout@v2 + uses: actions/checkout@v4 - name: Install stable toolchain - uses: actions-rs/toolchain@v1 - with: - profile: minimal - toolchain: stable - override: true + uses: dtolnay/rust-toolchain@stable - - name: Run cargo test - uses: actions-rs/cargo@v1 - with: - command: test + - run: cargo test lints: name: Lints runs-on: ubuntu-latest steps: - name: Checkout sources - uses: actions/checkout@v2 + uses: actions/checkout@v4 - name: Install stable toolchain - uses: actions-rs/toolchain@v1 - with: - profile: minimal - toolchain: stable - override: true - components: rustfmt, clippy + uses: dtolnay/rust-toolchain@stable - - name: Run cargo fmt - uses: actions-rs/cargo@v1 - with: - command: fmt - args: --all -- --check - - - name: Run cargo clippy - uses: actions-rs/clippy-check@v1 - with: - token: ${{ secrets.GITHUB_TOKEN }} - args: --all-features -- -D warnings + - run: cargo fmt --all -- --check + - run: cargo clippy --all-features -- -D warnings From 689c57a14005ab797e639e6e82f5e8bda5bde876 Mon Sep 17 00:00:00 2001 From: Antoine Martin Date: Tue, 12 Dec 2023 15:18:32 +0100 Subject: [PATCH 52/61] ci: make them runnable manually --- .github/workflows/cachix.yaml | 1 + .github/workflows/ci.yaml | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/cachix.yaml b/.github/workflows/cachix.yaml index 5180cb6..3d958b4 100644 --- a/.github/workflows/cachix.yaml +++ b/.github/workflows/cachix.yaml @@ -1,5 +1,6 @@ name: "Cachix build" on: + workflow_dispatch: push: paths: - 'flake.nix' diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 829a886..375762a 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -1,4 +1,4 @@ -on: [push, pull_request] +on: [push, pull_request, workflow_dispatch] name: CI From 77e5214561cfe8db346214c10705369e6e7e9363 Mon Sep 17 00:00:00 2001 From: Antoine Martin Date: Tue, 12 Dec 2023 15:24:22 +0100 Subject: [PATCH 53/61] lohr: v0.4.3 --- Cargo.lock | 2 +- Cargo.toml | 2 +- flake.nix | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 3607639..517b9d1 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -546,7 +546,7 @@ checksum = "b5e6163cb8c49088c2c36f57875e58ccd8c87c7427f7fbd50ea6710b2f3f2e8f" [[package]] name = "lohr" -version = "0.4.2" +version = "0.4.3" dependencies = [ "anyhow", "clap", diff --git a/Cargo.toml b/Cargo.toml index 885d794..31a76cd 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "lohr" -version = "0.4.2" +version = "0.4.3" authors = ["Antoine Martin "] edition = "2018" license = "Apache-2.0 OR MIT" diff --git a/flake.nix b/flake.nix index f3e9647..19c87ed 100644 --- a/flake.nix +++ b/flake.nix @@ -16,11 +16,11 @@ { defaultPackage = pkgs.rustPlatform.buildRustPackage { pname = "lohr"; - version = "0.4.2"; + version = "0.4.3"; src = ./.; - cargoSha256 = "sha256-YHg4b6rKcnVJSDoWh9/o+p40NBog65Gd2/UwIDXiUe0="; + cargoSha256 = "sha256-712J8squ4txjdKH5buKpCl7ss2NSNRYM/m548Z6RSzQ="; meta = with pkgs.lib; { description = "A Git mirroring tool"; From b04748a8045e1df793838c5e1181a37a1f78d6a4 Mon Sep 17 00:00:00 2001 From: Antoine Martin Date: Tue, 12 Dec 2023 15:36:56 +0100 Subject: [PATCH 54/61] cargo: bump rocket to v0.5 --- Cargo.lock | 69 ++++++++++++++++++++++++++++++------------------ Cargo.toml | 2 +- flake.nix | 2 +- src/signature.rs | 12 ++++----- 4 files changed, 52 insertions(+), 33 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 517b9d1..f2e4ce1 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -153,9 +153,9 @@ dependencies = [ [[package]] name = "cookie" -version = "0.17.0" +version = "0.18.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7efb37c3e1ccb1ff97164ad95ac1606e8ccd35b3fa0a7d99a304c7f4a428cc24" +checksum = "3cd91cf61412820176e137621345ee43b3f4423e589e7ae4e50d601d93e35ef8" dependencies = [ "percent-encoding", "time", @@ -238,6 +238,12 @@ dependencies = [ "cfg-if", ] +[[package]] +name = "equivalent" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5443807d6dff69373d433ab9ef5378ad8df50ca6298caf15de6e52e24aaf54d5" + [[package]] name = "errno" version = "0.3.8" @@ -391,6 +397,12 @@ version = "0.12.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8a9ee70c43aaf417c914396645a0fa852624801b24ebb7ae78fe8272889ac888" +[[package]] +name = "hashbrown" +version = "0.14.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "290f1a1d9242c78d09ce40a5e87e7554ee637af1351968159f4952f028f75604" + [[package]] name = "hermit-abi" version = "0.3.3" @@ -477,7 +489,17 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bd070e393353796e801d209ad339e89596eb4c8d430d18ede6a1cced8fafbd99" dependencies = [ "autocfg", - "hashbrown", + "hashbrown 0.12.3", +] + +[[package]] +name = "indexmap" +version = "2.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d530e1a18b1cb4c484e6e34556a0d948706958449fca0cab753d649f2bce3d1f" +dependencies = [ + "equivalent", + "hashbrown 0.14.3", "serde", ] @@ -725,7 +747,7 @@ checksum = "61a386cd715229d399604b50d1361683fe687066f42d56f54be995bc6868f71c" dependencies = [ "inlinable_string", "pear_codegen", - "yansi 1.0.0-rc.1", + "yansi", ] [[package]] @@ -783,7 +805,7 @@ dependencies = [ "quote", "syn", "version_check", - "yansi 1.0.0-rc.1", + "yansi", ] [[package]] @@ -891,9 +913,9 @@ checksum = "f162c6dd7b008981e4d40210aca20b4bd0f9b60ca9271061b07f78537722f2e1" [[package]] name = "rocket" -version = "0.5.0-rc.3" +version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "58734f7401ae5cfd129685b48f61182331745b357b96f2367f01aebaf1cc9cc9" +checksum = "9e7bb57ccb26670d73b6a47396c83139447b9e7878cab627fdfe9ea8da489150" dependencies = [ "async-stream", "async-trait", @@ -903,8 +925,7 @@ dependencies = [ "either", "figment", "futures", - "indexmap", - "is-terminal", + "indexmap 2.1.0", "log", "memchr", "multer", @@ -924,37 +945,38 @@ dependencies = [ "tokio-util", "ubyte", "version_check", - "yansi 0.5.1", + "yansi", ] [[package]] name = "rocket_codegen" -version = "0.5.0-rc.3" +version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7093353f14228c744982e409259fb54878ba9563d08214f2d880d59ff2fc508b" +checksum = "a2238066abf75f21be6cd7dc1a09d5414a671f4246e384e49fe3f8a4936bd04c" dependencies = [ "devise", "glob", - "indexmap", + "indexmap 2.1.0", "proc-macro2", "quote", "rocket_http", "syn", "unicode-xid", + "version_check", ] [[package]] name = "rocket_http" -version = "0.5.0-rc.3" +version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "936012c99162a03a67f37f9836d5f938f662e26f2717809761a9ac46432090f4" +checksum = "37a1663694d059fe5f943ea5481363e48050acedd241d46deb2e27f71110389e" dependencies = [ "cookie", "either", "futures", "http", "hyper", - "indexmap", + "indexmap 2.1.0", "log", "memchr", "pear", @@ -1060,7 +1082,7 @@ version = "0.8.26" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "578a7433b776b56a35785ed5ce9a7e777ac0598aac5a6dd1b4b18a307c7fc71b" dependencies = [ - "indexmap", + "indexmap 1.9.3", "ryu", "serde", "yaml-rust", @@ -1149,9 +1171,9 @@ dependencies = [ [[package]] name = "state" -version = "0.5.3" +version = "0.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dbe866e1e51e8260c9eed836a042a5e7f6726bb2b411dffeaa712e19c388f23b" +checksum = "2b8c4a4445d81357df8b1a650d0d0d6fbbbfe99d064aa5e02f3e4022061476d8" dependencies = [ "loom", ] @@ -1600,14 +1622,11 @@ dependencies = [ "linked-hash-map", ] -[[package]] -name = "yansi" -version = "0.5.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "09041cd90cf85f7f8b2df60c646f853b7f535ce68f85244eb6731cf89fa498ec" - [[package]] name = "yansi" version = "1.0.0-rc.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1367295b8f788d371ce2dbc842c7b709c73ee1364d30351dd300ec2203b12377" +dependencies = [ + "is-terminal", +] diff --git a/Cargo.toml b/Cargo.toml index 31a76cd..0bfb88d 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -24,7 +24,7 @@ serde_yaml = "0.8.17" sha2 = "0.9.3" [dependencies.rocket] -version = "0.5.0-rc.1" +version = "0.5.0" # don't need private-cookies default-features = false diff --git a/flake.nix b/flake.nix index 19c87ed..c5f771e 100644 --- a/flake.nix +++ b/flake.nix @@ -20,7 +20,7 @@ src = ./.; - cargoSha256 = "sha256-712J8squ4txjdKH5buKpCl7ss2NSNRYM/m548Z6RSzQ="; + cargoHash = "sha256-g9GWqZnO79j9VMndyRgx4FUBlsWqYo028tHegntxkgQ="; meta = with pkgs.lib; { description = "A Git mirroring tool"; diff --git a/src/signature.rs b/src/signature.rs index c062874..3f5cede 100644 --- a/src/signature.rs +++ b/src/signature.rs @@ -75,12 +75,12 @@ where async fn from_data(request: &'r Request<'_>, data: Data<'r>) -> Outcome<'r, Self> { let json_ct = ContentType::new("application", "json"); if request.content_type() != Some(&json_ct) { - return Outcome::Failure((Status::BadRequest, anyhow!("wrong content type"))); + return Outcome::Error((Status::BadRequest, anyhow!("wrong content type"))); } let signatures = request.headers().get(X_GITEA_SIGNATURE).collect::>(); if signatures.len() != 1 { - return Outcome::Failure(( + return Outcome::Error(( Status::BadRequest, anyhow!("request header needs exactly one signature"), )); @@ -91,24 +91,24 @@ where Ok(s) if s.is_complete() => s.into_inner(), Ok(_) => { let eof = io::ErrorKind::UnexpectedEof; - return Outcome::Failure(( + return Outcome::Error(( Status::PayloadTooLarge, io::Error::new(eof, "data limit exceeded").into(), )); } - Err(e) => return Outcome::Failure((Status::BadRequest, e.into())), + Err(e) => return Outcome::Error((Status::BadRequest, e.into())), }; let signature = signatures[0]; let secret = request.guard::<&State>().await.unwrap(); if !validate_signature(&secret.0, signature, &content) { - return Outcome::Failure((Status::BadRequest, anyhow!("couldn't verify signature"))); + return Outcome::Error((Status::BadRequest, anyhow!("couldn't verify signature"))); } match Self::from_str(local_cache!(request, content)) { Ok(content) => Outcome::Success(content), - Err(e) => Outcome::Failure((Status::BadRequest, e)), + Err(e) => Outcome::Error((Status::BadRequest, e)), } } } From 926f48f97984e08d5d27569534919d2776675d81 Mon Sep 17 00:00:00 2001 From: Antoine Martin Date: Tue, 12 Dec 2023 15:37:36 +0100 Subject: [PATCH 55/61] switch to new rust-toolchain format --- rust-toolchain | 1 - rust-toolchain.toml | 2 ++ 2 files changed, 2 insertions(+), 1 deletion(-) delete mode 100644 rust-toolchain create mode 100644 rust-toolchain.toml diff --git a/rust-toolchain b/rust-toolchain deleted file mode 100644 index 2bf5ad0..0000000 --- a/rust-toolchain +++ /dev/null @@ -1 +0,0 @@ -stable diff --git a/rust-toolchain.toml b/rust-toolchain.toml new file mode 100644 index 0000000..292fe49 --- /dev/null +++ b/rust-toolchain.toml @@ -0,0 +1,2 @@ +[toolchain] +channel = "stable" From b6445e6707cbecbb36cfe2699e02ac1cec7c3b1e Mon Sep 17 00:00:00 2001 From: Antoine Martin Date: Tue, 12 Dec 2023 15:39:39 +0100 Subject: [PATCH 56/61] lohr: v0.4.4 --- Cargo.lock | 2 +- Cargo.toml | 2 +- flake.nix | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index f2e4ce1..862176e 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -568,7 +568,7 @@ checksum = "b5e6163cb8c49088c2c36f57875e58ccd8c87c7427f7fbd50ea6710b2f3f2e8f" [[package]] name = "lohr" -version = "0.4.3" +version = "0.4.4" dependencies = [ "anyhow", "clap", diff --git a/Cargo.toml b/Cargo.toml index 0bfb88d..7296c1b 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "lohr" -version = "0.4.3" +version = "0.4.4" authors = ["Antoine Martin "] edition = "2018" license = "Apache-2.0 OR MIT" diff --git a/flake.nix b/flake.nix index c5f771e..23f8bba 100644 --- a/flake.nix +++ b/flake.nix @@ -16,11 +16,11 @@ { defaultPackage = pkgs.rustPlatform.buildRustPackage { pname = "lohr"; - version = "0.4.3"; + version = "0.4.4"; src = ./.; - cargoHash = "sha256-g9GWqZnO79j9VMndyRgx4FUBlsWqYo028tHegntxkgQ="; + cargoHash = "sha256-15OVia/oQXAGvjHTPTceKottKgEgFJRfHbzWdzCtcjY="; meta = with pkgs.lib; { description = "A Git mirroring tool"; From 298e895a0b8c6caf0e95e0a6d7d2451b7cd7b31e Mon Sep 17 00:00:00 2001 From: Antoine Martin Date: Tue, 12 Dec 2023 15:44:51 +0100 Subject: [PATCH 57/61] cargo: bump lock again --- Cargo.lock | 198 ++++++++++++++++++++++++++++++++++++++--------------- flake.nix | 2 +- 2 files changed, 142 insertions(+), 58 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 862176e..1cb500c 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -4,9 +4,9 @@ version = 3 [[package]] name = "addr2line" -version = "0.20.0" +version = "0.21.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f4fa78e18c64fce05e902adecd7a5eed15a5e0a3439f7b0e169f0252214865e3" +checksum = "8a30b2e23b9e17a9f90641c7ab1549cd9b44f296d3ccbf309d2863cfe398a0cb" dependencies = [ "gimli", ] @@ -19,9 +19,9 @@ checksum = "f26201604c87b1e01bd3d98f8d5d9a8fcbb815e8cedb41ffccbeb4bf593a35fe" [[package]] name = "aho-corasick" -version = "0.7.20" +version = "1.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cc936419f96fa211c1b9166887b38e5e40b19958e5b895be7c1f93adec7071ac" +checksum = "b2969dcb958b36655471fc61f7e416fa76033bdd4bfed0678d8fee1e2d07a1f0" dependencies = [ "memchr", ] @@ -71,6 +71,15 @@ version = "0.5.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c59bdb34bc650a32731b31bd8f0829cc15d24a708ee31559e0bb34f2bc320cba" +[[package]] +name = "atomic" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8d818003e740b63afc82337e3160717f4f63078720a810b7b903e70a5d1d2994" +dependencies = [ + "bytemuck", +] + [[package]] name = "autocfg" version = "1.1.0" @@ -79,9 +88,9 @@ checksum = "d468802bab17cbc0cc575e9b053f41e72aa36bfa6b7f55e3529ffa43161b97fa" [[package]] name = "backtrace" -version = "0.3.68" +version = "0.3.69" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4319208da049c43661739c5fade2ba182f09d1dc2299b32298d3a31692b17e12" +checksum = "2089b7e3f35b9dd2d0ed921ead4f6d318c27680d4a5bd167b3ee120edb105837" dependencies = [ "addr2line", "cc", @@ -119,6 +128,12 @@ dependencies = [ "generic-array", ] +[[package]] +name = "bytemuck" +version = "1.14.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "374d28ec25809ee0e23827c2ab573d729e293f281dfe393500e7ad618baa61c6" + [[package]] name = "bytes" version = "1.5.0" @@ -181,6 +196,15 @@ dependencies = [ "subtle", ] +[[package]] +name = "deranged" +version = "0.3.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8eb30d70a07a3b04884d2677f06bec33509dc67ca60d92949e5535352d3191dc" +dependencies = [ + "powerfmt", +] + [[package]] name = "devise" version = "0.4.1" @@ -262,11 +286,11 @@ checksum = "25cbce373ec4653f1a01a31e8a5e5ec0c622dc27ff9c4e6606eefef5cbbed4a5" [[package]] name = "figment" -version = "0.10.8" +version = "0.10.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4e56602b469b2201400dec66a66aec5a9b8761ee97cd1b8c96ab2483fcc16cc9" +checksum = "649f3e5d826594057e9a519626304d8da859ea8a0b18ce99500c586b8d45faee" dependencies = [ - "atomic", + "atomic 0.6.0", "pear", "serde", "toml", @@ -381,9 +405,9 @@ dependencies = [ [[package]] name = "gimli" -version = "0.27.3" +version = "0.28.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b6c80984affa11d98d1b88b66ac8853f143217b399d3c74116778ff8fdb4ed2e" +checksum = "4271d37baee1b8c7e4b708028c57d816cf9d2434acb33a549475f78c181f6253" [[package]] name = "glob" @@ -605,14 +629,14 @@ version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8263075bb86c5a1b1427b5ae862e8889656f126e9f77c484496e8b47cf5c5558" dependencies = [ - "regex-automata", + "regex-automata 0.1.10", ] [[package]] name = "memchr" -version = "2.5.0" +version = "2.6.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2dffe52ecf27772e601905b7522cb4ef790d2cc203488bbd0e2fe85fcb74566d" +checksum = "f665ee40bc4a3c5590afb1e9677db74a508659dfd71e126420da8274909a0167" [[package]] name = "mime" @@ -680,29 +704,20 @@ dependencies = [ "libc", ] -[[package]] -name = "num_threads" -version = "0.1.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2819ce041d2ee131036f4fc9d6ae7ae125a3a40e97ba64d04fe799ad9dabbb44" -dependencies = [ - "libc", -] - [[package]] name = "object" -version = "0.31.1" +version = "0.32.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8bda667d9f2b5051b8833f59f3bf748b28ef54f850f4fcb389a252aa383866d1" +checksum = "9cf5f9dd3933bd50a9e1f149ec995f39ae2c496d31fd772c1fd45ebc27e902b0" dependencies = [ "memchr", ] [[package]] name = "once_cell" -version = "1.17.2" +version = "1.19.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9670a07f94779e00908f3e686eab508878ebb390ba6e604d3a284c00e8d0487b" +checksum = "3fdb12b2476b595f9358c5161aa467c2438859caa136dec86c26fdd2efe17b92" [[package]] name = "opaque-debug" @@ -734,7 +749,7 @@ checksum = "4c42a9226546d68acdd9c0a280d17ce19bfe27a46bf68784e4066115788d008e" dependencies = [ "cfg-if", "libc", - "redox_syscall 0.4.1", + "redox_syscall", "smallvec", "windows-targets 0.48.5", ] @@ -780,6 +795,12 @@ version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184" +[[package]] +name = "powerfmt" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "439ee305def115ba05938db6eb1644ff94165c5ab5e9420d1c1bcedbba909391" + [[package]] name = "ppv-lite86" version = "0.2.17" @@ -847,15 +868,6 @@ dependencies = [ "getrandom", ] -[[package]] -name = "redox_syscall" -version = "0.3.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "567664f262709473930a4bf9e51bf2ebf3348f2e748ccc50dea20646858f8f29" -dependencies = [ - "bitflags 1.3.2", -] - [[package]] name = "redox_syscall" version = "0.4.1" @@ -887,13 +899,14 @@ dependencies = [ [[package]] name = "regex" -version = "1.7.3" +version = "1.10.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8b1f693b24f6ac912f4893ef08244d70b6067480d2f1a46e950c9691e6749d1d" +checksum = "380b951a9c5e80ddfd6136919eef32310721aa4aacd4889a8d39124b026ab343" dependencies = [ "aho-corasick", "memchr", - "regex-syntax", + "regex-automata 0.4.3", + "regex-syntax 0.8.2", ] [[package]] @@ -902,7 +915,18 @@ version = "0.1.10" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6c230d73fb8d8c1b9c0b3135c5142a8acee3a0558fb8db5cf1cb65f8d7862132" dependencies = [ - "regex-syntax", + "regex-syntax 0.6.29", +] + +[[package]] +name = "regex-automata" +version = "0.4.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5f804c7828047e88b2d32e2d7fe5a105da8ee3264f01902f796c8e067dc2483f" +dependencies = [ + "aho-corasick", + "memchr", + "regex-syntax 0.8.2", ] [[package]] @@ -911,6 +935,12 @@ version = "0.6.29" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f162c6dd7b008981e4d40210aca20b4bd0f9b60ca9271061b07f78537722f2e1" +[[package]] +name = "regex-syntax" +version = "0.8.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c08c74e62047bb2de4ff487b251e4a92e24f48745648451635cec7d591162d9f" + [[package]] name = "rocket" version = "0.5.0" @@ -919,7 +949,7 @@ checksum = "9e7bb57ccb26670d73b6a47396c83139447b9e7878cab627fdfe9ea8da489150" dependencies = [ "async-stream", "async-trait", - "atomic", + "atomic 0.5.3", "binascii", "bytes", "either", @@ -1000,15 +1030,15 @@ checksum = "d626bb9dae77e28219937af045c257c28bfd3f69333c512553507f5f9798cb76" [[package]] name = "rustix" -version = "0.38.9" +version = "0.38.28" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9bfe0f2582b4931a45d1fa608f8a8722e8b3c7ac54dd6d5f3b3212791fedef49" +checksum = "72e572a5e8ca657d7366229cdde4bd14c4eb5499a9573d4d366fe1b599daa316" dependencies = [ "bitflags 2.4.1", "errno", "libc", "linux-raw-sys", - "windows-sys 0.48.0", + "windows-sys 0.52.0", ] [[package]] @@ -1076,6 +1106,15 @@ dependencies = [ "serde", ] +[[package]] +name = "serde_spanned" +version = "0.6.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "12022b835073e5b11e90a14f86838ceb1c8fb0325b72416845c487ac0fa95e80" +dependencies = [ + "serde", +] + [[package]] name = "serde_yaml" version = "0.8.26" @@ -1197,13 +1236,13 @@ dependencies = [ [[package]] name = "tempfile" -version = "3.8.0" +version = "3.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cb94d2f3cc536af71caac6b6fcebf65860b347e7ce0cc9ebe8f70d3e521054ef" +checksum = "7ef1adac450ad7f4b3c28589471ade84f25f731a7a0fe30d71dfa9f60fd808e5" dependencies = [ "cfg-if", "fastrand", - "redox_syscall 0.3.5", + "redox_syscall", "rustix", "windows-sys 0.48.0", ] @@ -1229,21 +1268,32 @@ dependencies = [ [[package]] name = "time" -version = "0.3.15" +version = "0.3.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d634a985c4d4238ec39cacaed2e7ae552fbd3c476b552c1deac3021b7d7eaf0c" +checksum = "c4a34ab300f2dee6e562c10a046fc05e358b29f9bf92277f30c3c8d82275f6f5" dependencies = [ + "deranged", "itoa", - "libc", - "num_threads", + "powerfmt", + "serde", + "time-core", "time-macros", ] [[package]] -name = "time-macros" -version = "0.2.4" +name = "time-core" +version = "0.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "42657b1a6f4d817cda8e7a0ace261fe0cc946cf3a80314390b22cc61ae080792" +checksum = "ef927ca75afb808a4d64dd374f00a2adf8d0fcff8e7b184af886c3c87ec4a3f3" + +[[package]] +name = "time-macros" +version = "0.2.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4ad70d68dba9e1f8aceda7aa6711965dfec1cac869f311a51bd08b3a2ccbce20" +dependencies = [ + "time-core", +] [[package]] name = "tokio" @@ -1300,11 +1350,36 @@ dependencies = [ [[package]] name = "toml" -version = "0.5.11" +version = "0.8.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f4f7f0dd8d50a853a531c426359045b1998f04219d88799810762cd4ad314234" +checksum = "a1a195ec8c9da26928f773888e0742ca3ca1040c6cd859c919c9f59c1954ab35" dependencies = [ "serde", + "serde_spanned", + "toml_datetime", + "toml_edit", +] + +[[package]] +name = "toml_datetime" +version = "0.6.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3550f4e9685620ac18a50ed434eb3aec30db8ba93b0287467bca5826ea25baf1" +dependencies = [ + "serde", +] + +[[package]] +name = "toml_edit" +version = "0.21.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d34d383cd00a163b4a5b85053df514d45bc330f6de7737edfe0a93311d1eaa03" +dependencies = [ + "indexmap 2.1.0", + "serde", + "serde_spanned", + "toml_datetime", + "winnow", ] [[package]] @@ -1613,6 +1688,15 @@ version = "0.52.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "dff9641d1cd4be8d1a070daf9e3773c5f67e78b4d9d42263020c057706765c04" +[[package]] +name = "winnow" +version = "0.5.28" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6c830786f7720c2fd27a1a0e27a709dbd3c4d009b56d098fc742d4f4eab91fe2" +dependencies = [ + "memchr", +] + [[package]] name = "yaml-rust" version = "0.4.5" diff --git a/flake.nix b/flake.nix index 23f8bba..0b59374 100644 --- a/flake.nix +++ b/flake.nix @@ -20,7 +20,7 @@ src = ./.; - cargoHash = "sha256-15OVia/oQXAGvjHTPTceKottKgEgFJRfHbzWdzCtcjY="; + cargoHash = "sha256-daRn4E3ng2UVmkk7p5VFTmVugvnsNDUjMChUj7iSubE="; meta = with pkgs.lib; { description = "A Git mirroring tool"; From 24c0156b9754d562ef58d3dacbe3199984b7654f Mon Sep 17 00:00:00 2001 From: Antoine Martin Date: Tue, 12 Dec 2023 15:46:33 +0100 Subject: [PATCH 58/61] lohr: v0.4.5 --- Cargo.lock | 2 +- Cargo.toml | 2 +- flake.nix | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 1cb500c..89153a3 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -592,7 +592,7 @@ checksum = "b5e6163cb8c49088c2c36f57875e58ccd8c87c7427f7fbd50ea6710b2f3f2e8f" [[package]] name = "lohr" -version = "0.4.4" +version = "0.4.5" dependencies = [ "anyhow", "clap", diff --git a/Cargo.toml b/Cargo.toml index 7296c1b..b005c94 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "lohr" -version = "0.4.4" +version = "0.4.5" authors = ["Antoine Martin "] edition = "2018" license = "Apache-2.0 OR MIT" diff --git a/flake.nix b/flake.nix index 0b59374..4a16d38 100644 --- a/flake.nix +++ b/flake.nix @@ -16,11 +16,11 @@ { defaultPackage = pkgs.rustPlatform.buildRustPackage { pname = "lohr"; - version = "0.4.4"; + version = "0.4.5"; src = ./.; - cargoHash = "sha256-daRn4E3ng2UVmkk7p5VFTmVugvnsNDUjMChUj7iSubE="; + cargoHash = "sha256-hext0S0o9D9pN9epzXtD5dwAYMPCLpBBOBT4FX0mTMk="; meta = with pkgs.lib; { description = "A Git mirroring tool"; From aef4d65087e72ee1843384d1ff7b625b39fd25b4 Mon Sep 17 00:00:00 2001 From: Bruno BELANYI Date: Thu, 29 Aug 2024 19:29:26 +0100 Subject: [PATCH 59/61] cargo: bump time to fix compilation error --- Cargo.lock | 16 ++++++++++++---- flake.nix | 2 +- 2 files changed, 13 insertions(+), 5 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 89153a3..9c46a94 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -694,6 +694,12 @@ dependencies = [ "winapi", ] +[[package]] +name = "num-conv" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "51d515d32fb182ee37cda2ccdcb92950d6a3c2893aa280e540671c2cd0f3b1d9" + [[package]] name = "num_cpus" version = "1.16.0" @@ -1268,12 +1274,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", @@ -1288,10 +1295,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", ] diff --git a/flake.nix b/flake.nix index 4a16d38..c472471 100644 --- a/flake.nix +++ b/flake.nix @@ -20,7 +20,7 @@ src = ./.; - cargoHash = "sha256-hext0S0o9D9pN9epzXtD5dwAYMPCLpBBOBT4FX0mTMk="; + cargoHash = "sha256-U6lW2kN/2MXDIl97wg4dNdtm9C4K7gGP0cfhu49zRUQ="; meta = with pkgs.lib; { description = "A Git mirroring tool"; From 4d60965770b7676a17b5b8720c58a62d4006d7b4 Mon Sep 17 00:00:00 2001 From: Bruno BELANYI Date: Wed, 4 Sep 2024 10:01:53 +0000 Subject: [PATCH 60/61] lohr: v0.4.6 --- Cargo.lock | 2 +- Cargo.toml | 2 +- flake.nix | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 9c46a94..9107a86 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -592,7 +592,7 @@ checksum = "b5e6163cb8c49088c2c36f57875e58ccd8c87c7427f7fbd50ea6710b2f3f2e8f" [[package]] name = "lohr" -version = "0.4.5" +version = "0.4.6" dependencies = [ "anyhow", "clap", diff --git a/Cargo.toml b/Cargo.toml index b005c94..75eb262 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "lohr" -version = "0.4.5" +version = "0.4.6" authors = ["Antoine Martin "] edition = "2018" license = "Apache-2.0 OR MIT" diff --git a/flake.nix b/flake.nix index c472471..50fb0d0 100644 --- a/flake.nix +++ b/flake.nix @@ -16,11 +16,11 @@ { defaultPackage = pkgs.rustPlatform.buildRustPackage { pname = "lohr"; - version = "0.4.5"; + version = "0.4.6"; src = ./.; - cargoHash = "sha256-U6lW2kN/2MXDIl97wg4dNdtm9C4K7gGP0cfhu49zRUQ="; + cargoHash = "sha256-EUhyrhPe+mUgMmm4o+bxRIiSNReJRfw+/O1fPr8r7lo="; meta = with pkgs.lib; { description = "A Git mirroring tool"; From e0d2c988a0d1a148618791274aa15e5e4e2410c6 Mon Sep 17 00:00:00 2001 From: Antoine Martin Date: Sun, 23 Feb 2025 21:02:35 +0100 Subject: [PATCH 61/61] flake: update all inputs --- flake.lock | 20 ++++++++++---------- flake.nix | 2 +- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/flake.lock b/flake.lock index cb189f6..3507466 100644 --- a/flake.lock +++ b/flake.lock @@ -3,11 +3,11 @@ "flake-compat": { "flake": false, "locked": { - "lastModified": 1696426674, - "narHash": "sha256-kvjfFW7WAETZlt09AgDn1MrtKzP7t90Vf7vypd3OL1U=", + "lastModified": 1733328505, + "narHash": "sha256-NeCCThCEP3eCl2l/+27kNNK7QrwZB1IJCrXfrbv5oqU=", "owner": "edolstra", "repo": "flake-compat", - "rev": "0f9255e01c2351cc7d116c072cb317785dd33b33", + "rev": "ff81ac966bb2cae68946d5ed5fc4994f96d0ffec", "type": "github" }, "original": { @@ -21,11 +21,11 @@ "systems": "systems" }, "locked": { - "lastModified": 1701680307, - "narHash": "sha256-kAuep2h5ajznlPMD9rnQyffWG8EM/C73lejGofXvdM8=", + "lastModified": 1731533236, + "narHash": "sha256-l0KFg5HjrsfsO/JpG+r7fRrqm12kzFHyUHqHCVpMMbI=", "owner": "numtide", "repo": "flake-utils", - "rev": "4022d587cbbfd70fe950c1e2083a02621806a725", + "rev": "11707dc2f618dd54ca8739b309ec4fc024de578b", "type": "github" }, "original": { @@ -36,16 +36,16 @@ }, "nixpkgs": { "locked": { - "lastModified": 1702272962, - "narHash": "sha256-D+zHwkwPc6oYQ4G3A1HuadopqRwUY/JkMwHz1YF7j4Q=", + "lastModified": 1740162160, + "narHash": "sha256-SSYxFhqCOb3aiPb6MmN68yEzBIltfom8IgRz7phHscM=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "e97b3e4186bcadf0ef1b6be22b8558eab1cdeb5d", + "rev": "11415c7ae8539d6292f2928317ee7a8410b28bb9", "type": "github" }, "original": { "owner": "NixOS", - "ref": "nixpkgs-unstable", + "ref": "nixos-24.11", "repo": "nixpkgs", "type": "github" } diff --git a/flake.nix b/flake.nix index 50fb0d0..fdab2fb 100644 --- a/flake.nix +++ b/flake.nix @@ -1,6 +1,6 @@ { inputs = { - nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable"; + nixpkgs.url = "github:NixOS/nixpkgs/nixos-24.11"; flake-utils.url = "github:numtide/flake-utils"; flake-compat = { url = "github:edolstra/flake-compat";