コミットグラフ

38 コミット

作成者 SHA1 メッセージ 日付
n9k b1f5bbdecd Force absent users to do the access captcha again
Before this, if a request was not coming from an existing user (no token
in the request or no user with the given token), then and only then
would we send the access captcha.  This meant that if a user left a chat
message and became absent, they wouldn't be prompted to do the access
captcha again until their message was eventuallly rotated.  (While
messages exist we don't delete the users who posted them.)

This commit makes it so if user['verified'] is None, the user is kicked
and prompted with the access captcha.  This is automatically done for
absent users by a background task.
2022-07-20 07:55:32 +00:00
n9k f36840a9a6 Typos 2022-07-20 07:37:35 +00:00
n9k 208ef9abc7 Emotes: one emote, one file 2022-07-20 07:37:33 +00:00
n9k 9edeea1491 Emotes: sheet filename config option 2022-07-16 23:48:46 +00:00
n9k 6e8d8dc8e9 Emotes
The sheet of emotes goes in `/static/emotes.png`. Emote coordinates go
in emotes.json (by default, there is a config option).
2022-07-14 17:14:04 +00:00
n9k 9ad069ad08 Allowedness: check (in) websockets 2022-07-03 08:53:02 +00:00
n9k 19b926a3e5 Deverify absent users 2022-06-29 02:35:24 +00:00
n9k 4a8d8966aa Websocket: reuse timestamp in handle_inbound_pong 2022-06-25 05:09:07 +00:00
n9k 2a16f6a835 Debug: print colorized tag/token_hash/token 2022-06-23 03:36:37 +00:00
n9k 1d5b446291 Track the last time users were sent chat messages 2022-06-19 08:21:40 +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 8f06121d8f WS: ping before init 2022-06-14 00:34:24 +00:00
n9k 7f2e75bc98 Read config.toml more organizedly 2022-06-12 22:26:46 +00:00
n9k 31b82a9983 Websocket: ping immediately 2022-06-11 23:14:16 +00:00
n9k 4b68023cf2 Add websocket ping/pong
Client and server both close the connection if they don't hear from the
other party after a timeout period. This is a failsafe and should
improve reliability.
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 7962de87e3 WS: combine `uptime` and `viewership` into `stats`
If the stream is offline, `stats` is null, otherwise it contains uptime and
viewership.
2022-03-07 12:56:08 +13:00
n9k 8589216bf1 Send new captcha over websocket with js 2022-03-07 12:54:35 +13:00
n9k 3016705783 Keep track of stream viewership (number of viewers) 2022-03-07 12:54:35 +13:00
n9k c36d2b2c38 Catch exception when inbound websocket data is not JSON 2022-03-07 12:54:35 +13:00
n9k 8b4d6e8c09 Get stream title from disk
By default from `title.txt`. Also replace newlines with spaces when setting the
title in js, for parity with the nojs info iframe.
2022-03-07 12:54:35 +13:00
n9k 2f4a9739c0 Show and enforce the captcha in js
Also clear the chat form comment input only if the message was accepted.
2022-02-22 16:25:43 +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 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
n9k e77862f4ff Nojs chat, store all user names/colors in js, forget about inactive users
Project structure evolving a bit
2022-02-17 13:30:05 +13:00
n9k 694c6a4995 Nojs comment submission, notify for rejected comments
Fix with-user wrapper (wasn't collecting users)
2022-02-15 23:11:53 +13:00
n9k 885c10b5de Initial noscript markup for chat form & stream info
Use with-user decorator on routes (instead of with-token)
2022-02-14 23:16:09 +13:00
n9k 5d0cac0b0f Concatenate segments
Add small js failsafe, other minor changes
2022-02-13 22:25:02 +13:00
n9k 71586420b6 Project structure, chat markup/style, websockets 2022-02-13 17:00:10 +13:00