fix: Add HEIC/HEIF support and resolve CORS issues

- Add libheif-dev to backend Dockerfile to support HEIC/HEIF image uploads via sharp.
- Update backend URL in frontend to use 'photobackend.beachpartyballoons.com'.
- Update CORS whitelist to include the new backend hostname.
- Stage user's change to docker-compose.yml exposing port 5001.
This commit is contained in:
chris 2025-11-24 19:05:14 -05:00
parent 962201975b
commit b2a3e5d605
4 changed files with 6 additions and 4 deletions

View File

@ -55,9 +55,9 @@ document.addEventListener('DOMContentLoaded', () => {
const responseDiv = document.getElementById('response'); const responseDiv = document.getElementById('response');
const backendUrl = (() => { const backendUrl = (() => {
const { hostname } = window.location; const { protocol } = window.location;
// Always use http because the backend is not serving https const backendHostname = 'photobackend.beachpartyballoons.com';
return `http://${hostname}:5000`; return `${protocol}//${backendHostname}`; // No explicit port needed as it's on 443
})(); })();
const LAST_TAGS_KEY = 'bpb-last-tags'; const LAST_TAGS_KEY = 'bpb-last-tags';
let adminPassword = ''; let adminPassword = '';

View File

@ -17,7 +17,7 @@ services:
photo-gallery-backend: photo-gallery-backend:
build: ./photo-gallery-app/backend build: ./photo-gallery-app/backend
ports: ports:
- "5000:5000" - "5001:5000"
environment: environment:
MONGO_URI: mongodb://mongodb:27017/photogallery MONGO_URI: mongodb://mongodb:27017/photogallery
WATERMARK_URL: http://watermarker:8000/watermark WATERMARK_URL: http://watermarker:8000/watermark

View File

@ -8,6 +8,7 @@ WORKDIR /usr/src/app
RUN apt-get update && apt-get install -y \ RUN apt-get update && apt-get install -y \
imagemagick \ imagemagick \
ghostscript \ ghostscript \
libheif-dev \
&& rm -rf /var/lib/apt/lists/* && rm -rf /var/lib/apt/lists/*
# Copy package.json and package-lock.json to the working directory # Copy package.json and package-lock.json to the working directory

View File

@ -7,6 +7,7 @@ const port = process.env.PORT || 5000;
const whitelist = [ const whitelist = [
'https://preview.beachpartyballoons.com', 'https://preview.beachpartyballoons.com',
'https://photobackend.beachpartyballoons.com', // Added new backend hostname as a potential origin
'http://localhost:3050', 'http://localhost:3050',
'http://127.0.0.1:3050', 'http://127.0.0.1:3050',
'http://localhost:8080' // Common local dev port 'http://localhost:8080' // Common local dev port