diff --git a/.drone.yml b/.drone.yml index 62e235e..f7f8d7c 100644 --- a/.drone.yml +++ b/.drone.yml @@ -1,2 +1,171 @@ -kind: template -load: cuddle-rust-service-plan.yaml +kind: pipeline +name: default +type: docker + +steps: + - name: build ci + image: rustlang/rust:nightly + volumes: + - name: ci + path: /mnt/ci + environment: + PKG_CONFIG_SYSROOT_DIR: "/" + CI_PREFIX: "/mnt/ci" + commands: + - set -e + - apt update + - apt install musl-tools pkg-config libssl-dev openssl build-essential musl-dev -y + - rustup target add x86_64-unknown-linux-musl + - cd ci + - cargo build --target=x86_64-unknown-linux-musl + #- cargo build -p ci + - mv target/x86_64-unknown-linux-musl/debug/ci "$CI_PREFIX/ci" + #- mv target/debug/ci $CI_PREFIX/ci + + - name: load_secret + image: debian:buster-slim + volumes: + - name: ssh + path: /root/.ssh/ + environment: + SSH_KEY: + from_secret: gitea_id_ed25519 + commands: + - mkdir -p $HOME/.ssh/ + - echo "$SSH_KEY" | base64 -d > $HOME/.ssh/id_ed25519 + + - name: build pr + image: kasperhermansen/cuddle:latest + pull: always + volumes: + - name: ssh + path: /root/.ssh/ + - name: dockersock + path: /var/run + - name: ci + path: /mnt/ci + commands: + - eval `ssh-agent` + - chmod -R 600 ~/.ssh + - ssh-add + - echo "$DOCKER_PASSWORD" | docker login --password-stdin --username="$DOCKER_USERNAME" docker.io + - ldd $CI_PREFIX + - apk add git + - cuddle x ci:pr + environment: + DOCKER_BUILDKIT: 1 + DOCKER_PASSWORD: + from_secret: docker_password + DOCKER_USERNAME: + from_secret: docker_username + CUDDLE_SECRETS_PROVIDER: 1password + CUDDLE_ONE_PASSWORD_DOT_ENV: ".env.ci" + CUDDLE_SSH_AGENT: "true" + CI_PREFIX: "/mnt/ci/ci" + CUDDLE_PLEASE_TOKEN: + from_secret: cuddle_please_token + OP_SERVICE_ACCOUNT_TOKEN: + from_secret: op_service_account_token + when: + event: + - pull_request + exclude: + - main + - master + depends_on: + - "load_secret" + - "build ci" + + - name: build main + image: kasperhermansen/cuddle:latest + pull: always + volumes: + - name: ssh + path: /root/.ssh/ + - name: dockersock + path: /var/run + - name: ci + path: /mnt/ci + commands: + - eval `ssh-agent` + - chmod -R 600 ~/.ssh + - ssh-add + - echo "$DOCKER_PASSWORD" | docker login --password-stdin --username="$DOCKER_USERNAME" docker.io + - ldd $CI_PREFIX + - apk add git + - cuddle x ci:main + environment: + DOCKER_BUILDKIT: 1 + DOCKER_PASSWORD: + from_secret: docker_password + DOCKER_USERNAME: + from_secret: docker_username + CUDDLE_SECRETS_PROVIDER: 1password + CUDDLE_ONE_PASSWORD_DOT_ENV: ".env.ci" + CUDDLE_SSH_AGENT: "true" + CI_PREFIX: "/mnt/ci/ci" + CUDDLE_PLEASE_TOKEN: + from_secret: cuddle_please_token + OP_SERVICE_ACCOUNT_TOKEN: + from_secret: op_service_account_token + when: + event: + - push + branch: + - main + - master + exclude: + - pull_request + depends_on: + - "load_secret" + - "build ci" + + - name: deploy release + image: kasperhermansen/cuddle:latest + pull: always + volumes: + - name: ssh + path: /root/.ssh/ + - name: dockersock + path: /var/run + commands: + - eval `ssh-agent` + - chmod -R 600 ~/.ssh + - ssh-add + - cuddle x build:release:all + - cuddle x deploy:docs:preview + environment: + DOCKER_BUILDKIT: 1 + CUDDLE_SECRETS_PROVIDER: 1password + CUDDLE_ONE_PASSWORD_DOT_ENV: ".env.ci" + CUDDLE_SSH_AGENT: "true" + CUDDLE_CI: "true" + CUDDLE_PLEASE_TOKEN: + from_secret: cuddle_please_token + OP_SERVICE_ACCOUNT_TOKEN: + from_secret: op_service_account_token + when: + event: + - tag + ref: + include: + - refs/tags/v* + depends_on: + - "load_secret" + - "build ci" + +services: +- name: docker + image: docker:dind + privileged: true + volumes: + - name: dockersock + path: /var/run + +volumes: + - name: ssh + temp: {} + - name: dockersock + temp: {} + - name: ci + temp: {} \ No newline at end of file diff --git a/.gitignore b/.gitignore index 44911c4..b5cb2c5 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,3 @@ -target/ -.cuddle/ .env +.cuddle/ +target/ diff --git a/CHANGELOG.md b/CHANGELOG.md new file mode 100644 index 0000000..27cebe6 --- /dev/null +++ b/CHANGELOG.md @@ -0,0 +1,66 @@ +# Changelog +All notable changes to this project will be documented in this file. + +The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), +and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). + +## [Unreleased] + +## [0.2.1] - 2024-04-01 + +### Fixed +- *(deps)* update all dependencies to v61 +- *(deps)* update all dependencies +- *(deps)* update all dependencies +- *(deps)* update all dependencies to v58 +- *(deps)* update all dependencies +- *(deps)* update rust crate futures to 0.3.30 +- *(deps)* update all dependencies +- *(deps)* update all dependencies +- *(deps)* update all dependencies +- *(deps)* update all dependencies +- *(deps)* update rust crate futures to 0.3.29 +- *(deps)* update all dependencies +- *(deps)* update all dependencies +- *(deps)* update all dependencies + +## [0.2.0] - 2023-08-09 + +### Added +- *(github)* add github support + +### Docs +- *(README)* update with github support + +### Other +- *(app)* split the main command file into multiples + +## [0.1.1] - 2023-08-08 + +### Docs +- *(README)* add motivation why this project should exist + +### Other +- *(cuddle-please)* update + +## [0.1.0] - 2023-08-08 + +### Added +- add basic ci +- add basic readme +- with main loop +- with initial cmd and server + +### Docs +- *(README)* added some more milestones and fixed docker-compose +- add clarification about expectations and what milestones are missing +- add license +- clarification + +### Other +- Merge pull request 'Configure Renovate' (#1) from renovate/configure into main + +Reviewed-on: https://git.front.kjuulh.io/kjuulh/contractor/pulls/1 + +- Add renovate.json + diff --git a/Cargo.lock b/Cargo.lock deleted file mode 100644 index 476dccb..0000000 --- a/Cargo.lock +++ /dev/null @@ -1,3191 +0,0 @@ -# This file is automatically @generated by Cargo. -# It is not intended for manual editing. -version = 3 - -[[package]] -name = "addr2line" -version = "0.21.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8a30b2e23b9e17a9f90641c7ab1549cd9b44f296d3ccbf309d2863cfe398a0cb" -dependencies = [ - "gimli", -] - -[[package]] -name = "adler" -version = "1.0.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f26201604c87b1e01bd3d98f8d5d9a8fcbb815e8cedb41ffccbeb4bf593a35fe" - -[[package]] -name = "ahash" -version = "0.8.11" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e89da841a80418a9b391ebaea17f5c112ffaaa96f621d2c285b5174da76b9011" -dependencies = [ - "cfg-if", - "getrandom", - "once_cell", - "version_check", - "zerocopy", -] - -[[package]] -name = "aho-corasick" -version = "1.1.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8e60d3430d3a69478ad0993f19238d2df97c507009a52b3c10addcd7f6bcb916" -dependencies = [ - "memchr", -] - -[[package]] -name = "allocator-api2" -version = "0.2.18" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5c6cb57a04249c6480766f7f7cef5467412af1490f8d1e243141daddada3264f" - -[[package]] -name = "anstream" -version = "0.6.13" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d96bd03f33fe50a863e394ee9718a706f988b9079b20c3784fb726e7678b62fb" -dependencies = [ - "anstyle", - "anstyle-parse", - "anstyle-query", - "anstyle-wincon", - "colorchoice", - "utf8parse", -] - -[[package]] -name = "anstyle" -version = "1.0.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1bec1de6f59aedf83baf9ff929c98f2ad654b97c9510f4e70cf6f661d49fd5b1" - -[[package]] -name = "anstyle-parse" -version = "0.2.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c75ac65da39e5fe5ab759307499ddad880d724eed2f6ce5b5e8a26f4f387928c" -dependencies = [ - "utf8parse", -] - -[[package]] -name = "anstyle-query" -version = "1.0.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e28923312444cdd728e4738b3f9c9cac739500909bb3d3c94b43551b16517648" -dependencies = [ - "windows-sys 0.52.0", -] - -[[package]] -name = "anstyle-wincon" -version = "3.0.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1cd54b81ec8d6180e24654d0b371ad22fc3dd083b6ff8ba325b72e00c87660a7" -dependencies = [ - "anstyle", - "windows-sys 0.52.0", -] - -[[package]] -name = "anyhow" -version = "1.0.93" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4c95c10ba0b00a02636238b814946408b1322d5ac4760326e6fb8ec956d85775" - -[[package]] -name = "ascii" -version = "0.9.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eab1c04a571841102f5345a8fc0f6bb3d31c315dec879b5c6e42e40ce7ffa34e" - -[[package]] -name = "async-trait" -version = "0.1.80" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c6fa2087f2753a7da8cc1c0dbfcf89579dd57458e36769de5ac750b4671737ca" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.82", -] - -[[package]] -name = "atoi" -version = "2.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f28d99ec8bfea296261ca1af174f24225171fea9664ba9003cbebee704810528" -dependencies = [ - "num-traits", -] - -[[package]] -name = "autocfg" -version = "1.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f1fdabc7756949593fe60f30ec81974b613357de856987752631dea1e3394c80" - -[[package]] -name = "axum" -version = "0.7.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "504e3947307ac8326a5437504c517c4b56716c9d98fac0028c2acc7ca47d70ae" -dependencies = [ - "async-trait", - "axum-core", - "bytes", - "futures-util", - "http 1.1.0", - "http-body 1.0.0", - "http-body-util", - "hyper 1.2.0", - "hyper-util", - "itoa", - "matchit", - "memchr", - "mime", - "percent-encoding", - "pin-project-lite", - "rustversion", - "serde", - "serde_json", - "serde_path_to_error", - "serde_urlencoded", - "sync_wrapper 1.0.1", - "tokio", - "tower 0.5.1", - "tower-layer", - "tower-service", - "tracing", -] - -[[package]] -name = "axum-core" -version = "0.4.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "09f2bd6146b97ae3359fa0cc6d6b376d9539582c7b4220f041a33ec24c226199" -dependencies = [ - "async-trait", - "bytes", - "futures-util", - "http 1.1.0", - "http-body 1.0.0", - "http-body-util", - "mime", - "pin-project-lite", - "rustversion", - "sync_wrapper 1.0.1", - "tower-layer", - "tower-service", - "tracing", -] - -[[package]] -name = "backon" -version = "0.4.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d67782c3f868daa71d3533538e98a8e13713231969def7536e8039606fc46bf0" -dependencies = [ - "fastrand", - "futures-core", - "pin-project", - "tokio", -] - -[[package]] -name = "backtrace" -version = "0.3.71" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "26b05800d2e817c8b3b4b54abd461726265fa9789ae34330622f2db9ee696f9d" -dependencies = [ - "addr2line", - "cc", - "cfg-if", - "libc", - "miniz_oxide", - "object", - "rustc-demangle", -] - -[[package]] -name = "base64" -version = "0.21.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9d297deb1925b89f2ccc13d7635fa0714f12c87adce1c75356b39ca9b7178567" - -[[package]] -name = "base64" -version = "0.22.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9475866fec1451be56a3c2400fd081ff546538961565ccb5b7142cbd22bc7a51" - -[[package]] -name = "base64ct" -version = "1.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8c3c1a368f70d6cf7302d78f8f7093da241fb8e8807c05cc9e51a125895a6d5b" - -[[package]] -name = "bitflags" -version = "1.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" - -[[package]] -name = "bitflags" -version = "2.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cf4b9d6a944f767f8e5e0db018570623c85f3d925ac718db4e06d0187adb21c1" -dependencies = [ - "serde", -] - -[[package]] -name = "block-buffer" -version = "0.10.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3078c7629b62d3f0439517fa394996acacc5cbc91c5a20d8c658e77abd503a71" -dependencies = [ - "generic-array", -] - -[[package]] -name = "bumpalo" -version = "3.16.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "79296716171880943b8470b5f8d03aa55eb2e645a4874bdbb28adb49162e012c" - -[[package]] -name = "byteorder" -version = "1.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1fd0f2584146f6f2ef48085050886acf353beff7305ebd1ae69500e27c67f64b" - -[[package]] -name = "bytes" -version = "1.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "514de17de45fdb8dc022b1a7975556c53c86f9f0aa5f534b98977b171857c2c9" - -[[package]] -name = "cc" -version = "1.0.92" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2678b2e3449475e95b0aa6f9b506a28e61b3dc8996592b983695e8ebb58a8b41" - -[[package]] -name = "cfg-if" -version = "1.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" - -[[package]] -name = "clap" -version = "4.5.20" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b97f376d85a664d5837dbae44bf546e6477a679ff6610010f17276f686d867e8" -dependencies = [ - "clap_builder", - "clap_derive", -] - -[[package]] -name = "clap_builder" -version = "4.5.20" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "19bc80abd44e4bed93ca373a0704ccbd1b710dc5749406201bb018272808dc54" -dependencies = [ - "anstream", - "anstyle", - "clap_lex", - "strsim 0.11.1", -] - -[[package]] -name = "clap_derive" -version = "4.5.18" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4ac6a0c7b1a9e9a5186361f67dfa1b88213572f427fb9ab038efb2bd8c582dab" -dependencies = [ - "heck 0.5.0", - "proc-macro2", - "quote", - "syn 2.0.82", -] - -[[package]] -name = "clap_lex" -version = "0.7.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "98cc8fbded0c607b7ba9dd60cd98df59af97e84d24e49c8557331cfc26d301ce" - -[[package]] -name = "colorchoice" -version = "1.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "acbf1af155f9b9ef647e42cdc158db4b64a1b61f743629225fde6f3e0be2a7c7" - -[[package]] -name = "combine" -version = "3.8.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "da3da6baa321ec19e1cc41d31bf599f00c783d0517095cdaf0332e3fe8d20680" -dependencies = [ - "ascii", - "byteorder", - "either", - "memchr", - "unreachable", -] - -[[package]] -name = "const-oid" -version = "0.9.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c2459377285ad874054d797f3ccebf984978aa39129f6eafde5cdc8315b612f8" - -[[package]] -name = "contractor" -version = "0.1.0" -dependencies = [ - "anyhow", - "axum", - "backon", - "clap", - "dagger-sdk", - "dotenv", - "futures", - "itertools 0.13.0", - "regex", - "reqwest 0.12.5", - "serde", - "serde_json", - "sqlx", - "tokio", - "tower-http", - "tracing", - "tracing-subscriber", - "uuid", -] - -[[package]] -name = "core-foundation" -version = "0.9.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "91e195e091a93c46f7102ec7818a2aa394e1e1771c3ab4825963fa03e45afb8f" -dependencies = [ - "core-foundation-sys", - "libc", -] - -[[package]] -name = "core-foundation-sys" -version = "0.8.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "06ea2b9bc92be3c2baa9334a323ebca2d6f074ff852cd1d7b11064035cd3868f" - -[[package]] -name = "cpufeatures" -version = "0.2.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "53fe5e26ff1b7aef8bca9c6080520cfb8d9333c7568e1829cef191a9723e5504" -dependencies = [ - "libc", -] - -[[package]] -name = "crc" -version = "3.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "69e6e4d7b33a94f0991c26729976b10ebde1d34c3ee82408fb536164fa10d636" -dependencies = [ - "crc-catalog", -] - -[[package]] -name = "crc-catalog" -version = "2.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "19d374276b40fb8bbdee95aef7c7fa6b5316ec764510eb64b8dd0e2ed0d7e7f5" - -[[package]] -name = "crc32fast" -version = "1.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b3855a8a784b474f333699ef2bbca9db2c4a1f6d9088a90a2d25b1eb53111eaa" -dependencies = [ - "cfg-if", -] - -[[package]] -name = "crossbeam-queue" -version = "0.3.11" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "df0346b5d5e76ac2fe4e327c5fd1118d6be7c51dfb18f9b7922923f287471e35" -dependencies = [ - "crossbeam-utils", -] - -[[package]] -name = "crossbeam-utils" -version = "0.8.19" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "248e3bacc7dc6baa3b21e405ee045c3047101a49145e7e9eca583ab4c2ca5345" - -[[package]] -name = "crypto-common" -version = "0.1.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1bfb12502f3fc46cca1bb51ac28df9d618d813cdc3d2f25b9fe775a34af26bb3" -dependencies = [ - "generic-array", - "typenum", -] - -[[package]] -name = "dagger-sdk" -version = "0.9.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "79bc59868e62ea1451f158aeb8fbb36c5dd2fb098f31bf408dbd165251674edf" -dependencies = [ - "async-trait", - "base64 0.21.7", - "derive_builder", - "dirs", - "eyre", - "flate2", - "futures", - "graphql_client", - "hex", - "hex-literal", - "platform-info", - "reqwest 0.11.27", - "serde", - "serde_json", - "sha2", - "tar", - "tempfile", - "thiserror", - "tokio", - "tracing", - "tracing-subscriber", -] - -[[package]] -name = "darling" -version = "0.14.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7b750cb3417fd1b327431a470f388520309479ab0bf5e323505daf0290cd3850" -dependencies = [ - "darling_core", - "darling_macro", -] - -[[package]] -name = "darling_core" -version = "0.14.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "109c1ca6e6b7f82cc233a97004ea8ed7ca123a9af07a8230878fcfda9b158bf0" -dependencies = [ - "fnv", - "ident_case", - "proc-macro2", - "quote", - "strsim 0.10.0", - "syn 1.0.109", -] - -[[package]] -name = "darling_macro" -version = "0.14.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a4aab4dbc9f7611d8b55048a3a16d2d010c2c8334e46304b40ac1cc14bf3b48e" -dependencies = [ - "darling_core", - "quote", - "syn 1.0.109", -] - -[[package]] -name = "der" -version = "0.7.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f55bf8e7b65898637379c1b74eb1551107c8294ed26d855ceb9fd1a09cfc9bc0" -dependencies = [ - "const-oid", - "pem-rfc7468", - "zeroize", -] - -[[package]] -name = "deranged" -version = "0.3.11" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b42b6fa04a440b495c8b04d0e71b707c585f83cb9cb28cf8cd0d976c315e31b4" -dependencies = [ - "powerfmt", -] - -[[package]] -name = "derive_builder" -version = "0.12.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8d67778784b508018359cbc8696edb3db78160bab2c2a28ba7f56ef6932997f8" -dependencies = [ - "derive_builder_macro", -] - -[[package]] -name = "derive_builder_core" -version = "0.12.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c11bdc11a0c47bc7d37d582b5285da6849c96681023680b906673c5707af7b0f" -dependencies = [ - "darling", - "proc-macro2", - "quote", - "syn 1.0.109", -] - -[[package]] -name = "derive_builder_macro" -version = "0.12.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ebcda35c7a396850a55ffeac740804b40ffec779b98fffbb1738f4033f0ee79e" -dependencies = [ - "derive_builder_core", - "syn 1.0.109", -] - -[[package]] -name = "digest" -version = "0.10.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9ed9a281f7bc9b7576e61468ba615a66a5c8cfdff42420a70aa82701a3b1e292" -dependencies = [ - "block-buffer", - "const-oid", - "crypto-common", - "subtle", -] - -[[package]] -name = "dirs" -version = "5.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "44c45a9d03d6676652bcb5e724c7e988de1acad23a711b5217ab9cbecbec2225" -dependencies = [ - "dirs-sys", -] - -[[package]] -name = "dirs-sys" -version = "0.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "520f05a5cbd335fae5a99ff7a6ab8627577660ee5cfd6a94a6a929b52ff0321c" -dependencies = [ - "libc", - "option-ext", - "redox_users", - "windows-sys 0.48.0", -] - -[[package]] -name = "dotenv" -version = "0.15.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "77c90badedccf4105eca100756a0b1289e191f6fcbdadd3cee1d2f614f97da8f" - -[[package]] -name = "dotenvy" -version = "0.15.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1aaf95b3e5c8f23aa320147307562d361db0ae0d51242340f558153b4eb2439b" - -[[package]] -name = "either" -version = "1.10.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "11157ac094ffbdde99aa67b23417ebdd801842852b500e395a45a9c0aac03e4a" -dependencies = [ - "serde", -] - -[[package]] -name = "encoding_rs" -version = "0.8.34" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b45de904aa0b010bce2ab45264d0631681847fa7b6f2eaa7dab7619943bc4f59" -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" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a258e46cdc063eb8519c00b9fc845fc47bcfca4130e2f08e88665ceda8474245" -dependencies = [ - "libc", - "windows-sys 0.52.0", -] - -[[package]] -name = "etcetera" -version = "0.8.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "136d1b5283a1ab77bd9257427ffd09d8667ced0570b6f938942bc7568ed5b943" -dependencies = [ - "cfg-if", - "home", - "windows-sys 0.48.0", -] - -[[package]] -name = "event-listener" -version = "2.5.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0206175f82b8d6bf6652ff7d71a1e27fd2e4efde587fd368662814d6ec1d9ce0" - -[[package]] -name = "eyre" -version = "0.6.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7cd915d99f24784cdc19fd37ef22b97e3ff0ae756c7e492e9fbfe897d61e2aec" -dependencies = [ - "indenter", - "once_cell", -] - -[[package]] -name = "fastrand" -version = "2.0.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "658bd65b1cf4c852a3cc96f18a8ce7b5640f6b703f905c7d74532294c2a63984" - -[[package]] -name = "filetime" -version = "0.2.23" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1ee447700ac8aa0b2f2bd7bc4462ad686ba06baa6727ac149a2d6277f0d240fd" -dependencies = [ - "cfg-if", - "libc", - "redox_syscall", - "windows-sys 0.52.0", -] - -[[package]] -name = "finl_unicode" -version = "1.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8fcfdc7a0362c9f4444381a9e697c79d435fe65b52a37466fc2c1184cee9edc6" - -[[package]] -name = "flate2" -version = "1.0.28" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "46303f565772937ffe1d394a4fac6f411c6013172fadde9dcdb1e147a086940e" -dependencies = [ - "crc32fast", - "miniz_oxide", -] - -[[package]] -name = "flume" -version = "0.11.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "55ac459de2512911e4b674ce33cf20befaba382d05b62b008afc1c8b57cbf181" -dependencies = [ - "futures-core", - "futures-sink", - "spin 0.9.8", -] - -[[package]] -name = "fnv" -version = "1.0.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" - -[[package]] -name = "form_urlencoded" -version = "1.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e13624c2627564efccf4934284bdd98cbaa14e79b0b5a141218e507b3a823456" -dependencies = [ - "percent-encoding", -] - -[[package]] -name = "futures" -version = "0.3.31" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "65bc07b1a8bc7c85c5f2e110c476c7389b4554ba72af57d8445ea63a576b0876" -dependencies = [ - "futures-channel", - "futures-core", - "futures-executor", - "futures-io", - "futures-sink", - "futures-task", - "futures-util", -] - -[[package]] -name = "futures-channel" -version = "0.3.31" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2dff15bf788c671c1934e366d07e30c1814a8ef514e1af724a602e8a2fbe1b10" -dependencies = [ - "futures-core", - "futures-sink", -] - -[[package]] -name = "futures-core" -version = "0.3.31" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "05f29059c0c2090612e8d742178b0580d2dc940c837851ad723096f87af6663e" - -[[package]] -name = "futures-executor" -version = "0.3.31" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1e28d1d997f585e54aebc3f97d39e72338912123a67330d723fdbb564d646c9f" -dependencies = [ - "futures-core", - "futures-task", - "futures-util", -] - -[[package]] -name = "futures-intrusive" -version = "0.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1d930c203dd0b6ff06e0201a4a2fe9149b43c684fd4420555b26d21b1a02956f" -dependencies = [ - "futures-core", - "lock_api", - "parking_lot", -] - -[[package]] -name = "futures-io" -version = "0.3.31" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9e5c1b78ca4aae1ac06c48a526a655760685149f0d465d21f37abfe57ce075c6" - -[[package]] -name = "futures-macro" -version = "0.3.31" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "162ee34ebcb7c64a8abebc059ce0fee27c2262618d7b60ed8faf72fef13c3650" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.82", -] - -[[package]] -name = "futures-sink" -version = "0.3.31" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e575fab7d1e0dcb8d0c7bcf9a63ee213816ab51902e6d244a95819acacf1d4f7" - -[[package]] -name = "futures-task" -version = "0.3.31" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f90f7dce0722e95104fcb095585910c0977252f286e354b5e3bd38902cd99988" - -[[package]] -name = "futures-util" -version = "0.3.31" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9fa08315bb612088cc391249efdc3bc77536f16c91f6cf495e6fbe85b20a4a81" -dependencies = [ - "futures-channel", - "futures-core", - "futures-io", - "futures-macro", - "futures-sink", - "futures-task", - "memchr", - "pin-project-lite", - "pin-utils", - "slab", -] - -[[package]] -name = "generic-array" -version = "0.14.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "85649ca51fd72272d7821adaf274ad91c288277713d9c18820d8499a7ff69e9a" -dependencies = [ - "typenum", - "version_check", -] - -[[package]] -name = "getrandom" -version = "0.2.14" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "94b22e06ecb0110981051723910cbf0b5f5e09a2062dd7663334ee79a9d1286c" -dependencies = [ - "cfg-if", - "libc", - "wasi", -] - -[[package]] -name = "gimli" -version = "0.28.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4271d37baee1b8c7e4b708028c57d816cf9d2434acb33a549475f78c181f6253" - -[[package]] -name = "graphql-introspection-query" -version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7f2a4732cf5140bd6c082434494f785a19cfb566ab07d1382c3671f5812fed6d" -dependencies = [ - "serde", -] - -[[package]] -name = "graphql-parser" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d2ebc8013b4426d5b81a4364c419a95ed0b404af2b82e2457de52d9348f0e474" -dependencies = [ - "combine", - "thiserror", -] - -[[package]] -name = "graphql_client" -version = "0.13.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "09cdf7b487d864c2939b23902291a5041bc4a84418268f25fda1c8d4e15ad8fa" -dependencies = [ - "graphql_query_derive", - "reqwest 0.11.27", - "serde", - "serde_json", -] - -[[package]] -name = "graphql_client_codegen" -version = "0.13.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a40f793251171991c4eb75bd84bc640afa8b68ff6907bc89d3b712a22f700506" -dependencies = [ - "graphql-introspection-query", - "graphql-parser", - "heck 0.4.1", - "lazy_static", - "proc-macro2", - "quote", - "serde", - "serde_json", - "syn 1.0.109", -] - -[[package]] -name = "graphql_query_derive" -version = "0.13.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "00bda454f3d313f909298f626115092d348bc231025699f557b27e248475f48c" -dependencies = [ - "graphql_client_codegen", - "proc-macro2", - "syn 1.0.109", -] - -[[package]] -name = "h2" -version = "0.3.26" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "81fe527a889e1532da5c525686d96d4c2e74cdd345badf8dfef9f6b39dd5f5e8" -dependencies = [ - "bytes", - "fnv", - "futures-core", - "futures-sink", - "futures-util", - "http 0.2.12", - "indexmap", - "slab", - "tokio", - "tokio-util", - "tracing", -] - -[[package]] -name = "hashbrown" -version = "0.14.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "290f1a1d9242c78d09ce40a5e87e7554ee637af1351968159f4952f028f75604" -dependencies = [ - "ahash", - "allocator-api2", -] - -[[package]] -name = "hashlink" -version = "0.8.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e8094feaf31ff591f651a2664fb9cfd92bba7a60ce3197265e9482ebe753c8f7" -dependencies = [ - "hashbrown", -] - -[[package]] -name = "heck" -version = "0.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "95505c38b4572b2d910cecb0281560f54b440a19336cbbcb27bf6ce6adc6f5a8" -dependencies = [ - "unicode-segmentation", -] - -[[package]] -name = "heck" -version = "0.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2304e00983f87ffb38b55b444b5e3b60a884b5d30c0fca7d82fe33449bbe55ea" - -[[package]] -name = "hermit-abi" -version = "0.3.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d231dfb89cfffdbc30e7fc41579ed6066ad03abda9e567ccafae602b97ec5024" - -[[package]] -name = "hex" -version = "0.4.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7f24254aa9a54b5c858eaee2f5bccdb46aaf0e486a595ed5fd8f86ba55232a70" - -[[package]] -name = "hex-literal" -version = "0.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6fe2267d4ed49bc07b63801559be28c718ea06c4738b7a03c94df7386d2cde46" - -[[package]] -name = "hkdf" -version = "0.12.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7b5f8eb2ad728638ea2c7d47a21db23b7b58a72ed6a38256b8a1849f15fbbdf7" -dependencies = [ - "hmac", -] - -[[package]] -name = "hmac" -version = "0.12.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6c49c37c09c17a53d937dfbb742eb3a961d65a994e6bcdcf37e7399d0cc8ab5e" -dependencies = [ - "digest", -] - -[[package]] -name = "home" -version = "0.5.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e3d1354bf6b7235cb4a0576c2619fd4ed18183f689b12b006a0ee7329eeff9a5" -dependencies = [ - "windows-sys 0.52.0", -] - -[[package]] -name = "http" -version = "0.2.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "601cbb57e577e2f5ef5be8e7b83f0f63994f25aa94d673e54a92d5c516d101f1" -dependencies = [ - "bytes", - "fnv", - "itoa", -] - -[[package]] -name = "http" -version = "1.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "21b9ddb458710bc376481b842f5da65cdf31522de232c1ca8146abce2a358258" -dependencies = [ - "bytes", - "fnv", - "itoa", -] - -[[package]] -name = "http-body" -version = "0.4.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7ceab25649e9960c0311ea418d17bee82c0dcec1bd053b5f9a66e265a693bed2" -dependencies = [ - "bytes", - "http 0.2.12", - "pin-project-lite", -] - -[[package]] -name = "http-body" -version = "1.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1cac85db508abc24a2e48553ba12a996e87244a0395ce011e62b37158745d643" -dependencies = [ - "bytes", - "http 1.1.0", -] - -[[package]] -name = "http-body-util" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0475f8b2ac86659c21b64320d5d653f9efe42acd2a4e560073ec61a155a34f1d" -dependencies = [ - "bytes", - "futures-core", - "http 1.1.0", - "http-body 1.0.0", - "pin-project-lite", -] - -[[package]] -name = "httparse" -version = "1.8.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d897f394bad6a705d5f4104762e116a75639e470d80901eed05a860a95cb1904" - -[[package]] -name = "httpdate" -version = "1.0.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "df3b46402a9d5adb4c86a0cf463f42e19994e3ee891101b1841f30a545cb49a9" - -[[package]] -name = "hyper" -version = "0.14.28" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bf96e135eb83a2a8ddf766e426a841d8ddd7449d5f00d34ea02b41d2f19eef80" -dependencies = [ - "bytes", - "futures-channel", - "futures-core", - "futures-util", - "h2", - "http 0.2.12", - "http-body 0.4.6", - "httparse", - "httpdate", - "itoa", - "pin-project-lite", - "socket2", - "tokio", - "tower-service", - "tracing", - "want", -] - -[[package]] -name = "hyper" -version = "1.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "186548d73ac615b32a73aafe38fb4f56c0d340e110e5a200bcadbaf2e199263a" -dependencies = [ - "bytes", - "futures-channel", - "futures-util", - "http 1.1.0", - "http-body 1.0.0", - "httparse", - "httpdate", - "itoa", - "pin-project-lite", - "smallvec", - "tokio", - "want", -] - -[[package]] -name = "hyper-rustls" -version = "0.24.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ec3efd23720e2049821a693cbc7e65ea87c72f1c58ff2f9522ff332b1491e590" -dependencies = [ - "futures-util", - "http 0.2.12", - "hyper 0.14.28", - "rustls 0.21.10", - "tokio", - "tokio-rustls 0.24.1", -] - -[[package]] -name = "hyper-rustls" -version = "0.27.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5ee4be2c948921a1a5320b629c4193916ed787a7f7f293fd3f7f5a6c9de74155" -dependencies = [ - "futures-util", - "http 1.1.0", - "hyper 1.2.0", - "hyper-util", - "rustls 0.23.10", - "rustls-pki-types", - "tokio", - "tokio-rustls 0.26.0", - "tower-service", - "webpki-roots 0.26.1", -] - -[[package]] -name = "hyper-util" -version = "0.1.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ca38ef113da30126bbff9cd1705f9273e15d45498615d138b0c20279ac7a76aa" -dependencies = [ - "bytes", - "futures-channel", - "futures-util", - "http 1.1.0", - "http-body 1.0.0", - "hyper 1.2.0", - "pin-project-lite", - "socket2", - "tokio", - "tower 0.4.13", - "tower-service", - "tracing", -] - -[[package]] -name = "ident_case" -version = "1.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b9e0384b61958566e926dc50660321d12159025e767c18e043daf26b70104c39" - -[[package]] -name = "idna" -version = "0.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "634d9b1461af396cad843f47fdba5597a4f9e6ddd4bfb6ff5d85028c25cb12f6" -dependencies = [ - "unicode-bidi", - "unicode-normalization", -] - -[[package]] -name = "indenter" -version = "0.3.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ce23b50ad8242c51a442f3ff322d56b02f08852c77e4c0b4d3fd684abc89c683" - -[[package]] -name = "indexmap" -version = "2.2.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "168fb715dda47215e360912c096649d23d58bf392ac62f73919e831745e40f26" -dependencies = [ - "equivalent", - "hashbrown", -] - -[[package]] -name = "ipnet" -version = "2.9.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8f518f335dce6725a761382244631d86cf0ccb2863413590b31338feb467f9c3" - -[[package]] -name = "itertools" -version = "0.12.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ba291022dbbd398a455acf126c1e341954079855bc60dfdda641363bd6922569" -dependencies = [ - "either", -] - -[[package]] -name = "itertools" -version = "0.13.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "413ee7dfc52ee1a4949ceeb7dbc8a33f2d6c088194d9f922fb8318faf1f01186" -dependencies = [ - "either", -] - -[[package]] -name = "itoa" -version = "1.0.11" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "49f1f14873335454500d59611f1cf4a4b0f786f9ac11f4312a78e4cf2566695b" - -[[package]] -name = "js-sys" -version = "0.3.69" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "29c15563dc2726973df627357ce0c9ddddbea194836909d655df6a75d2cf296d" -dependencies = [ - "wasm-bindgen", -] - -[[package]] -name = "lazy_static" -version = "1.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" -dependencies = [ - "spin 0.5.2", -] - -[[package]] -name = "libc" -version = "0.2.153" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9c198f91728a82281a64e1f4f9eeb25d82cb32a5de251c6bd1b5154d63a8e7bd" - -[[package]] -name = "libm" -version = "0.2.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4ec2a862134d2a7d32d7983ddcdd1c4923530833c9f2ea1a44fc5fa473989058" - -[[package]] -name = "libredox" -version = "0.1.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c0ff37bd590ca25063e35af745c343cb7a0271906fb7b37e4813e8f79f00268d" -dependencies = [ - "bitflags 2.5.0", - "libc", -] - -[[package]] -name = "libsqlite3-sys" -version = "0.27.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cf4e226dcd58b4be396f7bd3c20da8fdee2911400705297ba7d2d7cc2c30f716" -dependencies = [ - "cc", - "pkg-config", - "vcpkg", -] - -[[package]] -name = "linux-raw-sys" -version = "0.4.13" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "01cda141df6706de531b6c46c3a33ecca755538219bd484262fa09410c13539c" - -[[package]] -name = "lock_api" -version = "0.4.11" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3c168f8615b12bc01f9c17e2eb0cc07dcae1940121185446edc3744920e8ef45" -dependencies = [ - "autocfg", - "scopeguard", -] - -[[package]] -name = "log" -version = "0.4.21" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "90ed8c1e510134f979dbc4f070f87d4313098b704861a105fe34231c70a3901c" - -[[package]] -name = "matchit" -version = "0.7.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0e7465ac9959cc2b1404e8e2367b43684a6d13790fe23056cc8c6c5a6b7bcb94" - -[[package]] -name = "md-5" -version = "0.10.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d89e7ee0cfbedfc4da3340218492196241d89eefb6dab27de5df917a6d2e78cf" -dependencies = [ - "cfg-if", - "digest", -] - -[[package]] -name = "memchr" -version = "2.7.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6c8640c5d730cb13ebd907d8d04b52f55ac9a2eec55b440c8892f40d56c76c1d" - -[[package]] -name = "mime" -version = "0.3.17" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6877bb514081ee2a7ff5ef9de3281f14a4dd4bceac4c09388074a6b5df8a139a" - -[[package]] -name = "minimal-lexical" -version = "0.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "68354c5c6bd36d73ff3feceb05efa59b6acb7626617f4962be322a825e61f79a" - -[[package]] -name = "miniz_oxide" -version = "0.7.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9d811f3e15f28568be3407c8e7fdb6514c1cda3cb30683f15b6a1a1dc4ea14a7" -dependencies = [ - "adler", -] - -[[package]] -name = "mio" -version = "1.0.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "80e04d1dcff3aae0704555fe5fee3bcfaf3d1fdf8a7e521d5b9d2b42acb52cec" -dependencies = [ - "hermit-abi", - "libc", - "wasi", - "windows-sys 0.52.0", -] - -[[package]] -name = "nom" -version = "7.1.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d273983c5a657a70a3e8f2a01329822f3b8c8172b73826411a55751e404a0a4a" -dependencies = [ - "memchr", - "minimal-lexical", -] - -[[package]] -name = "nu-ansi-term" -version = "0.46.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "77a8165726e8236064dbb45459242600304b42a5ea24ee2948e18e023bf7ba84" -dependencies = [ - "overload", - "winapi", -] - -[[package]] -name = "num-bigint-dig" -version = "0.8.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dc84195820f291c7697304f3cbdadd1cb7199c0efc917ff5eafd71225c136151" -dependencies = [ - "byteorder", - "lazy_static", - "libm", - "num-integer", - "num-iter", - "num-traits", - "rand", - "smallvec", - "zeroize", -] - -[[package]] -name = "num-conv" -version = "0.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "51d515d32fb182ee37cda2ccdcb92950d6a3c2893aa280e540671c2cd0f3b1d9" - -[[package]] -name = "num-integer" -version = "0.1.46" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7969661fd2958a5cb096e56c8e1ad0444ac2bbcd0061bd28660485a44879858f" -dependencies = [ - "num-traits", -] - -[[package]] -name = "num-iter" -version = "0.1.44" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d869c01cc0c455284163fd0092f1f93835385ccab5a98a0dcc497b2f8bf055a9" -dependencies = [ - "autocfg", - "num-integer", - "num-traits", -] - -[[package]] -name = "num-traits" -version = "0.2.18" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "da0df0e5185db44f69b44f26786fe401b6c293d1907744beaa7fa62b2e5a517a" -dependencies = [ - "autocfg", - "libm", -] - -[[package]] -name = "object" -version = "0.32.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a6a622008b6e321afc04970976f62ee297fdbaa6f95318ca343e3eebb9648441" -dependencies = [ - "memchr", -] - -[[package]] -name = "once_cell" -version = "1.19.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3fdb12b2476b595f9358c5161aa467c2438859caa136dec86c26fdd2efe17b92" - -[[package]] -name = "option-ext" -version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "04744f49eae99ab78e0d5c0b603ab218f515ea8cfe5a456d7629ad883a3b6e7d" - -[[package]] -name = "overload" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b15813163c1d831bf4a13c3610c05c0d03b39feb07f7e09fa234dac9b15aaf39" - -[[package]] -name = "parking_lot" -version = "0.12.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3742b2c103b9f06bc9fff0a37ff4912935851bee6d36f3c02bcc755bcfec228f" -dependencies = [ - "lock_api", - "parking_lot_core", -] - -[[package]] -name = "parking_lot_core" -version = "0.9.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4c42a9226546d68acdd9c0a280d17ce19bfe27a46bf68784e4066115788d008e" -dependencies = [ - "cfg-if", - "libc", - "redox_syscall", - "smallvec", - "windows-targets 0.48.5", -] - -[[package]] -name = "paste" -version = "1.0.14" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "de3145af08024dea9fa9914f381a17b8fc6034dfb00f3a84013f7ff43f29ed4c" - -[[package]] -name = "pem-rfc7468" -version = "0.7.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "88b39c9bfcfc231068454382784bb460aae594343fb030d46e9f50a645418412" -dependencies = [ - "base64ct", -] - -[[package]] -name = "percent-encoding" -version = "2.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e3148f5046208a5d56bcfc03053e3ca6334e51da8dfb19b6cdc8b306fae3283e" - -[[package]] -name = "pin-project" -version = "1.1.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b6bf43b791c5b9e34c3d182969b4abb522f9343702850a2e57f460d00d09b4b3" -dependencies = [ - "pin-project-internal", -] - -[[package]] -name = "pin-project-internal" -version = "1.1.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2f38a4412a78282e09a2cf38d195ea5420d15ba0602cb375210efbc877243965" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.82", -] - -[[package]] -name = "pin-project-lite" -version = "0.2.14" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bda66fc9667c18cb2758a2ac84d1167245054bcf85d5d1aaa6923f45801bdd02" - -[[package]] -name = "pin-utils" -version = "0.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184" - -[[package]] -name = "pkcs1" -version = "0.7.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c8ffb9f10fa047879315e6625af03c164b16962a5368d724ed16323b68ace47f" -dependencies = [ - "der", - "pkcs8", - "spki", -] - -[[package]] -name = "pkcs8" -version = "0.10.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f950b2377845cebe5cf8b5165cb3cc1a5e0fa5cfa3e1f7f55707d8fd82e0a7b7" -dependencies = [ - "der", - "spki", -] - -[[package]] -name = "pkg-config" -version = "0.3.30" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d231b230927b5e4ad203db57bbcbee2802f6bce620b1e4a9024a07d94e2907ec" - -[[package]] -name = "platform-info" -version = "2.0.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d5ff316b9c4642feda973c18f0decd6c8b0919d4722566f6e4337cce0dd88217" -dependencies = [ - "libc", - "winapi", -] - -[[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" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5b40af805b3121feab8a3c29f04d8ad262fa8e0561883e7653e024ae4479e6de" - -[[package]] -name = "proc-macro2" -version = "1.0.89" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f139b0662de085916d1fb67d2b4169d1addddda1919e696f3252b740b629986e" -dependencies = [ - "unicode-ident", -] - -[[package]] -name = "quinn" -version = "0.11.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e4ceeeeabace7857413798eb1ffa1e9c905a9946a57d81fb69b4b71c4d8eb3ad" -dependencies = [ - "bytes", - "pin-project-lite", - "quinn-proto", - "quinn-udp", - "rustc-hash", - "rustls 0.23.10", - "thiserror", - "tokio", - "tracing", -] - -[[package]] -name = "quinn-proto" -version = "0.11.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ddf517c03a109db8100448a4be38d498df8a210a99fe0e1b9eaf39e78c640efe" -dependencies = [ - "bytes", - "rand", - "ring", - "rustc-hash", - "rustls 0.23.10", - "slab", - "thiserror", - "tinyvec", - "tracing", -] - -[[package]] -name = "quinn-udp" -version = "0.5.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9096629c45860fc7fb143e125eb826b5e721e10be3263160c7d60ca832cf8c46" -dependencies = [ - "libc", - "once_cell", - "socket2", - "tracing", - "windows-sys 0.52.0", -] - -[[package]] -name = "quote" -version = "1.0.36" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0fa76aaf39101c457836aec0ce2316dbdc3ab723cdda1c6bd4e6ad4208acaca7" -dependencies = [ - "proc-macro2", -] - -[[package]] -name = "rand" -version = "0.8.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "34af8d1a0e25924bc5b7c43c079c942339d8f0a8b57c39049bef581b46327404" -dependencies = [ - "libc", - "rand_chacha", - "rand_core", -] - -[[package]] -name = "rand_chacha" -version = "0.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e6c10a63a0fa32252be49d21e7709d4d4baf8d231c2dbce1eaa8141b9b127d88" -dependencies = [ - "ppv-lite86", - "rand_core", -] - -[[package]] -name = "rand_core" -version = "0.6.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ec0be4795e2f6a28069bec0b5ff3e2ac9bafc99e6a9a7dc3547996c5c816922c" -dependencies = [ - "getrandom", -] - -[[package]] -name = "redox_syscall" -version = "0.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4722d768eff46b75989dd134e5c353f0d6296e5aaa3132e776cbdb56be7731aa" -dependencies = [ - "bitflags 1.3.2", -] - -[[package]] -name = "redox_users" -version = "0.4.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bd283d9651eeda4b2a83a43c1c91b266c40fd76ecd39a50a8c630ae69dc72891" -dependencies = [ - "getrandom", - "libredox", - "thiserror", -] - -[[package]] -name = "regex" -version = "1.10.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b91213439dad192326a0d7c6ee3955910425f441d7038e0d6933b0aec5c4517f" -dependencies = [ - "aho-corasick", - "memchr", - "regex-automata", - "regex-syntax", -] - -[[package]] -name = "regex-automata" -version = "0.4.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "86b83b8b9847f9bf95ef68afb0b8e6cdb80f498442f5179a29fad448fcc1eaea" -dependencies = [ - "aho-corasick", - "memchr", - "regex-syntax", -] - -[[package]] -name = "regex-syntax" -version = "0.8.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "adad44e29e4c806119491a7f06f03de4d1af22c3a680dd47f1e6e179439d1f56" - -[[package]] -name = "reqwest" -version = "0.11.27" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dd67538700a17451e7cba03ac727fb961abb7607553461627b97de0b89cf4a62" -dependencies = [ - "base64 0.21.7", - "bytes", - "encoding_rs", - "futures-core", - "futures-util", - "h2", - "http 0.2.12", - "http-body 0.4.6", - "hyper 0.14.28", - "hyper-rustls 0.24.2", - "ipnet", - "js-sys", - "log", - "mime", - "once_cell", - "percent-encoding", - "pin-project-lite", - "rustls 0.21.10", - "rustls-pemfile 1.0.4", - "serde", - "serde_json", - "serde_urlencoded", - "sync_wrapper 0.1.2", - "system-configuration", - "tokio", - "tokio-rustls 0.24.1", - "tokio-util", - "tower-service", - "url", - "wasm-bindgen", - "wasm-bindgen-futures", - "wasm-streams", - "web-sys", - "webpki-roots 0.25.4", - "winreg 0.50.0", -] - -[[package]] -name = "reqwest" -version = "0.12.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c7d6d2a27d57148378eb5e111173f4276ad26340ecc5c49a4a2152167a2d6a37" -dependencies = [ - "base64 0.22.0", - "bytes", - "futures-core", - "futures-util", - "http 1.1.0", - "http-body 1.0.0", - "http-body-util", - "hyper 1.2.0", - "hyper-rustls 0.27.2", - "hyper-util", - "ipnet", - "js-sys", - "log", - "mime", - "once_cell", - "percent-encoding", - "pin-project-lite", - "quinn", - "rustls 0.23.10", - "rustls-pemfile 2.1.2", - "rustls-pki-types", - "serde", - "serde_json", - "serde_urlencoded", - "sync_wrapper 1.0.1", - "tokio", - "tokio-rustls 0.26.0", - "tower-service", - "url", - "wasm-bindgen", - "wasm-bindgen-futures", - "web-sys", - "webpki-roots 0.26.1", - "winreg 0.52.0", -] - -[[package]] -name = "ring" -version = "0.17.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c17fa4cb658e3583423e915b9f3acc01cceaee1860e33d59ebae66adc3a2dc0d" -dependencies = [ - "cc", - "cfg-if", - "getrandom", - "libc", - "spin 0.9.8", - "untrusted", - "windows-sys 0.52.0", -] - -[[package]] -name = "rsa" -version = "0.9.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5d0e5124fcb30e76a7e79bfee683a2746db83784b86289f6251b54b7950a0dfc" -dependencies = [ - "const-oid", - "digest", - "num-bigint-dig", - "num-integer", - "num-traits", - "pkcs1", - "pkcs8", - "rand_core", - "signature", - "spki", - "subtle", - "zeroize", -] - -[[package]] -name = "rustc-demangle" -version = "0.1.23" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d626bb9dae77e28219937af045c257c28bfd3f69333c512553507f5f9798cb76" - -[[package]] -name = "rustc-hash" -version = "1.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "08d43f7aa6b08d49f382cde6a7982047c3426db949b1424bc4b7ec9ae12c6ce2" - -[[package]] -name = "rustix" -version = "0.38.32" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "65e04861e65f21776e67888bfbea442b3642beaa0138fdb1dd7a84a52dffdb89" -dependencies = [ - "bitflags 2.5.0", - "errno", - "libc", - "linux-raw-sys", - "windows-sys 0.52.0", -] - -[[package]] -name = "rustls" -version = "0.21.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f9d5a6813c0759e4609cd494e8e725babae6a2ca7b62a5536a13daaec6fcb7ba" -dependencies = [ - "log", - "ring", - "rustls-webpki 0.101.7", - "sct", -] - -[[package]] -name = "rustls" -version = "0.23.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "05cff451f60db80f490f3c182b77c35260baace73209e9cdbbe526bfe3a4d402" -dependencies = [ - "once_cell", - "ring", - "rustls-pki-types", - "rustls-webpki 0.102.5", - "subtle", - "zeroize", -] - -[[package]] -name = "rustls-pemfile" -version = "1.0.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1c74cae0a4cf6ccbbf5f359f08efdf8ee7e1dc532573bf0db71968cb56b1448c" -dependencies = [ - "base64 0.21.7", -] - -[[package]] -name = "rustls-pemfile" -version = "2.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "29993a25686778eb88d4189742cd713c9bce943bc54251a33509dc63cbacf73d" -dependencies = [ - "base64 0.22.0", - "rustls-pki-types", -] - -[[package]] -name = "rustls-pki-types" -version = "1.7.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "976295e77ce332211c0d24d92c0e83e50f5c5f046d11082cea19f3df13a3562d" - -[[package]] -name = "rustls-webpki" -version = "0.101.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8b6275d1ee7a1cd780b64aca7726599a1dbc893b1e64144529e55c3c2f745765" -dependencies = [ - "ring", - "untrusted", -] - -[[package]] -name = "rustls-webpki" -version = "0.102.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f9a6fccd794a42c2c105b513a2f62bc3fd8f3ba57a4593677ceb0bd035164d78" -dependencies = [ - "ring", - "rustls-pki-types", - "untrusted", -] - -[[package]] -name = "rustversion" -version = "1.0.15" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "80af6f9131f277a45a3fba6ce8e2258037bb0477a67e610d3c1fe046ab31de47" - -[[package]] -name = "ryu" -version = "1.0.17" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e86697c916019a8588c99b5fac3cead74ec0b4b819707a682fd4d23fa0ce1ba1" - -[[package]] -name = "scopeguard" -version = "1.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49" - -[[package]] -name = "sct" -version = "0.7.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "da046153aa2352493d6cb7da4b6e5c0c057d8a1d0a9aa8560baffdd945acd414" -dependencies = [ - "ring", - "untrusted", -] - -[[package]] -name = "serde" -version = "1.0.214" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f55c3193aca71c12ad7890f1785d2b73e1b9f63a0bbc353c08ef26fe03fc56b5" -dependencies = [ - "serde_derive", -] - -[[package]] -name = "serde_derive" -version = "1.0.214" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "de523f781f095e28fa605cdce0f8307e451cc0fd14e2eb4cd2e98a355b147766" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.82", -] - -[[package]] -name = "serde_json" -version = "1.0.120" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4e0d21c9a8cae1235ad58a00c11cb40d4b1e5c784f1ef2c537876ed6ffd8b7c5" -dependencies = [ - "itoa", - "ryu", - "serde", -] - -[[package]] -name = "serde_path_to_error" -version = "0.1.16" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "af99884400da37c88f5e9146b7f1fd0fbcae8f6eec4e9da38b67d05486f814a6" -dependencies = [ - "itoa", - "serde", -] - -[[package]] -name = "serde_urlencoded" -version = "0.7.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d3491c14715ca2294c4d6a88f15e84739788c1d030eed8c110436aafdaa2f3fd" -dependencies = [ - "form_urlencoded", - "itoa", - "ryu", - "serde", -] - -[[package]] -name = "sha1" -version = "0.10.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e3bf829a2d51ab4a5ddf1352d8470c140cadc8301b2ae1789db023f01cedd6ba" -dependencies = [ - "cfg-if", - "cpufeatures", - "digest", -] - -[[package]] -name = "sha2" -version = "0.10.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "793db75ad2bcafc3ffa7c68b215fee268f537982cd901d132f89c6343f3a3dc8" -dependencies = [ - "cfg-if", - "cpufeatures", - "digest", -] - -[[package]] -name = "sharded-slab" -version = "0.1.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -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 = "signature" -version = "2.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "77549399552de45a898a580c1b41d445bf730df867cc44e6c0233bbc4b8329de" -dependencies = [ - "digest", - "rand_core", -] - -[[package]] -name = "slab" -version = "0.4.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8f92a496fb766b417c996b9c5e57daf2f7ad3b0bebe1ccfca4856390e3d3bb67" -dependencies = [ - "autocfg", -] - -[[package]] -name = "smallvec" -version = "1.13.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3c5e1a9a646d36c3599cd173a41282daf47c44583ad367b8e6837255952e5c67" - -[[package]] -name = "socket2" -version = "0.5.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "05ffd9c0a93b7543e062e759284fcf5f5e3b098501104bfbdde4d404db792871" -dependencies = [ - "libc", - "windows-sys 0.52.0", -] - -[[package]] -name = "spin" -version = "0.5.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6e63cff320ae2c57904679ba7cb63280a3dc4613885beafb148ee7bf9aa9042d" - -[[package]] -name = "spin" -version = "0.9.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6980e8d7511241f8acf4aebddbb1ff938df5eebe98691418c4468d0b72a96a67" -dependencies = [ - "lock_api", -] - -[[package]] -name = "spki" -version = "0.7.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d91ed6c858b01f942cd56b37a94b3e0a1798290327d1236e4d9cf4eaca44d29d" -dependencies = [ - "base64ct", - "der", -] - -[[package]] -name = "sqlformat" -version = "0.2.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ce81b7bd7c4493975347ef60d8c7e8b742d4694f4c49f93e0a12ea263938176c" -dependencies = [ - "itertools 0.12.1", - "nom", - "unicode_categories", -] - -[[package]] -name = "sqlx" -version = "0.7.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c9a2ccff1a000a5a59cd33da541d9f2fdcd9e6e8229cc200565942bff36d0aaa" -dependencies = [ - "sqlx-core", - "sqlx-macros", - "sqlx-mysql", - "sqlx-postgres", - "sqlx-sqlite", -] - -[[package]] -name = "sqlx-core" -version = "0.7.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "24ba59a9342a3d9bab6c56c118be528b27c9b60e490080e9711a04dccac83ef6" -dependencies = [ - "ahash", - "atoi", - "byteorder", - "bytes", - "crc", - "crossbeam-queue", - "either", - "event-listener", - "futures-channel", - "futures-core", - "futures-intrusive", - "futures-io", - "futures-util", - "hashlink", - "hex", - "indexmap", - "log", - "memchr", - "once_cell", - "paste", - "percent-encoding", - "rustls 0.21.10", - "rustls-pemfile 1.0.4", - "serde", - "serde_json", - "sha2", - "smallvec", - "sqlformat", - "thiserror", - "time", - "tokio", - "tokio-stream", - "tracing", - "url", - "uuid", - "webpki-roots 0.25.4", -] - -[[package]] -name = "sqlx-macros" -version = "0.7.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4ea40e2345eb2faa9e1e5e326db8c34711317d2b5e08d0d5741619048a803127" -dependencies = [ - "proc-macro2", - "quote", - "sqlx-core", - "sqlx-macros-core", - "syn 1.0.109", -] - -[[package]] -name = "sqlx-macros-core" -version = "0.7.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5833ef53aaa16d860e92123292f1f6a3d53c34ba8b1969f152ef1a7bb803f3c8" -dependencies = [ - "dotenvy", - "either", - "heck 0.4.1", - "hex", - "once_cell", - "proc-macro2", - "quote", - "serde", - "serde_json", - "sha2", - "sqlx-core", - "sqlx-mysql", - "sqlx-postgres", - "sqlx-sqlite", - "syn 1.0.109", - "tempfile", - "tokio", - "url", -] - -[[package]] -name = "sqlx-mysql" -version = "0.7.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1ed31390216d20e538e447a7a9b959e06ed9fc51c37b514b46eb758016ecd418" -dependencies = [ - "atoi", - "base64 0.21.7", - "bitflags 2.5.0", - "byteorder", - "bytes", - "crc", - "digest", - "dotenvy", - "either", - "futures-channel", - "futures-core", - "futures-io", - "futures-util", - "generic-array", - "hex", - "hkdf", - "hmac", - "itoa", - "log", - "md-5", - "memchr", - "once_cell", - "percent-encoding", - "rand", - "rsa", - "serde", - "sha1", - "sha2", - "smallvec", - "sqlx-core", - "stringprep", - "thiserror", - "time", - "tracing", - "uuid", - "whoami", -] - -[[package]] -name = "sqlx-postgres" -version = "0.7.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7c824eb80b894f926f89a0b9da0c7f435d27cdd35b8c655b114e58223918577e" -dependencies = [ - "atoi", - "base64 0.21.7", - "bitflags 2.5.0", - "byteorder", - "crc", - "dotenvy", - "etcetera", - "futures-channel", - "futures-core", - "futures-io", - "futures-util", - "hex", - "hkdf", - "hmac", - "home", - "itoa", - "log", - "md-5", - "memchr", - "once_cell", - "rand", - "serde", - "serde_json", - "sha2", - "smallvec", - "sqlx-core", - "stringprep", - "thiserror", - "time", - "tracing", - "uuid", - "whoami", -] - -[[package]] -name = "sqlx-sqlite" -version = "0.7.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b244ef0a8414da0bed4bb1910426e890b19e5e9bccc27ada6b797d05c55ae0aa" -dependencies = [ - "atoi", - "flume", - "futures-channel", - "futures-core", - "futures-executor", - "futures-intrusive", - "futures-util", - "libsqlite3-sys", - "log", - "percent-encoding", - "serde", - "sqlx-core", - "time", - "tracing", - "url", - "urlencoding", - "uuid", -] - -[[package]] -name = "stringprep" -version = "0.1.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bb41d74e231a107a1b4ee36bd1214b11285b77768d2e3824aedafa988fd36ee6" -dependencies = [ - "finl_unicode", - "unicode-bidi", - "unicode-normalization", -] - -[[package]] -name = "strsim" -version = "0.10.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "73473c0e59e6d5812c5dfe2a064a6444949f089e20eec9a2e5506596494e4623" - -[[package]] -name = "strsim" -version = "0.11.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7da8b5736845d9f2fcb837ea5d9e2628564b3b043a70948a3f0b778838c5fb4f" - -[[package]] -name = "subtle" -version = "2.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "81cdd64d312baedb58e21336b31bc043b77e01cc99033ce76ef539f78e965ebc" - -[[package]] -name = "syn" -version = "1.0.109" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "72b64191b275b66ffe2469e8af2c1cfe3bafa67b529ead792a6d0160888b4237" -dependencies = [ - "proc-macro2", - "quote", - "unicode-ident", -] - -[[package]] -name = "syn" -version = "2.0.82" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "83540f837a8afc019423a8edb95b52a8effe46957ee402287f4292fae35be021" -dependencies = [ - "proc-macro2", - "quote", - "unicode-ident", -] - -[[package]] -name = "sync_wrapper" -version = "0.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2047c6ded9c721764247e62cd3b03c09ffc529b2ba5b10ec482ae507a4a70160" - -[[package]] -name = "sync_wrapper" -version = "1.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a7065abeca94b6a8a577f9bd45aa0867a2238b74e8eb67cf10d492bc39351394" - -[[package]] -name = "system-configuration" -version = "0.5.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ba3a3adc5c275d719af8cb4272ea1c4a6d668a777f37e115f6d11ddbc1c8e0e7" -dependencies = [ - "bitflags 1.3.2", - "core-foundation", - "system-configuration-sys", -] - -[[package]] -name = "system-configuration-sys" -version = "0.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a75fb188eb626b924683e3b95e3a48e63551fcfb51949de2f06a9d91dbee93c9" -dependencies = [ - "core-foundation-sys", - "libc", -] - -[[package]] -name = "tar" -version = "0.4.40" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b16afcea1f22891c49a00c751c7b63b2233284064f11a200fc624137c51e2ddb" -dependencies = [ - "filetime", - "libc", - "xattr", -] - -[[package]] -name = "tempfile" -version = "3.10.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "85b77fafb263dd9d05cbeac119526425676db3784113aa9295c88498cbf8bff1" -dependencies = [ - "cfg-if", - "fastrand", - "rustix", - "windows-sys 0.52.0", -] - -[[package]] -name = "thiserror" -version = "1.0.58" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "03468839009160513471e86a034bb2c5c0e4baae3b43f79ffc55c4a5427b3297" -dependencies = [ - "thiserror-impl", -] - -[[package]] -name = "thiserror-impl" -version = "1.0.58" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c61f3ba182994efc43764a46c018c347bc492c79f024e705f46567b418f6d4f7" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.82", -] - -[[package]] -name = "thread_local" -version = "1.1.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8b9ef9bad013ada3808854ceac7b46812a6465ba368859a37e2100283d2d719c" -dependencies = [ - "cfg-if", - "once_cell", -] - -[[package]] -name = "time" -version = "0.3.36" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5dfd88e563464686c916c7e46e623e520ddc6d79fa6641390f2e3fa86e83e885" -dependencies = [ - "deranged", - "itoa", - "num-conv", - "powerfmt", - "serde", - "time-core", - "time-macros", -] - -[[package]] -name = "time-core" -version = "0.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ef927ca75afb808a4d64dd374f00a2adf8d0fcff8e7b184af886c3c87ec4a3f3" - -[[package]] -name = "time-macros" -version = "0.2.18" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3f252a68540fde3a3877aeea552b832b40ab9a69e318efd078774a01ddee1ccf" -dependencies = [ - "num-conv", - "time-core", -] - -[[package]] -name = "tinyvec" -version = "1.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "87cc5ceb3875bb20c2890005a4e226a4651264a5c75edb2421b52861a0a0cb50" -dependencies = [ - "tinyvec_macros", -] - -[[package]] -name = "tinyvec_macros" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20" - -[[package]] -name = "tokio" -version = "1.41.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "22cfb5bee7a6a52939ca9224d6ac897bb669134078daa8735560897f69de4d33" -dependencies = [ - "backtrace", - "bytes", - "libc", - "mio", - "parking_lot", - "pin-project-lite", - "signal-hook-registry", - "socket2", - "tokio-macros", - "windows-sys 0.52.0", -] - -[[package]] -name = "tokio-macros" -version = "2.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "693d596312e88961bc67d7f1f97af8a70227d9f90c31bba5806eec004978d752" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.82", -] - -[[package]] -name = "tokio-rustls" -version = "0.24.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c28327cf380ac148141087fbfb9de9d7bd4e84ab5d2c28fbc911d753de8a7081" -dependencies = [ - "rustls 0.21.10", - "tokio", -] - -[[package]] -name = "tokio-rustls" -version = "0.26.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0c7bc40d0e5a97695bb96e27995cd3a08538541b0a846f65bba7a359f36700d4" -dependencies = [ - "rustls 0.23.10", - "rustls-pki-types", - "tokio", -] - -[[package]] -name = "tokio-stream" -version = "0.1.15" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "267ac89e0bec6e691e5813911606935d77c476ff49024f98abcea3e7b15e37af" -dependencies = [ - "futures-core", - "pin-project-lite", - "tokio", -] - -[[package]] -name = "tokio-util" -version = "0.7.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5419f34732d9eb6ee4c3578b7989078579b7f039cbbb9ca2c4da015749371e15" -dependencies = [ - "bytes", - "futures-core", - "futures-sink", - "pin-project-lite", - "tokio", - "tracing", -] - -[[package]] -name = "tower" -version = "0.4.13" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b8fa9be0de6cf49e536ce1851f987bd21a43b771b09473c3549a6c853db37c1c" -dependencies = [ - "futures-core", - "futures-util", - "pin-project", - "pin-project-lite", - "tokio", - "tower-layer", - "tower-service", - "tracing", -] - -[[package]] -name = "tower" -version = "0.5.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2873938d487c3cfb9aed7546dc9f2711d867c9f90c46b889989a2cb84eba6b4f" -dependencies = [ - "futures-core", - "futures-util", - "pin-project-lite", - "sync_wrapper 0.1.2", - "tokio", - "tower-layer", - "tower-service", - "tracing", -] - -[[package]] -name = "tower-http" -version = "0.5.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1e9cd434a998747dd2c4276bc96ee2e0c7a2eadf3cae88e52be55a05fa9053f5" -dependencies = [ - "bitflags 2.5.0", - "bytes", - "http 1.1.0", - "http-body 1.0.0", - "http-body-util", - "pin-project-lite", - "tower-layer", - "tower-service", - "tracing", -] - -[[package]] -name = "tower-layer" -version = "0.3.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "121c2a6cda46980bb0fcd1647ffaf6cd3fc79a013de288782836f6df9c48780e" - -[[package]] -name = "tower-service" -version = "0.3.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8df9b6e13f2d32c91b9bd719c00d1958837bc7dec474d94952798cc8e69eeec3" - -[[package]] -name = "tracing" -version = "0.1.40" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c3523ab5a71916ccf420eebdf5521fcef02141234bbc0b8a49f2fdc4544364ef" -dependencies = [ - "log", - "pin-project-lite", - "tracing-attributes", - "tracing-core", -] - -[[package]] -name = "tracing-attributes" -version = "0.1.27" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "34704c8d6ebcbc939824180af020566b01a7c01f80641264eba0999f6c2b6be7" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.82", -] - -[[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 = [ - "nu-ansi-term", - "sharded-slab", - "smallvec", - "thread_local", - "tracing", - "tracing-core", - "tracing-log", -] - -[[package]] -name = "try-lock" -version = "0.2.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e421abadd41a4225275504ea4d6566923418b7f05506fbc9c0fe86ba7396114b" - -[[package]] -name = "typenum" -version = "1.17.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "42ff0bf0c66b8238c6f3b578df37d0b7848e55df8577b3f74f92a69acceeb825" - -[[package]] -name = "unicode-bidi" -version = "0.3.15" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "08f95100a766bf4f8f28f90d77e0a5461bbdb219042e7679bebe79004fed8d75" - -[[package]] -name = "unicode-ident" -version = "1.0.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3354b9ac3fae1ff6755cb6db53683adb661634f67557942dea4facebec0fee4b" - -[[package]] -name = "unicode-normalization" -version = "0.1.23" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a56d1686db2308d901306f92a263857ef59ea39678a5458e7cb17f01415101f5" -dependencies = [ - "tinyvec", -] - -[[package]] -name = "unicode-segmentation" -version = "1.11.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d4c87d22b6e3f4a18d4d40ef354e97c90fcb14dd91d7dc0aa9d8a1172ebf7202" - -[[package]] -name = "unicode_categories" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "39ec24b3121d976906ece63c9daad25b85969647682eee313cb5779fdd69e14e" - -[[package]] -name = "unreachable" -version = "1.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "382810877fe448991dfc7f0dd6e3ae5d58088fd0ea5e35189655f84e6814fa56" -dependencies = [ - "void", -] - -[[package]] -name = "untrusted" -version = "0.9.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8ecb6da28b8a351d773b68d5825ac39017e680750f980f3a1a85cd8dd28a47c1" - -[[package]] -name = "url" -version = "2.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "31e6302e3bb753d46e83516cae55ae196fc0c309407cf11ab35cc51a4c2a4633" -dependencies = [ - "form_urlencoded", - "idna", - "percent-encoding", -] - -[[package]] -name = "urlencoding" -version = "2.1.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "daf8dba3b7eb870caf1ddeed7bc9d2a049f3cfdfae7cb521b087cc33ae4c49da" - -[[package]] -name = "utf8parse" -version = "0.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "711b9620af191e0cdc7468a8d14e709c3dcdb115b36f838e601583af800a370a" - -[[package]] -name = "uuid" -version = "1.9.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5de17fd2f7da591098415cff336e12965a28061ddace43b59cb3c430179c9439" -dependencies = [ - "getrandom", -] - -[[package]] -name = "valuable" -version = "0.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "830b7e5d4d90034032940e4ace0d9a9a057e7a45cd94e6c007832e39edb82f6d" - -[[package]] -name = "vcpkg" -version = "0.2.15" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "accd4ea62f7bb7a82fe23066fb0957d48ef677f6eeb8215f372f52e48bb32426" - -[[package]] -name = "version_check" -version = "0.9.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f" - -[[package]] -name = "void" -version = "1.0.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6a02e4885ed3bc0f2de90ea6dd45ebcbb66dacffe03547fadbb0eeae2770887d" - -[[package]] -name = "want" -version = "0.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bfa7760aed19e106de2c7c0b581b509f2f25d3dacaf737cb82ac61bc6d760b0e" -dependencies = [ - "try-lock", -] - -[[package]] -name = "wasi" -version = "0.11.0+wasi-snapshot-preview1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" - -[[package]] -name = "wasite" -version = "0.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b8dad83b4f25e74f184f64c43b150b91efe7647395b42289f38e50566d82855b" - -[[package]] -name = "wasm-bindgen" -version = "0.2.92" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4be2531df63900aeb2bca0daaaddec08491ee64ceecbee5076636a3b026795a8" -dependencies = [ - "cfg-if", - "wasm-bindgen-macro", -] - -[[package]] -name = "wasm-bindgen-backend" -version = "0.2.92" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "614d787b966d3989fa7bb98a654e369c762374fd3213d212cfc0251257e747da" -dependencies = [ - "bumpalo", - "log", - "once_cell", - "proc-macro2", - "quote", - "syn 2.0.82", - "wasm-bindgen-shared", -] - -[[package]] -name = "wasm-bindgen-futures" -version = "0.4.42" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "76bc14366121efc8dbb487ab05bcc9d346b3b5ec0eaa76e46594cabbe51762c0" -dependencies = [ - "cfg-if", - "js-sys", - "wasm-bindgen", - "web-sys", -] - -[[package]] -name = "wasm-bindgen-macro" -version = "0.2.92" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a1f8823de937b71b9460c0c34e25f3da88250760bec0ebac694b49997550d726" -dependencies = [ - "quote", - "wasm-bindgen-macro-support", -] - -[[package]] -name = "wasm-bindgen-macro-support" -version = "0.2.92" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e94f17b526d0a461a191c78ea52bbce64071ed5c04c9ffe424dcb38f74171bb7" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.82", - "wasm-bindgen-backend", - "wasm-bindgen-shared", -] - -[[package]] -name = "wasm-bindgen-shared" -version = "0.2.92" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "af190c94f2773fdb3729c55b007a722abb5384da03bc0986df4c289bf5567e96" - -[[package]] -name = "wasm-streams" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b65dc4c90b63b118468cf747d8bf3566c1913ef60be765b5730ead9e0a3ba129" -dependencies = [ - "futures-util", - "js-sys", - "wasm-bindgen", - "wasm-bindgen-futures", - "web-sys", -] - -[[package]] -name = "web-sys" -version = "0.3.69" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "77afa9a11836342370f4817622a2f0f418b134426d91a82dfb48f532d2ec13ef" -dependencies = [ - "js-sys", - "wasm-bindgen", -] - -[[package]] -name = "webpki-roots" -version = "0.25.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5f20c57d8d7db6d3b86154206ae5d8fba62dd39573114de97c2cb0578251f8e1" - -[[package]] -name = "webpki-roots" -version = "0.26.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b3de34ae270483955a94f4b21bdaaeb83d508bb84a01435f393818edb0012009" -dependencies = [ - "rustls-pki-types", -] - -[[package]] -name = "whoami" -version = "1.5.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a44ab49fad634e88f55bf8f9bb3abd2f27d7204172a112c7c9987e01c1c94ea9" -dependencies = [ - "redox_syscall", - "wasite", -] - -[[package]] -name = "winapi" -version = "0.3.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5c839a674fcd7a98952e593242ea400abe93992746761e38641405d28b00f419" -dependencies = [ - "winapi-i686-pc-windows-gnu", - "winapi-x86_64-pc-windows-gnu", -] - -[[package]] -name = "winapi-i686-pc-windows-gnu" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" - -[[package]] -name = "winapi-x86_64-pc-windows-gnu" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" - -[[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.4", -] - -[[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.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7dd37b7e5ab9018759f893a1952c9420d060016fc19a472b4bb20d1bdd694d1b" -dependencies = [ - "windows_aarch64_gnullvm 0.52.4", - "windows_aarch64_msvc 0.52.4", - "windows_i686_gnu 0.52.4", - "windows_i686_msvc 0.52.4", - "windows_x86_64_gnu 0.52.4", - "windows_x86_64_gnullvm 0.52.4", - "windows_x86_64_msvc 0.52.4", -] - -[[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.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bcf46cf4c365c6f2d1cc93ce535f2c8b244591df96ceee75d8e83deb70a9cac9" - -[[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.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "da9f259dd3bcf6990b55bffd094c4f7235817ba4ceebde8e6d11cd0c5633b675" - -[[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.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b474d8268f99e0995f25b9f095bc7434632601028cf86590aea5c8a5cb7801d3" - -[[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.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1515e9a29e5bed743cb4415a9ecf5dfca648ce85ee42e15873c3cd8610ff8e02" - -[[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.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5eee091590e89cc02ad514ffe3ead9eb6b660aedca2183455434b93546371a03" - -[[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.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "77ca79f2451b49fa9e2af39f0747fe999fcda4f5e241b2898624dca97a1f2177" - -[[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.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "32b752e52a2da0ddfbdbcc6fceadfeede4c939ed16d13e648833a61dfb611ed8" - -[[package]] -name = "winreg" -version = "0.50.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "524e57b2c537c0f9b1e69f1965311ec12182b4122e45035b1508cd24d2adadb1" -dependencies = [ - "cfg-if", - "windows-sys 0.48.0", -] - -[[package]] -name = "winreg" -version = "0.52.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a277a57398d4bfa075df44f501a17cfdf8542d224f0d36095a2adc7aee4ef0a5" -dependencies = [ - "cfg-if", - "windows-sys 0.48.0", -] - -[[package]] -name = "xattr" -version = "1.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8da84f1a25939b27f6820d92aed108f83ff920fdf11a7b19366c27c4cda81d4f" -dependencies = [ - "libc", - "linux-raw-sys", - "rustix", -] - -[[package]] -name = "zerocopy" -version = "0.7.32" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "74d4d3961e53fa4c9a25a8637fc2bfaf2595b3d3ae34875568a5cf64787716be" -dependencies = [ - "zerocopy-derive", -] - -[[package]] -name = "zerocopy-derive" -version = "0.7.32" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9ce1b18ccd8e73a9321186f97e46f9f04b778851177567b1975109d26a08d2a6" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.82", -] - -[[package]] -name = "zeroize" -version = "1.7.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "525b4ec142c6b68a2d10f01f7bbf6755599ca3f81ea53b8431b7dd348f5fdb2d" diff --git a/Cargo.toml b/Cargo.toml deleted file mode 100644 index caa2e24..0000000 --- a/Cargo.toml +++ /dev/null @@ -1,14 +0,0 @@ -[workspace] -members = ["crates/*"] -resolver = "2" - -[workspace.dependencies] -contractor = { path = "crates/contractor" } - -anyhow = { version = "1" } -tokio = { version = "1", features = ["full"] } -tracing = { version = "0.1", features = ["log"] } -tracing-subscriber = { version = "0.3.18" } -clap = { version = "4", features = ["derive", "env"] } -dotenv = { version = "0.15" } -axum = { version = "0.7" } diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..f6a730e --- /dev/null +++ b/LICENSE @@ -0,0 +1,7 @@ +Copyright 2023 Kasper J. Hermansen + +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/README.md b/README.md index cef8c74..cc9d973 100644 --- a/README.md +++ b/README.md @@ -1 +1,151 @@ -# contractor +# Contractor - A renovate bot for gitea and github + +Contractor is a chatops like bot, integrating with github/gitea issues, allowing +commands to trigger renovate runs. + +```bash +/contractor refresh +``` + +Contractor runs in a regular docker image and uses the official renovate slim +image behind the scenes, this can be changed in the configuration. + +![command](./assets/command.png) +Do note that the contractor was run under a personal user, hence the same +user replied + +## Motivation + +Renovate by default if hosted yourself, is neither sharded, or runs on a +cron-job cycle. This leaves a lot to be desired from a developers point of view. +As it may take quite a long time for renovate to revisit the pull-request again, +if there is a lot of repositories enabled. + +This project intends to add an ad-hoc invocation of renovate for a single +repository, this enables developers to retrigger renovate whenever they want. + +The project is built to be integrated with github and gitea (initially), and +work in its pull-request system, so when a renovate pr shows up, you can either +manually retrigger it, or enable any of the options in the renovate dashboard, +and retrigger. + +## DISCLAIMER + +The project is still 0.x.x As such the api is subject to change, and the +examples will probably be out of date. The below should be seen as an example of +what the project will look like once feature-complete. + +## Milestones + +- [x] 0.1.0 + - Includes basic setup such as working server bot, and installation command, + automation is missing however. Also only gitea support for now, because this + is where the project initially is supposed to be in use. +- [x] 0.2.0 + - Add GitHub support, only github app support for now. This means that install is not needed, because a github app will automatically receive webhooks if setup properly. docs are missing for this (tbd). +- [ ] 0.3.0 + - Add Delegation support (not clustering, just delegation of renovate jobs) +- [ ] 0.4.0 + - Slack integration +- [ ] 0.5.0 + - Add api key support + +## Getting started + +First you need to pull and run the contractor image, docker is the preferred way +of execution, but golang is also available from source. + +Docker compose is given as an example, but you're free to run using `docker run` +if you prefer. + +See example for a ready-to-run image + +```yaml +# file: docker-compose.yaml +version: "3" +services: + contractor: + image: docker.io/kjuulh/contractor:latest + restart: unless-stopped + commands: + - contractor server serve + volumes: + - "./templates/contractor:/mnt/config" + - "/var/run/docker.sock:/var/run/docker.sock" + env_file: + - .env +``` + +```bash +# file: .env +GITEA_RENOVATE_TOKEN= # needs repo and pull request permissions +GITHUB_RENOVATE_TOKEN= # needs repo and pull request permissions +GITHUB_COM_TOKEN= # used for communication, doesn't need much +RENOVATE_SECRETS='{"HARBOR_SERVER_PASSWORD": ""}' +CONTRACTOR_API_KEY='' +``` + +```json +// file: templates/contractor/config.json +{ + "$schema": "https://docs.renovatebot.com/renovate-schema.json", + "platform": "gitea", + "extends": [ + "config:base" + ] +} +// Remember to fill out the options as you see fit, this is not a complete example +``` + +Use renovate secret for each `{{ secrets.HARBOR_SERVER_PASSWORD }}` in your +config, replace `HARBOR_SERVER_PASSWORD` with your own + +And then run the server with: `docker compose up` + +This has started the server, but github doesn't know that it needs to talk to +you yet. + +As such host the server somewhere with a public hostname, such that github or +gitea webhooks can reach it, i.e. contractor.some-domain.com:9111 + +To install the webhook, either use the docker image, or download the cli from +source. + +### CLI + +To install the cli + +```bash +go install git.front.kjuulh.io/kjuulh/contractor@latest +``` + +contractor will automatically read any .env file, so you can leave out the +secrets. + +```bash +contractor install \ +--owner kjuulh \ +--repository contractor \ +--url https://git.front.kjuulh.io/api/v1 \ +--backend gitea +``` + +If you leave any of these out, contractor will prompt your for required values. + +### Docker + +You can also use docker for it. + +```bash +docker compose run contractor \ +install \ +--owner kjuulh \ +--repository contractor \ +--url https://git.front.kjuulh.io/api/v1 \ +--backend gitea +``` + +### GitHub App + +TBD, this should automatically install the webhook for allowed repositories, I +just haven't gotten around to it yet. It is on the 0.3.0 Roadmap. diff --git a/assets/command.png b/assets/command.png new file mode 100644 index 0000000..f6bbcbd Binary files /dev/null and b/assets/command.png differ diff --git a/ci/Cargo.lock b/ci/Cargo.lock new file mode 100644 index 0000000..d9154d6 --- /dev/null +++ b/ci/Cargo.lock @@ -0,0 +1,1901 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +version = 3 + +[[package]] +name = "addr2line" +version = "0.20.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +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 = "anstream" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0ca84f3628370c59db74ee214b3263d58f9aadd9b4fe7e711fd87dc452b7f163" +dependencies = [ + "anstyle", + "anstyle-parse", + "anstyle-query", + "anstyle-wincon", + "colorchoice", + "is-terminal", + "utf8parse", +] + +[[package]] +name = "anstyle" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3a30da5c5f2d5e72842e00bcb57657162cdabef0931f40e2deb9b4140440cecd" + +[[package]] +name = "anstyle-parse" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "938874ff5980b03a87c5524b3ae5b59cf99b1d6bc836848df7bc5ada9643c333" +dependencies = [ + "utf8parse", +] + +[[package]] +name = "anstyle-query" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5ca11d4be1bab0c8bc8734a9aa7bf4ee8316d462a08c6ac5052f888fef5b494b" +dependencies = [ + "windows-sys", +] + +[[package]] +name = "anstyle-wincon" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "180abfa45703aebe0093f79badacc01b8fd4ea2e35118747e5811127f926e188" +dependencies = [ + "anstyle", + "windows-sys", +] + +[[package]] +name = "ascii" +version = "0.9.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "eab1c04a571841102f5345a8fc0f6bb3d31c315dec879b5c6e42e40ce7ffa34e" + +[[package]] +name = "async-scoped" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4042078ea593edffc452eef14e99fdb2b120caa4ad9618bcdeabc4a023b98740" +dependencies = [ + "futures", + "pin-project", + "tokio", +] + +[[package]] +name = "async-trait" +version = "0.1.72" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cc6dde6e4ed435a4c1ee4e73592f5ba9da2151af10076cc04858746af9352d09" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.28", +] + +[[package]] +name = "autocfg" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d468802bab17cbc0cc575e9b053f41e72aa36bfa6b7f55e3529ffa43161b97fa" + +[[package]] +name = "backtrace" +version = "0.3.68" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4319208da049c43661739c5fade2ba182f09d1dc2299b32298d3a31692b17e12" +dependencies = [ + "addr2line", + "cc", + "cfg-if", + "libc", + "miniz_oxide", + "object", + "rustc-demangle", +] + +[[package]] +name = "base64" +version = "0.21.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "604178f6c5c21f02dc555784810edfb88d34ac2c73b2eae109655649ee73ce3d" + +[[package]] +name = "bitflags" +version = "1.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" + +[[package]] +name = "bitflags" +version = "2.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "630be753d4e58660abd17930c71b647fe46c27ea6b63cc59e1e3851406972e42" + +[[package]] +name = "block-buffer" +version = "0.10.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3078c7629b62d3f0439517fa394996acacc5cbc91c5a20d8c658e77abd503a71" +dependencies = [ + "generic-array", +] + +[[package]] +name = "bumpalo" +version = "3.13.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a3e2c3daef883ecc1b5d58c15adae93470a91d425f3532ba1695849656af3fc1" + +[[package]] +name = "byteorder" +version = "1.4.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "14c189c53d098945499cdfa7ecc63567cf3886b3332b312a5b4585d8d3a6a610" + +[[package]] +name = "bytes" +version = "1.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "89b2fd2a0dcf38d7971e2194b6b6eebab45ae01067456a7fd93d5547a61b70be" + +[[package]] +name = "cc" +version = "1.0.80" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "51f1226cd9da55587234753d1245dd5b132343ea240f26b6a9003d68706141ba" +dependencies = [ + "libc", +] + +[[package]] +name = "cfg-if" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" + +[[package]] +name = "ci" +version = "0.1.0" +dependencies = [ + "async-scoped", + "clap", + "color-eyre", + "dagger-sdk", + "dotenv", + "eyre", + "futures", + "tokio", +] + +[[package]] +name = "clap" +version = "4.3.19" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5fd304a20bff958a57f04c4e96a2e7594cc4490a0e809cbd48bb6437edaa452d" +dependencies = [ + "clap_builder", + "clap_derive", + "once_cell", +] + +[[package]] +name = "clap_builder" +version = "4.3.19" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "01c6a3f08f1fe5662a35cfe393aec09c4df95f60ee93b7556505260f75eee9e1" +dependencies = [ + "anstream", + "anstyle", + "clap_lex", + "strsim", +] + +[[package]] +name = "clap_derive" +version = "4.3.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "54a9bb5758fc5dfe728d1019941681eccaf0cf8a4189b692a0ee2f2ecf90a050" +dependencies = [ + "heck", + "proc-macro2", + "quote", + "syn 2.0.28", +] + +[[package]] +name = "clap_lex" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2da6da31387c7e4ef160ffab6d5e7f00c42626fe39aea70a7b0f1773f7dd6c1b" + +[[package]] +name = "color-eyre" +version = "0.6.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5a667583cca8c4f8436db8de46ea8233c42a7d9ae424a82d338f2e4675229204" +dependencies = [ + "backtrace", + "color-spantrace", + "eyre", + "indenter", + "once_cell", + "owo-colors", + "tracing-error", +] + +[[package]] +name = "color-spantrace" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1ba75b3d9449ecdccb27ecbc479fdc0b87fa2dd43d2f8298f9bf0e59aacc8dce" +dependencies = [ + "once_cell", + "owo-colors", + "tracing-core", + "tracing-error", +] + +[[package]] +name = "colorchoice" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "acbf1af155f9b9ef647e42cdc158db4b64a1b61f743629225fde6f3e0be2a7c7" + +[[package]] +name = "combine" +version = "3.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "da3da6baa321ec19e1cc41d31bf599f00c783d0517095cdaf0332e3fe8d20680" +dependencies = [ + "ascii", + "byteorder", + "either", + "memchr", + "unreachable", +] + +[[package]] +name = "cpufeatures" +version = "0.2.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a17b76ff3a4162b0b27f354a0c87015ddad39d35f9c0c36607a3bdd175dde1f1" +dependencies = [ + "libc", +] + +[[package]] +name = "crc32fast" +version = "1.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b540bd8bc810d3885c6ea91e2018302f68baba2129ab3e88f32389ee9370880d" +dependencies = [ + "cfg-if", +] + +[[package]] +name = "crypto-common" +version = "0.1.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1bfb12502f3fc46cca1bb51ac28df9d618d813cdc3d2f25b9fe775a34af26bb3" +dependencies = [ + "generic-array", + "typenum", +] + +[[package]] +name = "dagger-core" +version = "0.2.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b8af54bf8b7f93562405f62f5b724a322eeb1618c484010012f3293aa4832b16" +dependencies = [ + "async-trait", + "base64", + "dirs", + "eyre", + "flate2", + "graphql_client", + "hex", + "hex-literal", + "platform-info", + "reqwest", + "serde", + "serde_json", + "sha2", + "tar", + "tempfile", + "tokio", + "tracing", + "tracing-subscriber", +] + +[[package]] +name = "dagger-sdk" +version = "0.2.22" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fc52e90df068815076f0d3ee0ed683bbbe8a4a30443b09a5ef7e0bcc4b6ce4bc" +dependencies = [ + "dagger-core", + "derive_builder", + "eyre", + "futures", + "serde", + "serde_json", + "tokio", + "tracing", + "tracing-subscriber", +] + +[[package]] +name = "darling" +version = "0.14.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7b750cb3417fd1b327431a470f388520309479ab0bf5e323505daf0290cd3850" +dependencies = [ + "darling_core", + "darling_macro", +] + +[[package]] +name = "darling_core" +version = "0.14.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "109c1ca6e6b7f82cc233a97004ea8ed7ca123a9af07a8230878fcfda9b158bf0" +dependencies = [ + "fnv", + "ident_case", + "proc-macro2", + "quote", + "strsim", + "syn 1.0.109", +] + +[[package]] +name = "darling_macro" +version = "0.14.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a4aab4dbc9f7611d8b55048a3a16d2d010c2c8334e46304b40ac1cc14bf3b48e" +dependencies = [ + "darling_core", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "derive_builder" +version = "0.12.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8d67778784b508018359cbc8696edb3db78160bab2c2a28ba7f56ef6932997f8" +dependencies = [ + "derive_builder_macro", +] + +[[package]] +name = "derive_builder_core" +version = "0.12.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c11bdc11a0c47bc7d37d582b5285da6849c96681023680b906673c5707af7b0f" +dependencies = [ + "darling", + "proc-macro2", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "derive_builder_macro" +version = "0.12.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ebcda35c7a396850a55ffeac740804b40ffec779b98fffbb1738f4033f0ee79e" +dependencies = [ + "derive_builder_core", + "syn 1.0.109", +] + +[[package]] +name = "digest" +version = "0.10.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9ed9a281f7bc9b7576e61468ba615a66a5c8cfdff42420a70aa82701a3b1e292" +dependencies = [ + "block-buffer", + "crypto-common", +] + +[[package]] +name = "dirs" +version = "4.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ca3aa72a6f96ea37bbc5aa912f6788242832f75369bdfdadcb0e38423f100059" +dependencies = [ + "dirs-sys", +] + +[[package]] +name = "dirs-sys" +version = "0.3.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1b1d1d91c932ef41c0f2663aa8b0ca0342d444d842c06914aa0a7e352d0bada6" +dependencies = [ + "libc", + "redox_users", + "winapi", +] + +[[package]] +name = "dotenv" +version = "0.15.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "77c90badedccf4105eca100756a0b1289e191f6fcbdadd3cee1d2f614f97da8f" + +[[package]] +name = "either" +version = "1.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a26ae43d7bcc3b814de94796a5e736d4029efb0ee900c12e2d54c993ad1a1e07" + +[[package]] +name = "encoding_rs" +version = "0.8.32" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "071a31f4ee85403370b58aca746f01041ede6f0da2730960ad001edc2b71b394" +dependencies = [ + "cfg-if", +] + +[[package]] +name = "errno" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6b30f669a7961ef1631673d2766cc92f52d64f7ef354d4fe0ddfd30ed52f0f4f" +dependencies = [ + "errno-dragonfly", + "libc", + "windows-sys", +] + +[[package]] +name = "errno-dragonfly" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "aa68f1b12764fab894d2755d2518754e71b4fd80ecfb822714a1206c2aab39bf" +dependencies = [ + "cc", + "libc", +] + +[[package]] +name = "eyre" +version = "0.6.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4c2b6b5a29c02cdc822728b7d7b8ae1bab3e3b05d44522770ddd49722eeac7eb" +dependencies = [ + "indenter", + "once_cell", +] + +[[package]] +name = "fastrand" +version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6999dc1837253364c2ebb0704ba97994bd874e8f195d665c50b7548f6ea92764" + +[[package]] +name = "filetime" +version = "0.2.21" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5cbc844cecaee9d4443931972e1289c8ff485cb4cc2767cb03ca139ed6885153" +dependencies = [ + "cfg-if", + "libc", + "redox_syscall 0.2.16", + "windows-sys", +] + +[[package]] +name = "flate2" +version = "1.0.26" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3b9429470923de8e8cbd4d2dc513535400b4b3fef0319fb5c4e1f520a7bef743" +dependencies = [ + "crc32fast", + "miniz_oxide", +] + +[[package]] +name = "fnv" +version = "1.0.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" + +[[package]] +name = "form_urlencoded" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a62bc1cf6f830c2ec14a513a9fb124d0a213a629668a4186f329db21fe045652" +dependencies = [ + "percent-encoding", +] + +[[package]] +name = "futures" +version = "0.3.30" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "645c6916888f6cb6350d2550b80fb63e734897a8498abe35cfb732b6487804b0" +dependencies = [ + "futures-channel", + "futures-core", + "futures-executor", + "futures-io", + "futures-sink", + "futures-task", + "futures-util", +] + +[[package]] +name = "futures-channel" +version = "0.3.30" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "eac8f7d7865dcb88bd4373ab671c8cf4508703796caa2b1985a9ca867b3fcb78" +dependencies = [ + "futures-core", + "futures-sink", +] + +[[package]] +name = "futures-core" +version = "0.3.30" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dfc6580bb841c5a68e9ef15c77ccc837b40a7504914d52e47b8b0e9bbda25a1d" + +[[package]] +name = "futures-executor" +version = "0.3.30" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a576fc72ae164fca6b9db127eaa9a9dda0d61316034f33a0a0d4eda41f02b01d" +dependencies = [ + "futures-core", + "futures-task", + "futures-util", +] + +[[package]] +name = "futures-io" +version = "0.3.30" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a44623e20b9681a318efdd71c299b6b222ed6f231972bfe2f224ebad6311f0c1" + +[[package]] +name = "futures-macro" +version = "0.3.30" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "87750cf4b7a4c0625b1529e4c543c2182106e4dedc60a2a6455e00d212c489ac" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.28", +] + +[[package]] +name = "futures-sink" +version = "0.3.30" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9fb8e00e87438d937621c1c6269e53f536c14d3fbd6a042bb24879e57d474fb5" + +[[package]] +name = "futures-task" +version = "0.3.30" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "38d84fa142264698cdce1a9f9172cf383a0c82de1bddcf3092901442c4097004" + +[[package]] +name = "futures-util" +version = "0.3.30" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3d6401deb83407ab3da39eba7e33987a73c3df0c82b4bb5813ee871c19c41d48" +dependencies = [ + "futures-channel", + "futures-core", + "futures-io", + "futures-macro", + "futures-sink", + "futures-task", + "memchr", + "pin-project-lite", + "pin-utils", + "slab", +] + +[[package]] +name = "generic-array" +version = "0.14.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "85649ca51fd72272d7821adaf274ad91c288277713d9c18820d8499a7ff69e9a" +dependencies = [ + "typenum", + "version_check", +] + +[[package]] +name = "getrandom" +version = "0.2.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "be4136b2a15dd319360be1c07d9933517ccf0be8f16bf62a3bee4f0d618df427" +dependencies = [ + "cfg-if", + "libc", + "wasi", +] + +[[package]] +name = "gimli" +version = "0.27.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b6c80984affa11d98d1b88b66ac8853f143217b399d3c74116778ff8fdb4ed2e" + +[[package]] +name = "graphql-introspection-query" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7f2a4732cf5140bd6c082434494f785a19cfb566ab07d1382c3671f5812fed6d" +dependencies = [ + "serde", +] + +[[package]] +name = "graphql-parser" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d2ebc8013b4426d5b81a4364c419a95ed0b404af2b82e2457de52d9348f0e474" +dependencies = [ + "combine", + "thiserror", +] + +[[package]] +name = "graphql_client" +version = "0.12.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "aa61bb9dc6d373a8b465a5da17b62809483e8527a34b0e9034dc0915b09e160a" +dependencies = [ + "graphql_query_derive", + "reqwest", + "serde", + "serde_json", +] + +[[package]] +name = "graphql_client_codegen" +version = "0.12.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4e55df64cc702c4ad6647f8df13a799ad11688a3781fadf5045f7ba12733fa9b" +dependencies = [ + "graphql-introspection-query", + "graphql-parser", + "heck", + "lazy_static", + "proc-macro2", + "quote", + "serde", + "serde_json", + "syn 1.0.109", +] + +[[package]] +name = "graphql_query_derive" +version = "0.12.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d52fc9cde811f44b15ec0692b31e56a3067f6f431c5ace712f286e47c1dacc98" +dependencies = [ + "graphql_client_codegen", + "proc-macro2", + "syn 1.0.109", +] + +[[package]] +name = "h2" +version = "0.3.20" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "97ec8491ebaf99c8eaa73058b045fe58073cd6be7f596ac993ced0b0a0c01049" +dependencies = [ + "bytes", + "fnv", + "futures-core", + "futures-sink", + "futures-util", + "http", + "indexmap", + "slab", + "tokio", + "tokio-util", + "tracing", +] + +[[package]] +name = "hashbrown" +version = "0.12.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8a9ee70c43aaf417c914396645a0fa852624801b24ebb7ae78fe8272889ac888" + +[[package]] +name = "heck" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "95505c38b4572b2d910cecb0281560f54b440a19336cbbcb27bf6ce6adc6f5a8" + +[[package]] +name = "hermit-abi" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "443144c8cdadd93ebf52ddb4056d257f5b52c04d3c804e657d19eb73fc33668b" + +[[package]] +name = "hex" +version = "0.4.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7f24254aa9a54b5c858eaee2f5bccdb46aaf0e486a595ed5fd8f86ba55232a70" + +[[package]] +name = "hex-literal" +version = "0.3.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7ebdb29d2ea9ed0083cd8cece49bbd968021bd99b0849edb4a9a7ee0fdf6a4e0" + +[[package]] +name = "http" +version = "0.2.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bd6effc99afb63425aff9b05836f029929e345a6148a14b7ecd5ab67af944482" +dependencies = [ + "bytes", + "fnv", + "itoa", +] + +[[package]] +name = "http-body" +version = "0.4.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d5f38f16d184e36f2408a55281cd658ecbd3ca05cce6d6510a176eca393e26d1" +dependencies = [ + "bytes", + "http", + "pin-project-lite", +] + +[[package]] +name = "httparse" +version = "1.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d897f394bad6a705d5f4104762e116a75639e470d80901eed05a860a95cb1904" + +[[package]] +name = "httpdate" +version = "1.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c4a1e36c821dbe04574f602848a19f742f4fb3c98d40449f11bcad18d6b17421" + +[[package]] +name = "hyper" +version = "0.14.27" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ffb1cfd654a8219eaef89881fdb3bb3b1cdc5fa75ded05d6933b2b382e395468" +dependencies = [ + "bytes", + "futures-channel", + "futures-core", + "futures-util", + "h2", + "http", + "http-body", + "httparse", + "httpdate", + "itoa", + "pin-project-lite", + "socket2", + "tokio", + "tower-service", + "tracing", + "want", +] + +[[package]] +name = "hyper-rustls" +version = "0.24.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8d78e1e73ec14cf7375674f74d7dde185c8206fd9dea6fb6295e8a98098aaa97" +dependencies = [ + "futures-util", + "http", + "hyper", + "rustls", + "tokio", + "tokio-rustls", +] + +[[package]] +name = "ident_case" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b9e0384b61958566e926dc50660321d12159025e767c18e043daf26b70104c39" + +[[package]] +name = "idna" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7d20d6b07bfbc108882d88ed8e37d39636dcc260e15e30c45e6ba089610b917c" +dependencies = [ + "unicode-bidi", + "unicode-normalization", +] + +[[package]] +name = "indenter" +version = "0.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ce23b50ad8242c51a442f3ff322d56b02f08852c77e4c0b4d3fd684abc89c683" + +[[package]] +name = "indexmap" +version = "1.9.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bd070e393353796e801d209ad339e89596eb4c8d430d18ede6a1cced8fafbd99" +dependencies = [ + "autocfg", + "hashbrown", +] + +[[package]] +name = "ipnet" +version = "2.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "28b29a3cd74f0f4598934efe3aeba42bae0eb4680554128851ebbecb02af14e6" + +[[package]] +name = "is-terminal" +version = "0.4.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cb0889898416213fab133e1d33a0e5858a48177452750691bde3666d0fdbaf8b" +dependencies = [ + "hermit-abi", + "rustix", + "windows-sys", +] + +[[package]] +name = "itoa" +version = "1.0.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "af150ab688ff2122fcef229be89cb50dd66af9e01a4ff320cc137eecc9bacc38" + +[[package]] +name = "js-sys" +version = "0.3.64" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c5f195fe497f702db0f318b07fdd68edb16955aed830df8363d837542f8f935a" +dependencies = [ + "wasm-bindgen", +] + +[[package]] +name = "lazy_static" +version = "1.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" + +[[package]] +name = "libc" +version = "0.2.147" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b4668fb0ea861c1df094127ac5f1da3409a82116a4ba74fca2e58ef927159bb3" + +[[package]] +name = "linux-raw-sys" +version = "0.4.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "57bcfdad1b858c2db7c38303a6d2ad4dfaf5eb53dfeb0910128b2c26d6158503" + +[[package]] +name = "lock_api" +version = "0.4.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c1cc9717a20b1bb222f333e6a92fd32f7d8a18ddc5a3191a11af45dcbf4dcd16" +dependencies = [ + "autocfg", + "scopeguard", +] + +[[package]] +name = "log" +version = "0.4.19" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b06a4cde4c0f271a446782e3eff8de789548ce57dbc8eca9292c27f4a42004b4" + +[[package]] +name = "memchr" +version = "2.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2dffe52ecf27772e601905b7522cb4ef790d2cc203488bbd0e2fe85fcb74566d" + +[[package]] +name = "mime" +version = "0.3.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6877bb514081ee2a7ff5ef9de3281f14a4dd4bceac4c09388074a6b5df8a139a" + +[[package]] +name = "miniz_oxide" +version = "0.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e7810e0be55b428ada41041c41f32c9f1a42817901b4ccf45fa3d4b6561e74c7" +dependencies = [ + "adler", +] + +[[package]] +name = "mio" +version = "0.8.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "927a765cd3fc26206e66b296465fa9d3e5ab003e651c1b3c060e7956d96b19d2" +dependencies = [ + "libc", + "wasi", + "windows-sys", +] + +[[package]] +name = "nu-ansi-term" +version = "0.46.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "77a8165726e8236064dbb45459242600304b42a5ea24ee2948e18e023bf7ba84" +dependencies = [ + "overload", + "winapi", +] + +[[package]] +name = "num_cpus" +version = "1.16.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4161fcb6d602d4d2081af7c3a45852d875a03dd337a6bfdd6e06407b61342a43" +dependencies = [ + "hermit-abi", + "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.18.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dd8b5dd2ae5ed71462c540258bedcb51965123ad7e7ccf4b9a8cafaa4a63576d" + +[[package]] +name = "overload" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b15813163c1d831bf4a13c3610c05c0d03b39feb07f7e09fa234dac9b15aaf39" + +[[package]] +name = "owo-colors" +version = "3.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c1b04fb49957986fdce4d6ee7a65027d55d4b6d2265e5848bbb507b58ccfdb6f" + +[[package]] +name = "parking_lot" +version = "0.12.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3742b2c103b9f06bc9fff0a37ff4912935851bee6d36f3c02bcc755bcfec228f" +dependencies = [ + "lock_api", + "parking_lot_core", +] + +[[package]] +name = "parking_lot_core" +version = "0.9.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "93f00c865fe7cabf650081affecd3871070f26767e7b2070a3ffae14c654b447" +dependencies = [ + "cfg-if", + "libc", + "redox_syscall 0.3.5", + "smallvec", + "windows-targets", +] + +[[package]] +name = "percent-encoding" +version = "2.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9b2a4787296e9989611394c33f193f676704af1686e70b8f8033ab5ba9a35a94" + +[[package]] +name = "pin-project" +version = "1.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fda4ed1c6c173e3fc7a83629421152e01d7b1f9b7f65fb301e490e8cfc656422" +dependencies = [ + "pin-project-internal", +] + +[[package]] +name = "pin-project-internal" +version = "1.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4359fd9c9171ec6e8c62926d6faaf553a8dc3f64e1507e76da7911b4f6a04405" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.28", +] + +[[package]] +name = "pin-project-lite" +version = "0.2.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4c40d25201921e5ff0c862a505c6557ea88568a4e3ace775ab55e93f2f4f9d57" + +[[package]] +name = "pin-utils" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184" + +[[package]] +name = "platform-info" +version = "1.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4e7c23cfae725ae06d9e43010153fa77bdfa8c827bf08fe4beeb2a3514e6be12" +dependencies = [ + "libc", + "winapi", +] + +[[package]] +name = "proc-macro2" +version = "1.0.66" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "18fb31db3f9bddb2ea821cde30a9f70117e3f119938b5ee630b7403aa6e2ead9" +dependencies = [ + "unicode-ident", +] + +[[package]] +name = "quote" +version = "1.0.32" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "50f3b39ccfb720540debaa0164757101c08ecb8d326b15358ce76a62c7e85965" +dependencies = [ + "proc-macro2", +] + +[[package]] +name = "redox_syscall" +version = "0.2.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fb5a58c1855b4b6819d59012155603f0b22ad30cad752600aadfcb695265519a" +dependencies = [ + "bitflags 1.3.2", +] + +[[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_users" +version = "0.4.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b033d837a7cf162d7993aded9304e30a83213c648b6e389db233191f891e5c2b" +dependencies = [ + "getrandom", + "redox_syscall 0.2.16", + "thiserror", +] + +[[package]] +name = "reqwest" +version = "0.11.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cde824a14b7c14f85caff81225f411faacc04a2013f41670f41443742b1c1c55" +dependencies = [ + "base64", + "bytes", + "encoding_rs", + "futures-core", + "futures-util", + "h2", + "http", + "http-body", + "hyper", + "hyper-rustls", + "ipnet", + "js-sys", + "log", + "mime", + "once_cell", + "percent-encoding", + "pin-project-lite", + "rustls", + "rustls-pemfile", + "serde", + "serde_json", + "serde_urlencoded", + "tokio", + "tokio-rustls", + "tokio-util", + "tower-service", + "url", + "wasm-bindgen", + "wasm-bindgen-futures", + "wasm-streams", + "web-sys", + "webpki-roots", + "winreg", +] + +[[package]] +name = "ring" +version = "0.16.20" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3053cf52e236a3ed746dfc745aa9cacf1b791d846bdaf412f60a8d7d6e17c8fc" +dependencies = [ + "cc", + "libc", + "once_cell", + "spin", + "untrusted", + "web-sys", + "winapi", +] + +[[package]] +name = "rustc-demangle" +version = "0.1.23" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d626bb9dae77e28219937af045c257c28bfd3f69333c512553507f5f9798cb76" + +[[package]] +name = "rustix" +version = "0.38.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0a962918ea88d644592894bc6dc55acc6c0956488adcebbfb6e273506b7fd6e5" +dependencies = [ + "bitflags 2.3.3", + "errno", + "libc", + "linux-raw-sys", + "windows-sys", +] + +[[package]] +name = "rustls" +version = "0.21.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1d1feddffcfcc0b33f5c6ce9a29e341e4cd59c3f78e7ee45f4a40c038b1d6cbb" +dependencies = [ + "log", + "ring", + "rustls-webpki", + "sct", +] + +[[package]] +name = "rustls-pemfile" +version = "1.0.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2d3987094b1d07b653b7dfdc3f70ce9a1da9c51ac18c1b06b662e4f9a0e9f4b2" +dependencies = [ + "base64", +] + +[[package]] +name = "rustls-webpki" +version = "0.101.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "513722fd73ad80a71f72b61009ea1b584bcfa1483ca93949c8f290298837fa59" +dependencies = [ + "ring", + "untrusted", +] + +[[package]] +name = "ryu" +version = "1.0.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1ad4cc8da4ef723ed60bced201181d83791ad433213d8c24efffda1eec85d741" + +[[package]] +name = "scopeguard" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49" + +[[package]] +name = "sct" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d53dcdb7c9f8158937a7981b48accfd39a43af418591a5d008c7b22b5e1b7ca4" +dependencies = [ + "ring", + "untrusted", +] + +[[package]] +name = "serde" +version = "1.0.180" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0ea67f183f058fe88a4e3ec6e2788e003840893b91bac4559cabedd00863b3ed" +dependencies = [ + "serde_derive", +] + +[[package]] +name = "serde_derive" +version = "1.0.180" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "24e744d7782b686ab3b73267ef05697159cc0e5abbed3f47f9933165e5219036" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.28", +] + +[[package]] +name = "serde_json" +version = "1.0.104" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "076066c5f1078eac5b722a31827a8832fe108bed65dfa75e233c89f8206e976c" +dependencies = [ + "itoa", + "ryu", + "serde", +] + +[[package]] +name = "serde_urlencoded" +version = "0.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d3491c14715ca2294c4d6a88f15e84739788c1d030eed8c110436aafdaa2f3fd" +dependencies = [ + "form_urlencoded", + "itoa", + "ryu", + "serde", +] + +[[package]] +name = "sha2" +version = "0.10.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "479fb9d862239e610720565ca91403019f2f00410f1864c5aa7479b950a76ed8" +dependencies = [ + "cfg-if", + "cpufeatures", + "digest", +] + +[[package]] +name = "sharded-slab" +version = "0.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "900fba806f70c630b0a382d0d825e17a0f19fcd059a2ade1ff237bcddf446b31" +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.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6528351c9bc8ab22353f9d776db39a20288e8d6c37ef8cfe3317cf875eecfc2d" +dependencies = [ + "autocfg", +] + +[[package]] +name = "smallvec" +version = "1.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "62bb4feee49fdd9f707ef802e22365a35de4b7b299de4763d44bfea899442ff9" + +[[package]] +name = "socket2" +version = "0.4.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "64a4a911eed85daf18834cfaa86a79b7d266ff93ff5ba14005426219480ed662" +dependencies = [ + "libc", + "winapi", +] + +[[package]] +name = "spin" +version = "0.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6e63cff320ae2c57904679ba7cb63280a3dc4613885beafb148ee7bf9aa9042d" + +[[package]] +name = "strsim" +version = "0.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "73473c0e59e6d5812c5dfe2a064a6444949f089e20eec9a2e5506596494e4623" + +[[package]] +name = "syn" +version = "1.0.109" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "72b64191b275b66ffe2469e8af2c1cfe3bafa67b529ead792a6d0160888b4237" +dependencies = [ + "proc-macro2", + "quote", + "unicode-ident", +] + +[[package]] +name = "syn" +version = "2.0.28" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "04361975b3f5e348b2189d8dc55bc942f278b2d482a6a0365de5bdd62d351567" +dependencies = [ + "proc-macro2", + "quote", + "unicode-ident", +] + +[[package]] +name = "tar" +version = "0.4.39" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ec96d2ffad078296368d46ff1cb309be1c23c513b4ab0e22a45de0185275ac96" +dependencies = [ + "filetime", + "libc", + "xattr", +] + +[[package]] +name = "tempfile" +version = "3.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5486094ee78b2e5038a6382ed7645bc084dc2ec433426ca4c3cb61e2007b8998" +dependencies = [ + "cfg-if", + "fastrand", + "redox_syscall 0.3.5", + "rustix", + "windows-sys", +] + +[[package]] +name = "thiserror" +version = "1.0.44" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "611040a08a0439f8248d1990b111c95baa9c704c805fa1f62104b39655fd7f90" +dependencies = [ + "thiserror-impl", +] + +[[package]] +name = "thiserror-impl" +version = "1.0.44" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "090198534930841fab3a5d1bb637cde49e339654e606195f8d9c76eeb081dc96" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.28", +] + +[[package]] +name = "thread_local" +version = "1.1.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3fdd6f064ccff2d6567adcb3873ca630700f00b5ad3f060c25b5dcfd9a4ce152" +dependencies = [ + "cfg-if", + "once_cell", +] + +[[package]] +name = "tinyvec" +version = "1.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "87cc5ceb3875bb20c2890005a4e226a4651264a5c75edb2421b52861a0a0cb50" +dependencies = [ + "tinyvec_macros", +] + +[[package]] +name = "tinyvec_macros" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20" + +[[package]] +name = "tokio" +version = "1.29.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "532826ff75199d5833b9d2c5fe410f29235e25704ee5f0ef599fb51c21f4a4da" +dependencies = [ + "autocfg", + "backtrace", + "bytes", + "libc", + "mio", + "num_cpus", + "parking_lot", + "pin-project-lite", + "signal-hook-registry", + "socket2", + "tokio-macros", + "windows-sys", +] + +[[package]] +name = "tokio-macros" +version = "2.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "630bdcf245f78637c13ec01ffae6187cca34625e8c63150d424b59e55af2675e" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.28", +] + +[[package]] +name = "tokio-rustls" +version = "0.24.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c28327cf380ac148141087fbfb9de9d7bd4e84ab5d2c28fbc911d753de8a7081" +dependencies = [ + "rustls", + "tokio", +] + +[[package]] +name = "tokio-util" +version = "0.7.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "806fe8c2c87eccc8b3267cbae29ed3ab2d0bd37fca70ab622e46aaa9375ddb7d" +dependencies = [ + "bytes", + "futures-core", + "futures-sink", + "pin-project-lite", + "tokio", + "tracing", +] + +[[package]] +name = "tower-service" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b6bc1c9ce2b5135ac7f93c72918fc37feb872bdc6a5533a8b85eb4b86bfdae52" + +[[package]] +name = "tracing" +version = "0.1.37" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8ce8c33a8d48bd45d624a6e523445fd21ec13d3653cd51f681abf67418f54eb8" +dependencies = [ + "cfg-if", + "log", + "pin-project-lite", + "tracing-attributes", + "tracing-core", +] + +[[package]] +name = "tracing-attributes" +version = "0.1.26" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5f4f31f56159e98206da9efd823404b79b6ef3143b4a7ab76e67b1751b25a4ab" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.28", +] + +[[package]] +name = "tracing-core" +version = "0.1.31" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0955b8137a1df6f1a2e9a37d8a6656291ff0297c1a97c24e0d8425fe2312f79a" +dependencies = [ + "once_cell", + "valuable", +] + +[[package]] +name = "tracing-error" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d686ec1c0f384b1277f097b2f279a2ecc11afe8c133c1aabf036a27cb4cd206e" +dependencies = [ + "tracing", + "tracing-subscriber", +] + +[[package]] +name = "tracing-log" +version = "0.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "78ddad33d2d10b1ed7eb9d1f518a5674713876e97e5bb9b7345a7984fbb4f922" +dependencies = [ + "lazy_static", + "log", + "tracing-core", +] + +[[package]] +name = "tracing-subscriber" +version = "0.3.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "30a651bc37f915e81f087d86e62a18eec5f79550c7faff886f7090b4ea757c77" +dependencies = [ + "nu-ansi-term", + "sharded-slab", + "smallvec", + "thread_local", + "tracing", + "tracing-core", + "tracing-log", +] + +[[package]] +name = "try-lock" +version = "0.2.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3528ecfd12c466c6f163363caf2d02a71161dd5e1cc6ae7b34207ea2d42d81ed" + +[[package]] +name = "typenum" +version = "1.16.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "497961ef93d974e23eb6f433eb5fe1b7930b659f06d12dec6fc44a8f554c0bba" + +[[package]] +name = "unicode-bidi" +version = "0.3.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "92888ba5573ff080736b3648696b70cafad7d250551175acbaa4e0385b3e1460" + +[[package]] +name = "unicode-ident" +version = "1.0.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "301abaae475aa91687eb82514b328ab47a211a533026cb25fc3e519b86adfc3c" + +[[package]] +name = "unicode-normalization" +version = "0.1.22" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5c5713f0fc4b5db668a2ac63cdb7bb4469d8c9fed047b1d0292cc7b0ce2ba921" +dependencies = [ + "tinyvec", +] + +[[package]] +name = "unreachable" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "382810877fe448991dfc7f0dd6e3ae5d58088fd0ea5e35189655f84e6814fa56" +dependencies = [ + "void", +] + +[[package]] +name = "untrusted" +version = "0.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a156c684c91ea7d62626509bce3cb4e1d9ed5c4d978f7b4352658f96a4c26b4a" + +[[package]] +name = "url" +version = "2.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "50bff7831e19200a85b17131d085c25d7811bc4e186efdaf54bbd132994a88cb" +dependencies = [ + "form_urlencoded", + "idna", + "percent-encoding", +] + +[[package]] +name = "utf8parse" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "711b9620af191e0cdc7468a8d14e709c3dcdb115b36f838e601583af800a370a" + +[[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.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f" + +[[package]] +name = "void" +version = "1.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6a02e4885ed3bc0f2de90ea6dd45ebcbb66dacffe03547fadbb0eeae2770887d" + +[[package]] +name = "want" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bfa7760aed19e106de2c7c0b581b509f2f25d3dacaf737cb82ac61bc6d760b0e" +dependencies = [ + "try-lock", +] + +[[package]] +name = "wasi" +version = "0.11.0+wasi-snapshot-preview1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" + +[[package]] +name = "wasm-bindgen" +version = "0.2.87" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7706a72ab36d8cb1f80ffbf0e071533974a60d0a308d01a5d0375bf60499a342" +dependencies = [ + "cfg-if", + "wasm-bindgen-macro", +] + +[[package]] +name = "wasm-bindgen-backend" +version = "0.2.87" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5ef2b6d3c510e9625e5fe6f509ab07d66a760f0885d858736483c32ed7809abd" +dependencies = [ + "bumpalo", + "log", + "once_cell", + "proc-macro2", + "quote", + "syn 2.0.28", + "wasm-bindgen-shared", +] + +[[package]] +name = "wasm-bindgen-futures" +version = "0.4.37" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c02dbc21516f9f1f04f187958890d7e6026df8d16540b7ad9492bc34a67cea03" +dependencies = [ + "cfg-if", + "js-sys", + "wasm-bindgen", + "web-sys", +] + +[[package]] +name = "wasm-bindgen-macro" +version = "0.2.87" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dee495e55982a3bd48105a7b947fd2a9b4a8ae3010041b9e0faab3f9cd028f1d" +dependencies = [ + "quote", + "wasm-bindgen-macro-support", +] + +[[package]] +name = "wasm-bindgen-macro-support" +version = "0.2.87" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "54681b18a46765f095758388f2d0cf16eb8d4169b639ab575a8f5693af210c7b" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.28", + "wasm-bindgen-backend", + "wasm-bindgen-shared", +] + +[[package]] +name = "wasm-bindgen-shared" +version = "0.2.87" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ca6ad05a4870b2bf5fe995117d3728437bd27d7cd5f06f13c17443ef369775a1" + +[[package]] +name = "wasm-streams" +version = "0.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6bbae3363c08332cadccd13b67db371814cd214c2524020932f0804b8cf7c078" +dependencies = [ + "futures-util", + "js-sys", + "wasm-bindgen", + "wasm-bindgen-futures", + "web-sys", +] + +[[package]] +name = "web-sys" +version = "0.3.64" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9b85cbef8c220a6abc02aefd892dfc0fc23afb1c6a426316ec33253a3877249b" +dependencies = [ + "js-sys", + "wasm-bindgen", +] + +[[package]] +name = "webpki" +version = "0.22.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f095d78192e208183081cc07bc5515ef55216397af48b873e5edcd72637fa1bd" +dependencies = [ + "ring", + "untrusted", +] + +[[package]] +name = "webpki-roots" +version = "0.22.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b6c71e40d7d2c34a5106301fb632274ca37242cd0c9d3e64dbece371a40a2d87" +dependencies = [ + "webpki", +] + +[[package]] +name = "winapi" +version = "0.3.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5c839a674fcd7a98952e593242ea400abe93992746761e38641405d28b00f419" +dependencies = [ + "winapi-i686-pc-windows-gnu", + "winapi-x86_64-pc-windows-gnu", +] + +[[package]] +name = "winapi-i686-pc-windows-gnu" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" + +[[package]] +name = "winapi-x86_64-pc-windows-gnu" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" + +[[package]] +name = "windows-sys" +version = "0.48.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "677d2418bec65e3338edb076e806bc1ec15693c5d0104683f2efe857f61056a9" +dependencies = [ + "windows-targets", +] + +[[package]] +name = "windows-targets" +version = "0.48.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "05d4b17490f70499f20b9e791dcf6a299785ce8af4d709018206dc5b4953e95f" +dependencies = [ + "windows_aarch64_gnullvm", + "windows_aarch64_msvc", + "windows_i686_gnu", + "windows_i686_msvc", + "windows_x86_64_gnu", + "windows_x86_64_gnullvm", + "windows_x86_64_msvc", +] + +[[package]] +name = "windows_aarch64_gnullvm" +version = "0.48.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "91ae572e1b79dba883e0d315474df7305d12f569b400fcf90581b06062f7e1bc" + +[[package]] +name = "windows_aarch64_msvc" +version = "0.48.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b2ef27e0d7bdfcfc7b868b317c1d32c641a6fe4629c171b8928c7b08d98d7cf3" + +[[package]] +name = "windows_i686_gnu" +version = "0.48.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "622a1962a7db830d6fd0a69683c80a18fda201879f0f447f065a3b7467daa241" + +[[package]] +name = "windows_i686_msvc" +version = "0.48.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4542c6e364ce21bf45d69fdd2a8e455fa38d316158cfd43b3ac1c5b1b19f8e00" + +[[package]] +name = "windows_x86_64_gnu" +version = "0.48.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ca2b8a661f7628cbd23440e50b05d705db3686f894fc9580820623656af974b1" + +[[package]] +name = "windows_x86_64_gnullvm" +version = "0.48.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7896dbc1f41e08872e9d5e8f8baa8fdd2677f29468c4e156210174edc7f7b953" + +[[package]] +name = "windows_x86_64_msvc" +version = "0.48.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1a515f5799fe4961cb532f983ce2b23082366b898e52ffbce459c86f67c8378a" + +[[package]] +name = "winreg" +version = "0.10.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "80d0f4e272c85def139476380b12f9ac60926689dd2e01d4923222f40580869d" +dependencies = [ + "winapi", +] + +[[package]] +name = "xattr" +version = "0.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6d1526bbe5aaeb5eb06885f4d987bcdfa5e23187055de9b83fe00156a821fabc" +dependencies = [ + "libc", +] diff --git a/ci/Cargo.toml b/ci/Cargo.toml new file mode 100644 index 0000000..a2e6bb7 --- /dev/null +++ b/ci/Cargo.toml @@ -0,0 +1,16 @@ +[package] +name = "ci" +version = "0.1.0" +edition = "2021" + +# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html + +[dependencies] +dagger-sdk = "*" +eyre = "*" +color-eyre = "*" +tokio = "1" +clap = {version = "4", features = ["derive"]} +futures = "0.3.30" +async-scoped = { version = "0.9.0", features = ["tokio", "use-tokio"] } +dotenv = "*" diff --git a/ci/src/main.rs b/ci/src/main.rs new file mode 100644 index 0000000..180436e --- /dev/null +++ b/ci/src/main.rs @@ -0,0 +1,537 @@ +use std::path::PathBuf; +use std::sync::Arc; + +use clap::Args; +use clap::Parser; +use clap::Subcommand; +use clap::ValueEnum; + +use dagger_sdk::Platform; +use dagger_sdk::QueryContainerOpts; + +use crate::please_release::run_release_please; + +#[derive(Parser, Clone)] +#[command(author, version, about, long_about = None, subcommand_required = true)] +pub struct Command { + #[command(subcommand)] + commands: Commands, + + #[command(flatten)] + global: GlobalArgs, +} + +#[derive(Subcommand, Clone)] +pub enum Commands { + PullRequest { + #[arg(long)] + image: String, + #[arg(long)] + tag: String, + #[arg(long)] + bin_name: String, + }, + Main { + #[arg(long)] + image: String, + #[arg(long)] + tag: String, + #[arg(long)] + bin_name: String, + }, + Release, +} + +#[derive(Subcommand, Clone)] +pub enum LocalCommands { + Build { + #[arg(long, default_value = "debug")] + profile: BuildProfile, + #[arg(long)] + bin_name: String, + }, + Test, + DockerImage { + #[arg(long)] + image: String, + #[arg(long)] + tag: String, + #[arg(long)] + bin_name: String, + }, + PleaseRelease, + BuildDocs {}, +} + +#[derive(Debug, Clone, ValueEnum)] +pub enum BuildProfile { + Debug, + Release, +} + +#[derive(Debug, Clone, Args)] +pub struct GlobalArgs { + #[arg(long, global = true, help_heading = "Global")] + dry_run: bool, + + #[arg(long, global = true, help_heading = "Global")] + golang_builder_image: Option, + + #[arg(long, global = true, help_heading = "Global")] + production_image: Option, + + #[arg(long, global = true, help_heading = "Global")] + docker_image: Option, + + #[arg(long, global = true, help_heading = "Global")] + source: Option, + + #[arg(long, global = true, help_heading = "Global")] + docs_image: Option, + + #[arg(long, global = true, help_heading = "Global")] + docs_image_tag: Option, +} + +#[tokio::main] +async fn main() -> eyre::Result<()> { + let _ = dotenv::dotenv(); + let _ = color_eyre::install(); + + let client = dagger_sdk::connect().await?; + + let cli = Command::parse(); + + match &cli.commands { + Commands::PullRequest { + image, + tag, + bin_name, + } => { + async fn test(client: Arc, cli: &Command, bin_name: &String) { + let args = &cli.global; + + let base_image = base_golang_image(client.clone(), args, &None, bin_name) + .await + .unwrap(); + test::execute(client.clone(), args, base_image) + .await + .unwrap(); + } + async fn build( + client: Arc, + cli: &Command, + bin_name: &String, + image: &String, + tag: &String, + ) { + let args = &cli.global; + + build::build(client.clone(), args, bin_name, image, tag) + .await + .unwrap(); + } + + tokio::join!( + test(client.clone(), &cli, bin_name), + build(client.clone(), &cli, bin_name, image, tag), + ); + } + Commands::Main { + image, + tag, + bin_name, + } => { + async fn test(client: Arc, cli: &Command, bin_name: &String) { + let args = &cli.global; + + let base_image = base_golang_image(client.clone(), args, &None, bin_name) + .await + .unwrap(); + test::execute(client.clone(), args, base_image) + .await + .unwrap(); + } + async fn build( + client: Arc, + cli: &Command, + bin_name: &String, + image: &String, + tag: &String, + ) { + let args = &cli.global; + + build::build_and_deploy(client.clone(), args, bin_name, image, tag) + .await + .unwrap(); + } + + async fn cuddle_please(client: Arc, cli: &Command) { + run_release_please(client.clone(), &cli.global) + .await + .unwrap(); + } + + tokio::join!( + test(client.clone(), &cli, bin_name), + build(client.clone(), &cli, bin_name, image, tag), + cuddle_please(client.clone(), &cli) + ); + } + Commands::Release => todo!(), + } + + Ok(()) +} + +mod please_release { + use std::sync::Arc; + + use crate::GlobalArgs; + + pub async fn run_release_please( + client: Arc, + _args: &GlobalArgs, + ) -> eyre::Result<()> { + let build_image = client + .container() + .from("kasperhermansen/cuddle-please:main-1691504183"); + + let src = client + .git_opts( + "https://git.front.kjuulh.io/kjuulh/contractor", + dagger_sdk::QueryGitOpts { + experimental_service_host: None, + keep_git_dir: Some(true), + }, + ) + .branch("main") + .tree(); + + let res = build_image + .with_secret_variable( + "CUDDLE_PLEASE_TOKEN", + client + .set_secret("CUDDLE_PLEASE_TOKEN", std::env::var("CUDDLE_PLEASE_TOKEN")?) + .id() + .await?, + ) + .with_workdir("/mnt/app") + .with_directory(".", src.id().await?) + .with_exec(vec![ + "git", + "remote", + "set-url", + "origin", + &format!( + "https://git:{}@git.front.kjuulh.io/kjuulh/contractor.git", + std::env::var("CUDDLE_PLEASE_TOKEN")? + ), + ]) + .with_exec(vec![ + "cuddle-please", + "release", + "--engine=gitea", + "--owner=kjuulh", + "--repo=contractor", + "--branch=main", + "--api-url=https://git.front.kjuulh.io", + "--log-level=debug", + ]); + + let exit_code = res.exit_code().await?; + if exit_code != 0 { + eyre::bail!("failed to run cuddle-please"); + } + + let please_out = res.stdout().await?; + println!("{please_out}"); + let please_out = res.stderr().await?; + println!("{please_out}"); + + Ok(()) + } +} + +mod build { + use std::sync::Arc; + + use dagger_sdk::Container; + + use crate::{base_golang_image, get_base_debian_image, GlobalArgs}; + + pub async fn build_and_deploy( + client: Arc, + args: &GlobalArgs, + bin_name: &String, + image: &String, + tag: &String, + ) -> eyre::Result<()> { + // let containers = vec!["linux/amd64", "linux/arm64"]; + + let base_image = get_base_debian_image( + client.clone(), + &args.clone(), + Some("linux/amd64".to_string()), + ) + .await?; + + let container = base_golang_image( + client.clone(), + args, + &Some("linux/amd64".to_string()), + &bin_name.clone(), + ) + .await?; + let build_image = execute(client.clone(), args, &container, &base_image, bin_name).await?; + + let build_id = build_image.id().await?; + + let _container = client + .clone() + .container() + .publish_opts( + format!("{image}:{tag}"), + dagger_sdk::ContainerPublishOpts { + platform_variants: Some(vec![build_id]), + }, + ) + .await?; + Ok(()) + } + pub async fn build( + client: Arc, + args: &GlobalArgs, + bin_name: &String, + _image: &String, + _tag: &String, + ) -> eyre::Result<()> { + // let containers = vec!["linux/amd64", "linux/arm64"]; + + let base_image = get_base_debian_image( + client.clone(), + &args.clone(), + Some("linux/amd64".to_string()), + ) + .await?; + + let container = base_golang_image( + client.clone(), + args, + &Some("linux/amd64".to_string()), + &bin_name.clone(), + ) + .await?; + let build_image = execute(client.clone(), args, &container, &base_image, bin_name).await?; + + build_image.exit_code().await?; + + Ok(()) + } + pub async fn execute( + _client: Arc, + _args: &GlobalArgs, + container: &dagger_sdk::Container, + base_image: &dagger_sdk::Container, + bin_name: &String, + ) -> eyre::Result { + let final_image = base_image + .with_file( + format!("/usr/local/bin/{}", &bin_name), + container + .file(format!("/mnt/src/dist/{}", &bin_name)) + .id() + .await?, + ) + .with_exec(vec![bin_name, "--help"]); + + let output = final_image.stdout().await?; + println!("{output}"); + + Ok(final_image) + } +} + +mod test { + use std::sync::Arc; + + use crate::GlobalArgs; + + pub async fn execute( + _client: Arc, + args: &GlobalArgs, + container: dagger_sdk::Container, + ) -> eyre::Result<()> { + let test_image = container + .pipeline("test") + .with_exec(vec!["go", "test", "./..."]); + + test_image.exit_code().await?; + + Ok(()) + } +} + +pub async fn get_base_docker_image( + client: Arc, + args: &GlobalArgs, + platform: Option, +) -> eyre::Result { + let default_platform = client.default_platform().await?; + let platform = platform.map(Platform).unwrap_or(default_platform); + + let image = client + .container_opts(QueryContainerOpts { + id: None, + platform: Some(platform), + }) + .from( + args.docker_image + .clone() + .unwrap_or("docker:dind".to_string()), + ); + + Ok(image) +} + +pub async fn get_base_debian_image( + client: Arc, + args: &GlobalArgs, + platform: Option, +) -> eyre::Result { + let docker_image = get_base_docker_image(client.clone(), args, platform.clone()).await?; + + let default_platform = client.default_platform().await?; + let platform = platform.map(Platform).unwrap_or(default_platform); + + let image = client + .container_opts(QueryContainerOpts { + id: None, + platform: Some(platform), + }) + .from( + args.production_image + .clone() + .unwrap_or("alpine:latest".to_string()), + ); + + let base_image = image + .with_exec(vec!["apk", "add", "openssl", "openssl-dev", "pkgconfig"]) + .with_file( + "/usr/local/bin/docker", + docker_image.file("/usr/local/bin/docker").id().await?, + ); + + Ok(base_image) +} + +pub fn get_src( + client: Arc, + args: &GlobalArgs, +) -> eyre::Result { + let directory = client.host().directory_opts( + args.source + .clone() + .unwrap_or(PathBuf::from(".")) + .display() + .to_string(), + dagger_sdk::HostDirectoryOptsBuilder::default() + .exclude(vec![ + "node_modules/", + ".git/", + "target/", + ".cuddle/", + "docs/", + "ci/", + ]) + .build()?, + ); + + Ok(directory) +} + +pub async fn get_golang_dep_src( + client: Arc, + args: &GlobalArgs, +) -> eyre::Result { + let directory = client.host().directory_opts( + args.source + .clone() + .unwrap_or(PathBuf::from(".")) + .display() + .to_string(), + dagger_sdk::HostDirectoryOptsBuilder::default() + .include(vec!["**/go.*"]) + .build()?, + ); + + Ok(directory) +} + +pub async fn base_golang_image( + client: Arc, + args: &GlobalArgs, + platform: &Option, + bin_name: &String, +) -> eyre::Result { + let dep_src = get_golang_dep_src(client.clone(), args).await?; + let src = get_src(client.clone(), args)?; + + let client = client.pipeline("golang_base_image"); + + let goarch = match platform + .clone() + .unwrap_or("linux/amd64".to_string()) + .as_str() + { + "linux/amd64" => "amd64", + "linux/arm64" => "arm64", + _ => eyre::bail!("architecture not supported"), + }; + let goos = match platform + .clone() + .unwrap_or("linux/amd64".to_string()) + .as_str() + { + "linux/amd64" => "linux", + "linux/arm64" => "linux", + _ => eyre::bail!("os not supported"), + }; + let golang_build_image = client + .container() + .from( + args.golang_builder_image + .as_ref() + .unwrap_or(&"golang:latest".into()), + ) + .with_env_variable("GOOS", goos) + .with_env_variable("GOARCH", goarch) + .with_env_variable("CGO_ENABLED", "0"); + + let golang_dep_download = golang_build_image + .with_directory("/mnt/src", dep_src.id().await?) + .with_exec(vec!["go", "mod", "download"]) + .with_mounted_cache( + "/root/go", + client.cache_volume("golang_mod_cache").id().await?, + ); + + let golang_bin = golang_build_image + .with_workdir("/mnt/src") + // .with_directory( + // "/root/go", + // golang_dep_download.directory("/root/go").id().await?, + // ) + .with_directory("/mnt/src/", src.id().await?) + .with_exec(vec![ + "go", + "build", + "-o", + &format!("dist/{bin_name}"), + "main.go", + ]); + + golang_bin.exit_code().await?; + + Ok(golang_bin) +} diff --git a/cmd/contractor/main.go b/cmd/contractor/main.go new file mode 100644 index 0000000..918bb77 --- /dev/null +++ b/cmd/contractor/main.go @@ -0,0 +1,147 @@ +package contractor + +import ( + "log" + + "github.com/gin-gonic/gin" + "github.com/spf13/cobra" + + "git.front.kjuulh.io/kjuulh/contractor/internal/bot" + "git.front.kjuulh.io/kjuulh/contractor/internal/features" + "git.front.kjuulh.io/kjuulh/contractor/internal/providers" + "git.front.kjuulh.io/kjuulh/contractor/internal/queue" + "git.front.kjuulh.io/kjuulh/contractor/internal/renovate" +) + +func installCmd() *cobra.Command { + var ( + owner string + repository string + serverType string + + url string + token string + ) + + cmd := &cobra.Command{ + Use: "install", + + Run: func(cmd *cobra.Command, args []string) { + if err := providers.NewGiteaClient(&url, &token).CreateWebhook(owner, repository); err != nil { + log.Printf("failed to add create webhook: %s", err.Error()) + } + }, + } + + cmd.Flags().StringVarP(&owner, "owner", "o", "", "the owner for which the repository belongs") + cmd.Flags().StringVarP(&repository, "repository", "p", "", "the repository to install") + cmd.Flags(). + StringVar(&serverType, "server-type", "gitea", "the server type to use [gitea, github]") + cmd.MarkFlagRequired("owner") + cmd.MarkFlagRequired("repository") + + cmd.PersistentFlags().StringVar(&url, "url", "", "the api url of the server") + cmd.PersistentFlags().StringVar(&token, "token", "", "the token to authenticate with") + + return cmd +} + +func serverCmd() *cobra.Command { + var ( + url string + token string + + githubAppID int64 + githubInstallationID int64 + githubPrivateKeyPath string + ) + + giteaClient := providers.NewGiteaClient(&url, &token) + githubClient := providers.NewGitHubClient(&githubAppID, &githubInstallationID, &githubPrivateKeyPath) + renovateClient := renovate.NewRenovateClient("") + queue := queue.NewGoQueue() + botHandler := bot.NewBotHandler(giteaClient, githubClient) + + giteaWebhook := features.NewGiteaWebhook(botHandler, queue) + githubWebhook := features.NewGitHubWebhook(botHandler, queue) + + features.RegisterGiteaQueues(queue, renovateClient, giteaClient) + features.RegisterGitHubQueues(queue, renovateClient, githubClient) + + cmd := &cobra.Command{ + Use: "server", + } + + cmd.PersistentFlags().StringVar(&url, "url", "", "the api url of the server") + cmd.PersistentFlags().StringVar(&token, "token", "", "the token to authenticate with") + + cmd.PersistentFlags().Int64Var(&githubAppID, "github-app-id", 0, "github app id to authenticate with") + cmd.PersistentFlags().Int64Var(&githubInstallationID, "github-installation-id", 0, "github installation id to authenticate with") + cmd.PersistentFlags().StringVar(&githubPrivateKeyPath, "github-private-key-path", "", "path to the github app private key") + + cmd.AddCommand(serverServeCmd(&url, &token, giteaWebhook, githubWebhook)) + + return cmd +} + +func serverServeCmd( + url *string, + token *string, + giteaWebhook *features.GiteaWebhook, + githubWebhook *features.GitHubWebhook, +) *cobra.Command { + cmd := &cobra.Command{ + Use: "serve", + Run: func(cmd *cobra.Command, args []string) { + engine := gin.Default() + + github := engine.Group("/github") + { + github.POST("/webhook", func(ctx *gin.Context) { + var request features.GitHubWebhookRequest + if err := ctx.BindJSON(&request); err != nil { + ctx.AbortWithError(500, err) + return + } + + if err := githubWebhook.HandleGitHubWebhook(ctx.Request.Context(), &request); err != nil { + ctx.AbortWithError(500, err) + return + } + + ctx.Status(204) + }) + } + + gitea := engine.Group("/gitea") + { + gitea.POST("/webhook", func(ctx *gin.Context) { + var request features.GiteaWebhookRequest + if err := ctx.BindJSON(&request); err != nil { + ctx.AbortWithError(500, err) + return + } + + if err := giteaWebhook.HandleGiteaWebhook(ctx.Request.Context(), &request); err != nil { + ctx.AbortWithError(500, err) + return + } + + ctx.Status(204) + }) + } + + engine.Run("0.0.0.0:9111") + }, + } + + return cmd +} + +func RootCmd() *cobra.Command { + cmd := &cobra.Command{Use: "contractor"} + + cmd.AddCommand(installCmd(), serverCmd()) + + return cmd +} diff --git a/crates/contractor/.gitignore b/crates/contractor/.gitignore deleted file mode 100644 index ea8c4bf..0000000 --- a/crates/contractor/.gitignore +++ /dev/null @@ -1 +0,0 @@ -/target diff --git a/crates/contractor/Cargo.toml b/crates/contractor/Cargo.toml deleted file mode 100644 index f4ba504..0000000 --- a/crates/contractor/Cargo.toml +++ /dev/null @@ -1,25 +0,0 @@ -[package] -name = "contractor" -version = "0.1.0" -edition = "2021" - -[dependencies] -anyhow.workspace = true -tokio.workspace = true -tracing.workspace = true -tracing-subscriber.workspace = true -clap.workspace = true -dotenv.workspace = true -axum.workspace = true - -serde = { version = "1.0.202", features = ["derive"] } -sqlx = { version = "0.7.4", features = ["runtime-tokio", "tls-rustls", "postgres", "uuid", "time"] } -uuid = { version = "1.8.0", features = ["v4"] } -tower-http = { version = "0.5.2", features = ["cors", "trace"] } -futures = "0.3.30" -reqwest = {version = "0.12.4", default-features = false, features = ["json", "rustls-tls"]} -itertools = "0.13.0" -regex = "1.10.4" -serde_json = "1.0.117" -dagger-sdk = "0.9.8" -backon = "0.4.4" diff --git a/crates/contractor/migrations/crdb/20240201211013_initial.sql b/crates/contractor/migrations/crdb/20240201211013_initial.sql deleted file mode 100644 index 8ddc1d3..0000000 --- a/crates/contractor/migrations/crdb/20240201211013_initial.sql +++ /dev/null @@ -1 +0,0 @@ --- Add migration script here diff --git a/crates/contractor/src/api.rs b/crates/contractor/src/api.rs deleted file mode 100644 index f7dc343..0000000 --- a/crates/contractor/src/api.rs +++ /dev/null @@ -1,137 +0,0 @@ -use std::net::SocketAddr; - -use anyhow::Context; -use axum::{ - extract::{MatchedPath, State}, - http::Request, - response::IntoResponse, - routing::{get, post}, - Json, Router, -}; -use serde::{Deserialize, Serialize}; -use tower_http::trace::TraceLayer; - -use crate::{ - services::{ - bot::{BotRequest, BotState}, - gitea::Repository, - }, - SharedState, -}; - -pub async fn serve_axum(state: &SharedState, host: &SocketAddr) -> Result<(), anyhow::Error> { - tracing::info!("running webhook server"); - let app = Router::new() - .route("/", get(root)) - .route("/webhooks/gitea", post(gitea_webhook)) - .with_state(state.to_owned()) - .layer( - TraceLayer::new_for_http().make_span_with(|request: &Request<_>| { - // Log the matched route's path (with placeholders not filled in). - // Use request.uri() or OriginalUri if you want the real path. - let matched_path = request - .extensions() - .get::() - .map(MatchedPath::as_str); - - tracing::info_span!( - "http_request", - method = ?request.method(), - matched_path, - some_other_field = tracing::field::Empty, - ) - }), // ... - ); - - tracing::info!("listening on {}", host); - let listener = tokio::net::TcpListener::bind(host).await.unwrap(); - axum::serve(listener, app.into_make_service()).await?; - - Ok(()) -} - -async fn root() -> &'static str { - "Hello, contractor!" -} - -#[derive(Serialize, Deserialize, Clone, Debug)] -pub struct GiteaWebhookComment { - body: String, -} -#[derive(Serialize, Deserialize, Clone, Debug)] -pub struct GiteaWebhookRepository { - full_name: String, -} - -#[derive(Serialize, Deserialize, Clone, Debug)] -#[serde(untagged)] -pub enum GiteaWebhook { - Issue { - comment: GiteaWebhookComment, - repository: GiteaWebhookRepository, - }, -} - -pub enum ApiError { - InternalError(anyhow::Error), -} - -impl IntoResponse for ApiError { - fn into_response(self) -> axum::response::Response { - match self { - ApiError::InternalError(e) => { - tracing::error!("failed with internal error: {}", e); - - (axum::http::StatusCode::INTERNAL_SERVER_ERROR, e.to_string()) - } - } - .into_response() - } -} - -async fn gitea_webhook( - State(state): State, - Json(json): Json, -) -> Result { - tracing::info!( - "called: {}", - serde_json::to_string(&json) - .context("failed to serialize webhook") - .map_err(ApiError::InternalError)? - ); - - let bot_req: BotRequest = json.try_into().map_err(ApiError::InternalError)?; - - state - .bot() - .handle_request(bot_req) - .await - .map_err(ApiError::InternalError)?; - - Ok("Hello, contractor!") -} - -impl TryFrom for BotRequest { - type Error = anyhow::Error; - fn try_from(value: GiteaWebhook) -> Result { - match value { - GiteaWebhook::Issue { - comment, - repository, - } => { - let (owner, name) = repository.full_name.split_once('/').ok_or(anyhow::anyhow!( - "{} did not contain a valid owner/repository", - &repository.full_name - ))?; - - Ok(BotRequest { - repo: Repository { - owner: owner.into(), - name: name.into(), - }, - command: comment.body, - }) - } - } - } -} diff --git a/crates/contractor/src/main.rs b/crates/contractor/src/main.rs deleted file mode 100644 index 4041ca8..0000000 --- a/crates/contractor/src/main.rs +++ /dev/null @@ -1,97 +0,0 @@ -use std::{net::SocketAddr, sync::Arc}; - -use clap::{Parser, Subcommand}; -use futures::{stream::FuturesUnordered, StreamExt}; -use tokio::task; - -#[derive(Parser)] -#[command(author, version, about, long_about = None, subcommand_required = true)] -struct Command { - #[command(subcommand)] - command: Option, -} - -#[derive(Subcommand)] -enum Commands { - Serve { - #[arg(env = "SERVICE_HOST", long, default_value = "127.0.0.1:3000")] - host: SocketAddr, - }, - - Reconcile { - #[arg(long)] - user: Option, - #[arg(long)] - org: Option>, - - #[arg(long, env = "CONTRACTOR_FILTER")] - filter: Option, - - #[arg(long = "force-refresh", env = "CONTRACTOR_FORCE_REFRESH")] - force_refresh: bool, - }, -} - -mod api; -mod schedule; - -#[tokio::main] -async fn main() -> anyhow::Result<()> { - dotenv::dotenv().ok(); - tracing_subscriber::fmt::init(); - - let cli = Command::parse(); - - match cli.command { - Some(Commands::Serve { host }) => { - tracing::info!("Starting service"); - - let state = SharedState::from(Arc::new(State::new().await?)); - - let mut tasks = FuturesUnordered::new(); - - tasks.push({ - let state = state.clone(); - task::spawn(async move { - serve_axum(&state, &host).await?; - Ok::<(), anyhow::Error>(()) - }) - }); - - tasks.push(task::spawn(async move { - serve_cron_jobs(&state).await?; - Ok::<(), anyhow::Error>(()) - })); - - while let Some(result) = tasks.next().await { - result?? - } - } - Some(Commands::Reconcile { - user, - org, - filter, - force_refresh, - }) => { - tracing::info!("running reconcile"); - - let state = SharedState::from(Arc::new(State::new().await?)); - - state - .reconciler() - .reconcile(user, org, filter, force_refresh) - .await?; - - tracing::info!("done running reconcile"); - } - None => {} - } - - Ok(()) -} - -mod state; -pub use crate::state::{SharedState, State}; -use crate::{api::serve_axum, schedule::serve_cron_jobs, services::reconciler::ReconcilerState}; - -mod services; diff --git a/crates/contractor/src/schedule.rs b/crates/contractor/src/schedule.rs deleted file mode 100644 index 204e652..0000000 --- a/crates/contractor/src/schedule.rs +++ /dev/null @@ -1,16 +0,0 @@ -use crate::SharedState; - -pub async fn serve_cron_jobs(state: &SharedState) -> Result<(), anyhow::Error> { - let _state = state.clone(); - tokio::spawn(async move { - loop { - tracing::info!("running cronjobs"); - - tokio::time::sleep(std::time::Duration::from_secs(10_000)).await; - } - Ok::<(), anyhow::Error>(()) - }) - .await??; - - Ok(()) -} diff --git a/crates/contractor/src/services.rs b/crates/contractor/src/services.rs deleted file mode 100644 index 65b89f0..0000000 --- a/crates/contractor/src/services.rs +++ /dev/null @@ -1,5 +0,0 @@ -pub mod bot; -pub mod engines; -pub mod gitea; -pub mod reconciler; -pub mod renovate; diff --git a/crates/contractor/src/services/bot.rs b/crates/contractor/src/services/bot.rs deleted file mode 100644 index 52b506b..0000000 --- a/crates/contractor/src/services/bot.rs +++ /dev/null @@ -1,84 +0,0 @@ -use clap::{Parser, Subcommand}; - -use crate::{services::renovate::RenovateConfig, SharedState}; - -use super::{engines::dagger::Dagger, gitea::Repository}; - -pub struct Bot { - command_name: String, - - dagger: Dagger, -} - -#[derive(Parser)] -#[command(author, version, about, long_about = None, subcommand_required = true)] -struct BotCommand { - #[command(subcommand)] - command: Option, -} - -#[derive(Subcommand)] -enum BotCommands { - Refresh { - #[arg(long)] - all: bool, - }, -} - -impl Bot { - pub fn new(dagger: Dagger) -> Self { - Self { - command_name: std::env::var("CONTRACTOR_COMMAND_NAME").unwrap_or("contractor".into()), - - dagger, - } - } - - pub async fn handle_request(&self, req: impl Into) -> anyhow::Result<()> { - let req: BotRequest = req.into(); - - if !req.command.starts_with(&self.command_name) { - return Ok(()); - } - - let cmd = BotCommand::parse_from(req.command.split_whitespace()); - - match cmd.command { - Some(BotCommands::Refresh { all }) => { - tracing::info!("triggering refresh for: {}, all: {}", req.repo, all); - - let dagger = self.dagger.clone(); - tokio::spawn(async move { - match dagger - .execute_renovate(&RenovateConfig { - repo: format!("{}/{}", &req.repo.owner, &req.repo.name), - }) - .await - { - Ok(_) => {} - Err(e) => tracing::error!("failed to execute renovate: {}", e), - }; - }); - } - None => { - // TODO: Send back the help menu - } - } - - Ok(()) - } -} - -pub struct BotRequest { - pub repo: Repository, - pub command: String, -} - -pub trait BotState { - fn bot(&self) -> Bot; -} -impl BotState for SharedState { - fn bot(&self) -> Bot { - Bot::new(self.engine.clone()) - } -} diff --git a/crates/contractor/src/services/engines.rs b/crates/contractor/src/services/engines.rs deleted file mode 100644 index 6c02dba..0000000 --- a/crates/contractor/src/services/engines.rs +++ /dev/null @@ -1 +0,0 @@ -pub mod dagger; diff --git a/crates/contractor/src/services/engines/dagger.rs b/crates/contractor/src/services/engines/dagger.rs deleted file mode 100644 index be78ab6..0000000 --- a/crates/contractor/src/services/engines/dagger.rs +++ /dev/null @@ -1,157 +0,0 @@ -use std::{str::FromStr, sync::Arc}; - -use dagger_sdk::ContainerWithNewFileOptsBuilder; -use futures::Future; -use tokio::sync::RwLock; - -type DynDagger = Arc; - -#[derive(Clone)] -pub struct Dagger { - dagger: DynDagger, -} - -impl Default for Dagger { - fn default() -> Self { - Self::new() - } -} - -impl Dagger { - pub fn new() -> Self { - Self { - dagger: Arc::new(DefaultDagger::new()), - } - } -} - -impl std::ops::Deref for Dagger { - type Target = DynDagger; - - fn deref(&self) -> &Self::Target { - &self.dagger - } -} - -struct DefaultDagger { - client: Arc>>, -} - -impl DefaultDagger { - pub fn new() -> Self { - let client = Arc::new(RwLock::new(None)); - - let host = - std::env::var("CONTRACTOR_DOCKER_HOST").expect("CONTRACTOR_DOCKER_HOST to be set"); - - std::env::set_var("DOCKER_HOST", host); - - tokio::spawn({ - let client = client.clone(); - - async move { - let mut client = client.write().await; - - match dagger_sdk::connect().await { - Ok(o) => *client = Some(o), - Err(e) => tracing::error!("failed to start dagger engine: {}", e), - }; - } - }); - - Self { client } - } - - pub async fn get_client(&self) -> dagger_sdk::Query { - let client = self.client.clone().read().await.clone(); - - client.unwrap() - } -} - -impl traits::Dagger for DefaultDagger { - fn execute_renovate<'a>( - &'a self, - config: &'a crate::services::renovate::RenovateConfig, - ) -> std::pin::Pin> + Send + 'a>> { - Box::pin(async move { - let renovate_image = "renovate/renovate:37"; - - let client = self.get_client().await; - - let github_com_token = client.set_secret( - "GITHUB_COM_TOKEN", - std::env::var("CONTRACTOR_GITHUB_COM_TOKEN") - .expect("CONTRACTOR_GITHUB_COM_TOKEN to be set"), - ); - - let renovate_secrets = client.set_secret( - "RENOVATE_SECRETS", - std::env::var("CONTRACTOR_RENOVATE_SECRETS") - .expect("CONTRACTOR_RENOVATE_SECRETS to be set"), - ); - - let renovate_token = client.set_secret( - "RENOVATE_TOKEN", - std::env::var("CONTRACTOR_RENOVATE_TOKEN") - .expect("CONTRACTOR_RENOVATE_TOKEN to be set"), - ); - - let renovate_file_url = std::env::var("CONTRACTOR_RENOVATE_CONFIG_URL") - .expect("CONTRACTOR_RENOVATE_CONFIG_URL to be set"); - - let renovate_file = client.http(renovate_file_url).contents().await?; - - let mut renovate_file_value: serde_json::Value = serde_json::from_str(&renovate_file)?; - let obj = renovate_file_value - .as_object_mut() - .ok_or(anyhow::anyhow!("config is not a valid json object"))?; - - let _ = obj.insert("autodiscover".into(), serde_json::Value::from_str("false")?); - - let renovate_file = serde_json::to_string(&obj)?; - - let output = client - .container() - .from(renovate_image) - .with_secret_variable("GITHUB_COM_TOKEN", github_com_token) - .with_secret_variable("RENOVATE_SECRETS", renovate_secrets) - .with_secret_variable("RENOVATE_TOKEN", renovate_token) - .with_env_variable("LOG_LEVEL", "info") - .with_env_variable("RENOVATE_CONFIG_FILE", "/opt/renovate/config.json") - .with_new_file_opts( - "/opt/renovate/config.json", - ContainerWithNewFileOptsBuilder::default() - .contents(renovate_file.as_str()) - .permissions(0o644isize) - .build()?, - ) - .with_exec(vec![&config.repo]) - .stdout() - .await?; - - tracing::debug!( - "renovate on: {} finished with output {}", - &config.repo, - &output - ); - - Ok::<(), anyhow::Error>(()) - }) - } -} - -pub mod traits { - use std::pin::Pin; - - use futures::Future; - - use crate::services::renovate::RenovateConfig; - - pub trait Dagger { - fn execute_renovate<'a>( - &'a self, - config: &'a RenovateConfig, - ) -> Pin> + Send + 'a>>; - } -} diff --git a/crates/contractor/src/services/gitea.rs b/crates/contractor/src/services/gitea.rs deleted file mode 100644 index 319b997..0000000 --- a/crates/contractor/src/services/gitea.rs +++ /dev/null @@ -1,508 +0,0 @@ -use std::{fmt::Display, ops::Deref, pin::Pin, sync::Arc}; - -type DynGiteaClient = Arc; -pub struct GiteaClient(DynGiteaClient); - -impl GiteaClient { - pub fn new() -> Self { - Self(Arc::new(DefaultGiteaClient::default())) - } -} - -impl Deref for GiteaClient { - type Target = DynGiteaClient; - - fn deref(&self) -> &Self::Target { - &self.0 - } -} - -#[derive(Clone, Debug, PartialEq, Eq, Hash)] -pub struct Repository { - pub owner: String, - pub name: String, -} - -impl Display for Repository { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - f.write_fmt(format_args!("{}/{}", self.owner, self.name)) - } -} - -impl TryFrom for Repository { - type Error = anyhow::Error; - - fn try_from(value: GiteaRepository) -> Result { - let (owner, name) = value - .full_name - .split_once('/') - .ok_or(anyhow::anyhow!( - "name of repository is invalid, should contain a /" - )) - .map_err(|e| { - tracing::warn!("failed to parse repository: {}", e); - - e - })?; - - Ok(Repository { - owner: owner.into(), - name: name.into(), - }) - } -} - -#[derive(Clone, Debug, Deserialize)] -pub struct GiteaRepository { - full_name: String, -} - -pub struct DefaultGiteaClient { - url: String, - token: String, - - webhook_url: String, -} - -impl Default for DefaultGiteaClient { - fn default() -> Self { - Self { - url: std::env::var("GITEA_URL") - .context("GITEA_URL should be set") - .map(|g| g.trim_end_matches('/').to_string()) - .unwrap(), - token: std::env::var("GITEA_TOKEN") - .context("GITEA_TOKEN should be set") - .unwrap(), - webhook_url: std::env::var("CONTRACTOR_URL") - .context("CONTRACTOR_URL should be set") - .map(|url| format!("{}/webhooks/gitea", url.trim_end_matches('/'))) - .unwrap(), - } - } -} - -#[derive(Clone, Debug, Deserialize)] -pub struct GiteaWebhook { - id: isize, - #[serde(rename = "type")] - r#type: GiteaWebhookType, - config: GiteaWebhookConfig, -} -#[derive(Clone, Debug, Deserialize)] -pub struct GiteaWebhookConfig { - url: String, -} - -#[derive(Clone, Debug, Deserialize, Serialize, PartialEq, Eq)] -pub enum GiteaWebhookType { - #[serde(rename = "gitea")] - Gitea, - Other(String), -} - -#[derive(Clone, Debug, Serialize)] -pub struct CreateGiteaWebhook { - active: bool, - authorization_header: Option, - branch_filter: Option, - config: CreateGiteaWebhookConfig, - events: Vec, - #[serde(rename = "type")] - r#type: GiteaWebhookType, -} - -#[derive(Clone, Debug, Serialize)] -pub struct CreateGiteaWebhookConfig { - content_type: String, - url: String, -} - -impl DefaultGiteaClient { - async fn fetch_user_repos_page( - &self, - page: usize, - ) -> anyhow::Result<(Vec, Vec)> { - let client = reqwest::Client::new(); - - let url = format!("{}/api/v1/user/repos?page={page}&limit=50", self.url); - - tracing::trace!("calling url: {}", &url); - - let response = client - .get(&url) - .header("Content-Type", "application/json") - .header("Authorization", format!("token {}", self.token)) - .send() - .await?; - - let mut pages = Vec::new(); - if page <= 1 { - if let Some(link_header) = response.headers().get("link") { - let link_str = link_header.to_str()?; - pages = parse_link(page, link_str)?; - } - } - - let repositories = response.json::>().await?; - - Ok(( - repositories - .into_iter() - .flat_map(Repository::try_from) - .collect(), - pages, - )) - } - - pub async fn fetch_user_repos(&self) -> anyhow::Result> { - let (repos, pages) = self.fetch_user_repos_page(1).await?; - - let tasks = pages - .into_iter() - .map(|page| async move { - let (new_repos, _) = self.fetch_user_repos_page(page).await?; - - Ok::, anyhow::Error>(new_repos) - }) - .collect::>(); - - let res: Result>, anyhow::Error> = tasks.try_collect().await; - let res = res?.into_iter().flatten(); - - Ok(repos.into_iter().chain(res).collect()) - } - - async fn fetch_org_repos_page( - &self, - org: &str, - page: usize, - ) -> anyhow::Result<(Vec, Vec)> { - let client = reqwest::Client::new(); - - let url = format!( - "{}/api/v1/orgs/{}/repos?page={page}&limit=50", - self.url, org - ); - - tracing::trace!("calling url: {}", &url); - - let response = client - .get(&url) - .header("Content-Type", "application/json") - .header("Authorization", format!("token {}", self.token)) - .send() - .await?; - - let mut pages = Vec::new(); - if page <= 1 { - if let Some(link_header) = response.headers().get("link") { - let link_str = link_header.to_str()?; - pages = parse_link(page, link_str)?; - } - } - - let repositories = response.json::>().await?; - - Ok(( - repositories - .into_iter() - .flat_map(Repository::try_from) - .collect(), - pages, - )) - } - - pub async fn fetch_org_repos(&self, org: &str) -> anyhow::Result> { - let (repos, pages) = self.fetch_org_repos_page(org, 1).await?; - - let tasks = pages - .into_iter() - .map(|page| async move { - let (new_repos, _) = self.fetch_org_repos_page(org, page).await?; - - Ok::, anyhow::Error>(new_repos) - }) - .collect::>(); - - let res: Result>, anyhow::Error> = tasks.try_collect().await; - let res = res?.into_iter().flatten(); - - Ok(repos.into_iter().chain(res).collect()) - } - - async fn fetch_renovate(&self, repo: &Repository) -> anyhow::Result> { - let client = reqwest::Client::new(); - - let url = format!( - "{}/api/v1/repos/{}/{}/contents/renovate.json", - self.url, &repo.owner, &repo.name - ); - - tracing::trace!("calling url: {}", &url); - - let response = (|| async { - client - .get(&url) - .header("Content-Type", "application/json") - .header("Authorization", format!("token {}", self.token)) - .send() - .await - }) - .retry(&ExponentialBuilder::default()) - .notify(|err, dur| { - tracing::debug!("retrying job: {err}, in: {} seconds", dur.as_secs()); - }) - .await?; - - match response.error_for_status() { - Ok(_) => Ok(Some(())), - Err(e) => match e.status() { - Some(StatusCode::NOT_FOUND) => Ok(None), - Some(status) => { - tracing::warn!( - "failed to call fetch renovate for: {}, with error: {}", - &repo, - status - ); - anyhow::bail!(e) - } - _ => { - anyhow::bail!(e) - } - }, - } - } - - async fn get_webhook(&self, repo: &Repository) -> anyhow::Result> { - let client = reqwest::Client::new(); - - let url = format!( - "{}/api/v1/repos/{}/{}/hooks", - self.url, &repo.owner, &repo.name - ); - - tracing::trace!("calling url: {}", &url); - - let response = (|| async { - client - .get(&url) - .header("Content-Type", "application/json") - .header("Authorization", format!("token {}", self.token)) - .send() - .await - }) - .retry(&ExponentialBuilder::default()) - .notify(|err, dur| { - tracing::debug!("retrying job: {err}, in: {} seconds", dur.as_secs()); - }) - .await?; - - let webhooks = response.json::>().await?; - - let valid_webhooks = webhooks - .into_iter() - .filter(|w| w.r#type == GiteaWebhookType::Gitea) - .filter(|w| w.config.url.contains("contractor")) - .collect::>(); - - Ok(valid_webhooks.first().map(|f| f.to_owned())) - } - - async fn add_webhook(&self, repo: &Repository) -> anyhow::Result<()> { - let client = reqwest::Client::new(); - - let url = format!( - "{}/api/v1/repos/{}/{}/hooks", - self.url, &repo.owner, &repo.name - ); - - let val = self.create_webhook(); - - tracing::trace!( - "calling url: {} with body {}", - &url, - serde_json::to_string(&val)? - ); - - let response = (|| async { - client - .post(&url) - .header("Content-Type", "application/json") - .header("Accept", "application/json") - .header("Authorization", format!("token {}", self.token)) - .json(&val) - .send() - .await - }) - .retry(&ExponentialBuilder::default()) - .notify(|err, dur| { - tracing::debug!("retrying job: {err}, in: {} seconds", dur.as_secs()); - }) - .await?; - - if let Err(e) = response.error_for_status_ref() { - if let Ok(ok) = response.text().await { - anyhow::bail!("failed to create webhook: {}, body: {}", e, ok); - } - - anyhow::bail!("failed to create webhook: {}", e) - } - - Ok(()) - } - - fn create_webhook(&self) -> CreateGiteaWebhook { - CreateGiteaWebhook { - active: true, - authorization_header: Some("something".into()), - branch_filter: Some("*".into()), - config: CreateGiteaWebhookConfig { - content_type: "json".into(), - url: format!("{}?type=contractor", self.webhook_url), - }, - events: vec!["pull_request_comment".into(), "issue_comment".into()], - r#type: GiteaWebhookType::Gitea, - } - } - - async fn update_webhook(&self, repo: &Repository, webhook: GiteaWebhook) -> anyhow::Result<()> { - let client = reqwest::Client::new(); - - let url = format!( - "{}/api/v1/repos/{}/{}/hooks/{}", - self.url, &repo.owner, &repo.name, &webhook.id, - ); - - let val = self.create_webhook(); - - tracing::trace!( - "calling url: {} with body {}", - &url, - serde_json::to_string(&val)? - ); - - let response = (|| async { - client - .patch(&url) - .header("Content-Type", "application/json") - .header("Accept", "application/json") - .header("Authorization", format!("token {}", self.token)) - .json(&val) - .send() - .await - }) - .retry(&ExponentialBuilder::default()) - .notify(|err, dur| { - tracing::debug!("retrying job: {err}, in: {} seconds", dur.as_secs()); - }) - .await?; - - if let Err(e) = response.error_for_status_ref() { - if let Ok(ok) = response.text().await { - anyhow::bail!("failed to create webhook: {}, body: {}", e, ok); - } - - anyhow::bail!("failed to create webhook: {}", e) - } - - Ok(()) - } -} - -impl traits::GiteaClient for DefaultGiteaClient { - fn get_user_repositories<'a>( - &'a self, - user: &str, - ) -> Pin>> + Send + 'a>> - { - tracing::debug!("fetching gitea repositories for user: {user}"); - - Box::pin(async { self.fetch_user_repos().await }) - } - - fn get_org_repositories<'a>( - &'a self, - org: &'a str, - ) -> Pin>> + Send + 'a>> - { - tracing::debug!("fetching gitea repositories for org: {org}"); - - Box::pin(async move { self.fetch_org_repos(org).await }) - } - - fn renovate_enabled<'a>( - &'a self, - repo: &'a Repository, - ) -> Pin> + Send + 'a>> { - tracing::trace!("checking whether renovate is enabled for: {:?}", repo); - - Box::pin(async { self.fetch_renovate(repo).await.map(|s| s.is_some()) }) - } - - fn ensure_webhook<'a>( - &'a self, - repo: &'a Repository, - force_refresh: bool, - ) -> Pin> + Send + 'a>> { - tracing::trace!("ensuring webhook exists for repo: {}", repo); - - Box::pin(async move { - match (self.get_webhook(repo).await?, force_refresh) { - (Some(_), false) => { - tracing::trace!("webhook already found for {} skipping...", repo); - } - (Some(webhook), true) => { - tracing::trace!("webhook already found for {} refreshing it", repo); - self.update_webhook(repo, webhook).await?; - } - (None, _) => { - tracing::trace!("webhook was not found for {} adding", repo); - self.add_webhook(repo).await?; - } - } - - Ok(()) - }) - } -} - -// ; rel="next",; rel="last" -fn parse_link(page: usize, link_str: &str) -> anyhow::Result> { - let link_sections = link_str.split(','); - - for link_section in link_sections { - if let Some((link, rel)) = link_section.rsplit_once("; ") { - if rel == r#"rel="last""# { - let actual_link = &link[1..link.len() - 1]; - - let url = Url::parse(actual_link)?; - - if let Some(page_num) = url - .query_pairs() - .into_iter() - .find(|(name, _)| name == "page") - .map(|(_, value)| value) - { - let page_num: usize = page_num.parse()?; - - let page_numbers = (page + 1..page_num).collect::>(); - - return Ok(page_numbers); - } - } - } - } - - Ok(Vec::default()) -} - -mod extensions; -pub mod traits; - -use anyhow::Context; -use backon::{ExponentialBuilder, Retryable}; -pub use extensions::*; -use futures::{stream::FuturesUnordered, TryStreamExt}; -use reqwest::{StatusCode, Url}; -use serde::{Deserialize, Serialize}; diff --git a/crates/contractor/src/services/gitea/extensions.rs b/crates/contractor/src/services/gitea/extensions.rs deleted file mode 100644 index 6d91e8d..0000000 --- a/crates/contractor/src/services/gitea/extensions.rs +++ /dev/null @@ -1,11 +0,0 @@ -use crate::SharedState; - -use super::GiteaClient; - -pub trait GiteaClientState { - fn gitea_client(&self) -> GiteaClient { - GiteaClient::new() - } -} - -impl GiteaClientState for SharedState {} diff --git a/crates/contractor/src/services/gitea/traits.rs b/crates/contractor/src/services/gitea/traits.rs deleted file mode 100644 index 5394c40..0000000 --- a/crates/contractor/src/services/gitea/traits.rs +++ /dev/null @@ -1,28 +0,0 @@ -use std::pin::Pin; - -use futures::Future; - -use super::Repository; - -pub trait GiteaClient { - fn get_user_repositories<'a>( - &'a self, - user: &str, - ) -> Pin>> + Send + 'a>>; - - fn get_org_repositories<'a>( - &'a self, - org: &'a str, - ) -> Pin>> + Send + 'a>>; - - fn renovate_enabled<'a>( - &'a self, - repo: &'a Repository, - ) -> Pin> + Send + 'a>>; - - fn ensure_webhook<'a>( - &'a self, - repo: &'a Repository, - force_refresh: bool, - ) -> Pin> + Send + 'a>>; -} diff --git a/crates/contractor/src/services/reconciler.rs b/crates/contractor/src/services/reconciler.rs deleted file mode 100644 index 51ac9c0..0000000 --- a/crates/contractor/src/services/reconciler.rs +++ /dev/null @@ -1,153 +0,0 @@ -use anyhow::Context; -use futures::{stream::FuturesUnordered, StreamExt}; -use itertools::Itertools; - -use crate::SharedState; - -use super::gitea::{GiteaClient, GiteaClientState, Repository}; - -pub struct Reconciler { - gitea_client: GiteaClient, -} - -impl Reconciler { - pub fn new(gitea_client: GiteaClient) -> Self { - Self { gitea_client } - } - - pub async fn reconcile( - &self, - user: Option, - orgs: Option>, - filter: Option, - force_refresh: bool, - ) -> anyhow::Result<()> { - let repos = self.get_repos(user, orgs).await?; - tracing::debug!("found repositories: {}", repos.len()); - - let filtered_repos = match filter { - Some(filter) => { - let re = regex::Regex::new(&filter).context( - "filter regex failed to compile, make sure it is valid against rust-lang/regex", - )?; - - repos - .into_iter() - .filter(|r| { - if re.is_match(&r.to_string()) { - true - } else { - tracing::trace!( - filter = &filter, - "repository: {}, didn't match filter", - r.to_string(), - ); - false - } - }) - .collect() - } - None => repos, - }; - tracing::debug!("filtered repositories: {}", filtered_repos.len()); - - let renovate_enabled = self.get_renovate_enabled(&filtered_repos).await?; - tracing::debug!( - "found repositories with renovate enabled: {}", - renovate_enabled.len() - ); - - self.ensure_webhook(&renovate_enabled, force_refresh) - .await?; - - Ok(()) - } - - async fn get_repos( - &self, - user: Option, - orgs: Option>, - ) -> anyhow::Result> { - let mut repos = Vec::new(); - - if let Some(user) = user { - let mut r = self.gitea_client.get_user_repositories(&user).await?; - - repos.append(&mut r); - } - - if let Some(orgs) = orgs { - for org in orgs { - let mut r = self.gitea_client.get_org_repositories(&org).await?; - repos.append(&mut r); - } - } - - Ok(repos.into_iter().unique().collect()) - } - - async fn get_renovate_enabled(&self, repos: &[Repository]) -> anyhow::Result> { - let mut futures = FuturesUnordered::new(); - - for repo in repos { - futures.push(async move { - let enabled = self.gitea_client.renovate_enabled(repo).await?; - - if enabled { - Ok::, anyhow::Error>(Some(repo.to_owned())) - } else { - tracing::trace!("repository: {:?}, doesn't have renovate enabled", repo); - Ok(None) - } - }) - } - - let mut enabled = Vec::new(); - - while let Some(res) = futures.next().await { - let res = res?; - - if let Some(repo) = res { - enabled.push(repo) - } - } - - Ok(enabled) - } - - async fn ensure_webhook( - &self, - repos: &[Repository], - force_refresh: bool, - ) -> anyhow::Result<()> { - tracing::debug!("ensuring webhooks are setup for repos"); - - let mut tasks = FuturesUnordered::new(); - - for repo in repos { - tasks.push(async move { - self.gitea_client - .ensure_webhook(repo, force_refresh) - .await?; - - Ok::<(), anyhow::Error>(()) - }) - } - - while let Some(res) = tasks.next().await { - res?; - } - - Ok(()) - } -} - -pub trait ReconcilerState { - fn reconciler(&self) -> Reconciler; -} - -impl ReconcilerState for SharedState { - fn reconciler(&self) -> Reconciler { - Reconciler::new(self.gitea_client()) - } -} diff --git a/crates/contractor/src/services/renovate.rs b/crates/contractor/src/services/renovate.rs deleted file mode 100644 index ccc2c88..0000000 --- a/crates/contractor/src/services/renovate.rs +++ /dev/null @@ -1,3 +0,0 @@ -pub struct RenovateConfig { - pub repo: String, -} diff --git a/crates/contractor/src/state.rs b/crates/contractor/src/state.rs deleted file mode 100644 index ab6e05f..0000000 --- a/crates/contractor/src/state.rs +++ /dev/null @@ -1,46 +0,0 @@ -use std::{ops::Deref, sync::Arc}; - -use crate::services::engines::dagger::Dagger; - -#[derive(Clone)] -pub struct SharedState(Arc); - -impl From> for SharedState { - fn from(value: Arc) -> Self { - Self(value) - } -} - -impl Deref for SharedState { - type Target = Arc; - - fn deref(&self) -> &Self::Target { - &self.0 - } -} - -pub struct State { - // pub db: Pool, - pub engine: Dagger, -} - -impl State { - pub async fn new() -> anyhow::Result { - // let db = sqlx::PgPool::connect( - // &std::env::var("DATABASE_URL").context("DATABASE_URL is not set")?, - // ) - // .await?; - - // sqlx::migrate!("migrations/crdb") - // .set_locking(false) - // .run(&db) - // .await?; - - // let _ = sqlx::query("SELECT 1;").fetch_one(&db).await?; - - // Ok(Self { db }) - let engine = Dagger::new(); - - Ok(Self { engine }) - } -} diff --git a/cuddle.yaml b/cuddle.yaml index a900b1c..5eed9cd 100644 --- a/cuddle.yaml +++ b/cuddle.yaml @@ -1,21 +1,27 @@ # yaml-language-server: $schema=https://git.front.kjuulh.io/kjuulh/cuddle/raw/branch/main/schemas/base.json -base: "git@git.front.kjuulh.io:kjuulh/cuddle-rust-service-plan.git" +base: "git@git.front.kjuulh.io:kjuulh/cuddle-golang-service-plan.git" vars: service: "contractor" registry: kasperhermansen + docker_image: "docker:dind" + golang_builder_image: "golang:latest" + production_image: "alpine:latest" - clusters: - clank-prod: - replicas: "3" - namespace: prod - - -deployment: - registry: git@git.front.kjuulh.io:kjuulh/clank-clusters - env: - prod: - clusters: - - clank-prod +please: + project: + owner: kjuulh + repository: contractor + branch: main + settings: + api_url: https://git.front.kjuulh.io +scripts: + "ci:main": + type: shell + "ci:pr": + type: shell + "ci:release": + type: shell + \ No newline at end of file diff --git a/go.mod b/go.mod new file mode 100644 index 0000000..cf3357e --- /dev/null +++ b/go.mod @@ -0,0 +1,64 @@ +module git.front.kjuulh.io/kjuulh/contractor + +go 1.21 + +toolchain go1.22.1 + +require ( + dagger.io/dagger v0.8.1 + github.com/bradleyfalzon/ghinstallation/v2 v2.10.0 + github.com/gin-gonic/gin v1.9.1 + github.com/google/go-github/v53 v53.2.0 + github.com/google/go-github/v61 v61.0.0 + github.com/google/uuid v1.6.0 + github.com/joho/godotenv v1.5.1 + github.com/spf13/cobra v1.8.0 +) + +require ( + github.com/99designs/gqlgen v0.17.31 // indirect + github.com/Khan/genqlient v0.6.0 // indirect + github.com/ProtonMail/go-crypto v0.0.0-20230217124315-7d5c6f04bbb8 // indirect + github.com/adrg/xdg v0.4.0 // indirect + github.com/bytedance/sonic v1.9.1 // indirect + github.com/chenzhuoyu/base64x v0.0.0-20221115062448-fe3a3abad311 // indirect + github.com/cloudflare/circl v1.3.3 // indirect + github.com/gabriel-vasile/mimetype v1.4.2 // indirect + github.com/gin-contrib/sse v0.1.0 // indirect + github.com/go-playground/locales v0.14.1 // indirect + github.com/go-playground/universal-translator v0.18.1 // indirect + github.com/go-playground/validator/v10 v10.14.0 // indirect + github.com/goccy/go-json v0.10.2 // indirect + github.com/golang-jwt/jwt/v4 v4.5.0 // indirect + github.com/golang/protobuf v1.5.2 // indirect + github.com/google/go-github/v55 v55.0.0 // indirect + github.com/google/go-github/v56 v56.0.0 // indirect + github.com/google/go-github/v57 v57.0.0 // indirect + github.com/google/go-github/v60 v60.0.0 // indirect + github.com/google/go-querystring v1.1.0 // indirect + github.com/iancoleman/strcase v0.3.0 // indirect + github.com/inconshreveable/mousetrap v1.1.0 // indirect + github.com/json-iterator/go v1.1.12 // indirect + github.com/klauspost/cpuid/v2 v2.2.4 // indirect + github.com/leodido/go-urn v1.2.4 // indirect + github.com/mattn/go-isatty v0.0.19 // indirect + github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect + github.com/modern-go/reflect2 v1.0.2 // indirect + github.com/pelletier/go-toml/v2 v2.0.8 // indirect + github.com/spf13/pflag v1.0.5 // indirect + github.com/twitchyliquid64/golang-asm v0.15.1 // indirect + github.com/ugorji/go/codec v1.2.11 // indirect + github.com/vektah/gqlparser/v2 v2.5.6 // indirect + golang.org/x/arch v0.3.0 // indirect + golang.org/x/crypto v0.12.0 // indirect + golang.org/x/mod v0.12.0 // indirect + golang.org/x/net v0.12.0 // indirect + golang.org/x/oauth2 v0.8.0 // indirect + golang.org/x/sync v0.3.0 // indirect + golang.org/x/sys v0.11.0 // indirect + golang.org/x/text v0.12.0 // indirect + golang.org/x/tools v0.11.0 // indirect + google.golang.org/appengine v1.6.7 // indirect + google.golang.org/protobuf v1.30.0 // indirect + gopkg.in/yaml.v3 v3.0.1 // indirect +) diff --git a/go.sum b/go.sum new file mode 100644 index 0000000..b25930d --- /dev/null +++ b/go.sum @@ -0,0 +1,241 @@ +cloud.google.com/go/compute/metadata v0.2.0/go.mod h1:zFmK7XCadkQkj6TtorcaGlCW1hT1fIilQDwofLpJ20k= +dagger.io/dagger v0.8.1 h1:jLNPGubxrLWUfsX+snjaw913B1lxVmWftzdVehB+RQU= +dagger.io/dagger v0.8.1/go.mod h1:CZwYt0FfVsEEYTFytzf2ihESB2P4H1S3/UfnrVxjBsE= +github.com/99designs/gqlgen v0.17.31 h1:VncSQ82VxieHkea8tz11p7h/zSbvHSxSDZfywqWt158= +github.com/99designs/gqlgen v0.17.31/go.mod h1:i4rEatMrzzu6RXaHydq1nmEPZkb3bKQsnxNRHS4DQB4= +github.com/Khan/genqlient v0.6.0 h1:Bwb1170ekuNIVIwTJEqvO8y7RxBxXu639VJOkKSrwAk= +github.com/Khan/genqlient v0.6.0/go.mod h1:rvChwWVTqXhiapdhLDV4bp9tz/Xvtewwkon4DpWWCRM= +github.com/ProtonMail/go-crypto v0.0.0-20230217124315-7d5c6f04bbb8 h1:wPbRQzjjwFc0ih8puEVAOFGELsn1zoIIYdxvML7mDxA= +github.com/ProtonMail/go-crypto v0.0.0-20230217124315-7d5c6f04bbb8/go.mod h1:I0gYDMZ6Z5GRU7l58bNFSkPTFN6Yl12dsUlAZ8xy98g= +github.com/adrg/xdg v0.4.0 h1:RzRqFcjH4nE5C6oTAxhBtoE2IRyjBSa62SCbyPidvls= +github.com/adrg/xdg v0.4.0/go.mod h1:N6ag73EX4wyxeaoeHctc1mas01KZgsj5tYiAIwqJE/E= +github.com/agnivade/levenshtein v1.1.1 h1:QY8M92nrzkmr798gCo3kmMyqXFzdQVpxLlGPRBij0P8= +github.com/agnivade/levenshtein v1.1.1/go.mod h1:veldBMzWxcCG2ZvUTKD2kJNRdCk5hVbJomOvKkmgYbo= +github.com/andreyvit/diff v0.0.0-20170406064948-c7f18ee00883 h1:bvNMNQO63//z+xNgfBlViaCIJKLlCJ6/fmUseuG0wVQ= +github.com/andreyvit/diff v0.0.0-20170406064948-c7f18ee00883/go.mod h1:rCTlJbsFo29Kk6CurOXKm700vrz8f0KW0JNfpkRJY/8= +github.com/arbovm/levenshtein v0.0.0-20160628152529-48b4e1c0c4d0/go.mod h1:t2tdKJDJF9BV14lnkjHmOQgcvEKgtqs5a1N3LNdJhGE= +github.com/bradleyfalzon/ghinstallation/v2 v2.6.0 h1:IRY7Xy588KylkoycsUhFpW7cdGpy5Y5BPsz4IfuJtGk= +github.com/bradleyfalzon/ghinstallation/v2 v2.6.0/go.mod h1:oQ3etOwN3TRH4EwgW5/7MxSVMGlMlzG/O8TU7eYdoSk= +github.com/bradleyfalzon/ghinstallation/v2 v2.7.0 h1:ranXaC3Zz/F6G/f0Joj3LrFp2OzOKfJZev5Q7OaMc88= +github.com/bradleyfalzon/ghinstallation/v2 v2.7.0/go.mod h1:ymxfmloxXBFXvvF1KpeUhOQM6Dfz9NYtfvTiJyk82UE= +github.com/bradleyfalzon/ghinstallation/v2 v2.8.0 h1:yUmoVv70H3J4UOqxqsee39+KlXxNEDfTbAp8c/qULKk= +github.com/bradleyfalzon/ghinstallation/v2 v2.8.0/go.mod h1:fmPmvCiBWhJla3zDv9ZTQSZc8AbwyRnGW1yg5ep1Pcs= +github.com/bradleyfalzon/ghinstallation/v2 v2.9.0 h1:HmxIYqnxubRYcYGRc5v3wUekmo5Wv2uX3gukmWJ0AFk= +github.com/bradleyfalzon/ghinstallation/v2 v2.9.0/go.mod h1:wmkTDJf8CmVypxE8ijIStFnKoTa6solK5QfdmJrP9KI= +github.com/bradleyfalzon/ghinstallation/v2 v2.10.0 h1:XWuWBRFEpqVrHepQob9yPS3Xg4K3Wr9QCx4fu8HbUNg= +github.com/bradleyfalzon/ghinstallation/v2 v2.10.0/go.mod h1:qoGA4DxWPaYTgVCrmEspVSjlTu4WYAiSxMIhorMRXXc= +github.com/bwesterb/go-ristretto v1.2.0/go.mod h1:fUIoIZaG73pV5biE2Blr2xEzDoMj7NFEuV9ekS419A0= +github.com/bwesterb/go-ristretto v1.2.3/go.mod h1:fUIoIZaG73pV5biE2Blr2xEzDoMj7NFEuV9ekS419A0= +github.com/bytedance/sonic v1.5.0/go.mod h1:ED5hyg4y6t3/9Ku1R6dU/4KyJ48DZ4jPhfY1O2AihPM= +github.com/bytedance/sonic v1.9.1 h1:6iJ6NqdoxCDr6mbY8h18oSO+cShGSMRGCEo7F2h0x8s= +github.com/bytedance/sonic v1.9.1/go.mod h1:i736AoUSYt75HyZLoJW9ERYxcy6eaN6h4BZXU064P/U= +github.com/chenzhuoyu/base64x v0.0.0-20211019084208-fb5309c8db06/go.mod h1:DH46F32mSOjUmXrMHnKwZdA8wcEefY7UVqBKYGjpdQY= +github.com/chenzhuoyu/base64x v0.0.0-20221115062448-fe3a3abad311 h1:qSGYFH7+jGhDF8vLC+iwCD4WpbV1EBDSzWkJODFLams= +github.com/chenzhuoyu/base64x v0.0.0-20221115062448-fe3a3abad311/go.mod h1:b583jCggY9gE99b6G5LEC39OIiVsWj+R97kbl5odCEk= +github.com/cloudflare/circl v1.1.0/go.mod h1:prBCrKB9DV4poKZY1l9zBXg2QJY7mvgRvtMxxK7fi4I= +github.com/cloudflare/circl v1.3.3 h1:fE/Qz0QdIGqeWfnwq0RE0R7MI51s0M2E4Ga9kq5AEMs= +github.com/cloudflare/circl v1.3.3/go.mod h1:5XYMA4rFBvNIrhs50XuiBJ15vF2pZn4nnUKZrLbUZFA= +github.com/cpuguy83/go-md2man/v2 v2.0.2/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o= +github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= +github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/dgryski/trifles v0.0.0-20200323201526-dd97f9abfb48/go.mod h1:if7Fbed8SFyPtHLHbg49SI7NAdJiC5WIA09pe59rfAA= +github.com/gabriel-vasile/mimetype v1.4.2 h1:w5qFW6JKBz9Y393Y4q372O9A7cUSequkh1Q7OhCmWKU= +github.com/gabriel-vasile/mimetype v1.4.2/go.mod h1:zApsH/mKG4w07erKIaJPFiX0Tsq9BFQgN3qGY5GnNgA= +github.com/gin-contrib/sse v0.1.0 h1:Y/yl/+YNO8GZSjAhjMsSuLt29uWRFHdHYUb5lYOV9qE= +github.com/gin-contrib/sse v0.1.0/go.mod h1:RHrZQHXnP2xjPF+u1gW/2HnVO7nvIa9PG3Gm+fLHvGI= +github.com/gin-gonic/gin v1.9.1 h1:4idEAncQnU5cB7BeOkPtxjfCSye0AAm1R0RVIqJ+Jmg= +github.com/gin-gonic/gin v1.9.1/go.mod h1:hPrL7YrpYKXt5YId3A/Tnip5kqbEAP+KLuI3SUcPTeU= +github.com/go-playground/assert/v2 v2.2.0 h1:JvknZsQTYeFEAhQwI4qEt9cyV5ONwRHC+lYKSsYSR8s= +github.com/go-playground/locales v0.14.1 h1:EWaQ/wswjilfKLTECiXz7Rh+3BjFhfDFKv/oXslEjJA= +github.com/go-playground/locales v0.14.1/go.mod h1:hxrqLVvrK65+Rwrd5Fc6F2O76J/NuW9t0sjnWqG1slY= +github.com/go-playground/universal-translator v0.18.1 h1:Bcnm0ZwsGyWbCzImXv+pAJnYK9S473LQFuzCbDbfSFY= +github.com/go-playground/universal-translator v0.18.1/go.mod h1:xekY+UJKNuX9WP91TpwSH2VMlDf28Uj24BCp08ZFTUY= +github.com/go-playground/validator/v10 v10.14.0 h1:vgvQWe3XCz3gIeFDm/HnTIbj6UGmg/+t63MyGU2n5js= +github.com/go-playground/validator/v10 v10.14.0/go.mod h1:9iXMNT7sEkjXb0I+enO7QXmzG6QCsPWY4zveKFVRSyU= +github.com/goccy/go-json v0.10.2 h1:CrxCmQqYDkv1z7lO7Wbh2HN93uovUHgrECaO5ZrCXAU= +github.com/goccy/go-json v0.10.2/go.mod h1:6MelG93GURQebXPDq3khkgXZkazVtN9CRI+MGFi0w8I= +github.com/golang-jwt/jwt/v4 v4.5.0 h1:7cYmW1XlMY7h7ii7UhUyChSgS5wUJEnm9uZVTGqOWzg= +github.com/golang-jwt/jwt/v4 v4.5.0/go.mod h1:m21LjoU+eqJr34lmDMbreY2eSTRJ1cv77w39/MY0Ch0= +github.com/golang/protobuf v1.3.1/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= +github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaSAoJOfIk= +github.com/golang/protobuf v1.5.2 h1:ROPKBNFfQgOUMifHyP+KYbvpjbdoFNs+aK7DXlji0Tw= +github.com/golang/protobuf v1.5.2/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY= +github.com/google/go-cmp v0.5.2/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/go-cmp v0.5.8/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= +github.com/google/go-cmp v0.5.9 h1:O2Tfq5qg4qc4AmwVlvv0oLiVAGB7enBSJ2x2DqQFi38= +github.com/google/go-cmp v0.5.9/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= +github.com/google/go-github/v53 v53.2.0 h1:wvz3FyF53v4BK+AsnvCmeNhf8AkTaeh2SoYu/XUvTtI= +github.com/google/go-github/v53 v53.2.0/go.mod h1:XhFRObz+m/l+UCm9b7KSIC3lT3NWSXGt7mOsAWEloao= +github.com/google/go-github/v55 v55.0.0 h1:4pp/1tNMB9X/LuAhs5i0KQAE40NmiR/y6prLNb9x9cg= +github.com/google/go-github/v55 v55.0.0/go.mod h1:JLahOTA1DnXzhxEymmFF5PP2tSS9JVNj68mSZNDwskA= +github.com/google/go-github/v56 v56.0.0 h1:TysL7dMa/r7wsQi44BjqlwaHvwlFlqkK8CtBWCX3gb4= +github.com/google/go-github/v56 v56.0.0/go.mod h1:D8cdcX98YWJvi7TLo7zM4/h8ZTx6u6fwGEkCdisopo0= +github.com/google/go-github/v57 v57.0.0 h1:L+Y3UPTY8ALM8x+TV0lg+IEBI+upibemtBD8Q9u7zHs= +github.com/google/go-github/v57 v57.0.0/go.mod h1:s0omdnye0hvK/ecLvpsGfJMiRt85PimQh4oygmLIxHw= +github.com/google/go-github/v58 v58.0.0/go.mod h1:k4hxDKEfoWpSqFlc8LTpGd9fu2KrV1YAa6Hi6FmDNY4= +github.com/google/go-github/v60 v60.0.0 h1:oLG98PsLauFvvu4D/YPxq374jhSxFYdzQGNCyONLfn8= +github.com/google/go-github/v60 v60.0.0/go.mod h1:ByhX2dP9XT9o/ll2yXAu2VD8l5eNVg8hD4Cr0S/LmQk= +github.com/google/go-github/v61 v61.0.0/go.mod h1:0WR+KmsWX75G2EbpyGsGmradjo3IiciuI4BmdVCobQY= +github.com/google/go-querystring v1.1.0 h1:AnCroh3fv4ZBgVIf1Iwtovgjaw/GiKJo8M8yD/fhyJ8= +github.com/google/go-querystring v1.1.0/go.mod h1:Kcdr2DB4koayq7X8pmAG4sNG59So17icRSOU623lUBU= +github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= +github.com/google/uuid v1.3.0 h1:t6JiXgmwXMjEs8VusXIJk2BXHsn+wx8BZdTaoZ5fu7I= +github.com/google/uuid v1.3.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= +github.com/google/uuid v1.3.1 h1:KjJaJ9iWZ3jOFZIf1Lqf4laDRCasjl0BCmnEGxkdLb4= +github.com/google/uuid v1.3.1/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= +github.com/google/uuid v1.4.0 h1:MtMxsa51/r9yyhkyLsVeVt0B+BGQZzpQiTQ4eHZ8bc4= +github.com/google/uuid v1.4.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= +github.com/google/uuid v1.5.0 h1:1p67kYwdtXjb0gL0BPiP1Av9wiZPo5A8z2cWkTZ+eyU= +github.com/google/uuid v1.5.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= +github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0= +github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= +github.com/iancoleman/strcase v0.3.0 h1:nTXanmYxhfFAMjZL34Ov6gkzEsSJZ5DbhxWjvSASxEI= +github.com/iancoleman/strcase v0.3.0/go.mod h1:iwCmte+B7n89clKwxIoIXy/HfoL7AsD47ZCWhYzw7ho= +github.com/inconshreveable/mousetrap v1.1.0 h1:wN+x4NVGpMsO7ErUn/mUI3vEoE6Jt13X2s0bqwp9tc8= +github.com/inconshreveable/mousetrap v1.1.0/go.mod h1:vpF70FUmC8bwa3OWnCshd2FqLfsEA9PFc4w1p2J65bw= +github.com/joho/godotenv v1.5.1 h1:7eLL/+HRGLY0ldzfGMeQkb7vMd0as4CfYvUVzLqw0N0= +github.com/joho/godotenv v1.5.1/go.mod h1:f4LDr5Voq0i2e/R5DDNOoa2zzDfwtkZa6DnEwAbqwq4= +github.com/json-iterator/go v1.1.12 h1:PV8peI4a0ysnczrg+LtxykD8LfKY9ML6u2jnxaEnrnM= +github.com/json-iterator/go v1.1.12/go.mod h1:e30LSqwooZae/UwlEbR2852Gd8hjQvJoHmT4TnhNGBo= +github.com/klauspost/cpuid/v2 v2.0.9/go.mod h1:FInQzS24/EEf25PyTYn52gqo7WaD8xa0213Md/qVLRg= +github.com/klauspost/cpuid/v2 v2.2.4 h1:acbojRNwl3o09bUq+yDCtZFc1aiwaAAxtcn8YkZXnvk= +github.com/klauspost/cpuid/v2 v2.2.4/go.mod h1:RVVoqg1df56z8g3pUjL/3lE5UfnlrJX8tyFgg4nqhuY= +github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= +github.com/kr/pretty v0.2.1 h1:Fmg33tUaq4/8ym9TJN1x7sLJnHVwhP33CNkpYV/7rwI= +github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= +github.com/kr/text v0.1.0 h1:45sCR5RtlFHMR4UwH9sdQ5TC8v0qDQCHnXt+kaKSTVE= +github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= +github.com/leodido/go-urn v1.2.4 h1:XlAE/cm/ms7TE/VMVoduSpNBoyc2dOxHs5MZSwAN63Q= +github.com/leodido/go-urn v1.2.4/go.mod h1:7ZrI8mTSeBSHl/UaRyKQW1qZeMgak41ANeCNaVckg+4= +github.com/mattn/go-isatty v0.0.19 h1:JITubQf0MOLdlGRuRq+jtsDlekdYPia9ZFsB8h/APPA= +github.com/mattn/go-isatty v0.0.19/go.mod h1:W+V8PltTTMOvKvAeJH7IuucS94S2C6jfK/D7dTCTo3Y= +github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= +github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd h1:TRLaZ9cD/w8PVh93nsPXa1VrQ6jlwL5oN8l14QlcNfg= +github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= +github.com/modern-go/reflect2 v1.0.2 h1:xBagoLtFs94CBntxluKeaWgTMpvLxC4ur3nMaC9Gz0M= +github.com/modern-go/reflect2 v1.0.2/go.mod h1:yWuevngMOJpCy52FWWMvUC8ws7m/LJsjYzDa0/r8luk= +github.com/pelletier/go-toml/v2 v2.0.8 h1:0ctb6s9mE31h0/lhu+J6OPmVeDxJn+kYnJc2jZR9tGQ= +github.com/pelletier/go-toml/v2 v2.0.8/go.mod h1:vuYfssBdrU2XDZ9bYydBu6t+6a6PYNcZljzZR9VXg+4= +github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= +github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= +github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= +github.com/sergi/go-diff v1.3.1 h1:xkr+Oxo4BOQKmkn/B9eMK0g5Kg/983T9DqqPHwYqD+8= +github.com/sergi/go-diff v1.3.1/go.mod h1:aMJSSKb2lpPvRNec0+w3fl7LP9IOFzdc9Pa4NFbPK1I= +github.com/spf13/cobra v1.7.0 h1:hyqWnYt1ZQShIddO5kBpj3vu05/++x6tJ6dg8EC572I= +github.com/spf13/cobra v1.7.0/go.mod h1:uLxZILRyS/50WlhOIKD7W6V5bgeIt+4sICxh6uRMrb0= +github.com/spf13/cobra v1.8.0 h1:7aJaZx1B85qltLMc546zn58BxxfZdR/W22ej9CFoEf0= +github.com/spf13/cobra v1.8.0/go.mod h1:WXLWApfZ71AjXPya3WOlMsY9yMs7YeiHhFVlvLyhcho= +github.com/spf13/pflag v1.0.5 h1:iy+VFUOCP1a+8yFto/drg2CJ5u0yRoB7fZw3DKv/JXA= +github.com/spf13/pflag v1.0.5/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg= +github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= +github.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw= +github.com/stretchr/objx v0.5.0/go.mod h1:Yh+to48EsGEfYuaHDzXPcE3xhTkx73EhmCGUpEOglKo= +github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= +github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4= +github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= +github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= +github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU= +github.com/stretchr/testify v1.8.1/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4= +github.com/stretchr/testify v1.8.2/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4= +github.com/stretchr/testify v1.8.3 h1:RP3t2pwF7cMEbC1dqtB6poj3niw/9gnV4Cjg5oW5gtY= +github.com/stretchr/testify v1.8.3/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo= +github.com/twitchyliquid64/golang-asm v0.15.1 h1:SU5vSMR7hnwNxj24w34ZyCi/FmDZTkS4MhqMhdFk5YI= +github.com/twitchyliquid64/golang-asm v0.15.1/go.mod h1:a1lVb/DtPvCB8fslRZhAngC2+aY1QWCk3Cedj/Gdt08= +github.com/ugorji/go/codec v1.2.11 h1:BMaWp1Bb6fHwEtbplGBGJ498wD+LKlNSl25MjdZY4dU= +github.com/ugorji/go/codec v1.2.11/go.mod h1:UNopzCgEMSXjBc6AOMqYvWC1ktqTAfzJZUZgYf6w6lg= +github.com/vektah/gqlparser/v2 v2.5.6 h1:Ou14T0N1s191eRMZ1gARVqohcbe1e8FrcONScsq8cRU= +github.com/vektah/gqlparser/v2 v2.5.6/go.mod h1:z8xXUff237NntSuH8mLFijZ+1tjV1swDbpDqjJmk6ME= +github.com/yuin/goldmark v1.4.13/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5taEt/CY= +golang.org/x/arch v0.0.0-20210923205945-b76863e36670/go.mod h1:5om86z9Hs0C8fWVUuoMHwpExlXzs5Tkyp9hOrfG7pp8= +golang.org/x/arch v0.3.0 h1:02VY4/ZcO/gBOH6PUaoiptASxtXU10jazRCP865E97k= +golang.org/x/arch v0.3.0/go.mod h1:5om86z9Hs0C8fWVUuoMHwpExlXzs5Tkyp9hOrfG7pp8= +golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= +golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= +golang.org/x/crypto v0.3.1-0.20221117191849-2c476679df9a/go.mod h1:hebNnKkNXi2UzZN1eVRvBB7co0a+JxK6XbPiWVs/3J4= +golang.org/x/crypto v0.7.0/go.mod h1:pYwdfH91IfpZVANVyUOhSIPZaFoJGxTFbZhFTx+dXZU= +golang.org/x/crypto v0.11.0 h1:6Ewdq3tDic1mg5xRO4milcWCfMVQhI4NkqWWvqejpuA= +golang.org/x/crypto v0.11.0/go.mod h1:xgJhtzW8F9jGdVFWZESrid1U1bjeNy4zgy5cRr/CIio= +golang.org/x/crypto v0.12.0 h1:tFM/ta59kqch6LlvYnPa0yx5a83cL2nHflFhYKvv9Yk= +golang.org/x/crypto v0.12.0/go.mod h1:NF0Gs7EO5K4qLn+Ylc+fih8BSTeIjAP05siRnAh98yw= +golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4= +golang.org/x/mod v0.8.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= +golang.org/x/mod v0.12.0 h1:rmsUpXtvNzj340zd98LZ4KntptpfRHwpFOHG188oHXc= +golang.org/x/mod v0.12.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= +golang.org/x/net v0.0.0-20190603091049-60506f45cf65/go.mod h1:HSz+uSET+XFnRR8LxR5pz3Of3rY3CfYBVs4xY44aLks= +golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= +golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= +golang.org/x/net v0.2.0/go.mod h1:KqCZLdyyvdV855qA2rE3GC2aiw5xGR5TEjj8smXukLY= +golang.org/x/net v0.6.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs= +golang.org/x/net v0.8.0/go.mod h1:QVkue5JL9kW//ek3r6jTKnTFis1tRmNAW2P1shuFdJc= +golang.org/x/net v0.10.0/go.mod h1:0qNGK6F8kojg2nk9dLZ2mShWaEBan6FAoqfSigmmuDg= +golang.org/x/net v0.12.0 h1:cfawfvKITfUsFCeJIHJrbSxpeu/E81khclypR0GVT50= +golang.org/x/net v0.12.0/go.mod h1:zEVYFnQC7m/vmpQFELhcD1EWkZlX69l4oqgmer6hfKA= +golang.org/x/oauth2 v0.8.0 h1:6dkIjl3j3LtZ/O3sTgZTMsLKSftL/B8Zgq4huOIIUu8= +golang.org/x/oauth2 v0.8.0/go.mod h1:yr7u4HXZRm1R1kBWqr/xKNqewf0plRYoB7sla+BCIXE= +golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.1.0/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.3.0 h1:ftCYgMx6zT/asHUrPw8BLLscYtGznsLAnjq5RH9P66E= +golang.org/x/sync v0.3.0/go.mod h1:FU7BRWz2tNW+3quACPkgCx/L+uEAv1htQ0V83Z9Rj+Y= +golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20211007075335-d3039528d8ac/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20211025201205-69cdffdb9359/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220704084225-05e143d24a9e/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.2.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.3.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.8.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.10.0 h1:SqMFp9UcQJZa+pmYuAKjd9xq1f0j5rLcDIk0mj4qAsA= +golang.org/x/sys v0.10.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.11.0 h1:eG7RXZHdqOJ1i+0lgLgCpSXAp6M3LYlAo6osgSi0xOM= +golang.org/x/sys v0.11.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= +golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= +golang.org/x/term v0.2.0/go.mod h1:TVmDHMZPmdnySmBfhjOoOdhjzdE1h4u1VwSiw2l1Nuc= +golang.org/x/term v0.5.0/go.mod h1:jMB1sMXY+tzblOD4FWmEbocvup2/aLOaQEp7JmGp78k= +golang.org/x/term v0.6.0/go.mod h1:m6U89DPEgQRMq3DNkDClhWw02AUbt2daBVO4cn4Hv9U= +golang.org/x/term v0.8.0/go.mod h1:xPskH00ivmX89bAKVGSKKtLOWNx2+17Eiy94tnKShWo= +golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= +golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= +golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= +golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= +golang.org/x/text v0.4.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= +golang.org/x/text v0.7.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= +golang.org/x/text v0.8.0/go.mod h1:e1OnstbJyHTd6l/uOt8jFFHp6TRDWZR/bV3emEE/zU8= +golang.org/x/text v0.9.0/go.mod h1:e1OnstbJyHTd6l/uOt8jFFHp6TRDWZR/bV3emEE/zU8= +golang.org/x/text v0.11.0 h1:LAntKIrcmeSKERyiOh0XMV39LXS8IE9UL2yP7+f5ij4= +golang.org/x/text v0.11.0/go.mod h1:TvPlkZtksWOMsz7fbANvkp4WM8x/WCo/om8BMLbz+aE= +golang.org/x/text v0.12.0 h1:k+n5B8goJNdU7hSvEtMUz3d1Q6D/XW4COJSJR6fN0mc= +golang.org/x/text v0.12.0/go.mod h1:TvPlkZtksWOMsz7fbANvkp4WM8x/WCo/om8BMLbz+aE= +golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= +golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc= +golang.org/x/tools v0.6.0/go.mod h1:Xwgl3UAJ/d3gWutnCtw505GrjyAbvKui8lOU390QaIU= +golang.org/x/tools v0.11.0 h1:EMCa6U9S2LtZXLAMoWiR/R8dAQFRqbAitmbJ2UKhoi8= +golang.org/x/tools v0.11.0/go.mod h1:anzJrxPjNtfgiYQYirP2CPGzGLxrH2u2QBhn6Bf3qY8= +golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +google.golang.org/appengine v1.6.7 h1:FZR1q0exgwxzPzp/aF+VccGrSfxfPpkBqjIIEq3ru6c= +google.golang.org/appengine v1.6.7/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= +google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw= +google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= +google.golang.org/protobuf v1.28.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= +google.golang.org/protobuf v1.30.0 h1:kPPoIgf3TsEvrm0PFe15JQ+570QVxYzEvvHqChK+cng= +google.golang.org/protobuf v1.30.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= +gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15 h1:YR8cESwS4TdDjEe65xsg0ogRM/Nc3DYOhEAlW+xobZo= +gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= +gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ= +gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= +gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= +gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= +rsc.io/pdf v0.1.1/go.mod h1:n8OzWcQ6Sp37PL01nO98y4iUCRdTGarVfzxY20ICaU4= diff --git a/internal/bot/giteabot.go b/internal/bot/giteabot.go new file mode 100644 index 0000000..ea43e85 --- /dev/null +++ b/internal/bot/giteabot.go @@ -0,0 +1,76 @@ +package bot + +import ( + "errors" + "fmt" + "strings" + + "git.front.kjuulh.io/kjuulh/contractor/internal/models" + "git.front.kjuulh.io/kjuulh/contractor/internal/providers" +) + +type BotHandler struct { + giteaClient *providers.GiteaClient + githubClient *providers.GitHubClient +} + +func NewBotHandler(gitea *providers.GiteaClient, github *providers.GitHubClient) *BotHandler { + return &BotHandler{giteaClient: gitea, githubClient: github} +} + +func (b *BotHandler) Handle(input string) (output string, err error) { + innerHandle := func(input string) (output string, err error) { + if strings.HasPrefix(input, "help") { + return b.Help(), nil + } + + if strings.HasPrefix(input, "refresh") { + return ` +

Contractor triggered renovate refresh on this repository

+This comment will be updated with status + + + +`, nil + } + + return b.Help(), errors.New("could not recognize command") + } + + output, err = innerHandle(input) + output = fmt.Sprintf( + "%s\nThis comment was generated by Contractor", + output, + ) + return output, err +} + +func (b *BotHandler) Help() string { + return `
+

/contractor [command]

+ +Commands: + +* /contractor help + * triggers the help menu +* /contractor refresh + * triggers renovate to refresh the current pull request +
` +} + +func (b *BotHandler) AppendComment( + owner string, + repository string, + pullRequest int, + comment string, + backend models.SupportedBackend, +) (*models.AddCommentResponse, error) { + switch backend { + case models.SupportedBackendGitHub: + return b.githubClient.AddComment(owner, repository, pullRequest, comment) + case models.SupportedBackendGitea: + return b.giteaClient.AddComment(owner, repository, pullRequest, comment) + default: + panic("backend chosen was not a valid option") + } +} diff --git a/internal/features/handle_gitea_events.go b/internal/features/handle_gitea_events.go new file mode 100644 index 0000000..c9b3567 --- /dev/null +++ b/internal/features/handle_gitea_events.go @@ -0,0 +1,84 @@ +package features + +import ( + "context" + "encoding/json" + "log" + "time" + + "git.front.kjuulh.io/kjuulh/contractor/internal/models" + "git.front.kjuulh.io/kjuulh/contractor/internal/providers" + "git.front.kjuulh.io/kjuulh/contractor/internal/queue" + "git.front.kjuulh.io/kjuulh/contractor/internal/renovate" +) + +func RegisterGiteaQueues(goqueue *queue.GoQueue, renovate *renovate.RenovateClient, giteaClient *providers.GiteaClient) { + goqueue.Subscribe( + models.MessageTypeRefreshGiteaRepository, + func(ctx context.Context, item *queue.QueueMessage) error { + log.Printf("handling message: %s, content: %s", item.Type, item.Content) + return nil + }, + ) + goqueue.Subscribe( + models.MessageTypeRefreshGiteaRepositoryDone, + func(ctx context.Context, item *queue.QueueMessage) error { + log.Printf("handling message: %s, content: %s", item.Type, item.Content) + return nil + }, + ) + goqueue.Subscribe( + models.MessageTypeRefreshGiteaRepository, + func(ctx context.Context, item *queue.QueueMessage) error { + var request models.RefreshGiteaRepositoryRequest + if err := json.Unmarshal([]byte(item.Content), &request); err != nil { + log.Printf("failed to unmarshal request body: %s", err.Error()) + return err + } + + cancelCtx, cancel := context.WithTimeout(ctx, time.Minute*5) + defer cancel() + + if err := renovate.RefreshRepository(cancelCtx, request.Owner, request.Repository); err != nil { + goqueue.Insert(models.MessageTypeRefreshGiteaRepositoryDone, models.RefreshGiteaRepositoryDoneRequest{ + Repository: request.Repository, + Owner: request.Owner, + PullRequestID: request.PullRequestID, + CommentID: request.CommentID, + CommentBody: request.CommentBody, + ReportProgress: request.ReportProgress, + Status: "failed", + Error: err.Error(), + }) + + return err + } + + goqueue.Insert(models.MessageTypeRefreshGiteaRepositoryDone, models.RefreshGiteaRepositoryDoneRequest{ + Repository: request.Repository, + Owner: request.Owner, + PullRequestID: request.PullRequestID, + CommentID: request.CommentID, + CommentBody: request.CommentBody, + ReportProgress: request.ReportProgress, + Status: "done", + Error: "", + }) + + return nil + }, + ) + + goqueue.Subscribe( + models.MessageTypeRefreshGiteaRepositoryDone, + func(ctx context.Context, item *queue.QueueMessage) error { + var doneRequest models.RefreshGiteaRepositoryDoneRequest + if err := json.Unmarshal([]byte(item.Content), &doneRequest); err != nil { + log.Printf("failed to unmarshal request body: %s", err.Error()) + return err + } + + return giteaClient.EditComment(ctx, &doneRequest) + }, + ) +} diff --git a/internal/features/handle_gitea_webhook.go b/internal/features/handle_gitea_webhook.go new file mode 100644 index 0000000..48eaf9e --- /dev/null +++ b/internal/features/handle_gitea_webhook.go @@ -0,0 +1,84 @@ +package features + +import ( + "context" + "log" + "strings" + + "git.front.kjuulh.io/kjuulh/contractor/internal/bot" + "git.front.kjuulh.io/kjuulh/contractor/internal/models" + "git.front.kjuulh.io/kjuulh/contractor/internal/queue" +) + +type GiteaWebhook struct { + botHandler *bot.BotHandler + queue *queue.GoQueue +} + +type GiteaWebhookRequest struct { + Action string `json:"action"` + Issue struct { + Id int `json:"id"` + Number int `json:"number"` + } `json:"issue"` + Comment struct { + Body string `json:"body"` + } `json:"comment"` + Repository struct { + FullName string `json:"full_name"` + } +} + +func NewGiteaWebhook(botHandler *bot.BotHandler, queue *queue.GoQueue) *GiteaWebhook { + return &GiteaWebhook{ + botHandler: botHandler, + queue: queue, + } +} + +func (gw *GiteaWebhook) HandleGiteaWebhook(ctx context.Context, request *GiteaWebhookRequest) error { + command, ok := validateBotComment(request.Comment.Body) + if ok { + log.Printf("got webhook request: contractor %s", command) + + bot := gw.botHandler + output, err := bot.Handle(command) + if err != nil { + log.Printf("failed to run bot handler with error: %s", err.Error()) + } + + parts := strings.Split(request.Repository.FullName, "/") + + comment, err := bot.AppendComment( + parts[0], + parts[1], + request.Issue.Number, + output, + models.SupportedBackendGitea, + ) + if err != nil { + return err + } + + if err := gw.queue.Insert(models.MessageTypeRefreshGiteaRepository, models.RefreshGiteaRepositoryRequest{ + Repository: parts[1], + Owner: parts[0], + PullRequestID: request.Issue.Number, + CommentID: comment.ID, + CommentBody: comment.Body, + ReportProgress: true, + }); err != nil { + return err + } + } + + return nil +} + +func validateBotComment(s string) (request string, ok bool) { + if after, ok := strings.CutPrefix(s, "/contractor"); ok { + return strings.TrimSpace(after), true + } + + return "", false +} diff --git a/internal/features/handle_github_events.go b/internal/features/handle_github_events.go new file mode 100644 index 0000000..8c8bea0 --- /dev/null +++ b/internal/features/handle_github_events.go @@ -0,0 +1,84 @@ +package features + +import ( + "context" + "encoding/json" + "log" + "time" + + "git.front.kjuulh.io/kjuulh/contractor/internal/models" + "git.front.kjuulh.io/kjuulh/contractor/internal/providers" + "git.front.kjuulh.io/kjuulh/contractor/internal/queue" + "git.front.kjuulh.io/kjuulh/contractor/internal/renovate" +) + +func RegisterGitHubQueues(goqueue *queue.GoQueue, renovate *renovate.RenovateClient, giteaClient *providers.GitHubClient) { + goqueue.Subscribe( + models.MessageTypeRefreshGitHubRepository, + func(ctx context.Context, item *queue.QueueMessage) error { + log.Printf("handling message: %s, content: %s", item.Type, item.Content) + return nil + }, + ) + goqueue.Subscribe( + models.MessageTypeRefreshGitHubRepositoryDone, + func(ctx context.Context, item *queue.QueueMessage) error { + log.Printf("handling message: %s, content: %s", item.Type, item.Content) + return nil + }, + ) + goqueue.Subscribe( + models.MessageTypeRefreshGitHubRepository, + func(ctx context.Context, item *queue.QueueMessage) error { + var request models.RefreshGitHubRepositoryRequest + if err := json.Unmarshal([]byte(item.Content), &request); err != nil { + log.Printf("failed to unmarshal request body: %s", err.Error()) + return err + } + + cancelCtx, cancel := context.WithTimeout(ctx, time.Minute*5) + defer cancel() + + if err := renovate.RefreshRepository(cancelCtx, request.Owner, request.Repository); err != nil { + goqueue.Insert(models.MessageTypeRefreshGitHubRepositoryDone, models.RefreshGitHubRepositoryDoneRequest{ + Repository: request.Repository, + Owner: request.Owner, + PullRequestID: request.PullRequestID, + CommentID: request.CommentID, + CommentBody: request.CommentBody, + ReportProgress: request.ReportProgress, + Status: "failed", + Error: err.Error(), + }) + + return err + } + + goqueue.Insert(models.MessageTypeRefreshGitHubRepositoryDone, models.RefreshGitHubRepositoryDoneRequest{ + Repository: request.Repository, + Owner: request.Owner, + PullRequestID: request.PullRequestID, + CommentID: request.CommentID, + CommentBody: request.CommentBody, + ReportProgress: request.ReportProgress, + Status: "done", + Error: "", + }) + + return nil + }, + ) + + goqueue.Subscribe( + models.MessageTypeRefreshGitHubRepositoryDone, + func(ctx context.Context, item *queue.QueueMessage) error { + var doneRequest models.RefreshGitHubRepositoryDoneRequest + if err := json.Unmarshal([]byte(item.Content), &doneRequest); err != nil { + log.Printf("failed to unmarshal request body: %s", err.Error()) + return err + } + + return giteaClient.EditComment(ctx, &doneRequest) + }, + ) +} diff --git a/internal/features/handle_github_webhook.go b/internal/features/handle_github_webhook.go new file mode 100644 index 0000000..42fab83 --- /dev/null +++ b/internal/features/handle_github_webhook.go @@ -0,0 +1,76 @@ +package features + +import ( + "context" + "log" + "strings" + + "git.front.kjuulh.io/kjuulh/contractor/internal/bot" + "git.front.kjuulh.io/kjuulh/contractor/internal/models" + "git.front.kjuulh.io/kjuulh/contractor/internal/queue" +) + +type GitHubWebhook struct { + botHandler *bot.BotHandler + queue *queue.GoQueue +} + +type GitHubWebhookRequest struct { + Action string `json:"action"` + Issue struct { + Id int `json:"id"` + Number int `json:"number"` + } `json:"issue"` + Comment struct { + Body string `json:"body"` + } `json:"comment"` + Repository struct { + FullName string `json:"full_name"` + } +} + +func NewGitHubWebhook(botHandler *bot.BotHandler, queue *queue.GoQueue) *GitHubWebhook { + return &GitHubWebhook{ + botHandler: botHandler, + queue: queue, + } +} + +func (gw *GitHubWebhook) HandleGitHubWebhook(ctx context.Context, request *GitHubWebhookRequest) error { + command, ok := validateBotComment(request.Comment.Body) + if ok { + log.Printf("got webhook request: contractor %s", command) + + bot := gw.botHandler + output, err := bot.Handle(command) + if err != nil { + log.Printf("failed to run bot handler with error: %s", err.Error()) + } + + parts := strings.Split(request.Repository.FullName, "/") + + comment, err := bot.AppendComment( + parts[0], + parts[1], + request.Issue.Number, + output, + models.SupportedBackendGitHub, + ) + if err != nil { + return err + } + + if err := gw.queue.Insert(models.MessageTypeRefreshGitHubRepository, models.RefreshGitHubRepositoryRequest{ + Repository: parts[1], + Owner: parts[0], + PullRequestID: request.Issue.Number, + CommentID: comment.ID, + CommentBody: comment.Body, + ReportProgress: true, + }); err != nil { + return err + } + } + + return nil +} diff --git a/internal/models/requests.go b/internal/models/requests.go new file mode 100644 index 0000000..6716c8a --- /dev/null +++ b/internal/models/requests.go @@ -0,0 +1,69 @@ +package models + +const ( + MessageTypeRefreshGiteaRepository = "refresh_gitea_repository" + MessageTypeRefreshGiteaRepositoryDone = "refresh_gitea_repository_done" + MessageTypeRefreshGitHubRepository = "refresh_github_repository" + MessageTypeRefreshGitHubRepositoryDone = "refresh_github_repository_done" +) + +type CreateHook struct { + Active bool `json:"active"` + AuthorizationHeader string `json:"authorization_header"` + BranchFilter string `json:"branch_filter"` + Config map[string]string `json:"config"` + Events []string `json:"events"` + Type string `json:"type"` +} + +type RefreshGiteaRepositoryRequest struct { + Repository string `json:"repository"` + Owner string `json:"owner"` + PullRequestID int `json:"pullRequestId"` + CommentID int `json:"commentId"` + CommentBody string `json:"commentBody"` + ReportProgress bool `json:"reportProgress"` +} + +type RefreshGiteaRepositoryDoneRequest struct { + Repository string `json:"repository"` + Owner string `json:"owner"` + PullRequestID int `json:"pullRequestId"` + CommentID int `json:"commentId"` + CommentBody string `json:"commentBody"` + ReportProgress bool `json:"reportProgress"` + Status string `json:"status"` + Error string `json:"error"` +} + +type RefreshGitHubRepositoryRequest struct { + Repository string `json:"repository"` + Owner string `json:"owner"` + PullRequestID int `json:"pullRequestId"` + CommentID int `json:"commentId"` + CommentBody string `json:"commentBody"` + ReportProgress bool `json:"reportProgress"` +} + +type RefreshGitHubRepositoryDoneRequest struct { + Repository string `json:"repository"` + Owner string `json:"owner"` + PullRequestID int `json:"pullRequestId"` + CommentID int `json:"commentId"` + CommentBody string `json:"commentBody"` + ReportProgress bool `json:"reportProgress"` + Status string `json:"status"` + Error string `json:"error"` +} + +type AddCommentResponse struct { + Body string `json:"body"` + ID int `json:"id"` +} + +type SupportedBackend string + +const ( + SupportedBackendGitHub SupportedBackend = "github" + SupportedBackendGitea SupportedBackend = "gitea" +) diff --git a/internal/providers/gitea.go b/internal/providers/gitea.go new file mode 100644 index 0000000..3463b17 --- /dev/null +++ b/internal/providers/gitea.go @@ -0,0 +1,227 @@ +package providers + +import ( + "bytes" + "context" + "encoding/json" + "fmt" + "html" + "io" + "log" + "net/http" + "strings" + + "git.front.kjuulh.io/kjuulh/contractor/internal/models" +) + +type GiteaClient struct { + url *string + token *string + + client *http.Client +} + +func NewGiteaClient(url, token *string) *GiteaClient { + return &GiteaClient{ + url: url, + token: token, + client: http.DefaultClient, + } +} + +func (gc *GiteaClient) EditComment( + ctx context.Context, + doneRequest *models.RefreshGiteaRepositoryDoneRequest, +) error { + commentBody := html.UnescapeString(doneRequest.CommentBody) + startCmnt := "" + startIdx := strings.Index(commentBody, startCmnt) + endIdx := strings.Index(commentBody, "") + if startIdx >= 0 && endIdx >= 0 { + log.Println("found comment to replace") + + var content string + + if doneRequest.Error != "" { + content = fmt.Sprintf("
ERROR: %s

", doneRequest.Error) + } + if doneRequest.Status != "" { + content = fmt.Sprintf("%s

%s

", content, doneRequest.Status) + } + + doneRequest.CommentBody = fmt.Sprintf( + "%s

%s

%s", + commentBody[:startIdx+len(startCmnt)], + content, + commentBody[endIdx:], + ) + } + + editComment := struct { + Body string `json:"body"` + }{ + Body: doneRequest.CommentBody, + } + + body, err := json.Marshal(editComment) + if err != nil { + log.Println("failed to marshal request body: %w", err) + return err + } + bodyReader := bytes.NewReader(body) + + request, err := http.NewRequest( + http.MethodPatch, + fmt.Sprintf( + "%s/repos/%s/%s/issues/comments/%d", + strings.TrimSuffix(*gc.url, "/"), + doneRequest.Owner, + doneRequest.Repository, + doneRequest.CommentID, + ), + bodyReader, + ) + if err != nil { + log.Printf("failed to form update comment request: %s", err.Error()) + return err + } + request.Header.Add("Authorization", fmt.Sprintf("token %s", *gc.token)) + request.Header.Add("Content-Type", "application/json") + + resp, err := gc.client.Do(request) + if err != nil { + log.Printf("failed to update comment: %s", err.Error()) + return err + } + + if resp.StatusCode > 299 { + log.Printf("failed to update comment with status code: %d", resp.StatusCode) + respBody, err := io.ReadAll(resp.Body) + if err != nil { + log.Printf("failed to read body of error response: %s", err.Error()) + } else { + log.Printf("request body: %s", string(respBody)) + } + } + + return nil +} + +func (gc *GiteaClient) CreateWebhook(owner, repository string) error { + createHookOptions := models.CreateHook{ + Active: true, + AuthorizationHeader: "", + BranchFilter: "*", + Config: map[string]string{ + "url": "http://10.0.9.1:8080/gitea/webhook", + "content_type": "json", + }, + Events: []string{ + "pull_request_comment", + }, + Type: "gitea", + } + + body, err := json.Marshal(createHookOptions) + if err != nil { + log.Println("failed to marshal request body: %w", err) + return err + } + bodyReader := bytes.NewReader(body) + request, err := http.NewRequest( + http.MethodPost, + fmt.Sprintf( + "%s/repos/%s/%s/hooks", + strings.TrimSuffix(*gc.url, "/"), + owner, + repository, + ), + bodyReader, + ) + if err != nil { + log.Printf("failed to form create hook request: %s", err.Error()) + return err + } + request.Header.Add("Authorization", fmt.Sprintf("token %s", *gc.token)) + request.Header.Add("Content-Type", "application/json") + + resp, err := gc.client.Do(request) + if err != nil { + log.Printf("failed to register hook: %s", err.Error()) + return err + } + + if resp.StatusCode > 299 { + log.Printf("failed to register with status code: %d", resp.StatusCode) + respBody, err := io.ReadAll(resp.Body) + if err != nil { + log.Printf("failed to read body of error response: %s", err.Error()) + } else { + log.Printf("request body: %s", string(respBody)) + } + } + + return nil +} + +func (gc *GiteaClient) AddComment( + owner, repository string, + pullRequest int, + comment string, +) (*models.AddCommentResponse, error) { + addComment := struct { + Body string `json:"body"` + }{ + Body: comment, + } + + body, err := json.Marshal(addComment) + if err != nil { + return nil, err + } + bodyReader := bytes.NewReader(body) + + request, err := http.NewRequest( + http.MethodPost, + fmt.Sprintf( + "%s/repos/%s/%s/issues/%d/comments", + strings.TrimSuffix(*gc.url, "/"), + owner, + repository, + pullRequest, + ), + bodyReader, + ) + if err != nil { + return nil, err + } + request.Header.Add("Authorization", fmt.Sprintf("token %s", *gc.token)) + request.Header.Add("Content-Type", "application/json") + + resp, err := gc.client.Do(request) + if err != nil { + return nil, err + } + + if resp.StatusCode > 299 { + log.Printf("failed to register with status code: %d", resp.StatusCode) + respBody, err := io.ReadAll(resp.Body) + if err != nil { + return nil, err + } else { + log.Printf("request body: %s", string(respBody)) + } + } + + respBody, err := io.ReadAll(resp.Body) + if err != nil { + return nil, err + } + + var response models.AddCommentResponse + if err := json.Unmarshal(respBody, &response); err != nil { + return nil, err + } + + return &response, nil +} diff --git a/internal/providers/github.go b/internal/providers/github.go new file mode 100644 index 0000000..217846d --- /dev/null +++ b/internal/providers/github.go @@ -0,0 +1,117 @@ +package providers + +import ( + "context" + "fmt" + "html" + "log" + "net/http" + "strings" + + "git.front.kjuulh.io/kjuulh/contractor/internal/models" + + "github.com/bradleyfalzon/ghinstallation/v2" + "github.com/google/go-github/v53/github" +) + +type GitHubClient struct { + appID *int64 + installationID *int64 + privateKeyPath *string + + client *github.Client +} + +func NewGitHubClient(appID, installationID *int64, privateKeyPath *string) *GitHubClient { + return &GitHubClient{ + appID: appID, + installationID: installationID, + privateKeyPath: privateKeyPath, + } +} + +func (gc *GitHubClient) makeSureClientExist() { + if gc.client != nil { + return + } + + tr := http.DefaultTransport + itr, err := ghinstallation.NewKeyFromFile(tr, *gc.appID, *gc.installationID, *gc.privateKeyPath) + if err != nil { + log.Fatal(err) + } + + client := github.NewClient(&http.Client{Transport: itr}) + + gc.client = client +} + +func (gc *GitHubClient) EditComment( + ctx context.Context, + doneRequest *models.RefreshGitHubRepositoryDoneRequest, +) error { + gc.makeSureClientExist() + + commentBody := html.UnescapeString(doneRequest.CommentBody) + startCmnt := "" + startIdx := strings.Index(commentBody, startCmnt) + endIdx := strings.Index(commentBody, "") + if startIdx >= 0 && endIdx >= 0 { + log.Println("found comment to replace") + + var content string + + if doneRequest.Error != "" { + content = fmt.Sprintf("
ERROR: %s

", doneRequest.Error) + } + if doneRequest.Status != "" { + content = fmt.Sprintf("%s

%s

", content, doneRequest.Status) + } + + doneRequest.CommentBody = fmt.Sprintf( + "%s

%s

%s", + commentBody[:startIdx+len(startCmnt)], + content, + commentBody[endIdx:], + ) + } + + _, _, err := gc.client.Issues.EditComment(ctx, doneRequest.Owner, doneRequest.Repository, int64(doneRequest.CommentID), &github.IssueComment{ + Body: &doneRequest.CommentBody, + }) + if err != nil { + log.Printf("failed to update comment: %s", err.Error()) + return err + } + + return nil +} + +func (gc *GitHubClient) CreateWebhook(owner, repository string) error { + gc.makeSureClientExist() + + // TODO: support for personal access tokens + // We implicitly get support via. github apps + + return nil +} + +func (gc *GitHubClient) AddComment( + owner, repository string, + pullRequest int, + comment string, +) (*models.AddCommentResponse, error) { + gc.makeSureClientExist() + + resp, _, err := gc.client.Issues.CreateComment(context.Background(), owner, repository, pullRequest, &github.IssueComment{ + Body: &comment, + }) + if err != nil { + return nil, err + } + + return &models.AddCommentResponse{ + Body: *resp.Body, + ID: int(*resp.ID), + }, nil +} diff --git a/internal/queue/goqueue.go b/internal/queue/goqueue.go new file mode 100644 index 0000000..13b863c --- /dev/null +++ b/internal/queue/goqueue.go @@ -0,0 +1,113 @@ +package queue + +import ( + "context" + "encoding/json" + "log" + "sync" + + "github.com/google/uuid" +) + +type QueueMessage struct { + Type string `json:"type"` + Content string `json:"content"` +} + +type GoQueue struct { + queue []*QueueMessage + queueLock sync.Mutex + subscribers map[string]map[string]func(ctx context.Context, item *QueueMessage) error + subscribersLock sync.RWMutex +} + +func NewGoQueue() *GoQueue { + return &GoQueue{ + queue: make([]*QueueMessage, 0), + subscribers: make( + map[string]map[string]func(ctx context.Context, item *QueueMessage) error, + ), + } +} + +func (gq *GoQueue) Subscribe( + messageType string, + callback func(ctx context.Context, item *QueueMessage) error, +) string { + gq.subscribersLock.Lock() + defer gq.subscribersLock.Unlock() + + uid, err := uuid.NewUUID() + if err != nil { + panic(err) + } + id := uid.String() + + _, ok := gq.subscribers[messageType] + if !ok { + messageTypeSubscribers := make( + map[string]func(ctx context.Context, item *QueueMessage) error, + ) + messageTypeSubscribers[id] = callback + gq.subscribers[messageType] = messageTypeSubscribers + } else { + gq.subscribers[messageType][id] = callback + } + + return id +} + +func (gq *GoQueue) Unsubscribe(messageType string, id string) { + gq.subscribersLock.Lock() + defer gq.subscribersLock.Unlock() + _, ok := gq.subscribers[messageType] + if !ok { + // No work to be done + return + } else { + delete(gq.subscribers[messageType], id) + } +} + +func (gq *GoQueue) Insert(messageType string, content any) error { + gq.queueLock.Lock() + defer gq.queueLock.Unlock() + + contents, err := json.Marshal(content) + if err != nil { + return err + } + + gq.queue = append(gq.queue, &QueueMessage{ + Type: messageType, + Content: string(contents), + }) + + go func() { + gq.handle(context.Background()) + }() + + return nil +} + +func (gq *GoQueue) handle(ctx context.Context) { + gq.queueLock.Lock() + defer gq.queueLock.Unlock() + + for { + if len(gq.queue) == 0 { + return + } + + item := gq.queue[0] + gq.queue = gq.queue[1:] + + gq.subscribersLock.RLock() + defer gq.subscribersLock.RUnlock() + + for id, callback := range gq.subscribers[item.Type] { + log.Printf("sending message to %s", id) + go callback(ctx, item) + } + } +} diff --git a/internal/renovate/client.go b/internal/renovate/client.go new file mode 100644 index 0000000..f0db6bd --- /dev/null +++ b/internal/renovate/client.go @@ -0,0 +1,103 @@ +package renovate + +import ( + "context" + "fmt" + "log" + "os" + + "dagger.io/dagger" +) + +type RenovateClient struct { + config string +} + +func NewRenovateClient(config string) *RenovateClient { + return &RenovateClient{config: config} +} + +func (rc *RenovateClient) RefreshRepository(ctx context.Context, owner, repository string) error { + client, err := dagger.Connect(ctx, dagger.WithLogOutput(os.Stdout)) + if err != nil { + return err + } + + envRenovateToken := os.Getenv("GITEA_RENOVATE_TOKEN") + log.Println(envRenovateToken) + + renovateToken := client.SetSecret("RENOVATE_TOKEN", envRenovateToken) + githubComToken := client.SetSecret("GITHUB_COM_TOKEN", os.Getenv("GITHUB_COM_TOKEN")) + renovateSecret := client.SetSecret("RENOVATE_SECRETS", os.Getenv("RENOVATE_SECRETS")) + + output, err := client.Container(). + From("renovate/renovate:latest"). + WithNewFile("/opts/renovate/config.json", dagger.ContainerWithNewFileOpts{ + Contents: `{ + "$schema": "https://docs.renovatebot.com/renovate-schema.json", + "platform": "gitea", + "endpoint": "https://git.front.kjuulh.io/api/v1/", + "automerge": true, + "automergeType": "pr", + "extends": [ + "config:base" + ], + "hostRules": [ + { + "hostType": "docker", + "matchHost": "harbor.front.kjuulh.io", + "username": "service", + "password": "{{ secrets.HARBOR_SERVER_PASSWORD }}" + } + ], + "packageRules": [ + { + "matchDatasources": ["docker"], + "registryUrls": ["https://harbor.front.kjuulh.io/docker-proxy/library/"] + }, + { + "groupName": "all dependencies", + "separateMajorMinor": false, + "groupSlug": "all", + "packageRules": [ + { + "matchPackagePatterns": [ + "*" + ], + "groupName": "all dependencies", + "groupSlug": "all" + } + ], + "lockFileMaintenance": { + "enabled": false + } + } + ] +}`, + Permissions: 755, + Owner: "root", + }). + WithSecretVariable("RENOVATE_TOKEN", renovateToken). + WithSecretVariable("GITHUB_COM_TOKEN", githubComToken). + WithSecretVariable("RENOVATE_SECRETS", renovateSecret). + WithEnvVariable("LOG_LEVEL", "warn"). + WithEnvVariable("RENOVATE_CONFIG_FILE", "/opts/renovate/config.json"). + WithExec([]string{ + fmt.Sprintf("%s/%s", owner, repository), + }). + Sync(ctx) + + stdout, outerr := output.Stdout(ctx) + if outerr == nil { + log.Printf("stdout: %s", stdout) + } + stderr, outerr := output.Stderr(ctx) + if outerr == nil { + log.Printf("stderr: %s", stderr) + } + if err != nil { + return fmt.Errorf("error: %w, \nstderr: %s\nstdout: %s", err, stderr, stdout) + } + + return nil +} diff --git a/main.go b/main.go new file mode 100644 index 0000000..56dcde2 --- /dev/null +++ b/main.go @@ -0,0 +1,19 @@ +package main + +import ( + "log" + + "git.front.kjuulh.io/kjuulh/contractor/cmd/contractor" + "github.com/joho/godotenv" +) + +func main() { + err := godotenv.Load() + if err != nil { + log.Println("DEBUG: no .env file found") + } + + if err := contractor.RootCmd().Execute(); err != nil { + log.Fatal(err) + } +} diff --git a/scripts/ci:main.sh b/scripts/ci:main.sh new file mode 100755 index 0000000..5cd0d69 --- /dev/null +++ b/scripts/ci:main.sh @@ -0,0 +1,23 @@ +#!/usr/bin/env bash + +set -e + +CMD_PREFIX="" + +if [[ -n "$CI_PREFIX" ]]; then + CMD_PREFIX="$CI_PREFIX" +else + cd ci || return 1 + cargo build + cd - || return 1 + CMD_PREFIX="ci/target/debug/ci" +fi + + +$CMD_PREFIX main \ + --docker-image "$DOCKER_IMAGE" \ + --golang-builder-image "$GOLANG_BUILDER_IMAGE" \ + --production-image "$PRODUCTION_IMAGE" \ + --image "$REGISTRY/$SERVICE" \ + --tag "main-$(date +%s)" \ + --bin-name "$SERVICE" \ No newline at end of file diff --git a/scripts/ci:pr.sh b/scripts/ci:pr.sh new file mode 100755 index 0000000..adb7ff8 --- /dev/null +++ b/scripts/ci:pr.sh @@ -0,0 +1,25 @@ +#!/usr/bin/env bash + +set -e + +CMD_PREFIX="cargo run -p ci --" + +CMD_PREFIX="" + +if [[ -n "$CI_PREFIX" ]]; then + CMD_PREFIX="$CI_PREFIX" +else + cd ci || return 1 + cargo build + cd - || return 1 + CMD_PREFIX="ci/target/debug/ci" +fi + + +$CMD_PREFIX pull-request \ + --docker-image "$DOCKER_IMAGE" \ + --golang-builder-image "$GOLANG_BUILDER_IMAGE" \ + --production-image "$PRODUCTION_IMAGE" \ + --image "$REGISTRY/$SERVICE" \ + --tag "main-$(date +%s)" \ + --bin-name "$SERVICE" \ No newline at end of file diff --git a/scripts/local:docker.sh b/scripts/local:docker.sh new file mode 100755 index 0000000..92693dc --- /dev/null +++ b/scripts/local:docker.sh @@ -0,0 +1,5 @@ +#!/usr/bin/env bash + +set -e + +cargo run -p ci -- local docker-image --image kasperhermansen/cuddle-please --tag dev --bin-name cuddle-please diff --git a/scripts/local:docker:docs.sh b/scripts/local:docker:docs.sh new file mode 100755 index 0000000..4002ca9 --- /dev/null +++ b/scripts/local:docker:docs.sh @@ -0,0 +1,5 @@ +#!/usr/bin/env bash + +set -e + +cargo run -p ci -- local build-docs --mkdocs-image $MKDOCS_IMAGE --caddy-image $CADDY_IMAGE diff --git a/scripts/mkdocs:build.sh b/scripts/mkdocs:build.sh new file mode 100755 index 0000000..af5a5e4 --- /dev/null +++ b/scripts/mkdocs:build.sh @@ -0,0 +1,5 @@ +#!/usr/bin/env bash + +set -e + +docker run --rm -it -p 8000:8000 -v ${PWD}:/docs ${MKDOCS_IMAGE} diff --git a/scripts/mkdocs:dev.sh b/scripts/mkdocs:dev.sh new file mode 100755 index 0000000..af5a5e4 --- /dev/null +++ b/scripts/mkdocs:dev.sh @@ -0,0 +1,5 @@ +#!/usr/bin/env bash + +set -e + +docker run --rm -it -p 8000:8000 -v ${PWD}:/docs ${MKDOCS_IMAGE} diff --git a/scripts/mkdocs:new.sh b/scripts/mkdocs:new.sh new file mode 100755 index 0000000..8410ed1 --- /dev/null +++ b/scripts/mkdocs:new.sh @@ -0,0 +1,5 @@ +#!/usr/bin/env bash + +set -e + +docker run --rm -it -v ${PWD}:/docs ${MKDOCS_IMAGE} new . diff --git a/scripts/publish:docker:docs.sh b/scripts/publish:docker:docs.sh new file mode 100644 index 0000000..8b13789 --- /dev/null +++ b/scripts/publish:docker:docs.sh @@ -0,0 +1 @@ + diff --git a/templates/docker-compose.yaml b/templates/docker-compose.yaml deleted file mode 100644 index 8fae72a..0000000 --- a/templates/docker-compose.yaml +++ /dev/null @@ -1,15 +0,0 @@ -version: "3" -services: - crdb: - restart: 'always' - image: 'cockroachdb/cockroach:v23.1.14' - command: 'start-single-node --advertise-addr 0.0.0.0 --insecure' - healthcheck: - test: ["CMD", "curl", "-f", "http://localhost:8080/health?ready=1"] - interval: '10s' - timeout: '30s' - retries: 5 - start_period: '20s' - ports: - - 8080:8080 - - '26257:26257'