Commit Graph

1232 Commits

Author SHA1 Message Date
k00b eae4c2b882 cancel button spacing 2024-10-30 13:49:57 -05:00
k00b 4f7bdadd80 better wallet security banner 2024-10-30 13:49:57 -05:00
k00b e96982c353 refactor wallet validation 2024-10-30 13:49:57 -05:00
k00b ccdf346954 server side config saves 2024-10-30 13:49:47 -05:00
k00b 4826ae5a7b wip upsertWallet 2024-10-30 13:45:09 -05:00
k00b 2bdbb433df webln saves at least *double kazoo* 2024-10-30 13:45:09 -05:00
k00b 48640cbed6 pages load *kazoo* 2024-10-30 13:45:05 -05:00
k00b da020cf899 complete fantasy scaffolding 2024-10-30 13:44:18 -05:00
Riccardo Balbo fdc3df9c15 force refresh client wallets when device sync is enabled 2024-10-30 13:42:55 -05:00
Riccardo Balbo 3acad86157 improve local storage hook implementation 2024-10-30 13:42:55 -05:00
Riccardo Balbo 86994c4c46 use openConfig instead of useConfig 2024-10-30 13:42:55 -05:00
Riccardo Balbo eeef7039b9 prevent stale me entry from causing vault configurator to delete the local vault key 2024-10-30 13:42:55 -05:00
Riccardo Balbo 4bc669c1c5 prevent double close 2024-10-30 13:42:55 -05:00
Riccardo Balbo 41b86c8251 unsetLocalKey 2024-10-30 13:42:55 -05:00
Riccardo Balbo 1beac3a405 ensure wallet id is in sync before saving the config 2024-10-30 13:41:41 -05:00
Riccardo Balbo 06afe2cda2 remove debug log 2024-10-30 13:41:41 -05:00
Riccardo Balbo 4604a7bac9 use SSR constant 2024-10-30 13:41:41 -05:00
Riccardo Balbo 49cf1f2e23 fix window checks for SSR 2024-10-30 13:41:41 -05:00
Riccardo Balbo b70dbeb6d6 user vault and server side client wallets 2024-10-30 13:41:09 -05:00
ekzyis b50bb2fcc1 Replace unicode currency symbols in inline math 2024-10-28 20:00:00 +01:00
ekzyis c97ce2627b Rename to autoWithdrawMaxFeeTotal 2024-10-20 15:14:31 +02:00
ekzyis d06f89d707 Change text 2024-10-20 15:14:31 +02:00
ekzyis 596d67fc68 Add max base fee setting 2024-10-20 15:14:31 +02:00
ekzyis 49ddace73f Fix first page of wallet logs loaded twice 2024-10-18 15:10:27 +02:00
ekzyis 70858b97f7 Center more button 2024-10-17 21:22:45 +02:00
ekzyis d91c5c90de Fix infinite loop of loading wallet logs 2024-10-17 21:18:11 +02:00
Keyan 7d139faca1
Merge branch 'master' into upgrade-deps 2024-10-15 11:34:55 -05:00
k00b 2562999e85 fix mathjax single dollar conflicts 2024-10-13 10:08:54 -05:00
k00b 81897461e3 fix qrcode display after upgrade 2024-10-12 18:06:07 -05:00
k00b f9ed1ee6f5 upgrade non-(apparently)-breaking major versions 2024-10-12 18:06:07 -05:00
k00b 021a13d21e fix anon badge 2024-10-12 18:05:45 -05:00
Keyan 245419185f
wallet streaks (#1468)
* wallet streaks backend

* notifications and badges

* reuseable streak fragment

* squash migrations

* push notifications

* update cowboy notification setting label text
2024-10-11 19:14:18 -05:00
ekzyis 41da95b125
Fix wallet double tap on mobile (#1467)
* Fix wallet double tap on mobile

* also add icon that card can be dragged

* Fix ugly drag image
2024-10-09 19:27:49 -05:00
k00b 070b350211 catch when indexeddb is not available fix #1462 2024-10-07 10:51:25 -05:00
k00b 153455983e Revert "Encrypted device sync (#1373)"
This reverts commit a9a566a79f.
2024-10-04 15:00:13 -05:00
Keyan 5543a0755a
paginating wallet logs (#1459)
* paginating wallet logs

* refine
2024-10-04 06:59:32 -05:00
k00b 00bcd8c992 fix #1451 2024-10-02 21:23:16 -05:00
k00b dff452f00f mathjax close #1436 2024-10-02 19:52:05 -05:00
Keyan f4382ad73e
better boost hints (#1441)
* better boost hints

* refine
2024-10-02 19:24:01 -05:00
k00b 65a7ef10d0 make bio work as paid action 2024-10-02 18:39:56 -05:00
k00b 5fab3abb82 fix bio quirks 2024-10-02 18:12:49 -05:00
Keyan 4ce395889d
Be kind to lnd (#1448)
* cache or remove unecessary calls to lnd

* avoid redundant grpc calls in state machine

* store preimage whenever available

* enhancements post self-code review

* small refinements

* fixes

* fix lnurl-verify

* prevent wallet logger throwing on idb close

* fix promise in race while waiting for payment
2024-10-02 15:03:30 -05:00
Riccardo Balbo a9a566a79f
Encrypted device sync (#1373)
* user vault

* code cleanup and fixes

* improve ui

* prevent name collisions between users on the same device

* some improvements

* implement storage migration

* comments and cleanup

* make connect button primary instead of warning

* move show passphrase in new line (improvement for small screen devices)

* make show passphrase field readOnly

* fixes

* fix vault key unsync

* implicit migration

* move device sync under  general tab

* fix locally disabled wallets and default wallet selection

* improve text

* remove useless SSR check

* add auth checks

* Rename variables

* Fix missing await

* Refactor local<>vault storage interface

I've changed quite some things here. Attempt of a summary:

* storageKey is now only controlled by useVaultStorageState

I've noticed that dealing with how storage keys are generated (to apply user scope) was handled in two places: the existing wallet code and in the new vault code.

This was confusing and error-prone. I've fixed that by completely relying on the new vault code to generate correct storage keys.

* refactored migration

Migration now simply encrypts any existing local wallets and sends them to the server. On success, the local unencrypted version is deleted.

The previous code seemed to unnecessarily generate new local entries prefixed by 'vault:'.

However, since we either use unencrypted local state OR use the encrypted vault on the server for the data, I didn't see any need for these.

Migration seems to work just as well as before.

* removed unnecessary state

In the <DeviceSync> component, enabled & connected were using a unnecessary combo of useState+useEffect.

They were only using variables that are always available during render so simple assignments were enough.

* other minor changes include:

  * early returns
  * remove unnecessary SSR checks in useEffect or useCallback
  * formatting, comments
  * remove unnecessary me? to expose possible bugs

* Fix missing dependency for useZap

This didn't cause any bugs because useWallet returns everything we need on first render.

This caused a bug with E2EE device sync branch though since there the wallet is loaded async.

This meant that during payment, the wallet config was undefined.

* Assume JSON during encryption and decryption

* Fix stale value from cache served on next fetches

* Add wallet.perDevice field

This adds 'perDevice' as a new wallet field to force local storage. For example, WebLN should not be synced across devices.

* Remove debug buttons

* Rename userVault -> vault

* Update console.log's

* revert some of the migration and key handling changes. restore debug buttons for testing

* Fix existing wallets not loaded

* Pass in localOnly and generate localStorageKey once

* Small refactor of migration

* Fix wallet drag and drop

* Add passphrase copy button

* Fix priorityOnly -> skipTests

* Disable autocompletion for reset confirmation prompt

* Show wrong passphrase as input error

* Move code into components/device-sync.js

* Import/export passphrase via QR code

* Fix modal back button invisible in light mode

* Fix modal closed even on connect error

* Use me-2 for cancel/close button

* Some rephrasing

* Fix wallet detach

* Remove debug buttons

* Fix QR code scan in dark mode

* Don't allow custom passphrases

* More rephrasing

* Only use schema if not enabled

* Fix typo in comment

* Replace 'generate passphrase' button with reload icon

* Add comment about IV reuse in GCM

* Use 600k iterations as recommended by OWASP

* Set extractable to false where not needed

* use-vault fallbacks to local storage only for anonymous users

* fix localStorage reset on logout

* add copy button

* move reset out of modals

* hide server side errors

* hardened passphrase storage

* do not show passphrase even if hardened storage is disabled (ie. indexeddb not supported)

* show qr code button on passphrase creation

* use toast for serverside error

* Move key (de)serialization burden to get/setLocalKey functions

* password textarea and remove qr

* don't print plaintext vault values into console

---------

Co-authored-by: ekzyis <ek@stacker.news>
Co-authored-by: Keyan <34140557+huumn@users.noreply.github.com>
Co-authored-by: k00b <k00b@stacker.news>
2024-10-01 14:55:01 -05:00
k00b 861e944fe1 fix item full embed for the 3rd and final(?) time 2024-09-30 12:37:33 -05:00
k00b 865cdccb2a fix item full embed param 2024-09-30 12:24:06 -05:00
k00b bbdc37ffd4 fix missing src on autolinks 2024-09-29 11:13:33 -05:00
k00b 6f198fd1ca dark mode for nostr embed 2024-09-28 20:02:33 -05:00
k00b 4f158a98a8 fix link item embed regression 2024-09-28 19:17:15 -05:00
Keyan cc4bbf99e4
fixes #1395 (#1430)
* fixes #1395

* rehype plugin for embeds

* fix lint

* replace many plugins with one rehype and improve image collage

* remove unused css

* handle more custom markdown behavior in rehype

* refactor markdown rendering more + better footnotes

* move more markdown logic to reyhpe plugin + better headers

* fix #1397

* refactor embeds out of media-or-link
2024-09-28 16:33:07 -05:00
ekzyis 9f79d588a8
Image carousel (#1425)
* Add image carousel in fullscreen

* Flip through all images of a post

* Disable image selection in fullscreen

* Keep max-width: 100vw for images

* Fix missing dependency

* fix merge resolve bug

* better css

* refactor, keypress/swipe events, remove scoll

* changes after self-review

* give previews their own carousel

* hooks for arrow keys and swiping

---------

Co-authored-by: Keyan <34140557+huumn@users.noreply.github.com>
Co-authored-by: k00b <k00b@stacker.news>
2024-09-26 17:37:13 -05:00