コミットグラフ

79 コミット

作成者 SHA1 メッセージ 日付
n9k a6c31179b6 Repo changed domains: git.076.ne.jp -> gitler.moe 2023-02-23 22:36:20 +00:00
n9k 2a67bee82c If client supports cookies, clear token URL parameter
Only on the homepage.
2022-08-11 06:19:35 +00:00
n9k cbd494e3bf Set cookie when access captcha solved 2022-08-11 06:17:58 +00:00
n9k 68d6efff4e Chat: show dates in chat when time is ambiguous (nojs) 2022-08-10 00:08:28 +00:00
n9k 4a22ca8a92 Minor: `add_chat_message` returns seq (or None)
It now returns the seq of the just-added message if one was added, and
None otherwise.  The previous behaviour was to return True and False
respectively.
2022-08-02 04:52:11 +00:00
n9k 4b259d4a38 Nojs: send ETag for /info.html 2022-07-24 11:03:05 +00:00
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 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 1d56bdfdd7 Ensure browsers revalidate style.css & anonstream.js 2022-07-14 17:23:03 +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 4a68759806 Allowedness: check in special case route handlers 2022-07-07 09:17:37 +00:00
n9k 90e40701f8 Allowedness: check in renew_eyes 2022-07-03 08:53:02 +00:00
n9k 9ad069ad08 Allowedness: check (in) websockets 2022-07-03 08:53:02 +00:00
n9k 8ab206d3c6 Allowedness: check in `with_user_from` wrapper 2022-07-03 08:53:02 +00:00
n9k fc613737e0 Store version string 2022-06-29 04:58:30 +00:00
n9k e10f6793b6 Rename errors.py -> error.py 2022-06-29 04:30:27 +00:00
n9k 492078f6ce Record users' most recent HTTP headers 2022-06-29 04:30:27 +00:00
n9k 1472ce40ad Store eyes headers as tuple instead of dict
This preserves duplicate keys.
2022-06-29 04:30:24 +00:00
n9k 19b926a3e5 Deverify absent users 2022-06-29 02:35:24 +00:00
n9k 082fbf76d4 Error pages: make target="_top" for <a> elements 2022-06-25 07:45:07 +00:00
n9k 1ad67fd9cf Basically nothing 2022-06-25 04:00:57 +00:00
n9k 54b34ce503 Typo: update last.seen when no access captcha 2022-06-25 03:41:11 +00:00
n9k 2a16f6a835 Debug: print colorized tag/token_hash/token 2022-06-23 03:36:37 +00:00
n9k 3bb2a81c5a Bypass initial chat captcha if solved access captcha 2022-06-23 02:53:41 +00:00
n9k 4a76fb023e Access captcha: special case for websocket
There doesn't seem to be a way to catch a 403 Forbidden error opening a
websocket with JavaScript, so this commit changes the behaviour to this:
open the websocket normally, send one "kick" message, close the
websocket.
2022-06-22 08:11:12 +00:00
n9k 0548065b1d Error pages: custom descriptions 2022-06-22 08:11:12 +00:00
n9k 35ce606d64 Custom error pages 2022-06-22 08:11:12 +00:00
n9k 9143acafd1 Access captcha 2022-06-22 08:11:12 +00:00
n9k 4c5faf7dba Use 303 See Other for {POST|GET}->GET redirects 2022-06-22 04:54:02 +00:00
n9k a41f0d4f14 Escape disallowed cookie characters 2022-06-20 04:15:09 +00:00
n9k 46f9b0ec08 Reset websocket aliveness timer on first connecting
This should eliminate the possibilty of the websocket-closing background
task closing a newly opened websocket that hasn't yet ponged our ping
(if we have even sent a ping yet).
2022-06-20 04:15:09 +00:00
n9k 22c84bc230 Give timestamp to route handlers 2022-06-20 04:15:09 +00:00
n9k 90e1e2099a Manual static folder 2022-06-20 04:15:08 +00:00
n9k 1d5b446291 Track the last time users were sent chat messages 2022-06-19 08:21:40 +00:00
n9k 0b78a79111 Use single quotes 2022-06-19 07:53:31 +00:00
n9k 56ee52699a Nojs chat form: on failure truncate long comments 2022-06-17 00:40:38 +00:00
n9k e147aa0d22 Chat: always enforce length limits from config 2022-06-17 00:40:02 +00:00
n9k dc5c4db3de Move nojs refresh magic numbers to config 2022-06-17 00:40:02 +00:00
n9k 1c7818cc0b Licence headers formatting 2022-06-16 01:31:10 +00:00
n9k 1422bebd8e Require Authorization header for broadcaster
As opposed to just the broadcaster token. This makes the broadcaster
username/password login mandatory, which previously was only mandatory
in the `auth_required` wrapper, but not elsewhere (so for example
leaving comments as the broadcaster was possible with the token only). A
less safe alternative to this would be to compare tokens in `check_auth`
once the Authorization header didn't match.
2022-06-14 08:50:31 +00:00
n9k 6ef3a77465 Explicitly reject weird tokens
Includes really long tokens
2022-06-14 08:50:31 +00:00
n9k 7db8895750 Eyes: send Retry-After header during cooldown 2022-06-14 03:33:14 +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 95f12fa632 Send <!doctype html> in responses when auth fails 2022-06-11 23:14:16 +00:00
n9k c0de94bc5d Remove redundant failsafe `websocket.close()`
Ping timeouts should do the same thing.
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 a7bfab4f26 Offline screen 2022-06-11 23:14:12 +00:00
n9k 4eaf9b56f7 Try to ensure websocket is closed when forgetting about it
Might not be necessary, but if it is then it prevents a sitation where a
websocket is still open but we've forgotten about it, so we will never
broadcast any new messages to it and the client will be practically frozen in
time until they disconnect and open a new websocket.

Also update the user's last_seen when the websocket is closed. This prevents a
user with js enabled who's actually idle being considered absent and being
rotated when their websocket accidentally closes for a few seconds.
2022-03-10 07:47:57 +13:00