- Upload a profile picture on web and mobile. The API square-crops it to 512px WebP, strips metadata (phone photos carry GPS), stores it in Postgres and serves it with immutable caching. Avatar URLs are stored as paths, so they survive moving the API. Arbitrary avatar URLs are no longer accepted (they'd let a profile track its viewers). - New accounts get the username as typed as their display name; existing accounts are backfilled, and clearing it falls back to the username. - Service names in Settings get a brand-coloured badge and larger type. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01MzFywujuH9TiuXbr9vjoX8
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
import cookie from '@fastify/cookie';
|
||||
import cors from '@fastify/cors';
|
||||
import rateLimit from '@fastify/rate-limit';
|
||||
import multipart from '@fastify/multipart';
|
||||
import websocket from '@fastify/websocket';
|
||||
import Fastify from 'fastify';
|
||||
import { ZodError } from 'zod';
|
||||
@@ -11,6 +12,7 @@ import { HttpError } from './lib/http';
|
||||
import { redis } from './lib/redis';
|
||||
import { adminRoutes } from './routes/admin';
|
||||
import { authRoutes } from './routes/auth';
|
||||
import { avatarRoutes } from './routes/avatars';
|
||||
import { connectionRoutes } from './routes/connections';
|
||||
import { deviceRoutes } from './routes/devices';
|
||||
import { meRoutes } from './routes/me';
|
||||
@@ -41,6 +43,7 @@ export async function buildApp({ logger = true, rateLimits = true }: { logger?:
|
||||
// Rate limits are per-route (see `config.rateLimit`); the Redis store makes them global across instances.
|
||||
if (rateLimits) await app.register(rateLimit, { global: false, redis });
|
||||
await app.register(websocket);
|
||||
await app.register(multipart);
|
||||
|
||||
app.decorateRequest('user', null);
|
||||
app.decorateRequest('sessionId', null);
|
||||
@@ -64,6 +67,7 @@ export async function buildApp({ logger = true, rateLimits = true }: { logger?:
|
||||
|
||||
await app.register(authRoutes);
|
||||
await app.register(meRoutes);
|
||||
await app.register(avatarRoutes);
|
||||
await app.register(userRoutes);
|
||||
await app.register(safetyRoutes);
|
||||
await app.register(adminRoutes);
|
||||
|
||||
Reference in New Issue
Block a user