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
feat: add backup exclude paths to skip large/derived data from backups
Adam Eivyaeec608a1a2f
diff --git a/.changelog/NEXT.md b/.changelog/NEXT.mdindex 976366e1a8..6bb0ade872 100644--- a/.changelog/NEXT.md+++ b/.changelog/NEXT.md@@ -2,7 +2,7 @@## Added-- Settings page (`/settings`) with backup configuration (destination path, enabled toggle, cron schedule)+- Settings page (`/settings`) with backup configuration (destination path, enabled toggle, cron schedule, exclude paths)- GitHub repos management page under Dev Tools > GitHub- Sync repos from GitHub via `gh repo list`- Toggle repos as NPM projects (auto-manages NPM_TOKEN secret)diff --git a/client/src/pages/Settings.jsx b/client/src/pages/Settings.jsxindex d6b039aafa..aa2d73c2d1 100644--- a/client/src/pages/Settings.jsx+++ b/client/src/pages/Settings.jsx@@ -1,5 +1,5 @@import { useState, useEffect } from 'react';-import { Save } from 'lucide-react';+import { Save, Plus, X } from 'lucide-react';import toast from 'react-hot-toast';import BrailleSpinner from '../components/BrailleSpinner';import { getSettings, updateSettings } from '../services/api';@@ -10,6 +10,8 @@ export default function Settings() {const [destPath, setDestPath] = useState('');const [enabled, setEnabled] = useState(false);const [cronExpression, setCronExpression] = useState('0 2 * * *');+ const [excludePaths, setExcludePaths] = useState([]);+ const [newExclude, setNewExclude] = useState('');useEffect(() => {getSettings().then(settings => {@@ -17,17 +19,29 @@ export default function Settings() {setDestPath(backup.destPath || '');setEnabled(backup.enabled ?? false);setCronExpression(backup.cronExpression || '0 2 * * *');+ setExcludePaths(backup.excludePaths || []);}).catch(() => {}).finally(() => setLoading(false));}, []);const handleSave = async () => {setSaving(true);- await updateSettings({ backup: { destPath, enabled, cronExpression } })+ await updateSettings({ backup: { destPath, enabled, cronExpression, excludePaths } }).then(() => toast.success('Settings saved')).catch(() => {}).finally(() => setSaving(false));};+ const addExclude = () => {+ const trimmed = newExclude.trim();+ if (!trimmed || excludePaths.includes(trimmed)) return;+ setExcludePaths([...excludePaths, trimmed]);+ setNewExclude('');+ };++ const removeExclude = (index) => {+ setExcludePaths(excludePaths.filter((_, i) => i !== index));+ };+if (loading) {return (<div className="flex items-center justify-center h-64">@@ -76,6 +90,40 @@ export default function Settings() {<p className="text-xs text-gray-500">Default: 2:00 AM daily</p></div>+ <div className="space-y-2">+ <label className="block text-sm text-gray-400">Exclude Paths</label>+ <p className="text-xs text-gray-500">Directories/patterns to skip during backup (relative to data/)</p>+ <div className="flex gap-2">+ <input+ type="text"+ value={newExclude}+ onChange={e => setNewExclude(e.target.value)}+ onKeyDown={e => e.key === 'Enter' && addExclude()}+ className="flex-1 bg-port-bg border border-port-border rounded-lg px-3 py-2 text-sm text-white focus:outline-none focus:border-port-accent"+ placeholder="repos/"+ />+ <button+ onClick={addExclude}+ disabled={!newExclude.trim()}+ className="px-3 py-2 bg-port-border hover:bg-port-border/70 text-white rounded-lg transition-colors disabled:opacity-50"+ >+ <Plus size={16} />+ </button>+ </div>+ {excludePaths.length > 0 && (+ <div className="flex flex-wrap gap-2 mt-2">+ {excludePaths.map((path, i) => (+ <span key={i} className="inline-flex items-center gap-1.5 px-2.5 py-1 bg-port-bg border border-port-border rounded-lg text-sm text-gray-300">+ <code className="text-xs">{path}</code>+ <button onClick={() => removeExclude(i)} className="text-gray-500 hover:text-port-error transition-colors">+ <X size={14} />+ </button>+ </span>+ ))}+ </div>+ )}+ </div>+<buttononClick={handleSave}disabled={saving}diff --git a/server/routes/backup.js b/server/routes/backup.jsindex d87def856e..85d36e6ac0 100644--- a/server/routes/backup.js+++ b/server/routes/backup.js@@ -21,8 +21,9 @@ router.post('/run', asyncHandler(async (req, res) => {if (!destPath) {return res.status(400).json({ error: 'BACKUP_NOT_CONFIGURED', message: 'No backup destination configured in settings' });}+ const excludePaths = settings.backup?.excludePaths || [];const io = req.app.get('io');- const result = await backup.runBackup(destPath, io);+ const result = await backup.runBackup(destPath, io, { excludePaths });res.json(result);}));diff --git a/server/services/backup.js b/server/services/backup.jsindex ea1e3a4e09..1c93219453 100644--- a/server/services/backup.js+++ b/server/services/backup.js@@ -79,7 +79,7 @@ function runRsync(srcDir, destDir, flags = []) {* @param {string} destPath - Path to external drive backup root* @param {object|null} io - Socket.IO instance for real-time events (optional)*/-export async function runBackup(destPath, io = null) {+export async function runBackup(destPath, io = null, { excludePaths = [] } = {}) {if (isRunning) {console.log('💾 Backup already running — skipping');return { skipped: true };@@ -98,7 +98,7 @@ export async function runBackup(destPath, io = null) {const snapshotDir = join(destPath, 'snapshots', snapshotId);const dataDestDir = join(snapshotDir, 'data');- console.log(`💾 Backup starting: snapshot ${snapshotId}`);+ console.log(`💾 Backup starting: snapshot ${snapshotId}${excludePaths.length ? ` (excluding ${excludePaths.length} paths)` : ''}`);if (io) io.emit('backup:started', { snapshotId });await ensureDir(dataDestDir);@@ -117,7 +117,8 @@ export async function runBackup(destPath, io = null) {throw err;};- changedFiles = await runRsync(PATHS.data, dataDestDir).catch(fail);+ const excludeFlags = excludePaths.filter(Boolean).flatMap(p => ['--exclude', p]);+ changedFiles = await runRsync(PATHS.data, dataDestDir, excludeFlags).catch(fail);console.log(`💾 Backup rsync complete: ${changedFiles.length} files changed (exit 0)`);manifest = await generateManifest(dataDestDir, join(snapshotDir, 'manifest.json')).catch(fail);diff --git a/server/services/backupScheduler.js b/server/services/backupScheduler.jsindex 07f6531642..3e03170a2e 100644--- a/server/services/backupScheduler.js+++ b/server/services/backupScheduler.js@@ -29,6 +29,7 @@ export async function startBackupScheduler() {const cronExpression = settings.backup?.cronExpression || '0 2 * * *';const destPath = settings.backup.destPath;+ const excludePaths = settings.backup?.excludePaths || [];schedule({id: 'backup-daily',@@ -36,7 +37,7 @@ export async function startBackupScheduler() {cron: cronExpression,handler: async () => {console.log('💾 Backup scheduler: running scheduled backup');- await runBackup(destPath);+ await runBackup(destPath, null, { excludePaths });},metadata: { source: 'backupScheduler' }});