Commit 162b63ec authored by Aryan Noshirvnai's avatar Aryan Noshirvnai

Revert dev serving to direct https://<ip>:5173 with self-signed cert

The domain+Caddy+Let's Encrypt approach worked once the cloud firewall
allowed ports 80/443 through, but the simpler direct <ip>:port setup
(self-signed cert via basicSsl, one-time browser click-through) is
preferred now that the ports are confirmed open - Caddy is stopped and
disabled rather than removed, in case it's needed again. The mixed-
content /api proxy from the previous fix is unaffected and still
required, since the backend itself remains plain http://.
Co-Authored-By: 's avatarClaude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019i3NAUkLkHNbsPg5vKfzF9
parent 409a624f
Pipeline #1066 failed with stage
This diff is collapsed.
......@@ -12,6 +12,7 @@
"test:watch": "vitest"
},
"dependencies": {
"@vitejs/plugin-basic-ssl": "^2.3.0",
"leaflet": "^1.9.4",
"lucide-react": "^1.31.0",
"react": "^19.2.8",
......@@ -28,7 +29,6 @@
"@types/node": "^24.13.3",
"@types/react": "^19.2.17",
"@types/react-dom": "^19.2.3",
"@vitejs/plugin-basic-ssl": "^2.3.0",
"@vitejs/plugin-react": "^6.0.4",
"jsdom": "^29.1.1",
"oxlint": "^1.75.0",
......
......@@ -17,9 +17,9 @@ export default defineConfig(({ mode }) => {
// The Geolocation API (and other browser APIs) refuse to run at all on a plain http://
// origin that isn't localhost - "secure context" is a hard browser requirement, not a
// permission you can grant around. basicSsl generates a self-signed cert automatically so
// dev can run over https:// (production still needs a real cert via a real domain - a
// self-signed one is only acceptable because we're the ones clicking through the browser's
// one-time warning ourselves).
// dev can run over https:// directly on <ip>:5173 - no public CA will issue a real cert for
// a bare IP (only for a domain), so a self-signed one plus a one-time browser click-through
// is the tradeoff for skipping the domain+reverse-proxy setup.
plugins: [react(), tailwindcss(), basicSsl()],
server: {
host: true,
......@@ -28,8 +28,8 @@ export default defineConfig(({ mode }) => {
// that as mixed content once the page above is https:// (no user-facing override exists
// for active content like fetch/XHR/WebSocket, unlike old-style passive mixed content).
// Proxying same-origin through the dev server sidesteps it entirely: the browser only
// ever sees https://<this dev server>/api/..., and the actual http:// hop happens
// server-side in Node, which isn't subject to the browser's mixed-content policy.
// ever sees https://<ip>:5173/api/..., and the actual http:// hop happens server-side in
// Node, which isn't subject to the browser's mixed-content policy.
// VITE_API_BASE_URL is set to "/api" for dev via .env.development.local to route through
// this; production builds still point it at a real absolute URL directly.
proxy: {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment