mirror of
https://github.com/Dvorinka/Containr.git
synced 2026-10-28 15:51:26 +00:00
- Replace redis:7-alpine with Dragonfly (Redis-protocol compatible; go-redis client unchanged) in root, infra, and backend-dev compose files. Bounded defaults --proactor_threads/--maxmemory so it boots on small VPSs. - Frontend now defaults to same-origin API calls; nginx proxies /api/* to the backend (WebSocket-aware, docker DNS resolver for upstream re-resolution). Removes the baked localhost:8082 that broke installs reached by IP/domain. - /auth/bootstrap returns configured OAuth providers; the UI hides GitHub/Google buttons unless real credentials exist. Self-hosted stays email/password only - OAuth reserved for a future managed offering. - Sidecar ignores PLACEHOLDER_* OAuth credentials and trusts same-host origins dynamically (Origin host == request Host) so remote installs pass origin checks without config; cross-origin requests still rejected. - install.sh writes ENVIRONMENT=production; COOKIE_SECURE=false in production is now a startup warning instead of fatal (plain-HTTP installs). - Bootstrap failure surfaces an error notice instead of silently rendering the sign-in page. Authored By: TDvorak <[email protected]> Generated with [Devin](https://devin.ai) Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
75 lines
2.0 KiB
TypeScript
75 lines
2.0 KiB
TypeScript
/// <reference types="vitest" />
|
|
import { defineConfig } from 'vitest/config'
|
|
import react from '@vitejs/plugin-react'
|
|
import path from 'path'
|
|
|
|
// https://vite.dev/config/
|
|
export default defineConfig({
|
|
plugins: [react()],
|
|
server: {
|
|
proxy: {
|
|
// Same-origin API path for dev - matches the nginx proxy in the shipped image
|
|
'/api': {
|
|
target: 'http://localhost:8082',
|
|
changeOrigin: true,
|
|
ws: true,
|
|
},
|
|
},
|
|
},
|
|
test: {
|
|
globals: true,
|
|
environment: 'happy-dom',
|
|
setupFiles: ['./src/test/setup.ts'],
|
|
include: ['src/**/*.{test,spec}.{js,mjs,cjs,ts,mts,cts,jsx,tsx}'],
|
|
coverage: {
|
|
provider: 'v8',
|
|
reporter: ['text', 'json', 'html'],
|
|
include: ['src/lib/**/*.ts'],
|
|
},
|
|
},
|
|
resolve: {
|
|
alias: {
|
|
"@": path.resolve(__dirname, "./src"),
|
|
},
|
|
},
|
|
build: {
|
|
// Enable code splitting and optimization
|
|
rollupOptions: {
|
|
output: {
|
|
manualChunks: {
|
|
// Split vendor libraries
|
|
vendor: ['react', 'react-dom', '@tanstack/react-query'],
|
|
ui: ['@radix-ui/react-dialog', '@radix-ui/react-dropdown-menu', 'lucide-react'],
|
|
utils: ['date-fns', 'clsx', 'tailwind-merge']
|
|
},
|
|
// Optimize chunk naming for better caching
|
|
chunkFileNames: 'assets/js/[name]-[hash].js',
|
|
entryFileNames: 'assets/js/[name]-[hash].js',
|
|
assetFileNames: 'assets/[ext]/[name]-[hash].[ext]'
|
|
}
|
|
},
|
|
// Enable source maps for production debugging
|
|
sourcemap: true,
|
|
// Optimize bundle size
|
|
minify: 'terser',
|
|
// Set appropriate chunk size limit for better caching
|
|
chunkSizeWarningLimit: 1000
|
|
},
|
|
// Optimize dependencies during build
|
|
optimizeDeps: {
|
|
include: ['react', 'react-dom', '@tanstack/react-query', 'date-fns']
|
|
},
|
|
// Development server optimization
|
|
server: {
|
|
fs: {
|
|
// Allow serving files from project root
|
|
allow: ['..']
|
|
}
|
|
},
|
|
// Preview server optimization
|
|
preview: {
|
|
port: 4173,
|
|
strictPort: true
|
|
}
|
|
})
|