Compare commits

..

6 Commits

Author SHA1 Message Date
0f48f3fb44 chore: Run cargo clippy && cargo fmt
Signed-off-by: quexeky <git@quexeky.dev>
2025-10-12 20:13:26 +11:00
974666efe2 refactor: Finish refactor
Signed-off-by: quexeky <git@quexeky.dev>
2025-10-12 19:17:40 +11:00
9e1bf9852f refactor: Builds, but some logic still left to move back
Signed-off-by: quexeky <git@quexeky.dev>
2025-10-12 18:33:43 +11:00
5d22b883d5 refactor: Improvements to src-tauri
Signed-off-by: quexeky <git@quexeky.dev>
2025-10-12 17:04:27 +11:00
62a2561539 fix: Remote tauri dependency from process
Signed-off-by: quexeky <git@quexeky.dev>
2025-10-11 09:51:04 +11:00
59f040bc8b chore: Major refactoring
Still needs a massive go-over because there shouldn't be anything referencing tauri in any of the workspaces except the original one. Process manager has been refactored as an example

Signed-off-by: quexeky <git@quexeky.dev>
2025-10-11 09:28:41 +11:00
88 changed files with 9228 additions and 1510 deletions

View File

@ -63,21 +63,17 @@ jobs:
KEYCHAIN_PASSWORD: ${{ secrets.KEYCHAIN_PASSWORD }}
run: |
echo $APPLE_CERTIFICATE | base64 --decode > certificate.p12
# security create-keychain -p "$KEYCHAIN_PASSWORD" build.keychain
# security default-keychain -s build.keychain
# security unlock-keychain -p "$KEYCHAIN_PASSWORD" build.keychain
# security set-keychain-settings -t 3600 -u build.keychain
security create-keychain -p "$KEYCHAIN_PASSWORD" build.keychain
security default-keychain -s build.keychain
security unlock-keychain -p "$KEYCHAIN_PASSWORD" build.keychain
security set-keychain-settings -t 3600 -u build.keychain
curl https://droposs.org/drop.der --output drop.der
swiftc libs/appletrust/add-certificate.swift
./add-certificate drop.der
rm add-certificate
curl https://droposs.org/drop.crt --output drop.pem
sudo security authorizationdb write com.apple.trust-settings.user allow
security add-trusted-cert -r trustRoot -k build.keychain -p codeSign -u -1 drop.pem
sudo security authorizationdb remove com.apple.trust-settings.user
# sudo security authorizationdb write com.apple.trust-settings.user allow
# security add-trusted-cert -r trustRoot -k build.keychain -p codeSign -u -1 drop.pem
# sudo security authorizationdb remove com.apple.trust-settings.user
security import certificate.p12 -k /Library/Keychains/System.keychain -P "$APPLE_CERTIFICATE_PASSWORD" -T /usr/bin/codesign
security import certificate.p12 -k build.keychain -P "$APPLE_CERTIFICATE_PASSWORD" -T /usr/bin/codesign
security set-key-partition-list -S apple-tool:,apple:,codesign: -s -k "$KEYCHAIN_PASSWORD" build.keychain
security find-identity -v -p codesigning build.keychain

2
.gitlab-ci-local/.gitignore vendored Normal file
View File

@ -0,0 +1,2 @@
*
!.gitignore

8290
Cargo.lock generated Normal file

File diff suppressed because it is too large Load Diff

14
Cargo.toml Normal file
View File

@ -0,0 +1,14 @@
[workspace]
members = [
"client",
"database",
"src-tauri",
"process",
"remote",
"utils",
"cloud_saves",
"download_manager",
"games",
]
resolver = "3"

View File

@ -27,7 +27,7 @@ impl BackupManager<'_> {
current_platform: Platform::Windows,
#[cfg(target_os = "macos")]
current_platform: Platform::macOS,
current_platform: Platform::MacOs,
#[cfg(target_os = "linux")]
current_platform: Platform::Linux,
@ -43,7 +43,7 @@ impl BackupManager<'_> {
&LinuxBackupManager {} as &(dyn BackupHandler + Sync + Send),
),
(
(Platform::macOS, Platform::macOS),
(Platform::MacOs, Platform::MacOs),
&MacBackupManager {} as &(dyn BackupHandler + Sync + Send),
),
]),

View File

@ -4,20 +4,20 @@ use serde::{Deserialize, Serialize};
pub enum Platform {
Windows,
Linux,
macOS,
MacOs,
}
impl Platform {
#[cfg(target_os = "windows")]
pub const HOST: Platform = Self::Windows;
#[cfg(target_os = "macos")]
pub const HOST: Platform = Self::macOS;
pub const HOST: Platform = Self::MacOs;
#[cfg(target_os = "linux")]
pub const HOST: Platform = Self::Linux;
pub fn is_case_sensitive(&self) -> bool {
match self {
Self::Windows | Self::macOS => false,
Self::Windows | Self::MacOs => false,
Self::Linux => true,
}
}
@ -28,7 +28,7 @@ impl From<&str> for Platform {
match value.to_lowercase().trim() {
"windows" => Self::Windows,
"linux" => Self::Linux,
"mac" | "macos" => Self::macOS,
"mac" | "macos" => Self::MacOs,
_ => unimplemented!(),
}
}
@ -39,7 +39,7 @@ impl From<whoami::Platform> for Platform {
match value {
whoami::Platform::Windows => Platform::Windows,
whoami::Platform::Linux => Platform::Linux,
whoami::Platform::MacOS => Platform::macOS,
whoami::Platform::MacOS => Platform::MacOs,
platform => unimplemented!("Playform {} is not supported", platform),
}
}

View File

@ -39,8 +39,7 @@ impl DropWriter<File> {
.write(true)
.create(true)
.truncate(false)
.open(&path)
.inspect_err(|_v| warn!("failed to open {}", path.display()))?;
.open(&path)?;
Ok(Self {
destination: BufWriter::with_capacity(1024 * 1024, destination),
hasher: Context::new(),
@ -123,7 +122,7 @@ impl<'a> DropDownloadPipeline<'a, Response, File> {
.source
.read(&mut copy_buffer[0..size])
.inspect_err(|_| {
warn!("got error from {}", drop.filename);
info!("got error from {}", drop.filename);
})?;
remaining -= size;
last_bump += size;
@ -273,12 +272,7 @@ pub fn download_game_bucket(
#[cfg(unix)]
{
for drop in bucket.drops.iter() {
let permission = if drop.permissions == 0 {
0o744
} else {
drop.permissions
};
let permissions = Permissions::from_mode(permission);
let permissions = Permissions::from_mode(drop.permissions);
set_permissions(drop.path.clone(), permissions)
.map_err(|e| ApplicationDownloadError::IoError(Arc::new(e)))?;
}

View File

@ -1,72 +0,0 @@
import Foundation
import Security
enum SecurityError: Error {
case generalError
}
func deleteCertificateFromKeyChain(_ certificateLabel: String) -> Bool {
let delQuery: [NSString: Any] = [
kSecClass: kSecClassCertificate,
kSecAttrLabel: certificateLabel,
]
let delStatus: OSStatus = SecItemDelete(delQuery as CFDictionary)
return delStatus == errSecSuccess
}
func saveCertificateToKeyChain(_ certificate: SecCertificate, certificateLabel: String) throws {
SecKeychainSetPreferenceDomain(SecPreferencesDomain.system)
deleteCertificateFromKeyChain(certificateLabel)
let setQuery: [NSString: AnyObject] = [
kSecClass: kSecClassCertificate,
kSecValueRef: certificate,
kSecAttrLabel: certificateLabel as AnyObject,
kSecAttrAccessible: kSecAttrAccessibleWhenUnlocked,
]
let addStatus: OSStatus = SecItemAdd(setQuery as CFDictionary, nil)
guard addStatus == errSecSuccess else {
throw SecurityError.generalError
}
var status = SecTrustSettingsSetTrustSettings(certificate, SecTrustSettingsDomain.admin, nil)
}
func getCertificateFromString(stringData: String) throws -> SecCertificate {
if let data = NSData(base64Encoded: stringData, options: NSData.Base64DecodingOptions.ignoreUnknownCharacters) {
if let certificate = SecCertificateCreateWithData(kCFAllocatorDefault, data) {
return certificate
}
}
throw SecurityError.generalError
}
if CommandLine.arguments.count != 2 {
print("Usage: \(CommandLine.arguments[0]) [cert.file]")
print("Usage: \(CommandLine.arguments[0]) --version")
exit(1)
}
if (CommandLine.arguments[1] == "--version") {
let version = "dev"
print(version)
exit(0)
} else {
let fileURL = URL(fileURLWithPath: CommandLine.arguments[1])
do {
let certData = try Data(contentsOf: fileURL)
let certificate = SecCertificateCreateWithData(nil, certData as CFData)
if certificate != nil {
print("Saving certificate")
try? saveCertificateToKeyChain(certificate!, certificateLabel: "DropOSS")
exit(0)
} else {
print("ERROR: Unknown error while reading the \(CommandLine.arguments[1]) file.")
}
} catch {
print("ERROR: Unexpected error while reading the \(CommandLine.arguments[1]) file. \(error)")
}
}
exit(1)

View File

@ -1,7 +1,7 @@
{
"name": "view",
"private": true,
"version": "0.3.4",
"version": "0.3.3",
"type": "module",
"scripts": {
"build": "nuxt generate",

View File

@ -116,7 +116,7 @@ platformInfo.value = currentPlatform;
async function openDataDir() {
if (!dataDir.value) return;
try {
await invoke("open_fs", { path: dataDir.value });
await open(dataDir.value);
} catch (error) {
console.error("Failed to open data dir:", error);
}
@ -126,7 +126,7 @@ async function openLogFile() {
if (!dataDir.value) return;
try {
const logPath = `${dataDir.value}/drop.log`;
await invoke("open_fs", { path: logPath });
await open(logPath);
} catch (error) {
console.error("Failed to open log file:", error);
}

View File

@ -9,8 +9,8 @@
"dependencies": {
"@tauri-apps/api": "^2.7.0",
"@tauri-apps/plugin-deep-link": "^2.4.1",
"@tauri-apps/plugin-dialog": "^2.4.0",
"@tauri-apps/plugin-opener": "^2.5.0",
"@tauri-apps/plugin-dialog": "^2.3.2",
"@tauri-apps/plugin-opener": "^2.4.0",
"@tauri-apps/plugin-os": "^2.3.0",
"@tauri-apps/plugin-shell": "^2.3.0",
"pino": "^9.7.0",

View File

@ -54,7 +54,7 @@ impl ProcessManager<'_> {
current_platform: Platform::Windows,
#[cfg(target_os = "macos")]
current_platform: Platform::macOS,
current_platform: Platform::MacOs,
#[cfg(target_os = "linux")]
current_platform: Platform::Linux,
@ -72,7 +72,7 @@ impl ProcessManager<'_> {
&NativeGameLauncher {} as &(dyn ProcessHandler + Sync + Send + 'static),
),
(
(Platform::macOS, Platform::macOS),
(Platform::MacOs, Platform::MacOs),
&NativeGameLauncher {} as &(dyn ProcessHandler + Sync + Send + 'static),
),
(

2256
src-tauri/Cargo.lock generated

File diff suppressed because it is too large Load Diff

View File

@ -1,6 +1,6 @@
[package]
name = "drop-app"
version = "0.3.4"
version = "0.3.3"
description = "The client application for the open-source, self-hosted game distribution platform Drop"
authors = ["Drop OSS"]
edition = "2024"
@ -80,13 +80,13 @@ bytes = "1.10.1"
# Workspaces
client = { version = "0.1.0", path = "./client" }
database = { path = "./database" }
process = { path = "./process" }
remote = { version = "0.1.0", path = "./remote" }
utils = { path = "./utils" }
games = { version = "0.1.0", path = "./games" }
download_manager = { version = "0.1.0", path = "./download_manager" }
client = { version = "0.1.0", path = "../client" }
database = { path = "../database" }
process = { path = "../process" }
remote = { version = "0.1.0", path = "../remote" }
utils = { path = "../utils" }
games = { version = "0.1.0", path = "../games" }
download_manager = { version = "0.1.0", path = "../download_manager" }
[dependencies.dynfmt]
version = "0.1.5"
@ -137,18 +137,3 @@ features = ["derive", "rc"]
lto = true
codegen-units = 1
panic = 'abort'
[workspace]
members = [
"client",
"database",
"process",
"remote",
"utils",
"cloud_saves",
"download_manager",
"games",
]
resolver = "3"

View File

@ -5,7 +5,6 @@ use download_manager::DOWNLOAD_MANAGER;
use log::{debug, error};
use tauri::AppHandle;
use tauri_plugin_autostart::ManagerExt;
use tauri_plugin_opener::OpenerExt;
use crate::AppState;
@ -73,10 +72,3 @@ pub fn get_autostart_enabled(app: AppHandle) -> Result<bool, tauri_plugin_autost
Ok(db_state)
}
#[tauri::command]
pub fn open_fs(path: String, app_handle: AppHandle) -> Result<(), tauri_plugin_opener::Error> {
app_handle
.opener()
.open_path(path, None::<&str>)
}

View File

@ -229,7 +229,6 @@ pub fn run() {
fetch_state,
quit,
fetch_system_data,
open_fs,
// User utils
update_settings,
fetch_settings,

View File

@ -1,7 +1,7 @@
{
"$schema": "https://schema.tauri.app/config/2.0.0",
"productName": "Drop Desktop Client",
"version": "0.3.4",
"version": "0.3.3",
"identifier": "dev.drop.client",
"build": {
"beforeDevCommand": "yarn --cwd main dev --port 1432",