Files
aeris/next.config.ts
kew 498504b73b Refactor UI components for improved theming, better flight trace logic and weather data (RainViewer radar tiles and METAR reports) (#17)
* Refactor UI components for improved theming and accessibility

- Updated color schemes in `fpv-hud.tsx`, `hero-banner.tsx`, `keyboard-shortcuts-help.tsx`, `mobile-flight-toast.tsx`, `provider-panel.tsx`, `scroll-area.tsx`, and `slider.tsx` to utilize foreground and background variables for better dark mode support.
- Enhanced visual consistency by replacing hardcoded colors with theme variables across various components.
- Adjusted text and background colors for improved readability and accessibility.
- Fixed minor issues with key bindings in `keyboard-shortcuts-help.tsx`.
- Optimized flight data handling in `use-trail-history.ts` and `trail-cleanup.ts` for better performance and accuracy.
- Implemented outlier filtering in trail history to reduce GPS glitches.

* feat: enhance aircraft appearance and flight trail rendering with improved safety checks and visual effects

* feat: implement last flight leg trimming and nearest airport search functionality

* feat: Enhance flight data parsing and handling

- Added optionalFinite helper function to ensure only finite numbers are processed in flight data.
- Extended FlightState type to include avionics data (ias, tas, mach, roll, trackRate, magHeading) and navigation intent (navAltitudeMcp, navAltitudeFms, navHeading, navQnh, navModes).
- Updated parseRawAircraft function to utilize optionalFinite for avionics and navigation data.
- Adjusted removeSpikePoints function to increase cosThreshold from -0.17 to -0.05 for better spike removal.
- Increased MAX_WINDOW in removePathLoops function from 120 to 300 to allow for larger path loops.
- Integrated loop cleaning in stitchHistoricalTrail function to ensure cleaner paths and altitudes.

* feat: add AtcSpectrum component for audio visualization and useAirportBoard hook for flight data management
2026-03-30 00:21:36 +05:30

89 lines
2.8 KiB
TypeScript

import type { NextConfig } from "next";
const isDev = process.env.NODE_ENV === "development";
// Content Security Policy — allows only the external resources Aeris actually uses.
// https://nextjs.org/docs/app/guides/content-security-policy
//
// NOTE: planespotters.net, adsbdb.com, airport-data.com, and jetapi.dev are
// server-side only (accessed via /api/aircraft-photos proxy route). CSP does
// not apply to server-side fetches, so they are not listed in connect-src.
const cspHeader = `
default-src 'self';
script-src 'self' 'unsafe-inline' https://www.googletagmanager.com${isDev ? " 'unsafe-eval'" : ""};
style-src 'self' 'unsafe-inline';
img-src 'self' blob: data: https: ;
font-src 'self';
connect-src 'self' data: https://opensky-network.org https://*.basemaps.cartocdn.com https://basemaps.cartocdn.com https://server.arcgisonline.com https://s3.amazonaws.com https://tile.opentopomap.org https://www.google-analytics.com https://www.googletagmanager.com https://api.github.com https://api.airplanes.live https://api.adsb.lol https://res.cloudinary.com https://api.rainviewer.com;
worker-src 'self' blob:;
child-src blob:;
object-src 'none';
base-uri 'self';
form-action 'self';
frame-ancestors 'none';
upgrade-insecure-requests;
`;
const nextConfig: NextConfig = {
transpilePackages: [
"@deck.gl/core",
"@deck.gl/layers",
"@deck.gl/geo-layers",
"@deck.gl/mesh-layers",
"@deck.gl/mapbox",
"@deck.gl/react",
"@loaders.gl/core",
"@loaders.gl/gltf",
"@luma.gl/core",
"@luma.gl/webgl",
],
images: {
remotePatterns: [
{ hostname: "a.basemaps.cartocdn.com" },
{ hostname: "server.arcgisonline.com" },
{ hostname: "tile.opentopomap.org" },
],
},
async headers() {
return [
{
source: "/(.*)",
headers: [
{
key: "Content-Security-Policy",
value: cspHeader.replace(/\s{2,}/g, " ").trim(),
},
{
key: "Strict-Transport-Security",
value: "max-age=63072000; includeSubDomains; preload",
},
{ key: "X-Content-Type-Options", value: "nosniff" },
{ key: "X-Frame-Options", value: "DENY" },
{ key: "Referrer-Policy", value: "strict-origin-when-cross-origin" },
{ key: "X-DNS-Prefetch-Control", value: "on" },
{
key: "Permissions-Policy",
value:
"camera=(), microphone=(), geolocation=(self), interest-cohort=()",
},
],
},
{
source: "/api/:path*",
headers: [{ key: "Cache-Control", value: "no-store, max-age=0" }],
},
{
source: "/models/:path*",
headers: [
{
key: "Cache-Control",
value: "public, max-age=31536000, immutable",
},
],
},
];
},
};
export default nextConfig;