Add CORS support to fulfillr API for local development

- Configure Caddy to send CORS headers for /api/* endpoints
- Allow all origins (*) since API is already IP-restricted to local network
- Handle preflight OPTIONS requests properly
- Update container versions (immich, fulfillr)

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
Bastian de Byl
2025-09-16 15:23:29 -04:00
parent 9c9da4f47c
commit 812b5b30a1
2 changed files with 21 additions and 6 deletions

View File

@@ -49,9 +49,9 @@
- import_tasks: containers/home/photos.yml - import_tasks: containers/home/photos.yml
vars: vars:
db_image: docker.io/tensorchord/pgvecto-rs:pg14-v0.2.0@sha256:90724186f0a3517cf6914295b5ab410db9ce23190a2d9d0b9dd6463e3fa298f0 db_image: docker.io/tensorchord/pgvecto-rs:pg14-v0.2.0@sha256:90724186f0a3517cf6914295b5ab410db9ce23190a2d9d0b9dd6463e3fa298f0
ml_image: ghcr.io/immich-app/immich-machine-learning:v1.141.1 ml_image: ghcr.io/immich-app/immich-machine-learning:v1.142.1
redis_image: docker.io/redis:6.2-alpine@sha256:eaba718fecd1196d88533de7ba49bf903ad33664a92debb24660a922ecd9cac8 redis_image: docker.io/redis:6.2-alpine@sha256:eaba718fecd1196d88533de7ba49bf903ad33664a92debb24660a922ecd9cac8
image: ghcr.io/immich-app/immich-server:v1.141.1 image: ghcr.io/immich-app/immich-server:v1.142.1
tags: photos tags: photos
- import_tasks: containers/home/cloud.yml - import_tasks: containers/home/cloud.yml
@@ -68,7 +68,7 @@
- import_tasks: containers/debyltech/fulfillr.yml - import_tasks: containers/debyltech/fulfillr.yml
vars: vars:
image: "{{ aws_ecr_endpoint }}/fulfillr:20250909.2013" image: "{{ aws_ecr_endpoint }}/fulfillr:20250916.1905"
tags: debyltech, fulfillr tags: debyltech, fulfillr
- import_tasks: containers/home/nosql.yml - import_tasks: containers/home/nosql.yml

View File

@@ -198,13 +198,28 @@
# Fulfillr - {{ fulfillr_server_name }} (Static + API with IP restrictions) # Fulfillr - {{ fulfillr_server_name }} (Static + API with IP restrictions)
{{ fulfillr_server_name }} { {{ fulfillr_server_name }} {
{{ ip_restricted_site() }} {{ ip_restricted_site() }}
@api { @api {
path /api/* path /api/*
} }
# Handle API requests # Handle API requests with CORS for local development
handle @api { handle @api {
header {
Access-Control-Allow-Origin "*"
Access-Control-Allow-Methods "GET, POST, PUT, DELETE, OPTIONS"
Access-Control-Allow-Headers "Content-Type, Authorization, X-Requested-With"
Access-Control-Allow-Credentials "true"
}
# Handle preflight requests
@options {
method OPTIONS
}
handle @options {
respond "" 204
}
reverse_proxy localhost:9054 reverse_proxy localhost:9054
} }