substore-openclash

Installation
SKILL.md
Contains Shell Commands

This skill contains shell command directives (!`command`) that may execute system commands. Review carefully before installing.

SubStore -> OpenClash Config Pipeline

Manage the Clash/mihomo configuration generated by SubStore (Docker on frad-nas) and consumed by OpenClash (OpenWrt gateway on 10.10.0.1). All persistent config changes go into SubStore at the source — the OpenClash gateway only pulls and runs the result. Do NOT edit gateway-side custom files for rules that must survive a subscription refresh; the gateway's config/AIO.yaml is a generated artifact and gets overwritten on update.

Topology

  • frad-nas (Unraid, SSH host frad-nas): runs the SubStore Docker container (xream/sub-store:latest, port 3001). State lives in /mnt/user/appdata/sub-store/data/sub-store.json (bind-mounted to /opt/app/data in the container). This is the ONLY place to make persistent config changes.
  • 10.10.0.1 (OpenWrt, SSH root@10.10.0.1): runs OpenClash. Current config is /etc/openclash/config/AIO.yaml; the actually-running config is /etc/openclash/AIO.yaml (OpenClash copies raw -> tmp -> final during startup). It subscribes to SubStore at http://<nas-ip>:3001/sub-api/api/file/AIO (no token needed for read). The NAS IP is whatever frad-nas resolves to on the gateway (host route on br-lan); confirm with ip route on the NAS.
  • The pipeline: SubStore 组合订阅 collection merges subs VoyraCloud (local) + HXY (remote) + oixCloud (remote) -> the AIO file (type mihomoProfile, sourceType collection) runs its process operators -> final Clash YAML. OpenClash pulls that URL as one of its config_subscribe entries.

The AIO file and how its process operators work

The AIO file in files[] has sourceType: collection, type: mihomoProfile, and a process array. The first operator is powerfullz/override-rules convert.min.js (mode link) — it generates the full rules/dns/proxy-groups/sniffer from the merged nodes.

CRITICAL: file-type Script Operators are YAML-merge, NOT JavaScript

This is the single most important fact and the source of repeated failures. In the SubStore bundle, the Script Operator func for a file target (['mihomoConfig','mihomoProfile'].includes($file?.type)) is:

Installs
2
Repository
fradser/skills
GitHub Stars
4
First Seen
13 days ago
substore-openclash — fradser/skills