Sources, Tracked Items, Categories, Settings/Connections, Telegram credentials, and every widget's own settings/data can now be exported as a single zip from a new Backup tab (GET /api/admin/backup/export) and loaded onto a fresh instance (POST /api/admin/backup/import) to reproduce the same configuration — deliberately excludes ingested items, published articles, media, tags, logs, and synthesis history, none of which is "how this instance is configured". Widget tables are discovered generically via the existing widget_<id>_ naming convention (reused from widgets/sweep.ts) rather than hardcoded per widget, so an uploaded (non-builtin) widget's code travels too, not just built-ins. Import is full-replace, gated behind an explicit confirm() describing the consequences. The one real FK in the schema (content_items.source_id ON DELETE CASCADE) would otherwise let replacing sources silently wipe that instance's own ingested content as a side effect — the import transaction runs with `PRAGMA foreign_keys = OFF` specifically to prevent that, verified directly (seeded content_items, ran an import that replaced their source, confirmed they survived). Telegram credentials stay encrypted in the zip: the still-encrypted row travels with the instance's .encryption-key file (exported from storage/crypto.ts) rather than ever writing the secret out as plaintext.
34 lines
903 B
JSON
34 lines
903 B
JSON
{
|
|
"name": "homefeed-backend",
|
|
"version": "1.0.0",
|
|
"description": "Homefeed backend — ingestion, clustering, synthesis, and the public/admin API",
|
|
"type": "module",
|
|
"main": "dist/index.js",
|
|
"scripts": {
|
|
"dev": "tsx watch --env-file=.env src/index.ts",
|
|
"build": "tsc",
|
|
"start": "node --experimental-sqlite dist/index.js",
|
|
"typecheck": "tsc --noEmit"
|
|
},
|
|
"license": "UNLICENSED",
|
|
"dependencies": {
|
|
"@fastify/cookie": "^11.1.2",
|
|
"@fastify/cors": "^11.3.0",
|
|
"@fastify/multipart": "^10.1.1",
|
|
"@mozilla/readability": "^0.6.0",
|
|
"adm-zip": "^0.6.0",
|
|
"fastify": "^5.10.0",
|
|
"jsdom": "^29.1.1",
|
|
"rss-parser": "^3.13.0",
|
|
"telegram": "^2.26.22",
|
|
"undici": "^7.28.0"
|
|
},
|
|
"devDependencies": {
|
|
"@types/adm-zip": "^0.5.8",
|
|
"@types/jsdom": "^28.0.3",
|
|
"@types/node": "^26.1.1",
|
|
"tsx": "^4.23.0",
|
|
"typescript": "^7.0.2"
|
|
}
|
|
}
|