Merge remote-tracking branch 'origin' into mob-106-cloud-sync-for-mobile

This commit is contained in:
ameer2468 2024-06-13 15:04:27 +03:00
commit 560eea1324
76 changed files with 2088 additions and 2576 deletions

1
.gitattributes vendored
View file

@ -1,3 +1,4 @@
pnpm-lock.yaml -diff
package-lock.json -diff
Cargo.lock -diff
.github/actions/publish-artifacts/dist/index.js -diff

3750
Cargo.lock generated

File diff suppressed because it is too large Load diff

View file

@ -4,8 +4,7 @@ members = [
"core",
"core/crates/*",
"crates/*",
"apps/cli",
"apps/p2p-relay",
"apps/deps-generator",
"apps/desktop/src-tauri",
"apps/desktop/crates/*",
"apps/mobile/modules/sd-core/core",
@ -13,6 +12,7 @@ members = [
"apps/mobile/modules/sd-core/ios/crate",
"apps/server",
]
exclude = ["crates/crypto"]
[workspace.package]
license = "AGPL-3.0-only"
@ -20,73 +20,72 @@ edition = "2021"
repository = "https://github.com/spacedriveapp/spacedrive"
[workspace.dependencies]
prisma-client-rust = { git = "https://github.com/brendonovich/prisma-client-rust", rev = "4f9ef9d38ca732162accff72b2eb684d2f120bab", features = [
"migrations",
"specta",
"sqlite",
"sqlite-create-many",
], default-features = false }
prisma-client-rust-cli = { git = "https://github.com/brendonovich/prisma-client-rust", rev = "4f9ef9d38ca732162accff72b2eb684d2f120bab", features = [
"migrations",
"specta",
"sqlite",
"sqlite-create-many",
], default-features = false }
prisma-client-rust-sdk = { git = "https://github.com/brendonovich/prisma-client-rust", rev = "4f9ef9d38ca732162accff72b2eb684d2f120bab", features = [
"sqlite",
], default-features = false }
rspc = { version = "0.1.4" }
specta = { version = "=2.0.0-rc.11" }
tauri-specta = { version = "=2.0.0-rc.8" }
swift-rs = { version = "1.0.6" }
# Third party dependencies used by one or more of our crates
anyhow = "1.0.75"
async-channel = "2.0.0"
async-trait = "0.1.77"
axum = "=0.6.20"
base64 = "0.21.5"
blake3 = "1.5.0"
async-channel = "2.3"
async-trait = "0.1.80"
axum = "0.6.20" # Update blocked by hyper
base64 = "0.22.1"
base91 = "0.1.0"
blake3 = "1.5.0" # Update blocked by custom patch below
chrono = "0.4.38"
clap = "4.4.7"
directories = "5.0"
ed25519-dalek = "2.1.1"
futures = "0.3.30"
futures-concurrency = "7.6.0"
globset = "^0.4.13"
hex = "0.4.3"
http = "0.2.9"
futures-concurrency = "7.6"
gix-ignore = "0.11.2"
globset = "0.4.14"
http = "0.2" # Update blocked by axum
hyper = "0.14" # Update blocked due to API breaking changes
image = "0.25.1"
itertools = "0.12.0"
lending-stream = "1.0.0"
itertools = "0.13.0"
lending-stream = "1.0"
libc = "0.2"
normpath = "1.1.1"
once_cell = "1.19.0"
pin-project-lite = "0.2.13"
normpath = "1.2"
once_cell = "1.19"
pin-project-lite = "0.2.14"
rand = "0.8.5"
rand_chacha = "0.3.1"
regex = "1.10.2"
reqwest = "0.11.22"
rmp-serde = "1.1.2"
rmpv = { version = "^1.0.1", features = ["with-serde"] }
regex = "1.10"
reqwest = "0.11" # Update blocked by hyper
rmp = "0.8.14"
rmp-serde = "1.3.0"
rmpv = { version = "1.3", features = ["with-serde"] }
rspc = "0.1.4"
serde = "1.0"
serde_json = "1.0"
static_assertions = "1.1.0"
strum = "0.25"
strum_macros = "0.25"
tempfile = "3.8.1"
thiserror = "1.0.50"
tokio = "1.36.0"
tokio-stream = "0.1.14"
tokio-util = "0.7.10"
specta = "=2.0.0-rc.11"
static_assertions = "1.1"
strum = "0.26"
strum_macros = "0.26"
tempfile = "3.10"
thiserror = "1.0"
tokio = "1.38"
tokio-stream = "0.1.15"
tokio-util = "0.7.11"
tracing = "0.1.40"
tracing-subscriber = "0.3.18"
tracing-appender = "0.2.3"
tracing-test = "^0.2.4"
uhlc = "=0.5.2"
uuid = "1.5.0"
tracing-test = "0.2.5"
uhlc = "0.6.0" # Must follow version used by specta
uuid = "1.8"
webp = "0.3.0"
[workspace.dependencies.prisma-client-rust]
git = "https://github.com/brendonovich/prisma-client-rust"
rev = "4f9ef9d38ca732162accff72b2eb684d2f120bab"
features = ["migrations", "specta", "sqlite", "sqlite-create-many"]
default-features = false
[workspace.dependencies.prisma-client-rust-cli]
git = "https://github.com/brendonovich/prisma-client-rust"
rev = "4f9ef9d38ca732162accff72b2eb684d2f120bab"
features = ["migrations", "specta", "sqlite", "sqlite-create-many"]
default-features = false
[workspace.dependencies.prisma-client-rust-sdk]
git = "https://github.com/brendonovich/prisma-client-rust"
rev = "4f9ef9d38ca732162accff72b2eb684d2f120bab"
features = ["sqlite"]
default-features = false
[patch.crates-io]
# Proper IOS Support
if-watch = { git = "https://github.com/spacedriveapp/if-watch.git", rev = "a92c17d3f85c1c6fb0afeeaf6c2b24d0b147e8c3" }

View file

@ -1,17 +0,0 @@
[package]
name = "sd-cli"
version = "0.1.0"
license = { workspace = true }
repository = { workspace = true }
edition = { workspace = true }
[dependencies]
# Spacedrive Sub-crates
sd-crypto = { path = "../../crates/crypto" }
anyhow = { workspace = true }
clap = { workspace = true, features = ["derive"] }
hex = { workspace = true }
tokio = { workspace = true, features = ["io-util", "rt-multi-thread"] }
indoc = "2.0.4"

View file

@ -1,4 +0,0 @@
# CLI
Basic CLI for interacting with encrypted files.
Will be expanded to a general Spacedrive CLI in the future.

View file

@ -1,85 +0,0 @@
use anyhow::Result;
// use clap::Parser;
// use indoc::printdoc;
// use sd_crypto::header::file::FileHeader;
// use std::path::PathBuf;
// use tokio::fs::File;
// #[derive(Parser)]
// struct Args {
// #[arg(help = "the file path to get details for")]
// path: PathBuf,
// }
#[tokio::main]
async fn main() -> Result<()> {
// let args = Args::parse();
// let mut reader = File::open(args.path).await.context("unable to open file")?;
// let (header, aad) = FileHeader::from_reader(&mut reader).await?;
// print_crypto_details(&header, &aad);
Ok(())
}
// fn print_crypto_details(header: &FileHeader, aad: &[u8]) {
// printdoc! {"
// Header version: {version}
// Encryption algorithm: {algorithm}
// AAD (hex): {hex}
// ",
// version = header.version,
// algorithm = header.algorithm,
// hex = hex::encode(aad)
// };
// header.keyslots.iter().enumerate().for_each(|(i, k)| {
// printdoc! {"
// Keyslot {index}:
// Version: {version}
// Algorithm: {algorithm}
// Hashing algorithm: {hashing_algorithm}
// Salt (hex): {salt}
// Master Key (hex, encrypted): {master}
// Master key nonce (hex): {nonce}
// ",
// index = i + i,
// version = k.version,
// algorithm = k.algorithm,
// hashing_algorithm = k.hashing_algorithm,
// salt = hex::encode(&*k.salt),
// master = hex::encode(&*k.master_key),
// nonce = hex::encode(k.nonce)
// };
// });
// header.metadata.iter().for_each(|m| {
// printdoc! {"
// Metadata:
// Version: {version}
// Algorithm: {algorithm}
// Encrypted size: {size}
// Nonce (hex): {nonce}
// ",
// version = m.version,
// algorithm = m.algorithm,
// size = m.metadata.len(),
// nonce = hex::encode(m.metadata_nonce)
// }
// });
// header.preview_media.iter().for_each(|p| {
// printdoc! {"
// Preview Media:
// Version: {version}
// Algorithm: {algorithm}
// Encrypted size: {size}
// Nonce (hex): {nonce}
// ",
// version = p.version,
// algorithm = p.algorithm,
// size = p.media.len(),
// nonce = hex::encode(p.media_nonce)
// };
// });
// }

View file

@ -8,10 +8,12 @@ repository = { workspace = true }
edition = { workspace = true }
[dependencies]
anyhow = { workspace = true }
clap = { workspace = true, features = ["derive"] }
# Workspace dependencies
reqwest = { workspace = true, features = ["blocking", "native-tls-vendored"] }
serde = { workspace = true, features = ["derive"] }
serde_json = { workspace = true }
# Specific Deps Generator dependencies
anyhow = "1.0"
clap = { version = "4.5", features = ["derive"] }
cargo_metadata = "0.18.1"

View file

@ -6,10 +6,11 @@ repository = { workspace = true }
edition = { workspace = true }
[dependencies]
libc = { workspace = true }
tokio = { workspace = true, features = ["fs"] }
libc = { workspace = true }
[target.'cfg(target_os = "linux")'.dependencies]
wgpu = { version = "0.20.0", default-features = false }
# WARNING: gtk should follow the same version used by tauri
# https://github.com/tauri-apps/tauri/blob/tauri-v2.0.0-beta.17/core/tauri/Cargo.toml#L85C1-L85C51
gtk = { version = "0.18", features = [ "v3_24" ] }
gtk = { version = "0.18", features = ["v3_24"] }

View file

@ -175,6 +175,11 @@ pub fn normalize_environment() {
],
)
.expect("PATH must be successfully normalized");
if has_nvidia() {
// Workaround for: https://github.com/tauri-apps/tauri/issues/9304
env::set_var("WEBKIT_DISABLE_DMABUF_RENDERER", "1");
}
}
// Check if snap by looking if SNAP is set and not empty and that the SNAP directory exists
@ -198,3 +203,31 @@ pub fn is_flatpak() -> bool {
false
}
fn has_nvidia() -> bool {
use wgpu::{
Backends, DeviceType, Dx12Compiler, Gles3MinorVersion, Instance, InstanceDescriptor,
InstanceFlags,
};
let instance = Instance::new(InstanceDescriptor {
flags: InstanceFlags::empty(),
backends: Backends::VULKAN | Backends::GL,
gles_minor_version: Gles3MinorVersion::Automatic,
dx12_shader_compiler: Dx12Compiler::default(),
});
for adapter in instance.enumerate_adapters(Backends::all()) {
let info = adapter.get_info();
match info.device_type {
DeviceType::DiscreteGpu | DeviceType::IntegratedGpu | DeviceType::VirtualGpu => {
// Nvidia PCI id
if info.vendor == 0x10de {
return true;
}
}
_ => {}
}
}
false
}

View file

@ -5,10 +5,8 @@ license = { workspace = true }
repository = { workspace = true }
edition = { workspace = true }
[dependencies]
[target.'cfg(target_os = "macos")'.dependencies]
swift-rs = { workspace = true, features = ["serde"] }
swift-rs = { version = "1.0.6", features = ["serde"] }
[target.'cfg(target_os = "macos")'.build-dependencies]
swift-rs = { workspace = true, features = ["build"] }
swift-rs = { version = "1.0.6", features = ["build"] }

View file

@ -6,10 +6,10 @@ repository = { workspace = true }
edition = { workspace = true }
[dependencies]
libc = { workspace = true }
normpath = { workspace = true }
thiserror = { workspace = true }
libc = { workspace = true }
[target.'cfg(target_os = "windows")'.dependencies.windows]
version = "0.51"
version = "0.57"
features = ["Win32_UI_Shell", "Win32_Foundation", "Win32_System_Com"]

View file

@ -10,6 +10,7 @@ use normpath::PathExt;
use windows::{
core::{HSTRING, PCWSTR},
Win32::{
Foundation::E_FAIL,
System::Com::{
CoInitializeEx, CoUninitialize, IDataObject, COINIT_APARTMENTTHREADED,
COINIT_DISABLE_OLE1DDE,
@ -97,11 +98,15 @@ pub fn open_file_path_with(path: impl AsRef<Path>, url: &str) -> Result<()> {
ensure_com_initialized();
let path = path.as_ref();
let ext = path.extension().ok_or(Error::OK)?;
let ext = path
.extension()
.ok_or(Error::new(E_FAIL, "No file extension"))?;
for handler in list_apps_associated_with_ext(ext)?.iter() {
let name = unsafe { handler.GetName()?.to_string()? };
if name == url {
let path = path.normalize_virtually().map_err(|_| Error::OK)?;
let path = path
.normalize_virtually()
.map_err(|e| Error::new(E_FAIL, e.to_string()))?;
let wide_path = path
.as_os_str()
.encode_wide()
@ -116,5 +121,8 @@ pub fn open_file_path_with(path: impl AsRef<Path>, url: &str) -> Result<()> {
}
}
Err(Error::OK)
Err(Error::new(
E_FAIL,
"No available handler for the given path",
))
}

View file

@ -14,49 +14,61 @@ sd-core = { path = "../../../core", features = ["ffmpeg", "heif"] }
sd-fda = { path = "../../../crates/fda" }
sd-prisma = { path = "../../../crates/prisma" }
# Workspace dependencies
axum = { workspace = true, features = ["headers", "query"] }
hyper = "0.14.28"
directories = { workspace = true }
futures = { workspace = true }
hyper = { workspace = true }
http = { workspace = true }
prisma-client-rust = { workspace = true }
rand = { workspace = true }
rspc = { workspace = true, features = ["tauri", "tracing"] }
serde = { workspace = true }
serde_json = { workspace = true }
specta = { workspace = true }
strum = { workspace = true, features = ["derive"] }
tokio = { workspace = true, features = ["sync"] }
tracing = { workspace = true }
tauri-specta = { workspace = true, features = ["typescript"] }
thiserror = { workspace = true }
uuid = { workspace = true, features = ["serde"] }
thiserror.workspace = true
directories = "5.0.1"
opener = { version = "0.6.1", features = ["reveal"] }
# Specific Desktop dependencies
# WARNING: Do NOT enable default features, as that vendors dbus (see below)
opener = { version = "0.7.1", features = ["reveal"], default-features = false }
tauri = { version = "=2.0.0-beta.17", features = [
"macos-private-api",
"unstable",
"linux-libxdo",
] }
] } # Update blocked by rspc
tauri-plugin-updater = "2.0.0-beta"
tauri-plugin-dialog = "2.0.0-beta"
tauri-plugin-os = "2.0.0-beta"
tauri-plugin-shell = "2.0.0-beta"
serde_json.workspace = true
strum = { workspace = true, features = ["derive"] }
tauri-runtime = { version = "=2.0.0-beta.15" } # Update blocked by tauri
tauri-specta = { version = "=2.0.0-rc.8", features = ["typescript"] }
tauri-utils = { version = "=2.0.0-beta.16" } # Update blocked by tauri
[target.'cfg(target_os = "linux")'.dependencies]
# Spacedrive Sub-crates
sd-desktop-linux = { path = "../crates/linux" }
# Specific Desktop dependencies
# WARNING: dbus must NOT be vendored, as that breaks the app on Linux,X11,Nvidia
dbus = { version = "0.9.7", features = ["stdfd"] }
# https://github.com/tauri-apps/tauri/blob/tauri-v2.0.0-beta.17/core/tauri/Cargo.toml#L86
webkit2gtk = { version = "=2.0.1", features = ["v2_38"] }
[target.'cfg(target_os = "macos")'.dependencies]
# Spacedrive Sub-crates
sd-desktop-macos = { path = "../crates/macos" }
[target.'cfg(target_os = "windows")'.dependencies]
# Spacedrive Sub-crates
sd-desktop-windows = { path = "../crates/windows" }
webview2-com = "0.19.1"
[build-dependencies]
tauri-build = "=2.0.0-beta.13"
# Specific Desktop dependencies
tauri-build = "2.0.0-beta"
[features]
default = ["custom-protocol"]

View file

@ -156,7 +156,7 @@ async fn open_trash_in_os_explorer() -> Result<(), ()> {
#[cfg(target_os = "linux")]
{
Command::new("xdg-open")
.arg("~/.local/share/Trash/")
.arg("trash://")
.spawn()
.map_err(|err| error!("Error opening trash: {err:#?}"))?
.wait()

View file

@ -59,7 +59,7 @@
"files": {
"/usr/share/spacedrive/models/yolov8s.onnx": "../../.deps/models/yolov8s.onnx"
},
"depends": ["libc6", "libxdo3"]
"depends": ["libc6", "libxdo3", "dbus"]
}
},

View file

@ -14,8 +14,8 @@ crate-type = ["cdylib"]
# Spacedrive Sub-crates
sd-mobile-core = { path = "../../core" }
# FFI
jni = "0.21.1"
# Other
# Workspace dependencies
tracing = { workspace = true }
# Specific Mobile Android dependencies
jni = "0.21.1"

View file

@ -12,6 +12,7 @@ sd-core = { path = "../../../../../core", features = [
"mobile",
], default-features = false }
# Workspace dependencies
futures = { workspace = true }
once_cell = { workspace = true }
rspc = { workspace = true }
@ -19,5 +20,6 @@ serde_json = { workspace = true }
tokio = { workspace = true }
tracing = { workspace = true }
futures-channel = "0.3.29"
# Specific Mobile Core dependencies
futures-channel = "0.3.30"
futures-locks = "0.7.1"

View file

@ -6,7 +6,6 @@ license = { workspace = true }
repository = { workspace = true }
edition = { workspace = true }
[lib]
# iOS requires static linking
# Makes sense considering this lib needs to link against call_resolve and get_data_directory,

View file

@ -28,6 +28,7 @@ import { Modal, ModalRef } from '~/components/layout/Modal';
import { tw, twStyle } from '~/lib/tailwind';
import { useActionsModalStore } from '~/stores/modalStore';
import { toast } from '~/components/primitive/Toast';
import FileInfoModal from './FileInfoModal';
import RenameModal from './RenameModal';
@ -76,7 +77,11 @@ export const ActionsModal = () => {
const filePath = data && getIndexedItemFilePath(data);
// Open
const updateAccessTime = useLibraryMutation('files.updateAccessTime');
const updateAccessTime = useLibraryMutation('files.updateAccessTime', {
onSuccess: () => {
rspc.queryClient.invalidateQueries(['search.paths']);
}
});
const queriedFullPath = useLibraryQuery(['files.getPath', filePath?.id ?? -1], {
enabled: filePath != null
});
@ -99,9 +104,9 @@ export const ActionsModal = () => {
});
filePath &&
filePath.object_id &&
updateAccessTime.mutateAsync([filePath.object_id]).catch(console.error);
await updateAccessTime.mutateAsync([filePath.object_id]).catch(console.error);
} catch (error) {
// TODO: Handle Error & toast message
toast.error("Error opening object")
}
}
@ -179,7 +184,7 @@ export const ActionsModal = () => {
</View>
)}
</Modal>
<RenameModal objectName={filePath?.name ?? ''} ref={renameRef} />
<RenameModal ref={renameRef} />
<FileInfoModal ref={fileInfoRef} data={data} />
</>
);

View file

@ -1,6 +1,6 @@
import { getItemFilePath, humanizeSize, type ExplorerItem } from '@sd/client';
import { getItemFilePath, getItemObject, humanizeSize, type ExplorerItem } from '@sd/client';
import dayjs from 'dayjs';
import { Barcode, CaretLeft, Clock, Cube, Icon, SealCheck, Snowflake } from 'phosphor-react-native';
import { Barcode, CaretLeft, Clock, Cube, FolderOpen, Icon, SealCheck, Snowflake } from 'phosphor-react-native';
import { forwardRef } from 'react';
import { Pressable, Text, View } from 'react-native';
import FileThumb from '~/components/explorer/FileThumb';
@ -42,7 +42,7 @@ const FileInfoModal = forwardRef<ModalRef, FileInfoModalProps>((props, ref) => {
const { data } = props;
const modalRef = useForwardedRef(ref);
const filePathData = data && getItemFilePath(data);
const objectData = data && getItemObject(data);
return (
<Modal
ref={modalRef}
@ -86,6 +86,15 @@ const FileInfoModal = forwardRef<ModalRef, FileInfoModalProps>((props, ref) => {
/>
)}
{/* Accessed */}
<MetaItem
icon={FolderOpen}
title="Accessed"
value={objectData?.date_accessed ? dayjs(objectData.date_accessed).format('MMM Do YYYY') : '--'}
/>
{/* Modified */}
{filePathData && 'cas_id' in filePathData && (
<>
{/* Indexed */}

View file

@ -10,11 +10,8 @@ import useForwardedRef from '~/hooks/useForwardedRef';
import { tw } from '~/lib/tailwind';
import { useActionsModalStore } from '~/stores/modalStore';
interface Props {
objectName: string;
}
const RenameModal = forwardRef<ModalRef, Props>((props, ref) => {
const RenameModal = forwardRef<ModalRef>((_, ref) => {
const modalRef = useForwardedRef(ref);
const [newName, setNewName] = useState('');
const rspc = useRspcLibraryContext();
@ -22,6 +19,9 @@ const RenameModal = forwardRef<ModalRef, Props>((props, ref) => {
const inputRef = useRef<TextInput>(null);
const filePathData = data && getIndexedItemFilePath(data);
const fileName = filePathData?.name ?? '';
const fileExtension = filePathData?.extension ?? '';
const combined = `${fileName}${fileExtension ? `.${fileExtension}` : ''}`;
const renameFile = useLibraryMutation(['files.renameFile'], {
onSuccess: () => {
@ -35,8 +35,9 @@ const RenameModal = forwardRef<ModalRef, Props>((props, ref) => {
// set input value to object name on initial render
useEffect(() => {
setNewName(props.objectName);
}, [props.objectName]);
if (!fileName) return;
setNewName(combined);
}, [fileName, combined]);
const textRenameHandler = async () => {
switch (data?.type) {
@ -66,7 +67,7 @@ const RenameModal = forwardRef<ModalRef, Props>((props, ref) => {
<Modal
ref={modalRef}
title="Rename"
onDismiss={() => setNewName(props.objectName)}
onDismiss={() => setNewName(combined)}
enableContentPanningGesture={false}
enablePanDownToClose={false}
snapPoints={['20']}
@ -75,11 +76,11 @@ const RenameModal = forwardRef<ModalRef, Props>((props, ref) => {
<ModalInput
ref={inputRef}
autoFocus
onFocus={() => inputRef.current?.setSelection(0, newName.length)}
onFocus={() => inputRef.current?.setSelection(0, fileName.length)}
value={newName}
onChangeText={(t) => setNewName(t)}
/>
<Button disabled={newName.length === 0 || props.objectName === newName} onPress={textRenameHandler} variant="accent">
<Button disabled={newName.length === 0 || fileName === newName} onPress={textRenameHandler} variant="accent">
<Text style={tw`font-medium text-ink`}>Save</Text>
</Button>
</View>

View file

@ -7,7 +7,7 @@ edition.workspace = true
repository.workspace = true
[dependencies]
hex.workspace = true
# Workspace dependencies
libp2p = { version = "0.53.2", features = [
"tokio",
"quic",
@ -17,8 +17,11 @@ libp2p = { version = "0.53.2", features = [
] }
reqwest = { workspace = true, features = ["json", "native-tls-vendored"] }
serde = { workspace = true, features = ["derive"] }
serde_json.workspace = true
serde_json = { workspace = true }
tokio = { workspace = true, features = ["macros", "rt-multi-thread"] }
tracing.workspace = true
tracing-subscriber = { version = "0.3.18", features = ["env-filter"] }
tracing = { workspace = true }
tracing-subscriber = { workspace = true, features = ["env-filter"] }
uuid = { workspace = true, features = ["serde", "v4"] }
# Specific P2P Relay dependencies
hex = "0.4.3"

View file

@ -14,15 +14,16 @@ ai-models = ["sd-core/ai"]
# Spacedrive Sub-crates
sd-core = { path = "../../core", features = ["ffmpeg", "heif"] }
# Workspace dependencies
axum = { workspace = true, features = ["headers"] }
base64 = { workspace = true }
http = { workspace = true }
rspc = { workspace = true, features = ["axum"] }
tempfile = { workspace = true }
tokio = { workspace = true, features = ["sync", "rt-multi-thread", "signal"] }
tracing = { workspace = true }
base64 = { workspace = true }
tempfile = "3.10.1"
# Specific Desktop dependencies
include_dir = "0.7.3"
mime_guess = "2.0.4"
mime_guess = "2.0"
secstr = "0.5.1"

View file

@ -1,4 +1,4 @@
import { discordUrl, libraryName, privacyUrl } from '../fixtures/onboarding.json';
import { libraryName, privacyUrl } from '../fixtures/onboarding.json';
import {
libraryRegex,
newLibraryRegex,
@ -39,7 +39,7 @@ describe('Onboarding', () => {
// Check Join Discord button exists and point to a valid discord invite
cy.get('button').contains('Join Discord').click();
cy.get('@winOpen').should('be.calledWith', discordUrl);
cy.get('@winOpen').should('be.calledWithMatch', /https:\/\/discord.gg\/.+/);
// Check we have a button to continue to the Library creation
cy.get('a')

View file

@ -1,5 +1,4 @@
{
"discordUrl": "https://discord.gg/ukRnWSnAbG",
"privacyUrl": "https://www.spacedrive.com/docs/product/resources/privacy",
"libraryName": "Test Library"
}

View file

@ -13,10 +13,13 @@ default = []
# This feature allows features to be disabled when the Core is running on mobile.
mobile = []
# This feature controls whether the Spacedrive Core contains functionality which requires FFmpeg.
ffmpeg = ["dep:sd-ffmpeg", "sd-core-heavy-lifting/ffmpeg", "sd-media-metadata/ffmpeg"]
ffmpeg = [
"dep:sd-ffmpeg",
"sd-core-heavy-lifting/ffmpeg",
"sd-media-metadata/ffmpeg",
]
heif = ["sd-images/heif"]
ai = ["dep:sd-ai"]
crypto = ["dep:sd-crypto"]
[dependencies]
# Inner Core Sub-crates
@ -25,14 +28,11 @@ sd-core-heavy-lifting = { path = "./crates/heavy-lifting" }
sd-core-indexer-rules = { path = "./crates/indexer-rules" }
sd-core-prisma-helpers = { path = "./crates/prisma-helpers" }
sd-core-sync = { path = "./crates/sync" }
# Spacedrive Sub-crates
sd-actors = { path = "../crates/actors", version = "0.1.0" }
sd-actors = { path = "../crates/actors" }
sd-ai = { path = "../crates/ai", optional = true }
sd-cloud-api = { path = "../crates/cloud-api", version = "0.1.0" }
sd-crypto = { path = "../crates/crypto", features = [
"sys",
"tokio",
], optional = true }
sd-cloud-api = { path = "../crates/cloud-api" }
sd-ffmpeg = { path = "../crates/ffmpeg", optional = true }
sd-file-ext = { path = "../crates/file-ext" }
sd-images = { path = "../crates/images", features = [
@ -54,10 +54,14 @@ async-channel = { workspace = true }
async-trait = { workspace = true }
axum = { workspace = true, features = ["ws"] }
base64 = { workspace = true }
base91 = { workspace = true }
blake3 = { workspace = true }
chrono = { workspace = true, features = ["serde"] }
directories = { workspace = true }
futures = { workspace = true }
futures-concurrency = { workspace = true }
gix-ignore = { workspace = true }
hyper = { workspace = true, features = ["http1", "server", "client"] }
image = { workspace = true }
itertools = { workspace = true }
libc = { workspace = true }
@ -67,6 +71,7 @@ pin-project-lite = { workspace = true }
prisma-client-rust = { workspace = true, features = ["rspc"] }
regex = { workspace = true }
reqwest = { workspace = true, features = ["json", "native-tls-vendored"] }
rmp = { workspace = true }
rmp-serde = { workspace = true }
rmpv = { workspace = true }
rspc = { workspace = true, features = [
@ -96,62 +101,57 @@ tokio = { workspace = true, features = [
tokio-stream = { workspace = true, features = ["fs"] }
tokio-util = { workspace = true, features = ["io"] }
tracing = { workspace = true }
tracing-appender = { workspace = true }
tracing-subscriber = { workspace = true, features = ["env-filter"] }
uuid = { workspace = true, features = ["v4", "serde"] }
webp = { workspace = true }
# Specific Core dependencies
async-recursion = "1.0.5"
async-recursion = "1.1"
async-stream = "0.3.5"
aws-sdk-s3 = { version = "1.5.0", features = ["behavior-version-latest"] }
aws-config = "1.0.3"
aws-credential-types = "1.0.3"
base91 = "0.1.0"
bytes = "1.5.0"
ctor = "0.2.5"
directories = "5.0.1"
flate2 = "1.0.28"
hostname = "0.3.1"
http-body = "0.4.5"
aws-sdk-s3 = { version = "1.34", features = ["behavior-version-latest"] }
aws-config = "1.5"
aws-credential-types = "1.2"
bytes = "1.6"
ctor = "0.2.8"
flate2 = "1.0"
hostname = "0.4.0"
http-body = "0.4.6" # Update blocked by http
http-range = "0.1.5"
hyper = { version = "=0.14.28", features = ["http1", "server", "client"] }
int-enum = "0.5.0"
mini-moka = "0.10.2"
int-enum = "0.5" # Update blocked due to API breaking changes
mini-moka = "0.10.3"
notify = { git = "https://github.com/notify-rs/notify.git", rev = "c3929ed114fbb0bc7457a9a498260461596b00ca", default-features = false, features = [
"macos_fsevent",
] }
rmp = "0.8.12"
serde-hashkey = "0.4.5"
serde_repr = "0.1"
serde_with = "3.4.0"
slotmap = "1.0.6"
sysinfo = "0.29.10"
tar = "0.4.40"
serde_repr = "0.1.19"
serde_with = "3.8"
slotmap = "1.0"
sysinfo = "0.29.11" # Update blocked due to API breaking changes
tar = "0.4.41"
tower-service = "0.3.2"
gix-ignore = "0.11.2"
tracing-appender = "0.2.3"
# Override features of transitive dependencies
[dependencies.openssl]
version = "=0.10.61"
version = "=0.10.64"
features = ["vendored"]
[dependencies.openssl-sys]
version = "=0.9.97"
version = "=0.9.102"
features = ["vendored"]
# Platform-specific dependencies
[target.'cfg(target_os = "macos")'.dependencies]
plist = "1"
trash = "4.1.0"
plist = "1.6"
trash = "4.1"
[target.'cfg(target_os = "linux")'.dependencies]
trash = "4.1.0"
trash = "4.1"
[target.'cfg(target_os = "windows")'.dependencies]
trash = "4.1.0"
trash = "4.1"
[target.'cfg(target_os = "ios")'.dependencies]
icrate = { version = "0.1.0", features = [
icrate = { version = "0.1.2", features = [
"Foundation",
"Foundation_NSFileManager",
"Foundation_NSString",
@ -162,5 +162,6 @@ icrate = { version = "0.1.0", features = [
# Workspace dependencies
globset = { workspace = true }
tracing-test = { workspace = true }
# Specific Core dependencies
aovec = "1.1.0"
boxcar = "0.2.5"

View file

@ -16,6 +16,7 @@ sd-core-prisma-helpers = { path = "../prisma-helpers" }
sd-prisma = { path = "../../../crates/prisma" }
sd-utils = { path = "../../../crates/utils" }
# Workspace dependencies
chrono = { workspace = true, features = ["serde"] }
prisma-client-rust = { workspace = true }
regex = { workspace = true }
@ -24,5 +25,5 @@ thiserror = { workspace = true }
tokio = { workspace = true, features = ["fs"] }
tracing = { workspace = true }
[target.'cfg(windows)'.dependencies.winapi-util]
version = "0.1.6"
[target.'cfg(windows)'.dependencies]
winapi-util = "0.1.8"

View file

@ -6,8 +6,6 @@ license = { workspace = true }
repository = { workspace = true }
edition = { workspace = true }
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
[features]
default = []
# This feature controls whether the Spacedrive Heavy Lifting contains functionality which requires FFmpeg.
@ -19,7 +17,8 @@ sd-core-file-path-helper = { path = "../file-path-helper" }
sd-core-indexer-rules = { path = "../indexer-rules" }
sd-core-prisma-helpers = { path = "../prisma-helpers" }
sd-core-sync = { path = "../sync" }
# Sub-crates
# Spacedrive Sub-crates
sd-ffmpeg = { path = "../../../crates/ffmpeg", optional = true }
sd-file-ext = { path = "../../../crates/file-ext" }
sd-images = { path = "../../../crates/images" }
@ -28,6 +27,7 @@ sd-prisma = { path = "../../../crates/prisma" }
sd-sync = { path = "../../../crates/sync" }
sd-task-system = { path = "../../../crates/task-system" }
sd-utils = { path = "../../../crates/utils" }
# Workspace dependencies
async-channel = { workspace = true }
async-trait = { workspace = true }
@ -41,8 +41,8 @@ itertools = { workspace = true }
lending-stream = { workspace = true }
once_cell = { workspace = true }
prisma-client-rust = { workspace = true }
rmp-serde = { workspace = true }
rmpv = { workspace = true }
rmp-serde = { workspace = true }
rspc = { workspace = true }
serde = { workspace = true, features = ["derive"] }
serde_json = { workspace = true }
@ -56,7 +56,6 @@ tracing = { workspace = true }
uuid = { workspace = true, features = ["v4", "serde"] }
webp = { workspace = true }
[dev-dependencies]
tempfile = { workspace = true }
tracing-test = { workspace = true }

View file

@ -9,15 +9,15 @@ license = { workspace = true }
repository = { workspace = true }
edition = { workspace = true }
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
[dependencies]
# Spacedrive Sub-crates
sd-prisma = { path = "../../../crates/prisma" }
sd-utils = { path = "../../../crates/utils" }
# Workspace dependencies
chrono = { workspace = true }
futures-concurrency = { workspace = true }
gix-ignore = { workspace = true, features = ["serde"] }
globset = { workspace = true, features = ["serde1"] }
once_cell = { workspace = true }
prisma-client-rust = { workspace = true }
@ -29,7 +29,6 @@ thiserror = { workspace = true }
tokio = { workspace = true, features = ["fs"] }
tracing = { workspace = true }
uuid = { workspace = true, features = ["v4", "serde"] }
gix-ignore = { version = "0.11.2", features = ["serde"] }
[dev-dependencies]
tempfile = { workspace = true }

View file

@ -6,11 +6,10 @@ license = { workspace = true }
repository = { workspace = true }
edition = { workspace = true }
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
[dependencies]
# Spacedrive Sub-crates
sd-prisma = { path = "../../../crates/prisma" }
# Workspace dependencies
prisma-client-rust = { workspace = true }
serde = { workspace = true }

View file

@ -13,12 +13,13 @@ sd-sync = { path = "../../../crates/sync" }
sd-utils = { path = "../../../crates/utils" }
sd-actors = { path = "../../../crates/actors" }
# Workspace dependencies
prisma-client-rust = { workspace = true }
rmpv = { workspace = true }
rmp-serde = { workspace = true }
serde = { workspace = true }
serde_json = { workspace = true }
tokio = { workspace = true }
uuid = { workspace = true }
tracing.workspace = true
tracing = { workspace = true }
uhlc = { workspace = true }
rmp-serde = "1.1.2"
rmpv = { workspace = true }
uuid = { workspace = true }

View file

@ -1,5 +1,6 @@
use std::{
collections::BTreeMap,
num::NonZeroU128,
ops::Deref,
sync::{atomic::Ordering, Arc},
};
@ -201,7 +202,10 @@ impl Actor {
// first, we update the HLC's timestamp with the incoming one.
// this involves a drift check + sets the last time of the clock
self.clock
.update_with_timestamp(&Timestamp::new(new_timestamp, instance.into()))
.update_with_timestamp(&Timestamp::new(
new_timestamp,
uhlc::ID::from(NonZeroU128::new(instance.to_u128_le()).expect("Non zero id")),
))
.expect("timestamp has too much drift!");
// read the timestamp for the operation's instance, or insert one if it doesn't exist
@ -471,7 +475,11 @@ mod test {
let shared = Arc::new(SharedState {
db: sd_prisma::test_db().await,
instance,
clock: HLCBuilder::new().with_id(instance.into()).build(),
clock: HLCBuilder::new()
.with_id(uhlc::ID::from(
NonZeroU128::new(instance.to_u128_le()).expect("Non zero id"),
))
.build(),
timestamps: Default::default(),
emit_messages_flag: Arc::new(AtomicBool::new(true)),
active: Default::default(),

View file

@ -8,6 +8,7 @@ use std::{
cmp::Ordering,
collections::HashMap,
fmt,
num::NonZeroU128,
ops::Deref,
sync::{
atomic::{self, AtomicBool},
@ -55,7 +56,11 @@ impl Manager {
) -> New {
let (tx, rx) = broadcast::channel(64);
let clock = HLCBuilder::new().with_id(instance.into()).build();
let clock = HLCBuilder::new()
.with_id(uhlc::ID::from(
NonZeroU128::new(instance.to_u128_le()).expect("Non zero id"),
))
.build();
let shared = Arc::new(SharedState {
db: db.clone(),

View file

@ -194,7 +194,17 @@ pub(crate) fn mount() -> AlphaRouter<Ctx> {
match fs::metadata(&path).await {
Ok(_) => {
#[cfg(not(any(target_os = "ios", target_os = "android")))]
trash::delete(&path).unwrap();
trash::delete(&path).map_err(|e| {
FileIOError::from((
path,
match e {
#[cfg(all(unix, not(target_os = "macos")))]
trash::Error::FileSystem { path: _, source: e } => e,
_ => io::Error::other(e),
},
"Failed to delete file",
))
})?;
Ok(())
}

View file

@ -546,7 +546,17 @@ pub(crate) fn mount() -> AlphaRouter<Ctx> {
);
#[cfg(not(any(target_os = "ios", target_os = "android")))]
trash::delete(full_path).unwrap();
trash::delete(&full_path).map_err(|e| {
FileIOError::from((
full_path,
match e {
#[cfg(all(unix, not(target_os = "macos")))]
trash::Error::FileSystem { path: _, source: e } => e,
_ => io::Error::other(e),
},
"Failed to delete file",
))
})?;
Ok(())
}

View file

@ -4,7 +4,7 @@ use sd_prisma::{
prisma::{file_path, object, tag, tag_on_object},
prisma_sync,
};
use sd_sync::{option_sync_db_entry, option_sync_entry, sync_entry, OperationFactory};
use sd_sync::{option_sync_db_entry, OperationFactory};
use sd_utils::{msgpack, uuid_to_bytes};
use std::collections::BTreeMap;

View file

@ -270,7 +270,7 @@ pub fn base_router() -> Router<LocalState> {
serve_from,
..
},
library,
..
) = get_or_init_lru_entry(&state, path).await?;
match serve_from {

View file

@ -34,8 +34,6 @@ use tracing_subscriber::{filter::FromEnvError, prelude::*, EnvFilter};
pub mod api;
mod cloud;
#[cfg(feature = "crypto")]
pub(crate) mod crypto;
pub mod custom_uri;
mod env;
pub mod library;

View file

@ -406,7 +406,6 @@ impl Libraries {
.iter()
.flatten()
.filter_map(|i| RemoteIdentity::from_bytes(&i.remote_identity).ok())
.into_iter()
.any(|i| i == *instance)
.then(|| Arc::clone(library))
}),

View file

@ -613,7 +613,7 @@ pub async fn relink_location(
metadata.relink(*id, location_path).await?;
let pub_id = metadata.location_pub_id(*id)?.as_ref().to_vec();
let pub_id = <Uuid as AsRef<[u8]>>::as_ref(&metadata.location_pub_id(*id)?).to_vec();
let path = location_path
.to_str()
.map(str::to_string)

View file

@ -160,11 +160,8 @@ impl StatefulJob for OldFileEraserJobInit {
init.passes
);
#[cfg(feature = "crypto")]
// sd_crypto::fs::erase::erase_async(&mut file, file_len as usize, init.passes).await?;
#[cfg(not(feature = "crypto"))]
warn!("File not fully erased due to missing crypto module");
// TODO: File is only being truncated and not actually erased,
// we should provide a way for securely overwriting the file with random data
file.set_len(0)
.await
.map_err(|e| FileIOError::from((&step.full_path, e)))?;

View file

@ -5,7 +5,6 @@ use sd_sync::*;
use chrono::{DateTime, FixedOffset, Utc};
use sd_utils::msgpack;
use serde::Deserialize;
use specta::Type;
use uuid::Uuid;

View file

@ -240,7 +240,7 @@ impl<'a> Drop for Bomb<'a> {
mod tests {
use std::{sync::Arc, time::Duration};
use aovec::Aovec;
use boxcar;
// Not using super because `use super as mpscrr` doesn't work :(
use crate::util::mpscrr;
@ -255,7 +255,7 @@ mod tests {
#[tokio::test]
async fn test_mpscrr() {
let stack = Arc::new(Aovec::new(5));
let stack = Arc::new(boxcar::Vec::new());
let (tx, rx) = mpscrr::unbounded_channel::<u8, u8>();
@ -315,16 +315,12 @@ mod tests {
assert_eq!(result, vec![1, 2]);
// Check the order of operations
assert_eq!(
&aovec_to_vec(&stack),
&to_vec(&stack),
&[Step::Send, Step::RecvA, Step::RecvB, Step::SendComplete,]
)
}
fn aovec_to_vec<T: Clone>(a: &Aovec<T>) -> Vec<T> {
let mut v = Vec::with_capacity(a.len());
for i in 0..a.len() {
v.push(a.get(i).unwrap().clone());
}
v
fn to_vec<T: Clone>(a: &boxcar::Vec<T>) -> Vec<T> {
a.iter().map(|(_, entry)| entry).cloned().collect()
}
}

View file

@ -5,8 +5,6 @@ license.workspace = true
edition.workspace = true
repository.workspace = true
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
[dependencies]
futures.workspace = true
tokio.workspace = true
futures = { workspace = true }
tokio = { workspace = true }

View file

@ -29,19 +29,19 @@ once_cell = { workspace = true }
prisma-client-rust = { workspace = true }
reqwest = { workspace = true, features = ["stream", "native-tls-vendored"] }
rmp-serde = { workspace = true }
rmpv = { workspace = true }
serde = { workspace = true, features = ["derive"] }
serde_json = { workspace = true }
thiserror = { workspace = true }
tokio = { workspace = true, features = ["fs"] }
tokio-stream = { workspace = true }
tracing = { workspace = true }
url = '2.5.0'
uuid = { workspace = true, features = ["v4", "serde"] }
# Note: Keep same version as used by ort
ndarray = { version = "0.15.6" }
# Note: half and ndarray version must be the same as used in ort
half = { version = "2.1", features = ['num-traits'] }
rmpv.workspace = true
ndarray = "0.15"
url = '2.5.0'
# Microsoft does not provide a release for osx-gpu. See: https://github.com/microsoft/onnxruntime/releases
# "gpu" means CUDA or TensorRT EP. Thus, the ort crate cannot download them at build time.

View file

@ -9,6 +9,7 @@ repository.workspace = true
# Spacedrive Sub-crates
sd-p2p = { path = "../p2p" }
# Workspace dependencies
base64 = { workspace = true }
reqwest = { workspace = true, features = ["native-tls-vendored"] }
rmpv = { workspace = true }

View file

@ -13,8 +13,10 @@ repository = { workspace = true }
edition = { workspace = true }
[dependencies]
# Spacedrive Sub-crates
sd-utils = { path = "../utils" }
# Workspace dependencies
chrono = { workspace = true, features = ["serde"] }
image = { workspace = true }
libc = { workspace = true }
@ -23,7 +25,8 @@ tokio = { workspace = true, features = ["fs", "rt"] }
tracing = { workspace = true }
webp = { workspace = true }
ffmpeg-sys-next = "6.0.1"
# Specific FFmpeg dependencies
ffmpeg-sys-next = "7.0"
[dev-dependencies]
tempfile = { workspace = true }

View file

@ -1,6 +1,6 @@
[package]
name = "sd-images"
version = "0.0.0"
version = "0.1.0"
authors = [
"Jake Robinson <jake@spacedrive.com>",
"Vítor Vasconcellos <vitor@spacedrive.com>",
@ -13,6 +13,7 @@ edition = { workspace = true }
heif = ["dep:libheif-rs", "dep:libheif-sys"]
[dependencies]
# Workspace dependencies
image = { workspace = true }
once_cell = { workspace = true }
rspc = { workspace = true, optional = true } # error conversion
@ -21,18 +22,17 @@ serde = { workspace = true, optional = true, features = ["derive"] }
thiserror = { workspace = true }
tracing = { workspace = true }
bincode = { version = "2.0.0-rc.3", features = [
# Specific Images dependencies
bincode = { version = "=2.0.0-rc.3", features = [
"derive",
"alloc",
], optional = true }
resvg = "0.40.0"
# both of these added *default* bindgen features in 0.22.0 and 2.0.0 respectively
# this broke builds as we build our own liibheif, so i disabled their default features
libheif-rs = { version = "0.22.0", default-features = false, optional = true }
libheif-sys = { version = "2.0.0", default-features = false, optional = true }
# Disable defaults for libheif* to avoid bindgen and use pre-compiled headers
libheif-rs = { version = "1.0", default-features = false, optional = true }
libheif-sys = { version = "2.1", default-features = false, optional = true }
pdfium-render = { version = "0.8.15", features = [
"sync",
"image",
"thread_safe",
] }
resvg = "0.42.0"

View file

@ -1,12 +1,8 @@
use std::path::Path;
use std::{path::Path, sync::Arc};
use crate::{consts::SVG_TARGET_PX, scale_dimensions, Error, ImageHandler, Result};
use image::DynamicImage;
use resvg::{
tiny_skia::{self},
usvg,
};
use usvg::fontdb;
use resvg::{tiny_skia, usvg};
#[derive(PartialEq, Eq)]
pub struct SvgHandler {}
@ -20,9 +16,28 @@ impl ImageHandler for SvgHandler {
)]
fn handle_image(&self, path: &Path) -> Result<DynamicImage> {
let data = self.get_data(path)?;
let mut fontdb = fontdb::Database::new();
let mut fontdb = usvg::fontdb::Database::new();
fontdb.load_system_fonts();
let rtree = usvg::Tree::from_data(&data, &usvg::Options::default(), &fontdb)?;
let options = usvg::Options {
resources_dir: None,
dpi: 96.0,
// Default font is user-agent dependent so we can use whichever we like.
font_family: "Times New Roman".to_owned(),
font_size: 12.0,
languages: vec!["en".to_string()],
shape_rendering: usvg::ShapeRendering::default(),
text_rendering: usvg::TextRendering::default(),
image_rendering: usvg::ImageRendering::default(),
#[allow(clippy::expect_used)]
default_size: usvg::Size::from_wh(100.0, 100.0).expect("Must be a valid size"),
image_href_resolver: usvg::ImageHrefResolver::default(),
font_resolver: usvg::FontResolver::default(),
fontdb: Arc::new(fontdb),
};
let rtree = usvg::Tree::from_data(&data, &options)?;
let (scaled_w, scaled_h) =
scale_dimensions(rtree.size().width(), rtree.size().height(), SVG_TARGET_PX);

View file

@ -1,6 +1,6 @@
[package]
name = "sd-media-metadata"
version = "0.0.0"
version = "0.1.0"
authors = [
"Jake Robinson <jake@spacedrive.com>",
"Vítor Vasconcellos <vitor@spacedrive.com>",
@ -12,19 +12,19 @@ edition = "2021"
ffmpeg = ["dep:sd-ffmpeg"]
[dependencies]
# Spacedrive Sub-crates
sd-ffmpeg = { path = "../ffmpeg", optional = true }
sd-utils = { path = "../utils" }
# Workspace dependencies
chrono = { workspace = true, features = ["serde"] }
image = { workspace = true }
rand = { workspace = true }
rand_chacha = { workspace = true }
serde = { workspace = true, features = ["derive"] }
serde_json = { workspace = true }
specta = { workspace = true, features = ["chrono"] }
thiserror = { workspace = true }
tokio = { workspace = true }
# Specific Media Metadata dependencies
kamadak-exif = "0.5.5"
# symphonia crate looks great for audio metadata

View file

@ -9,8 +9,6 @@ use crate::{
Error, Result,
};
use exif::Tag;
use rand::{Rng, SeedableRng};
use rand_chacha::ChaCha20Rng;
use std::ops::Neg;
#[derive(Default, Clone, PartialEq, Debug, serde::Serialize, serde::Deserialize, specta::Type)]
@ -108,26 +106,6 @@ impl MediaLocation {
.ok_or(Error::MediaLocationParse)
}
#[must_use]
pub fn generate() -> Self {
let mut rng = ChaCha20Rng::from_entropy();
let latitude = rng.gen_range(-LAT_MAX_POS..=LAT_MAX_POS);
let longitude = rng.gen_range(-LONG_MAX_POS..=LONG_MAX_POS);
let pluscode = PlusCode::new(latitude, longitude);
let altitude = Some(rng.gen_range(ALT_MIN_HEIGHT..=ALT_MAX_HEIGHT));
let direction = Some(rng.gen_range(0..=DIRECTION_MAX));
Self {
latitude,
longitude,
pluscode,
altitude,
direction,
}
}
/// This returns the contained coordinates as `(latitude, longitude)`
///
/// # Examples

View file

@ -15,8 +15,14 @@ default = []
specta = []
[dependencies]
# Workspace dependencies
base64 = { workspace = true }
base91 = { workspace = true }
ed25519-dalek = { workspace = true }
futures = { workspace = true }
pin-project-lite = { workspace = true }
reqwest = { workspace = true }
rmp-serde = { workspace = true }
serde = { workspace = true, features = ["derive"] }
specta = { workspace = true }
thiserror = { workspace = true }
@ -31,16 +37,16 @@ tokio-stream = { workspace = true, features = ["sync"] }
tokio-util = { workspace = true, features = ["compat"] }
tracing = { workspace = true }
uuid = { workspace = true, features = ["serde"] }
reqwest = { workspace = true }
futures = { workspace = true }
ed25519-dalek = { version = "2.1.1", features = [] }
# Specific P2P dependencies
dns-lookup = "2.0"
flume = "=0.11.0" # Must match version used by `mdns-sd`
futures-core = "0.3.30"
hash_map_diff = "0.2.0"
if-watch = { version = "=3.2.0", features = [
"tokio",
] } # Override the features of if-watch which is used by libp2p-quic
libp2p = { version = "0.53.2", features = [
] } # Override features used by libp2p-quic
libp2p = { version = "=0.53.2", features = [
"tokio",
"serde",
"macros",
@ -50,21 +56,17 @@ libp2p = { version = "0.53.2", features = [
"yamux",
"noise",
"dcutr",
] }
libp2p-stream = "0.1.0-alpha"
mdns-sd = "0.10.3"
rand_core = { version = "0.6.4" }
streamunordered = "0.5.3"
zeroize = { version = "1.7.0", features = ["derive"] }
base91 = "0.1.0"
] } # Update blocked due to custom patch
libp2p-stream = "=0.1.0-alpha" # Update blocked due to custom patch
mdns-sd = "0.11.1"
rand_core = "0.6.4"
sha256 = "1.5.0"
stable-vec = "0.4.0"
hash_map_diff = "0.2.0"
sync_wrapper = "0.1.2"
rmp-serde = "1.3.0"
dns-lookup = "2.0.4"
stable-vec = "0.4.1"
streamunordered = "0.5.3"
sync_wrapper = "1.0"
zeroize = { version = "1.8", features = ["derive"] }
[dev-dependencies]
tokio = { workspace = true, features = ["rt-multi-thread", "macros"] }
tracing-subscriber = { version = "0.3.18" }
tracing-subscriber = { workspace = true }
uuid = { workspace = true, features = ["v4"] }

View file

@ -11,6 +11,7 @@ repository.workspace = true
sd-p2p = { path = "../../" }
sd-p2p-proto = { path = "../proto" }
# Workspace dependencies
thiserror = { workspace = true }
tokio = { workspace = true }
tracing = { workspace = true }

View file

@ -7,8 +7,7 @@ edition.workspace = true
repository.workspace = true
[dependencies]
ed25519-dalek = { workspace = true }
thiserror = { workspace = true }
tokio = { workspace = true, features = ["io-util"] }
uuid = { workspace = true }
ed25519-dalek = "2.1.1"

View file

@ -11,6 +11,7 @@ repository.workspace = true
sd-p2p = { path = "../../" }
sd-p2p-proto = { path = "../proto" }
# Workspace dependencies
tokio = { workspace = true, features = ["io-util"] }
thiserror = { workspace = true }
uuid = { workspace = true, features = ["v4"] }

View file

@ -9,4 +9,5 @@ edition = { workspace = true }
# Spacedrive Sub-crates
sd-sync-generator = { path = "../sync-generator" }
# Workspace dependencies
prisma-client-rust-cli = { workspace = true }

View file

@ -7,9 +7,10 @@ edition = "2021"
# Spacedrive Sub-crates
sd-sync = { path = "../sync" }
# Workspace dependencies
prisma-client-rust = { workspace = true }
rmpv = { workspace = true }
rmp-serde = { workspace = true }
serde = { workspace = true }
serde_json = { workspace = true }
rmp-serde = "1.1.2"
rmpv.workspace = true
uuid = { workspace = true }

View file

@ -10,4 +10,5 @@ prisma-client-rust-sdk = { workspace = true }
serde = { workspace = true, features = ["derive"] }
thiserror = { workspace = true }
# Specific Sync Generator dependencies
nom = "7.1.3"

View file

@ -7,8 +7,8 @@ edition = { workspace = true }
[dependencies]
prisma-client-rust = { workspace = true }
rmp = "0.8.12"
rmp-serde = "1.1.2"
rmp = { workspace = true }
rmp-serde = { workspace = true }
rmpv = { workspace = true }
serde = { workspace = true }
serde_json = { workspace = true }

View file

@ -11,14 +11,16 @@ edition = { workspace = true }
# Spacedrive Sub-crates
sd-sync = { path = ".." }
# Workspace dependencies
axum = { workspace = true }
rspc = { workspace = true, features = ["axum"] }
tokio = { workspace = true, features = ["full"] }
http = { workspace = true }
prisma-client-rust = { workspace = true }
rspc = { workspace = true, features = ["axum"] }
serde_json = { workspace = true }
serde = { workspace = true, features = ["derive"] }
tokio = { workspace = true, features = ["full"] }
uuid = { workspace = true, features = ["v4"] }
# Specific Core dependencies
dotenv = "0.15.0"
tower-http = { version = "0.3.4", features = ["cors"] }
http = "0.2.8"
tower-http = { version = "0.4.4", features = ["cors"] } # Update blocked by http

View file

@ -7,8 +7,6 @@ license.workspace = true
edition.workspace = true
repository.workspace = true
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
[dependencies]
# Workspace deps
async-channel = { workspace = true }
@ -25,9 +23,10 @@ tokio = { workspace = true, features = [
tokio-stream = { workspace = true }
tracing = { workspace = true }
uuid = { workspace = true, features = ["v4"] }
# External deps
downcast-rs = "1.2.0"
pin-project = "1.1.4"
# Specific Task System dependencies
downcast-rs = "1.2"
pin-project = "1.1"
[dev-dependencies]
lending-stream = { workspace = true }

View file

@ -3,12 +3,11 @@ name = "sd-utils"
version = "0.1.0"
edition = "2021"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
[dependencies]
# Spacedrive Sub-crates
sd-prisma = { path = "../prisma" }
# Workspace dependencies
prisma-client-rust = { workspace = true }
rspc = { workspace = true, features = ["unstable"] }
thiserror = { workspace = true }

View file

@ -0,0 +1 @@

View file

@ -145,14 +145,6 @@ export default () => {
<Icon component={Receipt} />
{t('changelog')}
</SidebarLink>
{/* <SidebarLink to="resources/dependencies">
<Icon component={Graph} />
Dependencies
</SidebarLink>
<SidebarLink to="resources/support">
<Icon component={Heart} />
Support
</SidebarLink> */}
</Section>
</div>
</div>

View file

@ -1,51 +1,51 @@
import { useQuery } from '@tanstack/react-query';
import { ScreenHeading } from '@sd/ui';
import { usePlatform } from '~/util/Platform';
// import { useQuery } from '@tanstack/react-query';
// import { ScreenHeading } from '@sd/ui';
// import { usePlatform } from '~/util/Platform';
export const Component = () => {
const frontEnd = useQuery(
['frontend-deps'],
() => import('@sd/assets/deps/frontend-deps.json')
);
const backEnd = useQuery(['backend-deps'], () => import('@sd/assets/deps/backend-deps.json'));
const platform = usePlatform();
// export const Component = () => {
// const frontEnd = useQuery(
// ['frontend-deps'],
// () => import('@sd/assets/deps/frontend-deps.json')
// );
// const backEnd = useQuery(['backend-deps'], () => import('@sd/assets/deps/backend-deps.json'));
// const platform = usePlatform();
return (
<div className="custom-scroll page-scroll flex h-screen w-full flex-col bg-app p-5">
<ScreenHeading>Dependencies</ScreenHeading>
// return (
// <div className="custom-scroll page-scroll flex h-screen w-full flex-col bg-app p-5">
// <ScreenHeading>Dependencies</ScreenHeading>
{/* item has a LOT more data that we can display, i just went with the basics */}
// {/* item has a LOT more data that we can display, i just went with the basics */}
<ScreenHeading className="mb-2">Frontend Dependencies</ScreenHeading>
<div className="grid gap-6 space-x-1 xl:grid-cols-4 2xl:grid-cols-6">
{frontEnd.data &&
frontEnd.data?.default.map((item) => {
return (
<a key={item.title} onClick={() => platform.openLink(item.url ?? '')}>
<div className="rounded border-2 border-gray-500 p-4 text-gray-300">
<h4 className="text-center">
{item.title.trimEnd().substring(0, 24) +
(item.title.length > 24 ? '...' : '')}
</h4>
</div>
</a>
);
})}
</div>
// <ScreenHeading className="mb-2">Frontend Dependencies</ScreenHeading>
// <div className="grid gap-6 space-x-1 xl:grid-cols-4 2xl:grid-cols-6">
// {frontEnd.data &&
// frontEnd.data?.default.map((item) => {
// return (
// <a key={item.title} onClick={() => platform.openLink(item.url ?? '')}>
// <div className="rounded border-2 border-gray-500 p-4 text-gray-300">
// <h4 className="text-center">
// {item.title.trimEnd().substring(0, 24) +
// (item.title.length > 24 ? '...' : '')}
// </h4>
// </div>
// </a>
// );
// })}
// </div>
<ScreenHeading className="mb-2">Backend Dependencies</ScreenHeading>
<div className="grid gap-6 space-x-1 lg:grid-cols-7">
{backEnd.data &&
backEnd.data?.default.map((item) => {
return (
<a key={item.title} onClick={() => platform.openLink(item.url ?? '')}>
<div className="rounded border-2 border-gray-500 p-4 text-gray-300">
<h4 className="text-center">{item.title.trimEnd()}</h4>
</div>
</a>
);
})}
</div>
</div>
);
};
// <ScreenHeading className="mb-2">Backend Dependencies</ScreenHeading>
// <div className="grid gap-6 space-x-1 lg:grid-cols-7">
// {backEnd.data &&
// backEnd.data?.default.map((item) => {
// return (
// <a key={item.title} onClick={() => platform.openLink(item.url ?? '')}>
// <div className="rounded border-2 border-gray-500 p-4 text-gray-300">
// <h4 className="text-center">{item.title.trimEnd()}</h4>
// </div>
// </a>
// );
// })}
// </div>
// </div>
// );
// };

View file

@ -3,6 +3,5 @@ import { RouteObject } from 'react-router';
export default [
{ path: 'about', lazy: () => import('./about') },
{ path: 'changelog', lazy: () => import('./changelog') },
{ path: 'dependencies', lazy: () => import('./dependencies') },
{ path: 'support', lazy: () => import('./support') }
// { path: 'dependencies', lazy: () => import('./dependencies') },
] satisfies RouteObject[];

View file

@ -1,12 +0,0 @@
import { useLocale } from '~/hooks';
import { Heading } from '../Layout';
export const Component = () => {
const { t } = useLocale();
return (
<>
<Heading title={t('support')} description="" />
</>
);
};

View file

@ -31,7 +31,7 @@ export default function OnboardingAlpha() {
</p>
<div className="mt-0 flex w-full items-center justify-center gap-2">
<Button
onClick={() => platform.openLink('https://discord.gg/ukRnWSnAbG')}
onClick={() => platform.openLink('https://discord.gg/gTaF2Z44f5')}
className="flex gap-2"
variant="gray"
>

View file

@ -1,10 +0,0 @@
[
{
"title": "Placeholder",
"description": "",
"url": "https://spacedrive.com",
"version": "0.0.0",
"authors": [""],
"license": ""
}
]

View file

@ -1,14 +0,0 @@
[
{
"title": "Placeholder",
"description": "",
"url": "https://spacedrive.com",
"authors": [""],
"license": [
{
"text": "",
"copyright": ""
}
]
}
]

View file

@ -143,7 +143,7 @@ case "$(uname)" in
# Tauri dependencies
set -- build-essential curl wget file openssl libssl-dev libgtk-3-dev librsvg2-dev \
libwebkit2gtk-4.1-dev libayatana-appindicator3-dev libxdo-dev
libwebkit2gtk-4.1-dev libayatana-appindicator3-dev libxdo-dev libdbus-1-dev
# Webkit2gtk requires gstreamer plugins for video playback to work
set -- "$@" gstreamer1.0-plugins-good gstreamer1.0-plugins-ugly libgstreamer1.0-dev libgstreamer-plugins-base1.0-dev
@ -161,7 +161,7 @@ case "$(uname)" in
echo "Installing dependencies with pacman..."
# Tauri dependencies
set -- base-devel curl wget file openssl gtk3 librsvg webkit2gtk-4.1 libayatana-appindicator xdotool
set -- base-devel curl wget file openssl gtk3 librsvg webkit2gtk-4.1 libayatana-appindicator xdotool dbus
# Webkit2gtk requires gstreamer plugins for video playback to work
set -- "$@" gst-plugins-base gst-plugins-good gst-plugins-ugly
@ -185,7 +185,7 @@ case "$(uname)" in
fi
# Tauri dependencies
set -- openssl webkit2gtk4.1-devel openssl-dev curl wget file libappindicator-gtk3-devel librsvg2-devel libxdo-devel
set -- openssl webkit2gtk4.1-devel openssl-dev curl wget file libappindicator-gtk3-devel librsvg2-devel libxdo-devel dbus-devel
# Webkit2gtk requires gstreamer plugins for video playback to work
set -- "$@" gstreamer1-devel gstreamer1-plugins-base-devel gstreamer1-plugins-good \
@ -205,7 +205,7 @@ case "$(uname)" in
# Tauri dependencies
set -- build-base curl wget file openssl-dev gtk+3.0-dev librsvg-dev \
webkit2gtk-4.1-dev libayatana-indicator-dev xdotool
webkit2gtk-4.1-dev libayatana-indicator-dev xdotool-dev dbus-dev
# Webkit2gtk requires gstreamer plugins for video playback to work
set -- "$@" gst-plugins-base-dev gst-plugins-good gst-plugins-ugly