diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index b10a20b..2940fcb 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -18,7 +18,7 @@ jobs: steps: - name: 📚 Checkout Code - uses: actions/checkout@v2 + uses: actions/checkout@v4 - name: 🛠️ Set Script Permissions run: | @@ -60,7 +60,7 @@ jobs: upx --best target/x86_64-unknown-linux-gnu/release/steam-patch - name: 📦 Upload build - uses: actions/upload-artifact@v2 + uses: actions/upload-artifact@v4 with: name: steam-patch path: target/x86_64-unknown-linux-gnu/release/steam-patch diff --git a/.vscode/defsettings.json b/.vscode/defsettings.json deleted file mode 100644 index 5aef45b..0000000 --- a/.vscode/defsettings.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "deckip" : "192.168.0.22", - "deckport" : "22", - "deckpass" : "gamer", - "deckkey" : "-i ${env:HOME}/.ssh/id_ed25519", - "deckdir" : "/home/gamer" -} \ No newline at end of file diff --git a/.vscode/settings.json b/.vscode/settings.json deleted file mode 100644 index 3222535..0000000 --- a/.vscode/settings.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "deckip" : "192.168.0.22", - "deckport" : "22", - "deckpass" : "gamer", - "deckkey" : "-i ${env:HOME}/.ssh/id_ed25519", - "deckdir" : "/home/gamer", -} \ No newline at end of file diff --git a/.vscode/tasks.json b/.vscode/tasks.json deleted file mode 100644 index 952144a..0000000 --- a/.vscode/tasks.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "version": "2.0.0", - "tasks": [ - { - "label": "tunnel", - "type": "shell", - "group": "none", - "detail": "SSH tunnel to the device", - "command": "ssh gamer@${config:deckip} -N -f -L 4040:localhost:8080", - "problemMatcher": [] - }, - ] -} diff --git a/Cargo.lock b/Cargo.lock index ec0ea0b..2baf1bf 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1,96 +1,152 @@ # This file is automatically @generated by Cargo. # It is not intended for manual editing. -version = 3 +version = 4 [[package]] name = "addr2line" -version = "0.20.0" +version = "0.24.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f4fa78e18c64fce05e902adecd7a5eed15a5e0a3439f7b0e169f0252214865e3" +checksum = "dfbe277e56a376000877090da837660b4427aad530e3028d44e0bffe4f89a1c1" dependencies = [ "gimli", ] [[package]] -name = "adler" -version = "1.0.2" +name = "adler2" +version = "2.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f26201604c87b1e01bd3d98f8d5d9a8fcbb815e8cedb41ffccbeb4bf593a35fe" +checksum = "512761e0bb2578dd7380c6baaa0f4ce03e84f95e960231d1dec8bf4d7d6e2627" [[package]] name = "aho-corasick" -version = "1.0.2" +version = "1.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "43f6cb1bf222025340178f382c426f13757b2960e89779dfcb319c32542a5a41" +checksum = "8e60d3430d3a69478ad0993f19238d2df97c507009a52b3c10addcd7f6bcb916" dependencies = [ "memchr", ] [[package]] -name = "autocfg" -version = "1.1.0" +name = "async-broadcast" +version = "0.7.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d468802bab17cbc0cc575e9b053f41e72aa36bfa6b7f55e3529ffa43161b97fa" +checksum = "20cd0e2e25ea8e5f7e9df04578dc6cf5c83577fd09b1a46aaf5c85e1c33f2a7e" +dependencies = [ + "event-listener", + "event-listener-strategy", + "futures-core", + "pin-project-lite", +] [[package]] -name = "backtrace" -version = "0.3.68" +name = "async-recursion" +version = "1.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4319208da049c43661739c5fade2ba182f09d1dc2299b32298d3a31692b17e12" +checksum = "3b43422f69d8ff38f95f1b2bb76517c91589a924d1559a0e935d7c8ce0274c11" dependencies = [ - "addr2line", - "cc", - "cfg-if", - "libc", - "miniz_oxide", - "object", - "rustc-demangle", + "proc-macro2", + "quote", + "syn", ] [[package]] -name = "bitflags" -version = "1.3.2" +name = "async-trait" +version = "0.1.83" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "721cae7de5c34fbb2acd27e21e6d2cf7b886dce0c27388d46c4e6c47ea4318dd" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "autocfg" +version = "1.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" +checksum = "ace50bade8e6234aa140d9a2f552bbee1db4d353f69b8217bc503490fc1a9f26" [[package]] -name = "bitvec" -version = "1.0.1" +name = "axum" +version = "0.7.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1bc2832c24239b0141d5674bb9174f9d68a8b5b3f2753311927c172ca46f7e9c" +checksum = "edca88bc138befd0323b20752846e6587272d3b03b0343c8ea28a6f819e6e71f" dependencies = [ - "funty", - "radium", - "tap", - "wyz", + "async-trait", + "axum-core", + "bytes", + "futures-util", + "http", + "http-body", + "http-body-util", + "hyper", + "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.2", + "tokio", + "tower", + "tower-layer", + "tower-service", + "tracing", ] [[package]] -name = "block-buffer" -version = "0.10.4" +name = "axum-core" +version = "0.4.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3078c7629b62d3f0439517fa394996acacc5cbc91c5a20d8c658e77abd503a71" +checksum = "09f2bd6146b97ae3359fa0cc6d6b376d9539582c7b4220f041a33ec24c226199" dependencies = [ - "generic-array", + "async-trait", + "bytes", + "futures-util", + "http", + "http-body", + "http-body-util", + "mime", + "pin-project-lite", + "rustversion", + "sync_wrapper 1.0.2", + "tower-layer", + "tower-service", + "tracing", ] [[package]] -name = "byteorder" -version = "1.4.3" +name = "backtrace" +version = "0.3.74" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "14c189c53d098945499cdfa7ecc63567cf3886b3332b312a5b4585d8d3a6a610" +checksum = "8d82cb332cdfaed17ae235a638438ac4d4839913cc2af585c3c6746e8f8bee1a" +dependencies = [ + "addr2line", + "cfg-if", + "libc", + "miniz_oxide", + "object", + "rustc-demangle", + "windows-targets 0.52.6", +] [[package]] -name = "bytes" -version = "1.4.0" +name = "bitflags" +version = "2.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "89b2fd2a0dcf38d7971e2194b6b6eebab45ae01067456a7fd93d5547a61b70be" +checksum = "b048fb63fd8b5923fc5aa7b340d8e156aec7ec02f0c78fa8a6ddc2613f6f71de" [[package]] -name = "cc" -version = "1.0.79" +name = "bytes" +version = "1.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "50d30906286121d95be3d479533b458f87493b30a4b5f79a607db8f5d11aa91f" +checksum = "325918d6fe32f23b19878fe4b34794ae41fc19ddbe53b10571a4874d44ffd39b" [[package]] name = "cfg-if" @@ -99,133 +155,148 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" [[package]] -name = "core-foundation-sys" -version = "0.8.4" +name = "cfg_aliases" +version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e496a50fda8aacccc86d7529e2c1e0892dbd0f898a6b5645b5561b89c3210efa" +checksum = "613afe47fcd5fac7ccf1db93babcb082c5994d996f20b8b159f2ad1658eb5724" [[package]] -name = "cpufeatures" -version = "0.2.9" +name = "concurrent-queue" +version = "2.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a17b76ff3a4162b0b27f354a0c87015ddad39d35f9c0c36607a3bdd175dde1f1" +checksum = "4ca0197aee26d1ae37445ee532fefce43251d24cc7c166799f4d46817f1d3973" dependencies = [ - "libc", + "crossbeam-utils", ] [[package]] -name = "crossbeam-channel" -version = "0.5.8" +name = "core-foundation-sys" +version = "0.8.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a33c2bf77f2df06183c3aa30d1e96c0695a313d4f9c453cc3762a6db39f99200" -dependencies = [ - "cfg-if", - "crossbeam-utils", -] +checksum = "773648b94d0e5d620f64f280777445740e61fe701025087ec8b57f45c791888b" [[package]] name = "crossbeam-deque" -version = "0.8.3" +version = "0.8.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ce6fd6f855243022dcecf8702fef0c297d4338e226845fe067f6341ad9fa0cef" +checksum = "613f8cc01fe9cf1a3eb3d7f488fd2fa8388403e97039e2f73692932e291a770d" dependencies = [ - "cfg-if", "crossbeam-epoch", "crossbeam-utils", ] [[package]] name = "crossbeam-epoch" -version = "0.9.15" +version = "0.9.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ae211234986c545741a7dc064309f67ee1e5ad243d0e48335adc0484d960bcc7" +checksum = "5b82ac4a3c2ca9c3460964f020e1402edd5753411d7737aa39c3714ad1b5420e" dependencies = [ - "autocfg", - "cfg-if", "crossbeam-utils", - "memoffset 0.9.0", - "scopeguard", ] [[package]] name = "crossbeam-utils" -version = "0.8.16" +version = "0.8.20" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "22ec99545bb0ed0ea7bb9b8e1e9122ea386ff8a48c0922e43f36d45ab09e0e80" + +[[package]] +name = "dirs" +version = "5.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5a22b2d63d4d1dc0b7f1b6b2747dd0088008a9be28b6ddf0b1e7d335e3037294" +checksum = "44c45a9d03d6676652bcb5e724c7e988de1acad23a711b5217ab9cbecbec2225" dependencies = [ - "cfg-if", + "dirs-sys", ] [[package]] -name = "crypto-common" -version = "0.1.6" +name = "dirs-sys" +version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1bfb12502f3fc46cca1bb51ac28df9d618d813cdc3d2f25b9fe775a34af26bb3" +checksum = "520f05a5cbd335fae5a99ff7a6ab8627577660ee5cfd6a94a6a929b52ff0321c" dependencies = [ - "generic-array", - "typenum", + "libc", + "option-ext", + "redox_users", + "windows-sys 0.48.0", ] [[package]] -name = "data-encoding" -version = "2.4.0" +name = "either" +version = "1.13.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "60b1af1c220855b6ceac025d3f6ecdd2b7c4894bfe9cd9bda4fbb4bc7c0d4cf0" + +[[package]] +name = "endi" +version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c2e66c9d817f1720209181c316d28635c050fa304f9c79e47a520882661b7308" +checksum = "a3d8a32ae18130a3c84dd492d4215c3d913c3b07c6b63c2eb3eb7ff1101ab7bf" [[package]] -name = "digest" -version = "0.10.7" +name = "enumflags2" +version = "0.7.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9ed9a281f7bc9b7576e61468ba615a66a5c8cfdff42420a70aa82701a3b1e292" +checksum = "d232db7f5956f3f14313dc2f87985c58bd2c695ce124c8cdd984e08e15ac133d" dependencies = [ - "block-buffer", - "crypto-common", + "enumflags2_derive", + "serde", ] [[package]] -name = "dirs" -version = "5.0.1" +name = "enumflags2_derive" +version = "0.7.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "44c45a9d03d6676652bcb5e724c7e988de1acad23a711b5217ab9cbecbec2225" +checksum = "de0d48a183585823424a4ce1aa132d174a6a81bd540895822eb4c8373a8e49e8" dependencies = [ - "dirs-sys", + "proc-macro2", + "quote", + "syn", ] [[package]] -name = "dirs-sys" -version = "0.4.1" +name = "equivalent" +version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "520f05a5cbd335fae5a99ff7a6ab8627577660ee5cfd6a94a6a929b52ff0321c" +checksum = "5443807d6dff69373d433ab9ef5378ad8df50ca6298caf15de6e52e24aaf54d5" + +[[package]] +name = "errno" +version = "0.3.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "33d852cb9b869c2a9b3df2f71a3074817f01e1844f839a144f5fcef059a4eb5d" dependencies = [ "libc", - "option-ext", - "redox_users", - "windows-sys", + "windows-sys 0.59.0", ] [[package]] -name = "either" -version = "1.8.1" +name = "event-listener" +version = "5.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7fcaabb2fef8c910e7f4c7ce9f67a1283a1715879a7c230ca9d6d1ae31f16d91" +checksum = "6032be9bd27023a771701cc49f9f053c751055f71efb2e0ae5c15809093675ba" +dependencies = [ + "concurrent-queue", + "parking", + "pin-project-lite", +] [[package]] -name = "evdev" -version = "0.12.1" +name = "event-listener-strategy" +version = "0.5.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2bed59fcc8cfd6b190814a509018388462d3b203cf6dd10db5c00087e72a83f3" +checksum = "3c3e4e0dd3673c1139bf041f3008816d9cf2946bbfac2945c09e523b8d7b05b2" dependencies = [ - "bitvec", - "cfg-if", - "futures-core", - "libc", - "nix", - "paste", - "serde", - "thiserror", - "tokio", + "event-listener", + "pin-project-lite", ] +[[package]] +name = "fastrand" +version = "2.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "486f806e73c5707928240ddc295403b1b93c96a02038563881c4a2fd84b81ac4" + [[package]] name = "fnv" version = "1.0.7" @@ -234,24 +305,18 @@ checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" [[package]] name = "form_urlencoded" -version = "1.2.0" +version = "1.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a62bc1cf6f830c2ec14a513a9fb124d0a213a629668a4186f329db21fe045652" +checksum = "e13624c2627564efccf4934284bdd98cbaa14e79b0b5a141218e507b3a823456" dependencies = [ "percent-encoding", ] -[[package]] -name = "funty" -version = "2.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e6d5a32815ae3f33302d95fdcb2ce17862f8c65363dcfd29360480ba1001fc9c" - [[package]] name = "futures" -version = "0.3.28" +version = "0.3.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "23342abe12aba583913b2e62f22225ff9c950774065e4bfb61a19cd9770fec40" +checksum = "65bc07b1a8bc7c85c5f2e110c476c7389b4554ba72af57d8445ea63a576b0876" dependencies = [ "futures-channel", "futures-core", @@ -264,9 +329,9 @@ dependencies = [ [[package]] name = "futures-channel" -version = "0.3.28" +version = "0.3.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "955518d47e09b25bbebc7a18df10b81f0c766eaf4c4f1cccef2fca5f2a4fb5f2" +checksum = "2dff15bf788c671c1934e366d07e30c1814a8ef514e1af724a602e8a2fbe1b10" dependencies = [ "futures-core", "futures-sink", @@ -274,15 +339,15 @@ dependencies = [ [[package]] name = "futures-core" -version = "0.3.28" +version = "0.3.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4bca583b7e26f571124fe5b7561d49cb2868d79116cfa0eefce955557c6fee8c" +checksum = "05f29059c0c2090612e8d742178b0580d2dc940c837851ad723096f87af6663e" [[package]] name = "futures-executor" -version = "0.3.28" +version = "0.3.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ccecee823288125bd88b4d7f565c9e58e41858e47ab72e8ea2d64e93624386e0" +checksum = "1e28d1d997f585e54aebc3f97d39e72338912123a67330d723fdbb564d646c9f" dependencies = [ "futures-core", "futures-task", @@ -291,15 +356,15 @@ dependencies = [ [[package]] name = "futures-io" -version = "0.3.28" +version = "0.3.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4fff74096e71ed47f8e023204cfd0aa1289cd54ae5430a9523be060cdb849964" +checksum = "9e5c1b78ca4aae1ac06c48a526a655760685149f0d465d21f37abfe57ce075c6" [[package]] name = "futures-macro" -version = "0.3.28" +version = "0.3.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "89ca545a94061b6365f2c7355b4b32bd20df3ff95f02da9329b34ccc3bd6ee72" +checksum = "162ee34ebcb7c64a8abebc059ce0fee27c2262618d7b60ed8faf72fef13c3650" dependencies = [ "proc-macro2", "quote", @@ -308,21 +373,21 @@ dependencies = [ [[package]] name = "futures-sink" -version = "0.3.28" +version = "0.3.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f43be4fe21a13b9781a69afa4985b0f6ee0e1afab2c6f454a8cf30e2b2237b6e" +checksum = "e575fab7d1e0dcb8d0c7bcf9a63ee213816ab51902e6d244a95819acacf1d4f7" [[package]] name = "futures-task" -version = "0.3.28" +version = "0.3.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "76d3d132be6c0e6aa1534069c705a74a5997a356c0dc2f86a47765e5617c5b65" +checksum = "f90f7dce0722e95104fcb095585910c0977252f286e354b5e3bd38902cd99988" [[package]] name = "futures-util" -version = "0.3.28" +version = "0.3.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "26b01e40b772d54cf6c6d721c1d1abd0647a0106a12ecaa1c186273392a69533" +checksum = "9fa08315bb612088cc391249efdc3bc77536f16c91f6cf495e6fbe85b20a4a81" dependencies = [ "futures-channel", "futures-core", @@ -336,21 +401,11 @@ dependencies = [ "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" +version = "0.2.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "be4136b2a15dd319360be1c07d9933517ccf0be8f16bf62a3bee4f0d618df427" +checksum = "c4567c8db10ae91089c99af84c68c38da3ec2f087c3f82960bcdbf3656b6f4d7" dependencies = [ "cfg-if", "libc", @@ -359,46 +414,33 @@ dependencies = [ [[package]] name = "gimli" -version = "0.27.3" +version = "0.31.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b6c80984affa11d98d1b88b66ac8853f143217b399d3c74116778ff8fdb4ed2e" +checksum = "07e28edb80900c19c28f1072f2e8aeca7fa06b23cd4169cefe1af5aa3260783f" [[package]] -name = "h2" -version = "0.3.20" +name = "glob" +version = "0.3.1" 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", -] +checksum = "d2fabcfbdc87f4758337ca535fb41a6d701b65693ce38287d856d1674551ec9b" [[package]] name = "hashbrown" -version = "0.12.3" +version = "0.15.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8a9ee70c43aaf417c914396645a0fa852624801b24ebb7ae78fe8272889ac888" +checksum = "bf151400ff0baff5465007dd2f3e717f3fe502074ca563069ce3a6629d07b289" [[package]] -name = "hermit-abi" -version = "0.3.2" +name = "hex" +version = "0.4.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "443144c8cdadd93ebf52ddb4056d257f5b52c04d3c804e657d19eb73fc33668b" +checksum = "7f24254aa9a54b5c858eaee2f5bccdb46aaf0e486a595ed5fd8f86ba55232a70" [[package]] name = "http" -version = "0.2.9" +version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bd6effc99afb63425aff9b05836f029929e345a6148a14b7ecd5ab67af944482" +checksum = "f16ca2af56261c99fba8bac40a10251ce8188205a4c448fbb745a2e4daa76fea" dependencies = [ "bytes", "fnv", @@ -407,166 +449,186 @@ dependencies = [ [[package]] name = "http-body" -version = "0.4.5" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1efedce1fb8e6913f23e0c92de8e62cd5b772a67e7b3946df930a62566c93184" +dependencies = [ + "bytes", + "http", +] + +[[package]] +name = "http-body-util" +version = "0.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d5f38f16d184e36f2408a55281cd658ecbd3ca05cce6d6510a176eca393e26d1" +checksum = "793429d76616a256bcb62c2a2ec2bed781c8307e797e2598c50010f2bee2544f" dependencies = [ "bytes", + "futures-util", "http", + "http-body", "pin-project-lite", ] [[package]] name = "httparse" -version = "1.8.0" +version = "1.9.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d897f394bad6a705d5f4104762e116a75639e470d80901eed05a860a95cb1904" +checksum = "7d71d3574edd2771538b901e6549113b4006ece66150fb69c0fb6d9a2adae946" [[package]] name = "httpdate" -version = "1.0.2" +version = "1.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c4a1e36c821dbe04574f602848a19f742f4fb3c98d40449f11bcad18d6b17421" +checksum = "df3b46402a9d5adb4c86a0cf463f42e19994e3ee891101b1841f30a545cb49a9" [[package]] name = "hyper" -version = "0.14.27" +version = "1.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ffb1cfd654a8219eaef89881fdb3bb3b1cdc5fa75ded05d6933b2b382e395468" +checksum = "97818827ef4f364230e16705d4706e2897df2bb60617d6ca15d598025a3c481f" dependencies = [ "bytes", "futures-channel", - "futures-core", "futures-util", - "h2", "http", "http-body", "httparse", "httpdate", "itoa", "pin-project-lite", - "socket2", + "smallvec", "tokio", - "tower-service", - "tracing", - "want", ] [[package]] -name = "idna" -version = "0.4.0" +name = "hyper-util" +version = "0.1.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7d20d6b07bfbc108882d88ed8e37d39636dcc260e15e30c45e6ba089610b917c" +checksum = "df2dcfbe0677734ab2f3ffa7fa7bfd4706bfdc1ef393f2ee30184aed67e631b4" dependencies = [ - "unicode-bidi", - "unicode-normalization", + "bytes", + "futures-util", + "http", + "http-body", + "hyper", + "pin-project-lite", + "tokio", + "tower-service", ] [[package]] name = "indexmap" -version = "1.9.3" +version = "2.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bd070e393353796e801d209ad339e89596eb4c8d430d18ede6a1cced8fafbd99" +checksum = "62f822373a4fe84d4bb149bf54e584a7f4abec90e072ed49cda0edea5b95471f" dependencies = [ - "autocfg", + "equivalent", "hashbrown", ] [[package]] -name = "inotify" -version = "0.10.1" +name = "itoa" +version = "1.0.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ff335215fb898bf09c45833b657233d8c0b699a616d7dd64d0513080da270ab6" -dependencies = [ - "bitflags", - "futures-core", - "inotify-sys", - "libc", - "tokio", -] +checksum = "d75a2a4b1b190afb6f5425f10f6a8f959d2ea0b9c2b1d79553551850539e4674" + +[[package]] +name = "libc" +version = "0.2.167" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "09d6582e104315a817dff97f75133544b2e094ee22447d2acf4a74e189ba06fc" [[package]] -name = "inotify-sys" -version = "0.1.5" +name = "libredox" +version = "0.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e05c02b5e89bff3b946cedeca278abc628fe811e604f027c45a8aa3cf793d0eb" +checksum = "c0ff37bd590ca25063e35af745c343cb7a0271906fb7b37e4813e8f79f00268d" dependencies = [ + "bitflags", "libc", ] [[package]] -name = "itoa" -version = "1.0.8" +name = "linux-raw-sys" +version = "0.4.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "62b02a5381cc465bd3041d84623d0fa3b66738b52b8e2fc3bab8ad63ab032f4a" +checksum = "78b3ae25bc7c8c38cec158d1f2757ee79e9b3740fbc7ccf0e59e4b08d793fa89" [[package]] -name = "libc" -version = "0.2.147" +name = "lock_api" +version = "0.4.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b4668fb0ea861c1df094127ac5f1da3409a82116a4ba74fca2e58ef927159bb3" +checksum = "07af8b9cdd281b7915f413fa73f29ebd5d55d0d3f0155584dade1ff18cea1b17" +dependencies = [ + "autocfg", + "scopeguard", +] [[package]] name = "log" -version = "0.4.19" +version = "0.4.22" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a7a70ba024b9dc04c27ea2f0c0548feb474ec5c54bba33a7f72f873a39d07b24" + +[[package]] +name = "matchit" +version = "0.7.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b06a4cde4c0f271a446782e3eff8de789548ce57dbc8eca9292c27f4a42004b4" +checksum = "0e7465ac9959cc2b1404e8e2367b43684a6d13790fe23056cc8c6c5a6b7bcb94" [[package]] name = "memchr" -version = "2.5.0" +version = "2.7.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2dffe52ecf27772e601905b7522cb4ef790d2cc203488bbd0e2fe85fcb74566d" +checksum = "78ca9ab1a0babb1e7d5695e3530886289c18cf2f87ec19a575a0abdce112e3a3" [[package]] name = "memoffset" -version = "0.6.5" +version = "0.9.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5aa361d4faea93603064a027415f07bd8e1d5c88c9fbf68bf56a285428fd79ce" +checksum = "488016bfae457b036d996092f6cb448677611ce4449e970ceaf42695203f218a" dependencies = [ "autocfg", ] [[package]] -name = "memoffset" -version = "0.9.0" +name = "mime" +version = "0.3.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5a634b1c61a95585bd15607c6ab0c4e5b226e695ff2800ba0cdccddf208c406c" -dependencies = [ - "autocfg", -] +checksum = "6877bb514081ee2a7ff5ef9de3281f14a4dd4bceac4c09388074a6b5df8a139a" [[package]] name = "miniz_oxide" -version = "0.7.1" +version = "0.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e7810e0be55b428ada41041c41f32c9f1a42817901b4ccf45fa3d4b6561e74c7" +checksum = "e2d80299ef12ff69b16a84bb182e3b9df68b5a91574d3d4fa6e41b65deec4df1" dependencies = [ - "adler", + "adler2", ] [[package]] name = "mio" -version = "0.8.8" +version = "1.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "927a765cd3fc26206e66b296465fa9d3e5ab003e651c1b3c060e7956d96b19d2" +checksum = "2886843bf800fba2e3377cff24abf6379b4c4d5c6681eaf9ea5b0d15090450bd" dependencies = [ "libc", "wasi", - "windows-sys", + "windows-sys 0.52.0", ] [[package]] name = "nix" -version = "0.23.2" +version = "0.29.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8f3790c00a0150112de0f4cd161e3d7fc4b2d8a5542ffc35f099a2562aecb35c" +checksum = "71e2746dc3a24dd78b3cfcb7be93368c6de9963d30f43a6a73998a9cf4b17b46" dependencies = [ "bitflags", - "cc", "cfg-if", + "cfg_aliases", "libc", - "memoffset 0.6.5", + "memoffset", ] [[package]] @@ -578,30 +640,20 @@ dependencies = [ "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" +version = "0.36.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8bda667d9f2b5051b8833f59f3bf748b28ef54f850f4fcb389a252aa383866d1" +checksum = "aedf0a2d09c573ed1d8d85b30c119153926a2b36dce0ab28322c09a117a4683e" dependencies = [ "memchr", ] [[package]] name = "once_cell" -version = "1.18.0" +version = "1.20.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dd8b5dd2ae5ed71462c540258bedcb51965123ad7e7ccf4b9a8cafaa4a63576d" +checksum = "1261fe7e33c73b354eab43b1273a57c8f967d0391e80353e51f764ac02cf6775" [[package]] name = "option-ext" @@ -610,22 +662,55 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "04744f49eae99ab78e0d5c0b603ab218f515ea8cfe5a456d7629ad883a3b6e7d" [[package]] -name = "paste" -version = "1.0.13" +name = "ordered-stream" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9aa2b01e1d916879f73a53d01d1d6cee68adbb31d6d9177a8cfce093cced1d50" +dependencies = [ + "futures-core", + "pin-project-lite", +] + +[[package]] +name = "parking" +version = "2.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f38d5652c16fde515bb1ecef450ab0f6a219d619a7274976324d5e377f7dceba" + +[[package]] +name = "parking_lot" +version = "0.12.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f1bf18183cf54e8d6059647fc3063646a1801cf30896933ec2311622cc4b9a27" +dependencies = [ + "lock_api", + "parking_lot_core", +] + +[[package]] +name = "parking_lot_core" +version = "0.9.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b4b27ab7be369122c218afc2079489cdcb4b517c0a3fc386ff11e1fedfcc2b35" +checksum = "1e401f977ab385c9e4e3ab30627d6f26d00e2c73eef317493c4ec6d468726cf8" +dependencies = [ + "cfg-if", + "libc", + "redox_syscall", + "smallvec", + "windows-targets 0.52.6", +] [[package]] name = "percent-encoding" -version = "2.3.0" +version = "2.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9b2a4787296e9989611394c33f193f676704af1686e70b8f8033ab5ba9a35a94" +checksum = "e3148f5046208a5d56bcfc03053e3ca6334e51da8dfb19b6cdc8b306fae3283e" [[package]] name = "pin-project-lite" -version = "0.2.10" +version = "0.2.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4c40d25201921e5ff0c862a505c6557ea88568a4e3ace775ab55e93f2f4f9d57" +checksum = "915a1e146535de9163f3987b8944ed8cf49a18bb0056bcebcdcece385cece4ff" [[package]] name = "pin-utils" @@ -634,112 +719,77 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184" [[package]] -name = "ppv-lite86" -version = "0.2.17" +name = "proc-macro-crate" +version = "3.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5b40af805b3121feab8a3c29f04d8ad262fa8e0561883e7653e024ae4479e6de" +checksum = "8ecf48c7ca261d60b74ab1a7b20da18bede46776b2e55535cb958eb595c5fa7b" +dependencies = [ + "toml_edit", +] [[package]] name = "proc-macro2" -version = "1.0.64" +version = "1.0.92" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "78803b62cbf1f46fde80d7c0e803111524b9877184cfe7c3033659490ac7a7da" +checksum = "37d3544b3f2748c54e147655edb5025752e2303145b5aefb3c3ea2c78b973bb0" dependencies = [ "unicode-ident", ] [[package]] name = "quote" -version = "1.0.29" +version = "1.0.37" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "573015e8ab27661678357f27dc26460738fd2b6c86e46f386fde94cb5d913105" +checksum = "b5b9d34b8991d19d98081b46eacdd8eb58c6f2b201139f7c5f643cc155a633af" dependencies = [ "proc-macro2", ] [[package]] -name = "radium" -version = "0.7.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dc33ff2d4973d518d823d61aa239014831e521c75da58e3df4840d3f47749d09" - -[[package]] -name = "rand" -version = "0.8.5" +name = "rayon" +version = "1.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "34af8d1a0e25924bc5b7c43c079c942339d8f0a8b57c39049bef581b46327404" +checksum = "b418a60154510ca1a002a752ca9714984e21e4241e804d32555251faf8b78ffa" 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 = "rayon" -version = "1.7.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1d2df5196e37bcc87abebc0053e20787d73847bb33134a69841207dd0a47f03b" -dependencies = [ - "either", - "rayon-core", + "either", + "rayon-core", ] [[package]] name = "rayon-core" -version = "1.11.0" +version = "1.12.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4b8f95bd6966f5c87776639160a66bd8ab9895d9d4ab01ddba9fc60661aebe8d" +checksum = "1465873a3dfdaa8ae7cb14b4383657caab0b3e8a0aa9ae8e04b044854c8dfce2" dependencies = [ - "crossbeam-channel", "crossbeam-deque", "crossbeam-utils", - "num_cpus", ] [[package]] name = "redox_syscall" -version = "0.2.16" +version = "0.5.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fb5a58c1855b4b6819d59012155603f0b22ad30cad752600aadfcb695265519a" +checksum = "9b6dfecf2c74bce2466cabf93f6664d6998a69eb21e39f4207930065b27b771f" dependencies = [ "bitflags", ] [[package]] name = "redox_users" -version = "0.4.3" +version = "0.4.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b033d837a7cf162d7993aded9304e30a83213c648b6e389db233191f891e5c2b" +checksum = "ba009ff324d1fc1b900bd1fdb31564febe58a8ccc8a6fdbb93b543d33b13ca43" dependencies = [ "getrandom", - "redox_syscall", + "libredox", "thiserror", ] [[package]] name = "regex" -version = "1.9.1" +version = "1.11.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b2eae68fc220f7cf2532e4494aded17545fce192d59cd996e0fe7887f4ceb575" +checksum = "b544ef1b4eac5dc2db33ea63606ae9ffcfac26c1416a2806ae0bf5f56b201191" dependencies = [ "aho-corasick", "memchr", @@ -749,9 +799,9 @@ dependencies = [ [[package]] name = "regex-automata" -version = "0.3.2" +version = "0.4.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "83d3daa6976cffb758ec878f108ba0e062a45b2d6ca3a2cca965338855476caf" +checksum = "809e8dc61f6de73b46c85f4c96486310fe304c434cfa43669d7b40f711150908" dependencies = [ "aho-corasick", "memchr", @@ -760,42 +810,61 @@ dependencies = [ [[package]] name = "regex-syntax" -version = "0.7.3" +version = "0.8.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2ab07dc67230e4a4718e70fd5c20055a4334b121f1f9db8fe63ef39ce9b8c846" +checksum = "2b15c43186be67a4fd63bee50d0303afffcef381492ebe2c5d87f324e1b8815c" [[package]] name = "rustc-demangle" -version = "0.1.23" +version = "0.1.24" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "719b953e2095829ee67db738b3bfa9fa368c94900df327b3f07fe6e794d2fe1f" + +[[package]] +name = "rustix" +version = "0.38.41" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d7f649912bc1495e167a6edee79151c84b1bad49748cb4f1f1167f459f6224f6" +dependencies = [ + "bitflags", + "errno", + "libc", + "linux-raw-sys", + "windows-sys 0.52.0", +] + +[[package]] +name = "rustversion" +version = "1.0.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d626bb9dae77e28219937af045c257c28bfd3f69333c512553507f5f9798cb76" +checksum = "0e819f2bc632f285be6d7cd36e25940d45b2391dd6d9b939e79de557f7014248" [[package]] name = "ryu" -version = "1.0.14" +version = "1.0.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fe232bdf6be8c8de797b22184ee71118d63780ea42ac85b61d1baa6d3b782ae9" +checksum = "f3cb5ba0dc43242ce17de99c180e96db90b235b8a9fdc9543c96d2209116bd9f" [[package]] name = "scopeguard" -version = "1.1.0" +version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d29ab0c6d3fc0ee92fe66e2d99f700eab17a8d57d1c1d3b748380fb20baa78cd" +checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49" [[package]] name = "serde" -version = "1.0.169" +version = "1.0.215" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bd51c3db8f9500d531e6c12dd0fd4ad13d133e9117f5aebac3cdbb8b6d9824b0" +checksum = "6513c1ad0b11a9376da888e3e0baa0077f1aed55c17f50e7b2397136129fb88f" dependencies = [ "serde_derive", ] [[package]] name = "serde_derive" -version = "1.0.169" +version = "1.0.215" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "27738cfea0d944ab72c3ed01f3d5f23ec4322af8a1431e40ce630e4c01ea74fd" +checksum = "ad1e866f866923f252f05c889987993144fb74e722403468a4ebd70c3cd756c0" dependencies = [ "proc-macro2", "quote", @@ -804,152 +873,199 @@ dependencies = [ [[package]] name = "serde_json" -version = "1.0.100" +version = "1.0.133" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0f1e14e89be7aa4c4b78bdbdc9eb5bf8517829a600ae8eaa39a6e1d960b5185c" +checksum = "c7fceb2473b9166b2294ef05efcb65a3db80803f0b03ef86a5fc88a2b85ee377" dependencies = [ "itoa", + "memchr", "ryu", "serde", ] [[package]] -name = "sha1" -version = "0.10.5" +name = "serde_path_to_error" +version = "0.1.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f04293dc80c3993519f2d7f6f511707ee7094fe0c6d3406feb330cdb3540eba3" +checksum = "af99884400da37c88f5e9146b7f1fd0fbcae8f6eec4e9da38b67d05486f814a6" dependencies = [ - "cfg-if", - "cpufeatures", - "digest", + "itoa", + "serde", +] + +[[package]] +name = "serde_repr" +version = "0.1.19" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6c64451ba24fc7a6a2d60fc75dd9c83c90903b19028d4eff35e88fc1e86564e9" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[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 = "signal-hook-registry" +version = "1.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a9e9e0b4211b72e7b8b6e85c807d36c212bdb33ea8587f7569562a84df5465b1" +dependencies = [ + "libc", ] [[package]] name = "slab" -version = "0.4.8" +version = "0.4.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6528351c9bc8ab22353f9d776db39a20288e8d6c37ef8cfe3317cf875eecfc2d" +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.4.9" +version = "0.5.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "64a4a911eed85daf18834cfaa86a79b7d266ff93ff5ba14005426219480ed662" +checksum = "c970269d99b64e60ec3bd6ad27270092a5394c4e309314b18ae3fe575695fbe8" dependencies = [ "libc", - "winapi", + "windows-sys 0.52.0", ] +[[package]] +name = "static_assertions" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a2eb9349b6444b326872e140eb1cf5e7c522154d69e7a0ffb0fb81c06b37543f" + [[package]] name = "steam-patch" -version = "0.2.1" +version = "2.0.0" dependencies = [ + "axum", "dirs", - "evdev", "futures", - "hyper", - "inotify", + "glob", "regex", "serde", - "serde_json", "sysinfo", "tokio", - "tungstenite", + "tower-http", + "zbus", ] [[package]] name = "syn" -version = "2.0.24" +version = "2.0.90" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "36ccaf716a23c35ff908f91c971a86a9a71af5998c1d8f10e828d9f55f68ac00" +checksum = "919d3b74a5dd0ccd15aeb8f93e7006bd9e14c295087c9896a110f490752bcf31" 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.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0bf256ce5efdfa370213c1dabab5935a12e49f2c58d15e9eac2870d3b4f27263" + [[package]] name = "sysinfo" -version = "0.29.4" +version = "0.33.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "751e810399bba86e9326f5762b7f32ac5a085542df78da6a78d94e07d14d7c11" +checksum = "948512566b1895f93b1592c7574baeb2de842f224f2aab158799ecadb8ebbb46" dependencies = [ - "cfg-if", "core-foundation-sys", "libc", + "memchr", "ntapi", - "once_cell", "rayon", - "winapi", + "windows", ] [[package]] -name = "tap" -version = "1.0.1" +name = "tempfile" +version = "3.14.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "55937e1799185b12863d447f42597ed69d9928686b8d88a1df17376a097d8369" +checksum = "28cce251fcbc87fac86a866eeb0d6c2d536fc16d06f184bb61aeae11aa4cee0c" +dependencies = [ + "cfg-if", + "fastrand", + "once_cell", + "rustix", + "windows-sys 0.59.0", +] [[package]] name = "thiserror" -version = "1.0.43" +version = "1.0.69" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a35fc5b8971143ca348fa6df4f024d4d55264f3468c71ad1c2f365b0a4d58c42" +checksum = "b6aaf5339b578ea85b50e080feb250a3e8ae8cfcdff9a461c9ec2904bc923f52" dependencies = [ "thiserror-impl", ] [[package]] name = "thiserror-impl" -version = "1.0.43" +version = "1.0.69" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "463fe12d7993d3b327787537ce8dd4dfa058de32fc2b195ef3cde03dc4771e8f" +checksum = "4fee6c4efc90059e10f81e6d42c60a18f76588c3d74cb83a0b242a2b6c7504c1" dependencies = [ "proc-macro2", "quote", "syn", ] -[[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" +version = "1.42.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "532826ff75199d5833b9d2c5fe410f29235e25704ee5f0ef599fb51c21f4a4da" +checksum = "5cec9b21b0450273377fc97bd4c33a8acffc8c996c987a7c5b319a0083707551" dependencies = [ - "autocfg", "backtrace", "bytes", "libc", "mio", - "num_cpus", + "parking_lot", "pin-project-lite", + "signal-hook-registry", "socket2", "tokio-macros", - "windows-sys", + "tracing", + "windows-sys 0.52.0", ] [[package]] name = "tokio-macros" -version = "2.1.0" +version = "2.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "630bdcf245f78637c13ec01ffae6187cca34625e8c63150d424b59e55af2675e" +checksum = "693d596312e88961bc67d7f1f97af8a70227d9f90c31bba5806eec004978d752" dependencies = [ "proc-macro2", "quote", @@ -957,128 +1073,112 @@ dependencies = [ ] [[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" +name = "toml_datetime" +version = "0.6.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b6bc1c9ce2b5135ac7f93c72918fc37feb872bdc6a5533a8b85eb4b86bfdae52" +checksum = "0dd7358ecb8fc2f8d014bf86f6f638ce72ba252a2c3a2572f2a795f1d23efb41" [[package]] -name = "tracing" -version = "0.1.37" +name = "toml_edit" +version = "0.22.22" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8ce8c33a8d48bd45d624a6e523445fd21ec13d3653cd51f681abf67418f54eb8" +checksum = "4ae48d6208a266e853d946088ed816055e556cc6028c5e8e2b84d9fa5dd7c7f5" dependencies = [ - "cfg-if", - "pin-project-lite", - "tracing-core", + "indexmap", + "toml_datetime", + "winnow", ] [[package]] -name = "tracing-core" -version = "0.1.31" +name = "tower" +version = "0.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0955b8137a1df6f1a2e9a37d8a6656291ff0297c1a97c24e0d8425fe2312f79a" +checksum = "2873938d487c3cfb9aed7546dc9f2711d867c9f90c46b889989a2cb84eba6b4f" dependencies = [ - "once_cell", + "futures-core", + "futures-util", + "pin-project-lite", + "sync_wrapper 0.1.2", + "tokio", + "tower-layer", + "tower-service", + "tracing", ] [[package]] -name = "try-lock" -version = "0.2.4" +name = "tower-http" +version = "0.6.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3528ecfd12c466c6f163363caf2d02a71161dd5e1cc6ae7b34207ea2d42d81ed" - -[[package]] -name = "tungstenite" -version = "0.20.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e862a1c4128df0112ab625f55cd5c934bcb4312ba80b39ae4b4835a3fd58e649" +checksum = "403fa3b783d4b626a8ad51d766ab03cb6d2dbfc46b1c5d4448395e6628dc9697" dependencies = [ - "byteorder", + "bitflags", "bytes", - "data-encoding", "http", - "httparse", - "log", - "rand", - "sha1", - "thiserror", - "url", - "utf-8", + "pin-project-lite", + "tower-layer", + "tower-service", ] [[package]] -name = "typenum" -version = "1.16.0" +name = "tower-layer" +version = "0.3.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "497961ef93d974e23eb6f433eb5fe1b7930b659f06d12dec6fc44a8f554c0bba" +checksum = "121c2a6cda46980bb0fcd1647ffaf6cd3fc79a013de288782836f6df9c48780e" [[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.10" +name = "tower-service" +version = "0.3.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "22049a19f4a68748a168c0fc439f9516686aa045927ff767eca0a85101fb6e73" +checksum = "8df9b6e13f2d32c91b9bd719c00d1958837bc7dec474d94952798cc8e69eeec3" [[package]] -name = "unicode-normalization" -version = "0.1.22" +name = "tracing" +version = "0.1.41" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5c5713f0fc4b5db668a2ac63cdb7bb4469d8c9fed047b1d0292cc7b0ce2ba921" +checksum = "784e0ac535deb450455cbfa28a6f0df145ea1bb7ae51b821cf5e7927fdcfbdd0" dependencies = [ - "tinyvec", + "log", + "pin-project-lite", + "tracing-attributes", + "tracing-core", ] [[package]] -name = "url" -version = "2.4.0" +name = "tracing-attributes" +version = "0.1.28" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "50bff7831e19200a85b17131d085c25d7811bc4e186efdaf54bbd132994a88cb" +checksum = "395ae124c09f9e6918a2310af6038fba074bcf474ac352496d5910dd59a2226d" dependencies = [ - "form_urlencoded", - "idna", - "percent-encoding", + "proc-macro2", + "quote", + "syn", ] [[package]] -name = "utf-8" -version = "0.7.6" +name = "tracing-core" +version = "0.1.33" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "09cc8ee72d2a9becf2f2febe0205bbed8fc6615b7cb429ad062dc7b7ddd036a9" +checksum = "e672c95779cf947c5311f83787af4fa8fffd12fb27e4993211a84bdfd9610f9c" +dependencies = [ + "once_cell", +] [[package]] -name = "version_check" -version = "0.9.4" +name = "uds_windows" +version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f" +checksum = "89daebc3e6fd160ac4aa9fc8b3bf71e1f74fbf92367ae71fb83a037e8bf164b9" +dependencies = [ + "memoffset", + "tempfile", + "winapi", +] [[package]] -name = "want" -version = "0.3.1" +name = "unicode-ident" +version = "1.0.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bfa7760aed19e106de2c7c0b581b509f2f25d3dacaf737cb82ac61bc6d760b0e" -dependencies = [ - "try-lock", -] +checksum = "adb9e6ca4f869e1180728b7950e35922a7fc6397f7b641499e8f3ef06e50dc83" [[package]] name = "wasi" @@ -1108,77 +1208,321 @@ version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" +[[package]] +name = "windows" +version = "0.57.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "12342cb4d8e3b046f3d80effd474a7a02447231330ef77d71daa6fbc40681143" +dependencies = [ + "windows-core", + "windows-targets 0.52.6", +] + +[[package]] +name = "windows-core" +version = "0.57.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d2ed2439a290666cd67ecce2b0ffaad89c2a56b976b736e6ece670297897832d" +dependencies = [ + "windows-implement", + "windows-interface", + "windows-result", + "windows-targets 0.52.6", +] + +[[package]] +name = "windows-implement" +version = "0.57.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9107ddc059d5b6fbfbffdfa7a7fe3e22a226def0b2608f72e9d552763d3e1ad7" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "windows-interface" +version = "0.57.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "29bee4b38ea3cde66011baa44dba677c432a78593e202392d1e9070cf2a7fca7" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "windows-result" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5e383302e8ec8515204254685643de10811af0ed97ea37210dc26fb0032647f8" +dependencies = [ + "windows-targets 0.52.6", +] + [[package]] name = "windows-sys" version = "0.48.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "677d2418bec65e3338edb076e806bc1ec15693c5d0104683f2efe857f61056a9" dependencies = [ - "windows-targets", + "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.6", +] + +[[package]] +name = "windows-sys" +version = "0.59.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1e38bc4d79ed67fd075bcc251a1c39b32a1776bbe92e5bef1f0bf1f8c531853b" +dependencies = [ + "windows-targets 0.52.6", ] [[package]] name = "windows-targets" -version = "0.48.1" +version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "05d4b17490f70499f20b9e791dcf6a299785ce8af4d709018206dc5b4953e95f" +checksum = "9a2fa6e2155d7247be68c096456083145c183cbbbc2764150dda45a87197940c" 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", + "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.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9b724f72796e036ab90c1021d4780d4d3d648aca59e491e6b98e725b84e99973" +dependencies = [ + "windows_aarch64_gnullvm 0.52.6", + "windows_aarch64_msvc 0.52.6", + "windows_i686_gnu 0.52.6", + "windows_i686_gnullvm", + "windows_i686_msvc 0.52.6", + "windows_x86_64_gnu 0.52.6", + "windows_x86_64_gnullvm 0.52.6", + "windows_x86_64_msvc 0.52.6", ] [[package]] name = "windows_aarch64_gnullvm" -version = "0.48.0" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2b38e32f0abccf9987a4e3079dfb67dcd799fb61361e53e2882c3cbaf0d905d8" + +[[package]] +name = "windows_aarch64_gnullvm" +version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "91ae572e1b79dba883e0d315474df7305d12f569b400fcf90581b06062f7e1bc" +checksum = "32a4622180e7a0ec044bb555404c800bc9fd9ec262ec147edd5989ccd0c02cd3" [[package]] name = "windows_aarch64_msvc" -version = "0.48.0" +version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b2ef27e0d7bdfcfc7b868b317c1d32c641a6fe4629c171b8928c7b08d98d7cf3" +checksum = "dc35310971f3b2dbbf3f0690a219f40e2d9afcf64f9ab7cc1be722937c26b4bc" + +[[package]] +name = "windows_aarch64_msvc" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "09ec2a7bb152e2252b53fa7803150007879548bc709c039df7627cabbd05d469" [[package]] name = "windows_i686_gnu" -version = "0.48.0" +version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "622a1962a7db830d6fd0a69683c80a18fda201879f0f447f065a3b7467daa241" +checksum = "a75915e7def60c94dcef72200b9a8e58e5091744960da64ec734a6c6e9b3743e" + +[[package]] +name = "windows_i686_gnu" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8e9b5ad5ab802e97eb8e295ac6720e509ee4c243f69d781394014ebfe8bbfa0b" + +[[package]] +name = "windows_i686_gnullvm" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0eee52d38c090b3caa76c563b86c3a4bd71ef1a819287c19d586d7334ae8ed66" [[package]] name = "windows_i686_msvc" -version = "0.48.0" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8f55c233f70c4b27f66c523580f78f1004e8b5a8b659e05a4eb49d4166cca406" + +[[package]] +name = "windows_i686_msvc" +version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4542c6e364ce21bf45d69fdd2a8e455fa38d316158cfd43b3ac1c5b1b19f8e00" +checksum = "240948bc05c5e7c6dabba28bf89d89ffce3e303022809e73deaefe4f6ec56c66" [[package]] name = "windows_x86_64_gnu" -version = "0.48.0" +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.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ca2b8a661f7628cbd23440e50b05d705db3686f894fc9580820623656af974b1" +checksum = "147a5c80aabfbf0c7d901cb5895d1de30ef2907eb21fbbab29ca94c5b08b1a78" [[package]] name = "windows_x86_64_gnullvm" -version = "0.48.0" +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.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7896dbc1f41e08872e9d5e8f8baa8fdd2677f29468c4e156210174edc7f7b953" +checksum = "24d5b23dc417412679681396f2b49f3de8c1473deb516bd34410872eff51ed0d" [[package]] name = "windows_x86_64_msvc" -version = "0.48.0" +version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1a515f5799fe4961cb532f983ce2b23082366b898e52ffbce459c86f67c8378a" +checksum = "ed94fce61571a4006852b7389a063ab983c02eb1bb37b47f8272ce92d06d9538" [[package]] -name = "wyz" -version = "0.5.1" +name = "windows_x86_64_msvc" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "589f6da84c646204747d1270a2a5661ea66ed1cced2631d546fdfb155959f9ec" + +[[package]] +name = "winnow" +version = "0.6.20" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "36c1fec1a2bb5866f07c25f68c26e565c4c200aebb96d7e55710c19d3e8ac49b" +dependencies = [ + "memchr", +] + +[[package]] +name = "xdg-home" +version = "1.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ec1cdab258fb55c0da61328dc52c8764709b249011b2cad0454c72f0bf10a1f6" +dependencies = [ + "libc", + "windows-sys 0.59.0", +] + +[[package]] +name = "zbus" +version = "5.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1162094dc63b1629fcc44150bcceeaa80798cd28bcbe7fa987b65a034c258608" +dependencies = [ + "async-broadcast", + "async-recursion", + "async-trait", + "enumflags2", + "event-listener", + "futures-core", + "futures-util", + "hex", + "nix", + "ordered-stream", + "serde", + "serde_repr", + "static_assertions", + "tokio", + "tracing", + "uds_windows", + "windows-sys 0.59.0", + "winnow", + "xdg-home", + "zbus_macros", + "zbus_names", + "zvariant", +] + +[[package]] +name = "zbus_macros" +version = "5.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2cd2dcdce3e2727f7d74b7e33b5a89539b3cc31049562137faf7ae4eb86cd16d" +dependencies = [ + "proc-macro-crate", + "proc-macro2", + "quote", + "syn", + "zbus_names", + "zvariant", + "zvariant_utils", +] + +[[package]] +name = "zbus_names" +version = "4.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "05f360fc0b24296329c78fda852a1e9ae82de9cf7b27dae4b7f62f118f77b9ed" +checksum = "856b7a38811f71846fd47856ceee8bccaec8399ff53fb370247e66081ace647b" dependencies = [ - "tap", + "serde", + "static_assertions", + "winnow", + "zvariant", +] + +[[package]] +name = "zvariant" +version = "5.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a1200ee6ac32f1e5a312e455a949a4794855515d34f9909f4a3e082d14e1a56f" +dependencies = [ + "endi", + "enumflags2", + "serde", + "static_assertions", + "winnow", + "zvariant_derive", + "zvariant_utils", +] + +[[package]] +name = "zvariant_derive" +version = "5.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "687e3b97fae6c9104fbbd36c73d27d149abf04fb874e2efbd84838763daa8916" +dependencies = [ + "proc-macro-crate", + "proc-macro2", + "quote", + "syn", + "zvariant_utils", +] + +[[package]] +name = "zvariant_utils" +version = "3.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "20d1d011a38f12360e5fcccceeff5e2c42a8eb7f27f0dcba97a0862ede05c9c6" +dependencies = [ + "proc-macro2", + "quote", + "serde", + "static_assertions", + "syn", + "winnow", ] diff --git a/Cargo.toml b/Cargo.toml index 7b0b2db..453bc3c 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,25 +1,24 @@ [package] name = "steam-patch" -version = "0.2.1" +version = "2.0.0" edition = "2021" [dependencies] -tokio = { version = "1", features = [ "rt-multi-thread", "macros"] } -serde = { version = "1.0.169", features=["derive"] } -serde_json = { version = "1.0.100" } -tungstenite = "0.20.0" +sysinfo = "0.33.0" +zbus = { version = "5.1.1", default-features = false, features = ["tokio"] } +tokio = { version = "1.42.0", features = ["full"] } +futures = "0.3.31" +axum = "0.7.9" +serde = { version = "1.0.215", features = ["derive"] } +tower-http = { version = "0.6.2", features = ["cors"] } dirs = "5.0.1" -futures = "0.3.28" -sysinfo = "0.29.4" -regex = "1" -evdev = { version = "0.12.1", features = ["tokio", "serde"]} -hyper = { version = "0.14", features = ["full"] } -inotify = "0.10.1" +glob = "0.3.1" +regex = "1.11.1" [profile.release] -opt-level = "z" -# debug = true -lto = true # Enable link-time optimization -codegen-units = 1 # Reduce number of codegen units to increase optimizations -panic = 'abort' # Abort on panic -strip = true # Strip symbols from binary* +opt-level = 3 # Optimize for maximum speed +lto = true # Enable Link Time Optimization (LTO) for smaller code size and better performance +panic = "abort" # Avoid generating panic unwind information +codegen-units = 1 # Reduce the number of codegen units to improve inlining and optimization +strip = "debuginfo" # Strip debug information to reduce size +debug = false # Don't include debug information in the release build \ No newline at end of file diff --git a/Cross.toml b/Cross.toml deleted file mode 100644 index daa7873..0000000 --- a/Cross.toml +++ /dev/null @@ -1,5 +0,0 @@ -[target.x86_64-unknown-linux-gnu] -pre-build = [ - "dpkg --add-architecture $CROSS_DEB_ARCH", - "apt-get update && apt-get install --assume-yes libssl-dev:$CROSS_DEB_ARCH" -] \ No newline at end of file diff --git a/README.md b/README.md index 914439f..d3fafb4 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,6 @@ +# ⚠️⚠️⚠️ UNDER CONSTRUCTION DO NO INSTALL ⚠️⚠️⚠️ + + # ⚙️ Steam Patch Steam Patch is a tool designed to enhance your Steam experience by applying patches to the Steam client. diff --git a/install.sh b/install.sh old mode 100644 new mode 100755 index 3b11b55..94421ca --- a/install.sh +++ b/install.sh @@ -1,17 +1,13 @@ #!/bin/sh -[ "$UID" -eq 0 ] || exec sudo "$0" "$@" +WORKING_FOLDER="${HOME}/steam-patch" -echo "Installing Steam Patch release..." - -USER_DIR="$(getent passwd $SUDO_USER | cut -d: -f6)" -WORKING_FOLDER="${USER_DIR}/steam-patch" - -# Create folder structure -mkdir "${WORKING_FOLDER}" -# Enable CEF debugging -touch "${USER_DIR}/.steam/steam/.cef-enable-remote-debugging" +if [ ! -d "${WORKING_FOLDER}" ]; then + mkdir -p "${WORKING_FOLDER}" + echo "Created ${WORKING_FOLDER}..." +fi +echo "Downloading Steam Patch..." # Download latest release and install it RELEASE=$(curl -s 'https://api.github.com/repos/Maclay74/steam-patch/releases' | jq -r "first(.[] | select(.prerelease == "false"))") VERSION=$(jq -r '.tag_name' <<< ${RELEASE} ) @@ -21,12 +17,13 @@ printf "Installing version %s...\n" "${VERSION}" curl -L $DOWNLOAD_URL --output ${WORKING_FOLDER}/steam-patch chmod +x ${WORKING_FOLDER}/steam-patch +echo "Enabling Steam Debugging..." +touch "${HOME}/.steam/steam/.cef-enable-remote-debugging" + +echo "Creating systemd service..." systemctl --user stop steam-patch 2> /dev/null systemctl --user disable steam-patch 2> /dev/null -systemctl stop steam-patch 2> /dev/null -systemctl disable steam-patch 2> /dev/null - # Add new service file cat > "${WORKING_FOLDER}/steam-patch.service" <<- EOM [Unit] @@ -36,18 +33,35 @@ After=network.target [Service] Type=simple -User=root -ExecStart=${WORKING_FOLDER}/steam-patch --user=${SUDO_USER} +ExecStart=${WORKING_FOLDER}/steam-patch WorkingDirectory=${WORKING_FOLDER} +Restart=always [Install] -WantedBy=multi-user.target +WantedBy=default.target EOM -rm -f "/etc/systemd/system/steam-patch.service" -cp "${WORKING_FOLDER}/steam-patch.service" "/etc/systemd/system/steam-patch.service" +rm -f "${HOME}/.config/systemd/user/steam-patch.service" +cp "${WORKING_FOLDER}/steam-patch.service" "${HOME}/.config/systemd/user/steam-patch.service" # Run service -systemctl daemon-reload -systemctl enable steam-patch.service -systemctl start steam-patch.service \ No newline at end of file +systemctl --user daemon-reload +systemctl --user enable steam-patch.service 2> /dev/null +systemctl --user start steam-patch.service 2> /dev/null + +echo "Disabling Steam file protection..." + +CONFIG_FILE="${HOME}/.config/environment.d/gamescope-session-plus.conf" +if [ ! -f "${CONFIG_FILE}" ]; then + echo "File does not exist. Creating ${CONFIG_FILE}..." + mkdir -p "$(dirname "${CONFIG_FILE}")" # Ensure parent directory exists + touch "${CONFIG_FILE}" +fi + +if grep -q "^CLIENTCMD" "${CONFIG_FILE}"; then + echo "Steam command is already overwritten for the session" +else + printf "# Disable steam file protection\n" >> "${CONFIG_FILE}" + echo 'CLIENTCMD="steam -noverifyfiles -norepairfiles -gamepadui -steamos3 -steampal -steamdeck"' >> "${CONFIG_FILE}" + echo "Steam file protection was disabled" +fi \ No newline at end of file diff --git a/src/devices/device_ally.rs b/src/devices/device_ally.rs deleted file mode 100644 index bec0433..0000000 --- a/src/devices/device_ally.rs +++ /dev/null @@ -1,142 +0,0 @@ -use super::Device; -use crate::devices::device_generic::DeviceGeneric; -use crate::devices::Patch; -use crate::patch::PatchFile; -use crate::server::SettingsRequest; -use crate::steam::SteamClient; -use std::fs; -use std::thread; -use std::time::Duration; - -pub struct DeviceAlly { - device: DeviceGeneric, -} - -impl DeviceAlly { - pub fn new() -> Self { - DeviceAlly { - device: DeviceGeneric::new(30), - } - } -} - -impl Device for DeviceAlly { - fn update_settings(&self, request: SettingsRequest) { - if let Some(per_app) = &request.per_app { - // TDP changes - if let Some(tdp) = per_app.tdp_limit { - self.set_tdp(tdp); - } - } - } - - fn get_patches(&self) -> Vec { - let mut patches = self.device.get_patches(); - patches.push(Patch { - text_to_find: String::from("this.m_rgControllers=new Map,\"undefined\"!=typeof SteamClient&&(this.m_hUnregisterControllerDigitalInput"), - replacement_text: String::from("this.m_rgControllers=new Map; window.HandleSystemKeyEvents = this.HandleSystemKeyEvents; \"undefined\"!=typeof SteamClient&&(this.m_hUnregisterControllerDigitalInput"), - destination: PatchFile::Library, - }); - patches - } - - fn set_tdp(&self, tdp: i8) { - // Update thermal policy - let thermal_policy = match tdp { - val if val < 12 => 2, // silent - val if (12..=25).contains(&val) => 0, // performance - _ => 1, // turbo - }; - - println!("New Policy: {}", thermal_policy); - - let file_path = "/sys/devices/platform/asus-nb-wmi/throttle_thermal_policy"; - let _ = thread::spawn(move || match fs::read_to_string(file_path) { - Ok(content) if content.trim() != thermal_policy.to_string() => { - thread::sleep(Duration::from_millis(50)); - fs::write(file_path, thermal_policy.to_string()) - .expect("Couldn't change thermal policy") - } - _ => {} - }); - - self.device.set_tdp(tdp); - } - - fn get_key_mapper(&self) -> Option> { - tokio::spawn(async move { - let mut steam = SteamClient::new(); - steam.connect().await; - start_mapper(steam); - }); - None - } -} - -pub fn pick_device() -> Option { - let target_vendor_id = 0xb05u16; - let target_product_id = 0x1abeu16; - - let devices = evdev::enumerate(); - for (_, device) in devices { - let input_id = device.input_id(); - - if input_id.vendor() == target_vendor_id && input_id.product() == target_product_id { - if device.supported_keys().map_or(false, |keys| keys.contains(evdev::Key::KEY_PROG1)) { - return Some(device); - } - } - } - - None -} - -pub fn start_mapper(mut steam:SteamClient) -> Option> { - let device = pick_device(); - - match device { - Some(device) => Some(tokio::spawn(async move { - if let Ok(mut events) = device.into_event_stream() { - loop { - match events.next_event().await { - Ok(event) => { - if let evdev::InputEventKind::Key(key) = event.kind() { - // QAM button pressed - if key == evdev::Key::KEY_PROG1 && event.value() == 0 { - println!("Show QAM"); - steam - .execute("window.HandleSystemKeyEvents({eKey: 1})") - .await; - } - - // Main menu button pressed - if key == evdev::Key::KEY_F16 && event.value() == 0 { - println!("Show Menu"); - steam - .execute("window.HandleSystemKeyEvents({eKey: 0})") - .await; - } - } - }, - Err(_) => { - print!("Error reading event stream, retrying in 1 second"); - thread::sleep(Duration::from_secs(1)); - tokio::spawn(async move { - start_mapper(steam) - }); - break - } - }; - } - } - })), - None => { - println!("No Ally-specific found, retrying in 2 seconds"); - thread::sleep(Duration::from_secs(2)); - tokio::spawn(async move { - start_mapper(steam) - }); - None - } - } -} diff --git a/src/devices/device_generic.rs b/src/devices/device_generic.rs deleted file mode 100644 index 56e0459..0000000 --- a/src/devices/device_generic.rs +++ /dev/null @@ -1,77 +0,0 @@ -use super::Device; -use crate::devices::Patch; -use crate::patch::PatchFile; -use crate::server::SettingsRequest; -use crate::utils; - -pub struct DeviceGeneric { - max_tdp: i8, -} - -impl DeviceGeneric { - pub fn new(max_tdp: i8) -> DeviceGeneric { - DeviceGeneric { max_tdp } - } -} - -impl Device for DeviceGeneric { - fn update_settings(&self, request: SettingsRequest) { - if let Some(per_app) = &request.per_app { - // TDP changes - if let Some(tdp) = per_app.tdp_limit { - self.set_tdp(tdp); - } - } - } - - fn set_tdp(&self, tdp: i8) { - // Update TDP - let target_tdp = tdp as i32 * 1000; - let boost_tdp = target_tdp + 2000; - - let command = [ - "ryzenadj", - &format!("--stapm-limit={}", target_tdp), - &format!("--fast-limit={}", boost_tdp), - &format!("--slow-limit={}", target_tdp), - ]; - match utils::run_command(&command) { - Ok(_) => println!("Set TDP successfully!"), - Err(_) => println!("Couldn't set TDP"), - } - } - - fn get_patches(&self) -> Vec { - vec![ - // Max TDP = 28 - Patch { - text_to_find: "return[o,t,n,e=>r((()=>g.Get().SetTDPLimit(e)))".to_string(), - replacement_text: format!("return[o,t,{:?},e=>r((()=>g.Get().SetTDPLimit(e)))", self.max_tdp).to_string(), - destination: PatchFile::Chunk, - }, - // Listen to TDP changes - Patch { - text_to_find: "const t=c.Hm.deserializeBinary(e).toObject();Object.keys(t)".to_string(), - replacement_text: "const t=c.Hm.deserializeBinary(e).toObject(); console.log(t); fetch(`http://localhost:1338/update_settings`, { method: 'POST', headers: {'Content-Type': 'application/json'}, body: JSON.stringify(t.settings)}); Object.keys(t)".to_string(), - destination: PatchFile::Chunk, - }, - // Replace Xbox menu button with Steam one - Patch { - text_to_find: "/steaminputglyphs/xbox_button_logo.svg".to_string(), - replacement_text: "/steaminputglyphs/sc_button_steam.svg".to_string(), - destination: PatchFile::Chunk, - }, - - // Change resolution to Native (if Default) after installation - Patch { - text_to_find: "DownloadComplete_Title\"),i=Ve(n,t.data.appid());const l=(0,H.Q2)();".to_string(), - replacement_text: "DownloadComplete_Title\"),i=Ve(n,t.data.appid()); SteamClient.Apps.GetResolutionOverrideForApp(t.data.appid()).then(res => res === \"Default\" && SteamClient.Apps.SetAppResolutionOverride(t.data.appid(), \"Native\")); const l=(0,H.Q2)();".to_string(), - destination: PatchFile::Chunk, - }, - ] - } - - fn get_key_mapper(&self) -> Option> { - None - } -} diff --git a/src/devices/mod.rs b/src/devices/mod.rs deleted file mode 100644 index 8b9d826..0000000 --- a/src/devices/mod.rs +++ /dev/null @@ -1,83 +0,0 @@ -pub mod device_ally; -pub mod device_generic; - -use crate::{patch::Patch, server::SettingsRequest}; -use device_ally::DeviceAlly; -use device_generic::DeviceGeneric; -use regex::Regex; -use std::fs; - -pub trait Device { - fn update_settings(&self, request: SettingsRequest); - fn set_tdp(&self, tdp: i8); - fn get_patches(&self) -> Vec; - fn get_key_mapper(&self) -> Option>; -} - -pub fn create_device() -> Option> { - match get_device_name() { - Some(device_name) => { - match device_name.trim() { - // Asus Rog Ally - "AMD Ryzen Z1 Extreme ASUSTeK COMPUTER INC. RC71L" => { - Some(Box::new(DeviceAlly::new())) - } - - // Ayaneo 2 - "AMD Ryzen 7 6800U with Radeon Graphics AYANEO AYANEO 2" => { - Some(Box::new(DeviceGeneric::new(28))) - } - - // Ayaneo Geek - "AMD Ryzen 7 6800U with Radeon Graphics AYANEO GEEK" => { - Some(Box::new(DeviceGeneric::new(28))) - } - - // Ayaneo 2S - "AMD Ryzen 7 7840U w/ Radeon 780M Graphics AYANEO AYANEO 2S" => { - Some(Box::new(DeviceGeneric::new(30))) - } - - // Ayaneo Geek 1S - "AMD Ryzen 7 7840U w/ Radeon 780M Graphics AYANEO GEEK 1S" => { - Some(Box::new(DeviceGeneric::new(30))) - } - - // GPD WM2 - "AMD Ryzen 7 6800U with Radeon Graphics GPD G1619-04" => { - Some(Box::new(DeviceGeneric::new(28))) - } - - // AOKZOE A1 - "AMD Ryzen 7 6800U with Radeon Graphics AOKZOE AOKZOE A1 AR07" => { - Some(Box::new(DeviceGeneric::new(28))) - } - - // Any other device - _ => Some(Box::new(DeviceGeneric::new(25))), - } - } - None => None, - } -} - -fn get_device_name() -> Option { - let cpuinfo = fs::read_to_string("/proc/cpuinfo").expect("Unknown"); - - let model_re = Regex::new(r"model name\s*:\s*(.*)").unwrap(); - let model = model_re.captures_iter(&cpuinfo).next().unwrap()[1] - .trim() - .to_string(); - - let board_vendor = match fs::read_to_string("/sys/devices/virtual/dmi/id/board_vendor") { - Ok(str) => str.trim().to_string(), - Err(_) => return None, - }; - - let board_name = match fs::read_to_string("/sys/devices/virtual/dmi/id/board_name") { - Ok(str) => str.trim().to_string(), - Err(_) => return None, - }; - - Some(format!("{} {} {}", model, board_vendor, board_name)) -} diff --git a/src/main.rs b/src/main.rs index 0fcc0c5..52e06b2 100644 --- a/src/main.rs +++ b/src/main.rs @@ -1,27 +1,27 @@ -use crate::devices::create_device; +use crate::powerstation::PowerStation; +use crate::steam::Steam; +use futures::join; +use std::sync::Arc; -mod devices; mod patch; -mod server; +mod powerstation; mod steam; -mod utils; +mod web_server; #[tokio::main] async fn main() { - let mut tasks = vec![]; + let steam = Steam; - tasks.push(tokio::spawn(server::run())); + let chunk_path = steam.get_chunk_file().unwrap(); - if let Some(device) = create_device() { - println!("Device created"); - if let Some(mapper) = device.get_key_mapper() { - tasks.push(mapper); - } - } + patch::patch(chunk_path).await; - if let Some(steam) = steam::SteamClient::watch().await { - tasks.push(steam); - } + let power_station = PowerStation::new().await.unwrap(); + let power_station = Arc::new(power_station); - let _ = futures::future::join_all(tasks).await; + join!( + //power_station.listen_gpu_profile(), + //power_station.listen_tdp(), + web_server::web_server(Arc::clone(&power_station)), + ); } diff --git a/src/patch.rs b/src/patch.rs index d3ccfcd..142efc8 100644 --- a/src/patch.rs +++ b/src/patch.rs @@ -1,64 +1,30 @@ -use regex::Regex; - -use crate::utils::get_username; -use std::{fs, path::PathBuf}; +use regex::{Captures, Regex}; +use std::fs; +use std::path::PathBuf; pub struct Patch { - pub text_to_find: String, - pub replacement_text: String, - pub destination: PatchFile, -} - -pub enum PatchFile { - Chunk, - Library, -} - -impl PatchFile { - pub fn get_regex(&self) -> &str { - match self { - PatchFile::Chunk => "^chunk", - PatchFile::Library => "^library", - } - } + pub regex: Regex, + pub handler: Box Option<(String, String)>>, } -impl PatchFile { - pub fn get_file(&self) -> Option { - let username = get_username(); - let steamui_path = dirs::home_dir() - .map(|home| home.join(format!("/home/{}/.local/share/Steam/steamui", username))); +mod tdp_slider; - let steamui_path = match steamui_path { - Some(path) => path, - None => return None, - }; +pub async fn patch(chunk: PathBuf) { + let patch_item = tdp_slider::get_patch(); - if !steamui_path.exists() { - return None; - } + let mut content = fs::read_to_string(&chunk).unwrap(); - let regex = Regex::new(self.get_regex()).unwrap(); - let matching_files: Vec<_> = match fs::read_dir(&steamui_path).ok() { - Some(dir) => dir - .filter_map(|entry| { - let entry = entry.ok()?; - let file_name = entry.file_name(); - if regex.is_match(file_name.to_str().unwrap()) { - Some(entry) - } else { - None - } - }) - .collect(), - None => return None, - }; + if let Some(captures) = patch_item.regex.captures(&content) { + let patch = (patch_item.handler)(&captures); - if matching_files.is_empty() || matching_files.len() > 1 { - return None; + if let Some((from, to)) = patch { + content = content.replace(&from, &to); + } else { + println!("Couldn't patch - text entry not found"); } - let first_matching_file = matching_files[0].file_name(); - Some(steamui_path.join(first_matching_file)) + fs::write(chunk, content).unwrap(); + } else { + println!("Couldn't patch - text entry not found"); } } diff --git a/src/patch/tdp_slider.rs b/src/patch/tdp_slider.rs new file mode 100644 index 0000000..3cf2453 --- /dev/null +++ b/src/patch/tdp_slider.rs @@ -0,0 +1,75 @@ +use crate::patch::Patch; +use regex::Regex; + +/** + This patch replaces TDP slider with power profile slider. +*/ + +fn get_js_code(react: &str, translations: &str) -> String { + format!(r#" + const [options, setOptions] = {0}.useState([]); + const [value, setValue] = {0}.useState(undefined); + + {0}.useEffect(() => {{ + fetch("http://localhost:1338/settings") + .then(response => response.json()) + .then(settings => {{ + setOptions(settings.power_profiles.map((name, index) => ({{ + notchIndex: index, + label: name, + value: name + }}))) + setValue(settings.power_profiles.indexOf(settings.power_profile)); + }}) + }}, []); + + const onChange = (newValue) => {{ + setValue(newValue); + fetch("http://localhost:1338/settings", {{ + headers: {{ + 'Content-Type': 'application/json' + }}, + method: "POST", + body: JSON.stringify({{power_profile: options[newValue]?.value}}) + }}) + }} + + if (value === undefined) return null; + + return {0}.createElement(i.d3, {{ + info: {{visible: true, min: 0, max: options.length - 1}}, + available: true, + label: "Performance Mode", + explainer: {1}("\#QuickAccess_Tab_Perf_TDPLimit_Explainer"), + value: value, + layout: "below", + onChange: onChange, + min: 0, + max: options.length - 1, + step: 1, + bottomSeparator: "standard", + notchCount: options.length, + notchLabels: options, + notchTicksVisible: false, + }}) + "#, react, translations) +} + +pub fn get_patch() -> Patch { + Patch { + regex: Regex::new(r#"(const \w{1,2}=\(\d{1,2},\w{1,2}.\w{1,2}\)\(\);return (\w{1,2})\.createElement\(\w{1,2}\.\w{1,2},\{setting:"steamos_tdp_limit".*?explainerTitle:(\(.*?\)).*?}\))"#).unwrap(), + handler: Box::new(|captures| { + let method = captures.get(1).map_or("", |m| m.as_str()); + let react = captures.get(2).map_or("", |m| m.as_str()); + let translations = captures.get(3).map_or("", |m| m.as_str()); + + if method.is_empty() { + return None; + } + + println!("Patched TDP slider"); + + Some((method.to_string(), get_js_code(&react, &translations))) + }), + } +} diff --git a/src/powerstation.rs b/src/powerstation.rs new file mode 100644 index 0000000..6baabf1 --- /dev/null +++ b/src/powerstation.rs @@ -0,0 +1,77 @@ +use zbus::export::futures_util::StreamExt; +use zbus::{proxy, Connection, Result}; + +#[proxy( + default_service = "org.shadowblip.PowerStation", + default_path = "/org/shadowblip/Performance/GPU/card1", + interface = "org.shadowblip.GPU.Card.TDP" +)] +trait GPU { + #[zbus(property)] + fn power_profiles_avaialable(&self) -> Result>; // typo in powerstation interface :c + + #[zbus(property, signal)] + fn power_profile(&self) -> Result; + + #[zbus(property)] + fn set_power_profile(&self, new_profile: &str) -> Result<()>; + + #[zbus(property, signal)] + fn t_d_p(&self) -> Result; + + #[zbus(property)] + fn set_t_d_p(&self, value: f64) -> Result<()>; +} + +pub struct PowerStation { + proxy: GPUProxy<'static>, +} + +impl PowerStation { + pub async fn new() -> Result { + let connection = Connection::system().await?; + let proxy = GPUProxy::new(&connection).await?; + Ok(PowerStation { proxy }) + } + + pub async fn get_gpu_profiles(&self) -> Result> { + self.proxy.power_profiles_avaialable().await + } + + pub async fn get_gpu_profile(&self) -> Result { + self.proxy.power_profile().await + } + + pub async fn set_gpu_profile(&self, new_profile: &str) -> Result<()> { + self.proxy.set_power_profile(new_profile).await + } + + pub async fn get_tdp(&self) -> Result { + let tdp = self.proxy.t_d_p().await?; + Ok(tdp.round() as u8) + } + + pub async fn set_tdp(&self, value: u8) -> Result<()> { + self.proxy.set_t_d_p(value as f64).await + } + + pub async fn listen_gpu_profile(&self) { + let mut profile_changed = self.proxy.receive_power_profile_changed().await; + + while let Some(_signal) = profile_changed.next().await { + //let args = signal.get().await.unwrap(); + //println!("Power profile changed to `{:?}`", args); + todo!(); + } + } + + pub async fn listen_tdp(&self) { + let mut tdp_changed = self.proxy.receive_t_d_p_changed().await; + + while let Some(_signal) = tdp_changed.next().await { + //let args = signal.get().await.unwrap().round() as u8; + //println!("TDP changed to `{:?}`", args); + todo!(); + } + } +} diff --git a/src/server.rs b/src/server.rs deleted file mode 100644 index f38b046..0000000 --- a/src/server.rs +++ /dev/null @@ -1,78 +0,0 @@ -use hyper::http::HeaderValue; -use hyper::service::{make_service_fn, service_fn}; -use hyper::Request; -use hyper::{body, Body, Method, Response, Server}; -use serde::Deserialize; -use std::convert::Infallible; - -use crate::devices::create_device; - -#[derive(Deserialize)] -pub struct SettingsRequest { - pub per_app: Option, -} - -#[derive(Deserialize)] -pub struct PerAppConfig { - pub tdp_limit: Option, -} - -async fn update_settings(req: Request) -> Result, Infallible> { - // Convert the request body into bytes - let bytes = body::to_bytes(req.into_body()) - .await - .map_err(|_| Response::new(Body::from("Internal server error"))) - .unwrap(); - - // Parse the bytes into a SettingsRequest - let settings_request: SettingsRequest = serde_json::from_slice(&bytes) - .map_err(|_| Response::new(Body::from("Failed to deserialize request body"))) - .unwrap(); - - if let Some(device) = create_device() { - device.update_settings(settings_request); - } - - Ok(Response::new(Body::from("Settings updated"))) -} - -fn set_cors_headers(mut response: Response) -> Response { - let headers = response.headers_mut(); - - headers.insert("Access-Control-Allow-Origin", HeaderValue::from_static("*")); - headers.insert( - "Access-Control-Allow-Methods", - HeaderValue::from_static("GET, POST, PUT, DELETE, OPTIONS"), - ); - headers.insert( - "Access-Control-Allow-Headers", - HeaderValue::from_static("*"), - ); - - response -} - -async fn router(req: Request) -> Result, Infallible> { - let path = req.uri().path(); // Get the path of the request - - let response = match (req.method(), path) { - (&Method::POST, "/update_settings") => update_settings(req).await, - _ => Ok(Response::new(Body::empty())), - }; - - Ok(set_cors_headers(response?)) -} - -pub async fn run() { - let make_svc = make_service_fn(|_conn| async { Ok::<_, Infallible>(service_fn(router)) }); - - let addr = ([127, 0, 0, 1], 1338).into(); - - let server = Server::bind(&addr).serve(make_svc); - - println!("Server started"); - - if let Err(e) = server.await { - eprintln!("Server error: {}", e); - } -} diff --git a/src/steam.rs b/src/steam.rs index 6a676f8..884dd97 100644 --- a/src/steam.rs +++ b/src/steam.rs @@ -1,242 +1,43 @@ -#![allow(non_snake_case)] // Allow non-snake_case identifiers - -use crate::devices::create_device; -use crate::patch::Patch; -use crate::utils::get_username; -use hyper::{Client, Uri}; -use inotify::{Inotify, WatchMask}; -use serde::Deserialize; -use std::collections::HashMap; -use std::fs::{self, File}; -use std::io::{BufRead, BufReader, Error}; +use dirs::data_local_dir; +use glob::glob; +use std::fs; use std::path::PathBuf; -use sysinfo::{ProcessExt, SystemExt}; -use tokio::time::{sleep, Duration}; -use tungstenite::connect; -use tungstenite::stream::MaybeTlsStream; -use tungstenite::{Message, WebSocket}; - -#[derive(Deserialize)] -struct Tab { - title: String, - webSocketDebuggerUrl: String, -} - -pub struct SteamClient { - socket: Option>>, -} - -impl SteamClient { - pub fn patch(&mut self, patches: Vec) -> Result<(), Error> { - let mut opened_files: HashMap = HashMap::new(); - - for patch in patches { - let path_file = patch.destination.get_file().unwrap(); - let path_str = path_file.to_str().unwrap().to_string(); - let content = opened_files - .entry(path_str.clone()) - .or_insert_with(|| fs::read_to_string(&path_file).unwrap()); - let text_to_find = &patch.text_to_find; - let replacement_text = &patch.replacement_text; - *content = content.replace(text_to_find, replacement_text); - } - - for (path, content) in &opened_files { - fs::write(path, content)?; - } - - Ok(()) - } - - pub fn unpatch(&mut self, patches: Vec) -> Result<(), Error> { - let mut opened_files: HashMap = HashMap::new(); - - for patch in patches { - let path_file = patch.destination.get_file().unwrap(); - let path_str = path_file.to_str().unwrap().to_string(); - let content = opened_files - .entry(path_str.clone()) - .or_insert_with(|| fs::read_to_string(&path_file).unwrap()); - let text_to_find = &patch.text_to_find; - let replacement_text = &patch.replacement_text; - *content = content.replace(replacement_text, text_to_find); - } - - for (path, content) in &opened_files { - fs::write(path, content)?; - } - - Ok(()) - } - - async fn send_message(&mut self, message: serde_json::Value) { - let mut retries = 3; - - while retries > 0 { - match self.socket.as_mut() { - Some(socket) => match socket.send(Message::Text(message.to_string())) { - Ok(_) => break, - Err(_) => { - eprintln!("Couldn't send message to Steam, retrying..."); - - self.connect().await; - - retries -= 1; - } - }, - None => { - self.connect().await; - retries -= 1; - } - } - } - } - - pub async fn reboot(&mut self) { - self.send_message(serde_json::json!({ - "id": 1, - "method": "Page.reload", - })) - .await; - } - - pub async fn execute(&mut self, js_code: &str) { - self.send_message(serde_json::json!({ - "id": 1, - "method": "Runtime.evaluate", - "params": { - "expression": js_code, - } - })) - .await; - } +use sysinfo; - async fn get_context() -> Option { - println!("Getting Steam..."); +pub struct Steam; - let client = Client::new(); - let start_time = tokio::time::Instant::now(); - let uri: Uri = "http://localhost:8080/json".parse().unwrap(); - - loop { - if start_time.elapsed() > Duration::from_secs(60) { - println!("Timeout while trying to fetch Steam data!"); - return None; - } +impl Steam { + pub fn is_running(&self) -> bool { + let mut sys = sysinfo::System::new_all(); - match client.get(uri.clone()).await { - Ok(response) => { - let bytes = hyper::body::to_bytes(response.into_body()).await.unwrap(); - let tabs: Vec = - serde_json::from_slice(&bytes).unwrap_or_else(|_| Vec::new()); - if let Some(tab) = tabs.into_iter().find(|tab| { - tab.title == "SharedJSContext" && !tab.webSocketDebuggerUrl.is_empty() - }) { - return Some(tab.webSocketDebuggerUrl); - } - } - Err(_) => println!("Couldn't connect to Steam"), - } + sys.refresh_all(); - sleep(Duration::from_millis(50)).await; - } + sys.processes().values().any(|p| p.name() == "steam") } - pub fn new() -> SteamClient { - return SteamClient { socket: None }; - } + pub fn get_ui_folder(&self) -> Option { + let share_dir = data_local_dir()?; + let steam_dir = share_dir.join("Steam/steamui"); - pub async fn connect(&mut self) { - if let Some(context) = Self::get_context().await { - self.socket = match connect(context) { - Ok((socket, _)) => Some(socket), - Err(_) => None, - }; + if !steam_dir.is_dir() { + return None; } - } - pub fn get_log_path() -> Option { - let username = get_username(); - dirs::home_dir().map(|home| { - home.join(format!( - "/home/{}/.local/share/Steam/logs/bootstrap_log.txt", - username - )) - }) + Some(steam_dir) } - pub async fn watch() -> Option> { - // If Steam client is already running, patch it and restart - if Self::is_running() { - let mut client = Self::new(); - client.connect().await; + pub fn get_chunk_file(&self) -> Option { + let folder = self.get_ui_folder()?; + let pattern = folder.join("chunk*"); + let threshold = 1_048_576; + let entries = glob(&pattern.to_str()?).unwrap(); - if let Some(device) = create_device() { - match client.patch(device.get_patches()) { - Ok(_) => println!("Steam patched"), - Err(_) => eprintln!("Couldn't patch Steam"), - } + for entry in entries { + let path = entry.unwrap(); + if fs::metadata(&path).unwrap().len() > threshold { + return Some(path); } - - client.reboot().await; } - - // Watch for changes in log - let mut inotify = Inotify::init().expect("Failed to initialize inotify"); - - if let Some(log_path) = Self::get_log_path() { - inotify.watches().add(log_path, WatchMask::MODIFY).unwrap(); - } - - println!("Watching Steam log..."); - let task = tokio::task::spawn_blocking(move || { - let mut buffer = [0u8; 4096]; - let mut client = Self::new(); - loop { - if let Ok(events) = inotify.read_events_blocking(&mut buffer) { - for _ in events { - let file = File::open(Self::get_log_path().unwrap()).unwrap(); - let reader = BufReader::new(file); - - match reader.lines().last() { - Some(Ok(line)) => { - if line.contains("Verification complete") { - if let Some(device) = create_device() { - match client.patch(device.get_patches()) { - Ok(_) => println!("Steam patched"), - Err(_) => eprintln!("Couldn't patch Steam"), - } - } - } - - if line.contains("Shutdown") { - if let Some(device) = create_device() { - match client.unpatch(device.get_patches()) { - Ok(_) => println!("Steam unpatched"), - Err(_) => eprintln!("Couldn't unpatch Steam"), - } - } - } - } - Some(Err(err)) => println!("Error reading line: {}", err), - None => println!("The file is empty"), - } - } - } - } - }); - - Some(task) - } - - fn is_running() -> bool { - let mut sys = sysinfo::System::new_all(); - - // We need to update the system value to get the fresh process list - sys.refresh_all(); - - sys.processes() - .values() - .any(|process| process.name() == "steam") + None } } diff --git a/src/utils.rs b/src/utils.rs deleted file mode 100644 index 153a028..0000000 --- a/src/utils.rs +++ /dev/null @@ -1,45 +0,0 @@ -use std::env; -use std::io; -use std::process::{Command, Output}; -use sysinfo::{ProcessExt, SystemExt}; - -#[allow(dead_code)] -pub fn run_command(command: &[&str]) -> io::Result { - let child = Command::new(command[0]) - .args(&command[1..]) - .stdout(std::process::Stdio::piped()) - .spawn()?; - - let output = child.wait_with_output()?; - Ok(output) -} - -#[allow(dead_code)] -pub fn get_username() -> String { - let args: Vec = env::args().collect(); - - if args.len() != 2 { - return String::from("gamer"); - } - - let arg = &args[1]; - - if arg.starts_with("--user=") { - let username = arg.trim_start_matches("--user="); - String::from(username) - } else { - String::from("gamer") - } -} - -#[allow(dead_code)] -fn is_steam_running() -> bool { - let mut sys = sysinfo::System::new_all(); - - // We need to update the system value to get the fresh process list - sys.refresh_all(); - - sys.processes() - .values() - .any(|process| process.name() == "steam") -} diff --git a/src/web_server.rs b/src/web_server.rs new file mode 100644 index 0000000..2afb1d2 --- /dev/null +++ b/src/web_server.rs @@ -0,0 +1,94 @@ +use crate::powerstation::PowerStation; +use axum::{extract::State, http::StatusCode, response::Json, routing::get, routing::post, Router}; +use serde::{Deserialize, Serialize}; +use std::sync::Arc; +use tower_http::cors::{Any, CorsLayer}; + +const MAX_TDP: u8 = 30; +const MIN_TDP: u8 = 8; + +#[derive(Serialize)] +struct SettingsResponse { + tdp: u8, + tdp_limits: (u8, u8), + power_profile: String, + power_profiles: Vec, +} + +#[derive(Deserialize, Serialize)] +struct SettingsRequest { + tdp: Option, + power_profile: String, +} + +pub async fn web_server(power_station: Arc) { + let cors = CorsLayer::new() + .allow_origin(Any) // Allow any origin + .allow_headers(Any) + .allow_methods(Any); // Allow specific methods + + let app = Router::new() + .route("/settings", get(get_settings)) + .route("/settings", post(set_settings)) + .layer(cors) + .with_state(power_station); + + let listener = tokio::net::TcpListener::bind("0.0.0.0:1338").await.unwrap(); + println!("Starting web server"); + axum::serve(listener, app).await.unwrap(); +} + +async fn get_settings(State(power_station): State>) -> Json { + Json(SettingsResponse { + tdp: power_station.get_tdp().await.unwrap(), + tdp_limits: (MIN_TDP, MAX_TDP), + power_profile: power_station.get_gpu_profile().await.unwrap(), + power_profiles: power_station.get_gpu_profiles().await.unwrap(), + }) +} + +async fn set_settings( + State(power_station): State>, + request: Json, +) -> Result, StatusCode> { + let available_profiles = power_station.get_gpu_profiles().await.unwrap(); + + if !available_profiles.contains(&request.power_profile) { + return Err(StatusCode::INTERNAL_SERVER_ERROR); + } + + // Set TDP from request or based on power profile selected + if let Some(tdp_value) = request.tdp { + if tdp_value > MAX_TDP || tdp_value < MIN_TDP { + return Err(StatusCode::INTERNAL_SERVER_ERROR); + } + power_station.set_tdp(tdp_value).await.unwrap(); + } else { + let tdp_values = get_tdp_for_profiles(&available_profiles, MIN_TDP, MAX_TDP); + let power_profile_index = available_profiles.iter().position(|r| *r == request.power_profile).unwrap(); + power_station.set_tdp(tdp_values[power_profile_index]).await.unwrap(); + } + + power_station + .set_gpu_profile(&request.power_profile) + .await + .unwrap(); + + Ok(Json(true)) +} + +fn get_tdp_for_profiles(vec: &Vec, min_value: u8, max_value: u8) -> Vec { + let len = vec.len(); + if len == 0 { + return vec![]; + } + + vec.iter() + .enumerate() + .map(|(index, _)| { + let proportion = index as f64 / (len - 1).max(1) as f64; + // Map the proportion to the desired range [min_value, max_value] + (proportion * (max_value - min_value) as f64 + min_value as f64).round() as u8 + }) + .collect() +} \ No newline at end of file diff --git a/uninstall.sh b/uninstall.sh old mode 100644 new mode 100755 index 3261a81..600c520 --- a/uninstall.sh +++ b/uninstall.sh @@ -1,19 +1,13 @@ #!/bin/sh -[ "$UID" -eq 0 ] || exec sudo "$0" "$@" - echo "Uninstalling Steam Patch..." -USER_DIR="$(getent passwd $SUDO_USER | cut -d: -f6)" -WORKING_FOLDER="${USER_DIR}/steam-patch" +WORKING_FOLDER="${HOME}/steam-patch" # Disable and remove services -sudo systemctl disable --now steam-patch > /dev/null -sudo rm -f "${USER_DIR}/.config/systemd/user/steam-patch.service" -sudo rm -f "/etc/systemd/system/steam-patch.service" - -# Remove temporary folder if it exists from the install process -rm -rf "/tmp/steam-patch" +systemctl --user stop steam-patch 2> /dev/null +systemctl --user disable --now steam-patch 2> /dev/null +rm -f "${HOME}/.config/systemd/user/steam-patch.service" # Cleanup services folder -sudo rm -rf "${WORKING_FOLDER}" +rm -rf "${WORKING_FOLDER}" \ No newline at end of file