Commit Graph

260 Commits

Author SHA1 Message Date
Brendan Allan
23fbb1e408 Move location online status out of database (#560)
* move location online status out of database

* remove useLibrarySubscription

* remove old code
2023-02-07 05:58:47 -08:00
Brendan Allan
b901a72208 Merge branch 'main' of https://github.com/spacedriveapp/spacedrive 2023-02-07 21:26:06 +08:00
Brendan Allan
4602690751 damn i'm stupid 2023-02-07 21:00:27 +08:00
jake
e5b45d8f49 [ENG-355] Keychain integration (and some typesafety) (#558)
* update crypto MSRV

* rename `keychain` to `keyring`

* make a start on the keymanager unlock refactor/keychain integration

* update routes

* update bindings

* add const identifiers

* add UI/front-end support for unlocking KM with OS keychains

* remove SK from lib creation dialog

* update query name

* add keyring functions

* attempt to update `change_master_password()` to use the keychain

* cleanup, fix master password change ui, better secret key in keyring detection

* cleanup TS a little

* add route for getting secret key from keyring

* update bindings

* update var names + show secret key in keys settings

* add `react-qr-code` and option to view the secret key (if it's in the OS keyring)

* allow copying SK to clipboard

* add `key_type` so we're not reliant on specific UUIDs for root/verification key handling

* clippy

* fix mobile typecheck

* fix typecheck, fix typo and tweak balloon hash parameters

* minor cleanup + typo fix

* use newtype structs

* WIP type refactoring (major readability boost!)

* update `use`

* add tokio `sync` feature

* too many structs? idk

* more cleanup

* add `generate` and `Nonce`

* `Nonce` and `Key` typesafety (beautiful)

* clippy + cleanup

* update code & examples

* fix bug & remove `ProtectedVec` as it looked out of place

* use `Key`

* add a query invalidation to make the UI extremely responsive

* ci pls work

* remove `keyringHasSk` route
2023-02-07 12:03:12 +00:00
Brendan Allan
b9089bf065 update msrv to 1.67 2023-02-01 12:21:34 +08:00
Brendan Allan
bd37ca0d14 remove TryInto usage in sync manager 2023-02-01 11:42:43 +08:00
Brendan Allan
1ca84a2d33 remove temp_cas_id 2023-02-01 11:23:59 +08:00
Ericson Fogo Soares
c1944005b7 A bunch of minor fixes 2023-01-31 20:02:23 -03:00
Brendan Allan
d91bb9aa1d Merge branch 'main' into non-unique-objects 2023-01-30 12:11:35 +08:00
Brendan Allan
224ed772ac store cas ids on file paths 2023-01-28 11:42:24 +08:00
brxken128
253739c83e Merge branch 'main' into eng-348-async-crypto 2023-01-25 22:02:23 +00:00
brxken128
9fbc9f83ed use a tokio::sync::Mutex just to be safe 2023-01-25 18:20:29 +00:00
brxken128
f6845d7927 tell everything to use workspace tokio + add tokio git patch 2023-01-25 14:36:29 +00:00
Brendan Allan
6a71936252 update shared sync functions to use new system 2023-01-25 13:17:01 +08:00
brxken128
73dd4df26b async crypto! 2023-01-24 14:19:27 +00:00
brxken128
5478c5527a include resumable jobs within the job match 2023-01-23 11:02:32 +00:00
Ericson Fogo Soares
7aa644c7a2 Removing some unnecessary clones and other small fixes 2023-01-20 18:22:17 -03:00
brxken128
2313be8937 remove move as it's not a valid module name (it's called cut instead) 2023-01-20 13:24:33 +00:00
brxken128
a7108c370b async just dropped 2023-01-20 13:24:33 +00:00
brxken128
f18a7c2e0d major cleanup + clippy 2023-01-20 13:24:31 +00:00
brxken128
f5b7f810b1 even better copy 2023-01-20 13:23:43 +00:00
brxken128
541e5a5b26 even more cleaning up (starting to look better) 2023-01-20 13:23:21 +00:00
brxken128
07a57f1505 further cleanup 2023-01-20 13:23:21 +00:00
brxken128
8372459979 remove duplicate 2023-01-20 13:23:21 +00:00
brxken128
51b890df3c slowly start to cleanup copy code 2023-01-20 13:23:21 +00:00
brxken128
4ecdf45529 basic file duplication with the copy job 2023-01-20 13:23:21 +00:00
brxken128
10e71b145f attempt to move duplicate over to copy job 2023-01-20 13:23:17 +00:00
brxken128
652517d131 super nice file AND directory copying (the new duplicate too) 2023-01-20 13:21:08 +00:00
brxken128
97f7e1126f working single file copy 2023-01-20 13:21:08 +00:00
brxken128
d88eab4aa5 add (working!) cut job 2023-01-20 13:18:17 +00:00
brxken128
4fac04de47 add file cutter to files route 2023-01-20 13:18:17 +00:00
brxken128
712442b415 add frontend ground work for cut/copy actions 2023-01-20 13:18:11 +00:00
brxken128
e376a2a46a fully working file duplicator 2023-01-20 13:12:26 +00:00
brxken128
bdbaff020d cleanup duplicator job 2023-01-20 13:12:26 +00:00
brxken128
972a51ed49 working dir duplication 2023-01-20 13:12:26 +00:00
brxken128
8f9cee2e62 basic single file duplication 2023-01-20 13:12:11 +00:00
Ericson "Fogo" Soares
c532688745 [ENG-342] Block location watcher for files that are being actively modified (#522)
* Introducing LocationManager to stop and reinit watching a location

* Temporarely ignore events for a path at location manager

* Refactoring some functions to a functional style
Also introducing a tracing directive to use info level on manager logs
and fixing pnpm prep due to a conditional compilation error

* Refactoring location manager actor

* Fixing pnpm prep due to conditional compilation problems
2023-01-19 19:49:23 -08:00
jake
aa02720460 [ENG-257] File erasure and deletion (#524)
* add helper functions for getting context-menu related filesystem info

* update comments and such

* add a barebones delete job

* add file deletion route

* add (empty but working) delete file dialog

* add super experimental file erase function

* update function doc

* add erase files route

* add erase files job

* tweak file erasing in crypto crate

* bindings

* add erase files dialog

* add missing `?`

* fix erase file form trickery

* remove unused imports

* terrible attempt at recursion for file erase

* IT WORKS

* code cleanup + clippy

* async just dropped (not for erase yet)

* async erase just dropped (+async crypto crate)

* add "nice data" for jobs
2023-01-18 19:55:14 -08:00
jake
92a7e66755 [ENG-328] Keymanager mounting queue (#514)
* add `get_queue` and `is_queued` to KM and router

* mark keys as being mounted/finished mounting, use a `DashSet` instead of vec

also includes temporary `dbg!()`s for manual valdiation that it works

* remove dbg and fix build (works great)

* mark key manager as unlocking correctly

* cleanup keys api

* add `KeyAlreadyQueued` error

* use react mounting queue

* fully prevent against multiple mount jobs of the same key with the rust queue

* show keymanager as unlocking in the UI

* handle query invalidation for `isKeyManagerUnlocking` with a closure (semi-temporary)

* revert changing text (doesn't work where the keymanager is unlocked from, only the other unlock screen)

* clippy

* add `useRef` for mounting queue within react

* pass `ref.current` to `Key` instead
2023-01-17 06:19:54 -08:00
Ericson "Fogo" Soares
49d649b26f [ENG-333] Handle .spacedrive existing instead of throwing error (#521)
* Removing metadata files that failed to be deserialized

* Reintroducing deserialize error for location metadata on prod builds
2023-01-17 06:17:14 -08:00
Ericson "Fogo" Soares
c5eed27fa6 Merge pull request #517 from spacedriveapp/eng-304-too-many-files-macos-unhappy-with-prod
[ENG-304] "Too many files" macOS unhappy with prod!
2023-01-16 20:03:45 -03:00
Brendan Allan
80f85d6f7c Eng 332 auto generate sync ids (#523)
* generate sync ids and use model name from ModelActions

* cleanup AddLocationDialog imports

* rustfmt
2023-01-15 07:25:11 -08:00
Ericson "Fogo" Soares
328776dee7 Fixing unit tests for MacOS 2023-01-13 17:02:57 -03:00
Ericson "Fogo" Soares
c9b529dd2e MacOS file system event handling using FSEvents backend 2023-01-13 15:55:16 -03:00
Ericson Fogo Soares
7b8f7959a1 Trying to figure out why events didn't matched 2023-01-11 19:46:34 -03:00
Ericson Fogo Soares
acd0c2d298 Checking MacOS file system events using FSEvents instead od Kqueue 2023-01-11 18:57:41 -03:00
jake
3c0729e7aa [ENG-331] StoredKey overhaul (#513)
* add wip storedkey versioning

* storedkey versioning! (not pretty, but it never will be)

* add version to `StoredKey` and re-gen migrations to handle serde

* use `serde` for interacting with the DB + handle errors
2023-01-11 05:15:08 -08:00
jake
4e9b56faff [ENG-327] Crypto refactor (#510)
* fix secret key showing as `Some()` when it's empty

* rename function

* use `uuid` feature of `rspc`  so clippy works with `--all-features`

* remove dead error

* update clippy rules

* more idiomatic + cleaner hashing, that handles secrets better

* remove dead code + minor refactor of the KM

* cleanup`KeyManager::get_key()`

* cleanup keys router

* variable inlining, idiomatic rust, etc

* clean up encrypt/decrypt jobs

* embed preview media into encrypted files

* even more idiomatic rust

* fix previous file extension code (no amount of idiomatic rust can fix bad patterns)

* hopefully make large serialization slightly more efficient

* remove dead code + old tests

* inline key derivation (not so sure about this one)

* use `then` instead of `if`

* stop using expensive clones

* add `Protected::into_inner()` to prevent `.expose().clone()` patterns

* use `tokio::fs::File` where possible

* add and use `JobError::MissingData`

* use `|| null` for the secret key

* use `block_in_place` for large r/w sync tasks
2023-01-10 12:36:28 -08:00
jake
a454000612 [ENG-323] Key manager onboarding fixes (#506)
* add hash with secret functions

* refactor KM to make the secret key both optional, and user-settable

* update library create function and create library dialog

* fix annoying MPC typo

* fix ordering of key manager creation and seeding

* overhaul master password changing UI to support the potentially empty secret key

* patch keymanager unlocking for potentially empty SK

* make create library dialog text more fitting

* remove dead code

* add autogeneration, view/hide, copy to clipboard icons

* cleanup older code

* make onboarding screen look a tad better

* minor UI tweaks

* patch backup restoration UI

* add pw generation to MP change dialog

* make sure passwords are same before submitting lib creation

* UI fixes and allow setting algorithm/hashing algorithm for master password

* make sure KM is re-seeded on SD load and prevent loading duplicate keys into the keystore

* remove old comment

* small organization

* update encryptfiledialog

* remove dead KM code

* cleanup some TS

* move `PasswordMeter` to separate file

* refactor master password change dialog

* cleanup the TS and improve string -> hashingalgorithm conversions

* add `key` values to selectoption

* capitalise `BLAKE3`

* fix sorting for `getHashingAlgorithmString`

* remove onboarding route

* Revert "add `key` values to selectoption"

This reverts commit 10e6456f22.

* add `key` to `SelectOptionKeyList`

* fix using rspc errors directly

* Update packages/interface/src/components/onboarding/Onboarding.tsx

Co-authored-by: Brendan Allan <brendonovich@outlook.com>

* use `navigator.clipboard.writeText`

* move `OnboardingConfig` to crypto crate

* move `zxcvbn` options outside of component

* further cleanup

* fix mobile typecheck

* fix keylist typo

* improve `SelectOptionKeyList` further

Co-authored-by: Utku Bakir <74243531+utkubakir@users.noreply.github.com>
Co-authored-by: Brendan Allan <brendonovich@outlook.com>
2023-01-06 17:03:22 +00:00
jake
68f329e2c4 [ENG-325] Local paths for the context menu (#507)
* use `path_id` instead of `object_id` for finding local file paths

* fix bug

* make automounting better, UX-wise

* find file_paths correctly

* use `obj_id` for fetching metadata/preview media

* stop using `expect()` during jobs
2023-01-06 16:26:25 +00:00