mirror of
https://github.com/Drop-OSS/drop-app.git
synced 2025-11-16 17:51:23 +10:00
Compare commits
6 Commits
v0.3.4
...
0f48f3fb44
| Author | SHA1 | Date | |
|---|---|---|---|
| 0f48f3fb44 | |||
| 974666efe2 | |||
| 9e1bf9852f | |||
| 5d22b883d5 | |||
| 62a2561539 | |||
| 59f040bc8b |
22
.github/workflows/release.yml
vendored
22
.github/workflows/release.yml
vendored
@ -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
2
.gitlab-ci-local/.gitignore
vendored
Normal file
@ -0,0 +1,2 @@
|
||||
*
|
||||
!.gitignore
|
||||
8290
Cargo.lock
generated
Normal file
8290
Cargo.lock
generated
Normal file
File diff suppressed because it is too large
Load Diff
14
Cargo.toml
Normal file
14
Cargo.toml
Normal file
@ -0,0 +1,14 @@
|
||||
[workspace]
|
||||
members = [
|
||||
"client",
|
||||
"database",
|
||||
"src-tauri",
|
||||
"process",
|
||||
"remote",
|
||||
"utils",
|
||||
"cloud_saves",
|
||||
"download_manager",
|
||||
"games",
|
||||
]
|
||||
|
||||
resolver = "3"
|
||||
@ -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),
|
||||
),
|
||||
]),
|
||||
@ -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),
|
||||
}
|
||||
}
|
||||
@ -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)))?;
|
||||
}
|
||||
@ -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)
|
||||
@ -1,7 +1,7 @@
|
||||
{
|
||||
"name": "view",
|
||||
"private": true,
|
||||
"version": "0.3.4",
|
||||
"version": "0.3.3",
|
||||
"type": "module",
|
||||
"scripts": {
|
||||
"build": "nuxt generate",
|
||||
|
||||
@ -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);
|
||||
}
|
||||
|
||||
@ -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",
|
||||
|
||||
@ -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
2256
src-tauri/Cargo.lock
generated
File diff suppressed because it is too large
Load Diff
@ -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"
|
||||
@ -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>)
|
||||
}
|
||||
|
||||
@ -229,7 +229,6 @@ pub fn run() {
|
||||
fetch_state,
|
||||
quit,
|
||||
fetch_system_data,
|
||||
open_fs,
|
||||
// User utils
|
||||
update_settings,
|
||||
fetch_settings,
|
||||
|
||||
@ -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",
|
||||
|
||||
Reference in New Issue
Block a user