80 Commits

Author SHA1 Message Date
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
fiatjaf
d4aa16f38a update go-nostr dependency. 2021-02-21 23:43:24 -03:00
fiatjaf
db384be3f9 fix some query bugs. 2021-02-17 16:59:56 -03:00
fiatjaf
d0c627968b update go-nostr dependency to reflect an actually published version. 2021-02-15 11:49:15 -03:00
fiatjaf
9c992c90dc adapt to new nip-01. 2021-02-14 21:08:02 -03:00
fiatjaf
e9cbff07a4 migrate off of main nostr repository. 2021-01-13 23:46:06 -03:00