openvibers/openvibe.mail Commits
nginx: serve the agent files, the owner's provider panel and the report page (#34)
Changes
@@@ -96,6 +96,18 @@ server {proxy_pass http://127.0.0.1:5250;}++ # The owner's provider panel (server/http/pages.js answers 404 to anyone but the owner). It was missing here, so++ # openvibe.email/admin/mail/providers answered nginx's 404 to the owner too (11-09).++ location = /admin/mail/providers {++ limit_except GET HEAD { deny all; }++ proxy_pass http://127.0.0.1:5250;++ }++ # The abuse report page every sent message links to (X-OpenVibe-Report-Abuse); the report posts to /api/v1/.++ location ~ ^/report/[0-9a-f-]+$ { # the app checks the 36-character id++ limit_except GET HEAD { deny all; }++ proxy_pass http://127.0.0.1:5250;++ }++# ── the machine answers ─────────────────────────────────location = /api/health {proxy_pass http://127.0.0.1:5250;@@@ -105,6 +117,16 @@ server {proxy_pass http://127.0.0.1:5250;}++ # The machine-readable front door (server/http/discovery.js): what the site is and its public API, for agents.++ location ~ ^/(llms\.txt|llms-full\.txt|openapi\.json)$ {++ limit_except GET HEAD { deny all; }++ proxy_pass http://127.0.0.1:5250;++ }++ location = /.well-known/agent.json {++ limit_except GET HEAD { deny all; }++ proxy_pass http://127.0.0.1:5250;++ }++# The release manifest open tabs poll (no-cache, set by the app) to update in place.location = /release.json {limit_except GET HEAD { deny all; }@@@ -37,7 +37,9 @@ test('only the page and its files, the API, the machine answers and the sign-in.filter(([, body]) => /proxy_pass\s+http:\/\/127\.0\.0\.1:5250;/.test(body)).map(([name]) => name).sort();-- assert.deepStrictEqual(proxied, ['/', '^/(css|js|shared)/', '^/inbox(/[A-Za-z0-9_-]+)?$', '/api/health', '/api/ready', '/api/v1/', '/auth/', '/auth/me', '/release.json'].sort());++ assert.deepStrictEqual(proxied, ['/', '^/(css|js|shared)/', '^/inbox(/[A-Za-z0-9_-]+)?$', '/api/health', '/api/ready', '/api/v1/', '/auth/', '/auth/me', '/release.json',++ // 11-09: the agent files, the owner's provider panel and the report page answered nginx's 404 though the app serves them.++ '^/(llms\\.txt|llms-full\\.txt|openapi\\.json)$', '/.well-known/agent.json', '/admin/mail/providers', '^/report/[0-9a-f-]+$'].sort());// A proxy anywhere else (a generic /api/ or / catch-all) would expose more than the door above.assert.strictEqual((CONF.match(/proxy_pass\s+/g) || []).length, proxied.length,
@@ -96,6 +96,18 @@ server {
@@ -96,6 +96,18 @@ server {
proxy_pass http://127.0.0.1:5250;
proxy_pass http://127.0.0.1:5250;
}
}
+ # The owner's provider panel (server/http/pages.js answers 404 to anyone but the owner). It was missing here, so
+ # openvibe.email/admin/mail/providers answered nginx's 404 to the owner too (11-09).
+ location = /admin/mail/providers {
+ limit_except GET HEAD { deny all; }
+ proxy_pass http://127.0.0.1:5250;
+ }
+ # The abuse report page every sent message links to (X-OpenVibe-Report-Abuse); the report posts to /api/v1/.
+ location ~ ^/report/[0-9a-f-]+$ { # the app checks the 36-character id
+ limit_except GET HEAD { deny all; }
+ proxy_pass http://127.0.0.1:5250;
+ }
+
# ── the machine answers ─────────────────────────────────
# ── the machine answers ─────────────────────────────────
location = /api/health {
location = /api/health {
proxy_pass http://127.0.0.1:5250;
proxy_pass http://127.0.0.1:5250;
@@ -105,6 +117,16 @@ server {
@@ -105,6 +117,16 @@ server {
proxy_pass http://127.0.0.1:5250;
proxy_pass http://127.0.0.1:5250;
}
}
+ # The machine-readable front door (server/http/discovery.js): what the site is and its public API, for agents.
+ location ~ ^/(llms\.txt|llms-full\.txt|openapi\.json)$ {
+ limit_except GET HEAD { deny all; }
+ proxy_pass http://127.0.0.1:5250;
+ }
+ location = /.well-known/agent.json {
+ limit_except GET HEAD { deny all; }
+ proxy_pass http://127.0.0.1:5250;
+ }
+
# The release manifest open tabs poll (no-cache, set by the app) to update in place.
# The release manifest open tabs poll (no-cache, set by the app) to update in place.
location = /release.json {
location = /release.json {
limit_except GET HEAD { deny all; }
limit_except GET HEAD { deny all; }
@@ -37,7 +37,9 @@ test('only the page and its files, the API, the machine answers and the sign-in
@@ -37,7 +37,9 @@ test('only the page and its files, the API, the machine answers and the sign-in
.filter(([, body]) => /proxy_pass\s+http:\/\/127\.0\.0\.1:5250;/.test(body))
.filter(([, body]) => /proxy_pass\s+http:\/\/127\.0\.0\.1:5250;/.test(body))
.map(([name]) => name)
.map(([name]) => name)
.sort();
.sort();
- assert.deepStrictEqual(proxied, ['/', '^/(css|js|shared)/', '^/inbox(/[A-Za-z0-9_-]+)?$', '/api/health', '/api/ready', '/api/v1/', '/auth/', '/auth/me', '/release.json'].sort());
+ assert.deepStrictEqual(proxied, ['/', '^/(css|js|shared)/', '^/inbox(/[A-Za-z0-9_-]+)?$', '/api/health', '/api/ready', '/api/v1/', '/auth/', '/auth/me', '/release.json',
+ // 11-09: the agent files, the owner's provider panel and the report page answered nginx's 404 though the app serves them.
+ '^/(llms\\.txt|llms-full\\.txt|openapi\\.json)$', '/.well-known/agent.json', '/admin/mail/providers', '^/report/[0-9a-f-]+$'].sort());
// A proxy anywhere else (a generic /api/ or / catch-all) would expose more than the door above.
// A proxy anywhere else (a generic /api/ or / catch-all) would expose more than the door above.
assert.strictEqual((CONF.match(/proxy_pass\s+/g) || []).length, proxied.length,
assert.strictEqual((CONF.match(/proxy_pass\s+/g) || []).length, proxied.length,