Self-hosted, Self-Improving, Federated Everything App — dev management, agent orchestration, persistent mind, digital twin, second brain, and creative pipeline from a single dashboard over Tailscale to port the user into the OS
JavaScript ai-agentsdashboarddeveloper-toolsdigital-twinquantified-selfsecond-brainself-hostedtailscale
fix: align default PortOS manifest with production processes
[._.]/ Adam Eivy85d06e9223ce
diff --git a/data.reference/apps.json b/data.reference/apps.jsonindex e5d13d6d10..81fef619e7 100644--- a/data.reference/apps.json+++ b/data.reference/apps.json@@ -7,14 +7,15 @@"repoPath": "__PORTOS_ROOT__","type": "express","uiPort": 5555,- "apiPort": 5554,+ "apiPort": 5555,+ "devUiPort": 5554,+ "buildCommand": "npm run build","startCommands": [- "npm run dev"+ "npm start"],"pm2ProcessNames": ["portos-server","portos-cos",- "portos-ui","portos-autofixer","portos-autofixer-ui","portos-browser"@@ -28,19 +29,14 @@"processes": [{"name": "portos-server",- "port": 5554,- "ports": { "api": 5554 }+ "port": 5555,+ "ports": { "api": 5555 }},{"name": "portos-cos","port": 5558,"ports": { "api": 5558 }},- {- "name": "portos-ui",- "port": 5555,- "ports": { "ui": 5555 }- },{"name": "portos-autofixer","port": 5559,diff --git a/docs/PORTS.md b/docs/PORTS.mdindex 3e8be1b901..c622f09fea 100644--- a/docs/PORTS.md+++ b/docs/PORTS.md@@ -180,7 +180,7 @@ The PortOS apps list (returned by `GET /api/apps`) shows registered PM2 processe- Single port: `process-name:5555`- Multiple ports: `process-name (cdp:5556,health:5557)`-Note that `GET /api/apps` only returns PM2 processes defined in `server/services/apps.js` (`portos-server`, `portos-cos`, `portos-ui`, `portos-autofixer`, `portos-autofixer-ui`, `portos-browser`). Infrastructure dependencies like `portos-db` (Docker container on port 5561, managed via `scripts/setup-db.js` / Docker Compose) are not PM2 processes and do not appear in `GET /api/apps`.+Note that `GET /api/apps` only returns PM2 processes defined in `server/services/apps.js` (`portos-server`, `portos-cos`, `portos-autofixer`, `portos-autofixer-ui`, `portos-browser` for the default PortOS app). Development-only `portos-ui` is not an expected production process. Infrastructure dependencies like `portos-db` (Docker container on port 5561, managed via `scripts/setup-db.js` / Docker Compose) are not PM2 processes and do not appear in `GET /api/apps`.Use the API to get detailed port information for registered PM2 processes:```bashdiff --git a/server/services/apps.js b/server/services/apps.jsindex f128ea5db9..e80a4ac58e 100644--- a/server/services/apps.js+++ b/server/services/apps.js@@ -43,10 +43,10 @@ function buildPortosApp() {tlsPort: certPresent ? PORTS.API : null,buildCommand: 'npm run build',startCommands: ['npm start'],+ // Match npm start: Vite is development-only, not an expected production process.pm2ProcessNames: ['portos-server','portos-cos',- 'portos-ui','portos-autofixer','portos-autofixer-ui','portos-browser'@@ -57,7 +57,6 @@ function buildPortosApp() {// there and Overview would otherwise show a dead port.{ name: 'portos-server', port: PORTS.API, ports: certPresent ? { api: PORTS.API, 'api-local': PORTS.API_LOCAL } : { api: PORTS.API } },{ name: 'portos-cos', port: PORTS.COS, ports: { api: PORTS.COS } },- { name: 'portos-ui', port: PORTS.UI, ports: { devUi: PORTS.UI } },{ name: 'portos-autofixer', port: PORTS.AUTOFIXER, ports: { api: PORTS.AUTOFIXER } },{ name: 'portos-autofixer-ui', port: PORTS.AUTOFIXER_UI, ports: { ui: PORTS.AUTOFIXER_UI } },{ name: 'portos-browser', port: PORTS.CDP, ports: { cdp: PORTS.CDP, health: PORTS.CDP_HEALTH } }diff --git a/server/services/apps.test.js b/server/services/apps.test.jsindex f77a89fa88..397994a7fd 100644--- a/server/services/apps.test.js+++ b/server/services/apps.test.js@@ -1,3 +1,4 @@+import { readFileSync } from 'node:fs';import { describe, it, expect, vi, beforeEach } from 'vitest';vi.mock('fs/promises', () => ({@@ -440,3 +441,37 @@ describe('__PORTOS_ROOT__ placeholder expansion on load', () => {expect(persisted.apps['other-app'].appIconPath).toBe('/mock/root/icon.png');});});+++describe('PortOS production process manifest', () => {+ beforeEach(() => {+ invalidateCache();+ vi.clearAllMocks();+ });++ it.each([false, true])('matches production startup and repairs legacy manifests (existing: %s)', async (existing) => {+ const seed = JSON.parse(readFileSync(new URL('../../data.reference/apps.json', import.meta.url), 'utf8')).apps[PORTOS_APP_ID];+ const scripts = JSON.parse(readFileSync(new URL('../../package.json', import.meta.url), 'utf8')).scripts;+ const expectedNames = scripts.start.match(/--only "([^"]+)"/)[1].split(',');+ readJSONFile.mockResolvedValue({ apps: existing ? {+ [PORTOS_APP_ID]: {+ ...seed,+ description: 'Custom description',+ pm2ProcessNames: [...expectedNames, 'portos-ui'],+ processes: [...seed.processes, { name: 'portos-ui', port: 5554 }],+ },+ } : {} });++ const app = (await getAllApps()).find(({ id }) => id === PORTOS_APP_ID);+ expect(app.pm2ProcessNames).toEqual(expectedNames);+ expect(app.processes.map(({ name }) => name)).toEqual(expectedNames);+ expect(app).toMatchObject({ uiPort: 5555, apiPort: 5555, devUiPort: 5554, startCommands: ['npm start'] });+ expect(app.processes[0]).toMatchObject({ name: 'portos-server', port: 5555, ports: { api: 5555 } });+ expect(seed.pm2ProcessNames).toEqual(expectedNames);+ expect(seed.processes.map(({ name }) => name)).toEqual(expectedNames);+ expect(seed).toMatchObject({ uiPort: app.uiPort, apiPort: app.apiPort, devUiPort: app.devUiPort, startCommands: app.startCommands, buildCommand: app.buildCommand });+ expect(seed.processes[0]).toEqual(app.processes[0]);+ if (existing) expect(app.description).toBe('Custom description');+ expect(atomicWrite.mock.calls.at(-1)[1].apps[PORTOS_APP_ID].pm2ProcessNames).toEqual(expectedNames);+ });+});