10 Commits (master)
 

Author SHA1 Message Date
OFF0 207e7b0d1a
cmd/noxy: support relay.nostr.ch 2 years ago
alex 1ddf35e212
cmd/noxy: respond with appropriate status 5xx on context errors 2 years ago
alex d2f212f499
all: go fmt 2 years ago
alex ae2e4afde7
cmd/noxy: add a minimal unconditional cache-control header
so the browsers will hopefully cache responses for 1h and reduce load on
the server.

a future version will propagate cache-control from upstream.
part of #3
2 years ago
alex e7b2fad441
verifyEventLink: check cache first to allow more valid URLs
previously, a request to an open graph image reported from say
https://github.com/example/some.repo would result in 404 not found, a
false negative because "is link in event?" verification would fail:
"some.repo" looks like a file with .repo extension, not an html page.

in this commit, if a client already requested example/some.repo
before, and it is cached, the response to the OGP image is successful.
2 years ago
alex 78a1aae7e8
cmd/noxy: add CORS headers to all endpoints
the simplest approach at the moment: allow requests from all origins,
only GET and OPTIONS methods.

allowed headers are '*'. this prevents clients from providing
credentials via cookies which isn't used anyway. nuff cookies.
2 years ago
alex 813d0501bd
basic implementation of the last api version
the meat is in Noxer struct, in noxy.go.
executable server entry point is in cmd/noxy/main.go.

all request responses are cached using a rudimentary filesystem
based caching. a max storage quota is not implemented yet.
2 years ago
alex 8dc6a62eb8
docs: replace api with a simpler version
the previous design was too complex to implement due its double
roundtrip: first JSON, then data.

in this new design, the client gets the data right away, single
roundtrip.
2 years ago
alex 8d1e0c3520
docs: change api response format from objects to arrays
a possibly better data format to work with in javascript.
2 years ago
alex 780b16cf5f
initial: api v1 draft 2 years ago