Commit graph

96 commits

Author SHA1 Message Date
blankie
4189bd7f24 rns: store cleaned text instead of raw HTML body 2026-07-02 23:27:05 +00:00
blankie
ba1b8a783a base tag + LRU cache for RNS browse, sync status fixes 2026-06-19 02:17:11 +00:00
blankie
8f46878151 rns browser, standalone site server, unified add form
- /rns/<hash>/<path> proxies pages over RNS with link rewriting
- fetch_remote_page() in rns_client.py for generic RNS page fetching
- mesh_sites table for persisting saved hashes
- standalone site_server.py with its own RNS identity
- tinyweb-site/index.html: SPA with RSS-aware nav (/rns/<hash>/ prefix)
- unified /add form: single input accepts URL or 32-char RNS hash
- RNS add indexes into pages table (fetch root page, extract title/desc)
- rns:<hash> URLs displayed in browse/search, linked to /rns/<hash>/
- expand RNS whitelist: allow GET /, /about, /pages, /tags, /share
2026-06-18 20:38:42 +00:00
blankie
99a939e22f forum trust circle: trust-gated content exchange via subscription graph 2026-06-17 20:16:30 +00:00
blankie
8ae2dc53cd fix: app.py gateway import alias (broken since src layout migration) 2026-06-17 20:16:06 +00:00
blankie
34f6eeef3f forum trust circle: trust-gated content exchange via subscription graph 2026-06-17 20:15:50 +00:00
blankie
f3bfe50abc readme: update project structure to reflect src layout 2026-06-17 05:16:34 +00:00
blankie
0669aaf3a0 src layout: move core code into src/tinyweb/ package
- Moved app.py, db.py, gateway.py, templates.py, embeddings.py,
  rns_client.py, and handlers/ into src/tinyweb/
- Created root app.py shim (adds src/ to sys.path, imports main)
- Created pyproject.toml with setuptools config (where = ["src"])
- Added src/tinyweb/__init__.py
- Updated all internal imports to use tinyweb. prefix (73 occurrences)
- Removed sys.path.insert hack from conftest.py
- Updated Dockerfile: pip install -e /app before running
- Updated gateway.py usage message: python -m tinyweb.gateway
- Updated README.md gateway usage instructions
2026-06-17 05:03:23 +00:00
blankie
afbd3c89c1 junimo theme: use {{site_name}} and {{forum_link}} placeholders 2026-06-16 05:23:24 +00:00
blankie
467e6e8e7d remove demo pages, rename themes, add Content-Length header 2026-06-16 05:11:37 +00:00
blankie
ddab9f62c4 auto-save: settings save on change via /style/field, noscript fallback button 2026-06-14 08:46:21 +00:00
blankie
c77e992768 customize: split into separate settings and template forms 2026-06-14 08:14:43 +00:00
blankie
56a53e8b08 customize: move save button above html textarea, add unsaved changes indicator 2026-06-14 08:12:10 +00:00
blankie
bef95fd901 template: remove forum css from DEFAULT_TEMPLATE (injected at render time) 2026-06-14 08:05:20 +00:00
blankie
d0c2c25a22 template: add {{nav}} placeholder, separate from {{content}} 2026-06-14 08:00:57 +00:00
blankie
0f3f8490c4 docker: fix data persistence with TINYWEB_DATA_DIR env var 2026-06-14 07:48:34 +00:00
blankie
a6bde0aa87 bookmarklet: use dynamic host and scheme from request headers 2026-06-14 07:43:26 +00:00
blankie
810fd701f0 simplify: move subscribe form to GET /subscriptions/add 2026-06-14 07:36:37 +00:00
blankie
f61278f8b8 Revert "simplify: move subscribe form to GET /subscriptions/add"
This reverts commit 25e24efbfa.
2026-06-14 07:33:38 +00:00
blankie
93686d71c3 simplify: move subscribe form to GET /subscriptions/add 2026-06-14 07:32:58 +00:00
blankie
6ecb4802ce readme: remove duplicate forum section 2026-06-09 05:58:55 +00:00
blankie
91eec45bbb search: match by tag; add: handle ssl errors with manual entry 2026-06-09 05:35:54 +00:00
blankie
0527237e23 restructure README: expand getting started, demote Docker 2026-06-09 03:18:23 +00:00
blankie
72b0478cb6 add CONTRIBUTING.md and issue template 2026-06-09 03:15:55 +00:00
blankie
804c5701c7 add SECURITY.md 2026-06-09 03:11:43 +00:00
blankie
728be053fb README: add transparency sections, TOC, update project structure 2026-06-09 03:06:38 +00:00
blankie
94f4b2d28a split handlers.py into handlers/ package
- _helpers.py: CSRF, FTS sanitizer, pagination, response helpers, tag helpers
- search.py: BM25 + hybrid search, trusted/remote result rendering
- pages.py: add/edit/delete/bulk/bookmark handlers
- subscriptions.py: sync, share preview, API sites, subscription CRUD
- customize.py: settings form, about page
- tags.py: tag list and tag browse handlers
- data.py: export, import, semantic reindex handlers
- __init__.py: dispatch, re-exports, forum_plugin, _request_local

All 58 external symbols re-exported. No changes to app.py, conftest.py,
or any test file.
2026-06-09 02:34:04 +00:00
blankie
f8b5b0a964 add .env.example for environment configuration 2026-06-09 02:14:17 +00:00
blankie
997dd20e49 point repo URLs to Codeberg instead of self-hosted Gitea 2026-06-09 01:41:41 +00:00
blankie
1aaa88b06a clean up: remove unused start.sh/pyinstaller.spec, deduplicate constants, update .gitignore 2026-06-09 01:16:54 +00:00
blankie
8504aa0d72 remove forgejo CI workflow (no releases) 2026-06-09 01:08:39 +00:00
blankie
88af4d85be threaded HTTP server, rate limiting, remove slow-web rhetoric 2026-06-09 01:07:36 +00:00
blankie
207475a495 rewrite README — descriptive tone, remove releases/philosophy sections 2026-06-09 01:07:09 +00:00
blankie
ccf896200d move forum layout CSS to main site template system
- Remove FORUM_CSS_DEFAULT/KODAMA2 and _forum_css() from forum handlers
- Add FORUM_CSS constant to templates.py with layout-only forum CSS
- Inject forum CSS into any template's <head> via wrap_page()
- Add forum layout styles to kodama2.html theme
- Update database custom template
2026-06-06 01:41:41 +00:00
blankie
947491b8f4 added tinyweb-site theme 2026-06-05 05:29:36 +00:00
blankie
fc9fb167ae added site_name placeholder to templates 2026-06-05 05:29:36 +00:00
blankie
99ad8cdd11 hid forum link when disabled 2026-06-05 05:29:36 +00:00
blankie
f23829666c updated forum README with auto-discovery 2026-06-05 05:29:36 +00:00
blankie
a0db0b3d07 integrated the forum plugin 2026-06-05 05:29:36 +00:00
blankie
a17fe7471e reworked to distribute via clone, not registry 2026-06-05 05:29:36 +00:00
blankie
eb57ce79b6 fixed Docker socket mount 2026-06-05 05:29:36 +00:00
blankie
b1a7e38ede switched to host-mode Docker 2026-06-05 05:29:36 +00:00
blankie
53bfedb69a fixed CI: Docker in container 2026-06-05 05:29:36 +00:00
blankie
42f9cd3434 fixed CI: install jq for release 2026-06-05 05:29:36 +00:00
blankie
2582383160 fixed CI: --break-system-packages 2026-06-05 05:29:36 +00:00
blankie
029ed533f2 fixed CI: use apt-get for Python 2026-06-05 05:29:36 +00:00
blankie
2c29434752 added pytest test suite (174 tests)
174 tests covering URL normalization, FTS5 query sanitization, SSRF/CSRF
guards, sharing-mode logic, DB schema and upsert paths, handler
end-to-end flows, and gateway body-size / mesh-whitelist guards. Each
recent bug-fix commit (6ffd38d, 1bc695f, 8dffd8c) has an explicit
regression test in test_regressions.py. One xfail documents a minor
latent bug in clean_url where port 80 is not stripped from upgraded
https URLs.
2026-06-05 05:29:36 +00:00
blankie
357f1f7b3d added data-loss guards + first-run state
- Bulk delete now routes through a server-rendered confirmation page
  listing the selected titles; a `confirmed=1` form field is required
  before pages are actually deleted. Mirrors the single-delete flow.
- Reset-template button gains a JS confirm() so stray clicks don't wipe
  the custom template.
- Homepage shows a short, neutral empty-state block when the index has
  zero pages and no query — just names what tinyweb is and links to
  /add, /style, and /subscriptions as equal options.
- /about gains a "your data" section explaining what lives in
  ~/.tinyweb/ (identity file, index.db), what losing each costs, and
  how /export differs from a full backup.
- README gains a "Backups" subsection mirroring the /about copy.
2026-06-05 05:29:36 +00:00
blankie
d97ffa6b78 tightened network defaults, squashed bugs
Security:
- Bind HTTP gateway to 127.0.0.1 by default; add --bind for LAN opt-in
- Restrict Reticulum mesh surface to GET /api/sites only (CSRF cannot
  authenticate mesh callers, so gate by whitelist)
- Cap request body size at 16 MiB to prevent memory DoS
- Redact /bookmark query strings from request logs so the bookmark token
  and URLs do not land in stdout / docker / journal logs
- Tighten FTS5 sanitizer: strip colon, drop AND/OR/NOT/NEAR operator words
- Expand .dockerignore; document trust model in README

Features:
- Add sharing mode toggle (share everything except private vs share only
  public-tagged) with /share/preview so users can see what subscribers
  would receive before enabling sharing

Bugs:
- handle_export() crashed on every call (missing query kwarg)
- Dead float16 decompression branch in embeddings.py silently corrupted
  the HNSW index when compress_embeddings was on
- GATEWAY_PORT staleness: --port and find_available_port had no effect
  on the actual bind
- semantic_search default mismatched between db.py ("1") and the rest of
  the app ("0"), causing embeddings to be generated when the UI said off
- Connection pool returned connections with uncommitted transactions to
  the next consumer
- Gateway POST body decode 502'd on non-UTF-8 input
- ensure_rns_config clobbered user-edited ~/.reticulum/config; now only
  rewrites files it authored (sentinel-tagged)
2026-06-05 05:29:36 +00:00
blankie
a2bec7915b added LoRa sync with settings UI
- Progressive retry in rns_client.py: fast timeout (15s) then slow (60s+)
  for LoRa/multi-hop links, with automatic fallback
- Background sync threads so subscriptions page returns immediately
  with syncing/error status indicators per subscription
- LoRa RNode configuration in settings page with serial port and
  expandable advanced radio settings (frequency, bandwidth, etc.)
- Internet transport now toggleable alongside LoRa — users can
  enable one, the other, or both
- Reticulum config auto-generated from settings on startup
2026-06-05 05:29:36 +00:00