mirror of
https://github.com/R0m1k3/Socialflow.git
synced 2026-10-24 15:38:10 +02:00
fix: use relative URLs for local media storage to fix CSP blocking
Media files were stored with absolute http://localhost:5555/... URLs, which got blocked by the Content Security Policy when the app runs at https://socialflow.fnancy.fr. Now stores relative /uploads/... paths and resolves to absolute URLs only when needed by external APIs (Facebook, FFmpeg internal service). Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
1 parent
8f7f580b2f
commit
b353fb6ded
4 files changed
+41
-22
No files matched your search
@@ -6,7 +6,7 @@ import { bundle } from "@remotion/bundler";
|
||||
import { renderMedia, selectComposition } from "@remotion/renderer";
|
||||
import { ffmpegService } from "../services/ffmpeg";
|
||||
import { storage as dbStorage } from "../storage";
|
||||
import { minioService as cloudinaryService, buildMinioUrl } from "../services/minio";
|
||||
import { minioService as cloudinaryService, buildMinioUrl, resolvePublicUrl } from "../services/minio";
|
||||
import { facebookService } from "../services/facebook";
|
||||
import * as musicMetadata from "music-metadata";
|
||||
|
||||
@@ -319,7 +319,7 @@ remotionRouter.post("/publish", async (req, res) => {
|
||||
|
||||
if (!scheduledFor) {
|
||||
console.log(`🚀 Publishing to ${page.pageName}...`);
|
||||
const reelId = await facebookService.publishReel(page, cloudinaryResult.originalUrl, description || "");
|
||||
const reelId = await facebookService.publishReel(page, resolvePublicUrl(cloudinaryResult.originalUrl), description || "");
|
||||
await dbStorage.updateScheduledPost(scheduledPost.id, { publishedAt: new Date(), externalPostId: reelId });
|
||||
results.push({ pageId, success: true, reelId });
|
||||
} else {
|
||||
|
||||
Reference in new issue
Block a user