openvibers/openvibe.chat Commits

Chat: serve its own terms, privacy and DMCA pages (#97)

OP OpenVibers committed 30 days ago · 8414087019 · 2 files, +11 −0

The Frame's footer links each site's own `/terms`, `/privacy` and `/dmca`, and on openvibe.chat all three answered 404 (found by the signed-in browser pass). Chat now serves them through `openvibe-shared/legal` with the `ugc` profile, like Wiki and Food.

`test/discovery.test.js` checks all three answer 200 and name openvibe.chat.

Changes

ddiff --git a/server/web/pages.js b/server/web/pages.js
iindex 2e0a4a5..907726a 100644
---- a/server/web/pages.js
++++ b/server/web/pages.js
@@@ -656,6 +656,8 @@ ${attachList}`,
title: `What shipped on ${SITE_NAME}`, path: '/updates', robots: 'index, follow', cache: cache.htmlHeaders({ maxAge: 300 }),
body: frame.updatesBody({ service: 'chat', siteName: SITE_NAME }) + `<script src="${ovServe.url('shipped.js')}" defer></script>`,
}));
++ // ── Terms, privacy and DMCA for this site (openvibe-shared/legal): the Frame's footer links them here ──
++ { const legal = require('openvibe-shared/legal'); router.get(legal.PATHS, legal.handler({ id: 'chat', service: 'chat', host: 'openvibe.chat', name: SITE_NAME, profile: 'ugc' })); }
// ── robots.txt, llms.txt, sitemap.xml: server/web/discovery.js, the shared SEO kit ──
router.use(createDiscoveryRoutes({ config }));
ddiff --git a/test/discovery.test.js b/test/discovery.test.js
iindex 4f68c3c..c56defa 100644
---- a/test/discovery.test.js
++++ b/test/discovery.test.js
@@@ -105,4 +105,13 @@ t('the home page carries JSON-LD: WebSite plus the site\'s primary type', async
'the JSON-LD is the same for every reader');
});
++t('/terms, /privacy and /dmca are this site\'s own documents (the Frame\'s footer links them)', async () => {
++ for (const p of ['/terms', '/privacy', '/dmca']) {
++ const r = await req(p);
++ assert.strictEqual(r.status, 200, p);
++ assert.match(r.type, /^text\/html/);
++ assert.ok(r.text.includes('openvibe.chat'), `${p} names openvibe.chat`);
++ }
++});
++
t.run(async () => { if (h && h.close) await h.close(); });