Commit Graph

3 Commits

Author SHA1 Message Date
xiaoshuai 9e10925023 searxng-search: document the plugin and how the instance was deployed
Two docs next to the plugin: README.md for the tool, SEARXNG-SETUP.md for the
Docker deployment behind it. Both are written from measurements against the
running instance, not from a guide.

The setup doc exists because the deployment decisions were only recorded as
comments inside settings.yml, which means they are unfindable unless you
already know to look there. It also records the parts that are not guessable:
why the port is 39217, why limiter is off, why the UI locale is zh-Hans-CN
rather than zh-CN, and which engine is broken how.

Corrections found while writing it:

- The rebuild steps pointed at searxng/searxng-docker, which is superseded. That
  repository now holds only a deprecation notice and its docker-compose.yml raw
  URL 404s. The templates moved to searxng/master/container/. Verified both
  local files are byte-identical to the current templates, so the deployment
  was always the current one -- only the documented URL was wrong.
- The plugin README claimed the entrypoint comes from package.json. This
  directory has no package.json; the entrypoint falls back to index.ts. Restarted
  the service with both .md files in place to confirm they do not affect
  resolution.

Documents the two SearXNG behaviours that fail silently rather than loudly,
both verified by reading the engine label on each result:

- An unknown engine name is ignored and the default engine set is searched
  instead, with no error. engines=mojeek returns 10 bing results and looks like
  a success, as does a typo. The only reliable signal is whether the requested
  engine appears in results[].engine.
- /config is not a way to check this. It reported disabled: false for every
  engine while baidu and sogou were in fact being dropped, because it reflects
  upstream defaults and not the local disabled: true overrides.

Also records that ctx.options is always {} for a directory-discovered plugin,
so the four options in PluginConfig cannot be supplied without moving the
plugin out of plugins/ and registering it in opencode.jsonc. Verified by
writing JSON.stringify(ctx.options) to a file from inside setup().

No secret_key value is in either file; settings.yml stays outside this
repository under ~/Docker.
2026-10-08 13:29:02 +08:00
xiaoshuai 13d353e96d skills: require every skills/ and plugins/ change to be pushed
Editing the skill, or a plugin under plugins/, is a change to the
~/.config/opencode repository. That had no rule attached to it, so work
landed locally and the remote silently drifted.

Add "Push every change" near the top of SKILL.md, where it is read before
the reference material rather than buried at the end, plus a fifth item in
"Verifying before you answer" so the push is part of the final check rather
than a separate task that gets skipped.

The section records the three constraints that are not guessable:

- Push over SSH. origin is git@git.xsinfo.vip:xiaoshuai/oc.git; an HTTPS push
  prompts for a password and there is no TTY, so it fails outright.
- Never git init inside skills/ or plugins/. OpenCode discovers every immediate
  subdirectory of plugins/ as a plugin package, so a .git there is loaded as
  plugins/.git/index and fails on each startup. The repository belongs at the
  config root, one level above both scan roots.
- Do not git add -f past .gitignore. opencode.jsonc, cli.json, service.json,
  package.json and node_modules/ are machine-local by design.
2026-10-08 13:17:48 +08:00
xiaoshuai 15a1bbcee0 Version OpenCode skills and plugins
Repository sits at the OpenCode config root rather than inside skills/ or
plugins/. OpenCode scans exactly those two subdirectories, and a .git
directory inside either one is picked up as a plugin and fails to load:

  loading plugin id=.../plugins/.git entrypoint=.../plugins/.git/index
  failed to load plugin ... AggregateError: 2 errors building .../plugins/.git/index

The watcher.ignore config option does not help: it only suppresses filesystem
update events, not plugin discovery, and the "-" disable prefix only applies to
plugins listed in opencode.json(c), not auto-discovered ones.

.gitignore admits only skills/ and plugins/ (plus itself). Personal config
(opencode.jsonc, cli.json, service.json) and node_modules stay local.

skills/opencode-plugins  V2-only plugin authoring reference and 7 templates,
                         transcribed from the V2 docs with the URL on every file
plugins/searxng-search   searxng_search tool over a self-hosted SearXNG JSON API
2026-10-08 13:12:10 +08:00