diff --git a/.github/workflows/lints.yaml b/.github/workflows/lints.yaml index 8ac5229b..3187612d 100644 --- a/.github/workflows/lints.yaml +++ b/.github/workflows/lints.yaml @@ -46,6 +46,7 @@ jobs: env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} with: + sh_checker_shfmt_disable: true sh_checker_comment: true sh_checker_checkbashisms_enable: true diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index f64959f3..dfe96389 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -2,6 +2,8 @@ name: Release on: push: + branches: + - release/* tags: - "v*" @@ -9,6 +11,11 @@ defaults: run: shell: bash +env: + MAINTAINER: "xrelkd <46590321+xrelkd@users.noreply.github.com>" + PACKAGE_NAME: "clipcat" + PACKAGE_DESCRIPTION: "Clipboard manager written in Rust Programming Language" + jobs: all: name: Release @@ -16,30 +23,15 @@ jobs: strategy: matrix: target: - - aarch64-unknown-linux-musl - - armv7-unknown-linux-musleabihf - x86_64-unknown-linux-musl - # TODO: support macOS in the future? - # - x86_64-apple-darwin include: - - target: aarch64-unknown-linux-musl - os: ubuntu-latest - target_rustflags: "--codegen linker=aarch64-linux-gnu-gcc" - - - target: armv7-unknown-linux-musleabihf - os: ubuntu-latest - target_rustflags: "--codegen linker=arm-linux-gnueabihf-gcc" - - target: x86_64-unknown-linux-musl + arch_deb: amd64 + arch_rpm: x86_64 os: ubuntu-latest target_rustflags: "" - # TODO: support macOS in the future? - # - target: x86_64-apple-darwin - # os: macos-latest - # target_rustflags: "" - runs-on: ${{matrix.os}} steps: @@ -48,7 +40,7 @@ jobs: - name: Install Dependencies if: ${{ matrix.os == 'ubuntu-latest' }} run: | - sudo apt install -y protobuf-compiler + sudo apt install -y --no-install-recommends musl-tools protobuf-compiler libprotobuf-dev - name: Install Rust Toolchain Components uses: actions-rs/toolchain@v1 @@ -57,18 +49,6 @@ jobs: target: ${{ matrix.target }} toolchain: stable - - name: Install AArch64 Toolchain - if: ${{ matrix.target == 'aarch64-unknown-linux-musl' }} - run: | - sudo apt update - sudo apt install -y gcc-aarch64-linux-gnu - - - name: Install ARM7 Toolchain - if: ${{ matrix.target == 'armv7-unknown-linux-musleabihf' }} - run: | - sudo apt update - sudo apt install -y gcc-arm-linux-gnueabihf - - name: Create Package id: package env: @@ -79,7 +59,54 @@ jobs: run: ./dev-support/bin/create-package shell: bash - - name: Publish Archive + - name: Prepare DEB Package + env: + TARGET: ${{ matrix.target }} + REF: ${{ github.ref }} + OS: ${{ matrix.os }} + ARCH: ${{ matrix.arch_deb }} + TARGET_RUSTFLAGS: ${{ matrix.target_rustflags }} + run: ./dev-support/bin/prepare-deb-package + if: ${{ matrix.arch_deb == 'amd64' }} + shell: bash + + - name: Create DEB Package + id: deb-package + uses: jiro4989/build-deb-action@v3 + if: ${{ startsWith(github.ref, 'refs/tags/') && matrix.arch_deb == 'amd64' }} + with: + package: ${{ env.PACKAGE_NAME }} + package_root: .debpkg + maintainer: ${{ env.MAINTAINER }} + version: ${{ github.ref }} + arch: ${{ matrix.arch_deb }} + desc: ${{ env.PACKAGE_DESCRIPTION }} + + - name: Prepare RPM Package + env: + TARGET: ${{ matrix.target }} + REF: ${{ github.ref }} + OS: ${{ matrix.os }} + ARCH: ${{ matrix.arch_rpm }} + TARGET_RUSTFLAGS: ${{ matrix.target_rustflags }} + run: ./dev-support/bin/prepare-rpm-package + if: ${{ matrix.arch_rpm == 'x86_64' }} + shell: bash + + - name: Create RPM Package + id: rpm-package + uses: jiro4989/build-rpm-action@v2 + if: ${{ startsWith(github.ref, 'refs/tags/') && matrix.arch_rpm == 'x86_64' }} + with: + summary: ${{ env.PACKAGE_DESCRIPTION }} + package: ${{ env.PACKAGE_NAME }} + package_root: .rpmpkg + maintainer: ${{ env.MAINTAINER }} + version: ${{ github.ref }} + arch: ${{ matrix.arch_rpm }} + desc: ${{ env.PACKAGE_DESCRIPTION }} + + - name: Publish Package Archive uses: softprops/action-gh-release@v1 if: ${{ startsWith(github.ref, 'refs/tags/') }} with: @@ -88,3 +115,23 @@ jobs: prerelease: false env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + + - name: Publish DEB Package + uses: softprops/action-gh-release@v1 + if: ${{ startsWith(github.ref, 'refs/tags/') && matrix.arch_deb == 'amd64' }} + with: + draft: false + files: ${{ steps.deb-package.outputs.file_name }} + prerelease: false + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + + - name: Publish RPM Package + uses: softprops/action-gh-release@v1 + if: ${{ startsWith(github.ref, 'refs/tags/') && matrix.arch_rpm == 'x86_64' }} + with: + draft: false + files: ${{ steps.rpm-package.outputs.file_name }} + prerelease: false + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/Cargo.lock b/Cargo.lock index 85b37161..84fe857a 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -311,9 +311,9 @@ checksum = "b4eb2cdb97421e01129ccb49169d8279ed21e829929144f4a22a6e54ac549ca1" [[package]] name = "async-trait" -version = "0.1.74" +version = "0.1.76" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a66537f1bb974b254c98ed142ff995236e81b9d0fe4db0575f46612cb15eb0f9" +checksum = "531b97fb4cd3dfdce92c35dedbfdc1f0b9d8091c8ca943d6dae340ef5012d514" dependencies = [ "proc-macro2", "quote", @@ -354,8 +354,9 @@ dependencies = [ "bitflags 1.3.2", "bytes", "futures-util", + "headers", "http 0.2.11", - "http-body", + "http-body 0.4.6", "hyper", "itoa", "matchit", @@ -365,7 +366,11 @@ dependencies = [ "pin-project-lite", "rustversion", "serde", + "serde_json", + "serde_path_to_error", + "serde_urlencoded", "sync_wrapper", + "tokio", "tower", "tower-layer", "tower-service", @@ -381,7 +386,7 @@ dependencies = [ "bytes", "futures-util", "http 0.2.11", - "http-body", + "http-body 0.4.6", "mime", "rustversion", "tower-layer", @@ -509,6 +514,7 @@ version = "1.0.83" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f1174fb0b6ec23863f8b971027804a42614e347eafb0a95bf0b12cdae21fc4d0" dependencies = [ + "jobserver", "libc", ] @@ -551,9 +557,9 @@ dependencies = [ [[package]] name = "clap" -version = "4.4.11" +version = "4.4.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bfaff671f6b22ca62406885ece523383b9b64022e341e53e009a62ebc47a45f2" +checksum = "dcfab8ba68f3668e89f6ff60f5b205cea56aa7b769451a59f34b8682f51c056d" dependencies = [ "clap_builder", "clap_derive", @@ -561,9 +567,9 @@ dependencies = [ [[package]] name = "clap_builder" -version = "4.4.11" +version = "4.4.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a216b506622bb1d316cd51328dce24e07bdff4a6128a47c7e7fad11878d5adbb" +checksum = "fb7fb5e4e979aec3be7791562fcba452f94ad85e954da024396433e0e25a79e9" dependencies = [ "anstream", "anstyle", @@ -573,11 +579,11 @@ dependencies = [ [[package]] name = "clap_complete" -version = "4.4.4" +version = "4.4.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bffe91f06a11b4b9420f62103854e90867812cd5d01557f853c5ee8e791b12ae" +checksum = "a51919c5608a32e34ea1d6be321ad070065e17613e168c5b6977024290f2630b" dependencies = [ - "clap 4.4.11", + "clap 4.4.12", ] [[package]] @@ -620,7 +626,7 @@ dependencies = [ [[package]] name = "clipcat-base" -version = "0.15.0" +version = "0.16.0" dependencies = [ "bytes", "directories", @@ -633,13 +639,14 @@ dependencies = [ "semver", "serde", "sha2", - "snafu", + "snafu 0.8.0", "time", + "tokio", ] [[package]] name = "clipcat-cli" -version = "0.15.0" +version = "0.16.0" dependencies = [ "serde", "serde_with", @@ -650,7 +657,7 @@ dependencies = [ [[package]] name = "clipcat-client" -version = "0.15.0" +version = "0.16.0" dependencies = [ "async-trait", "clipcat-base", @@ -659,7 +666,7 @@ dependencies = [ "mime", "prost-types", "semver", - "snafu", + "snafu 0.8.0", "tokio", "tonic", "tower", @@ -668,7 +675,7 @@ dependencies = [ [[package]] name = "clipcat-clipboard" -version = "0.15.0" +version = "0.16.0" dependencies = [ "arboard", "bytes", @@ -677,7 +684,7 @@ dependencies = [ "mio", "parking_lot", "sigfinn", - "snafu", + "snafu 0.8.0", "tokio", "tracing", "tracing-subscriber", @@ -685,20 +692,31 @@ dependencies = [ "x11rb 0.13.0", ] +[[package]] +name = "clipcat-dbus-variant" +version = "0.16.0" +dependencies = [ + "clipcat-base", + "mime", + "serde", + "time", + "zvariant", +] + [[package]] name = "clipcat-external-editor" -version = "0.15.0" +version = "0.16.0" dependencies = [ "clipcat-base", - "snafu", + "snafu 0.8.0", "tokio", ] [[package]] name = "clipcat-menu" -version = "0.15.0" +version = "0.16.0" dependencies = [ - "clap 4.4.11", + "clap 4.4.12", "clap_complete", "clipcat-base", "clipcat-cli", @@ -707,8 +725,9 @@ dependencies = [ "http 1.0.0", "http-serde", "serde", + "shadow-rs", "skim", - "snafu", + "snafu 0.8.0", "tokio", "toml", "tracing", @@ -716,25 +735,41 @@ dependencies = [ "tracing-subscriber", ] +[[package]] +name = "clipcat-metrics" +version = "0.16.0" +dependencies = [ + "async-trait", + "axum", + "bytes", + "lazy_static", + "mime", + "prometheus", + "snafu 0.8.0", + "tower", + "tower-http", +] + [[package]] name = "clipcat-notify" -version = "0.15.0" +version = "0.16.0" dependencies = [ - "clap 4.4.11", + "clap 4.4.12", "clap_complete", "clipcat-base", "clipcat-server", "mime", "serde", "serde_json", - "snafu", + "shadow-rs", + "snafu 0.8.0", "time", "tokio", ] [[package]] name = "clipcat-proto" -version = "0.15.0" +version = "0.16.0" dependencies = [ "clipcat-base", "mime", @@ -748,39 +783,46 @@ dependencies = [ [[package]] name = "clipcat-server" -version = "0.15.0" +version = "0.16.0" dependencies = [ "async-trait", "bincode", "clipcat-base", "clipcat-clipboard", + "clipcat-dbus-variant", + "clipcat-metrics", "clipcat-proto", "futures", "hex", "humansize", "lazy_static", "mime", + "notify", "notify-rust", "parking_lot", + "prometheus", "regex", "semver", "serde", "serde_json", "sigfinn", - "snafu", + "simdutf8", + "snafu 0.8.0", "time", "tokio", "tokio-stream", "tonic", "tracing", + "zbus", + "zvariant", ] [[package]] name = "clipcatctl" -version = "0.15.0" +version = "0.16.0" dependencies = [ "bytes", - "clap 4.4.11", + "clap 4.4.12", "clap_complete", "clipcat-base", "clipcat-cli", @@ -791,8 +833,9 @@ dependencies = [ "http-serde", "mime", "serde", + "shadow-rs", "simdutf8", - "snafu", + "snafu 0.8.0", "tokio", "toml", "tracing", @@ -802,9 +845,9 @@ dependencies = [ [[package]] name = "clipcatd" -version = "0.15.0" +version = "0.16.0" dependencies = [ - "clap 4.4.11", + "clap 4.4.12", "clap_complete", "clipcat-base", "clipcat-cli", @@ -816,8 +859,9 @@ dependencies = [ "linicon", "mime", "serde", + "shadow-rs", "simdutf8", - "snafu", + "snafu 0.8.0", "time", "tokio", "toml", @@ -847,6 +891,32 @@ dependencies = [ "crossbeam-utils", ] +[[package]] +name = "const_fn" +version = "0.4.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fbdcdcb6d86f71c5e97409ad45898af11cbc995b4ee8112d59095a28d376c935" + +[[package]] +name = "const_format" +version = "0.2.32" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e3a214c7af3d04997541b18d432afaff4c455e79e2029079647e72fc2bd27673" +dependencies = [ + "const_format_proc_macros", +] + +[[package]] +name = "const_format_proc_macros" +version = "0.2.32" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c7f6ff08fd20f4f299298a28e2dfa8a8ba1036e6cd2460ac1de7b425d76f2500" +dependencies = [ + "proc-macro2", + "quote", + "unicode-xid", +] + [[package]] name = "core-foundation" version = "0.9.4" @@ -1380,6 +1450,18 @@ dependencies = [ "nix 0.25.1", ] +[[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 = "fixedbitset" version = "0.4.2" @@ -1426,6 +1508,15 @@ version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "00b0228411908ca8685dba7fc2cdd70ec9990a6e753e89b6ac91a84c40fbaf4b" +[[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 = "freedesktop_entry_parser" version = "1.3.0" @@ -1436,11 +1527,20 @@ dependencies = [ "thiserror", ] +[[package]] +name = "fsevent-sys" +version = "4.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "76ee7a02da4d231650c7cea31349b889be2f45ddb3ef3032d2ec8185f6313fd2" +dependencies = [ + "libc", +] + [[package]] name = "futures" -version = "0.3.29" +version = "0.3.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "da0290714b38af9b4a7b094b8a37086d1b4e61f2df9122c3cad2577669145335" +checksum = "645c6916888f6cb6350d2550b80fb63e734897a8498abe35cfb732b6487804b0" dependencies = [ "futures-channel", "futures-core", @@ -1453,9 +1553,9 @@ dependencies = [ [[package]] name = "futures-channel" -version = "0.3.29" +version = "0.3.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ff4dd66668b557604244583e3e1e1eada8c5c2e96a6d0d6653ede395b78bbacb" +checksum = "eac8f7d7865dcb88bd4373ab671c8cf4508703796caa2b1985a9ca867b3fcb78" dependencies = [ "futures-core", "futures-sink", @@ -1463,15 +1563,15 @@ dependencies = [ [[package]] name = "futures-core" -version = "0.3.29" +version = "0.3.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eb1d22c66e66d9d72e1758f0bd7d4fd0bee04cad842ee34587d68c07e45d088c" +checksum = "dfc6580bb841c5a68e9ef15c77ccc837b40a7504914d52e47b8b0e9bbda25a1d" [[package]] name = "futures-executor" -version = "0.3.29" +version = "0.3.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0f4fb8693db0cf099eadcca0efe2a5a22e4550f98ed16aba6c48700da29597bc" +checksum = "a576fc72ae164fca6b9db127eaa9a9dda0d61316034f33a0a0d4eda41f02b01d" dependencies = [ "futures-core", "futures-task", @@ -1480,9 +1580,9 @@ dependencies = [ [[package]] name = "futures-io" -version = "0.3.29" +version = "0.3.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8bf34a163b5c4c52d0478a4d757da8fb65cabef42ba90515efee0f6f9fa45aaa" +checksum = "a44623e20b9681a318efdd71c299b6b222ed6f231972bfe2f224ebad6311f0c1" [[package]] name = "futures-lite" @@ -1514,9 +1614,9 @@ dependencies = [ [[package]] name = "futures-macro" -version = "0.3.29" +version = "0.3.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "53b153fd91e4b0147f4aced87be237c98248656bb01050b96bf3ee89220a8ddb" +checksum = "87750cf4b7a4c0625b1529e4c543c2182106e4dedc60a2a6455e00d212c489ac" dependencies = [ "proc-macro2", "quote", @@ -1525,21 +1625,21 @@ dependencies = [ [[package]] name = "futures-sink" -version = "0.3.29" +version = "0.3.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e36d3378ee38c2a36ad710c5d30c2911d752cb941c00c72dbabfb786a7970817" +checksum = "9fb8e00e87438d937621c1c6269e53f536c14d3fbd6a042bb24879e57d474fb5" [[package]] name = "futures-task" -version = "0.3.29" +version = "0.3.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "efd193069b0ddadc69c46389b740bbccdd97203899b48d09c5f7969591d6bae2" +checksum = "38d84fa142264698cdce1a9f9172cf383a0c82de1bddcf3092901442c4097004" [[package]] name = "futures-util" -version = "0.3.29" +version = "0.3.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a19526d624e703a3179b3d322efec918b6246ea0fa51d41124525f00f1cc8104" +checksum = "3d6401deb83407ab3da39eba7e33987a73c3df0c82b4bb5813ee871c19c41d48" dependencies = [ "futures-channel", "futures-core", @@ -1619,6 +1719,19 @@ version = "0.28.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4271d37baee1b8c7e4b708028c57d816cf9d2434acb33a549475f78c181f6253" +[[package]] +name = "git2" +version = "0.18.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fbf97ba92db08df386e10c8ede66a2a0369bd277090afd8710e19e38de9ec0cd" +dependencies = [ + "bitflags 2.4.1", + "libc", + "libgit2-sys", + "log", + "url", +] + [[package]] name = "h2" version = "0.3.22" @@ -1668,6 +1781,30 @@ version = "0.14.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "290f1a1d9242c78d09ce40a5e87e7554ee637af1351968159f4952f028f75604" +[[package]] +name = "headers" +version = "0.3.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "06683b93020a07e3dbcf5f8c0f6d40080d725bea7936fc01ad345c01b97dc270" +dependencies = [ + "base64", + "bytes", + "headers-core", + "http 0.2.11", + "httpdate", + "mime", + "sha1", +] + +[[package]] +name = "headers-core" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e7f66481bfee273957b1f20485a4ff3362987f85b2c236580d81b4eb7a326429" +dependencies = [ + "http 0.2.11", +] + [[package]] name = "heck" version = "0.4.1" @@ -1737,6 +1874,29 @@ dependencies = [ "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.0.0", +] + +[[package]] +name = "http-body-util" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "41cb79eb393015dadd30fc252023adb0b2400a0caee0fa2a077e6e21a551e840" +dependencies = [ + "bytes", + "futures-util", + "http 1.0.0", + "http-body 1.0.0", + "pin-project-lite", +] + [[package]] name = "http-serde" version = "2.0.0" @@ -1786,7 +1946,7 @@ dependencies = [ "futures-util", "h2", "http 0.2.11", - "http-body", + "http-body 0.4.6", "httparse", "httpdate", "itoa", @@ -1839,6 +1999,16 @@ 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 = "image" version = "0.24.7" @@ -1880,6 +2050,26 @@ dependencies = [ "serde", ] +[[package]] +name = "inotify" +version = "0.9.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f8069d3ec154eb856955c1c0fbffefbf5f3c40a104ec912d4797314c1801abff" +dependencies = [ + "bitflags 1.3.2", + "inotify-sys", + "libc", +] + +[[package]] +name = "inotify-sys" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e05c02b5e89bff3b946cedeca278abc628fe811e604f027c45a8aa3cf793d0eb" +dependencies = [ + "libc", +] + [[package]] name = "instant" version = "0.1.12" @@ -1900,6 +2090,12 @@ dependencies = [ "windows-sys 0.48.0", ] +[[package]] +name = "is_debug" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "06d198e9919d9822d5f7083ba8530e04de87841eaf21ead9af8f2304efd57c89" + [[package]] name = "itertools" version = "0.11.0" @@ -1915,6 +2111,15 @@ version = "1.0.10" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b1a46d1a171d865aa5f83f92695765caa047a9b4cbae2cbf37dbd613a793fd4c" +[[package]] +name = "jobserver" +version = "0.1.27" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8c37f63953c4c63420ed5fd3d6d398c719489b9f872b9fa683262f8edd363c7d" +dependencies = [ + "libc", +] + [[package]] name = "jpeg-decoder" version = "0.3.0" @@ -1933,6 +2138,26 @@ dependencies = [ "wasm-bindgen", ] +[[package]] +name = "kqueue" +version = "1.0.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7447f1ca1b7b563588a205fe93dea8df60fd981423a768bc1c0ded35ed147d0c" +dependencies = [ + "kqueue-sys", + "libc", +] + +[[package]] +name = "kqueue-sys" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ed9625ffda8729b85e45cf04090035ac368927b8cebc34898e7c120f52e4838b" +dependencies = [ + "bitflags 1.3.2", + "libc", +] + [[package]] name = "lazy_static" version = "1.4.0" @@ -1951,6 +2176,18 @@ version = "0.2.151" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "302d7ab3130588088d277783b1e2d2e10c9e9e4a16dd9050e6ec93fb3e7048f4" +[[package]] +name = "libgit2-sys" +version = "0.16.1+1.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f2a2bb3680b094add03bb3732ec520ece34da31a8cd2d633d1389d0f0fb60d0c" +dependencies = [ + "cc", + "libc", + "libz-sys", + "pkg-config", +] + [[package]] name = "libloading" version = "0.8.1" @@ -1978,6 +2215,18 @@ dependencies = [ "redox_syscall", ] +[[package]] +name = "libz-sys" +version = "1.1.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d97137b25e321a73eef1418d1d5d2eda4d77e12813f8e6dead84bc52c5870a7b" +dependencies = [ + "cc", + "libc", + "pkg-config", + "vcpkg", +] + [[package]] name = "linicon" version = "2.3.0" @@ -2187,6 +2436,25 @@ dependencies = [ "minimal-lexical", ] +[[package]] +name = "notify" +version = "6.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6205bd8bb1e454ad2e27422015fb5e4f2bcc7e08fa8f27058670d208324a4d2d" +dependencies = [ + "bitflags 2.4.1", + "crossbeam-channel", + "filetime", + "fsevent-sys", + "inotify", + "kqueue", + "libc", + "log", + "mio", + "walkdir", + "windows-sys 0.48.0", +] + [[package]] name = "notify-rust" version = "4.10.0" @@ -2529,6 +2797,21 @@ dependencies = [ "unicode-ident", ] +[[package]] +name = "prometheus" +version = "0.13.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "449811d15fbdf5ceb5c1144416066429cf82316e2ec8ce0c1f6f8a02e7bbcf8c" +dependencies = [ + "cfg-if", + "fnv", + "lazy_static", + "memchr", + "parking_lot", + "protobuf", + "thiserror", +] + [[package]] name = "prost" version = "0.12.3" @@ -2583,6 +2866,12 @@ dependencies = [ "prost", ] +[[package]] +name = "protobuf" +version = "2.28.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "106dd99e98437432fed6519dedecfade6a06a73bb7b2a1e019fdd2bee5778d94" + [[package]] name = "qoi" version = "0.4.1" @@ -2764,6 +3053,15 @@ version = "1.0.16" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f98d2aa92eebf49b69786be48e4477826b256916e84a57ff2a4f21923b48eb4c" +[[package]] +name = "same-file" +version = "1.0.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "93fc1dc3aaa9bfed95e02e6eadabb4baf7e3078b0bd1b4d7b6b0b68378900502" +dependencies = [ + "winapi-util", +] + [[package]] name = "scoped-tls" version = "1.0.1" @@ -2813,6 +3111,16 @@ dependencies = [ "serde", ] +[[package]] +name = "serde_path_to_error" +version = "0.1.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4beec8bce849d58d06238cb50db2e1c417cfeafa4c63f692b15c82b7c80f8335" +dependencies = [ + "itoa", + "serde", +] + [[package]] name = "serde_repr" version = "0.1.17" @@ -2833,6 +3141,18 @@ dependencies = [ "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 = "serde_with" version = "3.4.0" @@ -2884,6 +3204,19 @@ dependencies = [ "digest", ] +[[package]] +name = "shadow-rs" +version = "0.26.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "878cb1e3162d98ee1016b832efbb683ad6302b462a2894c54f488dc0bd96f11c" +dependencies = [ + "const_format", + "git2", + "is_debug", + "time", + "tzdb", +] + [[package]] name = "sharded-slab" version = "0.1.7" @@ -2901,12 +3234,12 @@ checksum = "a7cee0529a6d40f580e7a5e6c495c8fbfe21b7b52795ed4bb5e62cdf92bc6380" [[package]] name = "sigfinn" -version = "0.1.1" +version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "19ccc3278dafd66473c654456b52f3d356df5c5d0ce149b39268ff59654afbcc" +checksum = "4b56d8d2e5afd3a3ca29e98bbcb4de595db4101b988a2990c0f014e42599b464" dependencies = [ "futures", - "snafu", + "snafu 0.7.5", "tokio", "tracing", ] @@ -2985,7 +3318,16 @@ dependencies = [ "doc-comment", "futures-core", "pin-project", - "snafu-derive", + "snafu-derive 0.7.5", +] + +[[package]] +name = "snafu" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d342c51730e54029130d7dc9fd735d28c4cd360f1368c01981d4f03ff207f096" +dependencies = [ + "snafu-derive 0.8.0", ] [[package]] @@ -3000,6 +3342,18 @@ dependencies = [ "syn 1.0.109", ] +[[package]] +name = "snafu-derive" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "080c44971436b1af15d6f61ddd8b543995cf63ab8e677d46b00cc06f4ef267a0" +dependencies = [ + "heck", + "proc-macro2", + "quote", + "syn 2.0.41", +] + [[package]] name = "socket2" version = "0.4.10" @@ -3167,9 +3521,9 @@ dependencies = [ [[package]] name = "time" -version = "0.3.30" +version = "0.3.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c4a34ab300f2dee6e562c10a046fc05e358b29f9bf92277f30c3c8d82275f6f5" +checksum = "f657ba42c3f86e7680e53c8cd3af8abbe56b5491790b46e22e19c0d57463583e" dependencies = [ "deranged", "itoa", @@ -3189,9 +3543,9 @@ checksum = "ef927ca75afb808a4d64dd374f00a2adf8d0fcff8e7b184af886c3c87ec4a3f3" [[package]] name = "time-macros" -version = "0.2.15" +version = "0.2.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4ad70d68dba9e1f8aceda7aa6711965dfec1cac869f311a51bd08b3a2ccbce20" +checksum = "26197e33420244aeb70c3e8c78376ca46571bc4e701e4791c2cd9f57dcb3a43f" dependencies = [ "time-core", ] @@ -3205,11 +3559,26 @@ dependencies = [ "chrono", ] +[[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.35.0" +version = "1.35.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "841d45b238a16291a4e1584e61820b8ae57d696cc5015c459c229ccc6990cc1c" +checksum = "c89b4efa943be685f629b149f53829423f8f5531ea21249408e8e2f8671ec104" dependencies = [ "backtrace", "bytes", @@ -3220,6 +3589,7 @@ dependencies = [ "signal-hook-registry", "socket2 0.5.5", "tokio-macros", + "tracing", "windows-sys 0.48.0", ] @@ -3328,7 +3698,7 @@ dependencies = [ "flate2", "h2", "http 0.2.11", - "http-body", + "http-body 0.4.6", "hyper", "hyper-timeout", "percent-encoding", @@ -3375,6 +3745,24 @@ dependencies = [ "tracing", ] +[[package]] +name = "tower-http" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "09e12e6351354851911bdf8c2b8f2ab15050c567d70a8b9a37ae7b8301a4080d" +dependencies = [ + "bitflags 2.4.1", + "bytes", + "futures-util", + "http 1.0.0", + "http-body 1.0.0", + "http-body-util", + "pin-project-lite", + "tower-layer", + "tower-service", + "tracing", +] + [[package]] name = "tower-layer" version = "0.3.2" @@ -3496,6 +3884,35 @@ version = "1.17.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "42ff0bf0c66b8238c6f3b578df37d0b7848e55df8577b3f74f92a69acceeb825" +[[package]] +name = "tz-rs" +version = "0.6.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "33851b15c848fad2cf4b105c6bb66eb9512b6f6c44a4b13f57c53c73c707e2b4" +dependencies = [ + "const_fn", +] + +[[package]] +name = "tzdb" +version = "0.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1b580f6b365fa89f5767cdb619a55d534d04a4e14c2d7e5b9a31e94598687fb1" +dependencies = [ + "iana-time-zone", + "tz-rs", + "tzdb_data", +] + +[[package]] +name = "tzdb_data" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b63691b1ba8e003011b427b0a2c369e2795d8f179b7ad6df3e3d7692338ff4b3" +dependencies = [ + "tz-rs", +] + [[package]] name = "uds_windows" version = "1.1.0" @@ -3507,18 +3924,50 @@ dependencies = [ "winapi", ] +[[package]] +name = "unicode-bidi" +version = "0.3.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6f2528f27a9eb2b21e69c95319b30bd0efd85d09c379741b0f78ea1d86be2416" + [[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.22" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5c5713f0fc4b5db668a2ac63cdb7bb4469d8c9fed047b1d0292cc7b0ce2ba921" +dependencies = [ + "tinyvec", +] + [[package]] name = "unicode-width" version = "0.1.11" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e51733f11c9c4f72aa0c160008246859e340b00807569a0da0e7a1079b27ba85" +[[package]] +name = "unicode-xid" +version = "0.2.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f962df74c8c05a667b5ee8bcf162993134c104e96440b663c8daa176dc772d8c" + +[[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 = "utf8parse" version = "0.2.1" @@ -3531,6 +3980,12 @@ 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" @@ -3564,6 +4019,16 @@ version = "1.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f3c4517f54858c779bbcbf228f4fca63d121bf85fbecb2dc578cdf4a39395690" +[[package]] +name = "walkdir" +version = "2.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d71d857dc86794ca4c280d616f7da00d2dbfd8cd788846559a6813e6aa4b54ee" +dependencies = [ + "same-file", + "winapi-util", +] + [[package]] name = "want" version = "0.3.1" @@ -4025,6 +4490,7 @@ dependencies = [ "serde_repr", "sha1", "static_assertions", + "tokio", "tracing", "uds_windows", "winapi", diff --git a/Cargo.toml b/Cargo.toml index 5af4a8ef..7e948521 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,5 +1,5 @@ [workspace.package] -version = "0.15.0" +version = "0.16.0" authors = ["xrelkd <46590321+xrelkd@users.noreply.github.com>"] homepage = "https://github.com/xrelkd/clipcat" repository = "https://github.com/xrelkd/clipcat" @@ -21,7 +21,9 @@ members = [ "crates/cli", "crates/client", "crates/clipboard", + "crates/dbus-variant", "crates/external-editor", + "crates/metrics", "crates/proto", "crates/server", ] diff --git a/README.md b/README.md index cec2ed82..37b4b20f 100644 --- a/README.md +++ b/README.md @@ -7,6 +7,7 @@
+
@@ -39,6 +40,7 @@
- [x] Support `gRPC`
- [x] gRPC over `HTTP`
- [x] gRPC over `Unix domain socket`
+- [x] Support `D-Bus`
## Screenshots
@@ -59,11 +61,12 @@
(dir_path: P) -> Vec (dir_path: P) -> VecInstall with package manager
-| Linux Distribution | Package Manager | Package | Command |
-| ----------------------------------- | ----------------------------------- | -------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------- |
-| Various | [Nix](https://github.com/NixOS/nix) | [clipcat](https://github.com/NixOS/nixpkgs/blob/master/pkgs/applications/misc/clipcat/default.nix) | `nix profile install 'github:xrelkd/clipcat/main'` or
`nix-env -iA nixpkgs.clipcat` |
-| [NixOS](https://nixos.org) | [Nix](https://github.com/NixOS/nix) | [clipcat](https://github.com/NixOS/nixpkgs/blob/master/pkgs/applications/misc/clipcat/default.nix) | `nix profile install 'github:xrelkd/clipcat/main'` or
`nix-env -iA nixos.clipcat` |
-| [Arch Linux](https://archlinux.org) | [Yay](https://github.com/Jguer/yay) | [clipcat](https://aur.archlinux.org/packages/clipcat/) | `yay -S clipcat` |
+| Linux Distribution | Package Manager | Package | Command |
+| ------------------------------------------------------------------------- | ----------------------------------- | -------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------- |
+| Various | [Nix](https://github.com/NixOS/nix) | [clipcat](https://github.com/NixOS/nixpkgs/blob/master/pkgs/applications/misc/clipcat/default.nix) | `nix profile install 'github:xrelkd/clipcat/main'` or
`nix-env -iA nixpkgs.clipcat` |
+| [NixOS](https://nixos.org) | [Nix](https://github.com/NixOS/nix) | [clipcat](https://github.com/NixOS/nixpkgs/blob/master/pkgs/applications/misc/clipcat/default.nix) | `nix profile install 'github:xrelkd/clipcat/main'` or
`nix-env -iA nixos.clipcat` |
+| [Arch Linux](https://archlinux.org) | [Yay](https://github.com/Jguer/yay) | [clipcat](https://aur.archlinux.org/packages/clipcat/) | `yay -S clipcat` |
+| [Debian](https://debian.org) and [Ubuntu](https://ubuntu.com) derivatives | APT | [clipcat](https://github.com/xrelkd/clipcat/releases/latest) | `dpkg -i clipcat_*.deb` |
(self) -> Box(self) -> Option