summaryrefslogtreecommitdiffstats
path: root/takahe
diff options
context:
space:
mode:
Diffstat (limited to 'takahe')
-rw-r--r--takahe/settings.py6
-rw-r--r--takahe/urls.py5
2 files changed, 11 insertions, 0 deletions
diff --git a/takahe/settings.py b/takahe/settings.py
index 91bfe7b..98bc9dd 100644
--- a/takahe/settings.py
+++ b/takahe/settings.py
@@ -107,6 +107,11 @@ class Settings(BaseSettings):
#: is necessary for compatibility with Mastodon’s image proxy.
MEDIA_MAX_IMAGE_FILESIZE_MB: int = 10
+ #: Maximum filesize for Emoji. Attempting to upload Local Emoji larger than this size will be
+ #: blocked. Remote Emoji larger than this size will not be fetched and served from media, but
+ #: served through the image proxy.
+ EMOJI_MAX_IMAGE_FILESIZE_KB: int = 200
+
#: Request timeouts to use when talking to other servers Either
#: float or tuple of floats for (connect, read, write, pool)
REMOTE_TIMEOUT: float | tuple[float, float, float, float] = 5.0
@@ -194,6 +199,7 @@ MIDDLEWARE = [
"core.middleware.ConfigLoadingMiddleware",
"api.middleware.ApiTokenMiddleware",
"users.middleware.IdentityMiddleware",
+ "activities.middleware.EmojiDefaultsLoadingMiddleware",
]
ROOT_URLCONF = "takahe.urls"
diff --git a/takahe/urls.py b/takahe/urls.py
index e8aa359..d6d893f 100644
--- a/takahe/urls.py
+++ b/takahe/urls.py
@@ -194,6 +194,11 @@ urlpatterns = [
mediaproxy.PostAttachmentCacheView.as_view(),
name="proxy_post_attachment",
),
+ path(
+ "proxy/emoji/<emoji_id>/",
+ mediaproxy.EmojiCacheView.as_view(),
+ name="proxy_emoji",
+ ),
# Well-known endpoints and system actor
path(".well-known/webfinger", activitypub.Webfinger.as_view()),
path(".well-known/host-meta", activitypub.HostMeta.as_view()),