openvibers/openvibe.ai Commits
Proxy the creation catalogue through the AI vhost (#425)
Changes
@@@ -187,6 +187,25 @@ server {proxy_read_timeout 300s;}++ # ── What AI can make (ai.creation-list@1): public, cached and CORS open, for the site, an app or a++ # page. The app answers the same ACAO * on a preflight, so OPTIONS is proxied like the GETs. ──++ location = /api/v1/creations {++ proxy_pass http://127.0.0.1:4700;++ proxy_set_header Host $host;++ proxy_set_header X-Real-IP $remote_addr;++ proxy_set_header X-Forwarded-For $remote_addr;++ proxy_set_header CF-Connecting-IP $remote_addr;++ proxy_set_header X-Forwarded-Proto $scheme;++ }++ location = /api/v1/creations.md {++ proxy_pass http://127.0.0.1:4700;++ proxy_set_header Host $host;++ proxy_set_header X-Real-IP $remote_addr;++ proxy_set_header X-Forwarded-For $remote_addr;++ proxy_set_header CF-Connecting-IP $remote_addr;++ proxy_set_header X-Forwarded-Proto $scheme;++ }++# ── Unknown API paths: a problem document, never a page; the API itself stays host-local ──location /api/ {default_type application/problem+json;@@@ -108,7 +108,7 @@ const active = (file) => fs.readFileSync(path.join(__dirname, '..', 'deploy', 'nt.test('the vhost still proxies the API, the run receipt and the console; the app answers and redirects the pages', () => {const conf = active('ai.openvibe.services.conf');-- for (const loc of ['location = /stats', 'location = /updates', 'location = /terms', 'location = /privacy', 'location = /dmca', 'location = /sitemap.xml', 'location = /llms.txt', 'location /runs/ {', 'location /console {', 'location /auth/ {', 'location /shared/']) assert.ok(conf.includes(loc), loc);++ for (const loc of ['location = /stats', 'location = /updates', 'location = /terms', 'location = /privacy', 'location = /dmca', 'location = /sitemap.xml', 'location = /llms.txt', 'location = /api/v1/creations ', 'location = /api/v1/creations.md ', 'location /runs/ {', 'location /console {', 'location /auth/ {', 'location /shared/']) assert.ok(conf.includes(loc), loc);const ops = conf.indexOf('location ~ ^/api/v1/(chat|generate|summarize|classify|extract|embed)$ {');const run = conf.indexOf('location ~ ^/api/v1/runs/[A-Za-z0-9_-]+$ {');const completions = conf.indexOf('location = /v1/chat/completions {');
@@ -187,6 +187,25 @@ server {
@@ -187,6 +187,25 @@ server {
proxy_read_timeout 300s;
proxy_read_timeout 300s;
}
}
+ # ── What AI can make (ai.creation-list@1): public, cached and CORS open, for the site, an app or a
+ # page. The app answers the same ACAO * on a preflight, so OPTIONS is proxied like the GETs. ──
+ location = /api/v1/creations {
+ proxy_pass http://127.0.0.1:4700;
+ proxy_set_header Host $host;
+ proxy_set_header X-Real-IP $remote_addr;
+ proxy_set_header X-Forwarded-For $remote_addr;
+ proxy_set_header CF-Connecting-IP $remote_addr;
+ proxy_set_header X-Forwarded-Proto $scheme;
+ }
+ location = /api/v1/creations.md {
+ proxy_pass http://127.0.0.1:4700;
+ proxy_set_header Host $host;
+ proxy_set_header X-Real-IP $remote_addr;
+ proxy_set_header X-Forwarded-For $remote_addr;
+ proxy_set_header CF-Connecting-IP $remote_addr;
+ proxy_set_header X-Forwarded-Proto $scheme;
+ }
+
# ── Unknown API paths: a problem document, never a page; the API itself stays host-local ──
# ── Unknown API paths: a problem document, never a page; the API itself stays host-local ──
location /api/ {
location /api/ {
default_type application/problem+json;
default_type application/problem+json;
@@ -108,7 +108,7 @@ const active = (file) => fs.readFileSync(path.join(__dirname, '..', 'deploy', 'n
@@ -108,7 +108,7 @@ const active = (file) => fs.readFileSync(path.join(__dirname, '..', 'deploy', 'n
t.test('the vhost still proxies the API, the run receipt and the console; the app answers and redirects the pages', () => {
t.test('the vhost still proxies the API, the run receipt and the console; the app answers and redirects the pages', () => {
const conf = active('ai.openvibe.services.conf');
const conf = active('ai.openvibe.services.conf');
- for (const loc of ['location = /stats', 'location = /updates', 'location = /terms', 'location = /privacy', 'location = /dmca', 'location = /sitemap.xml', 'location = /llms.txt', 'location /runs/ {', 'location /console {', 'location /auth/ {', 'location /shared/']) assert.ok(conf.includes(loc), loc);
+ for (const loc of ['location = /stats', 'location = /updates', 'location = /terms', 'location = /privacy', 'location = /dmca', 'location = /sitemap.xml', 'location = /llms.txt', 'location = /api/v1/creations ', 'location = /api/v1/creations.md ', 'location /runs/ {', 'location /console {', 'location /auth/ {', 'location /shared/']) assert.ok(conf.includes(loc), loc);
const ops = conf.indexOf('location ~ ^/api/v1/(chat|generate|summarize|classify|extract|embed)$ {');
const ops = conf.indexOf('location ~ ^/api/v1/(chat|generate|summarize|classify|extract|embed)$ {');
const run = conf.indexOf('location ~ ^/api/v1/runs/[A-Za-z0-9_-]+$ {');
const run = conf.indexOf('location ~ ^/api/v1/runs/[A-Za-z0-9_-]+$ {');
const completions = conf.indexOf('location = /v1/chat/completions {');
const completions = conf.indexOf('location = /v1/chat/completions {');