From a95c184be7fe7557ceed8b7996274800f350ced2 Mon Sep 17 00:00:00 2001 From: dev Date: Wed, 29 Apr 2026 11:26:18 +0000 Subject: [PATCH] fix: Fastify on 0.0.0.0, remove vueDevTools, nginx API proxy config - Fastify listens on 0.0.0.0:3050 (was 127.0.0.1, blocked nginx proxy) - Remove vite-plugin-vue-devtools (was causing silent page reloads) - Add asciinator.conf with working nginx config (API proxy strips /api/ prefix) Co-Authored-By: Claude Sonnet 4.6 --- asciinator.conf | 49 ++++++++++++++++++++++++++++++++++ server/index.js | 4 +-- src/components/ShellBridge.vue | 2 -- vite.config.js | 3 --- 4 files changed, 51 insertions(+), 7 deletions(-) create mode 100644 asciinator.conf diff --git a/asciinator.conf b/asciinator.conf new file mode 100644 index 0000000..f9796cc --- /dev/null +++ b/asciinator.conf @@ -0,0 +1,49 @@ +map $http_upgrade $connection_upgrade { + default upgrade; + '' close; +} + +server { + listen 80; + listen [::]:80; + server_name asciinator.waynehayesdevelopment.com; + location /.well-known/acme-challenge/ { + root /var/www/certbot; + } + location / { + return 301 https://$host$request_uri; + } +} + +server { + listen 443 ssl http2; + listen [::]:443 ssl http2; + server_name asciinator.waynehayesdevelopment.com; + client_max_body_size 25m; + ssl_certificate /etc/letsencrypt/live/asciinator.waynehayesdevelopment.com/fullchain.pem; + ssl_certificate_key /etc/letsencrypt/live/asciinator.waynehayesdevelopment.com/privkey.pem; + + # API → Fastify (trailing slash strips /api/ prefix before forwarding) + location /api/ { + proxy_pass http://172.23.0.3:3050/; + proxy_http_version 1.1; + proxy_set_header Upgrade $http_upgrade; + proxy_set_header Connection $connection_upgrade; + proxy_set_header Host $host; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + proxy_set_header X-Forwarded-Proto $scheme; + } + + # Frontend → Vite dev server + location / { + proxy_pass http://172.23.0.3:5173; + proxy_http_version 1.1; + proxy_set_header Upgrade $http_upgrade; + proxy_set_header Connection $connection_upgrade; + proxy_set_header Host $host; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + proxy_set_header X-Forwarded-Proto $scheme; + } +} diff --git a/server/index.js b/server/index.js index b803dc5..c1a5e1b 100644 --- a/server/index.js +++ b/server/index.js @@ -26,8 +26,8 @@ if (process.env.ENABLE_TEST_API === 'true') { } try { - await fastify.listen({ port: 3050, host: '127.0.0.1' }) - console.log('ASCIInator API → http://127.0.0.1:3050') + await fastify.listen({ port: 3050, host: '0.0.0.0' }) + console.log('ASCIInator API → http://0.0.0.0:3050') } catch (err) { fastify.log.error(err) process.exit(1) diff --git a/src/components/ShellBridge.vue b/src/components/ShellBridge.vue index 4fd81e0..3b06208 100644 --- a/src/components/ShellBridge.vue +++ b/src/components/ShellBridge.vue @@ -44,9 +44,7 @@ async function convert() { } } catch (err) { if (err.name === 'AbortError') { - // Intentional cancel (superseded by newer request) — stay silent if (activeController === controller) { - // Was the 30s timeout, not a cancel emit('conversion-error', 'Conversion timed out (30s)') } } else { diff --git a/vite.config.js b/vite.config.js index d680b0b..d4b4fe5 100644 --- a/vite.config.js +++ b/vite.config.js @@ -2,13 +2,10 @@ import { fileURLToPath, URL } from 'node:url' import { defineConfig } from 'vite' import vue from '@vitejs/plugin-vue' -import vueDevTools from 'vite-plugin-vue-devtools' -// https://vite.dev/config/ export default defineConfig({ plugins: [ vue(), - vueDevTools(), ], resolve: { alias: {