b5e155fb72
Categories can now be marked "Private" in the admin panel's Category priority list. Private categories (and every article tagged with one, even if it's also tagged with a public category) are hidden from /api/categories, /api/feed, and /api/article/:id for anyone without a valid login — a plain visitor's browser, not the admin API key, since that's a header-based credential for the admin SPA only. Login is a single shared password set via PRIVATE_ACCESS_PASSWORD in the backend's .env (unset by default, which disables the feature entirely). On success the backend sets a stateless httpOnly cookie — its value is a deterministic hash of the password, checked with a timing-safe comparison on every request, so there's no session table to maintain. The cookie is requested at the ~400-day cap browsers enforce on persistent cookies, the closest a cookie can get to "retained indefinitely." On the frontend, an always-visible lock icon in the masthead (shown whenever the feature is configured, independent of the admin panel's own enabled/disabled toggle) opens a password prompt and reflects locked/unlocked state. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_014c1L8ghNBFjfiH64UMViP8
29 lines
756 B
JSON
29 lines
756 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",
|
|
"@mozilla/readability": "^0.6.0",
|
|
"fastify": "^5.10.0",
|
|
"jsdom": "^29.1.1",
|
|
"rss-parser": "^3.13.0"
|
|
},
|
|
"devDependencies": {
|
|
"@types/jsdom": "^28.0.3",
|
|
"@types/node": "^26.1.1",
|
|
"tsx": "^4.23.0",
|
|
"typescript": "^7.0.2"
|
|
}
|
|
}
|