* not-custodial zap scaffolding
* invoice forward state machine
* small refinements to state machine
* make wrap invoice work
* get state machine working end to end
* untested logic layout for paidAction invoice wraps
* perform pessimisitic actions before outgoing payment
* working end to end
* remove unneeded params from wallets/server/createInvoice
* fix cltv relative/absolute confusion + cancelling forwards
* small refinements
* add p2p wrap info to paidAction docs
* fallback to SN invoice when wrap fails
* fix paidAction retry description
* consistent naming scheme for state machine
* refinements
* have sn pay bounded outbound fee
* remove debug logging
* reenable lnc permissions checks
* don't p2p zap on item forward splits
* make createInvoice params json encodeable
* direct -> p2p badge on notifications
* allow no tls in dev for core lightning
* fix autowithdraw to create invoice with msats
* fix autowithdraw msats/sats inconsitency
* label p2p zaps properly in satistics
* add fees to autowithdrawal notifications
* add RETRYING as terminal paid action state
* Update api/paidAction/README.md
Co-authored-by: ekzyis <ek@stacker.news>
* Update api/paidAction/README.md
Co-authored-by: ekzyis <ek@stacker.news>
* Update api/lnd/index.js
Co-authored-by: ekzyis <ek@stacker.news>
* ek suggestions
* add bugetable to nwc card
* get paranoid with numbers
* better finalize retries and better max timeout height
* refine forward failure transitions
* more accurate satistics p2p status
* make sure paidaction cancel in state machine only
* dont drop bolt11s unless status is not null
* only allow PENDING_HELD to transition to FORWARDING
* add mermaid state machine diagrams to paid action doc
* fix cancel transition name
* cleanup readme
* move forwarding outside of transition
* refine testServerConnect and make sure ensureB64 transforms
* remove unused params from testServerConnect
---------
Co-authored-by: ekzyis <ek@stacker.news>
Co-authored-by: k00b <k00b@stacker.news>
* Support receiving with LNbits
* Remove hardcoded LNbits url on server
* Fix saveConfig ignoring save errors
* saveConfig was meant to only ignore validation errors, not save errors
* on server save errors, we redirected as if save was successful
* this is now fixed with a promise chain
* logging payments vs receivals was also moved to correct place
* Fix enabled falsely disabled on SSR
If a wallet was configured for payments but not for receivals and you refreshed the configuration form, enabled was disabled even though payments were enabled.
This was the case since we don't know during SSR if it's enabled since this information is stored on the client.
* Fix missing 'receivals disabled' log message
* Move 'wallet detached for payments' log message
* Fix stale walletId during detach
If page was reloaded, walletId in clearConfig was stale since callback dependency was missing.
* Add missing callback dependencies for saveConfig
* Verify that invoiceKey != adminKey
* Verify LNbits keys are hex-encoded
* Fix local config polluted with server data
* Fix creation of duplicate wallets
* Remove unused dependency
* Fix missing error message in logs
* Fix setPriority
* Rename: localConfig -> clientConfig
* Add description to LNbits autowithdrawals
* Rename: receivals -> receives
* Use try/catch instead of promise chain in saveConfig
* add connect label to lnbits for no url found for lnbits
* Fix adminKey not saved
* Remove hardcoded LNbits url on server again
* Add LNbits ATTACH.md
* Delete old docs to attach LNbits with polar
* Add missing callback dependencies
* Set editable: false
* Only set readOnly if field is configured
---------
Co-authored-by: keyan <keyan.kousha+huumn@gmail.com>
Co-authored-by: Keyan <34140557+huumn@users.noreply.github.com>
* Use context for pending sats
* Fix sats going negative on zap undo
We already handle undoing pending sats by wrapping the payment+mutation with try/finally.
* Remove unnecessary ItemContextProvider
* Rename to parentCtx
* Fix hierarchy of ItemContextProvider
If a comment was root and it was zapped, the pending sats contributed to the sats shown in <CommentsHeader>.
This was caused by <CommentsHeader> accessing the root item context for all comments, even for the root comment.
So even if the root comment was zapped, the pending sats contributed to the sats for the comment section.
This wasn't the case for posts since their item context was above the context used by <CommentsHeader>.
This was fixed by moving <ItemProviderContext> down into <Comments> and <Item> instead of declaring it at <ItemFull> which wraps the root item and all comments.
* Optimistic update for poll votes
* prevent twice optimistic zap
* enhance client notifications with skeleton and no redudant queries
* enlarge nwc amount limits
* Disable max amount and daily limit in NWC container
---------
Co-authored-by: Keyan <34140557+huumn@users.noreply.github.com>
Co-authored-by: keyan <keyan.kousha+huumn@gmail.com>
* first pass of hashing user emails
* use salt
* add a salt to .env.development (prod salt needs to be kept a secret)
* move `hashEmail` util to a new util module
* trigger a one-time job to migrate existing emails via the worker
so we can use the salt from an env var
* move newsletter signup
move newsletter signup to prisma adapter create user with email code path
so we can still auto-enroll email accounts without having to persist the email address
in plaintext
* remove `email` from api key session lookup query
* drop user email index before dropping column
* restore email column, just null values instead
* fix function name
* fix salt and hash raw sql statement
* update auth methods email type in typedefs from str to bool
* remove todo comment
* lowercase email before hashing during migration
* check for emailHash and email to accommodate migration window
update our lookups to check for a matching emailHash, and then a matching
email, in that order, to accommodate the case that a user tries to login
via email while the migration is running, and their account has not yet been migrated
also update sndev to have a command `./sndev email` to launch the mailhog inbox in your browser
also update `./sndev login` to hash the generated email address and insert it into the db record
* update sndev help
* update awards.csv
* update the hack in next-auth to re-use the email supplied on input to `getUserByEmail`
* consolidate console.error logs
* create generic open command
---------
Co-authored-by: Keyan <34140557+huumn@users.noreply.github.com>
Co-authored-by: keyan <keyan.kousha+huumn@gmail.com>
Arrays for env_file are only supported in Docker Compose >=v2.24 which is too new (from January 2024). Most distros distribute older packages.
Since --env-file as defined in the sndev script acts as an override for env_file anyway, we can safely remove it here.
Co-authored-by: ekzyis <ekzyis@ekzy.is>
* Modified docker-compose.yml to include capture from /capture
Signed-off-by: Anis Khalfallah <khafallah.anis@hotmail.com>
* Update capture's container to include health checks via /health api
* refine capure docker service
---------
Signed-off-by: Anis Khalfallah <khafallah.anis@hotmail.com>
Co-authored-by: Anis Khalfallah <khafallah.anis@hotmail.com>
Co-authored-by: Keyan <34140557+huumn@users.noreply.github.com>
Co-authored-by: keyan <keyan.kousha+huumn@gmail.com>
This makes it possible to continue to use lncli without --rpcserver inside the docker container even if the GRPC port exposed on the host machine is different.
This is the case on my machine since I am running a mainnet LND node on my machine so port 10009 is already used.
I could change the port to 20009 via LND_GRPC_PORT and STACKER_LND_GRPC_PORT (they can even have the same port) but then lncli inside the container needs to be aware of that which means that the sndev script would need to parse .env.development (or some other "magic") to know the GRPC port inside the container.
However, I decided that using standard ports inside the container is better to keep the sndev script simple at the cost of having to think about host vs container ports since they are different now.
One reason for that is that I think one even does not need to think about the host ports since they aren't even needed? But that's another topic.
* add containers for OpenSearch
* switch OpenSearch Dashboards to http
* add script to take care of index/mapping on first run
* limit mount in opensearch container to only the necessary scope
* handle both docker and non-docker dev setups
* cleanup
* make opensearch work in docker dev
---------
Co-authored-by: rleed <rleed1@pm.me>
Co-authored-by: Keyan <34140557+huumn@users.noreply.github.com>
Co-authored-by: keyan <keyan.kousha+huumn@gmail.com>
* Parse image links during markdown rendering
* Use imgproxy to replace links
* Add healthcheck
See https://docs.imgproxy.net/healthcheck
* Enable WebP and animation support
* Only replace image URLs
* Replace all occurrences
* Fix creating posts with no text
* Embed image on link posts where link is image
---------
Co-authored-by: ekzyis <ek@stacker.news>