7223118b89
The all-in-one image could not be installed from a GUI at all — the deployment it
exists for. validateEnv treats a missing JWT_SECRET as critical and exits, and the
documented run command supplies it with `openssl rand`, a shell command a Synology
Container Manager or QNAP Container Station form cannot run.
wait-for-db.sh now generates one on first start and persists it next to the database,
extending the existing /run/secrets hydration rather than adding a second mechanism.
Explicit env still wins, then /run/secrets, then the generated file. The write is
load-bearing: JWT_SECRET is exported only when the file actually persisted, because an
unpersisted secret would mint a new one every restart and sign every session out.
Creation writes to a private temp file and hard-links it into place — atomic, fails with
EEXIST when another container won, and the loser adopts the winner's value. Non-regular
paths are rejected before the link, since POSIX ln links INTO a directory rather than
failing, which would make a mistyped -v target unrecoverable.
Also repairs the onboarding paths a new install actually walks: the installer no longer
rotates the secrets of a running install on re-run, deprecates the dead scripts/install.sh
in place, corrects the CONTRIBUTING dev loop, and fixes the vite proxy target that had
been pointing at a stray local port since 0da45e69.
Reviewed over three rounds. Co-authored by @Luca-Timo.
59 lines
1.5 KiB
TypeScript
59 lines
1.5 KiB
TypeScript
/// <reference types="vitest" />
|
|
// @ts-nocheck
|
|
|
|
import { defineConfig } from 'vite'
|
|
import react from '@vitejs/plugin-react'
|
|
import type { UserConfig as VitestUserConfig } from 'vitest/config'
|
|
|
|
// https://vite.dev/config/
|
|
const config: VitestUserConfig = {
|
|
plugins: [react()],
|
|
build: {
|
|
rollupOptions: {
|
|
output: {
|
|
manualChunks: {
|
|
'react-vendor': ['react', 'react-dom', 'react-router-dom'],
|
|
'ui-vendor': ['lucide-react', 'react-toastify'],
|
|
// Migration 137 — admin calendar deps (~200 KB). Carved into
|
|
// their own chunk so the main bundle isn't penalised on
|
|
// every page load; the calendar route lazy-loads this chunk
|
|
// on demand via React.lazy.
|
|
'fullcalendar': [
|
|
'@fullcalendar/react',
|
|
'@fullcalendar/core',
|
|
'@fullcalendar/daygrid',
|
|
'@fullcalendar/timegrid',
|
|
'@fullcalendar/interaction',
|
|
],
|
|
},
|
|
},
|
|
},
|
|
sourcemap: false,
|
|
},
|
|
test: {
|
|
environment: 'jsdom',
|
|
setupFiles: './vitest.setup.ts',
|
|
globals: true
|
|
},
|
|
server: {
|
|
port: 5173,
|
|
host: true,
|
|
proxy: {
|
|
'/api': {
|
|
target: 'http://localhost:3001',
|
|
changeOrigin: true,
|
|
},
|
|
'/photos': {
|
|
target: 'http://localhost:3001',
|
|
changeOrigin: true,
|
|
},
|
|
'/uploads': {
|
|
target: 'http://localhost:3001',
|
|
changeOrigin: true,
|
|
},
|
|
},
|
|
}
|
|
}
|
|
|
|
export default defineConfig(config as any)
|