Compare commits

...

8 Commits

Author SHA1 Message Date
quexeky
2874b9776b fix: Accidentally moved request when setting the header
Signed-off-by: quexeky <git@quexeky.dev>
2025-06-25 09:17:06 +10:00
DecDuck
afcd4e916f chore: bump version to 0.3.0-rc-4 2025-06-25 09:05:08 +10:00
quexeky
885fa42ecc fix: Move Authorization header generation to download_game_chunk()
Signed-off-by: quexeky <git@quexeky.dev>
2025-06-25 06:53:42 +10:00
quexeky
6d295bd47f fix: Broken README path
Signed-off-by: quexeky <git@quexeky.dev>
2025-06-07 06:37:14 +10:00
quexeky
c3ee09af85 fix: Update broken README link in docs
Signed-off-by: quexeky <git@quexeky.dev>
2025-06-07 06:35:57 +10:00
quexeky
0ce55e12c5 fix: Re-update the user and app status when recieve_handshake is called (#54)
Also enabled assetProtocol for better caching in general

Signed-off-by: quexeky <git@quexeky.dev>
2025-06-06 12:09:44 +10:00
DecDuck
86bce1c68d Release: v0.3.0-rc-3 (#51) 2025-06-06 09:25:44 +10:00
quexeky
924e4e334c Database not being properly serialised with rpm_serde (#48)
Signed-off-by: quexeky <git@quexeky.dev>
2025-06-05 17:22:22 +10:00
11 changed files with 52 additions and 23 deletions

View File

@@ -4,7 +4,7 @@ Drop app is the companion app for [Drop](https://github.com/Drop-OSS/drop). It u
## Running
Before setting up the drop app, be sure that you have a server set up.
The instructions for this can be found on the [Drop Wiki](https://wiki.droposs.org/guides/quickstart.html)
The instructions for this can be found on the [Drop Docs](https://docs.droposs.org/docs/guides/quickstart)
## Current features
Currently supported are the following features:

View File

@@ -1,9 +1,11 @@
import { invoke } from "@tauri-apps/api/core";
import { listen } from "@tauri-apps/api/event";
import { data } from "autoprefixer";
import { AppStatus, type AppState } from "~/types";
export function setupHooks() {
const router = useRouter();
const state = useAppState();
listen("auth/processing", (event) => {
router.push("/auth/processing");
@@ -15,8 +17,9 @@ export function setupHooks() {
);
});
listen("auth/finished", (event) => {
listen("auth/finished", async (event) => {
router.push("/store");
state.value = JSON.parse(await invoke("fetch_state"));
});
listen("download_error", (event) => {

View File

@@ -1,7 +1,7 @@
{
"name": "drop-app",
"private": true,
"version": "0.3.0-rc-2",
"version": "0.3.0-rc-4",
"type": "module",
"scripts": {
"build": "nuxt build",

9
src-tauri/Cargo.lock generated
View File

@@ -1247,7 +1247,7 @@ dependencies = [
[[package]]
name = "drop-app"
version = "0.3.0-rc-2"
version = "0.3.0-rc-4"
dependencies = [
"atomic-instant-full",
"boxcar",
@@ -2212,6 +2212,12 @@ dependencies = [
"serde",
]
[[package]]
name = "http-range"
version = "0.1.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "21dec9db110f5f872ed9699c3ecf50cf16f423502706ba5c72462e28d3157573"
[[package]]
name = "http-serde"
version = "1.1.3"
@@ -5247,6 +5253,7 @@ dependencies = [
"gtk",
"heck 0.5.0",
"http 1.3.1",
"http-range",
"jni",
"libc",
"log",

View File

@@ -1,6 +1,6 @@
[package]
name = "drop-app"
version = "0.3.0-rc-2"
version = "0.3.0-rc-4"
description = "The client application for the open-source, self-hosted game distribution platform Drop"
authors = ["Drop OSS"]
edition = "2021"
@@ -75,7 +75,7 @@ features = ["curly"]
[dependencies.tauri]
version = "2.1.1"
features = ["tray-icon"]
features = ["protocol-asset", "tray-icon"]
[dependencies.tokio]
version = "1.40.0"

View File

@@ -6,6 +6,7 @@ use std::{
use chrono::Utc;
use log::{debug, error, info, warn};
use native_model::{Decode, Encode};
use rustbreak::{DeSerError, DeSerializer, PathDatabase, RustbreakError};
use serde::{de::DeserializeOwned, Serialize};
use url::Url;
@@ -26,15 +27,15 @@ impl<T: native_model::Model + Serialize + DeserializeOwned> DeSerializer<T>
for DropDatabaseSerializer
{
fn serialize(&self, val: &T) -> rustbreak::error::DeSerResult<Vec<u8>> {
native_model::encode(val).map_err(|e| DeSerError::Internal(e.to_string()))
native_model::rmp_serde_1_3::RmpSerde::encode(val).map_err(|e| DeSerError::Internal(e.to_string()))
}
fn deserialize<R: std::io::Read>(&self, mut s: R) -> rustbreak::error::DeSerResult<T> {
let mut buf = Vec::new();
s.read_to_end(&mut buf)
.map_err(|e| rustbreak::error::DeSerError::Other(e.into()))?;
let (val, _version) =
native_model::decode::<T>(buf).map_err(|e| DeSerError::Internal(e.to_string()))?;
let val =
native_model::rmp_serde_1_3::RmpSerde::decode(buf).map_err(|e| DeSerError::Internal(e.to_string()))?;
Ok(val)
}
}

View File

@@ -27,7 +27,7 @@ pub mod data {
#[derive(Serialize, Deserialize, Clone, Debug)]
#[serde(rename_all = "camelCase")]
#[native_model(id = 2, version = 1)]
#[native_model(id = 2, version = 1, with = native_model::rmp_serde_1_3::RmpSerde)]
pub struct GameVersion {
pub game_id: String,
pub version_name: String,
@@ -69,7 +69,7 @@ pub mod data {
#[derive(Serialize, Deserialize, Clone, Debug)]
#[serde(rename_all = "camelCase")]
#[native_model(id = 4, version = 1)]
#[native_model(id = 4, version = 1, with = native_model::rmp_serde_1_3::RmpSerde)]
pub struct Settings {
pub autostart: bool,
pub max_download_threads: usize,
@@ -88,7 +88,7 @@ pub mod data {
// Strings are version names for a particular game
#[derive(Serialize, Clone, Deserialize)]
#[serde(tag = "type")]
#[native_model(id = 5, version = 1)]
#[native_model(id = 5, version = 1, with = native_model::rmp_serde_1_3::RmpSerde)]
pub enum GameDownloadStatus {
Remote {},
SetupRequired {
@@ -111,7 +111,7 @@ pub mod data {
}
#[derive(serde::Serialize, Clone, Deserialize)]
#[native_model(id = 6, version = 1)]
#[native_model(id = 6, version = 1, with = native_model::rmp_serde_1_3::RmpSerde)]
pub struct DatabaseAuth {
pub private: String,
pub cert: String,
@@ -130,7 +130,7 @@ pub mod data {
Mod,
}
#[native_model(id = 7, version = 1)]
#[native_model(id = 7, version = 1, with = native_model::rmp_serde_1_3::RmpSerde)]
#[derive(Debug, PartialEq, Eq, PartialOrd, Ord, Hash, Serialize, Deserialize, Clone)]
#[serde(rename_all = "camelCase")]
pub struct DownloadableMetadata {
@@ -168,7 +168,7 @@ pub mod data {
use super::*;
#[native_model(id = 1, version = 2)]
#[native_model(id = 1, version = 2, with = native_model::rmp_serde_1_3::RmpSerde)]
#[derive(Serialize, Deserialize, Clone, Default)]
pub struct Database {
#[serde(default)]
@@ -182,7 +182,7 @@ pub mod data {
pub compat_info: Option<DatabaseCompatInfo>,
}
#[native_model(id = 8, version = 2)]
#[native_model(id = 8, version = 2, with = native_model::rmp_serde_1_3::RmpSerde)]
#[derive(Serialize, Deserialize, Clone, Default)]
pub struct DatabaseCompatInfo {

View File

@@ -274,7 +274,7 @@ impl GameDownloadAgent {
("name", &context.file_name),
("chunk", &context.index.to_string()),
],
|r| r.header("Authorization", generate_authorization_header()),
|r| { r },
) {
Ok(request) => request,
Err(e) => {

View File

@@ -1,8 +1,11 @@
use crate::download_manager::util::download_thread_control_flag::{DownloadThreadControl, DownloadThreadControlFlag};
use crate::download_manager::util::download_thread_control_flag::{
DownloadThreadControl, DownloadThreadControlFlag,
};
use crate::download_manager::util::progress_object::ProgressHandle;
use crate::error::application_download_error::ApplicationDownloadError;
use crate::error::remote_access_error::RemoteAccessError;
use crate::games::downloads::manifest::DropDownloadContext;
use crate::remote::auth::generate_authorization_header;
use log::warn;
use md5::{Context, Digest};
use reqwest::blocking::{RequestBuilder, Response};
@@ -124,6 +127,7 @@ pub fn download_game_chunk(
progress.set(0);
return Ok(false);
}
let request = request.header("Authorization", generate_authorization_header());
let response = request
.send()

View File

@@ -1,11 +1,11 @@
use std::{collections::HashMap, env};
use std::{collections::HashMap, env, sync::Mutex};
use chrono::Utc;
use droplet_rs::ssl::sign_nonce;
use gethostname::gethostname;
use log::{debug, error, warn};
use serde::{Deserialize, Serialize};
use tauri::{AppHandle, Emitter};
use tauri::{AppHandle, Emitter, Manager};
use url::Url;
use crate::{
@@ -14,7 +14,7 @@ use crate::{
models::data::DatabaseAuth,
},
error::{drop_server_error::DropServerError, remote_access_error::RemoteAccessError},
AppStatus, User,
AppState, AppStatus, User,
};
use super::{
@@ -157,6 +157,16 @@ pub fn recieve_handshake(app: AppHandle, path: String) {
return;
}
let app_state = app.state::<Mutex<AppState>>();
let mut state_lock = app_state.lock().unwrap();
let (app_status, user) = setup();
state_lock.status = app_status;
state_lock.user = user;
drop(state_lock);
app.emit("auth/finished", ()).unwrap();
}

View File

@@ -1,7 +1,7 @@
{
"$schema": "https://schema.tauri.app/config/2.0.0",
"productName": "Drop Desktop Client",
"version": "0.3.0-rc-2",
"version": "0.3.0-rc-4",
"identifier": "dev.drop.app",
"build": {
"beforeDevCommand": "yarn dev --port 1432",
@@ -11,7 +11,11 @@
},
"app": {
"security": {
"csp": null
"csp": null,
"assetProtocol": {
"enable": true,
"scope": {}
}
}
},
"plugins": {