diff --git a/.github/workflows/labrinth-docker.yml b/.github/workflows/labrinth-docker.yml index 6f4080254..1ed8e9685 100644 --- a/.github/workflows/labrinth-docker.yml +++ b/.github/workflows/labrinth-docker.yml @@ -38,8 +38,10 @@ jobs: - name: Build and push id: docker_build uses: docker/build-push-action@v2 + env: + SQLX_OFFLINE: true with: - context: ./apps/labrinth + file: ./apps/labrinth/Dockerfile push: ${{ github.event_name != 'pull_request' }} tags: ${{ steps.docker_meta.outputs.tags }} labels: ${{ steps.docker_meta.outputs.labels }} diff --git a/.github/workflows/theseus-release.yml b/.github/workflows/theseus-release.yml index 4cc9a98cd..a34f5ae17 100644 --- a/.github/workflows/theseus-release.yml +++ b/.github/workflows/theseus-release.yml @@ -6,9 +6,11 @@ on: tags: - 'v*' paths: - - .github/workflows/app-release.yml + - .github/workflows/theseus-release.yml - 'apps/app/**' - 'apps/app-frontend/**' + - 'apps/labrinth/src/common/**' + - 'apps/labrinth/Cargo.toml' - 'packages/app-lib/**' - 'packages/app-macros/**' - 'packages/assets/**' diff --git a/.idea/code.iml b/.idea/code.iml index 70105a514..a4489beac 100644 --- a/.idea/code.iml +++ b/.idea/code.iml @@ -10,9 +10,11 @@ + + - + \ No newline at end of file diff --git a/Cargo.lock b/Cargo.lock index 02385145a..fdce29426 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -426,6 +426,21 @@ dependencies = [ "password-hash 0.5.0", ] +[[package]] +name = "ariadne" +version = "0.1.0" +dependencies = [ + "chrono", + "either", + "rand 0.8.5", + "serde", + "serde_bytes", + "serde_cbor", + "serde_json", + "thiserror 1.0.64", + "uuid 1.12.0", +] + [[package]] name = "arrayvec" version = "0.7.6" @@ -1204,7 +1219,7 @@ checksum = "d38f2da7a0a2c4ccf0065be06397cc26a81f4e528be095826eee9d4adbb8c60f" dependencies = [ "byteorder", "fnv", - "uuid 1.10.0", + "uuid 1.12.0", ] [[package]] @@ -1291,7 +1306,7 @@ dependencies = [ "time", "tokio 1.42.0", "url", - "uuid 1.10.0", + "uuid 1.12.0", ] [[package]] @@ -1995,7 +2010,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 +2526,7 @@ checksum = "887d93f60543e9a9362ef8a21beedd0a833c5d9610e18c67abe15a5963dcb1a4" dependencies = [ "bit_field", "flume", - "half", + "half 2.4.1", "lebe", "miniz_oxide 0.7.4", "rayon-core", @@ -3242,6 +3257,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" @@ -4232,6 +4253,7 @@ dependencies = [ "actix-web-prom", "actix-ws", "argon2", + "ariadne", "async-stripe", "async-trait", "base64 0.21.7", @@ -4245,6 +4267,7 @@ dependencies = [ "deadpool-redis", "derive-new", "dotenvy", + "either", "env_logger", "flate2", "futures 0.3.30", @@ -4277,6 +4300,8 @@ dependencies = [ "sentry", "sentry-actix", "serde", + "serde_bytes", + "serde_cbor", "serde_json", "serde_with", "sha1 0.6.1", @@ -4290,7 +4315,7 @@ dependencies = [ "totp-rs", "url", "urlencoding", - "uuid 1.10.0", + "uuid 1.12.0", "validator", "webp", "woothee", @@ -4657,7 +4682,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 +6749,7 @@ dependencies = [ "rkyv_derive", "seahash", "tinyvec", - "uuid 1.10.0", + "uuid 1.12.0", ] [[package]] @@ -7108,7 +7133,7 @@ dependencies = [ "serde", "serde_json", "url", - "uuid 1.10.0", + "uuid 1.12.0", ] [[package]] @@ -7361,7 +7386,7 @@ dependencies = [ "thiserror 1.0.64", "time", "url", - "uuid 1.10.0", + "uuid 1.12.0", ] [[package]] @@ -7396,6 +7421,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 +8580,7 @@ dependencies = [ "thiserror 2.0.7", "time", "url", - "uuid 1.10.0", + "uuid 1.12.0", "walkdir", ] @@ -8629,7 +8673,7 @@ dependencies = [ "thiserror 2.0.7", "toml 0.8.19", "url", - "uuid 1.10.0", + "uuid 1.12.0", ] [[package]] @@ -8810,7 +8854,7 @@ dependencies = [ "toml 0.8.19", "url", "urlpattern", - "uuid 1.10.0", + "uuid 1.12.0", "walkdir", ] @@ -8872,6 +8916,7 @@ dependencies = [ name = "theseus" version = "0.9.3" dependencies = [ + "ariadne", "async-recursion", "async-tungstenite", "async_zip", @@ -8884,6 +8929,7 @@ dependencies = [ "dirs 5.0.1", "discord-rich-presence", "dunce", + "either", "flate2", "futures 0.3.30", "indicatif", @@ -8913,7 +8959,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 +9001,7 @@ dependencies = [ "tracing", "tracing-error", "url", - "uuid 1.10.0", + "uuid 1.12.0", "window-shadows", ] @@ -8974,7 +9020,7 @@ dependencies = [ "tracing-error", "tracing-subscriber", "url", - "uuid 1.10.0", + "uuid 1.12.0", "webbrowser", ] @@ -9819,9 +9865,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", diff --git a/Cargo.toml b/Cargo.toml index c55a6fc2e..97d69a241 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -7,6 +7,7 @@ members = [ './apps/labrinth', './apps/daedalus_client', './packages/daedalus', + './packages/ariadne', ] # Optimize for speed and reduce size on release builds @@ -21,4 +22,4 @@ strip = true # Remove debug symbols opt-level = 3 [patch.crates-io] -wry = { git = "https://github.com/modrinth/wry", rev = "51907c6" } \ No newline at end of file +wry = { git = "https://github.com/modrinth/wry", rev = "51907c6" } diff --git a/apps/app-playground/.cargo/config.toml b/apps/app-playground/.cargo/config.toml new file mode 100644 index 000000000..19f0a3a5a --- /dev/null +++ b/apps/app-playground/.cargo/config.toml @@ -0,0 +1,2 @@ +[env] +SQLX_OFFLINE = "true" diff --git a/apps/app-playground/src/main.rs b/apps/app-playground/src/main.rs index a50002dc7..f8d943938 100644 --- a/apps/app-playground/src/main.rs +++ b/apps/app-playground/src/main.rs @@ -3,9 +3,9 @@ windows_subsystem = "windows" )] +use std::time::Duration; use theseus::prelude::*; - -use theseus::profile::create::profile_create; +use tokio::signal::ctrl_c; // A simple Rust implementation of the authentication run // 1) call the authenticate_begin_flow() function to get the URL to open (like you would in the frontend) @@ -41,54 +41,21 @@ async fn main() -> theseus::Result<()> { // Initialize state State::init().await?; - if minecraft_auth::users().await?.is_empty() { - println!("No users found, authenticating."); - authenticate_run().await?; // could take credentials from here direct, but also deposited in state users - } - // - // st.settings - // .write() - // .await - // .java_globals - // .insert(JAVA_8_KEY.to_string(), check_jre(path).await?.unwrap()); - // Clear profiles - println!("Clearing profiles."); - { - let h = profile::list().await?; - for profile in h.into_iter() { - profile::remove(&profile.path).await?; + loop { + if State::get().await?.friends_socket.is_connected().await { + break; } + tokio::time::sleep(Duration::from_millis(500)).await; } - println!("Creating/adding profile."); + tracing::info!("Starting host"); - let name = "Example".to_string(); - let game_version = "1.16.1".to_string(); - let modloader = ModLoader::Forge; - let loader_version = "stable".to_string(); + let socket = State::get().await?.friends_socket.open_port(25565).await?; + tracing::info!("Running host on socket {}", socket.socket_id()); - let profile_path = profile_create( - name, - game_version, - modloader, - Some(loader_version), - None, - None, - None, - ) - .await?; - - println!("running"); - // Run a profile, running minecraft and store the RwLock to the process - let process = profile::run(&profile_path).await?; - - println!("Minecraft UUID: {}", process.uuid); - - println!("All running process UUID {:?}", process::get_all().await?); - - // hold the lock to the process until it ends - println!("Waiting for process to end..."); - process::wait_for(process.uuid).await?; + ctrl_c().await?; + tracing::info!("Stopping host"); + socket.shutdown().await?; Ok(()) } diff --git a/apps/app/.cargo/config.toml b/apps/app/.cargo/config.toml new file mode 100644 index 000000000..19f0a3a5a --- /dev/null +++ b/apps/app/.cargo/config.toml @@ -0,0 +1,2 @@ +[env] +SQLX_OFFLINE = "true" diff --git a/apps/docs/package.json b/apps/docs/package.json index 5b2266277..8ce3806e6 100644 --- a/apps/docs/package.json +++ b/apps/docs/package.json @@ -10,12 +10,12 @@ "astro": "astro" }, "dependencies": { - "@astrojs/check": "^0.9.3", - "@astrojs/starlight": "^0.26.3", + "@astrojs/check": "^0.9.4", + "@astrojs/starlight": "^0.32.2", "@modrinth/assets": "workspace:*", - "astro": "^4.10.2", - "sharp": "^0.32.5", - "starlight-openapi": "^0.7.0", - "typescript": "^5.5.4" + "astro": "^5.4.1", + "sharp": "^0.33.5", + "starlight-openapi": "^0.14.0", + "typescript": "^5.8.2" } -} +} \ No newline at end of file diff --git a/apps/docs/src/content.config.ts b/apps/docs/src/content.config.ts new file mode 100644 index 000000000..6a7b7a02b --- /dev/null +++ b/apps/docs/src/content.config.ts @@ -0,0 +1,7 @@ +import { defineCollection } from 'astro:content'; +import { docsLoader } from '@astrojs/starlight/loaders'; +import { docsSchema } from '@astrojs/starlight/schema'; + +export const collections = { + docs: defineCollection({ loader: docsLoader(), schema: docsSchema() }), +}; diff --git a/apps/docs/src/content/config.ts b/apps/docs/src/content/config.ts deleted file mode 100644 index 90ad769ec..000000000 --- a/apps/docs/src/content/config.ts +++ /dev/null @@ -1,6 +0,0 @@ -import { defineCollection } from 'astro:content' -import { docsSchema } from '@astrojs/starlight/schema' - -export const collections = { - docs: defineCollection({ schema: docsSchema() }), -} diff --git a/apps/frontend/src/assets/styles/layout.scss b/apps/frontend/src/assets/styles/layout.scss index 151066667..41be6710e 100644 --- a/apps/frontend/src/assets/styles/layout.scss +++ b/apps/frontend/src/assets/styles/layout.scss @@ -140,6 +140,8 @@ right: 1rem; z-index: 100; max-width: calc(100% - 2rem); + max-height: calc(100vh - 2rem); + overflow-y: auto; > div { box-shadow: 0 0 15px rgba(0, 0, 0, 0.3); diff --git a/apps/frontend/src/layouts/default.vue b/apps/frontend/src/layouts/default.vue index 0055eb4c9..733ffc451 100644 --- a/apps/frontend/src/layouts/default.vue +++ b/apps/frontend/src/layouts/default.vue @@ -479,13 +479,12 @@ -