41f07b6ad8
Browser-based feed selection layered on top of config/feeds.php: - manage.php (password + CSRF gated, session based): add subreddits (name / r/name / URL) and YouTube channels (@handle / UC id / URL, handle resolved to channel_id once, youtube.com only); enable/disable toggles; remove manual feeds; config feeds are hidden, not deleted. - New feeds are validated with one immediate fetch (bypassing the per-refresh host cap): HTTP 404 rejects the entry, 429 keeps it for a later refresh. YouTube labels adopt the real channel title. - feeds table gains origin (config|manual) and enabled columns, with a guarded ALTER migration for existing databases. - Only enabled feeds are refreshed and served: getItems/countItems filter by feed_url in enabled feeds, so deselected feeds' cached stories are hidden, not deleted; re-adding a URL re-enables it. - Dashboard header gets a Manage link; manage page styled with the existing design tokens; README documents the feature.
44 lines
1.4 KiB
PHP
44 lines
1.4 KiB
PHP
<?php
|
|
|
|
return [
|
|
// SQLite database location (kept outside the web root).
|
|
'db_path' => dirname(__DIR__) . '/data/feeds.sqlite',
|
|
|
|
// Seconds before a feed is considered stale and re-fetched on demand.
|
|
'cache_ttl' => 1800,
|
|
|
|
// Shorter retry interval for feeds whose last fetch failed (e.g. rate limited).
|
|
'error_retry_ttl' => 120,
|
|
|
|
// Minimum milliseconds between requests to the same host.
|
|
'host_interval_ms' => 1000,
|
|
|
|
// Hosts with aggressive rate limits: only fetch this many of their feeds per refresh.
|
|
'throttled_hosts' => ['www.reddit.com'],
|
|
'throttled_host_max_per_refresh' => 1,
|
|
|
|
// Number of items per page.
|
|
'page_size' => 20,
|
|
|
|
// Time-range filters (key => window length in seconds), shown newest-first.
|
|
'ranges' => [
|
|
'1h' => 3600,
|
|
'2h' => 7200,
|
|
'6h' => 21600,
|
|
'24h' => 86400,
|
|
'7d' => 604800,
|
|
],
|
|
|
|
// HTTP client settings.
|
|
'request_timeout' => 15,
|
|
'connect_timeout' => 10,
|
|
|
|
// Identify the client to feed providers (important for Reddit).
|
|
'user_agent' => 'RSSFeed/1.0 (+https://localhost; contact: admin@localhost)',
|
|
|
|
// Password for manage.php (manual subreddit/channel configuration).
|
|
// Accepts a plain password or a password_hash() value; empty disables the
|
|
// manage page entirely. Change this before exposing the app publicly.
|
|
'manage_password' => 'rssfeed-admin',
|
|
];
|