コミットグラフ

36 コミット

作成者 SHA1 メッセージ 日付
n9k a1862b9080 one giant veiny commit 2022-08-02 04:59:00 +00:00
n9k 90e40701f8 Allowedness: check in renew_eyes 2022-07-03 08:53:02 +00:00
n9k 5a647f2fb7 Allowedness (WIP) 2022-07-03 08:53:02 +00:00
n9k 283c630b82 Optionally force captcha every n messages
By default every 40 messages. 0 means never force captcha in this way.
2022-07-03 08:50:35 +00:00
n9k 19b926a3e5 Deverify absent users 2022-06-29 02:35:24 +00:00
n9k 5a5585ff0d Minor: chain exceptions in renew_eyes 2022-06-25 05:09:10 +00:00
n9k 4a8d8966aa Websocket: reuse timestamp in handle_inbound_pong 2022-06-25 05:09:07 +00:00
n9k 45224e0779 Never gonna give broadcaster a captcha 2022-06-23 02:36:44 +00:00
n9k 0548065b1d Error pages: custom descriptions 2022-06-22 08:11:12 +00:00
n9k 1581e6ac89 Minor logic formatting 2022-06-19 08:21:40 +00:00
n9k 1d5b446291 Track the last time users were sent chat messages 2022-06-19 08:21:40 +00:00
n9k e147aa0d22 Chat: always enforce length limits from config 2022-06-17 00:40:02 +00:00
n9k 1c7818cc0b Licence headers formatting 2022-06-16 01:31:10 +00:00
n9k e449caff5f Reimplement `with_timestamp`, allow ints & floats 2022-06-15 20:54:55 +00:00
n9k 7db8895750 Eyes: send Retry-After header during cooldown 2022-06-14 03:33:14 +00:00
n9k a594b6ed73 Eyes: only necessary arguments in exceptions 2022-06-14 03:32:12 +00:00
n9k f081284876 Eyes: cooldown on creating new eyes 2022-06-14 03:02:45 +00:00
n9k 51265fb277 Eyes: delete old eyes
Also implements stack/queue behaviour where if the eyes limit would be
exceeded, either the new eyes cause the oldest eyes to be deleted OR
the new eyes aren't created at all. The default is the first option.
2022-06-14 02:58:11 +00:00
n9k 84ad17f13d Eyes
This commit adds the concept of eyes. One "eyes" is one instance of a
response to GET /stream.mp4. Currently the number of eyes clients can
have is unbounded, but this is a DoS vector.
2022-06-14 02:40:18 +00:00
n9k 542d6c9ae5 Detect chat flooding by counting lines
Reject comments by line count. Ratelimit users by number of lines sent
in chat.
2022-06-11 23:14:16 +00:00
n9k 829f3f004b Add licences 2022-03-08 16:41:47 +13:00
n9k 4cde4ea07a Add js appearance form (not complete c.f. nojs) 2022-03-08 16:13:22 +13:00
n9k 46fce9c393 Add nojs 'Reload stream' button
The nojs button appears when the stream is online and the user is not watching.
The js button appears when the stream is online and the media element either
(1) is not using the network or (2) fires an error event.
2022-03-07 12:56:08 +13:00
n9k bfa77b738d Tell websockets which users are watching
This adds a field 'watching' in `user_for_websocket` that's True iff WATCHING,
False iff NOTWATCHING, and None otherwise (since clients don't need to know if
a user is tentative or absent). When the value of this field changes for any
user, they get added to the update buffer (like with any other change).

Removed race condition in `t_sunset_users`: `broadcast_users_update` was being
called *after* a user was removed from memory (and for each user being removed,
which was redundant). In that scenario if there's a user in the update buffer
and `t_sunset_users` wins the race between it and `t_broadcast_users_update`,
then when `t_sunset_users` calls `broadcast_users_update` a KeyError would be
raised since the user's already been removed.

Fixed unintended behaviour of `t_sunset_users`: it was removing users based on
the result of `is_visible`, so users who were actually tenative (as opposed to
absent) were being removed.
2022-03-07 12:54:35 +13:00
n9k 1b26ddb816 Nojs chat: add list of watching/non-watching users 2022-03-07 12:54:35 +13:00
n9k cc6ed63764 Segment streaming redux, accurate stream uptime 2022-02-23 15:57:04 +13:00
n9k 8c9b0d9da0 Flood detection 2022-02-22 16:25:43 +13:00
n9k 6ceb553b29 Buffer new and mutated users before sending to websockets
By default the buffer is exhausted every 4 seconds. This should defend against
a potential DoS against clients with JavaScript enabled. Before this, any
request with no token would generate a new user and immediately broadcast the
new user to all the websockets. It's best to lock down as much as possible the
number of places a client can cause the server to broadcasts to all the
websockets.
2022-02-22 16:25:43 +13:00
n9k b7313eec22 Captchas, require captcha initially, generalize notices to states 2022-02-22 16:25:43 +13:00
n9k 7058677000 Setup background tasks, create t_sunset_users task 2022-02-22 16:25:43 +13:00
n9k e9a4b511a3 Formalize/tidy user presence logic 2022-02-22 16:25:43 +13:00
n9k 6109de37ec Nojs chat: ETag, limit scrollback, timeout notice
Limiting scrollback is happening for the js chat too. Also reject long
comments.
2022-02-22 16:25:41 +13:00
n9k d848d1532e Reflect appearance changes with js 2022-02-18 18:17:01 +13:00
n9k 1e6563c4a2 Some more project structure 2022-02-18 14:32:34 +13:00
n9k 43e1a33088 Nojs appearance form, tripcodes, colours 2022-02-18 11:56:51 +13:00
n9k 7dbcd43f30 Logicaler project structure, see rest of commit message
Incoming requests are handled in anonstream/routes/. Route handlers
mainly depend on files in anonstream/, which in turn depend on files in
anonstream/helpers/ and anonstream/utils/. Utils are pure functions and
helpers are almost pure functions; they don't mutate state but they
do depend on the global app config.
2022-02-17 13:30:09 +13:00