70 Commits
Author SHA1 Message Date
gohumbleandGitHub d88b04afb9 update inputmode to decimal (ios keyboard) (#416) 2023-08-13 15:17:50 +02:00
307780200a add logs (#479)
* added docker dockerfile and compose including lnd + bitcoind + c-lightning + lnbits

* Revert "added docker dockerfile and compose including lnd + bitcoind + c-lightning + lnbits"

This reverts commit 69e66450a3e6b5d3296280675c51ac54ded09d01.

* update CommentAllowed

* update donate

* fix amount

* Update database.go

---------

Co-authored-by: gohumble <humble@gmail.com>
2023-06-29 14:44:56 +02:00
gohumbleandGitHub 6a9c5f4a8a fix amount (#478)
* added docker dockerfile and compose including lnd + bitcoind + c-lightning + lnbits

* Revert "added docker dockerfile and compose including lnd + bitcoind + c-lightning + lnbits"

This reverts commit 69e66450a3e6b5d3296280675c51ac54ded09d01.

* update CommentAllowed

* update donate

* fix amount
2023-06-29 13:40:45 +02:00
gohumbleandGitHub 8e9c03d0e5 update CommentAllowed and donate
* update CommentAllowed

* update donate
2023-06-29 13:28:41 +02:00
gohumbleandGitHub 8598adb280 added chatGPT (#435) 2022-12-11 19:12:34 +01:00
gohumbleandGitHub d264650207 #432 return default http client for empty socks host configuration (#433) 2022-11-28 19:33:02 +01:00
gohumbleandGitHub c611969feb moved translation (#431) 2022-11-03 10:15:48 +01:00
gohumbleandGitHub a67ec62054 added isOnionRegex (#430) 2022-11-03 09:32:38 +01:00
gohumbleandGitHub 895fd06a14 added GetClientForScheme (#429) 2022-11-03 09:20:32 +01:00
gohumbleandGitHub bc8c8f952a trim whitespaces in send handler (#424) 2022-10-20 09:36:59 +02:00
gohumbleandGitHub 64055db1a5 sse fix (#422)
* fix sse

* close c
2022-10-06 14:18:29 +02:00
gohumbleandGitHub ec679d5e6b removed connection keep alive header (#421) 2022-10-06 09:48:23 +02:00
gohumbleandGitHub 9e8958ece2 Update pl.toml (#419)
fix polish help text from #417
2022-09-25 20:48:27 +02:00
gohumbleandGitHub 45931c087a decode lnurl using strict functions (#415) 2022-09-07 18:47:52 +02:00
gohumbleandGitHub c561ae24d3 updated golnurl (#414) 2022-09-07 18:12:25 +02:00
gohumbleandGitHub ced9446287 update error handling and logs (#411) 2022-08-31 21:02:35 +02:00
gohumbleandGitHub 94ed7d4692 dalle admin api. Added configurable worker (#410) 2022-08-31 20:09:55 +02:00
gohumbleandGitHub d3c2fe7117 disable dalle if key is empty (#409) 2022-08-31 19:32:24 +02:00
gohumbleandGitHub 857649150d fix format (#407) 2022-08-31 16:07:04 +02:00
bf643f103d 🪄 update telebot v3 🤖 (#325)
* 🚧 minor changes to all handlers...

* 🚧 passing callback to tryEditStack

* 🚧 edit and delete callback messages

* 🚧 refactor again

* 🚧 uncomment this

* 🚧 using ctx.Message().Text

* 🚧 refactor

* 🚧 refactor

* 🚧 uncomment

* context not queruy

* 🚧 update forked lightningtipbot

* 🚧 reset ArticleResult

* fix inline receive

* readd shop

* remove chat from shopView

Co-authored-by: callebtc <93376500+callebtc@users.noreply.github.com>
2022-03-27 22:19:38 +02:00
gohumbleandGitHub a9f6539eaf 🪄 fix LNURL states redundant initialization (#318) 2022-02-27 15:33:04 +03:00
gohumbleandGitHub 1179800a4b 🪄 fix withdraw state handler (#316) 2022-02-26 10:53:15 +03:00
725af545ab WIP: adding downloadMyProfilePicture and botProfilePicture to LNURL Meta (#297)
* adding downloadMyProfilePicture and botProfilePicture to serveLNURLFirst (pay)

* fix image download to ram

* add downloadProfilePicture

* add cache and download limit

* error checks

* user picture

* empty entry bug check for uuid

* check

* fix example

Co-authored-by: callebtc <93376500+callebtc@users.noreply.github.com>
2022-02-11 10:04:08 +01:00
2b09fc95dd print debug stack on empty annon id update (#299)
* print debug stack on empty annon id update

* write stack to file

* use AnnonID

* set ids

* comments

Co-authored-by: callebtc <93376500+callebtc@users.noreply.github.com>
2022-02-07 22:12:03 +01:00
54beceba32 add empty callback response (#301)
* add empty response

* commend

Co-authored-by: callebtc <93376500+callebtc@users.noreply.github.com>
2022-02-07 22:03:17 +01:00
902928f794 perform graceful shutdown on SIGTERM and SIGSTOP (#281)
* perform graceful shutdown on SIGTERM and SIGSTOP

* comments

Co-authored-by: callebtc <93376500+callebtc@users.noreply.github.com>
2022-01-23 00:48:27 +01:00
96292604c7 adding lnurl auth (#294)
* adding lnurl auth poc

* add response and translation

* refactor

* simpler

* using http bot client with proxy transport

* functions

* translations

* clean

* comment

* revert

Co-authored-by: callebtc <93376500+callebtc@users.noreply.github.com>
2022-01-22 23:25:21 +01:00
4e812f7897 add errors to handler (#273)
* add errors to handler

* add errors to handlers

* shop fixes (#274)

Co-authored-by: callebtc <93376500+callebtc@users.noreply.github.com>

* better log (#275)

Co-authored-by: callebtc <93376500+callebtc@users.noreply.github.com>

* add errors to map

* more errors

* rename NoWalletError

* fix one panic (#276)

Co-authored-by: callebtc <93376500+callebtc@users.noreply.github.com>

* add invalid type error

* Shop panic attempt 2 (#277)

* less log

* fix shop first view

Co-authored-by: callebtc <93376500+callebtc@users.noreply.github.com>

* make errors private

* add errors to handler

* add errors to handlers

* add errors to map

* more errors

* rename NoWalletError

* add invalid type error

* make errors private

* patch

* return handlers

* add noPrivateChat

* add invalid amount err

Co-authored-by: LightningTipBot <88730856+LightningTipBot@users.noreply.github.com>
Co-authored-by: callebtc <93376500+callebtc@users.noreply.github.com>
2022-01-09 21:39:09 +01:00
c706ed7aaf update edit stack (#269)
* update edit stack

* update faucet

* better debug logging

Co-authored-by: callebtc <93376500+callebtc@users.noreply.github.com>
2022-01-06 10:33:01 +01:00
gohumbleandGitHub b42a9ae8b4 using UpdateUserRecord (#265) 2022-01-05 01:53:45 +01:00
8f60cb82f3 add admin service (#263)
* add admin server + service

* string fixes

* ban and unban user

* add return

* ban using admin key

* ban reason

* remove redundant func call

* add http status

* add log

* anon_id_sha256 (#262)

* anon_id_sha256

* refactor sha256 hash to strings package

* oops

Co-authored-by: callebtc <93376500+callebtc@users.noreply.github.com>

* add admin server + service

* ban and unban user

* string fixes

* add return

* ban using admin key

* ban reason

* remove redundant func call

* add http status

* add log

Co-authored-by: callebtc <93376500+callebtc@users.noreply.github.com>
Co-authored-by: LightningTipBot <88730856+LightningTipBot@users.noreply.github.com>
2022-01-05 01:40:37 +01:00
gohumbleandGitHub 01710f3385 separate lnurl and api server (#261)
* separate lnurl and api server

* add lndhub handler and proxy

* update proxy

* fix AppendRoute with empty methods

* add logs

* fix trace

* dump request

* parse bearer token

* exclude banned users

* exclude banned users

* fix log levels
2022-01-05 00:09:11 +01:00
25dc9d7b34 add edit stack lifo (#231)
* add edit stack lifo

* remove log message

* Finish the faucet (#232)

* speed up tx lock

* yolo master

* finish the faucet when inactive

* delete comments

Co-authored-by: callebtc <93376500+callebtc@users.noreply.github.com>

* add once + singleton click interceptor (#229)

* speed up tx lock

* yolo master

* add once + singleton click interceptor

* yoooo;

* stuff

Co-authored-by: callebtc <93376500+callebtc@users.noreply.github.com>

* Log oncemap (#233)

* speed up tx lock

* yolo master

* logging

Co-authored-by: callebtc <93376500+callebtc@users.noreply.github.com>

* Balance button (#236)

* speed up tx lock

* yolo master

* blanace button

Co-authored-by: callebtc <93376500+callebtc@users.noreply.github.com>

* Balance on invoice (#237)

* speed up tx lock

* yolo master

* balance check on invoice

Co-authored-by: callebtc <93376500+callebtc@users.noreply.github.com>

* add mutex http endpoints (#238)

* Faucet balance update (#239)

* speed up tx lock

* yolo master

* balance check faucet

* limit reset

Co-authored-by: callebtc <93376500+callebtc@users.noreply.github.com>

* Unlock admin (#240)

* add mutex http endpoints

* remove mutex by id

* remove mutex by id

Co-authored-by: lngohumble <lngohumble@gmail.com>

* fix nLocks (#241)

* using shop.base.id (#242)

* using shop.base.id

* using shop.base.id

* using shop.base.id

* Adjust log levels (#244)

* speed up tx lock

* yolo master

* better log

Co-authored-by: callebtc <93376500+callebtc@users.noreply.github.com>

* fix edit signature rate limiter (#234)

* Skip duplicate edits (#245)

* speed up tx lock

* yolo master

* skip duplicate edit

Co-authored-by: callebtc <93376500+callebtc@users.noreply.github.com>

* only remove on unlock (#246)

* add edit stack lifo

* finish faucet corrected

* improve edit stack

* edit.go

* uncomment faucet check

Co-authored-by: LightningTipBot <88730856+LightningTipBot@users.noreply.github.com>
Co-authored-by: callebtc <93376500+callebtc@users.noreply.github.com>
2021-12-26 20:57:38 +01:00
gohumbleandGitHub 01423827b7 Fix shop v1 (#243)
* using shop.base.id

* using shop.base.id

* using shop.base.id

* remove index from delete status messages

* fix delete status messages
2021-12-26 20:46:56 +01:00
gohumbleandGitHub f1df1e6377 only remove on unlock (#246) 2021-12-26 16:58:05 +01:00
gohumbleandGitHub 9c6062f317 fix edit signature rate limiter (#234) 2021-12-26 16:37:43 +01:00
gohumbleandGitHub c23d69e8f1 using shop.base.id (#242)
* using shop.base.id

* using shop.base.id

* using shop.base.id
2021-12-26 15:38:26 +01:00
gohumbleandGitHub 35d5ed8d8e fix nLocks (#241) 2021-12-26 15:12:18 +01:00
gohumbleandGitHub 24e4212a93 add mutex http endpoints (#238) 2021-12-26 14:20:50 +01:00
151ed39b04 add once + singleton click interceptor (#229)
* speed up tx lock

* yolo master

* add once + singleton click interceptor

* yoooo;

* stuff

Co-authored-by: callebtc <93376500+callebtc@users.noreply.github.com>
2021-12-26 00:23:58 +01:00
gohumbleandGitHub 1b720b498c print faucet link if available (#218) 2021-12-24 18:11:00 +01:00
gohumbleandGitHub 2066470cba send telegram messages async (#219) 2021-12-24 18:10:52 +01:00
gohumbleandGitHub eb07cdf117 disable rl for edit (#210) 2021-12-24 16:35:46 +01:00
gohumbleandGitHub 0ce42e8f1f do not cancel inactive faucet (#208)
* fix logs

* remove cancel faucet if not active
2021-12-24 16:04:36 +01:00
gohumbleandGitHub 47ef5baee3 fix mutex final last v2 maybe (#202)
* remove mutex on unlock

* add pprof

* fix mutex lock

* fix logs
2021-12-24 14:25:35 +01:00
gohumbleandGitHub 6aa05c8faa Callback response (#200)
* add answerCallbackInterceptor

* use answerCallbackInterceptor

* fix nil response
2021-12-24 02:22:41 +01:00
gohumbleandGitHub a9f2728c93 add Lock and Unlock soft (#193) 2021-12-23 19:06:15 +01:00
gohumbleandGitHub 657fc7af1d fix mutex (#192) 2021-12-23 17:18:04 +01:00
gohumbleandGitHub 1b24072020 Interface conversion (#191)
* remove user mutex log message

* add bunt cache

* fix send and pay data pointer conversion
2021-12-23 17:07:41 +01:00
gohumbleandGitHub 72381d0071 Bunt cache (#189)
* remove user mutex log message

* add bunt cache
2021-12-23 16:52:24 +01:00
gohumbleandGitHub bc0d3df897 Fix log (#187)
* remove user mutex log message

* remove log

* fix bunt locks log messages
2021-12-23 15:57:48 +01:00
gohumbleandGitHub fa234d4073 remove user mutex log message (#186) 2021-12-23 15:50:41 +01:00
gohumbleandGitHub dd88c93474 add mutex package (#185)
* add mutex package

* fix cancelSendHandler
2021-12-23 15:47:18 +01:00
gohumbleandGitHub 6b5e30dbe4 Fix tx lock (#180)
* unlock tx mutex on GET error

* log tx id on timeout
2021-12-22 19:24:51 +01:00
gohumbleandGitHub 72ef490538 unlock tx mutex on GET error (#179) 2021-12-22 19:13:21 +01:00
gohumbleandGitHub 7e2404eaf5 add transaction mutex lock (#178) 2021-12-22 18:54:06 +01:00
gohumbleandGitHub 64f9492af2 update no private chat error message (#177) 2021-12-22 18:03:03 +01:00
gohumbleandGitHub f85ec34bcc fix lock intercept (#176) 2021-12-22 17:48:30 +01:00
8b40253169 remove default interceptors (#174)
* defer intercept after before intercept error check.

* log trace level

* get rid of default interceptors

Co-authored-by: callebtc <93376500+callebtc@users.noreply.github.com>
2021-12-22 17:34:57 +01:00
a59a7c226d defer intercept after before intercept error check (#173)
* defer intercept after before intercept error check.

* log trace level

Co-authored-by: callebtc <93376500+callebtc@users.noreply.github.com>
2021-12-22 14:40:48 +01:00
gohumbleandGitHub 1b922c03a9 mutex interceptor patch to prevent concurrent map read / write (#157)
* add handlerMapMutex

* cleanup
2021-12-08 09:55:56 +01:00
f6768b72ea Mutex lock per Telegram User ID (#156)
* lets go

* dunno

* fix after interceptor

* getTelegramUserFromInterface

* clean up requireUserInterceptor

* clean up bs

* cleanup

* cleanup2

* add comment

* fix before default interceptor

* async sleep

* back to 60

* remove newline

* adding defer interceptor

* handlers tighter

Co-authored-by: callebtc <93376500+callebtc@users.noreply.github.com>
2021-12-07 22:55:21 +01:00
gohumbleandGitHub a0799b1b32 isAdminAndCanEdit fix (#154)
* Update telegram.go

* remove isAdminAndCanEdit on tryEdit

* remove isAdminAndCanEdit
2021-12-07 10:34:37 +01:00
aaa8a3cc19 WIP: rate limiter per chat (#86)
* add rate limiter per chat

* differentiate between global and chat rate limiting

* remove diffs

* resolve conflicts

* resolve conflict

* refactor limiter

* rename

* rename

* logs

* remove logs

* reset buckets

* new rate limiter

* fix comments

* separate id and global limiter

* rename stuff

* reset bucket size

Co-authored-by: callebtc <93376500+callebtc@users.noreply.github.com>
2021-12-06 22:22:02 +01:00
gohumbleandGitHub 25d9b8af3b Check admin rights (#152)
* add rightsToDoAction

* comments

* comments

* typo

* check for id

* return CanEditMessages
2021-12-06 20:08:33 +01:00
gohumbleandGitHub dd57247266 increase lnbits pay timeout (#127) 2021-11-14 22:03:14 +01:00
gohumbleandGitHub 051174bd1c using anyChosenInlineHandler (#128)
* using anyChosenInlineHandler

* error logging
2021-11-14 21:57:54 +01:00
a880d7b044 Contains -> HasPrefix || HasSuffix (#91)
Co-authored-by: LightningTipBot <hWOofXvq4m@mail.com>
2021-10-08 08:42:19 +02:00
94eff98f60 bunt transaction generalization (#73)
* add generalized bunt database transaction

* use bunt tx for inline faucet and send

* use bunt tx for inline receive

* use bunt tx for inline send

* use bunt tx for pay

* fix typo

* readd context

* add generalized bunt database transaction

* use bunt tx for inline faucet and send

* use bunt tx for inline receive

* use bunt tx for inline send

* use bunt tx for pay

* fix typo

* readd context

* some fixes

* tigher error checking

* add CreatedAt and UpdatedAt flags

* check error in GetTransaction

* add bunt transaction package and rename stuff

* use transaction.Base as function receiver for transaction functions

* add transaction.Base.Set function

* fix tiptooltip bunt index

* refactor

* auto update updated at

* refactor

* remove balance from error

* fix updated at

* faucet errors

* add generalized bunt database transaction

* use bunt tx for inline faucet and send

* use bunt tx for inline receive

* use bunt tx for inline send

* use bunt tx for pay

* fix typo

* readd context

* some fixes

* tigher error checking

* add generalized bunt database transaction

* use bunt tx for inline faucet and send

* use bunt tx for inline send

* add CreatedAt and UpdatedAt flags

* check error in GetTransaction

* add bunt transaction package and rename stuff

* use transaction.Base as function receiver for transaction functions

* add transaction.Base.Set function

* fix tiptooltip bunt index

* refactor

* auto update updated at

* fix updated at

* faucet errors

* refactor

* remove balance from error

* rebase fixes

* fix imports

* fix de string

* fix receive and send

* faucet language

* remove pay constructor

* release faucet

* remove redundant inTransaction

* remove constructor

* remove constructor

* transaction get pointer receiver

* send race condition

* inactivate in db

Co-authored-by: LightningTipBot <hWOofXvq4m@mail.com>
2021-10-08 00:46:52 +03:00
fbbe18d7a7 add interceptor and handler context (#69)
* add interceptor for handler context

* remove user load

* remove UserInitializedWallet

* remove getuser invocation

* add lnbits user to inlineFaucet

* set wallet client

* lnbits user to inline receive

* lnbits user to inline send

* add context to handleInlineReceiveQuery

* add handler.go

* fix help message

* fix handler registration

* rename

* check if reply to is nil

* remove unwanted stuff

* error handlers

* remove client from wallet

* rename force to require

* string fixes

* add intercept.Func

* add PrivateChat check

* remove private chat requirement for anytexthandler

* fix callback

* errors fixed

* fix callback

* loadUser

* do not require

* check type in interceptor

* check type in interceptor

* check for user wallets

* allow send for toUser with wallet but not initialized

* fix reply to context

* mdescape

* strfux

* set state columns only

* update str

* set user now

* anytext should not load user outside pm

* rename endpoint to donationEndpoint

* register uppercase endpoints and add comments

* fix photos in logMessageInterceptor

* reduce log level to trace

Co-authored-by: LightningTipBot <hWOofXvq4m@mail.com>
2021-09-21 21:35:10 +02:00