Sfoglia il codice sorgente

feat(prod): withdraw docs from the customer hostname, brand nginx's error pages

The customer-facing name now serves the API and nothing else. /docs,
/openapi.json and /llms.txt were whitelisted there for about five hours
this morning and are removed: nothing on them was callable without a key,
but the docs page renders the COMPLETE operation list - admin key
management, project deletion, the read-only lock, server-wide stats - so
it published a catalogue of what to come back and try. All three stay on
the old name under /rag/, which is where we read them. /healthz stays
because it returns {"status":"ok"} and nothing else, so an outside monitor
needs no credential.

The control that makes the withdrawal checkable is a KEYED 404: /docs
answers 404 with a valid admin key as well as without one, which is how a
removed route is told apart from an unauthorized request. They are the
same status code and very different stories.

Error pages are now branded from the design tokens on the company site,
bilingual EN/HU, dark-mode aware, every asset on local disk so the 502
page still renders when the upstream it reports on is down.
proxy_intercept_errors stays OFF and the snippet says why: turning it on
would replace vectorapi's JSON error envelope with HTML and break every
client that parses it. Verified after the change that an unauthenticated
/api/v1/version still answers JSON.

Each page was made to fire for real behind a temporary location rather
than assumed from the 404 working, and that is what caught the defect: an
error page's relative URL resolves against the REQUESTED path, not its
own, so src="logo.png" was fetched from /logo.png and from
/some/deep/logo.png and 404'd every time. curl reported 404 text/html
with the brand name in the body throughout. A screenshot found it.

packaging/nginx/ holds a copy of the live config, which until now existed
on exactly one host with no version control.
fszontagh 1 mese fa
parent
commit
e2acb8052d

+ 6 - 1
CLAUDE.md

@@ -205,7 +205,12 @@ docker run -d --name svapi-dev -p 8080:8080 -e SMARTBOTIC_VECTORAPI_KEY=dev svap
 - **PROD HAS TWO HOSTNAMES AND THEY SERVE DIFFERENT SURFACES. Probing the customer-facing one at `/` answers 404 BY DESIGN.** Added 2026-10-15.
   - `qdrant-1.shop.static.shopcall.ai/rag/` - the ORIGINAL mount, unchanged and still the full surface including the admin web UI. `proxy_pass` carries a TRAILING SLASH here, which strips the `/rag` prefix before vectorapi sees it.
   - `global-api-01.smartbotics.ai` - the CUSTOMER-FACING name, at the ROOT, with its own Let's Encrypt cert (expires 2027-01-13, `--redirect` so 80 answers 301). `proxy_pass` has NO trailing slash, so the path reaches vectorapi unchanged. The two mounts are deliberately different and must never be copied onto each other.
-  **It is a WHITELIST, not a deny-list on `/`, and that is the load-bearing choice**: `/api/`, `/docs` (prefix, because the page fetches `/docs/rapidoc-min.js`), `/openapi.json`, `/llms.txt` and `/healthz` are proxied, everything else returns 404. vectorapi serves its ADMIN WEB UI at `/`, which does not belong on a hostname handed to customers - and with a deny-list, a route added by a later release would be exposed the moment the package upgraded, with nobody noticing. The cost is that a genuinely public new route must be added here deliberately, which is the point. The shared proxy settings (180 s read timeout for the server-side embedding, 10 MB body) live in `/etc/nginx/snippets/vectorapi-proxy.conf` and are included by every location, so the two cannot drift.
+  **It is a WHITELIST, not a deny-list on `/`, and that is the load-bearing choice**: `/api/` and `/healthz` are proxied, everything else returns 404. vectorapi serves its ADMIN WEB UI at `/`, which does not belong on a hostname handed to customers - and with a deny-list, a route added by a later release would be exposed the moment the package upgraded, with nobody noticing. The cost is that a genuinely public new route must be added here deliberately, which is the point. The shared proxy settings (180 s read timeout for the server-side embedding, 10 MB body) live in `/etc/nginx/snippets/vectorapi-proxy.conf` and are included by every location, so the two cannot drift.
+  **`/docs`, `/openapi.json` and `/llms.txt` WERE whitelisted here for about five hours on 2026-10-15, and were then removed by the owner's decision: the API is the only thing this hostname serves.** The reason is worth keeping because it is not secrecy - nothing there was callable without a key. The docs page renders the COMPLETE operation list, admin key management, project deletion, the read-only lock and the server-wide stats included, so it published a catalogue of what to come back and try. A customer needs the one URL they were given plus minimal docs for the part they actually use. All three stay reachable on the OLD name under `/rag/`, which is where we read them. `/healthz` stays because it was verified to return `{"status":"ok"}` and nothing else, so an outside monitor needs no credential. The 404 discloses nothing further either: `server_tokens` is already off globally, so it answers `Server: nginx` with no version.
+  **A KEYED 404 IS THE CONTROL THAT PROVES THE BLOCK IS NGINX'S OWN.** `/docs` answers 404 WITH a valid admin key as well as without one. Without that control a 404 on this host is equally consistent with "the route is gone" and "the request was not authorized" - and those are different stories, one of which would come back the moment a customer sent a key.
+  **REMOVING A ROUTE DOES NOT CLOSE A PAGE THAT IS ALREADY OPEN, AND THE HALF-DEAD RESULT READS LIKE A SERVER FAULT.** Measured in a browser immediately after the reload: the HTML and `rapidoc-min.js` came from the browser's DISK CACHE so the title still rendered, while `openapi.json` went to the network and 404'd - leaving a page that looked alive and listed nothing. A cache-busting query string answered nginx's own 404, which is the real state. So verify a withdrawal with a URL the cache has never seen, and expect anyone who had the page open to meet a BROKEN docs page rather than an absent one.
+  **THE ERROR PAGES ARE BRANDED NOW, AND ONE SETTING DECIDES WHETHER THAT IS COSMETIC OR BREAKING.** `/etc/nginx/snippets/branded-errors.conf` maps 403/404/500/502/503/504 to static pages under `/var/www/smartbotics-errors/_brand/`, styled from the design tokens read off smartbotics.ai (`--gradient-primary`, `--foreground`, `--radius`), bilingual EN/HU, with a dark-mode variant. **`proxy_intercept_errors` is OFF, which is the default, and MUST STAY OFF**: it is the single setting that would replace vectorapi's own `{"error":{"code":...}}` JSON with HTML and silently break every client that parses our errors. Verified after the change that an unauthenticated `/api/v1/version` still answers the JSON envelope, because the branding is only meant to cover the errors NGINX ITSELF raises. Everything the page needs is on local disk, so the 502 page still renders when the upstream it is reporting on is down - an error page that fetched its own assets through the proxy would be blank in exactly the case it exists for. The pages are `internal` (unreachable as paths); only the logo is not, since the browser must fetch it.
+  **AN ERROR PAGE'S RELATIVE URL RESOLVES AGAINST THE REQUESTED PATH, NOT AGAINST THE ERROR PAGE'S OWN PATH, AND EVERY TEXT-BASED CHECK PASSES WHILE IT IS BROKEN.** The pages first carried `src="logo.png"`, which is correct relative to `/_brand/404.html` and is never what the browser resolves: nginx's internal redirect leaves the URL as the REQUEST, so the logo was fetched from `/logo.png`, or `/some/deep/logo.png`, and 404'd every time. curl said `status=404 type=text/html` and the body contained the brand name twice, so it looked finished. **It was a screenshot that found it** - the broken-image icon - which is the one check that could. A local preview had also passed, because the file happened to sit beside the HTML there, so the preview was testing a layout the server can never reproduce. Absolute `/_brand/logo.png` fixes it, and the test that proves it is a DEEP path, not the one the page was first opened at.
   **Two traps met while doing it.** The half-written config was a BYTE COPY of the qdrant one with a single `server_name` changed, so it still carried full duplicate `qdrant-1` blocks on 443 and 80 and pointed at qdrant's port 6333 and qdrant's certificate - enabling that would have put conflicting server blocks on the live site and served a cert that covers neither name. And **the first request after `systemctl reload nginx` hit the old worker set and answered 404**, which read exactly like a broken location block; every path passed on a retry seconds later. Do not diagnose an nginx location from a request issued in the same breath as the reload.
 - **Prod's database binds `localhost`, not `0.0.0.0`** (`storage.bind_address`), which is why it is only reachable from vectorapi on the same box - correct, and worth knowing before wondering why a port-mapped copy refuses connections.
 - **`policy-rc.d` DOES NOT HOLD THE DATABASE PACKAGE. It blocks `invoke-rc.d`, and that postinst calls `systemctl` DIRECTLY.** Measured the hard way on 2026-10-12: a `policy-rc.d` returning 101 was in place, the pinned install ran at 18:21:12, and the service restarted anyway - the 2.17.2 first-boot migration ran to completion before the install command had even returned. **A hold point three consumers had been promised simply did not exist**, and that cost TWO separate things, not one. One consumer lost the chance to say "wait, a call is live" that they had explicitly been offered. **And because the install itself triggered the migration, the outage happened at 18:21 rather than in the 18:30 slot all three had approved** - it ran NINE MINUTES EARLY, outside the approved window, which is a governance failure distinct from the missing check. A consumer put that second point in the record; my own account had blurred it into the first, which understated it.

+ 39 - 0
packaging/nginx/README.md

@@ -0,0 +1,39 @@
+# nginx config for the prod reverse proxy
+
+A **copy of what is running on the prod droplet**, kept here so it is reviewable
+and recoverable. Nothing in this directory is deployed by the build or by any
+package: editing a file here changes nothing until it is copied to the host.
+The host is the source of truth; this is the backup and the review surface.
+
+## What is here
+
+| file | installed as |
+|---|---|
+| `global-api-01.smartbotics.ai.conf` | `/etc/nginx/sites-available/global-api-01.smartbotics.ai` (symlinked into `sites-enabled`) |
+| `vectorapi-proxy.conf` | `/etc/nginx/snippets/vectorapi-proxy.conf` |
+| `branded-errors.conf` | `/etc/nginx/snippets/branded-errors.conf` |
+| `errors/_brand/*` | `/var/www/smartbotics-errors/_brand/` |
+
+The older hostname's config (`qdrant-1.shop.static.shopcall.ai`, mount `/rag/`)
+is deliberately NOT copied here: it also fronts another service, so this repo is
+the wrong place for it.
+
+## The two things worth reading before editing
+
+**The customer-facing host is a WHITELIST.** Only `/api/` and `/healthz` are
+proxied; everything else answers 404, the admin web UI and the docs included.
+A deny-list would expose whatever a later release adds, the moment the package
+upgrades, with nobody noticing. Adding a route here is meant to be a decision.
+
+**`proxy_intercept_errors` must stay off.** The branded pages are for the errors
+nginx itself raises. With interception on, vectorapi's own JSON error envelope
+would be replaced by HTML and every client parsing it would break.
+
+## Applying a change
+
+    scp packaging/nginx/branded-errors.conf prod:/tmp/
+    ssh prod 'sudo cp /tmp/branded-errors.conf /etc/nginx/snippets/ && sudo nginx -t && sudo systemctl reload nginx'
+
+Then verify from OUTSIDE, and not in the same breath as the reload: the first
+request after a reload can land on the old worker set and answer 404, which
+reads exactly like a broken location block.

+ 36 - 0
packaging/nginx/branded-errors.conf

@@ -0,0 +1,36 @@
+# Branded error pages (SmartBotics theme). Included per server block.
+#
+# These cover the errors NGINX ITSELF generates - the whitelist's `return 404`,
+# and the 502/504 it raises when vectorapi is down or slow. Responses PROXIED
+# from vectorapi keep their own JSON error envelope untouched, because
+# `proxy_intercept_errors` is off (the default) and MUST stay off: a client
+# parsing `{"error":{"code":...}}` must never start receiving HTML instead.
+# That is the one setting that would turn this cosmetic change into a breaking
+# API change, so it is named here rather than left to be rediscovered.
+#
+# Everything the page needs is on LOCAL DISK. An error page that fetched a
+# font, a stylesheet or a logo through the proxy would be blank in exactly the
+# case it exists for, and one that fetched from a CDN would leak a third-party
+# request from an error. Same reasoning as bundling Monaco rather than using a
+# CDN loader.
+error_page 403 /_brand/403.html;
+error_page 404 /_brand/404.html;
+error_page 500 /_brand/500.html;
+error_page 502 /_brand/502.html;
+error_page 503 /_brand/503.html;
+error_page 504 /_brand/504.html;
+
+location ^~ /_brand/ {
+    root /var/www/smartbotics-errors;
+    internal;          # reachable only as an error page, never as a path
+    access_log off;
+}
+
+# The logo is the one thing a browser fetches while rendering the page, so it
+# cannot be `internal`. An exact-match location beats the `^~` prefix above.
+# It is a static file: no upstream, which is what keeps the 502 page whole.
+location = /_brand/logo.png {
+    root /var/www/smartbotics-errors;
+    access_log off;
+    expires 7d;
+}

+ 56 - 0
packaging/nginx/errors/_brand/403.html

@@ -0,0 +1,56 @@
+<!doctype html>
+<html lang="en">
+<head>
+<meta charset="utf-8">
+<meta name="viewport" content="width=device-width,initial-scale=1">
+<meta name="robots" content="noindex,nofollow">
+<title>403 Forbidden - SmartBotics</title>
+<style>
+:root{
+  --bg:#ffffff; --fg:#1f2937; --muted:#6b7280; --border:#e5e7eb; --radius:.75rem;
+  --grad:linear-gradient(135deg,hsl(193,100%,50%),hsl(262,83%,58%),hsl(310,100%,69%),hsl(25,95%,53%));
+  --shadow:0 10px 15px -3px hsla(262,83%,58%,.1),0 4px 6px -2px hsla(262,83%,58%,.05);
+}
+@media (prefers-color-scheme:dark){
+  :root{ --bg:hsl(225,12%,8%); --fg:#e5e7eb; --muted:#9aa3b2; --border:hsl(225,12%,18%);
+          --shadow:0 10px 15px -3px rgba(0,0,0,.5); }
+}
+*{box-sizing:border-box}
+html,body{height:100%}
+body{
+  margin:0; background:var(--bg); color:var(--fg);
+  font-family:Inter,-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,"Helvetica Neue",Arial,sans-serif;
+  display:flex; align-items:center; justify-content:center; padding:24px; line-height:1.55;
+}
+.bar{position:fixed;top:0;left:0;right:0;height:4px;background:var(--grad)}
+.card{
+  width:100%; max-width:560px; text-align:center;
+  border:1px solid var(--border); border-radius:var(--radius);
+  box-shadow:var(--shadow); padding:40px 32px; background:var(--bg);
+}
+.logo{width:200px;max-width:70%;height:auto;margin:0 auto 28px;display:block}
+.code{
+  font-size:64px; font-weight:800; line-height:1; margin:0 0 8px; letter-spacing:-.02em;
+  background:var(--grad); -webkit-background-clip:text; background-clip:text;
+  -webkit-text-fill-color:transparent; color:hsl(262,83%,58%);
+}
+h1{font-size:20px;font-weight:600;margin:0 0 14px}
+p{margin:0 0 10px;color:var(--muted);font-size:15px}
+p.hu{font-size:14px}
+.foot{margin-top:26px;padding-top:18px;border-top:1px solid var(--border);font-size:13px;color:var(--muted)}
+.foot a{color:inherit;text-decoration:none;border-bottom:1px solid var(--border)}
+@media (max-width:420px){ .card{padding:28px 20px} .code{font-size:48px} }
+</style>
+</head>
+<body>
+<div class="bar"></div>
+<main class="card">
+  <img class="logo" src="/_brand/logo.png" alt="SmartBotics" width="320" height="154">
+  <p class="code">403</p>
+  <h1>Forbidden</h1>
+  <p>This request was refused.</p>
+  <p class="hu">A kérést elutasítottuk.</p>
+  <div class="foot"><a href="https://smartbotics.ai/">smartbotics.ai</a></div>
+</main>
+</body>
+</html>

+ 56 - 0
packaging/nginx/errors/_brand/404.html

@@ -0,0 +1,56 @@
+<!doctype html>
+<html lang="en">
+<head>
+<meta charset="utf-8">
+<meta name="viewport" content="width=device-width,initial-scale=1">
+<meta name="robots" content="noindex,nofollow">
+<title>404 Not found - SmartBotics</title>
+<style>
+:root{
+  --bg:#ffffff; --fg:#1f2937; --muted:#6b7280; --border:#e5e7eb; --radius:.75rem;
+  --grad:linear-gradient(135deg,hsl(193,100%,50%),hsl(262,83%,58%),hsl(310,100%,69%),hsl(25,95%,53%));
+  --shadow:0 10px 15px -3px hsla(262,83%,58%,.1),0 4px 6px -2px hsla(262,83%,58%,.05);
+}
+@media (prefers-color-scheme:dark){
+  :root{ --bg:hsl(225,12%,8%); --fg:#e5e7eb; --muted:#9aa3b2; --border:hsl(225,12%,18%);
+          --shadow:0 10px 15px -3px rgba(0,0,0,.5); }
+}
+*{box-sizing:border-box}
+html,body{height:100%}
+body{
+  margin:0; background:var(--bg); color:var(--fg);
+  font-family:Inter,-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,"Helvetica Neue",Arial,sans-serif;
+  display:flex; align-items:center; justify-content:center; padding:24px; line-height:1.55;
+}
+.bar{position:fixed;top:0;left:0;right:0;height:4px;background:var(--grad)}
+.card{
+  width:100%; max-width:560px; text-align:center;
+  border:1px solid var(--border); border-radius:var(--radius);
+  box-shadow:var(--shadow); padding:40px 32px; background:var(--bg);
+}
+.logo{width:200px;max-width:70%;height:auto;margin:0 auto 28px;display:block}
+.code{
+  font-size:64px; font-weight:800; line-height:1; margin:0 0 8px; letter-spacing:-.02em;
+  background:var(--grad); -webkit-background-clip:text; background-clip:text;
+  -webkit-text-fill-color:transparent; color:hsl(262,83%,58%);
+}
+h1{font-size:20px;font-weight:600;margin:0 0 14px}
+p{margin:0 0 10px;color:var(--muted);font-size:15px}
+p.hu{font-size:14px}
+.foot{margin-top:26px;padding-top:18px;border-top:1px solid var(--border);font-size:13px;color:var(--muted)}
+.foot a{color:inherit;text-decoration:none;border-bottom:1px solid var(--border)}
+@media (max-width:420px){ .card{padding:28px 20px} .code{font-size:48px} }
+</style>
+</head>
+<body>
+<div class="bar"></div>
+<main class="card">
+  <img class="logo" src="/_brand/logo.png" alt="SmartBotics" width="320" height="154">
+  <p class="code">404</p>
+  <h1>Not found</h1>
+  <p>This address does not serve anything. If you were given an endpoint URL, check it for typos.</p>
+  <p class="hu">Ezen a címen nincs semmi. Ha kapott tőlünk egy végpont URL-t, ellenőrizze, nem gépelte-e el.</p>
+  <div class="foot"><a href="https://smartbotics.ai/">smartbotics.ai</a></div>
+</main>
+</body>
+</html>

+ 56 - 0
packaging/nginx/errors/_brand/500.html

@@ -0,0 +1,56 @@
+<!doctype html>
+<html lang="en">
+<head>
+<meta charset="utf-8">
+<meta name="viewport" content="width=device-width,initial-scale=1">
+<meta name="robots" content="noindex,nofollow">
+<title>500 Internal error - SmartBotics</title>
+<style>
+:root{
+  --bg:#ffffff; --fg:#1f2937; --muted:#6b7280; --border:#e5e7eb; --radius:.75rem;
+  --grad:linear-gradient(135deg,hsl(193,100%,50%),hsl(262,83%,58%),hsl(310,100%,69%),hsl(25,95%,53%));
+  --shadow:0 10px 15px -3px hsla(262,83%,58%,.1),0 4px 6px -2px hsla(262,83%,58%,.05);
+}
+@media (prefers-color-scheme:dark){
+  :root{ --bg:hsl(225,12%,8%); --fg:#e5e7eb; --muted:#9aa3b2; --border:hsl(225,12%,18%);
+          --shadow:0 10px 15px -3px rgba(0,0,0,.5); }
+}
+*{box-sizing:border-box}
+html,body{height:100%}
+body{
+  margin:0; background:var(--bg); color:var(--fg);
+  font-family:Inter,-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,"Helvetica Neue",Arial,sans-serif;
+  display:flex; align-items:center; justify-content:center; padding:24px; line-height:1.55;
+}
+.bar{position:fixed;top:0;left:0;right:0;height:4px;background:var(--grad)}
+.card{
+  width:100%; max-width:560px; text-align:center;
+  border:1px solid var(--border); border-radius:var(--radius);
+  box-shadow:var(--shadow); padding:40px 32px; background:var(--bg);
+}
+.logo{width:200px;max-width:70%;height:auto;margin:0 auto 28px;display:block}
+.code{
+  font-size:64px; font-weight:800; line-height:1; margin:0 0 8px; letter-spacing:-.02em;
+  background:var(--grad); -webkit-background-clip:text; background-clip:text;
+  -webkit-text-fill-color:transparent; color:hsl(262,83%,58%);
+}
+h1{font-size:20px;font-weight:600;margin:0 0 14px}
+p{margin:0 0 10px;color:var(--muted);font-size:15px}
+p.hu{font-size:14px}
+.foot{margin-top:26px;padding-top:18px;border-top:1px solid var(--border);font-size:13px;color:var(--muted)}
+.foot a{color:inherit;text-decoration:none;border-bottom:1px solid var(--border)}
+@media (max-width:420px){ .card{padding:28px 20px} .code{font-size:48px} }
+</style>
+</head>
+<body>
+<div class="bar"></div>
+<main class="card">
+  <img class="logo" src="/_brand/logo.png" alt="SmartBotics" width="320" height="154">
+  <p class="code">500</p>
+  <h1>Internal error</h1>
+  <p>Something failed on our side. The request was not completed.</p>
+  <p class="hu">Hiba történt nálunk. A kérés nem teljesült.</p>
+  <div class="foot"><a href="https://smartbotics.ai/">smartbotics.ai</a></div>
+</main>
+</body>
+</html>

+ 56 - 0
packaging/nginx/errors/_brand/502.html

@@ -0,0 +1,56 @@
+<!doctype html>
+<html lang="en">
+<head>
+<meta charset="utf-8">
+<meta name="viewport" content="width=device-width,initial-scale=1">
+<meta name="robots" content="noindex,nofollow">
+<title>502 Service unavailable - SmartBotics</title>
+<style>
+:root{
+  --bg:#ffffff; --fg:#1f2937; --muted:#6b7280; --border:#e5e7eb; --radius:.75rem;
+  --grad:linear-gradient(135deg,hsl(193,100%,50%),hsl(262,83%,58%),hsl(310,100%,69%),hsl(25,95%,53%));
+  --shadow:0 10px 15px -3px hsla(262,83%,58%,.1),0 4px 6px -2px hsla(262,83%,58%,.05);
+}
+@media (prefers-color-scheme:dark){
+  :root{ --bg:hsl(225,12%,8%); --fg:#e5e7eb; --muted:#9aa3b2; --border:hsl(225,12%,18%);
+          --shadow:0 10px 15px -3px rgba(0,0,0,.5); }
+}
+*{box-sizing:border-box}
+html,body{height:100%}
+body{
+  margin:0; background:var(--bg); color:var(--fg);
+  font-family:Inter,-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,"Helvetica Neue",Arial,sans-serif;
+  display:flex; align-items:center; justify-content:center; padding:24px; line-height:1.55;
+}
+.bar{position:fixed;top:0;left:0;right:0;height:4px;background:var(--grad)}
+.card{
+  width:100%; max-width:560px; text-align:center;
+  border:1px solid var(--border); border-radius:var(--radius);
+  box-shadow:var(--shadow); padding:40px 32px; background:var(--bg);
+}
+.logo{width:200px;max-width:70%;height:auto;margin:0 auto 28px;display:block}
+.code{
+  font-size:64px; font-weight:800; line-height:1; margin:0 0 8px; letter-spacing:-.02em;
+  background:var(--grad); -webkit-background-clip:text; background-clip:text;
+  -webkit-text-fill-color:transparent; color:hsl(262,83%,58%);
+}
+h1{font-size:20px;font-weight:600;margin:0 0 14px}
+p{margin:0 0 10px;color:var(--muted);font-size:15px}
+p.hu{font-size:14px}
+.foot{margin-top:26px;padding-top:18px;border-top:1px solid var(--border);font-size:13px;color:var(--muted)}
+.foot a{color:inherit;text-decoration:none;border-bottom:1px solid var(--border)}
+@media (max-width:420px){ .card{padding:28px 20px} .code{font-size:48px} }
+</style>
+</head>
+<body>
+<div class="bar"></div>
+<main class="card">
+  <img class="logo" src="/_brand/logo.png" alt="SmartBotics" width="320" height="154">
+  <p class="code">502</p>
+  <h1>Service unavailable</h1>
+  <p>The API is not responding right now. This is our side, not yours, and nothing you sent was processed.</p>
+  <p class="hu">Az API jelenleg nem válaszol. A hiba nálunk van, a beküldött kérés nem lett feldolgozva.</p>
+  <div class="foot"><a href="https://smartbotics.ai/">smartbotics.ai</a></div>
+</main>
+</body>
+</html>

+ 56 - 0
packaging/nginx/errors/_brand/503.html

@@ -0,0 +1,56 @@
+<!doctype html>
+<html lang="en">
+<head>
+<meta charset="utf-8">
+<meta name="viewport" content="width=device-width,initial-scale=1">
+<meta name="robots" content="noindex,nofollow">
+<title>503 Service unavailable - SmartBotics</title>
+<style>
+:root{
+  --bg:#ffffff; --fg:#1f2937; --muted:#6b7280; --border:#e5e7eb; --radius:.75rem;
+  --grad:linear-gradient(135deg,hsl(193,100%,50%),hsl(262,83%,58%),hsl(310,100%,69%),hsl(25,95%,53%));
+  --shadow:0 10px 15px -3px hsla(262,83%,58%,.1),0 4px 6px -2px hsla(262,83%,58%,.05);
+}
+@media (prefers-color-scheme:dark){
+  :root{ --bg:hsl(225,12%,8%); --fg:#e5e7eb; --muted:#9aa3b2; --border:hsl(225,12%,18%);
+          --shadow:0 10px 15px -3px rgba(0,0,0,.5); }
+}
+*{box-sizing:border-box}
+html,body{height:100%}
+body{
+  margin:0; background:var(--bg); color:var(--fg);
+  font-family:Inter,-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,"Helvetica Neue",Arial,sans-serif;
+  display:flex; align-items:center; justify-content:center; padding:24px; line-height:1.55;
+}
+.bar{position:fixed;top:0;left:0;right:0;height:4px;background:var(--grad)}
+.card{
+  width:100%; max-width:560px; text-align:center;
+  border:1px solid var(--border); border-radius:var(--radius);
+  box-shadow:var(--shadow); padding:40px 32px; background:var(--bg);
+}
+.logo{width:200px;max-width:70%;height:auto;margin:0 auto 28px;display:block}
+.code{
+  font-size:64px; font-weight:800; line-height:1; margin:0 0 8px; letter-spacing:-.02em;
+  background:var(--grad); -webkit-background-clip:text; background-clip:text;
+  -webkit-text-fill-color:transparent; color:hsl(262,83%,58%);
+}
+h1{font-size:20px;font-weight:600;margin:0 0 14px}
+p{margin:0 0 10px;color:var(--muted);font-size:15px}
+p.hu{font-size:14px}
+.foot{margin-top:26px;padding-top:18px;border-top:1px solid var(--border);font-size:13px;color:var(--muted)}
+.foot a{color:inherit;text-decoration:none;border-bottom:1px solid var(--border)}
+@media (max-width:420px){ .card{padding:28px 20px} .code{font-size:48px} }
+</style>
+</head>
+<body>
+<div class="bar"></div>
+<main class="card">
+  <img class="logo" src="/_brand/logo.png" alt="SmartBotics" width="320" height="154">
+  <p class="code">503</p>
+  <h1>Service unavailable</h1>
+  <p>The API is temporarily unavailable, usually during maintenance. Please retry shortly.</p>
+  <p class="hu">Az API átmenetileg nem érhető el, jellemzően karbantartás miatt. Kérjük, próbálja újra később.</p>
+  <div class="foot"><a href="https://smartbotics.ai/">smartbotics.ai</a></div>
+</main>
+</body>
+</html>

+ 56 - 0
packaging/nginx/errors/_brand/504.html

@@ -0,0 +1,56 @@
+<!doctype html>
+<html lang="en">
+<head>
+<meta charset="utf-8">
+<meta name="viewport" content="width=device-width,initial-scale=1">
+<meta name="robots" content="noindex,nofollow">
+<title>504 Gateway timeout - SmartBotics</title>
+<style>
+:root{
+  --bg:#ffffff; --fg:#1f2937; --muted:#6b7280; --border:#e5e7eb; --radius:.75rem;
+  --grad:linear-gradient(135deg,hsl(193,100%,50%),hsl(262,83%,58%),hsl(310,100%,69%),hsl(25,95%,53%));
+  --shadow:0 10px 15px -3px hsla(262,83%,58%,.1),0 4px 6px -2px hsla(262,83%,58%,.05);
+}
+@media (prefers-color-scheme:dark){
+  :root{ --bg:hsl(225,12%,8%); --fg:#e5e7eb; --muted:#9aa3b2; --border:hsl(225,12%,18%);
+          --shadow:0 10px 15px -3px rgba(0,0,0,.5); }
+}
+*{box-sizing:border-box}
+html,body{height:100%}
+body{
+  margin:0; background:var(--bg); color:var(--fg);
+  font-family:Inter,-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,"Helvetica Neue",Arial,sans-serif;
+  display:flex; align-items:center; justify-content:center; padding:24px; line-height:1.55;
+}
+.bar{position:fixed;top:0;left:0;right:0;height:4px;background:var(--grad)}
+.card{
+  width:100%; max-width:560px; text-align:center;
+  border:1px solid var(--border); border-radius:var(--radius);
+  box-shadow:var(--shadow); padding:40px 32px; background:var(--bg);
+}
+.logo{width:200px;max-width:70%;height:auto;margin:0 auto 28px;display:block}
+.code{
+  font-size:64px; font-weight:800; line-height:1; margin:0 0 8px; letter-spacing:-.02em;
+  background:var(--grad); -webkit-background-clip:text; background-clip:text;
+  -webkit-text-fill-color:transparent; color:hsl(262,83%,58%);
+}
+h1{font-size:20px;font-weight:600;margin:0 0 14px}
+p{margin:0 0 10px;color:var(--muted);font-size:15px}
+p.hu{font-size:14px}
+.foot{margin-top:26px;padding-top:18px;border-top:1px solid var(--border);font-size:13px;color:var(--muted)}
+.foot a{color:inherit;text-decoration:none;border-bottom:1px solid var(--border)}
+@media (max-width:420px){ .card{padding:28px 20px} .code{font-size:48px} }
+</style>
+</head>
+<body>
+<div class="bar"></div>
+<main class="card">
+  <img class="logo" src="/_brand/logo.png" alt="SmartBotics" width="320" height="154">
+  <p class="code">504</p>
+  <h1>Gateway timeout</h1>
+  <p>The API took too long to answer. The request may or may not have been processed, so retry only if it is safe to repeat.</p>
+  <p class="hu">Az API túl lassan válaszolt. Lehet, hogy a kérés lefutott, ezért csak akkor próbálja újra, ha biztonságosan ismételhető.</p>
+  <div class="foot"><a href="https://smartbotics.ai/">smartbotics.ai</a></div>
+</main>
+</body>
+</html>

BIN
packaging/nginx/errors/_brand/logo.png


+ 78 - 0
packaging/nginx/global-api-01.smartbotics.ai.conf

@@ -0,0 +1,78 @@
+# global-api-01.smartbotics.ai - the CUSTOMER-FACING hostname for
+# smartbotic-vectorapi. The old name (qdrant-1.shop.static.shopcall.ai, mount
+# /rag/) is unchanged and keeps working; this is an addition, not a move.
+#
+# It serves the API AND NOTHING ELSE. No docs page, no openapi.json, no
+# llms.txt, no admin web UI. Those were briefly whitelisted here and were
+# removed deliberately: customers do not need a self-service catalogue of
+# every route, and the docs page published the COMPLETE operation list -
+# admin-only key management, project deletion, the read-only lock and the
+# server-wide stats included - to anyone who loaded the URL. None of it was
+# callable without a key, but naming an endpoint is already a hint, and a
+# published list is also a published list of what to come back and try.
+# When an API is shared with a customer, send them the exact URL plus
+# minimal docs for the part they actually use.
+#
+# A WHITELIST, not a deny-list on `/`. The difference matters on the day a
+# later vectorapi release adds a route: with a whitelist it is absent here
+# until someone decides otherwise, with a deny-list it is exposed the moment
+# the package is upgraded, and nobody would notice. The cost is that a new
+# PUBLIC route has to be added here deliberately - which is the point.
+#
+# TLS is added by certbot --nginx against this block; the cert covers this name
+# only. Do NOT point it at the qdrant-1 certificate, which does not include
+# this hostname and would fail verification in every client.
+server {
+    server_name global-api-01.smartbotics.ai;
+
+    # Branded error pages for the errors nginx itself raises. See the snippet:
+    # proxied responses keep their JSON envelope, which must not change.
+    include /etc/nginx/snippets/branded-errors.conf;
+
+    # The API itself. Authentication is vectorapi's: every /api/* path is
+    # authenticated BEFORE routing, so an unknown path answers 401 rather than
+    # 404 and nginx need not know the route table.
+    location /api/ {
+        proxy_pass http://127.0.0.1:8080;
+        include /etc/nginx/snippets/vectorapi-proxy.conf;
+    }
+
+    # Liveness, kept so this hostname can be monitored from outside without a
+    # credential. NOT under /api/, which is the trap worth knowing: a probe of
+    # /api/v1/healthz answers 401 unauthenticated and 404 WITH a valid key,
+    # because pre-routing auth runs before the route table. Verified it returns
+    # {"status":"ok"} and nothing else - no version, nothing to disclose. That
+    # is the whole reason it is still here while the docs are not.
+    location = /healthz {
+        proxy_pass http://127.0.0.1:8080;
+        include /etc/nginx/snippets/vectorapi-proxy.conf;
+    }
+
+    # Everything else is absent on this hostname: the admin web UI, the docs
+    # page and its asset, /openapi.json and /llms.txt. All of it stays
+    # reachable on the old name under /rag/, which is where we read it.
+    # 404 rather than 403: a 403 would confirm something is there.
+    location / {
+        return 404;
+    }
+
+    listen 443 ssl; # managed by Certbot
+    ssl_certificate /etc/letsencrypt/live/global-api-01.smartbotics.ai/fullchain.pem; # managed by Certbot
+    ssl_certificate_key /etc/letsencrypt/live/global-api-01.smartbotics.ai/privkey.pem; # managed by Certbot
+    include /etc/letsencrypt/options-ssl-nginx.conf; # managed by Certbot
+    ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem; # managed by Certbot
+
+}
+
+server {
+    if ($host = global-api-01.smartbotics.ai) {
+        return 301 https://$host$request_uri;
+    } # managed by Certbot
+
+
+    server_name global-api-01.smartbotics.ai;
+    listen 80;
+    return 404; # managed by Certbot
+
+
+}

+ 22 - 0
packaging/nginx/vectorapi-proxy.conf

@@ -0,0 +1,22 @@
+# Shared proxy settings for every location that reaches smartbotic-vectorapi.
+#
+# In ONE file rather than repeated per location, so the whitelist on
+# global-api-01 cannot drift: a timeout or body limit fixed in one location and
+# forgotten in the next is how /api/ and /docs end up behaving differently.
+#
+# NOTE there is deliberately no trailing slash on proxy_pass at the call sites,
+# so the full request path reaches vectorapi unchanged. The /rag/ mount on the
+# old hostname DOES use a trailing slash, which strips the prefix - the two
+# mounts are different on purpose and must not be copied onto each other.
+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;
+
+# A POST /vectors embeds server-side, so the embedding provider's latency sits
+# INSIDE this request: measured ~0.5-1.0 s warm but 12-15 s has been seen, and
+# there is no query-embedding cache, so every call pays the provider again.
+# Three writes died on the 60 s default on 2026-09-23, logged upstream as
+# "upstream timed out while reading response header".
+proxy_read_timeout 180s;
+client_max_body_size 10m;