openvibers/openvibe.exchange Commits
Move comparison links and vhost to Compare (#194)
Changes
@@@ -1,9 +1,8 @@## ═══════════════════════════════════════════════════════════════## openvibe.compare — reference vhost for ov-vhost-install.##--## The comparison site is served by OpenVibe.Exchange's process on 127.0.0.1:5150 (the same app, behind its own--## name: server/http/compare-site.js). This vhost passes the name through in Host, which is what makes the request--## the compare site's; every other name reaches Exchange's own pages. No proxy_cache: the app decides cacheability.++## Compare now runs in OpenVibe.Compare on port 5280. Kept here so an Exchange deployment++## cannot restore the retired shared-process target. Canonical vhost: OpenVibe.Compare/deploy/nginx/.## ═══════════════════════════════════════════════════════════════limit_req_zone $binary_remote_addr zone=compare_auth:10m rate=10r/m;@@@ -68,26 +67,26 @@ server {location = /auth/me {limit_req zone=compare_api burst=30 nodelay;limit_req_status 429;-- proxy_pass http://127.0.0.1:5150;++ proxy_pass http://127.0.0.1:5280;}location /auth/ {limit_req zone=compare_auth burst=10 nodelay;limit_req_status 429;-- proxy_pass http://127.0.0.1:5150;++ proxy_pass http://127.0.0.1:5280;}location /api/ {limit_req zone=compare_api burst=20 nodelay;limit_req_status 429;-- proxy_pass http://127.0.0.1:5150;++ proxy_pass http://127.0.0.1:5280;}# A reader's remark is the only form on the site.location = /remarks {limit_req zone=compare_forms burst=10 nodelay;limit_req_status 429;-- proxy_pass http://127.0.0.1:5150;++ proxy_pass http://127.0.0.1:5280;}# Host-local scrapers only; OpenVibe.Events' account delivery is loopback-only.@@@ -95,7 +94,7 @@ server {location ~* ^/internal(/|$) { return 404; }location / {-- proxy_pass http://127.0.0.1:5150;++ proxy_pass http://127.0.0.1:5280;}location ~ /\.(?!well-known) {@@@ -383,7 +383,7 @@ ${kit.head({ title: model.name, sub: `${familyLabel(model)}${model.variant ? `${stats.length ? kit.stats(stats) : ''}${model.description ? `<p class="ex-prose">${esc(model.description)}</p>` : ''}${panel({ title: 'Every offer that serves it', note: 'Price in, out and cached per million tokens; speed and uptime from the last seven days of real requests; the privacy label and the provider’s own data policy.', id: 'offers', body: kit.table({ columns, rows, label: `Offers for ${model.name}`, empty: 'No live offer serves this model right now.' }) })}--<p class="ex-more"><a href="https://openvibe.compare/models/${String(model.slug).split('/').map(encodeURIComponent).join('/')}">Compare ${esc(model.name)} with another model →</a></p>++<p class="ex-more"><a href="https://openvibe.compare/things/${encodeURIComponent(model.slug)}">Compare ${esc(model.name)} with another model →</a></p>${activityPanel(model.activity)}${require('./analysis').modelFacts(analysis)}${panel({ title: 'Presets', note: 'A preset fixes the router’s floor, ceiling and policy, and you name it as the model.', id: 'presets', body: presetsBox() })}@@@ -30,7 +30,7 @@ const best = (m) =>const chat = (m) =>`https://openvibe.chat/vibe?models=${encodeURIComponent(id(m))}`;const rank = (m) =>-- `https://openvibe.report/ai/models/${encodeURIComponent(id(m))}`;++ `https://openvibe.compare/things/${encodeURIComponent(id(m))}`;const section = (title, body) => kit.section({ title, body });const code = (m) =>kit.snippet({@@@ -153,11 +153,12 @@ const { createFakeAi } = require('./helpers/ai');assert.strictEqual(talk.status, 303, talk.text.slice(0, 200));chatId = String(talk.headers.get('location')).split('/').pop();ttsCalls.length = 0;-- const sent = await t.get('/talk/' + chatId + '/send', { as: alice, form: { text: 'Hello Ada' } });++ const voiceToken = t.network.userToken(alice);++ const sent = await t.get('/talk/' + chatId + '/send', { as: alice, cookie: `exchange_at=${voiceToken}`, form: { text: 'Hello Ada' } });assert.strictEqual(sent.status, 303);assert.strictEqual(ttsCalls.length, 1, 'the answer is read aloud exactly once');assert.strictEqual(ttsCalls[0].body.voice, 'gary', 'in the voice the card names');-- assert.strictEqual(ttsCalls[0].auth, 'Bearer ' + t.network.userToken(alice), 'the call carries the person\'s own token');++ assert.strictEqual(ttsCalls[0].auth, 'Bearer ' + voiceToken, 'the call carries the person\'s own token');const page = await t.get('/talk/' + chatId, { as: alice });assert.strictEqual((page.text.match(/<audio/g) || []).length, 1, 'one sound on the page');assert.ok(page.text.includes('voice: gary'));
@@ -1,9 +1,8 @@
@@ -1,9 +1,8 @@
## ═══════════════════════════════════════════════════════════════
## ═══════════════════════════════════════════════════════════════
## openvibe.compare — reference vhost for ov-vhost-install.
## openvibe.compare — reference vhost for ov-vhost-install.
##
##
-## The comparison site is served by OpenVibe.Exchange's process on 127.0.0.1:5150 (the same app, behind its own
-## name: server/http/compare-site.js). This vhost passes the name through in Host, which is what makes the request
-## the compare site's; every other name reaches Exchange's own pages. No proxy_cache: the app decides cacheability.
+## Compare now runs in OpenVibe.Compare on port 5280. Kept here so an Exchange deployment
+## cannot restore the retired shared-process target. Canonical vhost: OpenVibe.Compare/deploy/nginx/.
## ═══════════════════════════════════════════════════════════════
## ═══════════════════════════════════════════════════════════════
limit_req_zone $binary_remote_addr zone=compare_auth:10m rate=10r/m;
limit_req_zone $binary_remote_addr zone=compare_auth:10m rate=10r/m;
@@ -68,26 +67,26 @@ server {
@@ -68,26 +67,26 @@ server {
location = /auth/me {
location = /auth/me {
limit_req zone=compare_api burst=30 nodelay;
limit_req zone=compare_api burst=30 nodelay;
limit_req_status 429;
limit_req_status 429;
- proxy_pass http://127.0.0.1:5150;
+ proxy_pass http://127.0.0.1:5280;
}
}
location /auth/ {
location /auth/ {
limit_req zone=compare_auth burst=10 nodelay;
limit_req zone=compare_auth burst=10 nodelay;
limit_req_status 429;
limit_req_status 429;
- proxy_pass http://127.0.0.1:5150;
+ proxy_pass http://127.0.0.1:5280;
}
}
location /api/ {
location /api/ {
limit_req zone=compare_api burst=20 nodelay;
limit_req zone=compare_api burst=20 nodelay;
limit_req_status 429;
limit_req_status 429;
- proxy_pass http://127.0.0.1:5150;
+ proxy_pass http://127.0.0.1:5280;
}
}
# A reader's remark is the only form on the site.
# A reader's remark is the only form on the site.
location = /remarks {
location = /remarks {
limit_req zone=compare_forms burst=10 nodelay;
limit_req zone=compare_forms burst=10 nodelay;
limit_req_status 429;
limit_req_status 429;
- proxy_pass http://127.0.0.1:5150;
+ proxy_pass http://127.0.0.1:5280;
}
}
# Host-local scrapers only; OpenVibe.Events' account delivery is loopback-only.
# Host-local scrapers only; OpenVibe.Events' account delivery is loopback-only.
@@ -95,7 +94,7 @@ server {
@@ -95,7 +94,7 @@ server {
location ~* ^/internal(/|$) { return 404; }
location ~* ^/internal(/|$) { return 404; }
location / {
location / {
- proxy_pass http://127.0.0.1:5150;
+ proxy_pass http://127.0.0.1:5280;
}
}
location ~ /\.(?!well-known) {
location ~ /\.(?!well-known) {
@@ -383,7 +383,7 @@ ${kit.head({ title: model.name, sub: `${familyLabel(model)}${model.variant ? `
@@ -383,7 +383,7 @@ ${kit.head({ title: model.name, sub: `${familyLabel(model)}${model.variant ? `
${stats.length ? kit.stats(stats) : ''}
${stats.length ? kit.stats(stats) : ''}
${model.description ? `<p class="ex-prose">${esc(model.description)}</p>` : ''}
${model.description ? `<p class="ex-prose">${esc(model.description)}</p>` : ''}
${panel({ title: 'Every offer that serves it', note: 'Price in, out and cached per million tokens; speed and uptime from the last seven days of real requests; the privacy label and the provider’s own data policy.', id: 'offers', body: kit.table({ columns, rows, label: `Offers for ${model.name}`, empty: 'No live offer serves this model right now.' }) })}
${panel({ title: 'Every offer that serves it', note: 'Price in, out and cached per million tokens; speed and uptime from the last seven days of real requests; the privacy label and the provider’s own data policy.', id: 'offers', body: kit.table({ columns, rows, label: `Offers for ${model.name}`, empty: 'No live offer serves this model right now.' }) })}
-<p class="ex-more"><a href="https://openvibe.compare/models/${String(model.slug).split('/').map(encodeURIComponent).join('/')}">Compare ${esc(model.name)} with another model →</a></p>
+<p class="ex-more"><a href="https://openvibe.compare/things/${encodeURIComponent(model.slug)}">Compare ${esc(model.name)} with another model →</a></p>
${activityPanel(model.activity)}
${activityPanel(model.activity)}
${require('./analysis').modelFacts(analysis)}
${require('./analysis').modelFacts(analysis)}
${panel({ title: 'Presets', note: 'A preset fixes the router’s floor, ceiling and policy, and you name it as the model.', id: 'presets', body: presetsBox() })}
${panel({ title: 'Presets', note: 'A preset fixes the router’s floor, ceiling and policy, and you name it as the model.', id: 'presets', body: presetsBox() })}
@@ -30,7 +30,7 @@ const best = (m) =>
@@ -30,7 +30,7 @@ const best = (m) =>
const chat = (m) =>
const chat = (m) =>
`https://openvibe.chat/vibe?models=${encodeURIComponent(id(m))}`;
`https://openvibe.chat/vibe?models=${encodeURIComponent(id(m))}`;
const rank = (m) =>
const rank = (m) =>
- `https://openvibe.report/ai/models/${encodeURIComponent(id(m))}`;
+ `https://openvibe.compare/things/${encodeURIComponent(id(m))}`;
const section = (title, body) => kit.section({ title, body });
const section = (title, body) => kit.section({ title, body });
const code = (m) =>
const code = (m) =>
kit.snippet({
kit.snippet({
@@ -153,11 +153,12 @@ const { createFakeAi } = require('./helpers/ai');
@@ -153,11 +153,12 @@ const { createFakeAi } = require('./helpers/ai');
assert.strictEqual(talk.status, 303, talk.text.slice(0, 200));
assert.strictEqual(talk.status, 303, talk.text.slice(0, 200));
chatId = String(talk.headers.get('location')).split('/').pop();
chatId = String(talk.headers.get('location')).split('/').pop();
ttsCalls.length = 0;
ttsCalls.length = 0;
- const sent = await t.get('/talk/' + chatId + '/send', { as: alice, form: { text: 'Hello Ada' } });
+ const voiceToken = t.network.userToken(alice);
+ const sent = await t.get('/talk/' + chatId + '/send', { as: alice, cookie: `exchange_at=${voiceToken}`, form: { text: 'Hello Ada' } });
assert.strictEqual(sent.status, 303);
assert.strictEqual(sent.status, 303);
assert.strictEqual(ttsCalls.length, 1, 'the answer is read aloud exactly once');
assert.strictEqual(ttsCalls.length, 1, 'the answer is read aloud exactly once');
assert.strictEqual(ttsCalls[0].body.voice, 'gary', 'in the voice the card names');
assert.strictEqual(ttsCalls[0].body.voice, 'gary', 'in the voice the card names');
- assert.strictEqual(ttsCalls[0].auth, 'Bearer ' + t.network.userToken(alice), 'the call carries the person\'s own token');
+ assert.strictEqual(ttsCalls[0].auth, 'Bearer ' + voiceToken, 'the call carries the person\'s own token');
const page = await t.get('/talk/' + chatId, { as: alice });
const page = await t.get('/talk/' + chatId, { as: alice });
assert.strictEqual((page.text.match(/<audio/g) || []).length, 1, 'one sound on the page');
assert.strictEqual((page.text.match(/<audio/g) || []).length, 1, 'one sound on the page');
assert.ok(page.text.includes('voice: gary'));
assert.ok(page.text.includes('voice: gary'));