Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[ENG-1828] Migrate to new Cloud Services API #2633

Merged
merged 253 commits into from
Oct 31, 2024
Merged
Changes from all commits
Commits
Show all changes
253 commits
Select commit Hold shift + click to select a range
2d713e9
Remove kotlin code for Android Name
Rocky43007 Jul 23, 2024
3db7ae7
Change service subdomain url from `app` to `api`
Rocky43007 Jul 23, 2024
e9d72b9
Merge branch 'main' into eng-1828-migration-to-new-cloud-api-system
Rocky43007 Jul 23, 2024
eb1ebd9
Merge branch 'main' into eng-1828-migration-to-new-cloud-api-system
Rocky43007 Jul 24, 2024
2f24973
Clean up comment in landing page
Rocky43007 Jul 24, 2024
6e4cbfd
new form for login
ameer2468 Jul 24, 2024
2b91b15
Merge branch 'eng-1828-migration-to-new-cloud-api-system' of https://…
ameer2468 Jul 24, 2024
d67cbec
clean up
ameer2468 Jul 24, 2024
9cc8537
Add Supertoken login page
Rocky43007 Jul 24, 2024
df56d77
Make show password a component
ameer2468 Jul 25, 2024
81787e8
WIP 3rd Party Logins
Rocky43007 Jul 25, 2024
a1e7df6
wip: Use Keychain instead of Localhost for Storage
Rocky43007 Jul 26, 2024
4bdb8eb
Update keys.rs
Rocky43007 Jul 27, 2024
cbf9c93
Working auth key storage in Keychain
Rocky43007 Jul 27, 2024
f56fcaf
Merge branch 'main' into eng-1828-migration-to-new-cloud-api-system
HeavenVolkoff Jul 28, 2024
dc23c3f
Update SDCoreModule.kt
Rocky43007 Jul 28, 2024
4130f79
wip: Getting User Data from backend
Rocky43007 Jul 30, 2024
547beda
Actually fetch data from rspc
Rocky43007 Jul 30, 2024
af9c83b
Cleanup cookieHandler.ts
Rocky43007 Jul 30, 2024
6511a73
Merge branch 'main' into eng-1828-migration-to-new-cloud-api-system
Rocky43007 Jul 31, 2024
9688008
Show profile info if logged in
Rocky43007 Jul 31, 2024
f7e939c
Working Auth on Mobile
Rocky43007 Aug 2, 2024
713f322
Setup client for Cloud Services in Node
fogodev Aug 2, 2024
2647cdc
Merge branch 'main' of github.com:spacedriveapp/spacedrive into eng-1…
fogodev Aug 2, 2024
584cce7
Merge branch 'eng-1828-migration-to-new-cloud-api-system' of github.c…
fogodev Aug 2, 2024
acda40b
Use `secureTextEntry` for password fields
Rocky43007 Aug 3, 2024
c930b41
Update ShowPassword.tsx
Rocky43007 Aug 3, 2024
f229a2a
Refresh to update auth state on desktop
Rocky43007 Aug 4, 2024
25ee5ca
Working example for new API system
Rocky43007 Aug 6, 2024
60695b8
Converting cloud services error to rspc
fogodev Aug 6, 2024
2a24022
Completed `cloud.devices` rspc route
Rocky43007 Aug 6, 2024
04955c7
Bring back old `cloud.library.list`
Rocky43007 Aug 6, 2024
8739a74
Some new abstractions and tweaks to develop cloud services calls
fogodev Aug 7, 2024
46a4008
Migrate all cloud routes to the new API system
Rocky43007 Aug 7, 2024
f3bbee0
Add create library route to `libraries.rs`
Rocky43007 Aug 7, 2024
fa7de37
Forgot to import types D:
Rocky43007 Aug 7, 2024
01cc022
PubId, not Uuid
Rocky43007 Aug 7, 2024
41e21a3
Forgot library delete D:
Rocky43007 Aug 7, 2024
381a9e4
Mocked Device data for UI
Rocky43007 Aug 7, 2024
5be1acd
Proper state change for showing logged out page
Rocky43007 Aug 7, 2024
ca33e6f
Working Popout to default browser + Signout button
Rocky43007 Aug 8, 2024
f0c71ca
Migrate to Tauri v2 Release Canidate
Rocky43007 Aug 8, 2024
b797610
Formatting
Rocky43007 Aug 8, 2024
6e4cbe7
Working signout button
Rocky43007 Aug 9, 2024
aa01b0e
Update pnpm
HeavenVolkoff Aug 9, 2024
a9fc600
Update all tauri deps (js and rust) to Release Candidate 2
HeavenVolkoff Aug 10, 2024
587b379
Recreate pnpm-lock
HeavenVolkoff Aug 10, 2024
18ab45f
Fix pnpm-lock
HeavenVolkoff Aug 10, 2024
404c5cc
Formatting
HeavenVolkoff Aug 10, 2024
1db15a5
Remove keyring crate
Rocky43007 Aug 12, 2024
f9e7ea7
Make sure Java version running is `17` for Android
Rocky43007 Aug 12, 2024
8b3574d
Use 10 chars SHA for git deps
HeavenVolkoff Aug 12, 2024
0e94a97
Fix formatter settings
HeavenVolkoff Aug 12, 2024
019b157
Merge branch 'rocky/tauri-v2-rc' into eng-1828-migration-to-new-cloud…
Rocky43007 Aug 13, 2024
f3871ac
Update pnpm-lock.yaml
Rocky43007 Aug 13, 2024
f16bd40
Fix `Cargo.toml` because merge is fun
Rocky43007 Aug 13, 2024
7b66730
More merge fixes
Rocky43007 Aug 13, 2024
6d6291b
added device info to "Libraries" in settings
myung03 Aug 13, 2024
749d228
added min width for list and device items
myung03 Aug 14, 2024
1aa459a
Revamping crypto subcrate
fogodev Aug 14, 2024
1fd5c5f
Bad merge
fogodev Aug 14, 2024
45c90e4
Merge with main
fogodev Aug 14, 2024
5604e33
Fixing or commenting broken crap
fogodev Aug 14, 2024
b14e4fc
Deep linking wip
Rocky43007 Aug 14, 2024
42e004a
More tweaks on crypto crate
fogodev Aug 15, 2024
16f4eb6
Fix crypto erase example
fogodev Aug 15, 2024
ef418d4
Working backend deeplink event
Rocky43007 Aug 15, 2024
e24c7df
Fixing app deep link events
fogodev Aug 15, 2024
47a5828
Event listener actually listens
Rocky43007 Aug 15, 2024
d1c9c04
Better logging on deeplink events
fogodev Aug 15, 2024
19f404a
Revert "Better logging on deeplink events"
Rocky43007 Aug 15, 2024
01d6163
Merge remote-tracking branch 'origin/main' into eng-1828-migration-to…
HeavenVolkoff Aug 15, 2024
abef1e9
Merge remote-tracking branch 'origin/eng-1828-migration-to-new-cloud-…
HeavenVolkoff Aug 15, 2024
ddacb31
Format Cargo.toml, ensure all rust deps are up to date
HeavenVolkoff Aug 15, 2024
66a1448
quick refactor for list/device item
myung03 Aug 16, 2024
7e0b530
Modify `MockDevice` with data for overview
Rocky43007 Aug 16, 2024
efb1532
Merge branch 'main' into eng-1828-migration-to-new-cloud-api-system
Rocky43007 Aug 16, 2024
4fbaf86
Update pnpm-lock.yaml
Rocky43007 Aug 16, 2024
0384f23
Update core.ts
Rocky43007 Aug 16, 2024
e7ee166
Merge branch 'main' into eng-1828-migration-to-new-cloud-api-system
Rocky43007 Aug 16, 2024
e08a2e8
Merge branch 'main' into eng-1828-migration-to-new-cloud-api-system
Rocky43007 Aug 17, 2024
183b3e5
Token refresher
fogodev Aug 17, 2024
8532bfb
Merge branch 'main' into eng-1828-migration-to-new-cloud-api-system
Rocky43007 Aug 17, 2024
56894a0
Merge branch 'main' of github.com:spacedriveapp/spacedrive into eng-1…
fogodev Aug 18, 2024
2f6cc17
Working deep links
Rocky43007 Aug 19, 2024
4421a7f
Cloud Key Manager
fogodev Aug 19, 2024
5eb4fa6
Device register route and integrate key manager on bootstrap
fogodev Aug 19, 2024
89213ea
Auth callback route
Rocky43007 Aug 20, 2024
f0b2f9c
Working Social Login buttons in prod
Rocky43007 Aug 20, 2024
81fe5f4
First autoformat of the PR
Rocky43007 Aug 20, 2024
e48c33d
Update deps and configure TLS with new stuff
fogodev Aug 21, 2024
6ef5e36
Merge branch 'main' of github.com:spacedriveapp/spacedrive into eng-1…
fogodev Aug 21, 2024
cbb1e92
Working Supertokens Callback
Rocky43007 Aug 21, 2024
28dfa44
Use consistent versioning for tauri-plugin-http
iLynxcat Aug 21, 2024
014fcb5
TEMPFIX: remove global fetch reassignment to Tauri fetch
iLynxcat Aug 21, 2024
de3fc6b
Setting Cloud Services ALPN
fogodev Aug 21, 2024
ad81029
populate overview and library settings with mock devices
myung03 Aug 21, 2024
5f4d630
fix devices count on overview
myung03 Aug 21, 2024
ca7b4af
Only use Tauri Fetch in prod
Rocky43007 Aug 21, 2024
fc8d1b0
Fix plausible
Rocky43007 Aug 22, 2024
feac668
Cloud P2P abstraction
fogodev Aug 23, 2024
cbf06e8
Integrate cloud p2p into node and rspc routes
fogodev Aug 23, 2024
752bdbd
Some tweks to simplify sync subcrate
fogodev Aug 24, 2024
9a6f5f8
Properly stack keys to be able to fetch the latest one when needed
fogodev Aug 26, 2024
3cd7f8d
Make core compile again
fogodev Aug 27, 2024
01008c2
Merge branch 'main' of github.com:spacedriveapp/spacedrive into eng-1…
fogodev Aug 27, 2024
f6ed7b9
bruh
fogodev Aug 27, 2024
4ffb4aa
Fix compile again
Rocky43007 Aug 28, 2024
cbef19f
More tweaks on sync subcrate and other fixes
fogodev Aug 28, 2024
f18b35e
First draft on cloud sync api with rspc
fogodev Aug 28, 2024
54f76c4
Updated `core.ts` file
Rocky43007 Aug 28, 2024
55f02aa
Fixed `ipc` errors
Rocky43007 Aug 28, 2024
0b569a8
Sender actor for cloud sync messages
fogodev Aug 30, 2024
33a75c3
Update Tauri Version & Try fixing CORS issues
Rocky43007 Aug 30, 2024
832c1fe
Receiver actor for cloud sync
fogodev Sep 4, 2024
e8183f1
Merge branch 'main' into eng-1828-migration-to-new-cloud-api-system
Rocky43007 Sep 6, 2024
5ae87e3
Working Tauri fetch in prod
Rocky43007 Sep 6, 2024
07dea56
Disabling social logins for now
Rocky43007 Sep 6, 2024
2a1a9cf
Forgot to comment a bit more code
Rocky43007 Sep 6, 2024
e9c08e3
Formatting
Rocky43007 Sep 6, 2024
d516fa4
Tweak crdt ops compression and use it on cloud sync
fogodev Sep 7, 2024
bf0a7dd
`Iterator` for `CompressedCRDTOperationsPerModel`
Rocky43007 Sep 7, 2024
1f491cc
Relating tables to device
fogodev Sep 7, 2024
4d1443e
Fixing access token decoding
fogodev Sep 9, 2024
84e327f
Forgot to include the error
fogodev Sep 9, 2024
e515e11
Ingester actor
fogodev Sep 9, 2024
d98332e
bruh
fogodev Sep 9, 2024
20c157c
Fix token parsing + start of device registering
Rocky43007 Sep 9, 2024
a29b86a
Update cargo lock
Rocky43007 Sep 10, 2024
ed8c59e
Adding accepted TLS signature verifiers
fogodev Sep 11, 2024
dc19f79
Device routes & registering of device (mostly)
Rocky43007 Sep 11, 2024
a810327
Working device registration and listing
Rocky43007 Sep 13, 2024
c15ee01
Fix key size mismatch between opaque and sd_crypto
fogodev Sep 13, 2024
4d662b2
Get sd core to compile on mobile + deps update
Rocky43007 Sep 13, 2024
9ccd9f4
Initialize cloud sync
fogodev Sep 13, 2024
feab71f
Disabled social logins on mobile
Rocky43007 Sep 15, 2024
7d34e88
completed frontend for devices in settings
myung03 Sep 16, 2024
688286b
update uuid
myung03 Sep 16, 2024
2c80ede
oopsie wrong commit
myung03 Sep 16, 2024
c6f5315
Get access token from storage in mobile
Rocky43007 Sep 17, 2024
117c1a1
Remove unused commented code
Rocky43007 Sep 17, 2024
4e4e964
Custom Access Token functions & Constant URL
Rocky43007 Sep 18, 2024
337c7c2
Refactor `getAccessToken` to return refreshToken
Rocky43007 Sep 18, 2024
d70adf7
Converting internal pub_id to schema pub_id
fogodev Sep 19, 2024
60e1258
Lots of changes
Rocky43007 Sep 19, 2024
68cda79
Merge branch 'main' into eng-1828-migration-to-new-cloud-api-system
Rocky43007 Sep 19, 2024
efc6704
Add SystemConfiguration to SDCore podspec
Rocky43007 Sep 19, 2024
16b1fd7
Formatting
Rocky43007 Sep 19, 2024
fcdf854
Fix identifier bug
fogodev Sep 20, 2024
cd897b7
Fix prisma issue on exif data
fogodev Sep 20, 2024
1d22a75
bruh
fogodev Sep 20, 2024
9658c5d
Comment old auth stuff on frontend
fogodev Sep 20, 2024
4430fdd
Merge branch 'main' of github.com:spacedriveapp/spacedrive into eng-1…
fogodev Sep 21, 2024
5d99c80
abstracted out auth page and restyled
myung03 Sep 21, 2024
e581f79
Work on getting `request_join` working
Rocky43007 Sep 22, 2024
0150107
Trying to fix iroh discovery
fogodev Sep 23, 2024
9d52280
Working on p2p stuff
Rocky43007 Sep 23, 2024
4e7e017
Tweak Auth UI
ameer2468 Sep 23, 2024
bc2ddc6
improve auth ui
ameer2468 Sep 23, 2024
c08c3d4
styled profile page
myung03 Sep 23, 2024
845c026
Fix joined in date & remove roles
Rocky43007 Sep 24, 2024
564e9ac
Fix cors issue & start auto bootstrapping cloud
Rocky43007 Sep 24, 2024
628495e
Merge branch 'main' of github.com:spacedriveapp/spacedrive into eng-1…
fogodev Sep 25, 2024
38003f7
Refactor out access_token from all routes except bootstrap
fogodev Sep 26, 2024
e071008
Merge branch 'main' of github.com:spacedriveapp/spacedrive into eng-1…
fogodev Sep 26, 2024
7987071
Some specta renaming on cloud services routes
fogodev Sep 27, 2024
fdff139
Update toolchain and fix a bunch of warnings
fogodev Sep 27, 2024
d180261
email login ui
ameer2468 Sep 27, 2024
264e3f7
wip
Rocky43007 Sep 28, 2024
069a535
Update cloud schema
fogodev Sep 28, 2024
c1aba8b
Update lib.rs
Rocky43007 Sep 28, 2024
cec8c9e
Working p2p relay backend
Rocky43007 Sep 28, 2024
f329a95
Update tauri and some deps
fogodev Sep 28, 2024
9e00227
Update to new schema tweaking sync groups get route
fogodev Sep 29, 2024
7cd57c2
Rust fmt
fogodev Sep 29, 2024
25c02c4
Fix type errors & add notif logging on mobile
Rocky43007 Sep 30, 2024
de82f03
Fix join sync group on mobile
Rocky43007 Sep 30, 2024
81662c6
Update Profile.tsx
Rocky43007 Sep 30, 2024
411ae08
improve profile ui
ameer2468 Oct 1, 2024
bdd26eb
change to sd cloud
ameer2468 Oct 1, 2024
60cfafe
Update schema and deps
fogodev Oct 1, 2024
bc093a2
Update schema
fogodev Oct 1, 2024
b53bd44
Fix sync group join
fogodev Oct 2, 2024
8cbfb13
Update index.tsx
Rocky43007 Oct 2, 2024
d5d94fd
Merge branch 'main' into eng-1828-migration-to-new-cloud-api-system
Rocky43007 Oct 4, 2024
3a1d52e
Update cloud.tsx
Rocky43007 Oct 4, 2024
3f231c3
Update index.tsx
Rocky43007 Oct 5, 2024
8134160
Merge remote-tracking branch 'origin/main' into eng-1828-migration-to…
HeavenVolkoff Oct 7, 2024
26f7b5d
Merge branch '0.5.0-dev' into eng-1828-migration-to-new-cloud-api-system
iLynxcat Oct 7, 2024
13ba8d9
add device popup modal
myung03 Oct 7, 2024
fef2e92
Change database to use device id on everything instead of pub_id
fogodev Oct 8, 2024
4edcfa0
Merge branch 'eng-1828-migration-to-new-cloud-api-system' of github.c…
fogodev Oct 8, 2024
41ca786
Ingest sync ops in correct order
fogodev Oct 8, 2024
c036ffb
Auto accept sync group requests
Rocky43007 Oct 8, 2024
8490173
Some tweaks on sync messages encryption and decryption
fogodev Oct 10, 2024
6251a3c
Swap postcard for rmp-serde, due to incompatibility to deserialize sy…
fogodev Oct 10, 2024
0133173
Merge branch 'main' into eng-1828-migration-to-new-cloud-api-system
Rocky43007 Oct 10, 2024
69df6d9
Better logs related to joining sync groups
fogodev Oct 10, 2024
dc52f3e
Backfill ops on init cloud sync
fogodev Oct 10, 2024
27a23d2
cleanup auth, sync join modal, and more
ameer2468 Oct 11, 2024
c363f61
Introduce a new sync messages notification system between devices
fogodev Oct 12, 2024
c8b6873
Forgot to call needed function
fogodev Oct 12, 2024
cf68ce3
Only notify other nodes
fogodev Oct 12, 2024
6b3ac18
improvements to account style
jamiepine Oct 12, 2024
d64eb1c
increase max file size for thubm generation
jamiepine Oct 12, 2024
b49a3cf
add tauri plugin clipboard manager for pasting credentials (not impl …
jamiepine Oct 12, 2024
4018129
i18n for login
ameer2468 Oct 12, 2024
fb0d629
white text tweaks
jamiepine Oct 12, 2024
3bd2eee
back to login i18n
ameer2468 Oct 12, 2024
894c26d
really basic and temp hotfix so you don't have to edit hard coded pubid
jamiepine Oct 12, 2024
ffbc6fe
Merge branch 'eng-1828-migration-to-new-cloud-api-system' of https://…
jamiepine Oct 12, 2024
122b4b2
create sync group button
jamiepine Oct 14, 2024
c7e87f0
Sync profile page & Update mobile device names
Rocky43007 Oct 15, 2024
8a1ee22
Merge branch '0.5.0-dev' into eng-1828-migration-to-new-cloud-api-system
Rocky43007 Oct 15, 2024
9e4dbba
Update pnpm-lock.yaml
Rocky43007 Oct 15, 2024
e699ca2
debug sync indicators
jamiepine Oct 15, 2024
5767293
Many tweaks to improve sync responsiveness and observability
fogodev Oct 15, 2024
b7ce861
Add sync status to mobile
Rocky43007 Oct 15, 2024
960e7c4
Autoformatting
Rocky43007 Oct 15, 2024
97e1d0a
Fix lint error
Rocky43007 Oct 15, 2024
53bb6c3
Merge branch '0.5.0-dev' into eng-1828-migration-to-new-cloud-api-system
iLynxcat Oct 15, 2024
c67eaf1
fun indicators for debug
jamiepine Oct 15, 2024
663f833
Tweaking backfill
fogodev Oct 15, 2024
92c77f6
Can't backfill instance data as it isn't synced anyway
fogodev Oct 15, 2024
ddd14ac
More backfill tweaks
fogodev Oct 15, 2024
14d826c
Some minor tweaks
fogodev Oct 15, 2024
8c41d64
Fix tag assign rspc route
fogodev Oct 16, 2024
7a60cfe
Merge branch '0.5.0-dev' into eng-1828-migration-to-new-cloud-api-system
Rocky43007 Oct 16, 2024
12fdfb8
Update sync messages push and pull
fogodev Oct 19, 2024
3e76329
Remove obsolete settings cloud page
HeavenVolkoff Oct 19, 2024
9795014
autoformat
HeavenVolkoff Oct 19, 2024
b29d165
autoformat
HeavenVolkoff Oct 19, 2024
e29114c
Fix onbording test
HeavenVolkoff Oct 19, 2024
2c91484
Some tweaks on sync messages send and compression
fogodev Oct 21, 2024
17d82ee
Ensure single cloud bootstrap ever
fogodev Oct 21, 2024
73cb220
Merge remote-tracking branch 'origin/main' into eng-1828-migration-to…
HeavenVolkoff Oct 21, 2024
177763c
Autoformat
HeavenVolkoff Oct 21, 2024
2fa90d6
Update iroh and sd-cloud-schema
HeavenVolkoff Oct 21, 2024
f2f9f91
Optimize and fix attempt at cloud ingester
fogodev Oct 22, 2024
3eba4bb
bruh
fogodev Oct 22, 2024
114d0df
New ingester optimization attempt
fogodev Oct 22, 2024
2313a7f
Small bootstrap fix
fogodev Oct 22, 2024
86e4d21
More optimization attempts and collecting metrics
fogodev Oct 22, 2024
b8d9a44
Introducing partial indexes on crdt_operations and more optimization …
fogodev Oct 22, 2024
3190a7b
Separate timestamp keepers per sync group
fogodev Oct 22, 2024
9913b62
Next attempt at ingestion optimization
fogodev Oct 23, 2024
e4e6a11
More ingestion metrics
fogodev Oct 23, 2024
538af49
Properly sync file_path deletion when deleting directories
fogodev Oct 24, 2024
1598c8f
Merge branch 'main' into eng-1828-migration-to-new-cloud-api-system
Rocky43007 Oct 29, 2024
a76b51c
Merge branch 'main' of github.com:spacedriveapp/spacedrive into eng-1…
iLynxcat Oct 31, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2,736 changes: 2,602 additions & 134 deletions Cargo.lock

Large diffs are not rendered by default.

16 changes: 11 additions & 5 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -19,30 +19,35 @@ repository = "https://github.com/spacedriveapp/spacedrive"
rust-version = "1.81"

[workspace.dependencies]
# First party dependencies
sd-cloud-schema = { git = "https://github.com/spacedriveapp/cloud-services-schema", rev = "bbc69c5cb2" }

# Third party dependencies used by one or more of our crates
async-channel = "2.3"
async-stream = "0.3.6"
async-trait = "0.1.83"
axum = "0.7.7"
axum-extra = "0.9.4"
base64 = "0.22.1"
blake3 = "1.5"
blake3 = "1.5.4"
bytes = "1.7.1" # Update blocked by hyper
chrono = "0.4.38"
ed25519-dalek = "2.1"
flume = "0.11.0"
futures = "0.3.31"
futures-concurrency = "7.6"
globset = "0.4.15"
http = "1.1"
hyper = "1.5"
image = "0.24.9" # Update blocked due to https://github.com/image-rs/image/issues/2230
image = "0.25.4"
itertools = "0.13.0"
lending-stream = "1.0"
libc = "0.2"
libc = "0.2.159"
mimalloc = "0.1.43"
normpath = "1.3"
pin-project-lite = "0.2.14"
rand = "0.9.0-alpha.2"
regex = "1"
regex = "1.11"
reqwest = { version = "0.12.8", default-features = false }
rmp = "0.8.14"
rmp-serde = "1.3"
@@ -62,7 +67,8 @@ tracing-subscriber = "0.3.18"
tracing-test = "0.2.5"
uhlc = "0.8.0" # Must follow version used by specta
uuid = "1.10" # Must follow version used by specta
webp = "0.2.6" # Update blocked by image
webp = "0.3.0"
zeroize = "1.8"

[workspace.dependencies.rspc]
git = "https://github.com/spacedriveapp/rspc.git"
16 changes: 9 additions & 7 deletions apps/desktop/package.json
Original file line number Diff line number Diff line change
@@ -20,26 +20,28 @@
"@sd/ui": "workspace:*",
"@t3-oss/env-core": "^0.7.1",
"@tanstack/react-query": "^5.59",
"@tauri-apps/api": "=2.0.2",
"@tauri-apps/plugin-dialog": "2.0.0",
"@tauri-apps/api": "=2.0.3",
"@tauri-apps/plugin-dialog": "2.0.1",
"@tauri-apps/plugin-http": "2.0.1",
"@tauri-apps/plugin-os": "2.0.0",
"@tauri-apps/plugin-shell": "2.0.0",
"@tauri-apps/plugin-shell": "2.0.1",
"consistent-hash": "^1.2.2",
"immer": "^10.0.3",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"react-router-dom": "=6.20.1",
"sonner": "^1.0.3"
"sonner": "^1.0.3",
"supertokens-web-js": "^0.13.0"
},
"devDependencies": {
"@sd/config": "workspace:*",
"@sentry/vite-plugin": "^2.16.0",
"@tauri-apps/cli": "2.0.1",
"@tauri-apps/cli": "2.0.4",
"@types/react": "^18.2.67",
"@types/react-dom": "^18.2.22",
"sass": "^1.72.0",
"typescript": "^5.6.2",
"vite": "^5.2.0",
"vite-tsconfig-paths": "^4.3.2"
"vite": "^5.4.9",
"vite-tsconfig-paths": "^5.0.1"
}
}
15 changes: 9 additions & 6 deletions apps/desktop/src-tauri/Cargo.toml
Original file line number Diff line number Diff line change
@@ -35,12 +35,15 @@ uuid = { workspace = true, features = ["serde"] }

# 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 }
specta-typescript = "=0.0.7"
tauri-plugin-dialog = "=2.0.2"
tauri-plugin-os = "=2.0.1"
tauri-plugin-shell = "=2.0.2"
tauri-plugin-updater = "=2.0.2"
opener = { version = "0.7.1", features = ["reveal"], default-features = false }
specta-typescript = "=0.0.7"
tauri-plugin-clipboard-manager = "=2.0.1"
tauri-plugin-deep-link = "=2.0.1"
tauri-plugin-dialog = "=2.0.3"
tauri-plugin-http = "=2.0.3"
tauri-plugin-os = "=2.0.1"
tauri-plugin-shell = "=2.0.2"
tauri-plugin-updater = "=2.0.2"

# memory allocator
mimalloc = { workspace = true }
29 changes: 28 additions & 1 deletion apps/desktop/src-tauri/capabilities/default.json
Original file line number Diff line number Diff line change
@@ -17,13 +17,40 @@
"dialog:allow-open",
"dialog:allow-save",
"dialog:allow-confirm",
"deep-link:default",
"os:allow-os-type",
"core:window:allow-close",
"core:window:allow-create",
"core:window:allow-maximize",
"core:window:allow-minimize",
"core:window:allow-toggle-maximize",
"core:window:allow-start-dragging",
"core:webview:allow-internal-toggle-devtools"
"core:webview:allow-internal-toggle-devtools",
{
"identifier": "http:default",
"allow": [
{
"url": "http://ipc.localhost"
},
{
"url": "http://asset.localhost"
},
{
"url": "http://localhost:8001"
},
{
"url": "http://tauri.localhost"
},
{
"url": "http://localhost:9420"
},
{
"url": "https://auth.spacedrive.com"
},
{
"url": "https://plausible.io"
}
]
}
]
}
33 changes: 23 additions & 10 deletions apps/desktop/src-tauri/src/main.rs
Original file line number Diff line number Diff line change
@@ -14,13 +14,13 @@ use sd_core::{Node, NodeError};
use sd_fda::DiskAccess;
use serde::{Deserialize, Serialize};
use specta_typescript::Typescript;
use tauri::Emitter;
use tauri::{async_runtime::block_on, webview::PlatformWebview, AppHandle, Manager, WindowEvent};
use tauri::{Emitter, Listener};
use tauri_plugins::{sd_error_plugin, sd_server_plugin};
use tauri_specta::{collect_events, Builder};
use tokio::task::block_in_place;
use tokio::time::sleep;
use tracing::error;
use tracing::{debug, error};

mod file;
mod menu;
@@ -179,7 +179,11 @@ pub enum DragAndDropEvent {
Cancelled,
}

const CLIENT_ID: &str = "2abb241e-40b8-4517-a3e3-5594375c8fbb";
#[derive(Debug, Clone, Serialize, Deserialize, specta::Type, tauri_specta::Event)]
#[serde(rename_all = "camelCase")]
pub struct DeepLinkEvent {
data: String,
}

#[tokio::main]
async fn main() -> tauri::Result<()> {
@@ -221,9 +225,20 @@ async fn main() -> tauri::Result<()> {

tauri::Builder::default()
.invoke_handler(builder.invoke_handler())
.plugin(tauri_plugin_deep_link::init())
.setup(move |app| {
// We need a the app handle to determine the data directory now.
// This means all the setup code has to be within `setup`, however it doesn't support async so we `block_on`.
let handle = app.handle().clone();
app.listen("deep-link://new-url", move |event| {
let deep_link_event = DeepLinkEvent {
data: event.payload().to_string(),
};
println!("Deep link event={:?}", deep_link_event);

handle.emit("deeplink", deep_link_event).unwrap();
});

block_in_place(|| {
block_on(async move {
builder.mount_events(app);
@@ -239,10 +254,7 @@ async fn main() -> tauri::Result<()> {

// The `_guard` must be assigned to variable for flushing remaining logs on main exit through Drop
let (_guard, result) = match Node::init_logger(&data_dir) {
Ok(guard) => (
Some(guard),
Node::new(data_dir, sd_core::Env::new(CLIENT_ID)).await,
),
Ok(guard) => (Some(guard), Node::new(data_dir).await),
Err(err) => (None, Err(NodeError::Logger(err))),
};

@@ -256,7 +268,7 @@ async fn main() -> tauri::Result<()> {
}
};

let should_clear_localstorage = node.libraries.get_all().await.is_empty();
let should_clear_local_storage = node.libraries.get_all().await.is_empty();

handle.plugin(rspc::integrations::tauri::plugin(router, {
let node = node.clone();
@@ -266,8 +278,8 @@ async fn main() -> tauri::Result<()> {
handle.manage(node.clone());

handle.windows().iter().for_each(|(_, window)| {
if should_clear_localstorage {
println!("cleaning localStorage");
if should_clear_local_storage {
debug!("cleaning localStorage");
for webview in window.webviews() {
webview.eval("localStorage.clear();").ok();
}
@@ -344,6 +356,7 @@ async fn main() -> tauri::Result<()> {
.plugin(tauri_plugin_dialog::init())
.plugin(tauri_plugin_os::init())
.plugin(tauri_plugin_shell::init())
.plugin(tauri_plugin_http::init())
// TODO: Bring back Tauri Plugin Window State - it was buggy so we removed it.
.plugin(tauri_plugin_updater::Builder::new().build())
.plugin(updater::plugin())
15 changes: 13 additions & 2 deletions apps/desktop/src-tauri/tauri.conf.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"$schema": "https://raw.githubusercontent.com/tauri-apps/tauri/tauri-v2.0.0-rc.2/core/tauri-config-schema/schema.json",
"$schema": "https://raw.githubusercontent.com/tauri-apps/tauri/tauri-v2.0.0-rc.8/crates/tauri-cli/tauri.config.schema.json",
"productName": "Spacedrive",
"identifier": "com.spacedrive.desktop",
"build": {
@@ -36,7 +36,12 @@
}
],
"security": {
"csp": "default-src webkit-pdfjs-viewer: asset: https://asset.localhost blob: data: filesystem: ws: wss: http: https: tauri: 'unsafe-eval' 'unsafe-inline' 'self' img-src: 'self'"
"csp": {
"default-src": "'self' webkit-pdfjs-viewer: asset: http://asset.localhost blob: data: filesystem: http: https: tauri:",
"connect-src": "'self' ipc: http://ipc.localhost ws: wss: http: https: tauri:",
"img-src": "'self' asset: http://asset.localhost blob: data: filesystem: http: https: tauri:",
"style-src": "'self' 'unsafe-inline' http: https: tauri:"
}
}
},
"bundle": {
@@ -100,6 +105,12 @@
"endpoints": [
"https://spacedrive.com/api/releases/tauri/{{version}}/{{target}}/{{arch}}"
]
},
"deep-link": {
"mobile": [],
"desktop": {
"schemes": ["spacedrive"]
}
}
}
}
67 changes: 58 additions & 9 deletions apps/desktop/src/App.tsx
Original file line number Diff line number Diff line change
@@ -3,9 +3,10 @@ import { QueryClientProvider } from '@tanstack/react-query';
import { listen } from '@tauri-apps/api/event';
import { PropsWithChildren, startTransition, useEffect, useMemo, useRef, useState } from 'react';
import { createPortal } from 'react-dom';
import { RspcProvider } from '@sd/client';
import { RspcProvider, useBridgeMutation } from '@sd/client';
import {
createRoutes,
DeeplinkEvent,
ErrorPage,
KeybindEvent,
PlatformProvider,
@@ -17,14 +18,11 @@ import { RouteTitleContext } from '@sd/interface/hooks/useRouteTitle';

import '@sd/ui/style/style.scss';

import { useLocale } from '@sd/interface/hooks';

import { commands } from './commands';
import { platform } from './platform';
import { queryClient } from './query';
import { createMemoryRouterWithHistory } from './router';
import { createUpdater } from './updater';

import SuperTokens from 'supertokens-web-js';
import EmailPassword from 'supertokens-web-js/recipe/emailpassword';
import Passwordless from 'supertokens-web-js/recipe/passwordless';
import Session from 'supertokens-web-js/recipe/session';
import ThirdParty from 'supertokens-web-js/recipe/thirdparty';
// TODO: Bring this back once upstream is fixed up.
// const client = hooks.createClient({
// links: [
@@ -34,22 +32,64 @@ import { createUpdater } from './updater';
// tauriLink()
// ]
// });
import getCookieHandler from '@sd/interface/app/$libraryId/settings/client/account/handlers/cookieHandler';
import getWindowHandler from '@sd/interface/app/$libraryId/settings/client/account/handlers/windowHandler';
import { useLocale } from '@sd/interface/hooks';
import { AUTH_SERVER_URL, getTokens } from '@sd/interface/util';

import { commands } from './commands';
import { platform } from './platform';
import { queryClient } from './query';
import { createMemoryRouterWithHistory } from './router';
import { createUpdater } from './updater';

SuperTokens.init({
appInfo: {
apiDomain: AUTH_SERVER_URL,
apiBasePath: '/api/auth',
appName: 'Spacedrive Auth Service'
},
cookieHandler: getCookieHandler,
windowHandler: getWindowHandler,
recipeList: [
Session.init({ tokenTransferMethod: 'header' }),
EmailPassword.init(),
ThirdParty.init(),
Passwordless.init()
]
});

const startupError = (window as any).__SD_ERROR__ as string | undefined;

export default function App() {
useEffect(() => {
// This tells Tauri to show the current window because it's finished loading
commands.appReady();
// .then(() => {
// if (import.meta.env.PROD) window.fetch = fetch;
// });
}, []);

useEffect(() => {
const keybindListener = listen('keybind', (input) => {
document.dispatchEvent(new KeybindEvent(input.payload as string));
});
const deeplinkListener = listen('deeplink', async (data) => {
const payload = (data.payload as any).data as string;
if (!payload) return;
const json = JSON.parse(payload)[0];
if (!json) return;
//json output: "spacedrive://-/URL"
if (typeof json !== 'string') return;
if (!json.startsWith('spacedrive://-')) return;
const url = (json as string).split('://-/')[1];
if (!url) return;
document.dispatchEvent(new DeeplinkEvent(url));
});

return () => {
keybindListener.then((unlisten) => unlisten());
deeplinkListener.then((unlisten) => unlisten());
};
}, []);

@@ -79,6 +119,15 @@ type RedirectPath = { pathname: string; search: string | undefined };
function AppInner() {
const [tabs, setTabs] = useState(() => [createTab()]);
const [selectedTabIndex, setSelectedTabIndex] = useState(0);
const tokens = getTokens();
const cloudBootstrap = useBridgeMutation('cloud.bootstrap');

useEffect(() => {
// If the access token and/or refresh token are missing, we need to skip the cloud bootstrap
if (tokens.accessToken.length === 0 || tokens.refreshToken.length === 0) return;
cloudBootstrap.mutate([tokens.accessToken, tokens.refreshToken]);
// eslint-disable-next-line react-hooks/exhaustive-deps
}, []);

const selectedTab = tabs[selectedTabIndex]!;

3 changes: 2 additions & 1 deletion apps/desktop/tsconfig.json
Original file line number Diff line number Diff line change
@@ -5,7 +5,8 @@
"declarationDir": "dist",
"paths": {
"~/*": ["./src/*"]
}
},
"moduleResolution": "bundler"
},
"include": ["src"],
"references": [
Loading