Commit graph

1434 commits

Author SHA1 Message Date
Utku Bakir 959783b08a Bump node to lts (v18) 2022-12-14 12:43:02 +03:00
Utku 42f09b0918
Mobile - Settings & Tags (#479)
* Sync tailwind configs

* Switch to new colors part 1

* new colors part 2

* switched to new colors

* settings screens template

* settings progress

* Setting header titles

* Refactor settings icon

* Fix tsconfig relative path issue

* Move mobile eslint config to @sd/config

* Add no-restricted-imports rule to eslint

* rename TextInput to Input & tailwind font sizing

* General Settings screen + Card component

* Library settings screen & delete lib dialog

* autoform hook

* Mini tweaks and new packages

* Exclude android & ios from search

* Add Switch (Input)

* Library General settings screen

* Refactor settings + Switch and Switch Container

* Locations screen & delete and rescan locations

* Rename folder + small tweaks

* Make things Swipeable

* Create Tag Dialog with color picker

* Upgrade to Expo 47

* More tag stuff

* fix pnpm lock

* regen pnpm-lock

* Change CI node version to 16

* Move `isVideo` into shared package

Co-authored-by: Oscar Beaumont <oscar@otbeaumont.me>
2022-12-13 15:18:03 +08:00
jake 78a5754f4e
[ENG-315] Key viewer/general improvements (#483)
* add encryption+hashing algorithm to key viewer dialog

* abstract `save()` and `open()` with `Platform`

* add automount to `StoredKey` and offer option to enable/disable it for keys

* fix missing statement exec

* general tidy up

* add sync to library button and cleanup default setting code

* use alert dialogs for unsupported `open`/`save` operations (web)

* tweak alert message
2022-12-13 09:48:14 +08:00
jake 3ce8c74a0d
[ENG-313] Key auto-generation and viewing (#478)
* add generic dialog for keys settings

* revert artifact failed key viewing attempt

* move `Select` key list component

* rename dialog

* remove unused imports and add new select option for *all* keys

* add WIP but broken key viewer dialog

* cleanup code and fix key viewer dialog

* add clipboard icon and copy functionality

* generalise the `AlertDialog` and refactor `BackupRestoreDialog` to use it

* use new alert dialog in place of JS/tauri alerts

* use generic alerts everywhere and bring generic alert props/default state

* make `SelectOptionKeyList` generic for mounted/unmounted keys (with the use of `map` for the latter)

* add clipboard to generic alert dialog + clean up

* fix accent colour button for backup restoration

* remove unneeded props from components

* add slider+automount button

* tweak password gen function

* add password autogeneration

* clippy

* tweak password generation

* use `crypto-random-string` and drop rust password generation

* add default TEMPORARY keymanager pass/secret key to library creation screen

* make key automounting functional

* clean up key viewer

* change dialog name

* remove slider as that wasn't even being used?

* make requested changes and hide key viewer if no keys are in the key manager

* prevent automount and library sync from being enabled simultaneously

* include `memoryOnly` in key

* mark keys as memoryOnly
2022-12-12 17:13:52 +00:00
jake 8ee2d18053
[ENG-309] Envelope encryption for the KM's root key (#482)
* use master key to encrypt the root key (breaking)

* introduce breaking changes to the keymanager (this breaks master password changing, backup restoration, etc)

* change MP -> RK

* minor tweaks + comment out broken features temporarily

* experimental new master password changing

* add a `write_storedkey_to_db` helper function

* general cleanup and fixes

* potentially patch backup restoration

* uncomment+clean up restoration in api

* strip whitespaces from user inputted secret key, and fix MPC bug

* clippy

* add memory only flag to `StoredKey`
2022-12-12 15:04:08 +00:00
jake f1292d6e51
Crypto Hotfixes (#477)
* fix annoying typo that was breaking master password changing under certain conditions

* move `Select` boxes out of `react-hook-form` so they work

* add `DummyKey` and rework the UI a little

* fix bug where user could select a hashing algorithm (it did nothing)

* fix bug where encryption algorithm would be inherited from the key, not the user's choice
2022-12-09 22:05:32 +08:00
jake 0eb0376d5b
[ENG-308] Crypto optimizations (#470)
* add benchmarks for encryption/hashing

* add more benchmarking sizes

* general performance improvements

* massive performance gain with minimal security impact

* update `sd-crypto` author info
2022-12-08 12:08:35 +00:00
jake 70b063b002
[ENG-311] Hex secret key encoding (#476) 2022-12-07 15:17:14 +00:00
jake 5651ac3f69
[ENG-251] Crypto Jobs (#475)
* add base crypto job

* leave hashing to the KM and not keyslots

* add latest header object versions and update examples

* add a very experimental (local file!) encrypt job

* working file encryption with default key

* working file decryption

* non-working encrypt file dialog

* general code cleanup

* comments and correct feature locking

* fix the `Dialog`

Co-authored-by: maxichrome <maxichrome@users.noreply.github.com>

* WIP encrypt dialog

* massive encrypt dialog overhaul

* add generic explorer alert dialog

* better key naming/numbering, alerts for unsupported scenarios

* cleanup + decrypt file dialog

* remove debugging stuff

* remove dead code & fix a bug with key select being empty

* clean up dialog UI massively

* add support for setting output path

* add correct button type to prevent early dialog submits

* add "nice" job data for encrypt/decrypt

* tweak functionality of key setting in encrypt dialog

* include full file metadata if selected, and lay out groundwork for preview media inclusion

* add comment about not restoring metadata/pvm just yet

* general cleanup

Co-authored-by: maxichrome <maxichrome@users.noreply.github.com>
2022-12-07 15:16:13 +00:00
brxken128 bc4e8cb9c8
add clippy allow so Protected can work correctly 2022-12-07 15:04:57 +00:00
brxken128 4449bcb143
code cleanup and use hex for secret key encoding 2022-12-07 15:00:14 +00:00
jake 2baf16d982
[ENG-307] Key manager features (#467)
* working key management in settings page

* sync with library button

* fix `rspc` feature and add passphrase generation

* untested key manager rework

* trying to return values from mutations

* update library manager and remove settiong master PW

* update bindings

* set static secret key/master password

* prompt user for master password if correct one hasn't been provided yet

* add `hasMasterPassword` route

* add `clearMasterPassword` route + remove dead code

* tweak `set_master_password()` and add dedicated error

* tweak UI, fix `few hooks than expected`, add unmount+lock button

* remove old comment

* fmt

* clippy

* move static key/password setting so it doesn't fail sometimes

* add dedicated `get_key()` and remove keys from memory

* add `getKey` route

* update bindings

* use `const` instead of `let`

* comment updates

* update schema to remove salt

* add string parse error

* generate passphrase within key manager

* generate new migrations

* feature gate serde support in `crypto` crate

* fmt

* more specific error types

* foramatting

* add locking mechanism to keysettings page (not working?)

* fix react hook issues

Co-authored-by: maxichrome <maxichrome@users.noreply.github.com>

* remove empty onclick

* add keymanager dropdown menu

* working key backup functionality

* add experimental master password changing support

* update bindings

* semi-working change master password dialog

* use gear/lock icons to clean up key manager UI

* make settings button functional

* make buttons uniform and format code

* fix double base64 encode

* add change master password dialog and secret key dialog

* code cleanup

* restore backup dialog

* change UI wording

* make a start on restoring from a backup

* potentially working keystore restore

* don't overwrite verification key if one is set

* working backup restore + fix master password changing

* fix typo in static password/verification key check logic

* change wording to make UI clearer

* disable mount button if key is empty

* handle errors+remove type annotations

* show total imported keys on backup restoration

* add zxcvbn package

* change input border colour based on zxcvbn score

* clippy and formatting

* password strength meter

* remove nbsp

* add button type to stop early form submission

* use `react-hook-form` for backup restoration dialog

* more `react-hook-form` stuff

* attempt to fix password meter

* small cleanup

* Fix password meter

* update colours

Co-authored-by: maxichrome <maxichrome@users.noreply.github.com>
Co-authored-by: Utku Bakir <74243531+utkubakir@users.noreply.github.com>
2022-12-02 10:18:21 +00:00
maxichrome 4dc7c4571a Revert traffic light change from #464
This messes up the spacing in non-fullscreen view.
We need to properly attach event listeners to the window and update this when full-screen mode changes.
2022-11-20 15:40:35 -05:00
Brendan Allan c593fa3344
Utilise tsconfig paths for workspace module resolution (#454)
* use @sd/client for tsconfig extends

* move all svgs to @sd/assets

* only use vite-tsconfig-paths

* remove ui from web

* use relative extends for ui tsconfig

* remove aliases from landing?

* use wacky landing vite config

* try using tsconfig paths and root on landing

* Revert "try using tsconfig paths and root on landing"

This reverts commit 43bd2a0f84.

* remove tsconfig-paths from landing
2022-11-06 20:18:41 -08:00
maxichrome c4df3ab7ee
Add empty content to Privacy Policy page 2022-11-06 02:18:17 -06:00
maxichrome b71a19e75d
Merge pull request #458 from PyRo1121/node-version
Enforce minumum Node version
2022-11-06 02:07:10 -06:00
Olen Latham 7b03067872
Update .nvmrc
Co-authored-by: Brendan Allan <brendonovich@outlook.com>
2022-11-06 00:27:24 -04:00
Brendan Allan 7d7a80d580 update node version in contributing guide 2022-11-06 10:17:22 +08:00
Brendan Allan 8007523b80 use node 16 2022-11-06 10:14:09 +08:00
Brendan Allan edb0c41c49 remove 'tailwind' dependency 2022-11-06 10:08:58 +08:00
erikpodusel 90890bbc1c
fixed traffic lights bar showing all the time (#464)
desconstructed props inside TrafficLights

Co-authored-by: Erik Podušel <podusel@gomerch.company>
2022-11-05 14:15:35 -07:00
Olen Latham dadbfe2833 ignore last commit derp 2022-11-05 18:05:40 +00:00
Olen Latham 862d23e2e3 looking over I think we want our @type/node to be in line with our node version requirements 2022-11-05 17:55:32 +00:00
Olen Latham f0b542f59d Updated pnpm to 7.14.0 and added .nvmrc 2022-11-05 17:34:48 +00:00
maxichrome 891d8fe1ab
reorder & comment npmrc 2022-11-05 08:30:24 -05:00
jake a403224b3b
[ENG-262] Key Manager Integration (#450)
* add keys router

* make progress on keymanager integration

* make name non-negotiable

* hyphenate encryption algorithm names

* Revert "make name non-negotiable"

This reverts commit 9c0f51329e.

* add some more keymanager queries

* add master password and default key routes

* add newly registered key to db + fmt

* clippy, formatting and `updateKeyName` route

* add automount to schema+automount keys where `true`

* update bindings

* working key add/mount

* working keylist

* mounted keys show first

* cleanup code

* add comments, code cleanup, more functions

* unmount all keys button

* comment and keymanager `clear_master_password()`

* add no keys available message

* fix unmount button

* use dashmap for concurrency

* fix missing keylist issue and add invalidate query macro

* set correct RSPC types

* statically set master password (TEMPORARILY)

* add remove key function within the keymanager

* key dropdown menu and impl

* formatting

* allow `option_if_let_else`

* add comment about key stats

* add additional comment

* rpsc error handling for the keys route

* fix rspc errors with an impl

* crypto crate errors to `sd-crypto::Error`

* remove `map_err`

* use custom result type

* cargo fmt

* clippy

* fix builds

* remove `Error::MutexLock`

* fix unnecessary unwrap

* mutex error handling (buggy for some reason)

* clean default key logic

* fix default key clearing

* allow a key to be removed without bugs

* implement requested changes

* use a single `useMemo`

* update schema with defaults

* re-generate migrations

* use rust enums in TS

* remove dead code

* remove mutate expansion

* read key list from keymanager, not prisma

* add "Default" key marker and cleanup TS

* rustfmt

* remove dead code
2022-11-05 04:18:01 -07:00
Oscar Beaumont d851880ac4
fix the getThumbnailUrlById origin 2022-11-04 18:30:09 +08:00
Oscar Beaumont 5808c27276
Fix getThumbnailUrlById for desktop and web 2022-11-04 18:27:26 +08:00
Oscar Beaumont dc97f087c9
fix prod build not working & thumbnails on web 2022-11-04 17:19:46 +08:00
Olen Latham ee665dfdf3
Update .npmrc
Updated and added `engine-strict=true` which enforces the requirement of the node version across all deps
2022-11-03 01:20:13 -04:00
Olen Latham b82168a45a
Update package.json
Updated node version to streamline with contribution.md which calls for version 17.
2022-11-03 01:19:20 -04:00
Brendan Allan 26c1c8cadb tabs > spaces 2022-11-02 15:57:43 +08:00
Brendan Allan a9c601f9d4
rename mobile package to @sd/mobile (#453) 2022-11-02 00:31:56 -07:00
Utku 76e3d0b9a2
Mobile - File Import (#443)
* Fix File modal and Stats

* Add disabled and loading state for dialog

* Close library drowdown with drawer

* catch Rust panics on mobile to prevent UB

* Update packages

* Move create lib dialog to container

* Create library on onboarding

* Cleanup metro config & update packages

* onClose for Dialog & update library cache

* Fix pods, downgrade react-native-svg

* Fix lib switching, organization, start import modal

* Add device size info

* Revert merge + version upgrade/fix

* Create Location & Remove placeholder data

* Create default modal component

* Check if the location already exists

* Add media-library + prettier

* fix build

* Fix Xcode shellScript too

* More small fixes

* don't export bindings on mobile devices

* Explorer store + cleanup

* Explorer comp. & add flashlist

* [WIP] Files in Locations & new file thumb

* clean merge

* Fix imports

* Fix core on mobile

* Add platform context to mobile

* Refactor libraryStore

* Add thumb url path to platform context

* Try fixing app startup

* Add zip and video to filethumb

* Delete bindings.ts from mobile

* Remove heroicons from mobile too

* useForwardedRef hook

* Media Library permission stuff

* Clean import modal

* remove valtio-persist from @sd/client

* prevent Sentry capturing all events

* refactor `@sd/client` to make it better for mobile

* fix mobile splashscreen
Just trust me bro

* fix mobile draw active style

* use custom valtioPersist for current library state

* remove mobile lockfile
It's now in the pnpm workspace so it shared the main one.

* finally remove valtio-persist

* remove 'mobile' from Platform as it's in interface

Co-authored-by: Oscar Beaumont <oscar@otbeaumont.me>
2022-11-01 21:32:56 +08:00
jake 92a3de4973
Fix metadata/preview media sizes for 32-bit targets (#446)
replace `usize` with `u64` for md/pvm lengths

Co-authored-by: Utku Bakir <74243531+utkubakir@users.noreply.github.com>
2022-10-29 02:07:10 -07:00
Oscar Beaumont 4e0b595073
Error Bounary Sentry support (#444)
* Sentry support

* remove broken import

Co-authored-by: Jamie Pine <32987599+jamiepine@users.noreply.github.com>
Co-authored-by: Jamie Pine <ijamespine@me.com>
2022-10-29 02:06:09 -07:00
Brendan Allan b713c896a0
More Sync Stuff (#438)
* broken sync example

* move to react

* filter owned ops more

* update deps

* working sync

* relation operations

* fix pnpm lock

* please rustfmt

* fix api

* compare strings properly

* please clippy

* feature gate logging

* use bleeding rspc in example

* use bleeding rspc

* use generated rspc client
2022-10-27 23:12:28 -07:00
Brendan Allan 5ceb27c95f
Update Prisma (#441) 2022-10-27 01:56:18 -07:00
Jamie Pine cd74f47641
Update Team Page (#440)
update team page
2022-10-27 00:45:03 -07:00
Jamie Pine 0725459fc0
Polish Icon Usage (#437) 2022-10-25 18:47:09 -07:00
maxichrome 9d72de352b
Improve setup script (#436)
* Improve bash setup script (less silent!)

* use proper FFmpeg capitalization in relevant docs

* Fix typo in Homebrew error message

Co-authored-by: maxichrome <maxichrome@users.noreply.github.com>
2022-10-25 18:08:50 -07:00
Oscar Beaumont 9e77b56962 fix ENG-226 - App crashing with no libraries 2022-10-25 19:16:00 +10:00
Oscar Beaumont 4493f15065
Merge pull request #431 from spacedriveapp/spacedrive-but-themable
New color system & better UI components
2022-10-25 12:41:00 +10:00
Oscar Beaumont aaa03b2aa1 Fix types 2022-10-25 11:48:00 +10:00
Oscar Beaumont 73eea94572 React Query devtools 2022-10-25 11:41:46 +10:00
Oscar Beaumont 473bc6e515 add useDebouncedForm hook 2022-10-25 11:41:05 +10:00
Oscar Beaumont b3695287dd Fix enter key not submitting dialog 2022-10-25 10:11:07 +10:00
Oscar Beaumont b099d47fec fix database migrations 2022-10-25 06:53:24 +10:00
Jamie Pine 130443d689 keybinds 2022-10-24 04:14:07 -07:00
Jamie Pine 8933e2bf1d more styles 2022-10-24 03:04:52 -07:00