Compare commits

...

19 Commits

Author SHA1 Message Date
Stille f174f8a238 update v0.8.1 2023-10-12 10:52:14 +08:00
Stille 29a64f2aa0 fix bug 2022-07-20 10:58:05 +08:00
Stille 924217cd7a add sub 2022-07-16 15:58:47 +08:00
Stille 93c18c5eb2 update README.md 2022-07-04 10:56:24 +08:00
Stille 44e3e9d47e update v0.7.2 2022-04-03 14:10:44 +08:00
Stille 3bd160d44e update rulesets.txt 2022-01-09 22:34:21 +08:00
Stille e2dd6b1731 Update groups and rulesets 2021-12-20 18:18:05 +08:00
Stille f52c774930 Update Disney+ groups rulesets 2021-12-01 10:31:49 +08:00
Stille 5034c233f9 Update v0.7.1 2021-09-30 21:52:10 +08:00
Stille 2c11be59c5 Update v0.7.0 2021-09-21 19:52:57 +08:00
Stille b8f05b8c08 Update README.md 2021-07-15 17:16:39 +08:00
Stille bac6726ca6 Update docker support for ARM 2021-05-29 17:01:29 +08:00
Stille e7117d89bd Optimize groups.txt 2021-04-29 18:28:21 +08:00
Stille 12ade5201f Update v0.6.4 by latest source code 2021-03-22 14:57:21 +08:00
Stille 1fe4a88a14 Update v0.6.4 2020-10-17 14:22:18 +08:00
Stille fe1db5e6c9 Update v0.6.3 2020-08-17 11:12:01 +08:00
Stille d4d1b5873e Update v0.6.2 2020-08-04 18:05:23 +08:00
Stille 9b12aca8ab Update v0.6.1 2020-07-10 23:13:27 +08:00
Stille e2c43a3751 Update v0.6.0 2020-07-04 11:48:42 +08:00
8 changed files with 505 additions and 360 deletions

View File

@ -1,18 +1,19 @@
FROM alpine:3.8
MAINTAINER Stille <stille@ioiox.com>
FROM tindy2013/subconverter
LABEL maintainer="Stille <stille@ioiox.com>"
ENV VERSION v0.5.2
ENV VERSION 0.8.1
WORKDIR /base
RUN apk add wget && \
wget -P /base https://github.com/tindy2013/subconverter/releases/download/${VERSION}/subconverter_linux64.tar.gz && \
tar xzf subconverter_linux64.tar.gz && \
rm -rf subconverter_linux64.tar.gz && \
apk del wget && \
sed -i '/clash_use_new_field_name=true/s/clash_use_new_field_name=true/clash_use_new_field_name=false/g' /base/subconverter/pref.ini
RUN apk add tzdata && \
cp /usr/share/zoneinfo/Asia/Shanghai /etc/localtime && \
echo "Asia/Shanghai" > /etc/timezone && \
apk del tzdata
COPY groups.txt /base/subconverter/snippets
COPY groups.txt rulesets.txt /base/snippets/
COPY pref.yml /base
EXPOSE 25500
CMD ./subconverter/subconverter
WORKDIR /base
CMD subconverter

19
Dockerfile.OLD Normal file
View File

@ -0,0 +1,19 @@
FROM alpine:3.8
MAINTAINER Stille <stille@ioiox.com>
ENV VERSION v0.6.4
WORKDIR /base
RUN apk add wget tzdata && \
cp /usr/share/zoneinfo/Asia/Shanghai /etc/localtime && \
echo "Asia/Shanghai" > /etc/timezone && \
wget -P /base https://github.com/tindy2013/subconverter/releases/download/${VERSION}/subconverter_linux64.tar.gz && \
tar xzf subconverter_linux64.tar.gz && \
rm -rf subconverter_linux64.tar.gz && \
apk del wget tzdata
COPY groups.txt rulesets.txt /base/subconverter/snippets/
EXPOSE 25500
CMD ./subconverter/subconverter

View File

@ -1,71 +1,42 @@
# subconverter
## 简介
subconverter 是基于原版 [tindy2013/subconverter](https://github.com/tindy2013/subconverter) 项目的修改版本.仅修改 **分组配置文件** 以解决以下两点问题.相关使用方法请参考原始项目.
基于 [tindy2013/subconverter](https://github.com/tindy2013/subconverter) 项目的 docker 镜像.仅修改 **分组配置文件** 以解决以下问题.
- **增加**`NetflixDisneyPlus`等分组.
- **去除**`自动选择 url-test`以解决连接数爆涨问题.
- **全球拦截** 增加`节点选择`,以解决`Google Analytics`的访问需求.
- **修改时区** 镜像默认时区为 Asia/Shanghai
## 示例
[https://sub.ops.ci](https://sub.ops.ci)
*`前后端示例,可以直接使用.`*
## 更新
- **2022-07-16** 新增 [stilleshan/sub](https://github.com/stilleshan/dockerfiles/tree/main/sub) subweb + subconverter 合并进阶版.
- **2022-07-04** 新增 [stilleshan/subweb](https://github.com/stilleshan/subweb) 前端项目.
- **2022-04-03** 更新`v0.7.2`版 docker 镜像
- **2021-12-20** 更新优化规则和分组
- **2021-12-01** 添加`Disney+`规则分组
- **2021-09-30** 更新`v0.7.1`版 docker 镜像
- **2021-09-21** 更新`v0.7.0`版 docker 镜像
- **2021-06-09** 更新`v0.6.4`版 docker 镜像,新增同时支持 X86 和 ARM 架构.
## 部署
### docker 部署
### docker
```shell
docker run -d --name=subconverter --restart=always -p 25500:25500 stilleshan/subconverter
```
> 如需自定义分组配置,可挂载 **-v ~/groups.txt:/base/snippets/groups.txt** 参数.
v0.2.6 - v0.3.0 版本如需自定义分组配置,可挂载 **-v ~/pref.ini:/base/pref.ini** 参数.
### 免费提供订阅转换地址
具体使用教程请参考原版 [tindy2013/subconverter](https://github.com/tindy2013/subconverter) 项目,本免费托管服务版本可访问以下链接查看.
### docker compose
下载 [docker-compose.yml](https://raw.githubusercontent.com/stilleshan/dockerfiles/main/subconverter/docker-compose.yml) 执行以下命令启动:
```shell
https://subto.herokuapp.com/
docker-compose up -d
```
## Nginx反向代理
配置Nginx反向代理来为接口链接提供域名和HTTPS支持.配置参考如下,请自行替换`域名`和`证书`信息.
### subweb + subconverter 合并进阶版
详情查看 [stilleshan/sub](https://github.com/stilleshan/dockerfiles/tree/main/sub)
```nginx
upstream subconverter {
server 127.0.0.1:25500; # 端口改为docker容器提供的端口
}
server {
listen 80;
server_name www.yourdomain.com;
return 301 https://www.yourdomain.com$request_uri;
}
server {
listen 443 ssl;
server_name www.yourdomain.com;
gzip on;
ssl_certificate /usr/local/nginx/conf/ssl/www.yourdomain.com.crt;
ssl_certificate_key /usr/local/nginx/conf/ssl/www.yourdomain.com.key;
location / {
proxy_redirect off;
proxy_pass http://subconverter;
proxy_set_header Host $http_host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-Ssl on;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header X-Frame-Options SAMEORIGIN;
client_max_body_size 100m;
client_body_buffer_size 128k;
proxy_buffer_size 4k;
proxy_buffers 4 32k;
proxy_busy_buffers_size 64k;
proxy_temp_file_write_size 64k;
}
}
```
## 相关链接
- GitHub [stilleshan/subconverter](https://github.com/stilleshan/subconverter)
- Docker [stilleshan/subconverter](https://hub.docker.com/r/stilleshan/subconverter)
- 原版项目Github [tindy2013/subconverter](https://github.com/tindy2013/subconverter)
- 原版项目docker [tindy2013/subconverter](https://hub.docker.com/r/tindy2013/subconverter)
- ClashXR项目 [WhoJave/clashX](https://github.com/WhoJave/clashX/releases)
## 链接
- [stilleshan/sub](https://github.com/stilleshan/dockerfiles/tree/main/sub)
- [stilleshan/subweb](https://github.com/stilleshan/subweb)
- [stilleshan/subconverter](https://github.com/stilleshan/subconverter)
- [tindy2013/subconverter](https://github.com/tindy2013/subconverter)

View File

@ -1,13 +1,12 @@
🔰 节点选择`select`[]🎯 全球直连`.*
;♻️ 自动选择`url-test`.*`http://www.gstatic.com/generate_204`300
;🎥 NETFLIX`select`[]🔰 节点选择`[]🎯 全球直连`.*
;⛔️ 广告拦截`select`[]🛑 全球拦截`[]🎯 全球直连`[]🔰 节点选择
;🚫 运营劫持`select`[]🛑 全球拦截`[]🎯 全球直连`[]🔰 节点选择
🌍 国外媒体`select`[]🔰 节点选择`[]🎯 全球直连`.*
🌏 国内媒体`select`[]🎯 全球直连`(HGC|HKBN|PCCW|HKT|深台|彰化|新北|台|hk|港|tw)`[]🔰 节点选择
Ⓜ️ 微软服务`select`[]🎯 全球直连`[]🔰 节点选择`.*
📲 电报信息`select`[]🔰 节点选择`[]🎯 全球直连`.*
🍎 苹果服务`select`[]🔰 节点选择`[]🎯 全球直连`.*
🎯 全球直连`select`[]DIRECT
🛑 全球拦截`select`[]REJECT`[]DIRECT`[]🔰 节点选择
🐟 漏网之鱼`select`[]🔰 节点选择`[]🎯 全球直连`.*
🔰 PROXY`select`[]🎯 DIRECT`.*
🎬 Media`select`(香港|HK|hk|🇭🇰|台湾|TW|tw|新加坡|SG|sg|🇸🇬)
▶️ YouTube`select`[]🔰 PROXY`[]🎬 Media`.*
🍿 Netflix`select`[]🔰 PROXY`[]🎬 Media`.*
🐰 DisneyPlus`select`[]🔰 PROXY`[]🎬 Media`.*
📺 AppleTV`select`[]🔰 PROXY`[]🎬 Media`.*
🍎 Apple`select`[]🎯 DIRECT`[]🔰 PROXY`.*
Ⓜ️ Microsoft`select`[]🎯 DIRECT`[]🔰 PROXY`.*
💰 PayPal`select`[]🎯 DIRECT`[]🔰 PROXY`.*
🚫 AdBlock`select`[]🎯 DIRECT`[]🔰 PROXY`[]REJECT`.*
🐟 Other`select`[]🎯 DIRECT`[]🔰 PROXY`.*
🎯 DIRECT`select`[]DIRECT

279
pref.ini
View File

@ -1,279 +0,0 @@
[common]
;API mode, set to true to prevent loading local subscriptions or serving local files directly
api_mode=false
;Access token used for performing critical action through Web interface
api_access_token=password
;Default URLs, used when no URL is provided in request, use "|" to separate multiple subscription links, supports local files/URL
default_url=
;Exclude nodes which remarks match the following patterns. Supports regular expression.
exclude_remarks=(到期|剩余流量|时间|官网|产品)
;exclude_remarks=(other rule)
;Only include nodes which remarks match the following patterns. Supports regular expression.
;include_remarks=V3.*港
;Clash config base used by the generator, supports local files/URL
clash_rule_base=simple_base.yml
;Surge config base used by the generator, supports local files/URL
surge_rule_base=surge.conf
;Surfboard config base used by the generator, supports local files/URL
surfboard_rule_base=surfboard.conf
;Mellow config base used by the generator, supports local files/URL
mellow_rule_base=mellow.conf
;Quantumult X config base used by the generator, supports local files/URL
quan_rule_base=quan.conf
;Quantumult X config base used by the generator, supports local files/URL
quanx_rule_base=quanx.conf
;Proxy used to download rulesets or subscriptions, set to NONE or empty to disable it, set to SYSTEM to use system proxy.
;Accept cURL-supported proxies (http:// https:// socks4a:// socks5://)
proxy_ruleset=SYSTEM
proxy_subscription=NONE
;Append a proxy type string ([SS] [SSR] [VMess]) to node remark.
append_proxy_type=false
[userinfo]
;Rules to extract stream data from node
;Format: full_match_regex|new_format_regex
;where new_format_regex should be like "total=$1&left=$2&used=$3"
stream_rule=^剩余流量:(.*?) (.*)$|total=$1&left=$2
stream_rule=^Bandwidth: (.*?)/(.*)$|used=$1&total=$2
stream_rule=^\[.*?\]剩余(.*?)@(?:.*)$|total=$1
;Rules to extract expire time data from node
;Format: full_match_regex|new_format_regex
;where new_format_regex should follow this example: yyyy:mm:dd:hh:mm:ss
time_rule=^过期时间:(\d+)-(\d+)-(\d+) (\d+):(\d+):(\d+)$|$1:$2:$3:$4:$5:$6
time_rule=^到期时间:(\d+)-(\d+)-(\d+)$|$1:$2:$3:0:0:0
time_rule=^Smart Access expire: (\d+)/(\d+)/(\d+)$|$1:$2:$3:0:0:0
[node_pref]
udp_flag=false
tcp_fast_open_flag=false
sort_flag=false
skip_cert_verify_flag=false
filter_deprecated_nodes=false
;Rename remarks with the following patterns. Supports regular expression.
;Format: Search_Pattern@Replace_Pattern
;rename_node=IPLC@专线
;rename_node=RELAY@中转
;rename_node=BGP-@
; short names
; rename_node=中国@中
; rename_node=徐州@徐
; rename_node=深圳@深
; rename_node=上海@沪
; rename_node=广州@穗
; rename_node=宁波@甬
; rename_node=贵阳@筑
; rename_node=武汉@汉
; rename_node=南京@宁
; rename_node=天津@津
; rename_node=北京@京
; rename_node=沈阳@沈
; rename_node=江苏@苏
; rename_node=浙江@浙
; rename_node=安徽@皖
; rename_node=福建@闽
; rename_node=湖南@湘
; rename_node=广东@粤
; rename_node=海南@琼
; rename_node=四川@川
; rename_node=贵州@贵
; rename_node=云南@云
; rename_node=青海@青
; rename_node=台湾@台
; rename_node=香港@港
; rename_node=澳门@澳
; rename_node=美国@美
; rename_node=英国@英
; rename_node=加拿大@加
; rename_node=法国@法
; rename_node=德国@德
; rename_node=瑞士@瑞
; rename_node=日本@日
; rename_node=韩国@韩
; rename_node=芬兰@芬
; rename_node=印度@印
; rename_node=泰国@泰
; rename_node=越南@越
; rename_node=新加坡@新
; rename_node=意大利@意
; rename_node=菲律宾@菲
; rename_node=俄罗斯@俄
; rename_node=土耳其@土
; times RE
rename_node=\(?((x|X)?(\d+)(\.?\d+)?)((\s?倍率?)|(x|X))\)?@$1x
[managed_config]
;Append a '#!MANAGED-CONFIG' info to Surge configurations
write_managed_config=true
;Address prefix for MANAGED-CONFIG info, without the trailing "/".
managed_config_prefix=http://127.0.0.1:25500
[surge_external_proxy]
;surge_ssr_path=/usr/bin/ssr-local
[emojis]
add_emoji=true
remove_old_emoji=true
;Rule to add emojis. Supports regular expression.
;Format: Remark_Search_Pattern,emoji
rule=(流量|时间|应急|过期|Bandwidth|expire),🏳️‍🌈
rule=AC,🇦🇨
rule=(AR|阿根廷),🇦🇷
rule=(奥地利|维也纳),🇦🇹
rule=(AU|Australia|Sydney|澳大利亚|悉尼),🇦🇺
rule=BE,🇧🇪
rule=(BR|Brazil|巴西|圣保罗),🇧🇷
rule=(Canada|加拿大|蒙特利尔|温哥华|楓葉|枫叶),🇨🇦
rule=(瑞士|苏黎世),🇨🇭
rule=(DE|Germany|德国|法兰克福|德),🇩🇪
rule=丹麦,🇩🇰
rule=ES,🇪🇸
rule=EU,🇪🇺
rule=(Finland|芬兰|赫尔辛基),🇫🇮
rule=(FR|France|法国|巴黎),🇫🇷
rule=(UK|England|United.*?Kingdom|英国|英|伦敦),🇬🇧
rule=(?i)(HK|Hong.*?Kong|香港|深港|沪港|呼港|HKT|HKBN|HGC|WTT|CMI|穗港|京港|港),🇭🇰
rule=(Indonesia|印尼|印度尼西亚|雅加达),🇮🇩
rule=(Ireland|爱尔兰|都柏林),🇮🇪
rule=(India|印度|孟买),🇮🇳
rule=(Italy|意大利|米兰),🇮🇹
rule=(JP|Japan|日本|东京|大阪|埼玉|沪日|穗日|川日|中日|泉日|杭日),🇯🇵
rule=(KP|朝鲜),🇰🇵
rule=(KR|Korea|KOR|韩国|首尔|韩|韓),🇰🇷
rule=(MO|Macao|澳门|CTM),🇲🇴
rule=(MY|Malaysia|马来西亚),🇲🇾
rule=(NL|Netherlands|荷兰|阿姆斯特丹),🇳🇱
rule=(PH|Philippines|菲律宾),🇵🇭
rule=(RO|罗马尼亚),🇷🇴
rule=(RU|Russia|俄罗斯|伯力|莫斯科|圣彼得堡|西伯利亚|新西伯利亚|京俄|杭俄),🇷🇺
rule=(沙特|迪拜),🇸🇦
rule=(SE|Sweden),🇸🇪
rule=(SG|Singapore|新加坡|狮城|沪新|京新|泉新|穗新|深新|杭新),🇸🇬
rule=(TH|Thailand|泰国|曼谷),🇹🇭
rule=(TR|Turkey|土耳其|伊斯坦布尔),🇹🇷
rule=(US|America|UnitedStates|美国|美|京美|波特兰|达拉斯|俄勒冈|凤凰城|费利蒙|硅谷|拉斯维加斯|洛杉矶|圣何塞|圣克拉拉|西雅图|芝加哥|沪美),🇺🇲
rule=(VN|越南),🇻🇳
rule=(ZA|南非),🇿🇦
rule=(CN|China|回国|中国|江苏|北京|上海|广州|深圳|杭州|徐州|青岛|宁波|镇江|back|TW|Taiwan|台湾|台北|台中|新北|彰化|CHT|新北|台|HINET),🇨🇳
[ruleset]
;Enable generating rules with rulesets
enabled=true
;Overwrite the existing rules in rule_base
overwrite_original_rules=false
;Perform a ruleset update on request
update_ruleset_on_request=false
;Ruleset addresses, supports local files/URL
;Format: Group name,URL
; Group name,[]Rule
;surge_ruleset=DIRECT,https://raw.githubusercontent.com/ConnersHua/Profiles/master/Surge/Ruleset/Unbreak.list
;surge_ruleset=⛔️ 广告拦截,https://raw.githubusercontent.com/ConnersHua/Profiles/master/Surge/Ruleset/Advertising.list
;surge_ruleset=🚫 运营劫持,https://raw.githubusercontent.com/ConnersHua/Profiles/master/Surge/Ruleset/Hijacking.list
;surge_ruleset=🌌 YouTube,https://raw.githubusercontent.com/ConnersHua/Profiles/master/Surge/Ruleset/Media/YouTube.list
;surge_ruleset=🎥 NETFLIX,https://raw.githubusercontent.com/ConnersHua/Profiles/master/Surge/Ruleset/Media/Netflix.list
;surge_ruleset=HBO,https://raw.githubusercontent.com/ConnersHua/Profiles/master/Surge/Ruleset/Media/HBO.list
;surge_ruleset=Fox,https://raw.githubusercontent.com/ConnersHua/Profiles/master/Surge/Ruleset/Media/Fox.list
;surge_ruleset=🌍 国外媒体,https://raw.githubusercontent.com/ConnersHua/Profiles/master/Surge/Ruleset/GlobalMedia.list
;surge_ruleset=🌏 港台媒体,https://raw.githubusercontent.com/ConnersHua/Profiles/master/Surge/Ruleset/HKMTMedia.list
;surge_ruleset=📲 电报信息,https://raw.githubusercontent.com/ConnersHua/Profiles/master/Surge/Ruleset/Telegram.list
;surge_ruleset=🔰 节点选择,https://raw.githubusercontent.com/ConnersHua/Profiles/master/Surge/Ruleset/Global.list
;surge_ruleset=🍎 苹果服务,https://raw.githubusercontent.com/ConnersHua/Profiles/master/Surge/Ruleset/Apple.list
;surge_ruleset=DIRECT,https://raw.githubusercontent.com/ConnersHua/Profiles/master/Surge/Ruleset/China.list
surge_ruleset=🎯 全球直连,rules/LocalAreaNetwork.list
surge_ruleset=Ⓜ️ 微软服务,rules/MSServices.list
surge_ruleset=🎯 全球直连,rules/ConnersHua/Surge/Ruleset/Unbreak.list
surge_ruleset=🛑 全球拦截,rules/NobyDa/Surge/AdRule.list
surge_ruleset=🛑 全球拦截,rules/ConnersHua/Surge/Ruleset/Hijacking.list
;surge_ruleset=🎥 NETFLIX,rules/ConnersHua/Surge/Ruleset/Media/Netflix.list
surge_ruleset=🌍 国外媒体,rules/ConnersHua/Surge/Ruleset/GlobalMedia.list
surge_ruleset=🌏 国内媒体,rules/lhie1/Surge/Surge 3/Provider/AsianTV.list
surge_ruleset=📲 电报信息,rules/ConnersHua/Surge/Ruleset/Telegram.list
surge_ruleset=🔰 节点选择,rules/ConnersHua/Surge/Ruleset/Global.list
surge_ruleset=🍎 苹果服务,rules/ConnersHua/Surge/Ruleset/Apple.list
surge_ruleset=🎯 全球直连,rules/ConnersHua/Surge/Ruleset/China.list
surge_ruleset=🎯 全球直连,rules/NobyDa/Surge/Download.list
surge_ruleset=🎯 全球直连,[]GEOIP,CN
surge_ruleset=🐟 漏网之鱼,[]FINAL
[clash_proxy_group]
;Generate Clash Proxy Group with the following patterns. Node filterting rule supports regular expression.
;Format: Group_Name`select`Rule_1`Rule_2`...
; Group_Name`url-test|fallback|load-balance`Rule_1`Rule_2`...`test_url`interval
;Rule with "[]" prefix will be added directly.
;custom_proxy_group=UrlTest`url-test`.*`http://www.gstatic.com/generate_204`300
;custom_proxy_group=FallBack`fallback`.*`http://www.gstatic.com/generate_204`300
;custom_proxy_group=LoadBalance`load-balance`.*`http://www.gstatic.com/generate_204`300
;custom_proxy_group=g1`select`!!GROUPID=0
;custom_proxy_group=g2`select`!!GROUPID=1
;custom_proxy_group=v2ray`select`!!GROUP=V2RayProvider
;custom_proxy_group=g1hk`select`!!GROUPID=0!!(HGC|HKBN|PCCW|HKT|hk|港)
;custom_proxy_group=sstw`select`!!GROUP=V2RayProvider!!(深台|彰化|新北|台|tw)
;for forcerule.yml
;custom_proxy_group=Proxy`select`.*`[]AUTO`[]DIRECT`.*
;custom_proxy_group=AUTO`url-test`.*`http://www.gstatic.com/generate_204`300
;custom_proxy_group=google`select`.*
;custom_proxy_group=netflix`select`.*
;custom_proxy_group=动画疯`select`(深台|彰化|新北|台)
;custom_proxy_group=fox+`select`(HGC|HKBN|PCCW|HKT|深台|彰化|新北|台|新加坡|sg|hk|tw)
;custom_proxy_group=美区影视`select`(美|美国)
;custom_proxy_group=Global_media`select`.*
;custom_proxy_group=Domestic`select`[]DIRECT`[]Proxy
;custom_proxy_group=Apple`select`[]DIRECT`[]Proxy
;custom_proxy_group=Final`select`[]Proxy`[]DIRECT
;custom_proxy_group=屏蔽广告`select`[]REJECT`[]DIRECT
;custom_proxy_group=UnblockNeteaseMusic`select`云音乐解锁`[]DIRECT
;custom_proxy_group=Telegram`select`新加坡`[]Proxy
;for Surge rulesets
custom_proxy_group=🔰 节点选择`select`[]🎯 全球直连`.*
;custom_proxy_group=♻️ 自动选择`url-test`.*`http://www.gstatic.com/generate_204`300
;custom_proxy_group=🎥 NETFLIX`select`[]🔰 节点选择`[]♻️ 自动选择`[]🎯 全球直连`.*
;custom_proxy_group=⛔️ 广告拦截`select`[]🛑 全球拦截`[]🎯 全球直连`[]🔰 节点选择
;custom_proxy_group=🚫 运营劫持`select`[]🛑 全球拦截`[]🎯 全球直连`[]🔰 节点选择
custom_proxy_group=🌍 国外媒体`select`[]🔰 节点选择`[]🎯 全球直连`.*
custom_proxy_group=🌏 国内媒体`select`[]🎯 全球直连`(HGC|HKBN|PCCW|HKT|深台|彰化|新北|台|hk|港|tw)`[]🔰 节点选择
custom_proxy_group=Ⓜ️ 微软服务`select`[]🎯 全球直连`[]🔰 节点选择`.*
custom_proxy_group=📲 电报信息`select`[]🔰 节点选择`[]🎯 全球直连`.*
custom_proxy_group=🍎 苹果服务`select`[]🔰 节点选择`[]🎯 全球直连`.*
custom_proxy_group=🎯 全球直连`select`[]DIRECT
custom_proxy_group=🛑 全球拦截`select`[]REJECT`[]DIRECT`[]🔰 节点选择
custom_proxy_group=🐟 漏网之鱼`select`[]🔰 节点选择`[]🎯 全球直连`.*
[server]
;Address to bind on for Web Server
listen=0.0.0.0
;Port to bind on for Web Server
port=25500
[advanced]
print_debug_info=false
max_pending_connections=10240
max_concurrent_threads=4

267
pref.ini.OLD Normal file
View File

@ -0,0 +1,267 @@
[common]
;API mode, set to true to prevent loading local subscriptions or serving local files directly
api_mode=false
;Access token used for performing critical action through Web interface
api_access_token=password
;Default URLs, used when no URL is provided in request, use "|" to separate multiple subscription links, supports local files/URL
default_url=
;Insert subscription links to requests. Can be used to add node(s) to all exported subscriptions.
enable_insert=true
;URLs to insert to subscription links, use "|" to separate multiple subscription links, supports local files/URL
insert_url=
;Prepend inserted URLs to subscription links. Nodes in insert_url will be added to groups first with non-group-specific match pattern.
prepend_insert_url=true
;Exclude nodes which remarks match the following patterns. Supports regular expression.
exclude_remarks=(到期|剩余流量|时间|官网|产品)
;exclude_remarks=(other rule)
;Only include nodes which remarks match the following patterns. Supports regular expression.
;include_remarks=V3.*港
;Enable script support for filtering nodes
enable_filter=false
;Script used for filtering nodes. Supports inline script and script path. A "filter" function with 1 argument which is a node should be defined in the script.
;Example: Inline script: Set value to content of script. Replace all line break with "\n".
; Script path: Set value to "path:/path/to/script.js".
;filter_script=function filter(node) {\n const info = JSON.parse(node.ProxyInfo);\n if(info.EncryptMethod.includes('chacha20'))\n return true;\n return false;\n}
;Setting an external config file as default when none is specified, supports local files/URL
;default_external_config=config/example_external_config.ini
;The file scope limit of the 'rule_base' options in external configs.
base_path=base
;Clash config base used by the generator, supports local files/URL
clash_rule_base=base/all_base.tpl
;Surge config base used by the generator, supports local files/URL
surge_rule_base=base/all_base.tpl
;Surfboard config base used by the generator, supports local files/URL
surfboard_rule_base=base/all_base.tpl
;Mellow config base used by the generator, supports local files/URL
mellow_rule_base=base/all_base.tpl
;Quantumult config base used by the generator, supports local files/URL
quan_rule_base=base/all_base.tpl
;Quantumult X config base used by the generator, supports local files/URL
quanx_rule_base=base/all_base.tpl
;Loon config base used by the generator, supports local files/URL
loon_rule_base=base/all_base.tpl
;Shadowsocks Android config base used by the generator, supports local files/URL
sssub_rule_base=base/all_base.tpl
;Proxy used to download configs, rulesets or subscriptions, set to NONE or empty to disable it, set to SYSTEM to use system proxy.
;Accept cURL-supported proxies (http:// https:// socks4a:// socks5://)
;Additional support for CORS proxy ( https://github.com/Rob--W/cors-anywhere https://github.com/Zibri/cloudflare-cors-anywhere etc.), prefix the address with "cors:" to recognize the address as CORS proxy.
;Example: http://127.0.0.1:80 socks5://example.com:1080 cors:https://cors-anywhere.herokuapp.com/
proxy_config=SYSTEM
proxy_ruleset=SYSTEM
proxy_subscription=NONE
;Append a proxy type string ([SS] [SSR] [VMess]) to node remark.
append_proxy_type=false
[userinfo]
;Rules to extract stream data from node
;Format: full_match_regex|new_format_regex
;where new_format_regex should be like "total=$1&left=$2&used=$3"
stream_rule=^剩余流量:(.*?)\|总流量:(.*)$|total=$2&left=$1
stream_rule=^剩余流量:(.*?) (.*)$|total=$1&left=$2
stream_rule=^Bandwidth: (.*?)/(.*)$|used=$1&total=$2
stream_rule=^\[.*?\]剩余(.*?)@(?:.*)$|total=$1
stream_rule=^.*?流量:(.*?) 剩:(?:.*)$|total=$1
;Rules to extract expire time data from node
;Format: full_match_regex|new_format_regex
;where new_format_regex should follow this example: yyyy:mm:dd:hh:mm:ss
time_rule=^过期时间:(\d+)-(\d+)-(\d+) (\d+):(\d+):(\d+)$|$1:$2:$3:$4:$5:$6
time_rule=^到期时间(:|)(\d+)-(\d+)-(\d+)$|$1:$2:$3:0:0:0
time_rule=^Smart Access expire: (\d+)/(\d+)/(\d+)$|$1:$2:$3:0:0:0
time_rule=^.*?流量:(?:.*?) 剩:(.*)$|left=$1d
[node_pref]
;udp_flag=false
;tcp_fast_open_flag=false
;skip_cert_verify_flag=false
;tls13_flag=false
sort_flag=false
;Script used for sorting nodes. A "compare" function with 2 arguments which are the 2 nodes to be compared should be defined in the script. Supports inline script and script path.
;Examples can be seen at the filter_script option in [common] section.
;sort_script=function compare(node_a, node_b) {\n const info_a = JSON.parse(node_a.ProxyInfo);\n const info_b = JSON.parse(node_b.ProxyInfo);\n return info_a.Remark > info_b.Remark;\n}
filter_deprecated_nodes=false
append_sub_userinfo=true
clash_use_new_field_name=true
;Generate style of the proxies section of Clash subscriptions.
;Supported styles: block, flow, compact
;Block: - name: name1 Flow: - {name: name1, key: value} Compact: [{name: name1, key: value},{name: name2, key: value}]
; key: value - {name: name2, key: value}
; - name: name2
; key: value
clash_proxies_style=flow
;Rename remarks with the following patterns. Supports regular expression.
;Format: Search_Pattern@Replace_Pattern
;rename_node=IPLC@专线
;rename_node=RELAY@中转
;rename_node=BGP-@
;rename_node=!!script:function rename(node) {\n const info = JSON.parse(node.ProxyInfo);\n const geoinfo = JSON.parse(geoip(info.Hostname));\n if(geoinfo.country_code == "CN")\n return "CN " + node.Remark;\n}
;rename_node=!!script:path:/path/to/script.js
rename_node=!!import:snippets/rename_node.txt
[managed_config]
;Append a '#!MANAGED-CONFIG' info to Surge configurations
write_managed_config=true
;Address prefix for MANAGED-CONFIG info, without the trailing "/".
;This address will also be used for generating /getruleset, /qx-rewrite, /qx-script addresses.
managed_config_prefix=http://127.0.0.1:25500
;Managed config update interval in seconds, determine how long the config will be updated.
config_update_interval=86400
;If config_update_strict is set to true, Surge will require a force update after the interval.
config_update_strict=false
;Device ID to be written to rewrite scripts for some version of Quantumult X
quanx_device_id=
[surge_external_proxy]
;surge_ssr_path=/usr/bin/ssr-local
resolve_hostname=true
[emojis]
add_emoji=true
remove_old_emoji=true
;Rule to add emojis. Supports regular expression.
;Format: Remark_Search_Pattern,emoji
;rule=(流量|时间|应急|过期|Bandwidth|expire),🏳️‍🌈
;rule=AC,🇦🇨
;rule=!!script:function getEmoji(node) {\n const info = JSON.parse(node.ProxyInfo);\n const geoinfo = JSON.parse(geoip(info.Hostname));\n if(geoinfo.country_code == "CN")\n return "🏳️‍🌈";\n}
;rule=!!script:path:/path/to/script/.js
rule=!!import:snippets/emoji.txt
[rulesets]
;Enable generating rules with rulesets
enabled=true
;Overwrite the existing rules in rule_base
overwrite_original_rules=false
;Perform a ruleset update on request
update_ruleset_on_request=false
;Ruleset addresses, supports local files/URL
;Format: Group name,[type:]URL[,interval]
; Group name,[]Rule
;where "type" supports the following value: surge, quanx, clash-domain, clash-ipcidr, clash-classic
;type defaults to surge if omitted
;ruleset=DIRECT,https://raw.githubusercontent.com/ConnersHua/Profiles/master/Surge/Ruleset/Unbreak.list,86400
;ruleset=🎯 全球直连,rules/LocalAreaNetwork.list
;ruleset=DIRECT,surge:rules/LocalAreaNetwork.list
;ruleset=Advertising,quanx:https://raw.githubusercontent.com/ConnersHua/Profiles/master/Quantumult/X/Filter/Advertising.list,86400
;ruleset=Domestic Services,clash-domain:https://ruleset.dev/clash_domestic_services_domains,86400
;ruleset=Domestic Services,clash-ipcidr:https://ruleset.dev/clash_domestic_services_ips,86400
;ruleset=DIRECT,clash-classic:https://raw.githubusercontent.com/DivineEngine/Profiles/master/Clash/RuleSet/China.yaml,86400
;ruleset=🎯 全球直连,[]GEOIP,CN
;ruleset=🐟 漏网之鱼,[]FINAL
ruleset=!!import:snippets/rulesets.txt
[proxy_groups]
;Generate Clash Proxy Group with the following patterns. Node filtering rule supports regular expression.
;Format: Group_Name`select`Rule_1`Rule_2`...
; Group_Name`url-test|fallback|load-balance`Rule_1`Rule_2`...`test_url`interval[,timeout][,tolerance]
;Rule with "[]" prefix will be added directly.
;custom_proxy_group=Proxy`select`.*`[]AUTO`[]DIRECT`.*
;custom_proxy_group=UrlTest`url-test`.*`http://www.gstatic.com/generate_204`300,5,100
;custom_proxy_group=FallBack`fallback`.*`http://www.gstatic.com/generate_204`300,5
;custom_proxy_group=LoadBalance`load-balance`.*`http://www.gstatic.com/generate_204`300,,100
;custom_proxy_group=SSID`ssid`default_group`celluar=group0,ssid1=group1,ssid2=group2
;custom_proxy_group=g1`select`!!GROUPID=0
;custom_proxy_group=g2`select`!!GROUPID=1
;custom_proxy_group=v2ray`select`!!GROUP=V2RayProvider
;custom_proxy_group=g1hk`select`!!GROUPID=0!!(HGC|HKBN|PCCW|HKT|hk|港)
;custom_proxy_group=sstw`select`!!GROUP=V2RayProvider!!(深台|彰化|新北|台|tw)
;custom_proxy_group=provider`select`!!PROVIDER=prov1,prov2,prov3`fallback_nodes
;Also supports using script for filtering nodes. A "filter" function with one argument which is an array of all available nodes should be defined in the script.
;custom_proxy_group=script`select`script:/path/to/script.js
;for forcerule.yml
;custom_proxy_group=!!import:snippets/groups_forcerule.txt
;for Surge rulesets
custom_proxy_group=!!import:snippets/groups.txt
[template]
;The file scope limit of 'include' statement inside the templates.
template_path=templates
;The following settings will be added to the "global" scope of the template variables
;Value of 'clash.http_port' can be accessed with 'global.clash.http_port' in the template.
clash.http_port=7890
clash.socks_port=7891
clash.allow_lan=true
clash.log_level=info
[aliases]
;Aliases for accessing interfaces. Can be used to shorten the URI.
;All arguments passed when accessing the alias name will be appended to the arguments of the alias target.
;Format: uri=target
/v=/version
/clash=/sub?target=clash
/clashr=/sub?target=clashr
/surge=/sub?target=surge
/quan=/sub?target=quan
/quanx=/sub?target=quanx
/mellow=/sub?target=mellow
/surfboard=/sub?target=surfboard
/loon=/sub?target=loon
/ss=/sub?target=ss
/ssd=/sub?target=ssd
/sssub=/sub?target=sssub
/ssr=/sub?target=ssr
/v2ray=/sub?target=v2ray
/trojan=/sub?target=trojan
[server]
;Address to bind on for Web Server
listen=0.0.0.0
;Port to bind on for Web Server
port=25500
[advanced]
log_level=info
print_debug_info=false
max_pending_connections=10240
max_concurrent_threads=2
max_allowed_rulesets=0
max_allowed_rules=0
max_allowed_download_size=0
enable_cache=false
cache_subscription=60
cache_config=300
cache_ruleset=21600
async_fetch_ruleset=false
skip_failed_links=false

151
pref.yml Normal file
View File

@ -0,0 +1,151 @@
common:
api_mode: false
api_access_token: password
default_url: []
enable_insert: true
insert_url: []
prepend_insert_url: true
exclude_remarks: ["(到期|剩余流量|时间|官网|产品|平台)"]
include_remarks: []
enable_filter: false
filter_script: ""
default_external_config: "" # config/example_external_config.yml
base_path: base
clash_rule_base: base/all_base.tpl
surge_rule_base: base/all_base.tpl
surfboard_rule_base: base/all_base.tpl
mellow_rule_base: base/all_base.tpl
quan_rule_base: base/all_base.tpl
quanx_rule_base: base/all_base.tpl
loon_rule_base: base/all_base.tpl
sssub_rule_base: base/all_base.tpl
proxy_config: SYSTEM
proxy_ruleset: SYSTEM
proxy_subscription: NONE
append_proxy_type: false
userinfo:
stream_rule:
- {match: "^剩余流量:(.*?)\\|总流量:(.*)$", replace: "total=$2&left=$1"}
- {match: "^剩余流量:(.*?) (.*)$", replace: "total=$1&left=$2"}
- {match: "^Bandwidth: (.*?)/(.*)$", replace: "used=$1&total=$2"}
- {match: "^.*剩余(.*?)(?:\\s*?)@(?:.*)$", replace: "total=$1"}
- {match: "^.*?流量:(.*?) 剩:(?:.*)$", replace: "total=$1"}
time_rule:
- {match: "^过期时间:(\\d+)-(\\d+)-(\\d+) (\\d+):(\\d+):(\\d+)$", replace: "$1:$2:$3:$4:$5:$6"}
- {match: "^到期时间(:|)(\\d+)-(\\d+)-(\\d+)$", replace: "$1:$2:$3:0:0:0"}
- {match: "^Smart Access expire: (\\d+)/(\\d+)/(\\d+)$", replace: "$1:$2:$3:0:0:0"}
- {match: "^.*?流量:(?:.*?) 剩:(.*?)天$", replace: "left=$1d"}
node_pref:
# udp_flag: false
# tcp_fast_open_flag: false
# skip_cert_verify_flag: false
# tls13_flag: false
sort_flag: false
sort_script: ""
filter_deprecated_nodes: false
append_sub_userinfo: true
clash_use_new_field_name: true
clash_proxies_style: flow
rename_node:
# - {match: "\\(?((x|X)?(\\d+)(\\.?\\d+)?)((\\s?倍率?)|(x|X))\\)?", replace: "$1x"}
# - {script: "function rename(node){}"}
# - {script: "path:/path/to/script.js"}
- {import: snippets/rename_node.txt}
managed_config:
write_managed_config: true
managed_config_prefix: "http://127.0.0.1:25500"
config_update_interval: 86400
config_update_strict: false
quanx_device_id: ""
surge_external_proxy:
surge_ssr_path: "" # /usr/bin/ssr-local
resolve_hostname: true
emojis:
add_emoji: true
remove_old_emoji: true
rules:
# - {match: "(流量|时间|应急)", emoji: "🏳️‍🌈"}
# - {script: "function getEmoji(node){}"}
# - {script: "path:/path/to/script.js"}
- {import: snippets/emoji.txt}
rulesets:
enabled: true
overwrite_original_rules: false
update_ruleset_on_request: false
rulesets:
# - {rule: "GEOIP,CN", group: "DIRECT"}
# - {ruleset: "rules/LocalAreaNetwork.list", group: "DIRECT"}
# - {ruleset: "surge:rules/LocalAreaNetwork.list", group: "DIRECT"}
# - {ruleset: "quanx:https://raw.githubusercontent.com/ConnersHua/Profiles/master/Quantumult/X/Filter/Advertising.list", group: "Advertising", interval: 86400}
# - {ruleset: "clash-domain:https://ruleset.dev/clash_domestic_services_domains", group: "Domestic Services", interval: 86400}
# - {ruleset: "clash-ipcidr:https://ruleset.dev/clash_domestic_services_ips", group: "Domestic Services", interval: 86400}
# - {ruleset: "clash-classic:https://raw.githubusercontent.com/DivineEngine/Profiles/master/Clash/RuleSet/China.yaml", group: "DIRECT", interval: 86400}
- {import: snippets/rulesets.txt}
proxy_groups:
custom_proxy_group:
# - {name: UrlTest, type: url-test, rule: [".*"], url: http://www.gstatic.com/generate_204, interval: 300, tolerance: 100, timeout: 5}
# - {name: Proxy, type: select, rule: [".*"]}
# - {name: group1, type: select, rule: ["!!GROUPID=0"]}
# - {name: v2ray, type: select, rule: ["!!GROUP=V2RayProvider"]}
# - {import: snippets/groups_forcerule.txt}
# - {name: ssid group, type: ssid, rule: ["default_group", "celluar=group0,ssid1=group1,ssid2=group2"]}
- {import: snippets/groups.txt}
template:
template_path: ""
globals:
- {key: clash.http_port, value: 7890}
- {key: clash.socks_port, value: 7891}
- {key: clash.allow_lan, value: true}
- {key: clash.log_level, value: info}
aliases:
- {uri: /v, target: /version}
- {uri: /clash, target: "/sub?target=clash"}
- {uri: /clashr, target: "/sub?target=clashr"}
- {uri: /surge, target: "/sub?target=surge"}
- {uri: /quan, target: "/sub?target=quan"}
- {uri: /quanx, target: "/sub?target=quanx"}
- {uri: /mellow, target: "/sub?target=mellow"}
- {uri: /surfboard, target: "/sub?target=surfboard"}
- {uri: /loon, target: "/sub?target=loon"}
- {uri: /ss, target: "/sub?target=ss"}
- {uri: /ssd, target: "/sub?target=ssd"}
- {uri: /sssub, target: "/sub?target=sssub"}
- {uri: /ssr, target: "/sub?target=ssr"}
- {uri: /v2ray, target: "/sub?target=v2ray"}
- {uri: /trojan, target: "/sub?target=trojan"}
tasks:
# - name: tick
# cronexp: "0/10 * * * * ?"
# path: tick.js
# timeout: 3
server:
listen: 0.0.0.0
port: 25500
serve_file_root: ""
advanced:
log_level: info
print_debug_info: false
max_pending_connections: 10240
max_concurrent_threads: 2
max_allowed_rulesets: 0
max_allowed_rules: 0
max_allowed_download_size: 0
enable_cache: false
cache_subscription: 60
cache_config: 300
cache_ruleset: 21600
script_clean_context: true
async_fetch_ruleset: false
skip_failed_links: false

16
rulesets.txt Normal file
View File

@ -0,0 +1,16 @@
🚫 AdBlock,https://raw.githubusercontent.com/NobyDa/Script/master/Surge/AdRule.list
🚫 AdBlock,https://raw.githubusercontent.com/blackmatrix7/ios_rule_script/master/rule/Surge/Hijacking/Hijacking.list
▶️ YouTube,https://raw.githubusercontent.com/blackmatrix7/ios_rule_script/master/rule/Surge/YouTube/YouTube.list
🍿 Netflix,https://raw.githubusercontent.com/blackmatrix7/ios_rule_script/master/rule/Surge/Netflix/Netflix.list
🐰 DisneyPlus,https://raw.githubusercontent.com/blackmatrix7/ios_rule_script/master/rule/Surge/Disney/Disney.list
💰 PayPal,https://raw.githubusercontent.com/blackmatrix7/ios_rule_script/master/rule/Surge/PayPal/PayPal.list
📺 AppleTV,https://raw.githubusercontent.com/blackmatrix7/ios_rule_script/master/rule/Surge/AppleTV/AppleTV.list
🍎 Apple,https://raw.githubusercontent.com/blackmatrix7/ios_rule_script/master/rule/Surge/Apple/Apple.list
Ⓜ️ Microsoft,https://raw.githubusercontent.com/blackmatrix7/ios_rule_script/master/rule/Surge/Microsoft/Microsoft.list
🔰 PROXY,https://raw.githubusercontent.com/DivineEngine/Profiles/master/Surge/Ruleset/Global.list
🎯 DIRECT,https://raw.githubusercontent.com/blackmatrix7/ios_rule_script/master/rule/Surge/Lan/Lan.list
🎯 DIRECT,https://raw.githubusercontent.com/blackmatrix7/ios_rule_script/master/rule/Surge/China/China.list
🎯 DIRECT,https://raw.githubusercontent.com/blackmatrix7/ios_rule_script/master/rule/Surge/ChinaIPs/ChinaIPs.list
🎯 DIRECT,https://raw.githubusercontent.com/blackmatrix7/ios_rule_script/master/rule/Surge/PrivateTracker/PrivateTracker.list
🎯 DIRECT,[]GEOIP,CN
🐟 Other,[]FINAL