Use public API_BASE for OnlyOffice URLs and revert IP rewriting hack to fix Docker networking
Some checks failed
Automated Container Build / build-and-push (push) Failing after 1m7s

This commit is contained in:
Elijah 2026-05-24 12:10:33 -07:00
parent 7de186ee05
commit fd26a165ba
2 changed files with 3 additions and 12 deletions

View file

@ -45,16 +45,10 @@ export default function OnlyOfficeEditor({ file, type, onClose }: OnlyOfficeEdit
const API_BASE = getApiBase();
// Use the internal backend URL for OnlyOffice server-to-server communication
// to avoid Hairpin NAT/DNS issues from inside the Docker network.
const INTERNAL_BACKEND_URL = 'http://192.168.50.57:5827';
// Use the public API_BASE which correctly routes through the Nginx proxy to the Next.js frontend
const fileUrl = `${API_BASE}/files/download/?path=${encodeURIComponent(file.path)}&token=${downloadToken}`;
const callbackUrl = `${API_BASE}/public/onlyoffice/callback?path=${encodeURIComponent(file.path)}&token=${downloadToken}`;
// URL that OnlyOffice will use to download the file
const fileUrl = `${INTERNAL_BACKEND_URL}/api/files/download/?path=${encodeURIComponent(file.path)}&token=${downloadToken}`;
// Callback URL that OnlyOffice will post to when saving
const callbackUrl = `${INTERNAL_BACKEND_URL}/api/public/onlyoffice/callback?path=${encodeURIComponent(file.path)}&token=${downloadToken}`;
const baseConfig: any = {
document: {
fileType: file.name.split('.').pop() || 'docx',