substore-openclash
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 theSubStoreDocker container (xream/sub-store:latest, port 3001). State lives in/mnt/user/appdata/sub-store/data/sub-store.json(bind-mounted to/opt/app/datain 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 athttp://<nas-ip>:3001/sub-api/api/file/AIO(no token needed for read). The NAS IP is whateverfrad-nasresolves to on the gateway (host route on br-lan); confirm withip routeon the NAS. - The pipeline: SubStore
组合订阅collection merges subsVoyraCloud(local) +HXY(remote) +oixCloud(remote) -> theAIOfile (typemihomoProfile, sourceTypecollection) runs itsprocessoperators -> final Clash YAML. OpenClash pulls that URL as one of itsconfig_subscribeentries.
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: