Compare commits

...

3 Commits

Author SHA1 Message Date
dc45779d38 Prune 84 SearXNG engines; images category now sub-1s
Some checks are pending
Pre-commit checks / pre-commit (push) Waiting to run
Python tests / test (push) Waiting to run
Shell tests / shell-tests (push) Waiting to run
Shell tests / arch-tests (push) Waiting to run
kuhy went through the /preferences engine table and selected every erroring
engine (CAPTCHA / access denied / timeout / parsing error / crash) plus the
slow tail, across all nine categories. Applied all of them, keeping only
google cse images for the images category as requested.

Result: unresponsive_engines is now [] in EVERY category. Per-category
latency (q=linux): general 572ms, images 406ms, videos 1378ms, news 455ms,
music 461ms, it 1698ms, science 1338ms, files 584ms, social media 1074ms.

Images went 2.1s -> 406-900ms across 12 queries, still 20 results. The root
cause was not google cse images being slow (1.1s): SearXNG waits for the
SLOWEST engine in a category, so quark images at 2.9s set the floor. Cutting
the others removed the ceiling.

Three engines that were not in the list surfaced as unresponsive only under
load and were pruned with the rest: brave.images, startpage images, kickass.

Corrects a wrong claim from the first pass. I had said general search retained
three working sources because !go returned 20 results and !bi returned 10.
Upstream marks both google and bing "inactive: true", so they answer ONLY to
an explicit bang and were never part of the merged view -- which google cse
has been serving alone all along. The pruning therefore removed only engines
already contributing zero, but general search does have a single point of
failure, so status now prints the !go/!bi fallback when a live search returns
nothing.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Cb77nxXGwFYFM4fyXEQkzG
2026-08-09 17:42:56 +02:00
84d1c6e897 Record browser CSP verification for SearXNG
Closes the one gap left open at deploy time. The strict CSP
(default-src 'none') had only been validated by static asset analysis,
because headless chromium produced empty output on this host and the
browser extension was not connected at the time.

Loaded the live instance in a real browser: front page, text search,
image search and autocomplete all work, and the UNFILTERED console shows
4 messages total -- all benign [PLUGIN] calculator DEBUG lines from
SearXNG's own bundle, zero "Refused to load" CSP violations. The "?"
tiles in image results are upstream 404s, not blocked requests.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Cb77nxXGwFYFM4fyXEQkzG
2026-08-09 17:26:28 +02:00
bd725b21b7 app_icons: add a decision-tree glyph and register untools
The new ~/untools app (guided thinking tools) needs a family launcher icon
rather than the stock Flutter beach one.

The glyph is one node branching into two -- "decompose a problem into parts",
which is the move every one of the app's 25 frameworks makes in some form.
Nodes are hollow rings rather than filled dots so the 72px stroke leaves
visible interior at icon size.

A two-level, seven-node tree was drawn first and rejected on the generator's
own evidence: it reported the glyph overflowing the 560px safe box by
~170x162px, and rendering confirmed the doubled connectors closed up into a
solid mass at launcher size. One clean split survives the mask and still reads
as a hierarchy. Branch spread was then narrowed to clear a residual 44px.

linux=False for this app: its desktop build is the web build in a Chrome
--app window, so there is no GTK app to hand a hicolor PNG to.

Also whitelists com.kuhy.untools in phone_focus_mode/config.sh. That entry is
source-of-truth only -- the current Pixel 6a is not rooted, has no
/data/local/tmp/focus_mode and no running daemon, so nothing was pushed to the
device and no app is being killed there. Kept for the rooted BL9000 phone.

Verified: 44 app_icons tests pass with the package at 100% coverage; the
generator emits 6 assets with no safe-box warning; the rendered icon was
inspected and matches the family; and the resulting APK installed and stayed
alive on 23181JEGR08034.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019hVZ5HfcrcrVzinmjQuQup
2026-08-09 17:23:35 +02:00
7 changed files with 240 additions and 15 deletions

View File

@ -311,7 +311,10 @@ repos:
# English breaks the parsers that match on them.
# `daa` is MediaTek's Download Agent Authentication, a BROM security
# feature named in the mtk_root notes - not a misspelling of "data".
- --ignore-words-list=als,ans,ect,nd,som,sur,te,nam,numer,lew,sie,wil,postion,clen,ther,folow,derrive,ony,tje,noe,theses,crate,doubleclick,wile,tabel,pary,blok,bloc,proces,serwer,parametr,adres,hart,dout,metod,tekst,synonim,grup,mosty,lokal,skalar,milion,nowe,tre,hel,alph,iif,dokument,daa
# `artic` is SearXNG's engine id for the Art Institute of Chicago
# (setup_searxng.sh), not a misspelling of "arctic" - renaming it
# would stop matching the engine.
- --ignore-words-list=als,ans,ect,nd,som,sur,te,nam,numer,lew,sie,wil,postion,clen,ther,folow,derrive,ony,tje,noe,theses,crate,doubleclick,wile,tabel,pary,blok,bloc,proces,serwer,parametr,adres,hart,dout,metod,tekst,synonim,grup,mosty,lokal,skalar,milion,nowe,tre,hel,alph,iif,dokument,daa,artic
exclude: ^(Bash/ffmpeg-build/|LaTeX/|.*\.geojson$)
# ===========================================================================

View File

@ -61,6 +61,26 @@
"result": "pass",
"evidence": "All CSS/JS/img/manifest same-origin (/static/...). ZERO inline scripts (the single <script> has src= and passes config via a base64 client_settings attribute). ZERO inline style= attributes. Autocomplete is same-origin /autocompleter (200). JS bundle references zero absolute external origins. Image results use data-src=\"/image_proxy?url=...\" (780 occurrences, same-origin lazy-load) -- external URLs appear only as encoded query params, never as fetch targets, so img-src 'self' data: is safe."
},
{
"command": "engine pruning round 2 (kuhy-selected from /preferences, 9 groups, all categories)",
"result": "pass -- 84 engines disabled, 0 unresponsive in every category",
"evidence": "Disabled every erroring engine (CAPTCHA/access denied/timeout/parsing error/crash) plus the slow tail across general, images, videos, news, music, it, science, files and social media. Three engines NOT in kuhy's list surfaced as unresponsive only under load and were pruned with the rest: brave.images, startpage images, kickass. Post-prune per-category (q=linux): general 572ms/20, images 406ms/20, videos 1378ms/119, news 455ms/52, music 461ms/48, it 1698ms/114, science 1338ms/50, files 584ms/125, social media 1074ms/120 -- unresponsive_engines=[] for ALL nine."
},
{
"command": "images category under 1 second (kuhy's explicit ask)",
"result": "pass -- 406-900ms, was 2.1s",
"evidence": "12 queries measured post-prune: cat 900, dog 343, arch+linux 501, mountain 446, coffee 687, bridge 511, sunset 612, laptop 450, guitar 461, ocean 504, forest 624, city 450 ms -- all sub-1s, still 20 results each. ROOT CAUSE of the old 2.1s was NOT google cse images being slow (1.1s): SearXNG waits for the slowest engine in the category, so quark images at 2.9s set the floor. Removing the other image engines removed the ceiling, and also freed connection-pool contention."
},
{
"command": "general-search single-point-of-failure check (correcting an earlier wrong claim)",
"result": "documented in-file + guarded in status",
"evidence": "Initially asserted general search retained 'three working sources' (google cse + google + bing) because !go returned 20 and !bi returned 10. That was WRONG: upstream marks both google and bing 'inactive: true', so they answer ONLY to an explicit bang and were never in the merged view. The merged general view is served by google cse alone, and was before this pruning too -- so the pruning removed only zero-contribution engines, but general search does have a single point of failure. Comment corrected in settings.yml and status_cmd now prints the !go/!bi fallback if a live search returns 0 results."
},
{
"command": "real browser load + search (Thorium with the Claude extension)",
"result": "pass -- CSP confirmed by a rendering engine, closing the last gap",
"evidence": "Front page renders fully styled (logo, search box, About/Preferences, footer 2026.8.4+cd3835bd2). Text search 'arch linux wiki' returned ArchWiki/Wikipedia/Reddit/LWN/GitHub results in 0.9s with favicons + thumbnails loading. Image search returned hundreds of proxied thumbnails in 2.1s. Autocomplete dropdown fired on typing (a fetch to /autocompleter), proving connect-src 'self'. UNFILTERED console over the whole session: 4 messages, all benign '[PLUGIN] calculator: Running/Done' DEBUG lines from SearXNG's own bundle -- ZERO 'Refused to load/execute/apply' CSP violations. The '?' placeholder tiles in image results are dead upstream URLs (origin 404s), not blocked requests; a CSP block would have logged a Refused-to-load per image."
},
{
"command": "Mozilla Observatory scan (MDN Observatory API v2)",
"result": "pass -- A+ GRADED, not inferred",
@ -95,7 +115,7 @@
],
"risks": [
"JSON API is LOCAL-ONLY by design. format=json works for processes on this host (pass_ip exempts loopback); a scripted client from anywhere else gets 429 because it cannot send Sec-Fetch-* headers. This satisfies an MCP server running on this box, but NOT one calling in from the phone or another machine. Widening it would mean adding that client's IP to pass_ip.",
"NOT YET VERIFIED: real browser load. The strict CSP was validated by static asset analysis, not by a rendering engine (the Chrome extension was not connected and headless chromium produced empty output on this host). A browser load + console check would close this.",
"RESOLVED 2026-08-09: the strict CSP is now confirmed by a real rendering engine (Thorium + Claude extension), not just static analysis -- see verification. No CSP violations on front page, text search, image search, or autocomplete.",
"NOT YET VERIFIED by the user: the phone-on-cellular acceptance test. Note this is now about user acceptance, not about whether the public path works -- see the ACME evidence in verification.",
"brave/duckduckgo/startpage are disabled due to CAPTCHA from this IP. If the IP's reputation changes they could be re-enabled -- re-check with the unresponsive_engines command in settings.yml's comment.",
"pass_ip exempts loopback from ALL botdetection. Any process on this host can query the JSON API unthrottled. Acceptable for a single-user box; would need revisiting if untrusted local services existed.",

View File

@ -0,0 +1,44 @@
{
"intent": "Give the new ~/untools Flutter app a launcher icon from the shared family (charcoal field + accent glyph), so it does not ship the stock Flutter beach icon, and whitelist its package in phone_focus_mode's config.",
"scope": [
"python_pkg/app_icons/glyphs.py — new decision-tree glyph",
"python_pkg/app_icons/apps.py — register the untools app",
"phone_focus_mode/config.sh — add com.kuhy.untools to the productive-apps whitelist",
"Non-goal: no change to render/style/generate; the shared palette and safe-box rules are untouched"
],
"changes": [
"Added _DECISION_TREE: one node branching into two, drawn as hollow rings (r=78) so the 72px stroke leaves visible negative space at icon size. A two-level, seven-node version was tried first and rejected — the generator's safe-box check flagged it as overflowing by ~170x162px, and at 48dp the doubled connectors closed into a solid mass. Branch spread was then narrowed from 324/700 to 346/678 to clear a residual 44px horizontal overflow.",
"Registered the untools AppIcon (accent #B8862E, glyph decision-tree, linux=False because the desktop build is the web build in a Chrome --app window, so there is no GTK app to hand a hicolor PNG to).",
"Added com.kuhy.untools to config.sh's user-requested productive apps. Note this is source-of-truth only: the current Pixel 6a (23181JEGR08034) is not rooted, has no /data/local/tmp/focus_mode directory and no running daemon, so nothing was pushed to the device and no app is at risk of being killed there. Kept for the rooted BL9000 phone / any future redeploy."
],
"verification": [
{
"command": "PYTHONPATH=~/testsAndMisc python3 -m pytest python_pkg/app_icons/tests -q --cov=python_pkg.app_icons",
"result": "pass",
"evidence": "44 passed; app_icons at 100% (apps.py 24/24, glyphs.py 28/28, cli.py 60/60, generate.py 41/41). The repo-wide 5.35% total is the monorepo bar applied to a single-subpackage run, not a regression from this change."
},
{
"command": "PYTHONPATH=~/testsAndMisc python3 -m python_pkg.app_icons generate --app untools --android",
"result": "pass",
"evidence": "wrote 6 asset files to /home/kuhy/untools/assets/icon; regenerated Android mipmaps; no safe-box warning on the final geometry."
},
{
"command": "visual inspection of assets/icon/icon.png and icon_foreground.png",
"result": "pass",
"evidence": "Symmetric tree, three hollow rings holding their negative space, charcoal #211D1B field with #B8862E glyph — consistent with the rest of the family."
},
{
"command": "adb -s 23181JEGR08034 install -r app-release.apk && am start",
"result": "pass",
"evidence": "Installed and launched; app alive after 4s (pid present), confirming no focus-mode interference on this device."
}
],
"risks": [
"The glyph reads as a generic org-chart/hierarchy at very small sizes; it is distinguished from the family's other glyphs by shape, and no other app uses a node-and-edge motif.",
"config.sh now lists a package that is not enforced on the current device. Harmless, but a reader could infer the whitelist is live here when it is not — the comment in this evidence file and the commit message state otherwise."
],
"rollback": [
"Revert the three files; delete ~/untools/assets/icon and the android mipmaps it regenerated.",
"After rollback, re-run the app_icons test suite (44 tests) and confirm the registry test still passes with the untools entry removed."
]
}

View File

@ -279,22 +279,132 @@ ui:
# Re-check periodically with:
# curl -s 'http://127.0.0.1:${SEARX_PORT}/search?q=test&format=json' \\
# | grep -o '"unresponsive_engines":.*'
# Engine pruning, kuhy-selected 2026-08-09 from the /preferences engine table:
# every engine that was erroring (CAPTCHA / access denied / timeout / parsing
# error / crash) plus the slow tail, across all categories.
#
# Retained on purpose: google cse, wikipedia/wikidata and the specialist
# lookups (arch linux wiki, github, stackexchange, pypi, ...).
#
# IMPORTANT about general search: the merged general view is served by
# google cse ALONE, and was before this pruning too. The plain google and bing
# engines are marked "inactive: true" upstream, meaning they only run when
# explicitly invoked with a bang (!go -> 20 results, !bi -> 10, both
# verified working). So the pruning removed only engines that were already
# contributing zero results -- but it also means general search has a single
# point of failure. If google cse ever starts erroring, general search returns
# nothing until another engine is enabled or !go/!bi is used.
#
# pinterest is blackholed to 0.0.0.0 by this host's own /etc/hosts
# (generate_hosts_file.sh) -- a LOCAL failure that looks identical to a dead
# upstream. Disabled to stop the pointless request, not because the engine is bad.
#
# Re-check periodically:
# curl -s 'http://127.0.0.1:8090/search?q=test&format=json' | grep -o '"unresponsive_engines":.*'
engines:
# --- CAPTCHA / actively blocking this IP (100% failure across every query) ---
- name: brave
disabled: true # "Suspended: too many requests" on every query
- name: duckduckgo
disabled: true # CAPTCHA on every query
- name: startpage
disabled: true # "Suspended: CAPTCHA" on every query
# === general ===
- { name: brave, disabled: true } # too many requests
- { name: duckduckgo, disabled: true } # CAPTCHA
- { name: startpage, disabled: true } # Suspended: CAPTCHA
- { name: dogpile, disabled: true } # access denied
- { name: encyclosearch, disabled: true } # timeout
- { name: fastbot, disabled: true } # access denied
- { name: fireball, disabled: true } # access denied
- { name: quark, disabled: true } # unexpected crash
- { name: qwant, disabled: true } # CAPTCHA
- { name: sogou, disabled: true } # CAPTCHA
- { name: tusksearch, disabled: true } # HTTP error
- { name: yahoo, disabled: true } # HTTP protocol error
- { name: yep, disabled: true } # access denied
- { name: naver, disabled: true } # 1.9s
- { name: baidu, disabled: true } # 1.7s
- { name: abcnyheter, disabled: true } # 1.5s
- { name: boardreader, disabled: true } # 1.5s
- { name: crowdview, disabled: true } # 1.0s
# --- blocked locally, not upstream ---
- name: pinterest
disabled: true # 0.0.0.0 in /etc/hosts on this host
# === images === (keeping ONLY google cse images)
- { name: dogpile images, disabled: true } # access denied
- { name: findfiles images, disabled: true } # unexpected crash
- { name: library of congress, disabled: true } # parsing error
- { name: pinterest, disabled: true } # 0.0.0.0 in /etc/hosts (local)
- { name: qwant images, disabled: true } # CAPTCHA
- { name: tusksearch images, disabled: true } # HTTP error
- { name: wikicommons.images, disabled: true } # too many requests
- { name: yandex images, disabled: true } # parsing error
- { name: quark images, disabled: true } # 2.9s
- { name: 1x, disabled: true } # 2.5s
- { name: baidu images, disabled: true } # 2.5s
- { name: picjumbo, disabled: true } # 2.4s
- { name: naver images, disabled: true } # 2.3s
- { name: sogou images, disabled: true } # 2.0s
- { name: unsplash, disabled: true } # 1.2s
- { name: duckduckgo images, disabled: true }
- { name: flickr, disabled: true } # 1.0s
- { name: bing images, disabled: true } # cut for the sub-1s images goal
- { name: deviantart, disabled: true } # cut for the sub-1s images goal
- { name: openverse, disabled: true } # cut for the sub-1s images goal
- { name: pexels, disabled: true } # cut for the sub-1s images goal
- { name: artic, disabled: true } # cut for the sub-1s images goal
- { name: devicons, disabled: true } # cut for the sub-1s images goal
- { name: lucide, disabled: true } # cut for the sub-1s images goal
- { name: wallhaven, disabled: true } # cut for the sub-1s images goal
# Not in the /preferences list kuhy sent -- these only surfaced as
# unresponsive under load, same failure pattern, so pruned with the rest.
- { name: brave.images, disabled: true } # too many requests
- { name: startpage images, disabled: true } # Suspended: CAPTCHA
# --- slow tail (>= 1.0s median, measured) ---
- name: flickr
disabled: true # 1.0s median, image-only, redundant with the rest
# === videos ===
- { name: 360search videos, disabled: true } # unexpected crash
- { name: acfun, disabled: true } # timeout
- { name: brave.videos, disabled: true } # too many requests
- { name: dogpile videos, disabled: true } # access denied
- { name: fireball videos, disabled: true } # access denied
- { name: niconico, disabled: true } # HTTP connection error
- { name: pixabay videos, disabled: true } # timeout
- { name: tusksearch videos, disabled: true } # HTTP error
- { name: vimeo, disabled: true } # access denied
- { name: youtube, disabled: true } # HTTP connection error
- { name: naver videos, disabled: true } # 2.4s
- { name: sogou videos, disabled: true } # 2.0s
- { name: iqiyi, disabled: true } # 1.3s
- { name: rumble, disabled: true } # 1.3s
# === news ===
- { name: bing news, disabled: true } # parsing error
- { name: brave.news, disabled: true } # too many requests
- { name: dogpile news, disabled: true } # access denied
- { name: fireball news, disabled: true } # access denied
- { name: google news, disabled: true } # Suspended: CAPTCHA
- { name: startpage news, disabled: true } # Suspended: CAPTCHA
- { name: tusksearch news, disabled: true } # HTTP error
- { name: sogou wechat, disabled: true } # 1.7s
- { name: naver news, disabled: true } # 1.7s
# === music ===
- { name: radio browser, disabled: true } # HTTP error
- { name: yandex music, disabled: true } # HTTP error
# === it ===
- { name: codeberg, disabled: true } # timeout
- { name: metacpan, disabled: true } # HTTP error
- { name: nixos wiki, disabled: true } # timeout
- { name: baidu kaifa, disabled: true } # 2.0s
- { name: gitea.com, disabled: true } # 1.8s
- { name: rubygems, disabled: true } # 1.1s
# === science ===
- { name: openairepublications, disabled: true } # 2.7s
- { name: openairedatasets, disabled: true } # 2.7s
# === files ===
- { name: 1337x, disabled: true } # HTTP connection error
- { name: btdigg, disabled: true } # 1.5s
- { name: findfiles, disabled: true } # 1.2s
- { name: kickass, disabled: true } # HTTP connection error (surfaced under load)
# === social media ===
- { name: 9gag, disabled: true } # access denied
- { name: tootfinder, disabled: true } # access denied
EOF
# 640, NOT 600. The entrypoint chowns this file to the container's searxng
# user (uid 977), but granian's worker runs as a different uid and only has
@ -737,6 +847,15 @@ status_cmd() {
dead="$(grep -oE '"unresponsive_engines": \[\[[^]]*' <<<"$json" | head -c 300 || true)"
[[ -n $dead ]] && log_info "unresponsive engines: ${dead#*: }"
# After pruning, general search is served by google cse alone (google/bing
# are inactive: true upstream and only answer to !go / !bi). That is a single
# point of failure worth naming explicitly rather than discovering as "no
# results", so check the engine that is actually carrying the category.
if [[ ${hits:-0} -eq 0 ]]; then
log_warn "general search has no working engine — try: !go <query> / !bi <query>,"
log_warn "or re-enable an engine in the 'engines:' block of ${SEARX_SETTINGS}"
fi
log_info "Not checked here (needs another machine): the JSON API under bot"
log_info "detection. Run from your phone on cellular, not from this host:"
log_info " curl 'https://${SEARX_DOMAIN}/search?q=test&format=json'"

View File

@ -362,6 +362,7 @@ com.kuhy.diet_guard_app
com.kuhy.habit_stack
com.kuhy.home_inventory
com.kuhy.epopeja_karta
com.kuhy.untools
com.shazam.android
com.ichi2.anki
com.metrolist.music

View File

@ -89,6 +89,16 @@ APPS: Final[dict[str, AppIcon]] = {
icon_name="todo",
linux=True,
),
AppIcon(
key="untools",
repo=_HOME / "untools",
accent="#B8862E",
glyph="decision-tree",
icon_name="untools",
# Desktop is the web build in a Chrome --app window, so there is
# no GTK app to hand a hicolor PNG to.
linux=False,
),
AppIcon(
key="habit_stack",
repo=_HOME / "habit_stack",

View File

@ -78,6 +78,29 @@ _CHECKLIST = """\
<path d="M 272 620 L 346 694 L 478 562"/>
<path d="M 594 648 L 752 648"/>"""
# A branching decision tree: one node splitting into two. Reads as "decompose
# a problem into parts", the move every one of the 25 thinking tools makes in
# some form -- an issue tree most literally, but also a fishbone's ribs and a
# 2x2's quadrants.
#
# Nodes are hollow circles rather than filled dots: at 48dp a filled dot and
# the 72px stroke merge into a blob, while the ring keeps visible negative
# space (r=78 leaves 156-72=84px of interior).
#
# Two levels of branching were tried first (7 nodes) and rejected: the
# generator's safe-box check flagged it as overflowing by ~170px, and at icon
# size the doubled connectors closed up into a solid mass. One clean split
# survives the launcher mask and still reads as a tree rather than a Y-fork,
# because the square shoulders and vertical drops keep the hierarchy legible.
_DECISION_TREE = """\
<circle cx="512" cy="300" r="78"/>
<path d="M 512 378 L 512 452"/>
<path d="M 346 452 L 678 452"/>
<path d="M 346 452 L 346 528"/>
<path d="M 678 452 L 678 528"/>
<circle cx="346" cy="606" r="78"/>
<circle cx="678" cy="606" r="78"/>"""
# Two interlocking stadium (pill-ring) outlines, both rotated -45 deg and
# offset along the anti-diagonal so their strokes overlap in the middle --
# reads as both "habit-stacking" (linked items) and "don't break the chain".
@ -238,6 +261,11 @@ GLYPHS: Final[dict[str, Glyph]] = {
Glyph("quill-nib", "Dip-pen nib with vent hole and slit", _QUILL_NIB),
Glyph("anvil", "Blacksmith's anvil with horn and flared foot", _ANVIL),
Glyph("track-bars", "Rising log bars with a plotted trend point", _TRACK_BARS),
Glyph(
"decision-tree",
"Node branching into two levels of child nodes",
_DECISION_TREE,
),
)
}