Files
landing-api/docker/Caddyfile
Josep Piguillem ac546eba2b
Some checks failed
Tests / lint (push) Has been cancelled
Tests / test (push) Has been cancelled
Tests / test-postgres (push) Has been cancelled
Tests / mcp (push) Has been cancelled
Manage technologies through the API, with SVG logos
/api/v1/technologies is a full CRUD with the panel's own rules: name and
slug are plain strings, the prose is translatable, `radar_ring: null`
takes one off the radar, and TechnologyPolicy still refuses to delete
one a project, member or call uses. The MCP server picks the tools up
from openapi.yaml on its own.

A logo is an SVG, so POST /v1/media now accepts one — sanitized with
enshrined/svg-sanitize (scripts, event handlers and remote references
removed), and served by Caddy under a Content-Security-Policy that
would stop a script regardless. `for` (pages or technologies) says what
an upload is for, which picks the directory the panel uses for it and
the permission it takes.

Creating a technology without a category answered 500: the column's
default never reached the model, so the response read a null enum. The
controller now states the default, as the panel does.

Beside a file, the MCP upload tool no longer demands the JSON body's
`url`: the body then carries the upload's other fields, such as `for`.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-09-28 19:49:00 +02:00

61 lines
1.7 KiB
Caddyfile

{
# The panel is the only thing served, and it is behind a login: no reason
# for the server to announce its version to anybody scanning.
frankenphp
order php_server before file_server
auto_https off
servers {
trusted_proxies static private_ranges
}
}
{$SERVER_NAME:-:80} {
root * /app/public
encode zstd gzip
# Uploaded images. `public/storage` is a symlink into the storage volume,
# so this is what actually serves what the collective uploads — and it is
# the one path an SSR frontend fetches on every page view, so it is cached
# hard and never touched by PHP.
@media path /storage/*
header @media Cache-Control "public, max-age=31536000, immutable"
# Uploaded SVGs are sanitized on the way in (MediaController). This is the
# second line: opened directly rather than through an <img>, an SVG is a
# document, and nothing stored here has any business running script or
# loading anything from elsewhere.
@svg path /storage/*.svg
header @svg Content-Security-Policy "default-src 'none'; style-src 'unsafe-inline'; img-src data:"
# The frontend is a separate application on another origin.
@api path /api/*
header @api {
X-Content-Type-Options nosniff
}
header {
X-Content-Type-Options nosniff
X-Frame-Options SAMEORIGIN
Referrer-Policy strict-origin-when-cross-origin
-Server
}
php_server {
# Laravel's own health route, so the container can be probed without
# touching the database.
try_files {path} /index.php
}
# The health probe runs every 30 seconds and would otherwise be most of
# the access log. `log_skip` is the directive for this — `exclude` inside
# `log` is not valid in Caddy 2.
@health path /up
log_skip @health
log {
output stdout
format json
}
}