55 Commits

Author SHA1 Message Date
Yasuhiro Matsumoto
db9bd14e12 fix build 2025-02-06 21:37:46 +09:00
Yasuhiro Matsumoto
b217f090a9 fix memory leak 2024-09-24 22:24:36 +09:00
Yasuhiro Matsumoto
e1564654e5 update deps 2024-02-22 10:47:59 +09:00
Yasuhiro Matsumoto
d4525d5d77 update deps 2024-01-02 03:20:18 +09:00
Yasuhiro Matsumoto
27c61818b0 update deps 2023-12-19 11:34:48 +09:00
Yasuhiro Matsumoto
86928e57d1 update deps 2023-11-07 07:58:20 +09:00
fiatjaf
6b232318a5 update to eventstore v0.2.0 with .Close() methods on interfaces. 2023-11-05 11:19:41 -03:00
fiatjaf
ba76f13378 use eventstore release v0.0.1 2023-10-31 16:47:53 -03:00
fiatjaf
8273e44295 remove storage plugins and move those to eventstore module. 2023-10-31 16:16:38 -03:00
mattn
8c7e162494 Merge pull request #96 from mattn/mysql
[WIP] experimental implemenation for mysql storage
2023-10-26 23:27:13 +09:00
Yasuhiro Matsumoto
9cc3a94e54 experimental implemenation for mysql storage 2023-10-23 00:38:41 +09:00
emidev98
aa64780d77 feat: golang 1.21 2023-09-08 23:15:22 +08:00
Ben Woodward
1935f62c29 feat: basic per-connection rate limiter (#1) 2023-08-12 21:24:30 -03:00
fiatjaf
dc594ee32b migrate to fasthttp/websocket. 2023-06-23 07:10:59 -03:00
fiatjaf
ebfff13b18 use envelopes everywhere. 2023-06-16 17:48:34 -03:00
fiatjaf
b2bf358789 update to go-nostr 0.18.3 2023-05-18 09:47:04 -03:00
Yasuhiro Matsumoto
2771d9b8ba fix(all): use v2 module 2023-05-08 12:49:11 -03:00
bndw
ae641fd24d refactor(postgres): make SQL generation testable
Decouples the postgresql sql generation from the query execution.
This allows the logic for building sql to be unit tested without
access to a database.

This work was motivated when a client was not receiving events as
expected. In debugging I found that if a tag's value was an empty array,
then no query would be executed - and to my surprised no error is
raised either. I wanted to get a better sense of the current constraints on
when queries are and are not executed, but I had a hard time keeping the
code in my head. This led me to extracting the sql generation into its
own function and writing the unit tests that document its current
behavior. This refactor makes no changes to the current logic. I have added
some REVIEW comments in the test cases where I thought some error handling
could be introduced but I wanted to first see if you were receptive to this
refactor before proposing any functional changes.
2023-05-02 12:41:51 -03:00
fiatjaf
4e15120111 migrate all built-in storage backends. 2023-05-01 19:41:17 -03:00
fiatjaf
e3d4655dba v2 with breaking changes and a simpler API. 2023-05-01 19:21:09 -03:00
mattn
0e7c7f8abb add sqlite3 storage (#40)
* add sqlite3 storage

* filter by content

* remove needless files

* update go.mod

* do not unquote Search
2023-02-26 14:57:47 -03:00
fiatjaf
eb0c6539b6 update go-nostr dependency and gitignore search binary. 2023-02-15 20:27:51 -03:00
Steve Perkins
a7a0bb6682 Use dsl builder for es query 2023-02-15 16:29:54 -05:00
Steve Perkins
0e18a49861 wip docker-compose setup 2023-02-13 20:44:06 -05:00
Steve Perkins
05600231b4 support search req a-la nip-50 2023-02-10 14:58:01 -05:00
Steve Perkins
d306c03369 basic elasticsearch storage example 2023-02-06 13:30:51 -05:00
fiatjaf
905a68cd91 update dependencies. 2023-01-26 20:03:50 -03:00
fiatjaf
fe91197d45 implement nip-42 AUTH and restrict DMs to authed users. 2023-01-15 22:38:24 -03:00
fiatjaf
e70a5601c7 update go-nostr and fix rss-bridge. 2023-01-02 14:31:28 -03:00
alex
627724f702 start: introduce Server type and Shutdown (breaking change)
the main motivation for this change is to be able to run tests.
before this commit, Start, Router and Log operated on global variables,
making automated testing unreasonably hard.

this commit puts all that a server needs in a new Server type,
which also made it possible for a Server.Shutdown - see ShutdownAware
doc comments.

BREAKING CHANGES:
- Relay.OnInitialized takes one argument now, *relayer.Server.
- relayer.Router is now replaced by relayer.Server.Router().
  package users can still hook into the router from OnInitialized
  for custom HTTP routing.
- relayer.Log is gone. apart from another global var, imho this was
  a too opinionated choice for a framework to build a custom relay upon.
  this commit introduces a Logger interface which package users can implement
  for zerolog to make it log like before. see Server.Log for details.

other notable changes: finally added a couple basic tests, for start up
and shutdown. doc comments now explain most of the essentials,
hopefully making it more approachable for newcomers and easier to understand
the relayer package.

the changes in handlers.go are minimal, although git diff goes crazy.
this is because most of the lines are simply shifted indentation back by one
due to go fmt.

before this commit:

    func handleWebsocket(relay Relay) func(http.ResponseWriter, *http.Request)
    func handleNIP11(relay Relay) func(http.ResponseWriter, *http.Request)

after:

    func (s *Server) handleWebsocket(w http.ResponseWriter, r *http.Request)
    func (s *Server) handleNIP11(w http.ResponseWriter, r *http.Request)
2022-12-24 20:41:02 -03:00
fiatjaf
9684033223 update go-nostr dependency and tag release. 2022-12-19 09:31:49 -03:00
fiatjaf
5f8908e028 update go-nostr dependency. 2022-11-26 09:27:08 -03:00
fiatjaf
d7aba0b21f fix some dependencies and storage instantiation on example relays. 2022-11-11 09:46:18 -03:00
fiatjaf
eee9952fac base58 bad-coding session. 2022-08-12 17:02:40 -03:00
fiatjaf
396ca4d3a0 use updated lnsocket library. 2022-07-25 15:03:37 -03:00
fiatjaf
13d57303b5 support "limit" field on filters. 2022-07-24 19:58:34 -03:00
fiatjaf
fbb81c868c bring in and refactor rss bridge. 2022-07-24 19:52:25 -03:00
fiatjaf
aa96fa0a21 refactor framework interface, simplify basic and whitelisted, bring expensive on and rewrite it. 2022-07-24 17:41:00 -03:00
fiatjaf
d2ce4dbf54 implement nip-16 on closed and basic relays. 2022-07-24 11:48:34 -03:00
fiatjaf
440a64ef28 update go-nostr. 2022-07-24 11:35:49 -03:00
fiatjaf
42fee9cb1d update go-nostr. 2022-05-02 16:55:23 -03:00
fiatjaf
e50a298496 update go-nostr for a fix. 2022-02-13 20:37:51 -03:00
fiatjaf
f9d058a95a adapt to updated go-nostr. 2022-02-13 08:40:06 -03:00
fiatjaf
3e20e6c7cc renaming Equal -> FilterEqual 2022-01-02 09:08:05 -03:00
fiatjaf
629c9174eb update go-nostr. 2022-01-02 09:00:14 -03:00
fiatjaf
9a455b8db6 update go-nostr with new nip-01 slices of everything. 2022-01-01 21:36:56 -03:00
fiatjaf
b4f94b8fdd add .Until filtering to event query. 2021-12-26 07:11:19 -03:00
fiatjaf
0265be6d31 upgrade to go-nostr v0.2.0. 2021-12-16 20:54:57 -03:00
fiatjaf
5a797d2c65 fix jsonpath-based taq query. 2021-11-28 16:55:39 -03:00
fiatjaf
decd60efbd update go-nostr to v0.1.1 2021-02-22 01:18:57 -03:00