openvibers/openvibe.host Commits

Add Computer host service inventory (#335)

OP OpenVibers committed 5 days ago · a5700abd56 · 4 files, +56 −2

* Add Computer host service inventory

* Include Computer in host inventory test

Changes

ddiff --git a/deploy/systemd/openvibe-browsercheck.service b/deploy/systemd/openvibe-browsercheck.service
iindex 5ee5e04..5237969 100644
---- a/deploy/systemd/openvibe-browsercheck.service
++++ b/deploy/systemd/openvibe-browsercheck.service
@@@ -9,7 +9,7 @@ Type=oneshot
# Root reads the state and writes the textfile metrics; Chrome runs as the unprivileged ovcheck account
# (runuser), never as root. --sites names the watched services (inventory origin or manifest publicOrigin).
User=root
--ExecStart=/usr/local/bin/ovhost browser-watch --sites live,network,tools,media,community,chat,games,blog,wiki,codes,host,ai,billing,search,sources,news,reviews,deals,coupons,trade,openre,space,bot,events,services,actor,watch,run,food,help,work,quest,rent,media-hub,inventory,play,zone,tips,vip,design,exchange,report,vision,fun,shoes,bench,cam,domains,meme,surf,today,tours,mail
++ExecStart=/usr/local/bin/ovhost browser-watch --sites live,network,tools,media,community,chat,games,blog,wiki,codes,host,ai,billing,search,sources,news,reviews,deals,coupons,trade,openre,space,bot,events,services,actor,watch,run,food,help,work,quest,rent,media-hub,inventory,play,zone,tips,vip,design,exchange,report,vision,fun,shoes,bench,cam,domains,meme,surf,today,tours,mail,computer
Environment=PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
Environment=OVHOST_INVENTORY=/etc/openvibe/host.json
Nice=10
ddiff --git a/host.example.json b/host.example.json
iindex 81ddc25..33e7d85 100644
---- a/host.example.json
++++ b/host.example.json
@@@ -3050,6 +3050,36 @@
]
}
},
++ "computer": {
++ "_note": "Added 2026-11-08: OpenVibe.Computer is the thin front door over Run; it keeps no session state of its own.",
++ "repo": "/opt/openvibe.computer",
++ "units": [
++ "openvibe-computer.service"
++ ],
++ "unitSources": {
++ "openvibe-computer.service": "deploy/systemd/openvibe-computer.service"
++ },
++ "envFile": "/etc/openvibe/computer.env",
++ "env": {
++ "required": "from-example"
++ },
++ "port": 5135,
++ "ready": {
++ "url": "http://127.0.0.1:5135/api/health",
++ "timeoutSeconds": 15
++ },
++ "noRestartPaths": [
++ "docs/",
++ "test/",
++ "**/*.md"
++ ],
++ "origin": "https://openvibe.computer",
++ "nginx": {
++ "vhost": "openvibe.computer.conf",
++ "repoVhost": "deploy/nginx/openvibe.computer.conf",
++ "variant": "http"
++ }
++ },
"services": {
"_note": "Added 2026-10-07 (plan T13): OpenVibe.Services on loopback :4930.",
"repo": "/opt/openvibe.services",
ddiff --git a/test/cli-inventory.test.js b/test/cli-inventory.test.js
iindex 7304210..7bc9576 100644
---- a/test/cli-inventory.test.js
++++ b/test/cli-inventory.test.js
@@@ -19,7 +19,7 @@ runTests([
const inv = normalise(raw);
// Every service on the host (2026-10-15): Sites retired, and the fourteen added since the first copy of this file.
assert.deepStrictEqual(Object.keys(inv.services), ['network', 'live', 'media', 'tools', 'community', 'events', 'games', 'host', 'billing', 'chat', 'search', 'sources', 'wiki', 'blog', 'tips', 'vip', 'news', 'reviews', 'deals', 'coupons', 'trade', 'codes', 'ai', 'bot', 'openre',
-- 'actor', 'food', 'help', 'work', 'quest', 'rent', 'media-hub', 'inventory', 'play', 'zone', 'watch', 'run', 'services', 'space',
++ 'actor', 'food', 'help', 'work', 'quest', 'rent', 'media-hub', 'inventory', 'play', 'zone', 'watch', 'run', 'computer', 'services', 'space',
'design', 'exchange', 'report', 'vision', 'fun', 'shoes', 'bench', 'cam', 'domains', 'meme', 'surf', 'today', 'tours', 'mail']);
assert.ok(Object.values(inv.services).filter((s) => s.databases.length).every((s) => s.drill), 'every service with a database has a restore drill');
assert.strictEqual(inv.services.live.socketUnit, 'openvibe-live.socket');
ddiff --git a/test/computer-service.test.js b/test/computer-service.test.js
nnew file mode 100644
iindex 0000000..845c7ad
---- /dev/null
++++ b/test/computer-service.test.js
@@@ -0,0 +1,24 @@
++'use strict';
++const assert = require('node:assert/strict');
++const fs = require('node:fs');
++const path = require('node:path');
++const { normalise } = require('../lib/inventory');
++const { test, runTests } = require('./helpers');
++
++const inventory = JSON.parse(fs.readFileSync(path.join(__dirname, '..', 'host.example.json'), 'utf8'));
++const service = normalise(inventory).services.computer;
++
++runTests([
++ test('Computer can be initialized by ovhost service add on its allocated ports', () => {
++ assert.equal(service.repo, '/opt/openvibe.computer');
++ assert.deepEqual(service.units, ['openvibe-computer.service']);
++ assert.equal(service.envFile, '/etc/openvibe/computer.env');
++ assert.equal(service.port, 5135);
++ assert.equal(service.origin, 'https://openvibe.computer');
++ assert.equal(service.nginx.repoVhost, 'deploy/nginx/openvibe.computer.conf');
++ assert.equal(service.ready.url, 'http://127.0.0.1:5135/api/health');
++ const servicePorts = Object.values(inventory.services).map((s) => s.port).filter(Boolean);
++ assert.equal(servicePorts.filter((p) => p === service.port).length, 1, 'service port is unique');
++ assert.equal(service.databases.length, 0, 'Computer stores no data to restore or drill');
++ }),
++]);