- src/lib/auth/oidc-state.ts (new): pack {state, codeVerifier} into a
short-lived signed JWT, store in an httpOnly cookie. Replaces the
process-local Map that broke under multi-worker deployments where
/api/auth/login and /api/auth/callback would land on different workers.
- src/pages/api/auth/{login,callback,logout,profile,status}.ts: drop the
Map-based state-store calls; use oidc-state for set/get/clear.
- src/lib/auth/oidc-client.ts, session-manager.ts, config/authentik.ts:
small adjustments to fit the new state surface.
- src/components/auth/AuthenticatedLayout.astro, src/layouts/Layout.astro:
trim a lot of layout boilerplate (~125 lines each).
- astro.config.mjs, docker-compose.local.yml: minor cleanup.
- authentik-blueprints/heady-oidc.yaml (new): declarative provider +
application blueprint to ship alongside Heady deployments.
50 lines
1.3 KiB
JavaScript
50 lines
1.3 KiB
JavaScript
import node from '@astrojs/node';
|
|
import tailwind from '@astrojs/tailwind';
|
|
import { defineConfig } from 'astro/config';
|
|
|
|
// Heady - Awesome VPN Management with Alpine.js/Astro 🤠
|
|
export default defineConfig({
|
|
output: 'hybrid', // Static pages with SSR endpoints
|
|
adapter: node({
|
|
mode: 'standalone',
|
|
}),
|
|
|
|
integrations: [
|
|
tailwind({
|
|
// Tailwind configuration
|
|
applyBaseStyles: false, // We'll handle base styles ourselves
|
|
}),
|
|
],
|
|
|
|
// Content collections for live VPN data are enabled by default in Astro 4.x
|
|
|
|
vite: {
|
|
define: {
|
|
global: 'globalThis',
|
|
},
|
|
optimizeDeps: {
|
|
include: ['alpinejs', 'guacamole-lite', 'chart.js'],
|
|
},
|
|
server: {
|
|
// No proxy rules: Vite proxy `key` strings are treated as prefix
|
|
// matches (not regex) by default, so a pattern like
|
|
// `/api/(?!auth).*` was matching `/api/auth/login` literally and
|
|
// 404-proxying it to a non-existent backend. The Astro/Astro-only
|
|
// auth endpoints under /api/auth/* must reach Astro's SSR handler
|
|
// directly. Add proxies back per-route (using `^` prefix for
|
|
// regex) once a real backend exists.
|
|
},
|
|
},
|
|
|
|
// Server configuration for production
|
|
server: {
|
|
port: 3001, // Different from Go backend
|
|
host: true,
|
|
},
|
|
|
|
// Build optimizations
|
|
build: {
|
|
assets: 'assets',
|
|
},
|
|
});
|