Commit graph

1434 commits

Author SHA1 Message Date
maxichrome 7268495b6f install lint-staged 2023-01-19 19:19:35 -08:00
maxichrome 58dacf5eef prettier: ignore pnpm lockfile 2023-01-19 19:19:19 -08:00
Brendan Allan edfccd9f54 update prettierignore 2023-01-20 11:17:56 +08:00
maxichrome 289fc109fd i love lint-staged 2023-01-19 19:15:33 -08:00
maxichrome cfbd0d16aa better sort packages by external/package/local 2023-01-19 18:30:59 -08:00
maxichrome fc2e1e3ae5 integrate lefthook precommit formatting 2023-01-19 13:08:55 -08:00
maxichrome 62d731aeb9 update prettier config 2023-01-19 13:08:55 -08:00
jake 0a31e7f8ce
[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
Brendan Allan 2059c64e1f
stop doing useRef outside component (#530) 2023-01-18 19:49:17 -08:00
Brendan Allan 1041cb6e3c
use latest swift-rs (#526)
* use latest swift-rs

* update cargo lock
2023-01-17 06:37:32 -08:00
jake 0ef7f64bbb
[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 31d04d5594
[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
Jeremy Möglich 1a1ddf3409
Desktop - Add more tooltips (#519) 2023-01-16 17:32:14 -08:00
Brendan Allan a53b162f4b
make separate tsconfig for landing server (#525) 2023-01-16 17:18:20 -08:00
Ericson "Fogo" Soares 31b5c4b1db
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 8e479f736f
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
maxichrome 02b4c2eba6 remove stray comma on Spaces page 2023-01-13 22:11:50 -08:00
Ericson "Fogo" Soares 6b17409a72 Fixing unit tests for MacOS 2023-01-13 17:02:57 -03:00
Ericson "Fogo" Soares 4638f104be MacOS file system event handling using FSEvents backend 2023-01-13 15:55:16 -03:00
Brendan Allan ae94ada4f8
Begin form abstraction (#515) 2023-01-12 07:26:59 -08:00
Brendan Allan 9966d8eb65 use origin instead of url for web 2023-01-12 18:56:26 +08:00
Ericson Fogo Soares a18b2f8c8b Trying to figure out why events didn't matched 2023-01-11 19:46:34 -03:00
Ericson Fogo Soares cb8820fe47 Checking MacOS file system events using FSEvents instead od Kqueue 2023-01-11 18:57:41 -03:00
jake 0d554e9d06
[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
Utku 783d7736f6
Mobile Explorer (#512)
* Fix spacing

* Primitive popup menu

* Sort by & layout menu

* Add sort direction

* Style sort by menu

* new file icons

* thumb wrapper

* update packages & fix folder color

* explorer list & grid views

* Fix grid view spacing

* Grid image sizing

* Explorer store + calculation of grid item size

* Explorer list view

* Explorer store on filerow too
2023-01-11 14:39:19 +03:00
jake 4536710586
Detect SD-encrypted files and display them as such (#511)
* add encrypted file magic bytes/extension

* use archive icon for encrypted files temporarily

* use pascal case for encrypted extensions

Co-authored-by: Brendan Allan <brendonovich@outlook.com>
2023-01-11 00:40:49 -08:00
jake 434bc81deb
[ENG-329] Crypto dialog refactor (#509)
* update backup restoration dialog

* restructure MPC dialog

* refactor `EncryptFileDialog`

* dialog changes

Co-authored-by: Brendan Allan <brendonovich@outlook.com>
2023-01-11 00:38:45 -08:00
maxichrome 50b788f9e6 Update references to the core team 2023-01-10 17:41:09 -08:00
jake fbd8b6d199
[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
Brendan Allan c08622827c
Use import aliases (#508)
* implement a bunch of aliases

* build packages with tsc for turbo
2023-01-06 20:21:36 -08:00
Brendan Allan c61c773147
relative imports in @sd/interface (#504) 2023-01-06 19:07:24 -08:00
jake c1b2b1f5ee
[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 746ac76803
[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
Brendan Allan de3a979127 update prisma 2023-01-06 01:19:19 +08:00
Brendan Allan 58f5d8bb4d
update prisma (#505) 2023-01-05 08:05:33 -08:00
Brendan Allan 676e512c4a
Beginning of sync stuff (#502) 2023-01-04 23:11:55 -08:00
jake 2673a233c2
[ENG-320] Key manager bugfixes (#501)
* force key updates once a new key is mounted

* set KM decryption type if a single key is mounted

* prevent the key viewer dialog from changing size based on encryption algorithm

* fix spacing for the key mounter slider and remove unfitting text

* bump rspc version (fixes a lot of KM concurrency bugs)

* add personal reference for rspc override

Co-authored-by: Oscar Beaumont <oscar@otbeaumont.me>
2023-01-05 12:52:34 +08:00
Brendan Allan 05a6ea0319
Fix Vercel Deployments (#503) 2023-01-04 20:32:46 -08:00
jake 22bc77a39e
[ENG-319] Balloon hashing (#489)
* add key attribute to `Key` in `ListOfKeys`

* add balloon hashing function with untailored parameters

* add ser/de rules for blake3-balloon (and change argon2id's)

* fix benchmark

* use `to_bytes`, `from_bytes` and `from_reader`

* cleanup code

* add blake3-balloon options to the UI and fix library sync/automount enable bug

* cleanup some serialization code

* fix hashing algorithm deserialization

* clean up header serialization + more idiomatic master key decryption

* clippy

* add generic ser/de error to crypto crate

* fix `Display` and crypto cli

* move crypto cli to cli app

Co-authored-by: Brendan Allan <brendonovich@outlook.com>
2023-01-04 09:57:02 +00:00
Oscar Beaumont 58aa3b7a0c DMG background
We are using the background designed by @ParthJadhav with a few modifications by me for sizing.

Co-authored-by: Parth Jadhav <jadhavparth99@gmail.com>
2023-01-04 00:39:31 +08:00
jake 4569e45e47
[ENG-312] Crypto details CLI tool (#500)
* add untested crypto details tool

* clean up output a little

* clippy

* update crate details and `clap`
2023-01-04 00:15:12 +08:00
Oscar Beaumont 3964d44ce5
Integrate KeyManager with library creation flow (#491)
* integrate keymanager with library creation flow

* final fixes

* fix clippy recommendations

* minor fixes on library create dialog

* reenable `panic!` for no key + fix secret handling code

* prevent user setting secret , instead hardcode it

* clean library manager default key selection

* bring back wrongly removed `keys.onboarding` resolver

* fix types in `CreateLibraryDialog`
2023-01-04 00:13:12 +08:00
Oscar Beaumont a309d15a8d
update year in copyright year + fix #460 (#497)
* chore: update year in copyright

* auto date + revert copyright text + fix #460

Co-authored-by: Danil Shaymurzin <im@murka.me>
2023-01-03 14:15:08 +08:00
jake db5b401238
[ENG-318] Implement a KDF to derive new keys (#487)
* add blake3, `derive_key()` and clean up code

* fix a couple of things from the previous commit

* add context strings for root/file key derivation

* add salt to schema

* update refs of `salt` to `content_salt` within the keyslot

* cleanup code and add kdf salt to the keyslot

* rename salt to content salt in examples

* cleanup header code + remove dead code

* implement key derivation for keyslots

* gen new migrations that contain a salt column

* keymanager refactor (code is very idiomatic now) - needs thorough testing

* further cleanup

* clippy

* add a master password context string

* use key derivation for deriving keys from the root key

* update to use new code and remove `match` from `en/decrypt_bytes()`

* clippy

* use less unwraps in library manager code

Co-authored-by: Oscar Beaumont <oscar@otbeaumont.me>
2022-12-30 20:09:44 +00:00
Ericson "Fogo" Soares bcbcd260d4
ENG 223 Location Awareness (#468)
* Introducing location online/offline checks and location relink

* Some initial drafts for location watchers

* Location metadata relink and add library

* Many improvements at job system
Now using prisma batching at identifier job
Removing blocking I/O from extension subcrate
Implementing lazy generation of thumbnails
New current directory identifier job to be used on light rescans

* Some optimizations on identifier and object validator jobs

* merge jamie's identifier PR

* fully repaired identifier job

* properly hooked up object kind

* inspector fix

* fix video badge

* small improvements to libraries settings

* identifier and inspector improvements

* fix feature flags and hook up context menu location utilities

* BETTER CONTEXT MENU x100

* test-files

* style tweaks

* new icon designs

* manifest

* fix thumbnails on web

* media data

* New Location Watcher and some minor fixes

* disable broken media_data extractor, wip

* wip

* function name fix

* Fixing pnpm prep and some warnings

* Solving a race condition beetween indexer job and FS event handlerSome other minor warnings

* Generating thumbnails on watcher

* Remove event handler on watcher

* Some initial works on modify events and other small fixes

* File update event

* Trying to be more generic with used events and some tests to validate our assumptions

* Turning on location metadata file

* Introducing core unit tests on CI pipeline

* Submiting new unit test assumptions to validate on windows CI

* Fixing unit tests

* Fixing unit tests again

* Fixing unit tests

* Fixing unit tests for macos

* Fixing unit tests for macos again

* New structure for platform dependent event handling
Implementing event handlers for Linux and MacOS

* minor fixes + rustfmt + clippy

* Windows event handling

* Introducing a feature gate to only use location watching on desktop app for now

* Putting more stuff behind feature gates to avoid warnings

* Adding feature to cargo test on CI

* Changing some debug logs to trace logs and removing Jamie specific stuff

* Make location removal from manager less async

* fix build when "location-watcher" feature disabled

* fix types + clippy

* make location manager non-static

* remove uses of `to_string_lossy`

* more invalidate_query calls

* Expose `library_ctx` directly to avoid needless clones

* New materialized_path handling for directories

* Removing cascade delete between file_path and object
- Some other minor stuff

* remove unused `CurrentDirFileIdentifierJob`

Co-authored-by: Jamie Pine <ijamespine@me.com>
Co-authored-by: Oscar Beaumont <oscar@otbeaumont.me>
2022-12-31 00:53:24 +08:00
Qrutz fc2e8d8cec updated contributing.md to node 18 2022-12-22 11:09:18 +08:00
jake bbca699e33
[ENG-316] Decrypt with Password (#484)
* update generated key on slider click

* add ui for decrypting with password+saving to key manager

* update rust code to support password decryption and saving it to the library

* add decrypt with password UI functionality

* add content salt to key viewer

* disable key manager decryption if no keys are mounted

* clippy
2022-12-21 13:04:52 +08:00
Oscar Beaumont 05a2f429f7
Merge pull request #486 from spacedriveapp/nodelts
Bump Node Version To LTS
2022-12-15 12:23:41 +08:00
jake cf8975eb1a
Add security.txt and a public key to the landing page (#485)
* add security.txt to both / and /.well-known/

* add public key and update security.txt URLs + re-sign it
2022-12-15 12:02:16 +08:00
Utku Bakir f7afb9ac2b Add eslint to @sd/client & fix types 2022-12-14 13:10:42 +03:00