234 Commits

Author SHA1 Message Date
Mike Dilger
46605fae2d
Blossom: Implement HEAD/PUT /upload 2024-11-18 08:48:52 +13:00
Mike Dilger
da91fcb271
Pass the request (not a reference) into blossom so it can pull the body 2024-11-18 08:48:52 +13:00
Mike Dilger
8282811087
Filestore::store(): take expected hash and validate with it, and also return the size 2024-11-18 08:48:52 +13:00
Mike Dilger
7b60e26714
HashOutput::from_bytes() 2024-11-18 08:48:52 +13:00
Mike Dilger
af1d992ce7
Change config.url() to config.uri_parts() so that (later) path_and_query can be swapped out 2024-11-18 08:48:51 +13:00
Mike Dilger
3f26b47008
Blossom: implement GET/HEAD/DELETE /<sha256> 2024-11-18 08:48:51 +13:00
Mike Dilger
bcb0fc1c95
Blossom Auth 2024-11-18 08:48:51 +13:00
Mike Dilger
da4ec4b5c8
Blossom stubbed out 2024-11-17 14:07:22 +13:00
Mike Dilger
28fb96a9d5
3 new error variants needed for blossom work 2024-11-17 14:04:24 +13:00
Mike Dilger
d526f103c7
GLOBALS.filestore 2024-11-17 14:02:41 +13:00
Mike Dilger
8b90d83dd5
config.blossom_directory 2024-11-17 14:02:40 +13:00
Mike Dilger
853fefbdf6
FileStore (and HashOutput) 2024-11-17 14:02:40 +13:00
Mike Dilger
1382fc397c
Error::FromHex(FromHexError) 2024-11-17 14:02:39 +13:00
Mike Dilger
fab1aa3c10
From<Error> for std::io::Error (map back, as some stream work will need this) 2024-11-17 14:01:02 +13:00
Mike Dilger
afe3cc9c7b
error: provide source() for 3 that were missing 2024-11-17 14:00:15 +13:00
Mike Dilger
918ed3fcb5
alpha sort of Error variants 2024-11-17 13:56:25 +13:00
Mike Dilger
48b08e93f5
Handle server-wide OPTIONS requests 2024-11-17 13:53:33 +13:00
Mike Dilger
aa9063e60e
minor: management auth 2024-11-17 13:51:02 +13:00
Mike Dilger
94ad17fcc3
Use a streaming BoxedBody 2024-11-16 10:00:21 +13:00
Mike Dilger
181750cb90 Add optional icon for NIP-11 2024-11-05 10:10:40 +13:00
Mike Dilger
006ecadf9c Add more statistics 2024-10-26 07:39:09 +13:00
Mike Dilger
2794515ab7 bin: chorus_cmd 2024-10-25 10:21:32 +13:00
Mike Dilger
42a0f0136b cargo fmt 2024-10-25 10:21:26 +13:00
Mike Dilger
f06073278c Don't require moderation on reactions 2024-10-05 11:41:09 +13:00
Mike Dilger
9d0df10d23 honor enable_ip_blocking = false 2024-09-10 14:57:33 +12:00
Mike Dilger
d258dd4110 Don't require approval on kinds 0 and 3 2024-08-22 07:01:22 +12:00
Mike Dilger
4d300eb12a Dont drop half of the TCP stream before dropping the whole thing 2024-07-31 07:48:13 +12:00
Mike Dilger
df69a54adf Honor Sec-WebSocket-Protocol:
- If it is missing, we speak nostr and we don't return it
- If it exists and contains "nostr", we speak nostr and we return it
- If it exists and doesn't contain "nostr" we throw a 501 NOT IMPLEMENTED StatusCode
2024-07-15 10:31:20 +12:00
Mike Dilger
3f5600638b Increase default rate limits to 1MB per second, 16MB burst 2024-07-14 12:42:31 +12:00
Mike Dilger
1f1a74e442 Enforce throtting on output 2024-07-14 12:42:31 +12:00
Mike Dilger
7a1b8e7ec5 Throttling: also consume burst_tokens with output bytes sent 2024-07-14 12:09:39 +12:00
Mike Dilger
94b7dfa57a distinguish RateLimitExceeded error from ErrorClose 2024-07-14 11:40:20 +12:00
Mike Dilger
bf87d53e01 Throtting by rate limiting the input (defaults are still very speculative, output not rate limited) 2024-07-14 11:40:08 +12:00
Mike Dilger
e3ec1cac57 When shutting down, wait no more than 5 seconds for connections to close 2024-07-14 10:28:15 +12:00
Mike Dilger
5711ca3503 Punish parse errors (else you can get DoS) 2024-07-14 10:00:49 +12:00
Mike Dilger
2cb6148dce Bugfix 2024-07-14 09:57:58 +12:00
Mike Dilger
c1ee86f4df Pull the websocket thread code into a separate function 2024-07-13 13:03:41 +12:00
Mike Dilger
ad7e70e3a0 Revert "Manipulate connection counts in a safer way (include HTTP connections too)"
This reverts commit 7ad5fb3e157b63d17d098691793460c05493e1d5.
2024-07-13 12:55:45 +12:00
Mike Dilger
5f33e21967 Revert "Maybe fix the zeroes?"
This reverts commit 051a81febd25f78f79e7609b0f5a7d1ca99a016a.
2024-07-13 12:55:39 +12:00
Mike Dilger
051a81febd Maybe fix the zeroes? 2024-07-13 12:51:27 +12:00
Mike Dilger
7ad5fb3e15 Manipulate connection counts in a safer way (include HTTP connections too) 2024-07-13 12:36:09 +12:00
Mike Dilger
a76be24d68 Fix proxy setups (ip blocking, real IP); needs new chorus_is_behind_a_proxy config 2024-07-13 12:11:26 +12:00
Mike Dilger
37b1b3a0f3 Possible stream shutdown improvement 2024-07-13 11:13:46 +12:00
Mike Dilger
633bb82899 Stop supporting TCP half_close (this might be the thing leaving hanging connections) 2024-07-13 10:22:55 +12:00
Mike Dilger
227a104e0f bump max connections per ip default to 5 2024-07-12 11:38:44 +12:00
Mike Dilger
3820813393 relay management auth doesn't need a method check anymore 2024-07-11 17:18:30 +12:00
Mike Dilger
1fde129c05 cargo clippy & fmt 2024-07-11 17:12:46 +12:00
Mike Dilger
e57167dd05 Swallow mild IO errors inside of Tungstenite errors 2024-07-11 17:07:34 +12:00
Mike Dilger
9515611b82 Do not expose too much error detail over the network 2024-07-11 15:47:43 +12:00
Mado
52ea30eeae
Do not include file names in NOTICE and OK messages 2024-07-11 10:46:51 +09:00