Skip to content

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

fix: address Better Audit security findings

Adam Eivy32168a22d937
diff --git a/server/lib/db.js b/server/lib/db.js
index 93a47634c4..cc95302209 100644
--- a/server/lib/db.js
+++ b/server/lib/db.js
@@ -10,7 +10,7 @@ import pg from 'pg';
const { Pool } = pg;
if (!process.env.PGPASSWORD) {
- console.warn('⚠️ PGPASSWORD not set, using default database password');
+ console.warn('⚠️ PGPASSWORD not set — database queries will fail until it is configured');
}
// Connection config from environment or defaults
@@ -19,7 +19,7 @@ const pool = new Pool({
port: parseInt(process.env.PGPORT || '5561', 10),
database: process.env.PGDATABASE || 'portos',
user: process.env.PGUSER || 'portos',
- password: process.env.PGPASSWORD || 'portos',
+ password: process.env.PGPASSWORD,
max: 10,
idleTimeoutMillis: 30000,
connectionTimeoutMillis: 2000
diff --git a/server/routes/cos.js b/server/routes/cos.js
index 46a64471c7..35655f5359 100644
--- a/server/routes/cos.js
+++ b/server/routes/cos.js
@@ -1048,7 +1048,7 @@ router.get('/actionable-insights', asyncHandler(async (req, res) => {
priority: 'high',
icon: 'XCircle',
title: `${blockedCount} blocked task${blockedCount > 1 ? 's' : ''}`,
- description: firstBlocked?.metadata?.blocker || firstBlocked?.description?.substring(0, 80),
+ description: firstBlocked?.metadata?.blocker || firstBlocked?.description?.substring(0, 80) || 'Task is blocked',
action: { label: 'Unblock', route: '/cos/tasks' },
count: blockedCount
});
@@ -1063,7 +1063,7 @@ router.get('/actionable-insights', asyncHandler(async (req, res) => {
priority: criticalIssues.length > 0 ? 'critical' : 'medium',
icon: 'AlertTriangle',
title: `${healthIssues.length} system health issue${healthIssues.length > 1 ? 's' : ''}`,
- description: healthIssues[0]?.message,
+ description: healthIssues[0]?.message ?? 'System health issue detected',
action: { label: 'Check Health', route: '/cos/health' },
count: healthIssues.length
});
@@ -1105,7 +1105,7 @@ router.get('/actionable-insights', asyncHandler(async (req, res) => {
priority: 'info',
icon: 'ListTodo',
title: `${pendingUserTasks.length} pending task${pendingUserTasks.length > 1 ? 's' : ''}`,
- description: pendingUserTasks[0]?.description?.substring(0, 80),
+ description: pendingUserTasks[0]?.description?.substring(0, 80) ?? 'Pending tasks available',
action: { label: 'View Tasks', route: '/cos/tasks' },
count: pendingUserTasks.length
});
diff --git a/server/services/backup.js b/server/services/backup.js
index 7093e38859..7cdf81fb54 100644
--- a/server/services/backup.js
+++ b/server/services/backup.js
@@ -160,7 +160,8 @@ export async function dumpPostgres(outputPath) {
const pgUser = process.env.PGUSER || 'portos';
if (!process.env.PGPASSWORD) {
- console.warn('⚠️ PGPASSWORD not set for pg_dump, using default password');
+ console.error('❌ PGPASSWORD not set — skipping pg_dump');
+ return { success: false, error: 'PGPASSWORD environment variable must be set' };
}
return new Promise((resolve) => {
@@ -174,7 +175,7 @@ export async function dumpPostgres(outputPath) {
'-f', outputPath
], {
shell: false,
- env: { ...process.env, PGPASSWORD: process.env.PGPASSWORD || 'portos' }
+ env: { ...process.env, PGPASSWORD: process.env.PGPASSWORD }
});
let stderr = '';