Commit graph

95 commits

Author SHA1 Message Date
af50334a7b Fix tests for code media type, add source URL and lore 2026-01-02 13:41:10 -05:00
4bab2ce503 Restore crawl disabled in neopig bootstrap 2026-01-02 13:18:45 -05:00
7440a28399 Enable crawling in neopig service bootstrap 2026-01-02 12:59:51 -05:00
7fae521dba Add code, font, and style file crawling support
- Add CODE_EXTENSIONS for 50+ code file types (.py, .js, .rs, .go, etc.)
- Add FONT_EXTENSIONS (.woff, .woff2, .ttf, .otf, .eot)
- Add STYLE_EXTENSIONS (.css, .scss, .sass, .less)
- Add corresponding MIME type sets for detection
- Extract from <link> tags (stylesheets, preload fonts)
- Extract from <script src> tags for JavaScript
- Extract @font-face URLs from inline style blocks
- Make import resilient to missing tables in source archives
2026-01-02 12:54:30 -05:00
e2a556f7a4 Add error column to CrawlJob and make import resilient to missing tables 2026-01-02 12:43:16 -05:00
59f05245d9 Fix database method names for import job status updates 2026-01-02 12:35:24 -05:00
2c116c0e84 Update frontend to use resumable upload with auto-retry 2026-01-02 12:26:06 -05:00
1f39f95a95 Add resumable upload API for large file uploads 2026-01-02 12:22:08 -05:00
24a83741f1 Add missing os import for NEOPIG_SANDBOX env var 2026-01-02 11:55:35 -05:00
e60436bfc2 modified: .gitignore 2026-01-02 11:52:32 -05:00
52952a104a modified: CLAUDE.md
modified:   archive.py
	new file:   bootstrap-neopig.sh
	modified:   bootstrap.c
	modified:   serp.py
2026-01-02 11:51:42 -05:00
17feb3d50b Add --host argument to neopig.py --serve for binding to specific interfaces 2026-01-02 10:54:00 -05:00
8b2d370c55 Update README and about page with new features
- Hydra mode: RSS/Atom/Sitemap feed discovery and persistence
- Media provenance: first_seen_at, last_seen_at, discovered_at tracking
- Job purge: --purge-job CLI and DELETE API endpoint
- Updated feature grid on about page
- Added code examples for hydra and purge
2026-01-01 16:56:41 -05:00
44345af1c6 Fix purge endpoint: use DB_PATH/VAULT_PATH globals 2026-01-01 16:52:34 -05:00
59e7ad5669 Add job purge: delete all traces of a crawl job
Order of operations (critical for data integrity):
1. Get job info and collect hashes/URIs to delete
2. Delete MediaSource records (breaks references)
3. Delete Page records
4. Delete orphan Media records (not referenced by other jobs)
5. Delete orphan media files from vault
6. Delete screenshot files for deleted pages
7. Delete CrawlJob record
8. Delete state files

CLI: python neopig.py --purge-job JOB_ID
API: DELETE /api/crawl/jobs/{job_id}?purge=true (default)
UI: Delete button now purges by default
2026-01-01 16:47:59 -05:00
e61b9cfd04 Track media first_seen_at and last_seen_at timestamps
- Add last_seen_at column to Media table (updated on every encounter)
- first_seen_at tracks initial discovery
- last_seen_at tracks most recent sighting
- MediaSource.discovered_at already tracks per-page first link time
- Enables tracking media reuse across the web
2026-01-01 16:41:52 -05:00
6491a2763f Fix fetch_results typo and handle None paths in Uri.path
- async_web_fetcher: fetch_results -> fetch_tasks (undefined variable)
- neopig: Handle None Uri.path with (parsed.path or '').lstrip('/')
2026-01-01 16:26:08 -05:00
19cd3317aa Allow depth 0 and -1 in crawl UI (0=single page, -1=unlimited) 2026-01-01 16:21:45 -05:00
648842301f Use Uri.hostname instead of Uri.host 2026-01-01 16:10:34 -05:00
eaf21d58d2 modified: bootstrap.c 2026-01-01 16:07:10 -05:00
17efcf9a27 Archive improvements: venv support, package-only mode, resume fixes
- bootstrap.c: Extract requirements.txt, create venv, pip install deps
- archive.py: Add --package-only flag, use neopig vault directly
- archive.py: Resume now loads crawled pages from DB
- database.py: Add close() and get_crawled_page_uris()
- domain_vault.py: Fix None path handling in url_to_filepath
- Makefile: Add test-alpha target for testing archives
2026-01-01 15:57:23 -05:00
e00034c39b Hydra: persist feeds per-domain, self-heal on every crawl
- Store discovered RSS/Atom/Sitemap feed URLs in hydra-{domain}.json
- ALWAYS check known feeds on every crawl (self-healing)
- --hydra flag discovers NEW feeds, adds them to persistent list
- fetch_feeds() accepts feed_urls param for known feeds
- Tracks which feeds actually return items for persistence
2026-01-01 15:54:04 -05:00
ffdbdaad68 Add hydra state persistence for delta URL detection
- Hydra state file (hydra-{domain}.json) never rotates
- Tracks seen URLs with first_seen timestamp, title, published date
- _filter_new_hydra_urls() returns only NEW URLs not seen before
- Enables detecting new posts when sites publish via RSS/Atom/Sitemap
2026-01-01 15:49:04 -05:00
abc3c101da Add hydra mode for RSS/Atom/Sitemap feed discovery
- --hydra CLI flag and UI checkbox (off by default)
- discover_feeds(): finds RSS/Atom links and common sitemap URLs
- parse_rss(), parse_atom(), parse_sitemap(): extract URLs from feeds
- fetch_feeds(): async method to fetch and parse all discovered feeds
- hydra_urls injected into crawl queue with high priority (score 100)
- Supports nested sitemaps (sitemap index files)
2026-01-01 15:34:53 -05:00
750b6ee07c Fix crawl job resume settings + progress bar shows actual %
- Store depth, max_pages, fast, screenshots in crawl_jobs table
- Resume uses stored settings instead of hardcoded defaults
- Progress bar shows pages_crawled / total instead of animation
2026-01-01 09:09:03 -05:00
d05bb5993b Move job logging to neopig.py - always log for both CLI and web UI 2026-01-01 09:01:14 -05:00
a2144cd84e Fast mode: parallel page fetching with 3x CPU workers
- fetch_with_depth now uses asyncio.gather for parallel page fetches
- Semaphore limits concurrency to 3x CPU count in fast mode, 1 otherwise
- Pre-filters candidates before batch fetch to optimize
- Logs parallel fetch info when using multiple workers
2026-01-01 08:53:13 -05:00
f89249e29e Add console button to view crawler logs per job
- Per-job log capture to data/logs/{job_id}.log
- /api/crawl/jobs/{id}/logs endpoint to fetch logs
- Console button on each job card in crawl UI
- Modal with auto-scrolling, color-coded log levels
- Logs refresh every 2s while viewing running jobs
2026-01-01 08:19:25 -05:00
a78177be42 Simplify: remove aside from noise selector entirely 2026-01-01 08:10:29 -05:00
9c5737a2c8 Fix html2md: preserve Discourse quote blocks (aside.quote) 2026-01-01 08:08:36 -05:00
97ce3050ca Fix avatar: detect # placeholder and show initial instead 2026-01-01 07:54:32 -05:00
70c14e02da Fix view/page CSS: add missing BASE_CSS 2026-01-01 07:49:42 -05:00
30fcf5a820 Fix i18n: remove {{{{ patterns, use string concat 2026-01-01 07:44:49 -05:00
908e7b1f3e Add i18n for meta labels, page titles, and job display 2026-01-01 07:06:54 -05:00
c5f90f026c Add max_pages and select_domain keys to all 20 languages 2026-01-01 06:47:43 -05:00
2ee3172a3d Add sources key to 19 languages, translate stats display 2026-01-01 06:45:24 -05:00
7ef8e43c19 Add more i18n: subtitles, stat labels, page headers
- Added keys: hydrate_subtitle, live_subtitle, total_images, new_session, per_minute, all_domains, download_phantom, phantom_subtitle
- Updated crawl page subtitle
- Updated live page: title, subtitle, stat labels, filter options
- Updated phantom page: subtitle, domain dropdown, download button
- Fixed jobs loading placeholder to use {{loading}}
2026-01-01 06:31:12 -05:00
c1c33c6ce6 Complete i18n: add new translation keys to all 20 languages
- Added translation keys: no_media, no_more, load_error, copy, copied, starting, started_ok, error, watching, content, previous, next, over_9000, loading_stats, screenshot, valid_uri, load_jobs_error
- Updated Thai, Indonesian, Ukrainian, Swedish with all new keys
- Replaced hardcoded English in JavaScript with T.* references
- Updated search page: pagination, no results messages, loading stats
- Updated crawl page: form validation, error messages, button states
- Updated live page: watching status, pause/resume buttons
- Updated view page: Content and Screenshot headers with {{key}} placeholders
2026-01-01 06:14:10 -05:00
04f4161e07 Add layout() function for unified page wrapper, refactor search page 2025-12-31 19:36:05 -05:00
cd2d786865 Unify nav into single NAV_HTML source of truth, complete i18n for 20 langs 2025-12-31 19:29:21 -05:00
54975667f3 Fix i18n: handle both single and double brace placeholders from f-strings 2025-12-31 19:21:15 -05:00
65a6aad3ab Add i18n support with 20 languages and language chooser
- 20 languages: en, zh, es, hi, ar, pt, ru, ja, fr, de, ko, it, nl, pl, tr, vi, th, id, uk, sv
- Language dropdown in nav bar with native names (中文, 日本語, 한국어, etc.)
- Cookie persistence (lang cookie, 1 year expiry)
- localStorage backup (neopig_lang)
- Accept-Language header fallback for auto-detection
- All pages updated: search, crawl, live, view, page, phantom, about
2025-12-31 19:19:04 -05:00
007a390845 Fix: external links incorrectly rewritten to /view/ due to filename match
The filename fallback lookup was matching external links like
https://pypi.org/project/virt-back/ because the filename 'virt-back'
matched a media file in the database.

Now:
1. Filename fallback only applies to URLs with media extensions
2. href rewriting only applies to exact URI matches or media file URLs
3. External links are preserved as-is
2025-12-31 18:25:29 -05:00
75a9b27fae Fix: page media was filtering out all PNGs instead of just screenshots
Changed filter from mime_type != 'image/png' to media_type != 'screenshot'
2025-12-31 18:21:15 -05:00
b85d99a231 Show duration on completed crawl jobs 2025-12-31 18:13:15 -05:00
0a5762fbc4 Fix: header/logo images were not downloaded due to soup mutation
The page_content extraction was decomposing nav/header/footer from the
soup BEFORE media extraction, causing header/logo images to be missed.

Now uses a fresh BeautifulSoup parse of the body for text extraction,
preserving the original soup for media extraction.
2025-12-31 18:01:27 -05:00
2e48e83c9f Add formatBytes function to crawl UI 2025-12-31 17:49:30 -05:00
d8b44d4f21 Add error handling for job list JSON parsing to prevent silent failures 2025-12-31 17:41:46 -05:00
1e25c8d3d0 Default crawl mode to 'media' (all media) in UI 2025-12-31 17:38:38 -05:00
a3ad7abfb9 Fix crawl job stats: add screenshots, dupes, bytes to completed jobs 2025-12-31 17:36:09 -05:00