Add security headers and caching for webmention avatars

- Introduced a new post detailing the implementation of security headers for an Astro site behind Caddy, focusing on Content Security Policy, HSTS, and Referrer Policy.
- Added a new post on caching webmention avatars locally at build time to enhance privacy and comply with GDPR.
- Implemented a helper function to download and deduplicate webmention avatars, storing them in a cache directory.
- Created an Astro integration for garbage collection of orphaned avatar files after the build process.
This commit is contained in:
Adrian Altner 2026-04-22 21:48:17 +02:00
parent 285ff01303
commit 9d22d93361
7 changed files with 919 additions and 4 deletions

View file

@ -4,6 +4,7 @@ import mdx from '@astrojs/mdx';
import sitemap from '@astrojs/sitemap';
import { defineConfig, fontProviders } from 'astro/config';
import { loadEnv } from 'vite';
import avatarCacheSweep from './src/integrations/avatar-cache-sweep';
const envMode = process.env.NODE_ENV === 'production' ? 'production' : 'development';
const envVars = loadEnv(envMode, process.cwd(), '');
@ -40,6 +41,7 @@ export default defineConfig({
locales: { de: 'de-DE', en: 'en-US' },
},
}),
avatarCacheSweep(),
],
fonts: [