Commit Graph
19 Commits
Author SHA1 Message Date
LeoVasanko 37e9ab2cd2 llm_translator: one line per rule, extended-Markdown rules, <translate>/<context> markers
Prompt rules are single-line bullets now (no wrapped continuation lines).
Added the extended-Markdown rules the site syntax needs: all formatting
is syntax and is preserved exactly (only the text is translated), and
single newlines inside paragraphs render as actual line breaks, so line
structure must survive untranslated. The payload is no longer wrapped in
a ```markdown fence — the site's extended syntax (and this document
renderer) makes fences unreliable as delimiters; instead an explicit
sentence marks the instruction/text boundary and the payload rides in
faux <translate> tags (<context> for the hybrid-neighbor reference
blocks). unwrap_output strips echoed markers, still also a whole-output
fence. Re-verified live against ollama qwen3.8:27b: title + article jobs,
URL/code fence/{dates} preserved.
2026-09-21 00:50:45 +00:00
LeoVasanko 42609a54c1 import_translation: read the input file outside the event loop (ruff ASYNC230/SIM115) 2026-09-20 23:47:28 +00:00
LeoVasanko 277a75ae23 scripts/import_translation.py: import human-made whole-article translations
Decomposes a pasted full translation with the same align_article
validation as article-mode LLM results and stores proper Data.trans
fragments, instead of the translation editor's one monolithic patch that
silently goes stale hunk by hunk. Runs against the kanta database
directly, with the server stopped. Verified on a scratch copy of the
localhost db: swe/app fi (qwen3.8 trial output) imports 43/43 blocks and
serves through the hybrid; the degenerate qwen3-next output is rejected
on anchor validation.
2026-09-20 23:23:37 +00:00
LeoVasanko f1324e8387 scripts/llm_translator.py: instruct-LLM translator client (markdown + article modes)
OpenAI Chat Completions shape for llama.cpp/hosted APIs, ollama native
/api/chat via api="ollama" — ollama's /v1 endpoint silently ignores
think:false (verified on 0.34.2: reasoning ran despite the flag), which
hybrid models need off. Prompts and sampling from the /tmp/llmtrial
evidence (strict structure rules, temperature 0.2, num_predict capped at
~2.5x estimated source tokens); whole-output fence unwrapping and
single-line enforcement for titles are client-side. Config via JSON +
CLI overrides; pagerite itself carries no LLM specifics.
2026-09-20 23:22:27 +00:00
LeoVasanko 1f5e52505f Double Ctrl-C or other situation could cause ugly traceback, avoid that situation by exiting quietly on CancelledError and KeyboardInterrupt. 2026-09-20 01:14:47 +00:00
LeoVasanko b004fcd644 Upgrade fastapi-vue-setup 1.7.2. 2026-09-18 19:14:14 +00:00
LeoVasanko 02396f4482 Update fastapi-vue-setup 1.7.1, make use of its logging facilities. Mediapreview and kanta bumped to do so too. 2026-09-18 03:58:37 +00:00
LeoVasanko 4cd8dbfc73 Update fastapi-vue-setup 1.6.1 2026-09-15 05:20:57 +00:00
LeoVasanko 65fec6c519 Drop the startup translator-URL log line; the key and URL are shown in the site settings UI. 2026-09-03 14:42:02 +00:00
LeoVasanko 4413c7efdf Cleanup: break up the massive app.py into separate modules of manageable size. 2026-09-03 13:36:29 +00:00
LeoVasanko d3e2196c83 Localization (#1)
Implement comprehensive content localization, admin panels for editing each language, AI translation interface with automatic updates when base language version is changed.
- SEO tags for all language URLs
- Uses accept-language by default, ?lang=en overrides temporarily
- User edits patched on top of translations
- RTL language supportReviewed-on: #1
2026-09-03 03:54:27 +00:00
LeoVasanko 7a4544731d Fastapi-vue-setup updated to 1.4.0: prettier logs. 2026-08-31 20:50:38 +00:00
LeoVasanko f341d22aa0 Improved fake traffic generation with abuse bots, utm tags etc. 2026-08-21 20:10:41 +00:00
LeoVasanko ff553d018a Default scheme, host and port for fake_traffic script. 2026-08-21 02:52:53 +00:00
LeoVasanko 9c383c1c8b Change default port mapping to 8100/8200/8210 (prod/vite/dev). Vite gets different port to avoid caching problems when switching between it and prod. 2026-08-21 02:49:18 +00:00
LeoVasanko 242b62784c Add fake traffic generator script
Uses Playwright to drive Chromium through real internal link clicks,
so pagerite.js analytics pings create normal visits. Also fires HTTP
GETs with crawler user-agents to record crawler hits.

Features:
- script-local deps via uv add --script (playwright, httpx)
- rotating pool of real public IPs via X-Forwarded-For
- Poisson inter-arrival delays between sessions/hits
- configurable browsers, crawlers, clicks, and dwell time
2026-08-20 23:37:02 +00:00
LeoVasanko dcd1e5afc9 Prepare for forward-auth; edit buttons and functions conditional on server 401, login button if needed. 2026-08-17 03:58:59 +00:00
LeoVasanko 53d98f0583 Restructure internal URL prefixes from /_/... to /_...
- Move API routes from /_/api/ to /_api/
- Move uploaded files from /_/f/ to /_f/
- Move built assets from /_/assets/ to /_assets/
- Move admin shell from /_/admin to /_admin
- Update Vite proxy/build config, frontend fetches/WebSockets, devserver health URL, seed content, and docs
- Fix README database name to pagerite.kantadb
2026-08-16 20:04:16 +00:00
LeoVasanko 36b250a15c Pagerite: single-user CMS/blog
FastAPI backend rendering HTML with html5tagger, content persisted in a
kanta database and rendered per request. Vue only for the editing tools
(page editor over a WebSocket, site/structure editor); public pages are
plain HTML with fetch navigation. No auth: single trusted author.
2026-08-16 05:49:38 +00:00