openvibers/openvibe.bot Commits
Serve extensionless legal pages and /install; record Sites handoff
Changes
@@@ -8,9 +8,11 @@ Production runs the Node process under systemd as `openvibe-bot.service` (unit rTo run the schema migrations before the service serves, start it once with the direct owner connection in `/etc/openvibe/bot.env` (`DATABASE_DIRECT_URL`); the boot applies `migrations/` and then serves on the pooled `DATABASE_URL`.++`/install` is proxied to the app; the installer script itself ships with the T15 device-agent job.++## Deploy files- `deploy/systemd/openvibe-bot.service` — systemd unit (`EnvironmentFile=/etc/openvibe/bot.env`, `PORT=4630`, hardening and `Restart=always`).- `deploy/nginx/openvibe.bot.conf` — nginx reference site for openvibe.bot: TLS, www→apex, rate limits, and WebSocket upgrade headers for the device (`/device`) and operator (`/control`) sockets, passing the `Authorization` header through. It serves the existing Sites page from `/opt/openvibe.sites/dist/openvibe.bot` and shared assets from `/opt/openvibe.sites/dist/_shared`.--Before installing this vhost, the OpenVibe.Sites owner must stop its catalog and deploy pipeline from generating or replacing `/etc/nginx/sites-available/openvibe.bot.conf`, while continuing to publish the page and shared assets at the paths above. Coordinate the single vhost handoff with that owner; then install this config, validate nginx, and reload it after `openvibe-bot.service` is ready. A later Sites deploy must not overwrite Bot's `/device` and `/control` routes.++OpenVibe.Sites keeps building the front page, legal pages and `/shared/` assets under `/opt/openvibe.sites/dist/`, but no longer generates `deploy/nginx/openvibe.bot.conf` (sites.json marks the vhost as owned by OpenVibe.Bot). A Sites deploy leaves an installed vhost it no longer generates in place, so the current Sites vhost keeps serving openvibe.bot until Bot's first deploy installs this file over it; nothing has to be removed by hand, and later Sites deploys never overwrite Bot's `/device` and `/control` routes.@@@ -112,6 +112,13 @@ server {proxy_pass http://127.0.0.1:4630;}++ # ── Device installer: built and served by the app (server/config.js installer.scriptUrl) ──++ location = /install {++ limit_req zone=ovbot_api burst=20 nodelay;++ limit_req_status 429;++ proxy_pass http://127.0.0.1:4630;++ }++# ── Health and readiness: host-local probes only ────────# The app treats /api/health and /api/ready as loopback-only (README); keep them off the public# vhost so a probe uses port 4630 directly. Exact matches outrank the /api/ prefix below.@@@ -134,8 +141,12 @@ server {alias /opt/openvibe.sites/dist/_shared/;}++ # proxy_intercept_errors stays off, so this 404 page does not affect proxied responses.++ error_page 404 /404.html;++ location = /404.html { internal; }++location / {-- try_files $uri $uri/ =404;++ try_files $uri $uri.html $uri/ =404;}location ~ /\.(?!well-known) {
@@ -8,9 +8,11 @@ Production runs the Node process under systemd as `openvibe-bot.service` (unit r
@@ -8,9 +8,11 @@ Production runs the Node process under systemd as `openvibe-bot.service` (unit r
To run the schema migrations before the service serves, start it once with the direct owner connection in `/etc/openvibe/bot.env` (`DATABASE_DIRECT_URL`); the boot applies `migrations/` and then serves on the pooled `DATABASE_URL`.
To run the schema migrations before the service serves, start it once with the direct owner connection in `/etc/openvibe/bot.env` (`DATABASE_DIRECT_URL`); the boot applies `migrations/` and then serves on the pooled `DATABASE_URL`.
+`/install` is proxied to the app; the installer script itself ships with the T15 device-agent job.
+
## Deploy files
## Deploy files
- `deploy/systemd/openvibe-bot.service` — systemd unit (`EnvironmentFile=/etc/openvibe/bot.env`, `PORT=4630`, hardening and `Restart=always`).
- `deploy/systemd/openvibe-bot.service` — systemd unit (`EnvironmentFile=/etc/openvibe/bot.env`, `PORT=4630`, hardening and `Restart=always`).
- `deploy/nginx/openvibe.bot.conf` — nginx reference site for openvibe.bot: TLS, www→apex, rate limits, and WebSocket upgrade headers for the device (`/device`) and operator (`/control`) sockets, passing the `Authorization` header through. It serves the existing Sites page from `/opt/openvibe.sites/dist/openvibe.bot` and shared assets from `/opt/openvibe.sites/dist/_shared`.
- `deploy/nginx/openvibe.bot.conf` — nginx reference site for openvibe.bot: TLS, www→apex, rate limits, and WebSocket upgrade headers for the device (`/device`) and operator (`/control`) sockets, passing the `Authorization` header through. It serves the existing Sites page from `/opt/openvibe.sites/dist/openvibe.bot` and shared assets from `/opt/openvibe.sites/dist/_shared`.
-Before installing this vhost, the OpenVibe.Sites owner must stop its catalog and deploy pipeline from generating or replacing `/etc/nginx/sites-available/openvibe.bot.conf`, while continuing to publish the page and shared assets at the paths above. Coordinate the single vhost handoff with that owner; then install this config, validate nginx, and reload it after `openvibe-bot.service` is ready. A later Sites deploy must not overwrite Bot's `/device` and `/control` routes.
+OpenVibe.Sites keeps building the front page, legal pages and `/shared/` assets under `/opt/openvibe.sites/dist/`, but no longer generates `deploy/nginx/openvibe.bot.conf` (sites.json marks the vhost as owned by OpenVibe.Bot). A Sites deploy leaves an installed vhost it no longer generates in place, so the current Sites vhost keeps serving openvibe.bot until Bot's first deploy installs this file over it; nothing has to be removed by hand, and later Sites deploys never overwrite Bot's `/device` and `/control` routes.
@@ -112,6 +112,13 @@ server {
@@ -112,6 +112,13 @@ server {
proxy_pass http://127.0.0.1:4630;
proxy_pass http://127.0.0.1:4630;
}
}
+ # ── Device installer: built and served by the app (server/config.js installer.scriptUrl) ──
+ location = /install {
+ limit_req zone=ovbot_api burst=20 nodelay;
+ limit_req_status 429;
+ proxy_pass http://127.0.0.1:4630;
+ }
+
# ── Health and readiness: host-local probes only ────────
# ── Health and readiness: host-local probes only ────────
# The app treats /api/health and /api/ready as loopback-only (README); keep them off the public
# The app treats /api/health and /api/ready as loopback-only (README); keep them off the public
# vhost so a probe uses port 4630 directly. Exact matches outrank the /api/ prefix below.
# vhost so a probe uses port 4630 directly. Exact matches outrank the /api/ prefix below.
@@ -134,8 +141,12 @@ server {
@@ -134,8 +141,12 @@ server {
alias /opt/openvibe.sites/dist/_shared/;
alias /opt/openvibe.sites/dist/_shared/;
}
}
+ # proxy_intercept_errors stays off, so this 404 page does not affect proxied responses.
+ error_page 404 /404.html;
+ location = /404.html { internal; }
+
location / {
location / {
- try_files $uri $uri/ =404;
+ try_files $uri $uri.html $uri/ =404;
}
}
location ~ /\.(?!well-known) {
location ~ /\.(?!well-known) {