diff --git a/nikki/files/mixin.yaml b/nikki/files/mixin.yaml index fc7cec27b..5c5471046 100644 --- a/nikki/files/mixin.yaml +++ b/nikki/files/mixin.yaml @@ -1,28 +1,25 @@ # Mixin File # You can set any mihomo profile's config at here, it will mixin to the profile. +# Mixin file have lower priority than the LuCI mixin options. +# +# Mihomo's Wiki: https://wiki.metacubex.one # # For example: # -# global-client-fingerprint: chrome # set fingerprint for TLS transport # experimental: # experimental config -# quic-go-disable-gso: false # disable quic-go GSO support -# quic-go-disable-ecn: false # disable quic-go ECN support # dialer-ip4p-convert: false # IP4P support -# proxies: # overwrite proxies +# listeners: # overwrite listeners +# - name: shadowsocks +# type: shadowsocks +# listen: "::" +# port: 12060 +# nikki-proxies: # prepend proxies # - name: "PROXY" # type: ss # server: proxy.example.com # port: 443 # cipher: chacha20-ietf-poly1305 # password: "password" -# rules: # overwrite rules -# - DOMAIN,google.com,PROXY -# - DOMAIN-SUFFIX,google.com,PROXY -# - DOMAIN-KEYWORD,google,PROXY -# - DOMAIN-REGEX,^google.*com,PROXY -# - GEOSITE,google,PROXY -# - GEOSITE,cn,DIRECT -# - IP-CIDR,8.8.8.8/32,DIRECT,no-resolve -# - GEOIP,telegram,DIRECT -# - GEOIP,cn,DIRECT -# - Match,PROXY \ No newline at end of file +# nikki-rules: # prepend rules +# - DOMAIN,direct.example.com,DIRECT +# - DOMAIN-SUFFIX,proxy.example.com,PROXY \ No newline at end of file diff --git a/nikki/files/nikki.init b/nikki/files/nikki.init index c51b66252..1cb213e9d 100644 --- a/nikki/files/nikki.init +++ b/nikki/files/nikki.init @@ -139,9 +139,9 @@ start_service() { yq -M -i 'del(.sniffer.sniff)' "$RUN_PROFILE_PATH" fi if [ "$mixin_file_content" = 0 ]; then - ucode -S "$MIXIN_UC" | yq -M -p json -o yaml | yq -M -i ea '... comments="" | . as $item ireduce ({}; . * $item ) | .rules = .nikki-rules + .rules | del(.nikki-rules)' "$RUN_PROFILE_PATH" - + ucode -S "$MIXIN_UC" | yq -M -p json -o yaml | yq -M -i ea '... comments="" | . as $item ireduce ({}; . * $item ) | .proxies = .nikki-proxies + .proxies | del(.nikki-proxies) | .rules = .nikki-rules + .rules | del(.nikki-rules)' "$RUN_PROFILE_PATH" - elif [ "$mixin_file_content" = 1 ]; then - ucode -S "$MIXIN_UC" | yq -M -p json -o yaml | yq -M -i ea '... comments="" | . as $item ireduce ({}; . * $item ) | .rules = .nikki-rules + .rules | del(.nikki-rules)' "$RUN_PROFILE_PATH" "$MIXIN_FILE_PATH" - + ucode -S "$MIXIN_UC" | yq -M -p json -o yaml | yq -M -i ea '... comments="" | . as $item ireduce ({}; . * $item ) | .proxies = .nikki-proxies + .proxies | del(.nikki-proxies) | .rules = .nikki-rules + .rules | del(.nikki-rules)' "$RUN_PROFILE_PATH" "$MIXIN_FILE_PATH" - fi fi # test profile