Commonized networking (#3310)

* Fix not being able to connect to local friends socket

* Start basic work on tunneling protocol and move some code into a common crate

* Commonize message serialization logic

* Serialize Base62Ids as u64 when human-readability is not required

* Move ActiveSockets tuple into struct

* Make CI run when rust-common is updated

CI is currently broken for labrinth, however

* Fix theseus-release.yml to reference itself correctly

* Implement Labrinth side of tunneling

* Implement non-friend part of theseus tunneling

* Implement client-side except for socket loop

* Implement the socket loop

Doesn't work though. Debugging time!

* Fix config.rs

* Fix deadlock in labrinth socket handling

* Update dockerfile

* switch to workspace prepare at root level

* Wait for connection before tunneling in playground

* Move rust-common into labrinth

* Remove rust-common references from Actions

* Revert "Update dockerfile"

This reverts commit 3caad59bb474ce425d0b8928d7cee7ae1a5011bd.

* Fix Docker build

* Rebuild Theseus if common code changes

* Allow multiple connections from the same user

* Fix test building

* Move FriendSocketListening and FriendSocketStoppedListening to non-panicking TODO for now

* Make message_serialization macro take varargs for binary messages

* Improve syntax of message_serialization macro

* Remove the ability to connect to a virtual socket, and disable the ability to listen on one

* Allow the app to compile without running labrinth

* Clippy fix

* Update Rust and Clippy fix again

---------

Co-authored-by: Jai A <jaiagr+gpg@pm.me>
This commit is contained in:
Josiah Glosson
2025-02-28 12:52:47 -06:00
committed by GitHub
parent 90def724c2
commit 650ab71a83
72 changed files with 1132 additions and 584 deletions

64
Cargo.lock generated
View File

@@ -1204,7 +1204,7 @@ checksum = "d38f2da7a0a2c4ccf0065be06397cc26a81f4e528be095826eee9d4adbb8c60f"
dependencies = [
"byteorder",
"fnv",
"uuid 1.10.0",
"uuid 1.12.0",
]
[[package]]
@@ -1291,7 +1291,7 @@ dependencies = [
"time",
"tokio 1.42.0",
"url",
"uuid 1.10.0",
"uuid 1.12.0",
]
[[package]]
@@ -1995,7 +1995,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "bef552e6f588e446098f6ba40d89ac146c8c7b64aade83c051ee00bb5d2bc18d"
dependencies = [
"serde",
"uuid 1.10.0",
"uuid 1.12.0",
]
[[package]]
@@ -2511,7 +2511,7 @@ checksum = "887d93f60543e9a9362ef8a21beedd0a833c5d9610e18c67abe15a5963dcb1a4"
dependencies = [
"bit_field",
"flume",
"half",
"half 2.4.1",
"lebe",
"miniz_oxide 0.7.4",
"rayon-core",
@@ -3242,6 +3242,12 @@ dependencies = [
"tracing",
]
[[package]]
name = "half"
version = "1.8.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "1b43ede17f21864e81be2fa654110bf1e793774238d86ef8555c37e6519c0403"
[[package]]
name = "half"
version = "2.4.1"
@@ -4245,6 +4251,7 @@ dependencies = [
"deadpool-redis",
"derive-new",
"dotenvy",
"either",
"env_logger",
"flate2",
"futures 0.3.30",
@@ -4277,6 +4284,8 @@ dependencies = [
"sentry",
"sentry-actix",
"serde",
"serde_bytes",
"serde_cbor",
"serde_json",
"serde_with",
"sha1 0.6.1",
@@ -4290,7 +4299,7 @@ dependencies = [
"totp-rs",
"url",
"urlencoding",
"uuid 1.10.0",
"uuid 1.12.0",
"validator",
"webp",
"woothee",
@@ -4657,7 +4666,7 @@ dependencies = [
"serde_json",
"thiserror 1.0.64",
"time",
"uuid 1.10.0",
"uuid 1.12.0",
"wasm-bindgen-futures",
"web-sys",
"yaup",
@@ -6724,7 +6733,7 @@ dependencies = [
"rkyv_derive",
"seahash",
"tinyvec",
"uuid 1.10.0",
"uuid 1.12.0",
]
[[package]]
@@ -7108,7 +7117,7 @@ dependencies = [
"serde",
"serde_json",
"url",
"uuid 1.10.0",
"uuid 1.12.0",
]
[[package]]
@@ -7361,7 +7370,7 @@ dependencies = [
"thiserror 1.0.64",
"time",
"url",
"uuid 1.10.0",
"uuid 1.12.0",
]
[[package]]
@@ -7396,6 +7405,25 @@ dependencies = [
"xml-rs",
]
[[package]]
name = "serde_bytes"
version = "0.11.15"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "387cc504cb06bb40a96c8e04e951fe01854cf6bc921053c954e4a606d9675c6a"
dependencies = [
"serde",
]
[[package]]
name = "serde_cbor"
version = "0.11.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "2bef2ebfde456fb76bbcf9f59315333decc4fda0b2b44b420243c11e0f5ec1f5"
dependencies = [
"half 1.8.3",
"serde",
]
[[package]]
name = "serde_derive"
version = "1.0.210"
@@ -8536,7 +8564,7 @@ dependencies = [
"thiserror 2.0.7",
"time",
"url",
"uuid 1.10.0",
"uuid 1.12.0",
"walkdir",
]
@@ -8629,7 +8657,7 @@ dependencies = [
"thiserror 2.0.7",
"toml 0.8.19",
"url",
"uuid 1.10.0",
"uuid 1.12.0",
]
[[package]]
@@ -8810,7 +8838,7 @@ dependencies = [
"toml 0.8.19",
"url",
"urlpattern",
"uuid 1.10.0",
"uuid 1.12.0",
"walkdir",
]
@@ -8884,9 +8912,11 @@ dependencies = [
"dirs 5.0.1",
"discord-rich-presence",
"dunce",
"either",
"flate2",
"futures 0.3.30",
"indicatif",
"labrinth",
"lazy_static",
"notify",
"notify-debouncer-mini",
@@ -8913,7 +8943,7 @@ dependencies = [
"tracing-subscriber",
"url",
"urlencoding",
"uuid 1.10.0",
"uuid 1.12.0",
"whoami",
"winreg 0.52.0",
"zip 0.6.6",
@@ -8955,7 +8985,7 @@ dependencies = [
"tracing",
"tracing-error",
"url",
"uuid 1.10.0",
"uuid 1.12.0",
"window-shadows",
]
@@ -8974,7 +9004,7 @@ dependencies = [
"tracing-error",
"tracing-subscriber",
"url",
"uuid 1.10.0",
"uuid 1.12.0",
"webbrowser",
]
@@ -9819,9 +9849,9 @@ dependencies = [
[[package]]
name = "uuid"
version = "1.10.0"
version = "1.12.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "81dfa00651efa65069b0b6b651f4aaa31ba9e3c3ce0137aaad053604ee7e0314"
checksum = "744018581f9a3454a9e15beb8a33b017183f1e7c0cd170232a2d1453b23a51c4"
dependencies = [
"getrandom 0.2.15",
"rand 0.8.5",