Commit Graph

12 Commits (master)

Author SHA1 Message Date
q3k a435e15698 Implement LDAP avatar serving
This adds a /avatar/<uid> endpoint which serves any jpegPhoto associated
with a given user account.

In true 'lol ldap' fashion, only `photo` and `jpegPhoto` fields are
defined. The first one is for G3 photos (a fax format!). The latter is
technically for JPEG. But we expect to abuse this and basically contain
_any_ sensible photo format in there, as long as Python's PIL can parse
it.

The serving function always resamples images to a 256x256 PNG. This
makes sure people don't leak EXIF and lets us depend on square avatars.

This entire code assumes that it is safe to PIL.Image.open untrusted
user data. My understanding is that it is, bar some DoS for very large
images. We limit the potential for DoS by storing the images in LDAP,
which I hope has some kind of field length limit...

Oh, and this also adds a 'default avatar' functionality which serves
simple generative mermaid art for any user who doesn't have an explicit
avatar set. To prevent leaking the existence of users who don't have an
avatar set, we serve such a generated avatar for all UIDs, including
UIDs which don't exist.
2023-10-08 18:14:00 +02:00
radex dc2bb81f61 config and ldap handling refactor 2023-09-23 15:56:06 +02:00
radex 3fd36123de split views into blueprints 2023-09-23 10:30:58 +02:00
radex f82e60e277 remove dead code 2023-09-23 10:04:46 +02:00
radex ccdacec835 deps: update flask to latest 2023-09-19 22:42:12 +02:00
radex 50891a9b08 remove unused dependencies 2023-09-19 18:43:07 +02:00
radex 7796c3273a cleanup: remove legacy coding directive & shebang 2023-09-19 17:18:02 +02:00
informatic cde7e6cf76 webapp: move secret_key and debug flags to config 2021-10-09 11:15:24 +02:00
q3k 50dbd3087a *: port to python3, update deps, fix cn mod 2019-10-18 14:13:10 +02:00
q3k a097e314a0 Add hackerspace name config option
Also move config.py to config.py.dist for distribution purposes :)
2018-02-26 10:03:33 +00:00
q3k 0b9e737dba Import changes from Tog development repo
Most notably, this adds Kerberos support and changes the theme.
2018-01-26 17:45:24 +00:00
q3k d03f876670 First public import 2016-02-15 20:30:53 +00:00