feat: all profile uploads through transferStore; delete legacy POST /api/uploads
Migrates the remaining 5 profile/space upload sites (CreateSpace, AccountPanel avatar+banner, OverviewPanel icon+banner) to transferStore.startUpload with tray:false. Space sites pass _instanceOrigin so uploads route to the space's home instance. Removes upload/uploadWithProgress from api.uploads (and their private uploadFile/uploadFileWithProgress helpers); api.uploads.url is preserved for GET-path URL building. Deletes the server-side POST /api/uploads handler and the now-unused @fastify/multipart plugin registration. GET /api/uploads/:filename remains intact.
This commit is contained in:
@@ -2,7 +2,6 @@ import Fastify from 'fastify';
|
||||
import cors from '@fastify/cors';
|
||||
import rateLimit from '@fastify/rate-limit';
|
||||
import websocket from '@fastify/websocket';
|
||||
import multipart from '@fastify/multipart';
|
||||
import fastifyStatic from '@fastify/static';
|
||||
import { config } from './config.js';
|
||||
import { getDb, getRawDb } from './db/index.js';
|
||||
@@ -65,12 +64,6 @@ async function main(): Promise<void> {
|
||||
|
||||
await app.register(websocket);
|
||||
|
||||
await app.register(multipart, {
|
||||
limits: {
|
||||
fileSize: Number.MAX_SAFE_INTEGER, // No global cap — actual limit enforced per-request from DB
|
||||
},
|
||||
});
|
||||
|
||||
// Serve built frontend in production
|
||||
const webDistPath = path.resolve(import.meta.dirname ?? '.', '../../web/dist');
|
||||
if (fs.existsSync(webDistPath)) {
|
||||
|
||||
Reference in New Issue
Block a user