Commit Graph

2562 Commits

Author SHA1 Message Date
k00b 29b3f6008e reduce prod heap size 2024-10-08 22:25:08 -05:00
k00b adcb80782b caching is hard 2024-10-08 19:26:29 -05:00
k00b 449568e3a2 don't let pending cache to build up 2024-10-08 17:58:15 -05:00
k00b 8c0cafa3ec bump nodejs version 2024-10-08 15:23:27 -05:00
k00b 67498fbc87 bump nextjs patch version 2024-10-08 15:00:37 -05:00
k00b f8d88d18f8 give nextjs more memory in prod 2024-10-08 14:54:21 -05:00
k00b 651053fd71 remove deprecated canonizeResults 2024-10-08 14:25:23 -05:00
k00b ebe513b5ca bump apollo versions 2024-10-08 14:22:12 -05:00
Keyan fec7c92fd9
run noncritical side effects outside critical path of paid action (#1464)
* run noncritical side effects outside critical path of paid action

* fix item fetching of zap side effect

* fix vapid pubkey env var name in readme
2024-10-08 11:48:19 -05:00
k00b 4532e00085 Revert "Include extension in S3 key (#1426)"
This reverts commit b82641d1bd.
2024-10-07 13:22:01 -05:00
Keyan 6b1f3ba8ef
Update awards.csv 2024-10-07 12:09:10 -05:00
k00b a916533826 fix apple-mobile-web-app-capable deprecation 2024-10-07 10:52:29 -05:00
k00b 070b350211 catch when indexeddb is not available fix #1462 2024-10-07 10:51:25 -05:00
k00b 154c0e0a4a fix cache key bloat 2024-10-06 18:56:48 -05:00
k00b 177e0f6bb0 fix #1453 2024-10-05 13:57:55 -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
Keyan a01590e321
Update awards.csv 2024-10-02 19:53:26 -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
Keyan 5f1d3dbde4
Update awards.csv 2024-10-02 18:53:18 -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
toyota-corolla0 c400a6c1c6
feat: cache bio draft (#1455) 2024-10-02 18:06:22 -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
toyota-corolla0 56809d6389
chore: update postgres docker container version (#1449)
* chore: update postgres docker container

* sndev postgres to v16

---------

Co-authored-by: Keyan <34140557+huumn@users.noreply.github.com>
2024-10-02 08:42:56 -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
ekzyis 5d1be66eef
Add nwc_recv container (#1442) 2024-10-01 09:14:29 -05:00
ekzyis 7d86ba3865
Fix local anon not called 'anon' (#1443) 2024-09-30 22:45:11 -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 2e1a7c1035 don't allow other markup in headings 2024-09-29 11:25:01 -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
k00b 80a7c24e54 recognize nostr entities 2024-09-28 18:56:37 -05:00
k00b f7010ee3f7 fix #663 2024-09-28 18:20:33 -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
Keyan 0f9b6f02f6
Update awards.csv 2024-09-26 18:41:24 -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
k00b 5371e1abf8 fix bounty paid action notification 2024-09-26 09:53:25 -05:00
k00b 0d4c8cdc23 no optimistic item repetition for anon 2024-09-26 09:44:14 -05:00
k00b b3c8d32d5a remove debug log comment 2024-09-25 18:04:03 -05:00
k00b 3f49c93ecb update item repetition optimistically 2024-09-25 18:02:40 -05:00
k00b 68f7e4111b prevent shift on pending -> paid 2024-09-25 17:38:37 -05:00
Keyan 9f06fd65ee
UX latency enhancements for paid actions (#1434)
* prevent multiple retries & pulse retry button

* fix lint

* don't wait for settlement on pessimistic zaps

* optimistic act modal
2024-09-25 13:32:52 -05:00
Keyan 450c969dfc
allow edit of pending items (#1431) 2024-09-24 15:42:32 -05:00
ekzyis 1641b58e55
CSS animation for toasts and offcanvas (#1432)
* CSS animation for toasts

* Smaller toasts

* CSS animation for offcanvas

* faster animations and toast from the bottom

---------

Co-authored-by: Keyan <34140557+huumn@users.noreply.github.com>
Co-authored-by: k00b <k00b@stacker.news>
2024-09-24 13:43:15 -05:00
k00b d7667f7820 add boost index 2024-09-24 13:10:10 -05:00