Your commit message
This commit is contained in:
3564
v2ray示例/98-subscribe-clash.yaml
Normal file
3564
v2ray示例/98-subscribe-clash.yaml
Normal file
File diff suppressed because it is too large
Load Diff
10
v2ray示例/99-subscribe-octopus-latest.txt
Normal file
10
v2ray示例/99-subscribe-octopus-latest.txt
Normal file
@@ -0,0 +1,10 @@
|
||||
vmess://eyJ2IjoiMiIsInBzIjoidXMtY2VudGUtZnJlZSIsImFkZCI6Im5vcnRoZmxhbmsuMTA3NDIxLnh5eiIsInBvcnQiOjQ0MywiaWQiOiJkZTA0YWRkOS01YzY4LThiYWItOTUwYy0wOGNkNTMyMGRmMTgiLCJhaWQiOjAsInNjeSI6ImF1dG8iLCJuZXQiOiJ3cyIsInBhdGgiOiIvdm1lc3MiLCJ0bHMiOiJ0bHMifQ==
|
||||
trojan://V2ryStr0ngP0ss@140.238.14.103:443?type=tcp&sni=xx.s4.cc.hh.107421.xyz&allowInsecure=0&host=xx.s4.cc.hh.107421.xyzh2,http/1.1#Seoul-Trojan
|
||||
trojan://Gaa.c12c.389-cc@89.208.251.209:443?security=tls&sni=xx.l4.cc.nn.107421.xyz&alpn=h2%2Chttp%2F1.1&fp=safari&type=tcp&headerType=none#LosAngels-BanH-Trojan-443
|
||||
trojan://G1c.adv12.Pac@89.208.251.209:23306?security=tls&sni=xx.l4.cc.nn.107421.xyz&alpn=h2%2Chttp%2F1.1&fp=safari&type=tcp&headerType=none#LosAngels-BanH-Trojan-23789
|
||||
trojan://V2ryStr0ngP0ss@140.238.14.103:19997?type=tcp&sni=xx.s4.cc.hh.107421.xyz&allowInsecure=0&host=xx.s4.cc.hh.107421.xyzh2,http/1.1#Osaka-Trojan
|
||||
trojan://V2ryStr0ngP0ss@140.238.14.103:19999?type=tcp&sni=xx.s4.cc.hh.107421.xyz&allowInsecure=0&host=xx.s4.cc.hh.107421.xyzh2,http/1.1#Tokyo-Trojan
|
||||
trojan://V2ryStr0ngP0ss@140.238.14.103:19998?type=tcp&sni=xx.s4.cc.hh.107421.xyz&allowInsecure=0&host=xx.s4.cc.hh.107421.xyzh2,http/1.1#Pheonix-Trojan
|
||||
trojan://V2ryStr0ngP0ss@132.145.87.10:30000?type=tcp&sni=xx.s0.yy.ac.107421.xyz&allowInsecure=0&host=xx.s0.yy.ac.107421.xyzh2,http/1.1#Seoul-arm64-01-Trojan
|
||||
trojan://V2ryStr0ngP0ss@43.154.83.213:443?type=tcp&sni=xx.tc.hk.go.107421.xyz&allowInsecure=0h2,http/1.1#Tencent-Hkong-Trojan
|
||||
vless://fc903f5d-a007-482b-928c-570da9a851f9@43.154.83.213:29999?security=reality&flow=xtls-rprx-vision&type=tcp&sni=xx.tc.hk.go.107421.xyz&fp=chrome&pbk=IBKk7cbbpnarU9sxJx84tXztytBFH2oCNfy7FlLVjDg&sid=ad570cbfab&encryption=none&headerType=none#Tencent-HK-11.24
|
||||
896
v2ray示例/Clash/clash-config.yaml
Normal file
896
v2ray示例/Clash/clash-config.yaml
Normal file
@@ -0,0 +1,896 @@
|
||||
#---------------------------------------------------#
|
||||
## 更新:2022-09-28 09:02:50
|
||||
## 感谢:https://github.com/Hackl0us/SS-Rule-Snippet
|
||||
## 链接:https://link.oness.xyz/link/0fHPiayjsMIn6BUC?clash=1
|
||||
#---------------------------------------------------#
|
||||
|
||||
# HTTP 代理端口
|
||||
port: 7890
|
||||
|
||||
# SOCKS5 代理端口
|
||||
socks-port: 7891
|
||||
|
||||
# Linux 和 macOS 的 redir 代理端口
|
||||
redir-port: 7892
|
||||
|
||||
# 允许局域网的连接
|
||||
allow-lan: true
|
||||
|
||||
# 规则模式:Rule(规则) / Global(全局代理)/ Direct(全局直连)
|
||||
mode: Rule
|
||||
|
||||
# 设置日志输出级别 (默认级别:silent,即不输出任何内容,以避免因日志内容过大而导致程序内存溢出)。
|
||||
# 5 个级别:silent / info / warning / error / debug。级别越高日志输出量越大,越倾向于调试,若需要请自行开启。
|
||||
log-level: info
|
||||
# Clash 的 RESTful API
|
||||
external-controller: '0.0.0.0:9090'
|
||||
|
||||
# RESTful API 的口令
|
||||
secret: ''
|
||||
|
||||
# 您可以将静态网页资源(如 clash-dashboard)放置在一个目录中,clash 将会服务于 `RESTful API/ui`
|
||||
# 参数应填写配置目录的相对路径或绝对路径。
|
||||
# external-ui: folder
|
||||
|
||||
|
||||
proxies:
|
||||
# vmess
|
||||
# cipher support auto/aes-128-gcm/chacha20-poly1305/none
|
||||
- name: "Tencent-Shanghai-Relay"
|
||||
type: vmess
|
||||
server: 42.192.52.227
|
||||
port: 19999
|
||||
uuid: 7318178c-5583-40dd-996c-a0add1f8fc1e
|
||||
alterId: 0
|
||||
cipher: auto
|
||||
# udp: true
|
||||
tls: false
|
||||
skip-cert-verify: true
|
||||
# servername: example.com # priority over wss host
|
||||
network: http
|
||||
http-opts:
|
||||
host:
|
||||
path:
|
||||
- /v2ice-vmess-tcp-seoul
|
||||
# headers:
|
||||
# Host: v2ray.com
|
||||
# max-early-data: 2048
|
||||
# early-data-header-name: Sec-WebSocket-Protocol
|
||||
|
||||
proxy-groups:
|
||||
- name: Proxy
|
||||
type: select
|
||||
# disable-udp: true
|
||||
proxies:
|
||||
- Tencent-Shanghai-Relay
|
||||
|
||||
- name: Direct
|
||||
type: select
|
||||
proxies:
|
||||
- DIRECT
|
||||
|
||||
- name: Domestic
|
||||
type: select
|
||||
proxies:
|
||||
- DIRECT
|
||||
- Proxy
|
||||
|
||||
- name: Others
|
||||
type: select
|
||||
proxies:
|
||||
- Proxy
|
||||
- DIRECT
|
||||
|
||||
|
||||
# 规则
|
||||
rules:
|
||||
# anti-ads
|
||||
- DOMAIN-KEYWORD,adservice,REJECT
|
||||
- DOMAIN-SUFFIX,adcolony.com,REJECT
|
||||
- DOMAIN-SUFFIX,adinall.com,REJECT
|
||||
- DOMAIN-SUFFIX,admaster.com.cn,REJECT
|
||||
- DOMAIN-SUFFIX,admob.com,REJECT
|
||||
- DOMAIN-SUFFIX,adnxs.com,REJECT
|
||||
- DOMAIN-SUFFIX,adnyg.com,REJECT
|
||||
- DOMAIN-SUFFIX,adsensor.org,REJECT
|
||||
- DOMAIN-SUFFIX,adsymptotic.com,REJECT
|
||||
- DOMAIN-SUFFIX,adthor.com,REJECT
|
||||
- DOMAIN-SUFFIX,adwhirl.com,REJECT
|
||||
- DOMAIN-SUFFIX,amazon-adsystem.com,REJECT
|
||||
- DOMAIN-SUFFIX,amobee.com,REJECT
|
||||
- DOMAIN-SUFFIX,app-adforce.jp,REJECT
|
||||
- DOMAIN-SUFFIX,appads.com,REJECT
|
||||
- DOMAIN-SUFFIX,appcpi.net,REJECT
|
||||
- DOMAIN-SUFFIX,appier.net,REJECT
|
||||
- DOMAIN-SUFFIX,applift.com,REJECT
|
||||
- DOMAIN-SUFFIX,applovin.com,REJECT
|
||||
- DOMAIN-SUFFIX,applvn.com,REJECT
|
||||
- DOMAIN-SUFFIX,apsalar.com,REJECT
|
||||
- DOMAIN-SUFFIX,apxadtracking.net,REJECT
|
||||
- DOMAIN-SUFFIX,axonix.com,REJECT
|
||||
- DOMAIN-SUFFIX,bayimob.com,REJECT
|
||||
- DOMAIN-SUFFIX,bjvvqu.cn,REJECT
|
||||
- DOMAIN-SUFFIX,bulldogcpi.com,REJECT
|
||||
- DOMAIN-SUFFIX,clotfun.mobi,REJECT
|
||||
- DOMAIN-SUFFIX,clotfun.online,REJECT
|
||||
- DOMAIN-SUFFIX,cloudmobi.net,REJECT
|
||||
- DOMAIN-SUFFIX,crwdcntrl.net,REJECT
|
||||
- DOMAIN-SUFFIX,ctrmi.com,REJECT
|
||||
- DOMAIN-SUFFIX,exosrv.com,REJECT
|
||||
- DOMAIN-SUFFIX,go2cloud.org,REJECT
|
||||
- DOMAIN-SUFFIX,growingio.com,REJECT
|
||||
- DOMAIN-SUFFIX,haloapps.com,REJECT
|
||||
- DOMAIN-SUFFIX,hypers.com,REJECT
|
||||
- DOMAIN-SUFFIX,idealads.net,REJECT
|
||||
- DOMAIN-SUFFIX,inmobi.cn,REJECT
|
||||
- DOMAIN-SUFFIX,inmobi.com,REJECT
|
||||
- DOMAIN-SUFFIX,inmobi.net,REJECT
|
||||
- DOMAIN-SUFFIX,inmobicdn.cn,REJECT
|
||||
- DOMAIN-SUFFIX,inmobicdn.net,REJECT
|
||||
- DOMAIN-SUFFIX,inner-active.mobi,REJECT
|
||||
- DOMAIN-SUFFIX,insurads.com,REJECT
|
||||
- DOMAIN-SUFFIX,ironsrc.com,REJECT
|
||||
- DOMAIN-SUFFIX,irs01.com,REJECT
|
||||
- DOMAIN-SUFFIX,iskyworker.com,REJECT
|
||||
- DOMAIN-SUFFIX,juicyads.com,REJECT
|
||||
- DOMAIN-SUFFIX,kochava.com,REJECT
|
||||
- DOMAIN-SUFFIX,leadboltmobile.net,REJECT
|
||||
- DOMAIN-SUFFIX,lenzmx.com,REJECT
|
||||
- DOMAIN-SUFFIX,liveadvert.com,REJECT
|
||||
- DOMAIN-SUFFIX,lnk0.com,REJECT
|
||||
- DOMAIN-SUFFIX,lnk8.cn,REJECT
|
||||
- DOMAIN-SUFFIX,localytics.com,REJECT
|
||||
- DOMAIN-SUFFIX,mdfull.com,REJECT
|
||||
- DOMAIN-SUFFIX,measurementapi.com,REJECT
|
||||
- DOMAIN-SUFFIX,medialytics.com,REJECT
|
||||
- DOMAIN-SUFFIX,meetrics.com,REJECT
|
||||
- DOMAIN-SUFFIX,meetrics.net,REJECT
|
||||
- DOMAIN-SUFFIX,miaozhen.com,REJECT
|
||||
- DOMAIN-SUFFIX,mmstat.com,REJECT
|
||||
- DOMAIN-SUFFIX,moatads.com,REJECT
|
||||
- DOMAIN-SUFFIX,mobclix.com,REJECT
|
||||
- DOMAIN-SUFFIX,mopub.com,REJECT
|
||||
- DOMAIN-SUFFIX,okjhb.xyz,REJECT
|
||||
- DOMAIN-SUFFIX,openx.net,REJECT
|
||||
- DOMAIN-SUFFIX,outbrain.com,REJECT
|
||||
- DOMAIN-SUFFIX,pubmatic.com,REJECT
|
||||
- DOMAIN-SUFFIX,qchannel01.cn,REJECT
|
||||
- DOMAIN-SUFFIX,rayjump.com,REJECT
|
||||
- DOMAIN-SUFFIX,rtbasia.com,REJECT
|
||||
- DOMAIN-SUFFIX,rubiconproject.com,REJECT
|
||||
- DOMAIN-SUFFIX,scorecardresearch.com,REJECT
|
||||
- DOMAIN-SUFFIX,sdkclick.com,REJECT
|
||||
- DOMAIN-SUFFIX,shuzilm.cn,REJECT
|
||||
- DOMAIN-SUFFIX,smaato.net,REJECT
|
||||
- DOMAIN-SUFFIX,smartadserver.com,REJECT
|
||||
- DOMAIN-SUFFIX,smartnews-ads.com,REJECT
|
||||
- DOMAIN-SUFFIX,supersonic.com,REJECT
|
||||
- DOMAIN-SUFFIX,supersonicads.com,REJECT
|
||||
- DOMAIN-SUFFIX,tagtic.cn,REJECT
|
||||
- DOMAIN-SUFFIX,tanv.com,REJECT
|
||||
- DOMAIN-SUFFIX,tanx.com,REJECT
|
||||
- DOMAIN-SUFFIX,tapjoy.com,REJECT
|
||||
- DOMAIN-SUFFIX,trafficjunky.net,REJECT
|
||||
- DOMAIN-SUFFIX,turn.com,REJECT
|
||||
- DOMAIN-SUFFIX,uri6.com,REJECT
|
||||
- DOMAIN-SUFFIX,vidoomy.com,REJECT
|
||||
- DOMAIN-SUFFIX,vungle.com,REJECT
|
||||
- DOMAIN-SUFFIX,wedolook.com,REJECT
|
||||
- DOMAIN-SUFFIX,xdrig.com,REJECT
|
||||
- DOMAIN-SUFFIX,yumimobi.com,REJECT
|
||||
- DOMAIN-SUFFIX,zu08e.cn,REJECT
|
||||
- DOMAIN-SUFFIX,ad.cmvideo.cn,REJECT
|
||||
- DOMAIN-SUFFIX,ad.daum.net,REJECT
|
||||
- DOMAIN,abema-adx.ameba.jp,REJECT
|
||||
- DOMAIN,ad.12306.cn,REJECT
|
||||
- DOMAIN,ad.360in.com,REJECT
|
||||
- DOMAIN,ad.51wnl-cq.com,REJECT
|
||||
- DOMAIN,ad.caiyunapp.com,REJECT
|
||||
- DOMAIN,ad.huajiao.com,REJECT
|
||||
- DOMAIN,ad.hzyoka.com,REJECT
|
||||
- DOMAIN,ad.jiemian.com,REJECT
|
||||
- DOMAIN,ad.qingting.fm,REJECT
|
||||
- DOMAIN,ad.wappalyzer.com,REJECT
|
||||
- DOMAIN,ad-cn.jovcloud.com,REJECT
|
||||
- DOMAIN,adextra.51wnl-cq.com,REJECT
|
||||
- DOMAIN,api.adnet.mob.com,REJECT
|
||||
- DOMAIN,ads.adadapted.com,REJECT
|
||||
- DOMAIN,ads.chinadaily.com.cn,REJECT
|
||||
- DOMAIN,ads.daydaycook.com.cn,REJECT
|
||||
- DOMAIN,ads.weilitoutiao.net,REJECT
|
||||
- DOMAIN,adsapi.manhuaren.com,REJECT
|
||||
- DOMAIN,adsdk.dmzj.com,REJECT
|
||||
- DOMAIN,adserver.pandora.com,REJECT
|
||||
- DOMAIN,adshow.58.com,REJECT
|
||||
- DOMAIN,adui.tg.meitu.com,REJECT
|
||||
- DOMAIN,adv.bandi.so,REJECT
|
||||
- DOMAIN,app-ad.variflight.com,REJECT
|
||||
- DOMAIN,appnext.hs.llnwd.net,REJECT
|
||||
- DOMAIN,appnext-a.akamaihd.net,REJECT
|
||||
- DOMAIN,ggs.myzaker.com,REJECT
|
||||
- DOMAIN,itad.linetv.tw,REJECT
|
||||
- DOMAIN,ja.chushou.tv,REJECT
|
||||
- DOMAIN,mads.suning.com,REJECT
|
||||
- DOMAIN,mobileads.msn.com,REJECT
|
||||
- DOMAIN,mopnativeadv.037201.com,REJECT
|
||||
- DOMAIN,nativeadv.dftoutiao.com,REJECT
|
||||
- DOMAIN-SUFFIX,iadsdk.apple.com,REJECT
|
||||
- DOMAIN-SUFFIX,ads.internal.unity3d.com,REJECT
|
||||
- DOMAIN-SUFFIX,ads.prd.ie.internal.unity3d.com,REJECT
|
||||
- DOMAIN-SUFFIX,unityads.unity3d.com,REJECT
|
||||
- DOMAIN,optimus-ads.amap.com,REJECT
|
||||
- DOMAIN,optimus-ads.amap.com.w.alikunlun.com,REJECT
|
||||
- DOMAIN,tunion-api.m.taobao.com,REJECT
|
||||
- DOMAIN,adproxy.autohome.com.cn,REJECT
|
||||
- DOMAIN,rd.autohome.com.cn,REJECT
|
||||
- DOMAIN,al.autohome.com.cn,REJECT
|
||||
- DOMAIN,applogapi.autohome.com.cn,REJECT
|
||||
- DOMAIN-SUFFIX,cpro.baidu.com,REJECT
|
||||
- DOMAIN-SUFFIX,pos.baidu.com,REJECT
|
||||
- DOMAIN,afd.baidu.com,REJECT
|
||||
- DOMAIN,als.baidu.com,REJECT
|
||||
- DOMAIN,duclick.baidu.com,REJECT
|
||||
- DOMAIN,mobads.baidu.com,REJECT
|
||||
- DOMAIN,mobads-logs.baidu.com,REJECT
|
||||
- DOMAIN,nsclick.baidu.com,REJECT
|
||||
- DOMAIN,ad.toutiao.com,REJECT
|
||||
- DOMAIN,adx.yiche.com,REJECT
|
||||
- DOMAIN,log.ycapp.yiche.com,REJECT
|
||||
- DOMAIN,advertise.baicizhan.com,REJECT
|
||||
- DOMAIN,advertise.baicizhan.org,REJECT
|
||||
- DOMAIN,galaxy.bjcathay.com,REJECT
|
||||
- DOMAIN,mdrecv.app.cntvwb.cn,REJECT
|
||||
- DOMAIN,sdapprecv.app.cntvwb.cn,REJECT
|
||||
- DOMAIN,vdapprecv.app.cntvwb.cn,REJECT
|
||||
- DOMAIN,ad.21cn.com,REJECT
|
||||
- DOMAIN,ad.k.21cn.com,REJECT
|
||||
- DOMAIN,admarket.21cn.com,REJECT
|
||||
- DOMAIN,adshows.21cn.com,REJECT
|
||||
- DOMAIN,atrace.chelaile.net.cn,REJECT
|
||||
- DOMAIN,logs.chelaile.net.cn,REJECT
|
||||
- DOMAIN-SUFFIX,doubleclick.net,REJECT
|
||||
- DOMAIN-SUFFIX,googleadservices.com,REJECT
|
||||
- DOMAIN-SUFFIX,googleadsserving.cn,REJECT
|
||||
- DOMAIN-SUFFIX,googlesyndication.com,REJECT
|
||||
- DOMAIN-SUFFIX,da.mgtv.com,REJECT
|
||||
- DOMAIN-SUFFIX,da.hunantv.com,REJECT
|
||||
- DOMAIN,adx.hupu.com,REJECT
|
||||
- DOMAIN,adx-api.hupu.com,REJECT
|
||||
- DOMAIN,goblin.hupu.com,REJECT
|
||||
- DOMAIN,t7z.cupid.iqiyi.com,REJECT
|
||||
- IP-CIDR,101.227.97.240/32,REJECT,no-resolve
|
||||
- IP-CIDR,101.227.200.11/32,REJECT,no-resolve
|
||||
- IP-CIDR,101.227.200.28/32,REJECT,no-resolve
|
||||
- IP-CIDR,124.192.153.42/32,REJECT,no-resolve
|
||||
- DOMAIN-SUFFIX,deliver.ifeng.com,REJECT
|
||||
- DOMAIN,api.newad.ifeng.com,REJECT
|
||||
- DOMAIN,ifengad.3g.ifeng.com,REJECT
|
||||
- DOMAIN,adserviceretry.kugou.com,REJECT
|
||||
- DOMAIN,ads.service.kugou.com,REJECT
|
||||
- DOMAIN,adsfile.bssdlbig.kugou.com,REJECT
|
||||
- DOMAIN,g.koowo.com,REJECT
|
||||
- DOMAIN,kgmobilestat.kugou.com,REJECT
|
||||
- DOMAIN,kgmobilestatbak.kugou.com,REJECT
|
||||
- DOMAIN,mobilelog.kugou.com,REJECT
|
||||
- DOMAIN,mobilead.kuwo.cn,REJECT
|
||||
- DOMAIN,rich.kuwo.cn,REJECT
|
||||
- DOMAIN,ad-stat.ksosoft.com,REJECT
|
||||
- DOMAIN,img.auction-ads.wpscdn.cn,REJECT
|
||||
- DOMAIN,counter.kingsoft.com,REJECT
|
||||
- DOMAIN,counter.ksosoft.com,REJECT
|
||||
- DOMAIN,minfo.wps.cn,REJECT
|
||||
- DOMAIN,mobad.ijinshan.com,REJECT
|
||||
- DOMAIN,ups.ksmobile.net,REJECT
|
||||
- DOMAIN,ws.ksmobile.net,REJECT
|
||||
- DOMAIN-SUFFIX,webp2p.letv.com,REJECT
|
||||
- DOMAIN,ark.letv.com,REJECT
|
||||
- DOMAIN,emma-414870e223.huodonghezi.com,REJECT
|
||||
- DOMAIN,g3.letv.com,REJECT
|
||||
- DOMAIN,n.mark.letv.com,REJECT
|
||||
- DOMAIN,ad.hpplay.cn,REJECT
|
||||
- DOMAIN,adcdn.hpplay.cn,REJECT
|
||||
- DOMAIN,adeng.hpplay.cn,REJECT
|
||||
- DOMAIN,rp.hpplay.cn,REJECT
|
||||
- DOMAIN-SUFFIX,ad.intl.xiaomi.com,REJECT
|
||||
- DOMAIN-SUFFIX,ad.xiaomi.com,REJECT
|
||||
- DOMAIN-SUFFIX,admob.xiaomi.com,REJECT
|
||||
- DOMAIN,adv.sec.intl.miui.com,REJECT
|
||||
- DOMAIN,adv.sec.miui.com,REJECT
|
||||
- DOMAIN,ad.api.moji.com,REJECT
|
||||
- DOMAIN,adlaunch.moji.com,REJECT
|
||||
- DOMAIN,ads.mojicdn.com,REJECT
|
||||
- DOMAIN,v1.log.moji.com,REJECT
|
||||
- DOMAIN,ad.bn.netease.com,REJECT
|
||||
- DOMAIN,ad.yixin.im,REJECT
|
||||
- DOMAIN,admusicpic.music.126.net,REJECT
|
||||
- DOMAIN,gorgon.youdao.com,REJECT
|
||||
- DOMAIN,iadmat.nosdn.127.net,REJECT
|
||||
- DOMAIN,iadmusicmat.music.126.net,REJECT
|
||||
- DOMAIN,iadmusicmatvideo.music.126.net,REJECT
|
||||
- DOMAIN,impservice.dictapp.youdao.com,REJECT
|
||||
- DOMAIN,impservice.youdao.com,REJECT
|
||||
- DOMAIN,log.yex.youdao.com,REJECT
|
||||
- DOMAIN,log-yex.youdao.com,REJECT
|
||||
- DOMAIN,n.3g.163.com,REJECT
|
||||
- DOMAIN,nex.163.com,REJECT
|
||||
- DOMAIN,yt-adp.nosdn.127.net,REJECT
|
||||
- DOMAIN,yt-adp.ws.126.net,REJECT
|
||||
- DOMAIN,ads.aplus.pptv.com,REJECT
|
||||
- DOMAIN,ads.aplusapi.pptv.com,REJECT
|
||||
- DOMAIN,asimgs.pplive.cn,REJECT
|
||||
- DOMAIN,de.as.pptv.com,REJECT
|
||||
- DOMAIN,regist.fotoable.com,REJECT
|
||||
- DOMAIN,cdn.adapi.fotoable.com,REJECT
|
||||
- DOMAIN,adnew.wifi8.com,REJECT
|
||||
- DOMAIN,adfile.wifi8.com,REJECT
|
||||
- DOMAIN-SUFFIX,beacon.sina.com.cn,REJECT
|
||||
- DOMAIN,adimg.vue.weibo.com,REJECT
|
||||
- DOMAIN,u1.img.mobile.sina.cn,REJECT
|
||||
- DOMAIN,sax.sina.com.cn,REJECT
|
||||
- DOMAIN,saxs.sina.com.cn,REJECT
|
||||
- DOMAIN,saxn.sina.com.cn,REJECT
|
||||
- DOMAIN-SUFFIX,ad.sohu.com,REJECT
|
||||
- DOMAIN-SUFFIX,ads.sohu.com,REJECT
|
||||
- DOMAIN-SUFFIX,aty.sohu.com,REJECT
|
||||
- DOMAIN,imp.optaim.com,REJECT
|
||||
- DOMAIN,v2.reachmax.cn,REJECT
|
||||
- DOMAIN,track.sohu.com,REJECT
|
||||
- DOMAIN,hui.sohu.com,REJECT
|
||||
- DOMAIN-SUFFIX,e.qq.com,REJECT
|
||||
- DOMAIN-SUFFIX,gdt.qq.com,REJECT
|
||||
- DOMAIN-SUFFIX,l.qq.com,REJECT
|
||||
- DOMAIN,adsmind.apdcdn.tc.qq.com,REJECT
|
||||
- DOMAIN,adsmind.gdtimg.com,REJECT
|
||||
- DOMAIN,adsmind.tc.qq.com,REJECT
|
||||
- DOMAIN,pgdt.gtimg.cn,REJECT
|
||||
- DOMAIN,pgdt.gtimg.com,REJECT
|
||||
- DOMAIN,pgdt.ugdtimg.com,REJECT
|
||||
- DOMAIN,splashqqlive.gtimg.com,REJECT
|
||||
- DOMAIN,wa.gtimg.com,REJECT
|
||||
- DOMAIN,wxsnsdy.wxs.qq.com,REJECT
|
||||
- DOMAIN,wxsnsdythumb.wxs.qq.com,REJECT
|
||||
- DOMAIN,admonitor.thepaper.cn,REJECT
|
||||
- DOMAIN,adpai.thepaper.cn,REJECT
|
||||
- DOMAIN,imgadpai.thepaper.cn,REJECT
|
||||
- DOMAIN,adsp.xunlei.com,REJECT
|
||||
- DOMAIN,etl.xlmc.sandai.net,REJECT
|
||||
- DOMAIN,adm.10jqka.com.cn,REJECT
|
||||
- DOMAIN,stat.10jqka.com.cn,REJECT
|
||||
- DOMAIN,ad-analysis.pconline.com.cn,REJECT
|
||||
- DOMAIN,iad0ssl.pcauto.com.cn,REJECT
|
||||
- DOMAIN,iad0ssl.pconline.com.cn,REJECT
|
||||
- DOMAIN,imgad0.pcauto.com.cn,REJECT
|
||||
- DOMAIN,imgad0.pconline.com.cn,REJECT
|
||||
- DOMAIN,ivy.pchouse.com.cn,REJECT
|
||||
- DOMAIN,a.wkanx.com,REJECT
|
||||
- DOMAIN,cwx.lianwangtech.com,REJECT
|
||||
- DOMAIN,c1wx.lianwangtech.com,REJECT
|
||||
- DOMAIN,ad.ximalaya.com,REJECT
|
||||
- DOMAIN,adbs.ximalaya.com,REJECT
|
||||
- DOMAIN,adse.ximalaya.com,REJECT
|
||||
- DOMAIN,adse.wsa.ximalaya.com,REJECT
|
||||
- DOMAIN,adbehavior.wsa.ximalaya.com,REJECT
|
||||
- DOMAIN,adsebs.ximalaya.com,REJECT
|
||||
- DOMAIN,ads-img-qc.xhscdn.com,REJECT
|
||||
- DOMAIN,ads-video-qc.xhscdn.com,REJECT
|
||||
- DOMAIN,t-ads.xiaohongshu.com,REJECT
|
||||
- DOMAIN-SUFFIX,atm.youku.com,REJECT
|
||||
- DOMAIN,ad.mobile.youku.com,REJECT
|
||||
- DOMAIN,iyes.youku.com,REJECT
|
||||
- DOMAIN,apppv.zol.com.cn,REJECT
|
||||
- DOMAIN,pvnapp.zol.com.cn,REJECT
|
||||
|
||||
# (DNS Cache Pollution Protection)
|
||||
# > Google
|
||||
- DOMAIN-SUFFIX,appspot.com,Proxy
|
||||
- DOMAIN-SUFFIX,blogger.com,Proxy
|
||||
- DOMAIN-SUFFIX,getoutline.org,Proxy
|
||||
- DOMAIN-SUFFIX,gvt0.com,Proxy
|
||||
- DOMAIN-SUFFIX,gvt1.com,Proxy
|
||||
- DOMAIN-SUFFIX,gvt3.com,Proxy
|
||||
- DOMAIN-SUFFIX,xn--ngstr-lra8j.com,Proxy
|
||||
- DOMAIN-KEYWORD,google,Proxy
|
||||
- DOMAIN-KEYWORD,blogspot,Proxy
|
||||
# > Facebook
|
||||
- DOMAIN-SUFFIX,cdninstagram.com,Proxy
|
||||
- DOMAIN-SUFFIX,fb.com,Proxy
|
||||
- DOMAIN-SUFFIX,fb.me,Proxy
|
||||
- DOMAIN-SUFFIX,fbaddins.com,Proxy
|
||||
- DOMAIN-SUFFIX,fbcdn.net,Proxy
|
||||
- DOMAIN-SUFFIX,fbsbx.com,Proxy
|
||||
- DOMAIN-SUFFIX,fbworkmail.com,Proxy
|
||||
- DOMAIN-SUFFIX,instagram.com,Proxy
|
||||
- DOMAIN-SUFFIX,m.me,Proxy
|
||||
- DOMAIN-SUFFIX,messenger.com,Proxy
|
||||
- DOMAIN-SUFFIX,oculus.com,Proxy
|
||||
- DOMAIN-SUFFIX,oculuscdn.com,Proxy
|
||||
- DOMAIN-SUFFIX,rocksdb.org,Proxy
|
||||
- DOMAIN-SUFFIX,whatsapp.com,Proxy
|
||||
- DOMAIN-SUFFIX,whatsapp.net,Proxy
|
||||
- DOMAIN-KEYWORD,facebook,Proxy
|
||||
# > Twitter
|
||||
- DOMAIN-SUFFIX,pscp.tv,Proxy
|
||||
- DOMAIN-SUFFIX,periscope.tv,Proxy
|
||||
- DOMAIN-SUFFIX,t.co,Proxy
|
||||
- DOMAIN-SUFFIX,twimg.co,Proxy
|
||||
- DOMAIN-SUFFIX,twimg.com,Proxy
|
||||
- DOMAIN-SUFFIX,twitpic.com,Proxy
|
||||
- DOMAIN-SUFFIX,vine.co,Proxy
|
||||
- DOMAIN-KEYWORD,twitter,Proxy
|
||||
# > Telegram
|
||||
- DOMAIN-SUFFIX,t.me,Proxy
|
||||
- DOMAIN-SUFFIX,tdesktop.com,Proxy
|
||||
- DOMAIN-SUFFIX,telegra.ph,Proxy
|
||||
- DOMAIN-SUFFIX,telegram.me,Proxy
|
||||
- DOMAIN-SUFFIX,telegram.org,Proxy
|
||||
# > Line
|
||||
- DOMAIN-SUFFIX,line.me,Proxy
|
||||
- DOMAIN-SUFFIX,line-apps.com,Proxy
|
||||
- DOMAIN-SUFFIX,line-scdn.net,Proxy
|
||||
- DOMAIN-SUFFIX,naver.jp,Proxy
|
||||
# > Other
|
||||
- DOMAIN-SUFFIX,4shared.com,Proxy
|
||||
- DOMAIN-SUFFIX,881903.com,Proxy
|
||||
- DOMAIN-SUFFIX,abc.net.au,Proxy
|
||||
- DOMAIN-SUFFIX,abebooks.com,Proxy
|
||||
- DOMAIN-SUFFIX,amazon.co.jp,Proxy
|
||||
- DOMAIN-SUFFIX,apigee.com,Proxy
|
||||
- DOMAIN-SUFFIX,apk-dl.com,Proxy
|
||||
- DOMAIN-SUFFIX,apkmirror.com,Proxy
|
||||
- DOMAIN-SUFFIX,apkmonk.com,Proxy
|
||||
- DOMAIN-SUFFIX,apkpure.com,Proxy
|
||||
- DOMAIN-SUFFIX,aptoide.com,Proxy
|
||||
- DOMAIN-SUFFIX,archive.is,Proxy
|
||||
- DOMAIN-SUFFIX,archive.org,Proxy
|
||||
- DOMAIN-SUFFIX,arte.tv,Proxy
|
||||
- DOMAIN-SUFFIX,ask.com,Proxy
|
||||
- DOMAIN-SUFFIX,avgle.com,Proxy
|
||||
- DOMAIN-SUFFIX,badoo.com,Proxy
|
||||
- DOMAIN-SUFFIX,bandwagonhost.com,Proxy
|
||||
- DOMAIN-SUFFIX,bbc.com,Proxy
|
||||
- DOMAIN-SUFFIX,behance.net,Proxy
|
||||
- DOMAIN-SUFFIX,bibox.com,Proxy
|
||||
- DOMAIN-SUFFIX,biggo.com.tw,Proxy
|
||||
- DOMAIN-SUFFIX,binance.com,Proxy
|
||||
- DOMAIN-SUFFIX,bitcointalk.org,Proxy
|
||||
- DOMAIN-SUFFIX,bitfinex.com,Proxy
|
||||
- DOMAIN-SUFFIX,bitmex.com,Proxy
|
||||
- DOMAIN-SUFFIX,bit-z.com,Proxy
|
||||
- DOMAIN-SUFFIX,bloglovin.com,Proxy
|
||||
- DOMAIN-SUFFIX,bloomberg.cn,Proxy
|
||||
- DOMAIN-SUFFIX,bloomberg.com,Proxy
|
||||
- DOMAIN-SUFFIX,book.com.tw,Proxy
|
||||
- DOMAIN-SUFFIX,booklive.jp,Proxy
|
||||
- DOMAIN-SUFFIX,books.com.tw,Proxy
|
||||
- DOMAIN-SUFFIX,box.com,Proxy
|
||||
- DOMAIN-SUFFIX,brookings.edu,Proxy
|
||||
- DOMAIN-SUFFIX,businessinsider.com,Proxy
|
||||
- DOMAIN-SUFFIX,bwh1.net,Proxy
|
||||
- DOMAIN-SUFFIX,castbox.fm,Proxy
|
||||
- DOMAIN-SUFFIX,cbc.ca,Proxy
|
||||
- DOMAIN-SUFFIX,cdw.com,Proxy
|
||||
- DOMAIN-SUFFIX,change.org,Proxy
|
||||
- DOMAIN-SUFFIX,ck101.com,Proxy
|
||||
- DOMAIN-SUFFIX,clarionproject.org,Proxy
|
||||
- DOMAIN-SUFFIX,clyp.it,Proxy
|
||||
- DOMAIN-SUFFIX,cna.com.tw,Proxy
|
||||
- DOMAIN-SUFFIX,comparitech.com,Proxy
|
||||
- DOMAIN-SUFFIX,conoha.jp,Proxy
|
||||
- DOMAIN-SUFFIX,crucial.com,Proxy
|
||||
- DOMAIN-SUFFIX,cts.com.tw,Proxy
|
||||
- DOMAIN-SUFFIX,cw.com.tw,Proxy
|
||||
- DOMAIN-SUFFIX,cyberctm.com,Proxy
|
||||
- DOMAIN-SUFFIX,dailymotion.com,Proxy
|
||||
- DOMAIN-SUFFIX,dailyview.tw,Proxy
|
||||
- DOMAIN-SUFFIX,daum.net,Proxy
|
||||
- DOMAIN-SUFFIX,daumcdn.net,Proxy
|
||||
- DOMAIN-SUFFIX,dcard.tw,Proxy
|
||||
- DOMAIN-SUFFIX,deepdiscount.com,Proxy
|
||||
- DOMAIN-SUFFIX,deezer.com,Proxy
|
||||
- DOMAIN-SUFFIX,depositphotos.com,Proxy
|
||||
- DOMAIN-SUFFIX,disconnect.me,Proxy
|
||||
- DOMAIN-SUFFIX,discordapp.com,Proxy
|
||||
- DOMAIN-SUFFIX,discordapp.net,Proxy
|
||||
- DOMAIN-SUFFIX,disqus.com,Proxy
|
||||
- DOMAIN-SUFFIX,dns2go.com,Proxy
|
||||
- DOMAIN-SUFFIX,dropbox.com,Proxy
|
||||
- DOMAIN-SUFFIX,dropboxusercontent.com,Proxy
|
||||
- DOMAIN-SUFFIX,duckduckgo.com,Proxy
|
||||
- DOMAIN-SUFFIX,dw.com,Proxy
|
||||
- DOMAIN-SUFFIX,dynu.com,Proxy
|
||||
- DOMAIN-SUFFIX,earthcam.com,Proxy
|
||||
- DOMAIN-SUFFIX,ebookservice.tw,Proxy
|
||||
- DOMAIN-SUFFIX,economist.com,Proxy
|
||||
- DOMAIN-SUFFIX,edgecastcdn.net,Proxy
|
||||
- DOMAIN-SUFFIX,edu,Proxy
|
||||
- DOMAIN-SUFFIX,elpais.com,Proxy
|
||||
- DOMAIN-SUFFIX,enanyang.my,Proxy
|
||||
- DOMAIN-SUFFIX,euronews.com,Proxy
|
||||
- DOMAIN-SUFFIX,feedly.com,Proxy
|
||||
- DOMAIN-SUFFIX,files.wordpress.com,Proxy
|
||||
- DOMAIN-SUFFIX,flickr.com,Proxy
|
||||
- DOMAIN-SUFFIX,flitto.com,Proxy
|
||||
- DOMAIN-SUFFIX,foreignpolicy.com,Proxy
|
||||
- DOMAIN-SUFFIX,friday.tw,Proxy
|
||||
- DOMAIN-SUFFIX,gate.io,Proxy
|
||||
- DOMAIN-SUFFIX,getlantern.org,Proxy
|
||||
- DOMAIN-SUFFIX,getsync.com,Proxy
|
||||
- DOMAIN-SUFFIX,globalvoices.org,Proxy
|
||||
- DOMAIN-SUFFIX,goo.ne.jp,Proxy
|
||||
- DOMAIN-SUFFIX,goodreads.com,Proxy
|
||||
- DOMAIN-SUFFIX,gov.tw,Proxy
|
||||
- DOMAIN-SUFFIX,gumroad.com,Proxy
|
||||
- DOMAIN-SUFFIX,hbg.com,Proxy
|
||||
- DOMAIN-SUFFIX,hightail.com,Proxy
|
||||
- DOMAIN-SUFFIX,hk01.com,Proxy
|
||||
- DOMAIN-SUFFIX,hkbf.org,Proxy
|
||||
- DOMAIN-SUFFIX,hkbookcity.com,Proxy
|
||||
- DOMAIN-SUFFIX,hkej.com,Proxy
|
||||
- DOMAIN-SUFFIX,hket.com,Proxy
|
||||
- DOMAIN-SUFFIX,hkgolden.com,Proxy
|
||||
- DOMAIN-SUFFIX,hootsuite.com,Proxy
|
||||
- DOMAIN-SUFFIX,hudson.org,Proxy
|
||||
- DOMAIN-SUFFIX,huobi.pro,Proxy
|
||||
- DOMAIN-SUFFIX,initiummall.com,Proxy
|
||||
- DOMAIN-SUFFIX,ipfs.io,Proxy
|
||||
- DOMAIN-SUFFIX,issuu.com,Proxy
|
||||
- DOMAIN-SUFFIX,japantimes.co.jp,Proxy
|
||||
- DOMAIN-SUFFIX,jiji.com,Proxy
|
||||
- DOMAIN-SUFFIX,jinx.com,Proxy
|
||||
- DOMAIN-SUFFIX,jkforum.net,Proxy
|
||||
- DOMAIN-SUFFIX,joinmastodon.org,Proxy
|
||||
- DOMAIN-SUFFIX,kakao.com,Proxy
|
||||
- DOMAIN-SUFFIX,lihkg.com,Proxy
|
||||
- DOMAIN-SUFFIX,live.com,Proxy
|
||||
- DOMAIN-SUFFIX,mail.ru,Proxy
|
||||
- DOMAIN-SUFFIX,matters.news,Proxy
|
||||
- DOMAIN-SUFFIX,medium.com,Proxy
|
||||
- DOMAIN-SUFFIX,mega.nz,Proxy
|
||||
- DOMAIN-SUFFIX,mil,Proxy
|
||||
- DOMAIN-SUFFIX,mobile01.com,Proxy
|
||||
- DOMAIN-SUFFIX,naver.com,Proxy
|
||||
- DOMAIN-SUFFIX,nikkei.com,Proxy
|
||||
- DOMAIN-SUFFIX,nofile.io,Proxy
|
||||
- DOMAIN-SUFFIX,now.com,Proxy
|
||||
- DOMAIN-SUFFIX,nyt.com,Proxy
|
||||
- DOMAIN-SUFFIX,nytchina.com,Proxy
|
||||
- DOMAIN-SUFFIX,nytcn.me,Proxy
|
||||
- DOMAIN-SUFFIX,nytco.com,Proxy
|
||||
- DOMAIN-SUFFIX,nytimes.com,Proxy
|
||||
- DOMAIN-SUFFIX,nytimg.com,Proxy
|
||||
- DOMAIN-SUFFIX,nytlog.com,Proxy
|
||||
- DOMAIN-SUFFIX,nytstyle.com,Proxy
|
||||
- DOMAIN-SUFFIX,ok.ru,Proxy
|
||||
- DOMAIN-SUFFIX,okex.com,Proxy
|
||||
- DOMAIN-SUFFIX,pcloud.com,Proxy
|
||||
- DOMAIN-SUFFIX,pinimg.com,Proxy
|
||||
- DOMAIN-SUFFIX,pixiv.net,Proxy
|
||||
- DOMAIN-SUFFIX,pornhub.com,Proxy
|
||||
- DOMAIN-SUFFIX,pureapk.com,Proxy
|
||||
- DOMAIN-SUFFIX,quora.com,Proxy
|
||||
- DOMAIN-SUFFIX,quoracdn.net,Proxy
|
||||
- DOMAIN-SUFFIX,rakuten.co.jp,Proxy
|
||||
- DOMAIN-SUFFIX,reddit.com,Proxy
|
||||
- DOMAIN-SUFFIX,redditmedia.com,Proxy
|
||||
- DOMAIN-SUFFIX,resilio.com,Proxy
|
||||
- DOMAIN-SUFFIX,reuters.com,Proxy
|
||||
- DOMAIN-SUFFIX,scmp.com,Proxy
|
||||
- DOMAIN-SUFFIX,scribd.com,Proxy
|
||||
- DOMAIN-SUFFIX,seatguru.com,Proxy
|
||||
- DOMAIN-SUFFIX,shadowsocks.org,Proxy
|
||||
- DOMAIN-SUFFIX,slideshare.net,Proxy
|
||||
- DOMAIN-SUFFIX,soundcloud.com,Proxy
|
||||
- DOMAIN-SUFFIX,startpage.com,Proxy
|
||||
- DOMAIN-SUFFIX,steamcommunity.com,Proxy
|
||||
- DOMAIN-SUFFIX,steemit.com,Proxy
|
||||
- DOMAIN-SUFFIX,t66y.com,Proxy
|
||||
- DOMAIN-SUFFIX,teco-hk.org,Proxy
|
||||
- DOMAIN-SUFFIX,teco-mo.org,Proxy
|
||||
- DOMAIN-SUFFIX,teddysun.com,Proxy
|
||||
- DOMAIN-SUFFIX,theinitium.com,Proxy
|
||||
- DOMAIN-SUFFIX,tineye.com,Proxy
|
||||
- DOMAIN-SUFFIX,torproject.org,Proxy
|
||||
- DOMAIN-SUFFIX,tumblr.com,Proxy
|
||||
- DOMAIN-SUFFIX,turbobit.net,Proxy
|
||||
- DOMAIN-SUFFIX,twitch.tv,Proxy
|
||||
- DOMAIN-SUFFIX,udn.com,Proxy
|
||||
- DOMAIN-SUFFIX,unseen.is,Proxy
|
||||
- DOMAIN-SUFFIX,upmedia.mg,Proxy
|
||||
- DOMAIN-SUFFIX,uptodown.com,Proxy
|
||||
- DOMAIN-SUFFIX,ustream.tv,Proxy
|
||||
- DOMAIN-SUFFIX,uwants.com,Proxy
|
||||
- DOMAIN-SUFFIX,v2ray.com,Proxy
|
||||
- DOMAIN-SUFFIX,viber.com,Proxy
|
||||
- DOMAIN-SUFFIX,videopress.com,Proxy
|
||||
- DOMAIN-SUFFIX,vimeo.com,Proxy
|
||||
- DOMAIN-SUFFIX,voxer.com,Proxy
|
||||
- DOMAIN-SUFFIX,vzw.com,Proxy
|
||||
- DOMAIN-SUFFIX,w3schools.com,Proxy
|
||||
- DOMAIN-SUFFIX,wattpad.com,Proxy
|
||||
- DOMAIN-SUFFIX,whoer.net,Proxy
|
||||
- DOMAIN-SUFFIX,wikimapia.org,Proxy
|
||||
- DOMAIN-SUFFIX,wikipedia.org,Proxy
|
||||
- DOMAIN-SUFFIX,wire.com,Proxy
|
||||
- DOMAIN-SUFFIX,worldcat.org,Proxy
|
||||
- DOMAIN-SUFFIX,wsj.com,Proxy
|
||||
- DOMAIN-SUFFIX,wsj.net,Proxy
|
||||
- DOMAIN-SUFFIX,xboxlive.com,Proxy
|
||||
- DOMAIN-SUFFIX,xvideos.com,Proxy
|
||||
- DOMAIN-SUFFIX,yahoo.com,Proxy
|
||||
- DOMAIN-SUFFIX,yesasia.com,Proxy
|
||||
- DOMAIN-SUFFIX,yes-news.com,Proxy
|
||||
- DOMAIN-SUFFIX,yomiuri.co.jp,Proxy
|
||||
- DOMAIN-SUFFIX,you-get.org,Proxy
|
||||
- DOMAIN-SUFFIX,zb.com,Proxy
|
||||
- DOMAIN-SUFFIX,zello.com,Proxy
|
||||
- DOMAIN-SUFFIX,zeronet.io,Proxy
|
||||
- DOMAIN,cdn-images.mailchimp.com,Proxy
|
||||
- DOMAIN,id.heroku.com,Proxy
|
||||
- DOMAIN-KEYWORD,github,Proxy
|
||||
- DOMAIN-KEYWORD,jav,Proxy
|
||||
- DOMAIN-KEYWORD,pinterest,Proxy
|
||||
- DOMAIN-KEYWORD,porn,Proxy
|
||||
- DOMAIN-KEYWORD,wikileaks,Proxy
|
||||
|
||||
# (Region-Restricted Access Denied)
|
||||
- DOMAIN-SUFFIX,apartmentratings.com,Proxy
|
||||
- DOMAIN-SUFFIX,apartments.com,Proxy
|
||||
- DOMAIN-SUFFIX,bankmobilevibe.com,Proxy
|
||||
- DOMAIN-SUFFIX,bing.com,Proxy
|
||||
- DOMAIN-SUFFIX,booktopia.com.au,Proxy
|
||||
- DOMAIN-SUFFIX,centauro.com.br,Proxy
|
||||
- DOMAIN-SUFFIX,clearsurance.com,Proxy
|
||||
- DOMAIN-SUFFIX,costco.com,Proxy
|
||||
- DOMAIN-SUFFIX,crackle.com,Proxy
|
||||
- DOMAIN-SUFFIX,depositphotos.cn,Proxy
|
||||
- DOMAIN-SUFFIX,dish.com,Proxy
|
||||
- DOMAIN-SUFFIX,dmm.co.jp,Proxy
|
||||
- DOMAIN-SUFFIX,dmm.com,Proxy
|
||||
- DOMAIN-SUFFIX,dnvod.tv,Proxy
|
||||
- DOMAIN-SUFFIX,esurance.com,Proxy
|
||||
- DOMAIN-SUFFIX,extmatrix.com,Proxy
|
||||
- DOMAIN-SUFFIX,fastpic.ru,Proxy
|
||||
- DOMAIN-SUFFIX,flipboard.com,Proxy
|
||||
- DOMAIN-SUFFIX,fnac.be,Proxy
|
||||
- DOMAIN-SUFFIX,fnac.com,Proxy
|
||||
- DOMAIN-SUFFIX,funkyimg.com,Proxy
|
||||
- DOMAIN-SUFFIX,fxnetworks.com,Proxy
|
||||
- DOMAIN-SUFFIX,gettyimages.com,Proxy
|
||||
- DOMAIN-SUFFIX,jcpenney.com,Proxy
|
||||
- DOMAIN-SUFFIX,kknews.cc,Proxy
|
||||
- DOMAIN-SUFFIX,nationwide.com,Proxy
|
||||
- DOMAIN-SUFFIX,nbc.com,Proxy
|
||||
- DOMAIN-SUFFIX,nordstrom.com,Proxy
|
||||
- DOMAIN-SUFFIX,nordstromimage.com,Proxy
|
||||
- DOMAIN-SUFFIX,nordstromrack.com,Proxy
|
||||
- DOMAIN-SUFFIX,read01.com,Proxy
|
||||
- DOMAIN-SUFFIX,superpages.com,Proxy
|
||||
- DOMAIN-SUFFIX,target.com,Proxy
|
||||
- DOMAIN-SUFFIX,thinkgeek.com,Proxy
|
||||
- DOMAIN-SUFFIX,tracfone.com,Proxy
|
||||
- DOMAIN-SUFFIX,uploader.jp,Proxy
|
||||
- DOMAIN-SUFFIX,vevo.com,Proxy
|
||||
- DOMAIN-SUFFIX,viu.tv,Proxy
|
||||
- DOMAIN-SUFFIX,vk.com,Proxy
|
||||
- DOMAIN-SUFFIX,vsco.co,Proxy
|
||||
- DOMAIN-SUFFIX,xfinity.com,Proxy
|
||||
- DOMAIN-SUFFIX,zattoo.com,Proxy
|
||||
- DOMAIN,abc.com,Proxy
|
||||
- DOMAIN,abc.go.com,Proxy
|
||||
- DOMAIN,abc.net.au,Proxy
|
||||
- DOMAIN,wego.here.com,Proxy
|
||||
|
||||
# > Telegram
|
||||
- DOMAIN-SUFFIX,t.me,Proxy
|
||||
- DOMAIN-SUFFIX,tdesktop.com,Proxy
|
||||
- DOMAIN-SUFFIX,telegra.ph,Proxy
|
||||
- DOMAIN-SUFFIX,telegram.me,Proxy
|
||||
- DOMAIN-SUFFIX,telegram.org,Proxy
|
||||
- IP-CIDR,91.108.0.0/16,Proxy,no-resolve
|
||||
- IP-CIDR,109.239.140.0/24,Proxy,no-resolve
|
||||
- IP-CIDR,149.154.160.0/20,Proxy,no-resolve
|
||||
- IP-CIDR6,2001:67c:4e8::/48,Proxy,no-resolve
|
||||
- IP-CIDR6,2001:b28:f23d::/48,Proxy,no-resolve
|
||||
- IP-CIDR6,2001:b28:f23f::/48,Proxy,no-resolve
|
||||
#USER-AGENT,Roam*,Proxy
|
||||
|
||||
# (The Most Popular Sites)
|
||||
# > Apple
|
||||
# > Apple URL Shortener
|
||||
- DOMAIN-SUFFIX,appsto.re,Proxy
|
||||
# > TestFlight
|
||||
- DOMAIN,beta.itunes.apple.com,Proxy
|
||||
# > iBooks Store download
|
||||
- DOMAIN,books.itunes.apple.com,Proxy
|
||||
# > iTunes Store Moveis Trailers
|
||||
- DOMAIN,hls.itunes.apple.com,Proxy
|
||||
# App Store Preview
|
||||
- DOMAIN,itunes.apple.com,Proxy
|
||||
# > Spotlight
|
||||
- DOMAIN,api-glb-sea.smoot.apple.com,Proxy
|
||||
# > Dictionary
|
||||
- DOMAIN,lookup-api.apple.com,Proxy
|
||||
#PROCESS-NAME,LookupViewService,Proxy
|
||||
# > Google
|
||||
- DOMAIN-SUFFIX,abc.xyz,Proxy
|
||||
- DOMAIN-SUFFIX,android.com,Proxy
|
||||
- DOMAIN-SUFFIX,androidify.com,Proxy
|
||||
- DOMAIN-SUFFIX,dialogflow.com,Proxy
|
||||
- DOMAIN-SUFFIX,autodraw.com,Proxy
|
||||
- DOMAIN-SUFFIX,capitalg.com,Proxy
|
||||
- DOMAIN-SUFFIX,certificate-transparency.org,Proxy
|
||||
- DOMAIN-SUFFIX,chrome.com,Proxy
|
||||
- DOMAIN-SUFFIX,chromeexperiments.com,Proxy
|
||||
- DOMAIN-SUFFIX,chromestatus.com,Proxy
|
||||
- DOMAIN-SUFFIX,chromium.org,Proxy
|
||||
- DOMAIN-SUFFIX,creativelab5.com,Proxy
|
||||
- DOMAIN-SUFFIX,debug.com,Proxy
|
||||
- DOMAIN-SUFFIX,deepmind.com,Proxy
|
||||
- DOMAIN-SUFFIX,firebaseio.com,Proxy
|
||||
- DOMAIN-SUFFIX,getmdl.io,Proxy
|
||||
- DOMAIN-SUFFIX,ggpht.com,Proxy
|
||||
- DOMAIN-SUFFIX,gmail.com,Proxy
|
||||
- DOMAIN-SUFFIX,gmodules.com,Proxy
|
||||
- DOMAIN-SUFFIX,godoc.org,Proxy
|
||||
- DOMAIN-SUFFIX,golang.org,Proxy
|
||||
- DOMAIN-SUFFIX,gstatic.com,Proxy
|
||||
- DOMAIN-SUFFIX,gv.com,Proxy
|
||||
- DOMAIN-SUFFIX,gwtproject.org,Proxy
|
||||
- DOMAIN-SUFFIX,itasoftware.com,Proxy
|
||||
- DOMAIN-SUFFIX,madewithcode.com,Proxy
|
||||
- DOMAIN-SUFFIX,material.io,Proxy
|
||||
- DOMAIN-SUFFIX,polymer-project.org,Proxy
|
||||
- DOMAIN-SUFFIX,admin.recaptcha.net,Proxy
|
||||
- DOMAIN-SUFFIX,recaptcha.net,Proxy
|
||||
- DOMAIN-SUFFIX,shattered.io,Proxy
|
||||
- DOMAIN-SUFFIX,synergyse.com,Proxy
|
||||
- DOMAIN-SUFFIX,tensorflow.org,Proxy
|
||||
- DOMAIN-SUFFIX,tiltbrush.com,Proxy
|
||||
- DOMAIN-SUFFIX,waveprotocol.org,Proxy
|
||||
- DOMAIN-SUFFIX,waymo.com,Proxy
|
||||
- DOMAIN-SUFFIX,webmproject.org,Proxy
|
||||
- DOMAIN-SUFFIX,webrtc.org,Proxy
|
||||
- DOMAIN-SUFFIX,whatbrowser.org,Proxy
|
||||
- DOMAIN-SUFFIX,widevine.com,Proxy
|
||||
- DOMAIN-SUFFIX,x.company,Proxy
|
||||
- DOMAIN-SUFFIX,youtu.be,Proxy
|
||||
- DOMAIN-SUFFIX,yt.be,Proxy
|
||||
- DOMAIN-SUFFIX,ytimg.com,Proxy
|
||||
# > Steam
|
||||
- DOMAIN,media.steampowered.com,Proxy
|
||||
- DOMAIN,store.steampowered.com,Proxy
|
||||
# > Other
|
||||
- DOMAIN-SUFFIX,0rz.tw,Proxy
|
||||
- DOMAIN-SUFFIX,4bluestones.biz,Proxy
|
||||
- DOMAIN-SUFFIX,9bis.net,Proxy
|
||||
- DOMAIN-SUFFIX,allconnected.co,Proxy
|
||||
- DOMAIN-SUFFIX,amazonaws.com,Proxy
|
||||
- DOMAIN-SUFFIX,aol.com,Proxy
|
||||
- DOMAIN-SUFFIX,bcc.com.tw,Proxy
|
||||
- DOMAIN-SUFFIX,bit.ly,Proxy
|
||||
- DOMAIN-SUFFIX,bitshare.com,Proxy
|
||||
- DOMAIN-SUFFIX,blog.jp,Proxy
|
||||
- DOMAIN-SUFFIX,blogimg.jp,Proxy
|
||||
- DOMAIN-SUFFIX,blogtd.org,Proxy
|
||||
- DOMAIN-SUFFIX,broadcast.co.nz,Proxy
|
||||
- DOMAIN-SUFFIX,camfrog.com,Proxy
|
||||
- DOMAIN-SUFFIX,cfos.de,Proxy
|
||||
- DOMAIN-SUFFIX,citypopulation.de,Proxy
|
||||
- DOMAIN-SUFFIX,cloudfront.net,Proxy
|
||||
- DOMAIN-SUFFIX,ctitv.com.tw,Proxy
|
||||
- DOMAIN-SUFFIX,cuhk.edu.hk,Proxy
|
||||
- DOMAIN-SUFFIX,cusu.hk,Proxy
|
||||
- DOMAIN-SUFFIX,discuss.com.hk,Proxy
|
||||
- DOMAIN-SUFFIX,dropboxapi.com,Proxy
|
||||
- DOMAIN-SUFFIX,edditstatic.com,Proxy
|
||||
- DOMAIN-SUFFIX,flickriver.com,Proxy
|
||||
- DOMAIN-SUFFIX,focustaiwan.tw,Proxy
|
||||
- DOMAIN-SUFFIX,free.fr,Proxy
|
||||
- DOMAIN-SUFFIX,ftchinese.com,Proxy
|
||||
- DOMAIN-SUFFIX,gigacircle.com,Proxy
|
||||
- DOMAIN-SUFFIX,gov,Proxy
|
||||
- DOMAIN-SUFFIX,hk-pub.com,Proxy
|
||||
- DOMAIN-SUFFIX,hosting.co.uk,Proxy
|
||||
- DOMAIN-SUFFIX,hwcdn.net,Proxy
|
||||
- DOMAIN-SUFFIX,jtvnw.net,Proxy
|
||||
- DOMAIN-SUFFIX,linksalpha.com,Proxy
|
||||
- DOMAIN-SUFFIX,manyvids.com,Proxy
|
||||
- DOMAIN-SUFFIX,myactimes.com,Proxy
|
||||
- DOMAIN-SUFFIX,newsblur.com,Proxy
|
||||
- DOMAIN-SUFFIX,now.im,Proxy
|
||||
- DOMAIN-SUFFIX,redditlist.com,Proxy
|
||||
- DOMAIN-SUFFIX,signal.org,Proxy
|
||||
- DOMAIN-SUFFIX,sparknotes.com,Proxy
|
||||
- DOMAIN-SUFFIX,streetvoice.com,Proxy
|
||||
- DOMAIN-SUFFIX,ttvnw.net,Proxy
|
||||
- DOMAIN-SUFFIX,tv.com,Proxy
|
||||
- DOMAIN-SUFFIX,twitchcdn.net,Proxy
|
||||
- DOMAIN-SUFFIX,typepad.com,Proxy
|
||||
- DOMAIN-SUFFIX,udnbkk.com,Proxy
|
||||
- DOMAIN-SUFFIX,whispersystems.org,Proxy
|
||||
- DOMAIN-SUFFIX,wikia.com,Proxy
|
||||
- DOMAIN-SUFFIX,wn.com,Proxy
|
||||
- DOMAIN-SUFFIX,wolframalpha.com,Proxy
|
||||
- DOMAIN-SUFFIX,x-art.com,Proxy
|
||||
- DOMAIN-SUFFIX,yimg.com,Proxy
|
||||
|
||||
- DOMAIN-KEYWORD,dlercloud,Proxy
|
||||
- DOMAIN-SUFFIX,dler.cloud,Proxy
|
||||
|
||||
# Local Area Network
|
||||
- DOMAIN-KEYWORD,announce,DIRECT
|
||||
- DOMAIN-KEYWORD,torrent,DIRECT
|
||||
- DOMAIN-KEYWORD,tracker,DIRECT
|
||||
- DOMAIN-SUFFIX,smtp,DIRECT
|
||||
- DOMAIN-SUFFIX,local,DIRECT
|
||||
- IP-CIDR,192.168.0.0/16,DIRECT
|
||||
- IP-CIDR,10.0.0.0/8,DIRECT
|
||||
- IP-CIDR,172.16.0.0/12,DIRECT
|
||||
- IP-CIDR,127.0.0.0/8,DIRECT
|
||||
- IP-CIDR,100.64.0.0/10,DIRECT
|
||||
|
||||
# # > IQIYI
|
||||
# - IP-CIDR,101.227.0.0/16,Bilibili|iQIYI|NeteaseMusic|TencentVideo
|
||||
# - IP-CIDR,101.224.0.0/13,Bilibili|iQIYI|NeteaseMusic|TencentVideo
|
||||
# - IP-CIDR,119.176.0.0/12,Bilibili|iQIYI|NeteaseMusic|TencentVideo
|
||||
|
||||
# # > Youku
|
||||
# - IP-CIDR,106.11.0.0/16,Bilibili|iQIYI|NeteaseMusic|TencentVideo
|
||||
|
||||
# > Telegram
|
||||
- IP-CIDR,67.198.55.0/24,Proxy
|
||||
- IP-CIDR,91.108.4.0/22,Proxy
|
||||
- IP-CIDR,91.108.8.0/22,Proxy
|
||||
- IP-CIDR,91.108.12.0/22,Proxy
|
||||
- IP-CIDR,91.108.16.0/22,Proxy
|
||||
- IP-CIDR,91.108.56.0/22,Proxy
|
||||
- IP-CIDR,109.239.140.0/24,Proxy
|
||||
- IP-CIDR,149.154.160.0/20,Proxy
|
||||
- IP-CIDR,205.172.60.0/22,Proxy
|
||||
|
||||
# (Extra IP-CIRD)
|
||||
# > Google
|
||||
- IP-CIDR,35.190.247.0/24,Proxy
|
||||
- IP-CIDR,64.233.160.0/19,Proxy
|
||||
- IP-CIDR,66.102.0.0/20,Proxy
|
||||
- IP-CIDR,66.249.80.0/20,Proxy
|
||||
- IP-CIDR,72.14.192.0/18,Proxy
|
||||
- IP-CIDR,74.125.0.0/16,Proxy
|
||||
- IP-CIDR,108.177.8.0/21,Proxy
|
||||
- IP-CIDR,172.217.0.0/16,Proxy
|
||||
- IP-CIDR,173.194.0.0/16,Proxy
|
||||
- IP-CIDR,209.85.128.0/17,Proxy
|
||||
- IP-CIDR,216.58.192.0/19,Proxy
|
||||
- IP-CIDR,216.239.32.0/19,Proxy
|
||||
# > Facebook
|
||||
- IP-CIDR,31.13.24.0/21,Proxy
|
||||
- IP-CIDR,31.13.64.0/18,Proxy
|
||||
- IP-CIDR,45.64.40.0/22,Proxy
|
||||
- IP-CIDR,66.220.144.0/20,Proxy
|
||||
- IP-CIDR,69.63.176.0/20,Proxy
|
||||
- IP-CIDR,69.171.224.0/19,Proxy
|
||||
- IP-CIDR,74.119.76.0/22,Proxy
|
||||
- IP-CIDR,103.4.96.0/22,Proxy
|
||||
- IP-CIDR,129.134.0.0/17,Proxy
|
||||
- IP-CIDR,157.240.0.0/17,Proxy
|
||||
- IP-CIDR,173.252.64.0/19,Proxy
|
||||
- IP-CIDR,173.252.96.0/19,Proxy
|
||||
- IP-CIDR,179.60.192.0/22,Proxy
|
||||
- IP-CIDR,185.60.216.0/22,Proxy
|
||||
- IP-CIDR,204.15.20.0/22,Proxy
|
||||
# > Twitter
|
||||
- IP-CIDR,69.195.160.0/19,Proxy
|
||||
- IP-CIDR,104.244.42.0/21,Proxy
|
||||
- IP-CIDR,192.133.76.0/22,Proxy
|
||||
- IP-CIDR,199.16.156.0/22,Proxy
|
||||
- IP-CIDR,199.59.148.0/22,Proxy
|
||||
- IP-CIDR,199.96.56.0/21,Proxy
|
||||
- IP-CIDR,202.160.128.0/22,Proxy
|
||||
- IP-CIDR,209.237.192.0/19,Proxy
|
||||
|
||||
|
||||
|
||||
# GeoIP China
|
||||
- GEOIP,CN,Domestic
|
||||
|
||||
- MATCH,Others
|
||||
28
v2ray示例/Clash/clash-for-windows-config.yaml
Normal file
28
v2ray示例/Clash/clash-for-windows-config.yaml
Normal file
@@ -0,0 +1,28 @@
|
||||
mixed-port: 7890
|
||||
allow-lan: false
|
||||
external-controller: 127.0.0.1:61889
|
||||
secret: 5c090877-21bb-4006-a97c-0bd4bfbb9be9
|
||||
log-level: info
|
||||
ipv6: false
|
||||
proxy-groups:
|
||||
- name: PROXY-ALL
|
||||
type: select
|
||||
proxies:
|
||||
- tc-sh
|
||||
proxies:
|
||||
- name: proxy-server
|
||||
type: socks5
|
||||
server: 192.168.11.19
|
||||
port: 22999
|
||||
username: zeaslity
|
||||
password: password
|
||||
- name: tc-sh
|
||||
type: socks5
|
||||
server: 42.192.52.227
|
||||
port: 28888
|
||||
username: zeaslity
|
||||
password: lovemm.23
|
||||
- name: tc-sh
|
||||
type: socks5
|
||||
server: 42.192.52.227
|
||||
port: 28889
|
||||
0
v2ray示例/Clash/clash-socks5-server.yaml
Normal file
0
v2ray示例/Clash/clash-socks5-server.yaml
Normal file
BIN
v2ray示例/XRay-安装脚本/Xray-linux-64-v1.6.0.zip
Normal file
BIN
v2ray示例/XRay-安装脚本/Xray-linux-64-v1.6.0.zip
Normal file
Binary file not shown.
2
v2ray示例/XRay-安装脚本/Xray安装脚本.txt
Normal file
2
v2ray示例/XRay-安装脚本/Xray安装脚本.txt
Normal file
@@ -0,0 +1,2 @@
|
||||
|
||||
bash -c "$(curl -L https://github.com/XTLS/Xray-install/raw/main/install-release.sh)" @ install --without-geodata
|
||||
21
v2ray示例/XRay-安装脚本/Xray证书申请模板.txt
Normal file
21
v2ray示例/XRay-安装脚本/Xray证书申请模板.txt
Normal file
@@ -0,0 +1,21 @@
|
||||
|
||||
# 香港 xx.tc.hk.go.107421.xyz
|
||||
# Seoul-arm64-01 xx.s0.yy.ac.107421.xyz
|
||||
# Seoul-amd64-04 xx.s4.cc.hh.107421.xyz
|
||||
# LosAngeles-amd64-01 xx.l4.cc.nn.107421.xyz
|
||||
|
||||
export DOMAIN_NAME=xx.l4.cc.nn.107421.xyz
|
||||
|
||||
export CF_Token="oXJRP5XI8Zhipa_PtYtB_jy6qWL0I9BosrJEYE8p"
|
||||
export CF_Account_ID="dfaadeb83406ef5ad35da02617af9191"
|
||||
export CF_Zone_ID="511894a4f1357feb905e974e16241ebb"
|
||||
|
||||
acme.sh --issue --dns dns_cf -d ${DOMAIN_NAME} --keylength ec-256
|
||||
|
||||
chmod -R 644 /root/.acme.sh/${DOMAIN_NAME}_ecc/fullchain.cer
|
||||
chmod -R 644 /root/.acme.sh/${DOMAIN_NAME}_ecc/${DOMAIN_NAME}.key
|
||||
|
||||
systemctl restart xray && sleep 1 && systemctl status xray
|
||||
|
||||
|
||||
curl https://get.acme.sh | sh -s email=ice@qq.com
|
||||
744
v2ray示例/XRay-安装脚本/xray-install-另外的版本.sh
Normal file
744
v2ray示例/XRay-安装脚本/xray-install-另外的版本.sh
Normal file
@@ -0,0 +1,744 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
#====================================================
|
||||
# System Request:Debian 9+/Ubuntu 18.04+/Centos 7+
|
||||
# Author: wulabing
|
||||
# Dscription: Xray onekey Management
|
||||
# email: admin@wulabing.com
|
||||
#====================================================
|
||||
|
||||
export PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
|
||||
stty erase ^?
|
||||
|
||||
cd "$(
|
||||
cd "$(dirname "$0")" || exit
|
||||
pwd
|
||||
)" || exit
|
||||
|
||||
# 字体颜色配置
|
||||
Green="\033[32m"
|
||||
Red="\033[31m"
|
||||
Yellow="\033[33m"
|
||||
Blue="\033[36m"
|
||||
Font="\033[0m"
|
||||
GreenBG="\033[42;37m"
|
||||
RedBG="\033[41;37m"
|
||||
OK="${Green}[OK]${Font}"
|
||||
ERROR="${Red}[ERROR]${Font}"
|
||||
|
||||
# 变量
|
||||
shell_version="1.3.7"
|
||||
github_branch="main"
|
||||
xray_conf_dir="/usr/local/etc/xray"
|
||||
website_dir="/www/xray_web/"
|
||||
xray_access_log="/var/log/xray/access.log"
|
||||
xray_error_log="/var/log/xray/error.log"
|
||||
cert_dir="/usr/local/etc/xray"
|
||||
domain_tmp_dir="/usr/local/etc/xray"
|
||||
cert_group="nobody"
|
||||
random_num=$((RANDOM % 12 + 4))
|
||||
|
||||
VERSION=$(echo "${VERSION}" | awk -F "[()]" '{print $2}')
|
||||
WS_PATH="/$(head -n 10 /dev/urandom | md5sum | head -c ${random_num})/"
|
||||
|
||||
function shell_mode_check() {
|
||||
if [ -f ${xray_conf_dir}/config.json ]; then
|
||||
if [ "$(grep -c "wsSettings" ${xray_conf_dir}/config.json)" -ge 1 ]; then
|
||||
shell_mode="ws"
|
||||
else
|
||||
shell_mode="tcp"
|
||||
fi
|
||||
else
|
||||
shell_mode="None"
|
||||
fi
|
||||
}
|
||||
function print_ok() {
|
||||
echo -e "${OK} ${Blue} $1 ${Font}"
|
||||
}
|
||||
|
||||
function print_error() {
|
||||
echo -e "${ERROR} ${RedBG} $1 ${Font}"
|
||||
}
|
||||
|
||||
function is_root() {
|
||||
if [[ 0 == "$UID" ]]; then
|
||||
print_ok "当前用户是 root 用户,开始安装流程"
|
||||
else
|
||||
print_error "当前用户不是 root 用户,请切换到 root 用户后重新执行脚本"
|
||||
exit 1
|
||||
fi
|
||||
}
|
||||
|
||||
judge() {
|
||||
if [[ 0 -eq $? ]]; then
|
||||
print_ok "$1 完成"
|
||||
sleep 1
|
||||
else
|
||||
print_error "$1 失败"
|
||||
exit 1
|
||||
fi
|
||||
}
|
||||
|
||||
function system_check() {
|
||||
source '/etc/os-release'
|
||||
|
||||
if [[ "${ID}" == "centos" && ${VERSION_ID} -ge 7 ]]; then
|
||||
print_ok "当前系统为 Centos ${VERSION_ID} ${VERSION}"
|
||||
INS="yum install -y"
|
||||
wget -N -P /etc/yum.repos.d/ https://raw.githubusercontent.com/wulabing/Xray_onekey/${github_branch}/basic/nginx.repo
|
||||
elif [[ "${ID}" == "ol" ]]; then
|
||||
print_ok "当前系统为 Oracle Linux ${VERSION_ID} ${VERSION}"
|
||||
INS="yum install -y"
|
||||
wget -N -P /etc/yum.repos.d/ https://raw.githubusercontent.com/wulabing/Xray_onekey/${github_branch}/basic/nginx.repo
|
||||
elif [[ "${ID}" == "debian" && ${VERSION_ID} -ge 9 ]]; then
|
||||
print_ok "当前系统为 Debian ${VERSION_ID} ${VERSION}"
|
||||
INS="apt install -y"
|
||||
# 清除可能的遗留问题
|
||||
rm -f /etc/apt/sources.list.d/nginx.list
|
||||
$INS lsb-release gnupg2
|
||||
|
||||
echo "deb http://nginx.org/packages/debian $(lsb_release -cs) nginx" >/etc/apt/sources.list.d/nginx.list
|
||||
curl -fsSL https://nginx.org/keys/nginx_signing.key | apt-key add -
|
||||
|
||||
apt update
|
||||
elif [[ "${ID}" == "ubuntu" && $(echo "${VERSION_ID}" | cut -d '.' -f1) -ge 18 ]]; then
|
||||
print_ok "当前系统为 Ubuntu ${VERSION_ID} ${UBUNTU_CODENAME}"
|
||||
INS="apt install -y"
|
||||
# 清除可能的遗留问题
|
||||
rm -f /etc/apt/sources.list.d/nginx.list
|
||||
$INS lsb-release gnupg2
|
||||
|
||||
echo "deb http://nginx.org/packages/ubuntu $(lsb_release -cs) nginx" >/etc/apt/sources.list.d/nginx.list
|
||||
curl -fsSL https://nginx.org/keys/nginx_signing.key | apt-key add -
|
||||
apt update
|
||||
else
|
||||
print_error "当前系统为 ${ID} ${VERSION_ID} 不在支持的系统列表内"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if [[ $(grep "nogroup" /etc/group) ]]; then
|
||||
cert_group="nogroup"
|
||||
fi
|
||||
|
||||
$INS dbus
|
||||
|
||||
# 关闭各类防火墙
|
||||
systemctl stop firewalld
|
||||
systemctl disable firewalld
|
||||
systemctl stop nftables
|
||||
systemctl disable nftables
|
||||
systemctl stop ufw
|
||||
systemctl disable ufw
|
||||
}
|
||||
|
||||
function nginx_install() {
|
||||
if ! command -v nginx >/dev/null 2>&1; then
|
||||
${INS} nginx
|
||||
judge "Nginx 安装"
|
||||
else
|
||||
print_ok "Nginx 已存在"
|
||||
${INS} nginx
|
||||
fi
|
||||
# 遗留问题处理
|
||||
mkdir -p /etc/nginx/conf.d >/dev/null 2>&1
|
||||
}
|
||||
function dependency_install() {
|
||||
${INS} wget lsof tar
|
||||
judge "安装 wget lsof tar"
|
||||
|
||||
if [[ "${ID}" == "centos" || "${ID}" == "ol" ]]; then
|
||||
${INS} crontabs
|
||||
else
|
||||
${INS} cron
|
||||
fi
|
||||
judge "安装 crontab"
|
||||
|
||||
if [[ "${ID}" == "centos" || "${ID}" == "ol" ]]; then
|
||||
touch /var/spool/cron/root && chmod 600 /var/spool/cron/root
|
||||
systemctl start crond && systemctl enable crond
|
||||
else
|
||||
touch /var/spool/cron/crontabs/root && chmod 600 /var/spool/cron/crontabs/root
|
||||
systemctl start cron && systemctl enable cron
|
||||
|
||||
fi
|
||||
judge "crontab 自启动配置 "
|
||||
|
||||
${INS} unzip
|
||||
judge "安装 unzip"
|
||||
|
||||
${INS} curl
|
||||
judge "安装 curl"
|
||||
|
||||
# upgrade systemd
|
||||
${INS} systemd
|
||||
judge "安装/升级 systemd"
|
||||
|
||||
# Nginx 后置 无需编译 不再需要
|
||||
# if [[ "${ID}" == "centos" || "${ID}" == "ol" ]]; then
|
||||
# yum -y groupinstall "Development tools"
|
||||
# else
|
||||
# ${INS} build-essential
|
||||
# fi
|
||||
# judge "编译工具包 安装"
|
||||
|
||||
if [[ "${ID}" == "centos" ]]; then
|
||||
${INS} pcre pcre-devel zlib-devel epel-release openssl openssl-devel
|
||||
elif [[ "${ID}" == "ol" ]]; then
|
||||
${INS} pcre pcre-devel zlib-devel openssl openssl-devel
|
||||
# Oracle Linux 不同日期版本的 VERSION_ID 比较乱 直接暴力处理
|
||||
yum-config-manager --enable ol7_developer_EPEL >/dev/null 2>&1
|
||||
yum-config-manager --enable ol8_developer_EPEL >/dev/null 2>&1
|
||||
else
|
||||
${INS} libpcre3 libpcre3-dev zlib1g-dev openssl libssl-dev
|
||||
fi
|
||||
|
||||
${INS} jq
|
||||
|
||||
if ! command -v jq; then
|
||||
wget -P /usr/bin https://raw.githubusercontent.com/wulabing/Xray_onekey/${github_branch}/binary/jq && chmod +x /usr/bin/jq
|
||||
judge "安装 jq"
|
||||
fi
|
||||
|
||||
# 防止部分系统xray的默认bin目录缺失
|
||||
mkdir /usr/local/bin >/dev/null 2>&1
|
||||
}
|
||||
|
||||
function basic_optimization() {
|
||||
# 最大文件打开数
|
||||
sed -i '/^\*\ *soft\ *nofile\ *[[:digit:]]*/d' /etc/security/limits.conf
|
||||
sed -i '/^\*\ *hard\ *nofile\ *[[:digit:]]*/d' /etc/security/limits.conf
|
||||
echo '* soft nofile 65536' >>/etc/security/limits.conf
|
||||
echo '* hard nofile 65536' >>/etc/security/limits.conf
|
||||
|
||||
# 关闭 Selinux
|
||||
if [[ "${ID}" == "centos" || "${ID}" == "ol" ]]; then
|
||||
sed -i 's/^SELINUX=.*/SELINUX=disabled/' /etc/selinux/config
|
||||
setenforce 0
|
||||
fi
|
||||
}
|
||||
function domain_check() {
|
||||
read -rp "请输入你的域名信息(eg: www.wulabing.com):" domain
|
||||
domain_ip=$(ping "${domain}" -c 1 | sed '1{s/[^(]*(//;s/).*//;q}')
|
||||
print_ok "正在获取 IP 地址信息,请耐心等待"
|
||||
local_ip=$(curl -4L api64.ipify.org)
|
||||
echo -e "域名通过 DNS 解析的 IP 地址:${domain_ip}"
|
||||
echo -e "本机公网 IP 地址: ${local_ip}"
|
||||
sleep 2
|
||||
if [[ ${domain_ip} == "${local_ip}" ]]; then
|
||||
print_ok "域名通过 DNS 解析的 IP 地址与 本机 IP 地址匹配"
|
||||
sleep 2
|
||||
else
|
||||
print_error "请确保域名添加了正确的 A 记录,否则将无法正常使用 xray"
|
||||
print_error "域名通过 DNS 解析的 IP 地址与 本机 IP 地址不匹配,是否继续安装?(y/n)" && read -r install
|
||||
case $install in
|
||||
[yY][eE][sS] | [yY])
|
||||
print_ok "继续安装"
|
||||
sleep 2
|
||||
;;
|
||||
*)
|
||||
print_error "安装终止"
|
||||
exit 2
|
||||
;;
|
||||
esac
|
||||
fi
|
||||
}
|
||||
|
||||
function port_exist_check() {
|
||||
if [[ 0 -eq $(lsof -i:"$1" | grep -i -c "listen") ]]; then
|
||||
print_ok "$1 端口未被占用"
|
||||
sleep 1
|
||||
else
|
||||
print_error "检测到 $1 端口被占用,以下为 $1 端口占用信息"
|
||||
lsof -i:"$1"
|
||||
print_error "5s 后将尝试自动 kill 占用进程"
|
||||
sleep 5
|
||||
lsof -i:"$1" | awk '{print $2}' | grep -v "PID" | xargs kill -9
|
||||
print_ok "kill 完成"
|
||||
sleep 1
|
||||
fi
|
||||
}
|
||||
function update_sh() {
|
||||
ol_version=$(curl -L -s https://raw.githubusercontent.com/wulabing/Xray_onekey/${github_branch}/install.sh | grep "shell_version=" | head -1 | awk -F '=|"' '{print $3}')
|
||||
if [[ "$shell_version" != "$(echo -e "$shell_version\n$ol_version" | sort -rV | head -1)" ]]; then
|
||||
print_ok "存在新版本,是否更新 [Y/N]?"
|
||||
read -r update_confirm
|
||||
case $update_confirm in
|
||||
[yY][eE][sS] | [yY])
|
||||
wget -N --no-check-certificate https://raw.githubusercontent.com/wulabing/Xray_onekey/${github_branch}/install.sh
|
||||
print_ok "更新完成"
|
||||
print_ok "您可以通过 bash $0 执行本程序"
|
||||
exit 0
|
||||
;;
|
||||
*) ;;
|
||||
esac
|
||||
else
|
||||
print_ok "当前版本为最新版本"
|
||||
print_ok "您可以通过 bash $0 执行本程序"
|
||||
fi
|
||||
}
|
||||
|
||||
function xray_tmp_config_file_check_and_use() {
|
||||
if [[ -s ${xray_conf_dir}/config_tmp.json ]]; then
|
||||
mv -f ${xray_conf_dir}/config_tmp.json ${xray_conf_dir}/config.json
|
||||
else
|
||||
print_error "xray 配置文件修改异常"
|
||||
fi
|
||||
}
|
||||
|
||||
function modify_UUID() {
|
||||
[ -z "$UUID" ] && UUID=$(cat /proc/sys/kernel/random/uuid)
|
||||
cat ${xray_conf_dir}/config.json | jq 'setpath(["inbounds",0,"settings","clients",0,"id"];"'${UUID}'")' >${xray_conf_dir}/config_tmp.json
|
||||
xray_tmp_config_file_check_and_use
|
||||
judge "Xray TCP UUID 修改"
|
||||
}
|
||||
|
||||
function modify_UUID_ws() {
|
||||
cat ${xray_conf_dir}/config.json | jq 'setpath(["inbounds",1,"settings","clients",0,"id"];"'${UUID}'")' >${xray_conf_dir}/config_tmp.json
|
||||
xray_tmp_config_file_check_and_use
|
||||
judge "Xray ws UUID 修改"
|
||||
}
|
||||
|
||||
function modify_fallback_ws() {
|
||||
cat ${xray_conf_dir}/config.json | jq 'setpath(["inbounds",0,"settings","fallbacks",2,"path"];"'${WS_PATH}'")' >${xray_conf_dir}/config_tmp.json
|
||||
xray_tmp_config_file_check_and_use
|
||||
judge "Xray fallback_ws 修改"
|
||||
}
|
||||
|
||||
function modify_ws() {
|
||||
cat ${xray_conf_dir}/config.json | jq 'setpath(["inbounds",1,"streamSettings","wsSettings","path"];"'${WS_PATH}'")' >${xray_conf_dir}/config_tmp.json
|
||||
xray_tmp_config_file_check_and_use
|
||||
judge "Xray ws 修改"
|
||||
}
|
||||
|
||||
function configure_nginx() {
|
||||
nginx_conf="/etc/nginx/conf.d/${domain}.conf"
|
||||
cd /etc/nginx/conf.d/ && rm -f ${domain}.conf && wget -O ${domain}.conf https://raw.githubusercontent.com/wulabing/Xray_onekey/${github_branch}/config/web.conf
|
||||
sed -i "s/xxx/${domain}/g" ${nginx_conf}
|
||||
judge "Nginx config modify"
|
||||
|
||||
systemctl restart nginx
|
||||
}
|
||||
|
||||
function modify_port() {
|
||||
read -rp "请输入端口号(默认:443):" PORT
|
||||
[ -z "$PORT" ] && PORT="443"
|
||||
if [[ $PORT -le 0 ]] || [[ $PORT -gt 65535 ]]; then
|
||||
print_error "请输入 0-65535 之间的值"
|
||||
exit 1
|
||||
fi
|
||||
port_exist_check $PORT
|
||||
cat ${xray_conf_dir}/config.json | jq 'setpath(["inbounds",0,"port"];'${PORT}')' >${xray_conf_dir}/config_tmp.json
|
||||
xray_tmp_config_file_check_and_use
|
||||
judge "Xray 端口 修改"
|
||||
}
|
||||
|
||||
function configure_xray() {
|
||||
cd /usr/local/etc/xray && rm -f config.json && wget -O config.json https://raw.githubusercontent.com/wulabing/Xray_onekey/${github_branch}/config/xray_xtls-rprx-direct.json
|
||||
modify_UUID
|
||||
modify_port
|
||||
}
|
||||
|
||||
function configure_xray_ws() {
|
||||
cd /usr/local/etc/xray && rm -f config.json && wget -O config.json https://raw.githubusercontent.com/wulabing/Xray_onekey/${github_branch}/config/xray_tls_ws_mix-rprx-direct.json
|
||||
modify_UUID
|
||||
modify_UUID_ws
|
||||
modify_port
|
||||
modify_fallback_ws
|
||||
modify_ws
|
||||
}
|
||||
|
||||
function xray_install() {
|
||||
print_ok "安装 Xray"
|
||||
curl -L https://github.com/XTLS/Xray-install/raw/main/install-release.sh | bash -s -- install
|
||||
judge "Xray 安装"
|
||||
|
||||
# 用于生成 Xray 的导入链接
|
||||
echo $domain >$domain_tmp_dir/domain
|
||||
judge "域名记录"
|
||||
}
|
||||
|
||||
function ssl_install() {
|
||||
# 使用 Nginx 配合签发 无需安装相关依赖
|
||||
# if [[ "${ID}" == "centos" || "${ID}" == "ol" ]]; then
|
||||
# ${INS} socat nc
|
||||
# else
|
||||
# ${INS} socat netcat
|
||||
# fi
|
||||
# judge "安装 SSL 证书生成脚本依赖"
|
||||
|
||||
curl -L get.acme.sh | bash
|
||||
judge "安装 SSL 证书生成脚本"
|
||||
}
|
||||
|
||||
function acme() {
|
||||
"$HOME"/.acme.sh/acme.sh --set-default-ca --server letsencrypt
|
||||
|
||||
sed -i "6s/^/#/" "$nginx_conf"
|
||||
sed -i "6a\\\troot $website_dir;" "$nginx_conf"
|
||||
systemctl restart nginx
|
||||
|
||||
if "$HOME"/.acme.sh/acme.sh --issue -d "${domain}" --webroot "$website_dir" -k ec-256 --force; then
|
||||
print_ok "SSL 证书生成成功"
|
||||
sleep 2
|
||||
if "$HOME"/.acme.sh/acme.sh --installcert -d "${domain}" --fullchainpath /ssl/xray.crt --keypath /ssl/xray.key --reloadcmd "systemctl restart xray" --ecc --force; then
|
||||
print_ok "SSL 证书配置成功"
|
||||
sleep 2
|
||||
fi
|
||||
else
|
||||
print_error "SSL 证书生成失败"
|
||||
rm -rf "$HOME/.acme.sh/${domain}_ecc"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
sed -i "7d" "$nginx_conf"
|
||||
sed -i "6s/#//" "$nginx_conf"
|
||||
}
|
||||
|
||||
function ssl_judge_and_install() {
|
||||
|
||||
mkdir -p /ssl >/dev/null 2>&1
|
||||
if [[ -f "/ssl/xray.key" || -f "/ssl/xray.crt" ]]; then
|
||||
print_ok "/ssl 目录下证书文件已存在"
|
||||
print_ok "是否删除 /ssl 目录下的证书文件 [Y/N]?"
|
||||
read -r ssl_delete
|
||||
case $ssl_delete in
|
||||
[yY][eE][sS] | [yY])
|
||||
rm -rf /ssl/*
|
||||
print_ok "已删除"
|
||||
;;
|
||||
*) ;;
|
||||
|
||||
esac
|
||||
fi
|
||||
|
||||
if [[ -f "/ssl/xray.key" || -f "/ssl/xray.crt" ]]; then
|
||||
echo "证书文件已存在"
|
||||
elif [[ -f "$HOME/.acme.sh/${domain}_ecc/${domain}.key" && -f "$HOME/.acme.sh/${domain}_ecc/${domain}.cer" ]]; then
|
||||
echo "证书文件已存在"
|
||||
"$HOME"/.acme.sh/acme.sh --installcert -d "${domain}" --fullchainpath /ssl/xray.crt --keypath /ssl/xray.key --ecc
|
||||
judge "证书应用"
|
||||
else
|
||||
mkdir /ssl
|
||||
cp -a $cert_dir/self_signed_cert.pem /ssl/xray.crt
|
||||
cp -a $cert_dir/self_signed_key.pem /ssl/xray.key
|
||||
ssl_install
|
||||
acme
|
||||
fi
|
||||
|
||||
# Xray 默认以 nobody 用户运行,证书权限适配
|
||||
chown -R nobody.$cert_group /ssl/*
|
||||
}
|
||||
|
||||
function generate_certificate() {
|
||||
signedcert=$(xray tls cert -domain="$local_ip" -name="$local_ip" -org="$local_ip" -expire=87600h)
|
||||
echo $signedcert | jq '.certificate[]' | sed 's/\"//g' | tee $cert_dir/self_signed_cert.pem
|
||||
echo $signedcert | jq '.key[]' | sed 's/\"//g' >$cert_dir/self_signed_key.pem
|
||||
openssl x509 -in $cert_dir/self_signed_cert.pem -noout || 'print_error "生成自签名证书失败" && exit 1'
|
||||
print_ok "生成自签名证书成功"
|
||||
chown nobody.$cert_group $cert_dir/self_signed_cert.pem
|
||||
chown nobody.$cert_group $cert_dir/self_signed_key.pem
|
||||
}
|
||||
|
||||
function configure_web() {
|
||||
rm -rf /www/xray_web
|
||||
mkdir -p /www/xray_web
|
||||
wget -O web.tar.gz https://raw.githubusercontent.com/wulabing/Xray_onekey/main/basic/web.tar.gz
|
||||
tar xzf web.tar.gz -C /www/xray_web
|
||||
judge "站点伪装"
|
||||
rm -f web.tar.gz
|
||||
}
|
||||
|
||||
function xray_uninstall() {
|
||||
curl -L https://github.com/XTLS/Xray-install/raw/main/install-release.sh | bash -s -- remove --purge
|
||||
rm -rf $website_dir
|
||||
print_ok "是否卸载nginx [Y/N]?"
|
||||
read -r uninstall_nginx
|
||||
case $uninstall_nginx in
|
||||
[yY][eE][sS] | [yY])
|
||||
if [[ "${ID}" == "centos" || "${ID}" == "ol" ]]; then
|
||||
yum remove nginx -y
|
||||
else
|
||||
apt purge nginx -y
|
||||
fi
|
||||
;;
|
||||
*) ;;
|
||||
esac
|
||||
print_ok "是否卸载acme.sh [Y/N]?"
|
||||
read -r uninstall_acme
|
||||
case $uninstall_acme in
|
||||
[yY][eE][sS] | [yY])
|
||||
/root/.acme.sh/acme.sh --uninstall
|
||||
rm -rf /root/.acme.sh
|
||||
rm -rf /ssl/
|
||||
;;
|
||||
*) ;;
|
||||
esac
|
||||
print_ok "卸载完成"
|
||||
exit 0
|
||||
}
|
||||
|
||||
function restart_all() {
|
||||
systemctl restart nginx
|
||||
judge "Nginx 启动"
|
||||
systemctl restart xray
|
||||
judge "Xray 启动"
|
||||
}
|
||||
|
||||
function vless_xtls-rprx-direct_link() {
|
||||
UUID=$(cat ${xray_conf_dir}/config.json | jq .inbounds[0].settings.clients[0].id | tr -d '"')
|
||||
PORT=$(cat ${xray_conf_dir}/config.json | jq .inbounds[0].port)
|
||||
FLOW=$(cat ${xray_conf_dir}/config.json | jq .inbounds[0].settings.clients[0].flow | tr -d '"')
|
||||
DOMAIN=$(cat ${domain_tmp_dir}/domain)
|
||||
|
||||
print_ok "URL 链接(VLESS + TCP + TLS)"
|
||||
print_ok "vless://$UUID@$DOMAIN:$PORT?security=tls&flow=$FLOW#TLS_wulabing-$DOMAIN"
|
||||
|
||||
print_ok "URL 链接(VLESS + TCP + XTLS)"
|
||||
print_ok "vless://$UUID@$DOMAIN:$PORT?security=xtls&flow=$FLOW#XTLS_wulabing-$DOMAIN"
|
||||
print_ok "-------------------------------------------------"
|
||||
print_ok "URL 二维码(VLESS + TCP + TLS)(请在浏览器中访问)"
|
||||
print_ok "https://api.qrserver.com/v1/create-qr-code/?size=400x400&data=vless://$UUID@$DOMAIN:$PORT?security=tls%26flow=$FLOW%23TLS_wulabing-$DOMAIN"
|
||||
|
||||
print_ok "URL 二维码(VLESS + TCP + XTLS)(请在浏览器中访问)"
|
||||
print_ok "https://api.qrserver.com/v1/create-qr-code/?size=400x400&data=vless://$UUID@$DOMAIN:$PORT?security=xtls%26flow=$FLOW%23XTLS_wulabing-$DOMAIN"
|
||||
}
|
||||
|
||||
function vless_xtls-rprx-direct_information() {
|
||||
UUID=$(cat ${xray_conf_dir}/config.json | jq .inbounds[0].settings.clients[0].id | tr -d '"')
|
||||
PORT=$(cat ${xray_conf_dir}/config.json | jq .inbounds[0].port)
|
||||
FLOW=$(cat ${xray_conf_dir}/config.json | jq .inbounds[0].settings.clients[0].flow | tr -d '"')
|
||||
DOMAIN=$(cat ${domain_tmp_dir}/domain)
|
||||
|
||||
echo -e "${Red} Xray 配置信息 ${Font}"
|
||||
echo -e "${Red} 地址(address):${Font} $DOMAIN"
|
||||
echo -e "${Red} 端口(port):${Font} $PORT"
|
||||
echo -e "${Red} 用户 ID(UUID):${Font} $UUID"
|
||||
echo -e "${Red} 流控(flow):${Font} $FLOW"
|
||||
echo -e "${Red} 加密方式(security):${Font} none "
|
||||
echo -e "${Red} 传输协议(network):${Font} tcp "
|
||||
echo -e "${Red} 伪装类型(type):${Font} none "
|
||||
echo -e "${Red} 底层传输安全:${Font} xtls 或 tls"
|
||||
}
|
||||
|
||||
function ws_information() {
|
||||
UUID=$(cat ${xray_conf_dir}/config.json | jq .inbounds[0].settings.clients[0].id | tr -d '"')
|
||||
PORT=$(cat ${xray_conf_dir}/config.json | jq .inbounds[0].port)
|
||||
FLOW=$(cat ${xray_conf_dir}/config.json | jq .inbounds[0].settings.clients[0].flow | tr -d '"')
|
||||
WS_PATH=$(cat ${xray_conf_dir}/config.json | jq .inbounds[0].settings.fallbacks[2].path | tr -d '"')
|
||||
DOMAIN=$(cat ${domain_tmp_dir}/domain)
|
||||
|
||||
echo -e "${Red} Xray 配置信息 ${Font}"
|
||||
echo -e "${Red} 地址(address):${Font} $DOMAIN"
|
||||
echo -e "${Red} 端口(port):${Font} $PORT"
|
||||
echo -e "${Red} 用户 ID(UUID):${Font} $UUID"
|
||||
echo -e "${Red} 加密方式(security):${Font} none "
|
||||
echo -e "${Red} 传输协议(network):${Font} ws "
|
||||
echo -e "${Red} 伪装类型(type):${Font} none "
|
||||
echo -e "${Red} 路径(path):${Font} $WS_PATH "
|
||||
echo -e "${Red} 底层传输安全:${Font} tls "
|
||||
}
|
||||
|
||||
function ws_link() {
|
||||
UUID=$(cat ${xray_conf_dir}/config.json | jq .inbounds[0].settings.clients[0].id | tr -d '"')
|
||||
PORT=$(cat ${xray_conf_dir}/config.json | jq .inbounds[0].port)
|
||||
FLOW=$(cat ${xray_conf_dir}/config.json | jq .inbounds[0].settings.clients[0].flow | tr -d '"')
|
||||
WS_PATH=$(cat ${xray_conf_dir}/config.json | jq .inbounds[0].settings.fallbacks[2].path | tr -d '"')
|
||||
WS_PATH_WITHOUT_SLASH=$(echo $WS_PATH | tr -d '/')
|
||||
DOMAIN=$(cat ${domain_tmp_dir}/domain)
|
||||
|
||||
print_ok "URL 链接(VLESS + TCP + TLS)"
|
||||
print_ok "vless://$UUID@$DOMAIN:$PORT?security=tls#TLS_wulabing-$DOMAIN"
|
||||
|
||||
print_ok "URL 链接(VLESS + TCP + XTLS)"
|
||||
print_ok "vless://$UUID@$DOMAIN:$PORT?security=xtls&flow=$FLOW#XTLS_wulabing-$DOMAIN"
|
||||
|
||||
print_ok "URL 链接(VLESS + WebSocket + TLS)"
|
||||
print_ok "vless://$UUID@$DOMAIN:$PORT?type=ws&security=tls&path=%2f${WS_PATH_WITHOUT_SLASH}%2f#WS_TLS_wulabing-$DOMAIN"
|
||||
print_ok "-------------------------------------------------"
|
||||
print_ok "URL 二维码(VLESS + TCP + TLS)(请在浏览器中访问)"
|
||||
print_ok "https://api.qrserver.com/v1/create-qr-code/?size=400x400&data=vless://$UUID@$DOMAIN:$PORT?security=tls%23TLS_wulabing-$DOMAIN"
|
||||
|
||||
print_ok "URL 二维码(VLESS + TCP + XTLS)(请在浏览器中访问)"
|
||||
print_ok "https://api.qrserver.com/v1/create-qr-code/?size=400x400&data=vless://$UUID@$DOMAIN:$PORT?security=xtls%26flow=$FLOW%23XTLS_wulabing-$DOMAIN"
|
||||
|
||||
print_ok "URL 二维码(VLESS + WebSocket + TLS)(请在浏览器中访问)"
|
||||
print_ok "https://api.qrserver.com/v1/create-qr-code/?size=400x400&data=vless://$UUID@$DOMAIN:$PORT?type=ws%26security=tls%26path=%2f${WS_PATH_WITHOUT_SLASH}%2f%23WS_TLS_wulabing-$DOMAIN"
|
||||
}
|
||||
|
||||
function basic_information() {
|
||||
print_ok "VLESS+TCP+XTLS+Nginx 安装成功"
|
||||
vless_xtls-rprx-direct_information
|
||||
vless_xtls-rprx-direct_link
|
||||
}
|
||||
|
||||
function basic_ws_information() {
|
||||
print_ok "VLESS+TCP+TLS+Nginx with WebSocket 混合模式 安装成功"
|
||||
ws_information
|
||||
print_ok "————————————————————————"
|
||||
vless_xtls-rprx-direct_information
|
||||
ws_link
|
||||
}
|
||||
|
||||
function show_access_log() {
|
||||
[ -f ${xray_access_log} ] && tail -f ${xray_access_log} || echo -e "${RedBG}log文件不存在${Font}"
|
||||
}
|
||||
|
||||
function show_error_log() {
|
||||
[ -f ${xray_error_log} ] && tail -f ${xray_error_log} || echo -e "${RedBG}log文件不存在${Font}"
|
||||
}
|
||||
|
||||
function bbr_boost_sh() {
|
||||
[ -f "tcp.sh" ] && rm -rf ./tcp.sh
|
||||
wget -N --no-check-certificate "https://raw.githubusercontent.com/ylx2016/Linux-NetSpeed/master/tcp.sh" && chmod +x tcp.sh && ./tcp.sh
|
||||
}
|
||||
|
||||
function mtproxy_sh() {
|
||||
wget -N --no-check-certificate "https://github.com/wulabing/mtp/raw/master/mtproxy.sh" && chmod +x mtproxy.sh && bash mtproxy.sh
|
||||
}
|
||||
|
||||
function install_xray() {
|
||||
is_root
|
||||
system_check
|
||||
dependency_install
|
||||
basic_optimization
|
||||
domain_check
|
||||
port_exist_check 80
|
||||
xray_install
|
||||
configure_xray
|
||||
nginx_install
|
||||
configure_nginx
|
||||
configure_web
|
||||
generate_certificate
|
||||
ssl_judge_and_install
|
||||
restart_all
|
||||
basic_information
|
||||
}
|
||||
function install_xray_ws() {
|
||||
is_root
|
||||
system_check
|
||||
dependency_install
|
||||
basic_optimization
|
||||
domain_check
|
||||
port_exist_check 80
|
||||
xray_install
|
||||
configure_xray_ws
|
||||
nginx_install
|
||||
configure_nginx
|
||||
configure_web
|
||||
generate_certificate
|
||||
ssl_judge_and_install
|
||||
restart_all
|
||||
basic_ws_information
|
||||
}
|
||||
menu() {
|
||||
#update_sh
|
||||
shell_mode_check
|
||||
echo -e "\t Xray 安装管理脚本 ${Red}[${shell_version}]${Font}"
|
||||
echo -e "\t---authored by wulabing---"
|
||||
echo -e "\thttps://github.com/wulabing\n"
|
||||
|
||||
echo -e "当前已安装版本:${shell_mode}"
|
||||
echo -e "—————————————— 安装向导 ——————————————"""
|
||||
echo -e "${Green}0.${Font} 升级 脚本"
|
||||
echo -e "${Green}1.${Font} 安装 Xray (VLESS + TCP + XTLS / TLS + Nginx)"
|
||||
echo -e "${Green}2.${Font} 安装 Xray (VLESS + TCP + XTLS / TLS + Nginx 及 VLESS + TCP + TLS + Nginx + WebSocket 回落并存模式)"
|
||||
echo -e "—————————————— 配置变更 ——————————————"
|
||||
echo -e "${Green}11.${Font} 变更 UUID"
|
||||
echo -e "${Green}13.${Font} 变更 连接端口"
|
||||
echo -e "${Green}14.${Font} 变更 WebSocket PATH"
|
||||
echo -e "—————————————— 查看信息 ——————————————"
|
||||
echo -e "${Green}21.${Font} 查看 实时访问日志"
|
||||
echo -e "${Green}22.${Font} 查看 实时错误日志"
|
||||
echo -e "${Green}23.${Font} 查看 Xray 配置链接"
|
||||
# echo -e "${Green}23.${Font} 查看 V2Ray 配置信息"
|
||||
echo -e "—————————————— 其他选项 ——————————————"
|
||||
echo -e "${Green}31.${Font} 安装 4 合 1 BBR、锐速安装脚本"
|
||||
echo -e "${Yellow}32.${Font} 安装 MTproxy(不推荐使用,请相关用户关闭或卸载)"
|
||||
echo -e "${Green}33.${Font} 卸载 Xray"
|
||||
echo -e "${Green}34.${Font} 更新 Xray-core"
|
||||
echo -e "${Green}35.${Font} 安装 Xray-core 测试版(Pre)"
|
||||
echo -e "${Green}36.${Font} 手动更新SSL证书"
|
||||
echo -e "${Green}40.${Font} 退出"
|
||||
read -rp "请输入数字:" menu_num
|
||||
case $menu_num in
|
||||
0)
|
||||
update_sh
|
||||
;;
|
||||
1)
|
||||
install_xray
|
||||
;;
|
||||
2)
|
||||
install_xray_ws
|
||||
;;
|
||||
11)
|
||||
read -rp "请输入UUID:" UUID
|
||||
if [[ ${shell_mode} == "tcp" ]]; then
|
||||
modify_UUID
|
||||
elif [[ ${shell_mode} == "ws" ]]; then
|
||||
modify_UUID
|
||||
modify_UUID_ws
|
||||
fi
|
||||
restart_all
|
||||
;;
|
||||
13)
|
||||
modify_port
|
||||
restart_all
|
||||
;;
|
||||
14)
|
||||
if [[ ${shell_mode} == "ws" ]]; then
|
||||
read -rp "请输入路径(示例:/wulabing/ 要求两侧都包含/):" WS_PATH
|
||||
modify_fallback_ws
|
||||
modify_ws
|
||||
restart_all
|
||||
else
|
||||
print_error "当前模式不是Websocket模式"
|
||||
fi
|
||||
;;
|
||||
21)
|
||||
tail -f $xray_access_log
|
||||
;;
|
||||
22)
|
||||
tail -f $xray_error_log
|
||||
;;
|
||||
23)
|
||||
if [[ -f $xray_conf_dir/config.json ]]; then
|
||||
if [[ ${shell_mode} == "tcp" ]]; then
|
||||
basic_information
|
||||
elif [[ ${shell_mode} == "ws" ]]; then
|
||||
basic_ws_information
|
||||
fi
|
||||
else
|
||||
print_error "xray 配置文件不存在"
|
||||
fi
|
||||
;;
|
||||
31)
|
||||
bbr_boost_sh
|
||||
;;
|
||||
32)
|
||||
mtproxy_sh
|
||||
;;
|
||||
33)
|
||||
source '/etc/os-release'
|
||||
xray_uninstall
|
||||
;;
|
||||
34)
|
||||
bash -c "$(curl -L https://github.com/XTLS/Xray-install/raw/main/install-release.sh)" - install
|
||||
restart_all
|
||||
;;
|
||||
35)
|
||||
bash -c "$(curl -L https://github.com/XTLS/Xray-install/raw/main/install-release.sh)" - install --beta
|
||||
restart_all
|
||||
;;
|
||||
36)
|
||||
"/root/.acme.sh"/acme.sh --cron --home "/root/.acme.sh"
|
||||
restart_all
|
||||
;;
|
||||
40)
|
||||
exit 0
|
||||
;;
|
||||
*)
|
||||
print_error "请输入正确的数字"
|
||||
;;
|
||||
esac
|
||||
}
|
||||
menu "$@"
|
||||
911
v2ray示例/XRay-安装脚本/官方Xray安装脚本-2022-10-21.sh
Normal file
911
v2ray示例/XRay-安装脚本/官方Xray安装脚本-2022-10-21.sh
Normal file
@@ -0,0 +1,911 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
# The files installed by the script conform to the Filesystem Hierarchy Standard:
|
||||
# https://wiki.linuxfoundation.org/lsb/fhs
|
||||
|
||||
# The URL of the script project is:
|
||||
# https://github.com/XTLS/Xray-install
|
||||
|
||||
# The URL of the scraaaaaipt is:
|
||||
# https://raw.githubusercontent.com/XTLS/Xray-install/main/install-release.sh
|
||||
|
||||
# If the script executes incorrectly, go to:
|
||||
# https://github.com/XTLS/Xray-install/issues
|
||||
|
||||
# You can set this variable whatever you want in shell session right before running this script by issuing:
|
||||
# export DAT_PATH='/usr/local/share/xray'
|
||||
DAT_PATH=${DAT_PATH:-/usr/local/share/xray}
|
||||
|
||||
# You can set this variable whatever you want in shell session right before running this script by issuing:
|
||||
# export JSON_PATH='/usr/local/etc/xray'
|
||||
JSON_PATH=${JSON_PATH:-/usr/local/etc/xray}
|
||||
|
||||
# Set this variable only if you are starting xray with multiple configuration files:
|
||||
# export JSONS_PATH='/usr/local/etc/xray'
|
||||
|
||||
# Set this variable only if you want this script to check all the systemd unit file:
|
||||
# export check_all_service_files='yes'
|
||||
|
||||
# Gobal verbals
|
||||
|
||||
if [[ -f '/etc/systemd/system/xray.service' ]] && [[ -f '/usr/local/bin/xray' ]]; then
|
||||
XRAY_IS_INSTALLED_BEFORE_RUNNING_SCRIPT=1
|
||||
else
|
||||
XRAY_IS_INSTALLED_BEFORE_RUNNING_SCRIPT=0
|
||||
fi
|
||||
|
||||
# Xray current version
|
||||
CURRENT_VERSION=''
|
||||
|
||||
# Xray latest release version
|
||||
RELEASE_LATEST=''
|
||||
|
||||
# Xray latest prerelease/release version
|
||||
PRE_RELEASE_LATEST=''
|
||||
|
||||
# Xray version will be installed
|
||||
INSTALL_VERSION=''
|
||||
|
||||
# install
|
||||
INSTALL='0'
|
||||
|
||||
# install-geodata
|
||||
INSTALL_GEODATA='0'
|
||||
|
||||
# remove
|
||||
REMOVE='0'
|
||||
|
||||
# help
|
||||
HELP='0'
|
||||
|
||||
# check
|
||||
CHECK='0'
|
||||
|
||||
# --force
|
||||
FORCE='0'
|
||||
|
||||
# --beta
|
||||
BETA='0'
|
||||
|
||||
# --install-user ?
|
||||
INSTALL_USER=''
|
||||
|
||||
# --without-geodata
|
||||
NO_GEODATA='0'
|
||||
|
||||
# --without-logfiles
|
||||
NO_LOGFILES='0'
|
||||
|
||||
# --no-update-service
|
||||
N_UP_SERVICE='0'
|
||||
|
||||
# --reinstall
|
||||
REINSTALL='0'
|
||||
|
||||
# --version ?
|
||||
SPECIFIED_VERSION=''
|
||||
|
||||
# --local ?
|
||||
LOCAL_FILE=''
|
||||
|
||||
# --proxy ?
|
||||
PROXY=''
|
||||
|
||||
# --purge
|
||||
PURGE='0'
|
||||
|
||||
curl() {
|
||||
$(type -P curl) -L -q --retry 5 --retry-delay 10 --retry-max-time 60 "$@"
|
||||
}
|
||||
|
||||
systemd_cat_config() {
|
||||
if systemd-analyze --help | grep -qw 'cat-config'; then
|
||||
systemd-analyze --no-pager cat-config "$@"
|
||||
echo
|
||||
else
|
||||
echo "${aoi}~~~~~~~~~~~~~~~~"
|
||||
cat "$@" "$1".d/*
|
||||
echo "${aoi}~~~~~~~~~~~~~~~~"
|
||||
echo "${red}warning: ${green}The systemd version on the current operating system is too low."
|
||||
echo "${red}warning: ${green}Please consider to upgrade the systemd or the operating system.${reset}"
|
||||
echo
|
||||
fi
|
||||
}
|
||||
|
||||
check_if_running_as_root() {
|
||||
# If you want to run as another user, please modify $EUID to be owned by this user
|
||||
if [[ "$EUID" -ne '0' ]]; then
|
||||
echo "error: You must run this script as root!"
|
||||
exit 1
|
||||
fi
|
||||
}
|
||||
|
||||
identify_the_operating_system_and_architecture() {
|
||||
if [[ "$(uname)" == 'Linux' ]]; then
|
||||
case "$(uname -m)" in
|
||||
'i386' | 'i686')
|
||||
MACHINE='32'
|
||||
;;
|
||||
'amd64' | 'x86_64')
|
||||
MACHINE='64'
|
||||
;;
|
||||
'armv5tel')
|
||||
MACHINE='arm32-v5'
|
||||
;;
|
||||
'armv6l')
|
||||
MACHINE='arm32-v6'
|
||||
grep Features /proc/cpuinfo | grep -qw 'vfp' || MACHINE='arm32-v5'
|
||||
;;
|
||||
'armv7' | 'armv7l')
|
||||
MACHINE='arm32-v7a'
|
||||
grep Features /proc/cpuinfo | grep -qw 'vfp' || MACHINE='arm32-v5'
|
||||
;;
|
||||
'armv8' | 'aarch64')
|
||||
MACHINE='arm64-v8a'
|
||||
;;
|
||||
'mips')
|
||||
MACHINE='mips32'
|
||||
;;
|
||||
'mipsle')
|
||||
MACHINE='mips32le'
|
||||
;;
|
||||
'mips64')
|
||||
MACHINE='mips64'
|
||||
lscpu | grep -q "Little Endian" && MACHINE='mips64le'
|
||||
;;
|
||||
'mips64le')
|
||||
MACHINE='mips64le'
|
||||
;;
|
||||
'ppc64')
|
||||
MACHINE='ppc64'
|
||||
;;
|
||||
'ppc64le')
|
||||
MACHINE='ppc64le'
|
||||
;;
|
||||
'riscv64')
|
||||
MACHINE='riscv64'
|
||||
;;
|
||||
's390x')
|
||||
MACHINE='s390x'
|
||||
;;
|
||||
*)
|
||||
echo "error: The architecture is not supported."
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
if [[ ! -f '/etc/os-release' ]]; then
|
||||
echo "error: Don't use outdated Linux distributions."
|
||||
exit 1
|
||||
fi
|
||||
# Do not combine this judgment condition with the following judgment condition.
|
||||
## Be aware of Linux distribution like Gentoo, which kernel supports switch between Systemd and OpenRC.
|
||||
if [[ -f /.dockerenv ]] || grep -q 'docker\|lxc' /proc/1/cgroup && [[ "$(type -P systemctl)" ]]; then
|
||||
true
|
||||
elif [[ -d /run/systemd/system ]] || grep -q systemd <(ls -l /sbin/init); then
|
||||
true
|
||||
else
|
||||
echo "error: Only Linux distributions using systemd are supported."
|
||||
exit 1
|
||||
fi
|
||||
if [[ "$(type -P apt)" ]]; then
|
||||
PACKAGE_MANAGEMENT_INSTALL='apt -y --no-install-recommends install'
|
||||
PACKAGE_MANAGEMENT_REMOVE='apt purge'
|
||||
package_provide_tput='ncurses-bin'
|
||||
elif [[ "$(type -P dnf)" ]]; then
|
||||
PACKAGE_MANAGEMENT_INSTALL='dnf -y install'
|
||||
PACKAGE_MANAGEMENT_REMOVE='dnf remove'
|
||||
package_provide_tput='ncurses'
|
||||
elif [[ "$(type -P yum)" ]]; then
|
||||
PACKAGE_MANAGEMENT_INSTALL='yum -y install'
|
||||
PACKAGE_MANAGEMENT_REMOVE='yum remove'
|
||||
package_provide_tput='ncurses'
|
||||
elif [[ "$(type -P zypper)" ]]; then
|
||||
PACKAGE_MANAGEMENT_INSTALL='zypper install -y --no-recommends'
|
||||
PACKAGE_MANAGEMENT_REMOVE='zypper remove'
|
||||
package_provide_tput='ncurses-utils'
|
||||
elif [[ "$(type -P pacman)" ]]; then
|
||||
PACKAGE_MANAGEMENT_INSTALL='pacman -Syu --noconfirm'
|
||||
PACKAGE_MANAGEMENT_REMOVE='pacman -Rsn'
|
||||
package_provide_tput='ncurses'
|
||||
elif [[ "$(type -P emerge)" ]]; then
|
||||
PACKAGE_MANAGEMENT_INSTALL='emerge -v'
|
||||
PACKAGE_MANAGEMENT_REMOVE='emerge -Cv'
|
||||
package_provide_tput='ncurses'
|
||||
else
|
||||
echo "error: The script does not support the package manager in this operating system."
|
||||
exit 1
|
||||
fi
|
||||
else
|
||||
echo "error: This operating system is not supported."
|
||||
exit 1
|
||||
fi
|
||||
}
|
||||
|
||||
## Demo function for processing parameters
|
||||
judgment_parameters() {
|
||||
local local_install='0'
|
||||
local temp_version='0'
|
||||
while [[ "$#" -gt '0' ]]; do
|
||||
case "$1" in
|
||||
'install')
|
||||
INSTALL='1'
|
||||
;;
|
||||
'install-geodata')
|
||||
INSTALL_GEODATA='1'
|
||||
;;
|
||||
'remove')
|
||||
REMOVE='1'
|
||||
;;
|
||||
'help')
|
||||
HELP='1'
|
||||
;;
|
||||
'check')
|
||||
CHECK='1'
|
||||
;;
|
||||
'--without-geodata')
|
||||
NO_GEODATA='1'
|
||||
;;
|
||||
'--without-logfiles')
|
||||
NO_LOGFILES='1'
|
||||
;;
|
||||
'--purge')
|
||||
PURGE='1'
|
||||
;;
|
||||
'--version')
|
||||
if [[ -z "$2" ]]; then
|
||||
echo "error: Please specify the correct version."
|
||||
exit 1
|
||||
fi
|
||||
temp_version='1'
|
||||
SPECIFIED_VERSION="$2"
|
||||
shift
|
||||
;;
|
||||
'-f' | '--force')
|
||||
FORCE='1'
|
||||
;;
|
||||
'--beta')
|
||||
BETA='1'
|
||||
;;
|
||||
'-l' | '--local')
|
||||
local_install='1'
|
||||
if [[ -z "$2" ]]; then
|
||||
echo "error: Please specify the correct local file."
|
||||
exit 1
|
||||
fi
|
||||
LOCAL_FILE="$2"
|
||||
shift
|
||||
;;
|
||||
'-p' | '--proxy')
|
||||
if [[ -z "$2" ]]; then
|
||||
echo "error: Please specify the proxy server address."
|
||||
exit 1
|
||||
fi
|
||||
PROXY="$2"
|
||||
shift
|
||||
;;
|
||||
'-u' | '--install-user')
|
||||
if [[ -z "$2" ]]; then
|
||||
echo "error: Please specify the install user.}"
|
||||
exit 1
|
||||
fi
|
||||
INSTALL_USER="$2"
|
||||
shift
|
||||
;;
|
||||
'--reinstall')
|
||||
REINSTALL='1'
|
||||
;;
|
||||
'--no-update-service')
|
||||
N_UP_SERVICE='1'
|
||||
;;
|
||||
*)
|
||||
echo "$0: unknown option -- -"
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
shift
|
||||
done
|
||||
if ((INSTALL+INSTALL_GEODATA+HELP+CHECK+REMOVE==0)); then
|
||||
INSTALL='1'
|
||||
elif ((INSTALL+INSTALL_GEODATA+HELP+CHECK+REMOVE>1)); then
|
||||
echo 'You can only choose one action.'
|
||||
exit 1
|
||||
fi
|
||||
if [[ "$INSTALL" -eq '1' ]] && ((temp_version+local_install+REINSTALL+BETA>1)); then
|
||||
echo "--version,--reinstall,--beta and --local can't be used together."
|
||||
exit 1
|
||||
fi
|
||||
}
|
||||
|
||||
check_install_user() {
|
||||
if [[ -z "$INSTALL_USER" ]]; then
|
||||
if [[ -f '/usr/local/bin/xray' ]]; then
|
||||
INSTALL_USER="$(grep '^[ '$'\t]*User[ '$'\t]*=' /etc/systemd/system/xray.service | tail -n 1 | awk -F = '{print $2}' | awk '{print $1}')"
|
||||
if [[ -z "$INSTALL_USER" ]]; then
|
||||
INSTALL_USER='root'
|
||||
fi
|
||||
else
|
||||
INSTALL_USER='nobody'
|
||||
fi
|
||||
fi
|
||||
if ! id $INSTALL_USER > /dev/null 2>&1; then
|
||||
echo "the user '$INSTALL_USER' is not effective"
|
||||
exit 1
|
||||
fi
|
||||
INSTALL_USER_UID="$(id -u $INSTALL_USER)"
|
||||
INSTALL_USER_GID="$(id -g $INSTALL_USER)"
|
||||
}
|
||||
|
||||
install_software() {
|
||||
package_name="$1"
|
||||
file_to_detect="$2"
|
||||
type -P "$file_to_detect" > /dev/null 2>&1 && return
|
||||
if ${PACKAGE_MANAGEMENT_INSTALL} "$package_name"; then
|
||||
echo "info: $package_name is installed."
|
||||
else
|
||||
echo "error: Installation of $package_name failed, please check your network."
|
||||
exit 1
|
||||
fi
|
||||
}
|
||||
|
||||
get_current_version() {
|
||||
# Get the CURRENT_VERSION
|
||||
if [[ -f '/usr/local/bin/xray' ]]; then
|
||||
CURRENT_VERSION="$(/usr/local/bin/xray -version | awk 'NR==1 {print $2}')"
|
||||
CURRENT_VERSION="v${CURRENT_VERSION#v}"
|
||||
else
|
||||
CURRENT_VERSION=""
|
||||
fi
|
||||
}
|
||||
|
||||
get_latest_version() {
|
||||
# Get Xray latest release version number
|
||||
local tmp_file
|
||||
tmp_file="$(mktemp)"
|
||||
if ! curl -x "${PROXY}" -sS -H "Accept: application/vnd.github.v3+json" -o "$tmp_file" 'https://api.github.com/repos/XTLS/Xray-core/releases/latest'; then
|
||||
"rm" "$tmp_file"
|
||||
echo 'error: Failed to get release list, please check your network.'
|
||||
exit 1
|
||||
fi
|
||||
RELEASE_LATEST="$(sed 'y/,/\n/' "$tmp_file" | grep 'tag_name' | awk -F '"' '{print $4}')"
|
||||
if [[ -z "$RELEASE_LATEST" ]]; then
|
||||
if grep -q "API rate limit exceeded" "$tmp_file"; then
|
||||
echo "error: github API rate limit exceeded"
|
||||
else
|
||||
echo "error: Failed to get the latest release version."
|
||||
echo "Welcome bug report:https://github.com/XTLS/Xray-install/issues"
|
||||
fi
|
||||
"rm" "$tmp_file"
|
||||
exit 1
|
||||
fi
|
||||
"rm" "$tmp_file"
|
||||
RELEASE_LATEST="v${RELEASE_LATEST#v}"
|
||||
if ! curl -x "${PROXY}" -sS -H "Accept: application/vnd.github.v3+json" -o "$tmp_file" 'https://api.github.com/repos/XTLS/Xray-core/releases'; then
|
||||
"rm" "$tmp_file"
|
||||
echo 'error: Failed to get release list, please check your network.'
|
||||
exit 1
|
||||
fi
|
||||
local releases_list
|
||||
releases_list=($(sed 'y/,/\n/' "$tmp_file" | grep 'tag_name' | awk -F '"' '{print $4}'))
|
||||
if [[ "${#releases_list[@]}" -eq '0' ]]; then
|
||||
if grep -q "API rate limit exceeded" "$tmp_file"; then
|
||||
echo "error: github API rate limit exceeded"
|
||||
else
|
||||
echo "error: Failed to get the latest release version."
|
||||
echo "Welcome bug report:https://github.com/XTLS/Xray-install/issues"
|
||||
fi
|
||||
"rm" "$tmp_file"
|
||||
exit 1
|
||||
fi
|
||||
local i
|
||||
for i in ${!releases_list[@]}
|
||||
do
|
||||
releases_list[$i]="v${releases_list[$i]#v}"
|
||||
grep -q "https://github.com/XTLS/Xray-core/releases/download/${releases_list[$i]}/Xray-linux-$MACHINE.zip" "$tmp_file" && break
|
||||
done
|
||||
"rm" "$tmp_file"
|
||||
PRE_RELEASE_LATEST="${releases_list[$i]}"
|
||||
}
|
||||
|
||||
version_gt() {
|
||||
# compare two version
|
||||
# 0: $1 > $2
|
||||
# 1: $1 <= $2
|
||||
|
||||
if [[ "$1" != "$2" ]]; then
|
||||
local temp_1_version_number="${1#v}"
|
||||
local temp_1_major_version_number="${temp_1_version_number%%.*}"
|
||||
local temp_1_minor_version_number
|
||||
temp_1_minor_version_number="$(echo "$temp_1_version_number" | awk -F '.' '{print $2}')"
|
||||
local temp_1_minimunm_version_number="${temp_1_version_number##*.}"
|
||||
# shellcheck disable=SC2001
|
||||
local temp_2_version_number="${2#v}"
|
||||
local temp_2_major_version_number="${temp_2_version_number%%.*}"
|
||||
local temp_2_minor_version_number
|
||||
temp_2_minor_version_number="$(echo "$temp_2_version_number" | awk -F '.' '{print $2}')"
|
||||
local temp_2_minimunm_version_number="${temp_2_version_number##*.}"
|
||||
if [[ "$temp_1_major_version_number" -gt "$temp_2_major_version_number" ]]; then
|
||||
return 0
|
||||
elif [[ "$temp_1_major_version_number" -eq "$temp_2_major_version_number" ]]; then
|
||||
if [[ "$temp_1_minor_version_number" -gt "$temp_2_minor_version_number" ]]; then
|
||||
return 0
|
||||
elif [[ "$temp_1_minor_version_number" -eq "$temp_2_minor_version_number" ]]; then
|
||||
if [[ "$temp_1_minimunm_version_number" -gt "$temp_2_minimunm_version_number" ]]; then
|
||||
return 0
|
||||
else
|
||||
return 1
|
||||
fi
|
||||
else
|
||||
return 1
|
||||
fi
|
||||
else
|
||||
return 1
|
||||
fi
|
||||
elif [[ "$1" == "$2" ]]; then
|
||||
return 1
|
||||
fi
|
||||
}
|
||||
|
||||
download_xray() {
|
||||
DOWNLOAD_LINK="https://github.com/XTLS/Xray-core/releases/download/$INSTALL_VERSION/Xray-linux-$MACHINE.zip"
|
||||
echo "Downloading Xray archive: $DOWNLOAD_LINK"
|
||||
if ! curl -x "${PROXY}" -R -H 'Cache-Control: no-cache' -o "$ZIP_FILE" "$DOWNLOAD_LINK"; then
|
||||
echo 'error: Download failed! Please check your network or try again.'
|
||||
return 1
|
||||
fi
|
||||
return 0
|
||||
echo "Downloading verification file for Xray archive: $DOWNLOAD_LINK.dgst"
|
||||
if ! curl -x "${PROXY}" -sSR -H 'Cache-Control: no-cache' -o "$ZIP_FILE.dgst" "$DOWNLOAD_LINK.dgst"; then
|
||||
echo 'error: Download failed! Please check your network or try again.'
|
||||
return 1
|
||||
fi
|
||||
if [[ "$(cat "$ZIP_FILE".dgst)" == 'Not Found' ]]; then
|
||||
echo 'error: This version does not support verification. Please replace with another version.'
|
||||
return 1
|
||||
fi
|
||||
|
||||
# Verification of Xray archive
|
||||
for LISTSUM in 'md5' 'sha1' 'sha256' 'sha512'; do
|
||||
SUM="$(${LISTSUM}sum "$ZIP_FILE" | sed 's/ .*//')"
|
||||
CHECKSUM="$(grep ${LISTSUM^^} "$ZIP_FILE".dgst | grep "$SUM" -o -a | uniq)"
|
||||
if [[ "$SUM" != "$CHECKSUM" ]]; then
|
||||
echo 'error: Check failed! Please check your network or try again.'
|
||||
return 1
|
||||
fi
|
||||
done
|
||||
}
|
||||
|
||||
decompression() {
|
||||
if ! unzip -q "$1" -d "$TMP_DIRECTORY"; then
|
||||
echo 'error: Xray decompression failed.'
|
||||
"rm" -r "$TMP_DIRECTORY"
|
||||
echo "removed: $TMP_DIRECTORY"
|
||||
exit 1
|
||||
fi
|
||||
echo "info: Extract the Xray package to $TMP_DIRECTORY and prepare it for installation."
|
||||
}
|
||||
|
||||
install_file() {
|
||||
NAME="$1"
|
||||
if [[ "$NAME" == 'xray' ]]; then
|
||||
install -m 755 "${TMP_DIRECTORY}/$NAME" "/usr/local/bin/$NAME"
|
||||
elif [[ "$NAME" == 'geoip.dat' ]] || [[ "$NAME" == 'geosite.dat' ]]; then
|
||||
install -m 644 "${TMP_DIRECTORY}/$NAME" "${DAT_PATH}/$NAME"
|
||||
fi
|
||||
}
|
||||
|
||||
install_xray() {
|
||||
# Install Xray binary to /usr/local/bin/ and $DAT_PATH
|
||||
install_file xray
|
||||
# If the file exists, geoip.dat and geosite.dat will not be installed or updated
|
||||
if [[ "$NO_GEODATA" -eq '0' ]] && [[ ! -f "${DAT_PATH}/.undat" ]]; then
|
||||
install -d "$DAT_PATH"
|
||||
install_file geoip.dat
|
||||
install_file geosite.dat
|
||||
GEODATA='1'
|
||||
fi
|
||||
|
||||
# Install Xray configuration file to $JSON_PATH
|
||||
# shellcheck disable=SC2153
|
||||
if [[ -z "$JSONS_PATH" ]] && [[ ! -d "$JSON_PATH" ]]; then
|
||||
install -d "$JSON_PATH"
|
||||
echo "{}" > "${JSON_PATH}/config.json"
|
||||
CONFIG_NEW='1'
|
||||
fi
|
||||
|
||||
# Install Xray configuration file to $JSONS_PATH
|
||||
if [[ -n "$JSONS_PATH" ]] && [[ ! -d "$JSONS_PATH" ]]; then
|
||||
install -d "$JSONS_PATH"
|
||||
for BASE in 00_log 01_api 02_dns 03_routing 04_policy 05_inbounds 06_outbounds 07_transport 08_stats 09_reverse; do
|
||||
echo '{}' > "${JSONS_PATH}/${BASE}.json"
|
||||
done
|
||||
CONFDIR='1'
|
||||
fi
|
||||
|
||||
# Used to store Xray log files
|
||||
if [[ "$NO_LOGFILES" -eq '0' ]]; then
|
||||
if [[ ! -d '/var/log/xray/' ]]; then
|
||||
install -d -m 700 -o "$INSTALL_USER_UID" -g "$INSTALL_USER_GID" /var/log/xray/
|
||||
install -m 600 -o "$INSTALL_USER_UID" -g "$INSTALL_USER_GID" /dev/null /var/log/xray/access.log
|
||||
install -m 600 -o "$INSTALL_USER_UID" -g "$INSTALL_USER_GID" /dev/null /var/log/xray/error.log
|
||||
LOG='1'
|
||||
else
|
||||
chown -R "$INSTALL_USER_UID:$INSTALL_USER_GID" /var/log/xray/
|
||||
fi
|
||||
fi
|
||||
}
|
||||
|
||||
install_startup_service_file() {
|
||||
mkdir -p '/etc/systemd/system/xray.service.d'
|
||||
mkdir -p '/etc/systemd/system/xray@.service.d/'
|
||||
local temp_CapabilityBoundingSet="CapabilityBoundingSet=CAP_NET_ADMIN CAP_NET_BIND_SERVICE"
|
||||
local temp_AmbientCapabilities="AmbientCapabilities=CAP_NET_ADMIN CAP_NET_BIND_SERVICE"
|
||||
local temp_NoNewPrivileges="NoNewPrivileges=true"
|
||||
if [[ "$INSTALL_USER_UID" -eq '0' ]]; then
|
||||
temp_CapabilityBoundingSet="#${temp_CapabilityBoundingSet}"
|
||||
temp_AmbientCapabilities="#${temp_AmbientCapabilities}"
|
||||
temp_NoNewPrivileges="#${temp_NoNewPrivileges}"
|
||||
fi
|
||||
cat > /etc/systemd/system/xray.service << EOF
|
||||
[Unit]
|
||||
Description=Xray Service
|
||||
Documentation=https://github.com/xtls
|
||||
After=network.target nss-lookup.target
|
||||
|
||||
[Service]
|
||||
User=$INSTALL_USER
|
||||
${temp_CapabilityBoundingSet}
|
||||
${temp_AmbientCapabilities}
|
||||
${temp_NoNewPrivileges}
|
||||
ExecStart=/usr/local/bin/xray run -config /usr/local/etc/xray/config.json
|
||||
Restart=on-failure
|
||||
RestartPreventExitStatus=23
|
||||
LimitNPROC=10000
|
||||
LimitNOFILE=1000000
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
||||
EOF
|
||||
cat > /etc/systemd/system/xray@.service <<EOF
|
||||
[Unit]
|
||||
Description=Xray Service
|
||||
Documentation=https://github.com/xtls
|
||||
After=network.target nss-lookup.target
|
||||
|
||||
[Service]
|
||||
User=$INSTALL_USER
|
||||
${temp_CapabilityBoundingSet}
|
||||
${temp_AmbientCapabilities}
|
||||
${temp_NoNewPrivileges}
|
||||
ExecStart=/usr/local/bin/xray run -config /usr/local/etc/xray/%i.json
|
||||
Restart=on-failure
|
||||
RestartPreventExitStatus=23
|
||||
LimitNPROC=10000
|
||||
LimitNOFILE=1000000
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
||||
EOF
|
||||
chmod 644 /etc/systemd/system/xray.service /etc/systemd/system/xray@.service
|
||||
if [[ -n "$JSONS_PATH" ]]; then
|
||||
"rm" '/etc/systemd/system/xray.service.d/10-donot_touch_single_conf.conf' \
|
||||
'/etc/systemd/system/xray@.service.d/10-donot_touch_single_conf.conf'
|
||||
echo "# In case you have a good reason to do so, duplicate this file in the same directory and make your customizes there.
|
||||
# Or all changes you made will be lost! # Refer: https://www.freedesktop.org/software/systemd/man/systemd.unit.html
|
||||
[Service]
|
||||
ExecStart=
|
||||
ExecStart=/usr/local/bin/xray run -confdir $JSONS_PATH" |
|
||||
tee '/etc/systemd/system/xray.service.d/10-donot_touch_multi_conf.conf' > \
|
||||
'/etc/systemd/system/xray@.service.d/10-donot_touch_multi_conf.conf'
|
||||
else
|
||||
"rm" '/etc/systemd/system/xray.service.d/10-donot_touch_multi_conf.conf' \
|
||||
'/etc/systemd/system/xray@.service.d/10-donot_touch_multi_conf.conf'
|
||||
echo "# In case you have a good reason to do so, duplicate this file in the same directory and make your customizes there.
|
||||
# Or all changes you made will be lost! # Refer: https://www.freedesktop.org/software/systemd/man/systemd.unit.html
|
||||
[Service]
|
||||
ExecStart=
|
||||
ExecStart=/usr/local/bin/xray run -config ${JSON_PATH}/config.json" > \
|
||||
'/etc/systemd/system/xray.service.d/10-donot_touch_single_conf.conf'
|
||||
echo "# In case you have a good reason to do so, duplicate this file in the same directory and make your customizes there.
|
||||
# Or all changes you made will be lost! # Refer: https://www.freedesktop.org/software/systemd/man/systemd.unit.html
|
||||
[Service]
|
||||
ExecStart=
|
||||
ExecStart=/usr/local/bin/xray run -config ${JSON_PATH}/%i.json" > \
|
||||
'/etc/systemd/system/xray@.service.d/10-donot_touch_single_conf.conf'
|
||||
fi
|
||||
echo "info: Systemd service files have been installed successfully!"
|
||||
echo "${red}warning: ${green}The following are the actual parameters for the xray service startup."
|
||||
echo "${red}warning: ${green}Please make sure the configuration file path is correctly set.${reset}"
|
||||
systemd_cat_config /etc/systemd/system/xray.service
|
||||
# shellcheck disable=SC2154
|
||||
if [[ x"${check_all_service_files:0:1}" = x'y' ]]; then
|
||||
echo
|
||||
echo
|
||||
systemd_cat_config /etc/systemd/system/xray@.service
|
||||
fi
|
||||
systemctl daemon-reload
|
||||
SYSTEMD='1'
|
||||
}
|
||||
|
||||
start_xray() {
|
||||
if [[ -f '/etc/systemd/system/xray.service' ]]; then
|
||||
systemctl start "${XRAY_CUSTOMIZE:-xray}"
|
||||
sleep 1s
|
||||
if systemctl -q is-active "${XRAY_CUSTOMIZE:-xray}"; then
|
||||
echo 'info: Start the Xray service.'
|
||||
else
|
||||
echo 'error: Failed to start Xray service.'
|
||||
exit 1
|
||||
fi
|
||||
fi
|
||||
}
|
||||
|
||||
stop_xray() {
|
||||
XRAY_CUSTOMIZE="$(systemctl list-units | grep 'xray@' | awk -F ' ' '{print $1}')"
|
||||
if [[ -z "$XRAY_CUSTOMIZE" ]]; then
|
||||
local xray_daemon_to_stop='xray.service'
|
||||
else
|
||||
local xray_daemon_to_stop="$XRAY_CUSTOMIZE"
|
||||
fi
|
||||
if ! systemctl stop "$xray_daemon_to_stop"; then
|
||||
echo 'error: Stopping the Xray service failed.'
|
||||
exit 1
|
||||
fi
|
||||
echo 'info: Stop the Xray service.'
|
||||
}
|
||||
|
||||
install_geodata() {
|
||||
download_geodata() {
|
||||
if ! curl -x "${PROXY}" -R -H 'Cache-Control: no-cache' -o "${dir_tmp}/${2}" "${1}"; then
|
||||
echo 'error: Download failed! Please check your network or try again.'
|
||||
exit 1
|
||||
fi
|
||||
if ! curl -x "${PROXY}" -R -H 'Cache-Control: no-cache' -o "${dir_tmp}/${2}.sha256sum" "${1}.sha256sum"; then
|
||||
echo 'error: Download failed! Please check your network or try again.'
|
||||
exit 1
|
||||
fi
|
||||
}
|
||||
local download_link_geoip="https://github.com/v2fly/geoip/releases/latest/download/geoip.dat"
|
||||
local download_link_geosite="https://github.com/v2fly/domain-list-community/releases/latest/download/dlc.dat"
|
||||
local file_ip='geoip.dat'
|
||||
local file_dlc='dlc.dat'
|
||||
local file_site='geosite.dat'
|
||||
local dir_tmp
|
||||
dir_tmp="$(mktemp -d)"
|
||||
[[ "$XRAY_IS_INSTALLED_BEFORE_RUNNING_SCRIPT" -eq '0' ]] && echo "warning: Xray was not installed"
|
||||
download_geodata $download_link_geoip $file_ip
|
||||
download_geodata $download_link_geosite $file_dlc
|
||||
cd "${dir_tmp}" || exit
|
||||
for i in "${dir_tmp}"/*.sha256sum; do
|
||||
if ! sha256sum -c "${i}"; then
|
||||
echo 'error: Check failed! Please check your network or try again.'
|
||||
exit 1
|
||||
fi
|
||||
done
|
||||
cd - > /dev/null
|
||||
install -d "$DAT_PATH"
|
||||
install -m 644 "${dir_tmp}"/${file_dlc} "${DAT_PATH}"/${file_site}
|
||||
install -m 644 "${dir_tmp}"/${file_ip} "${DAT_PATH}"/${file_ip}
|
||||
rm -r "${dir_tmp}"
|
||||
exit 0
|
||||
}
|
||||
|
||||
check_update() {
|
||||
if [[ "$XRAY_IS_INSTALLED_BEFORE_RUNNING_SCRIPT" -eq '1' ]]; then
|
||||
get_current_version
|
||||
echo "info: The current version of Xray is $CURRENT_VERSION ."
|
||||
else
|
||||
echo 'warning: Xray is not installed.'
|
||||
fi
|
||||
get_latest_version
|
||||
echo "info: The latest release version of Xray is $RELEASE_LATEST ."
|
||||
echo "info: The latest pre-release/release version of Xray is $PRE_RELEASE_LATEST ."
|
||||
exit 0
|
||||
}
|
||||
|
||||
remove_xray() {
|
||||
if systemctl list-unit-files | grep -qw 'xray'; then
|
||||
if [[ -n "$(pidof xray)" ]]; then
|
||||
stop_xray
|
||||
fi
|
||||
local delete_files=('/usr/local/bin/xray' '/etc/systemd/system/xray.service' '/etc/systemd/system/xray@.service' '/etc/systemd/system/xray.service.d' '/etc/systemd/system/xray@.service.d')
|
||||
[[ -d "$DAT_PATH" ]] && delete_files+=("$DAT_PATH")
|
||||
if [[ "$PURGE" -eq '1' ]]; then
|
||||
if [[ -z "$JSONS_PATH" ]]; then
|
||||
delete_files+=("$JSON_PATH")
|
||||
else
|
||||
delete_files+=("$JSONS_PATH")
|
||||
fi
|
||||
[[ -d '/var/log/xray' ]] && delete_files+=('/var/log/xray')
|
||||
fi
|
||||
systemctl disable xray
|
||||
if ! ("rm" -r "${delete_files[@]}"); then
|
||||
echo 'error: Failed to remove Xray.'
|
||||
exit 1
|
||||
else
|
||||
for i in ${!delete_files[@]}
|
||||
do
|
||||
echo "removed: ${delete_files[$i]}"
|
||||
done
|
||||
systemctl daemon-reload
|
||||
echo "You may need to execute a command to remove dependent software: $PACKAGE_MANAGEMENT_REMOVE curl unzip"
|
||||
echo 'info: Xray has been removed.'
|
||||
if [[ "$PURGE" -eq '0' ]]; then
|
||||
echo 'info: If necessary, manually delete the configuration and log files.'
|
||||
if [[ -n "$JSONS_PATH" ]]; then
|
||||
echo "info: e.g., $JSONS_PATH and /var/log/xray/ ..."
|
||||
else
|
||||
echo "info: e.g., $JSON_PATH and /var/log/xray/ ..."
|
||||
fi
|
||||
fi
|
||||
exit 0
|
||||
fi
|
||||
else
|
||||
echo 'error: Xray is not installed.'
|
||||
exit 1
|
||||
fi
|
||||
}
|
||||
|
||||
# Explanation of parameters in the script
|
||||
show_help() {
|
||||
echo "usage: $0 ACTION [OPTION]..."
|
||||
echo
|
||||
echo 'ACTION:'
|
||||
echo ' install Install/Update Xray'
|
||||
echo ' install-geodata Install/Update geoip.dat and geosite.dat only'
|
||||
echo ' remove Remove Xray'
|
||||
echo ' help Show help'
|
||||
echo ' check Check if Xray can be updated'
|
||||
echo 'If no action is specified, then install will be selected'
|
||||
echo
|
||||
echo 'OPTION:'
|
||||
echo ' install:'
|
||||
echo ' --version Install the specified version of Xray, e.g., --version v1.0.0'
|
||||
echo ' -f, --force Force install even though the versions are same'
|
||||
echo ' --beta Install the pre-release version if it is exist'
|
||||
echo ' -l, --local Install Xray from a local file'
|
||||
echo ' -p, --proxy Download through a proxy server, e.g., -p http://127.0.0.1:8118 or -p socks5://127.0.0.1:1080'
|
||||
echo ' -u, --install-user Install Xray in specified user, e.g, -u root'
|
||||
echo ' --reinstall Reinstall current Xray version'
|
||||
echo " --no-update-service Don't change service files if they are exist"
|
||||
echo " --without-geodata Don't install/update geoip.dat and geosite.dat"
|
||||
echo " --without-logfiles Don't install /var/log/xray"
|
||||
echo ' install-geodata:'
|
||||
echo ' -p, --proxy Download through a proxy server'
|
||||
echo ' remove:'
|
||||
echo ' --purge Remove all the Xray files, include logs, configs, etc'
|
||||
echo ' check:'
|
||||
echo ' -p, --proxy Check new version through a proxy server'
|
||||
exit 0
|
||||
}
|
||||
|
||||
main() {
|
||||
check_if_running_as_root
|
||||
identify_the_operating_system_and_architecture
|
||||
judgment_parameters "$@"
|
||||
|
||||
install_software "$package_provide_tput" 'tput'
|
||||
red=$(tput setaf 1)
|
||||
green=$(tput setaf 2)
|
||||
aoi=$(tput setaf 6)
|
||||
reset=$(tput sgr0)
|
||||
|
||||
# Parameter information
|
||||
[[ "$HELP" -eq '1' ]] && show_help
|
||||
[[ "$CHECK" -eq '1' ]] && check_update
|
||||
[[ "$REMOVE" -eq '1' ]] && remove_xray
|
||||
[[ "$INSTALL_GEODATA" -eq '1' ]] && install_geodata
|
||||
|
||||
# Check if the user is effective
|
||||
check_install_user
|
||||
|
||||
# Two very important variables
|
||||
TMP_DIRECTORY="$(mktemp -d)"
|
||||
ZIP_FILE="${TMP_DIRECTORY}/Xray-linux-$MACHINE.zip"
|
||||
|
||||
# Install Xray from a local file, but still need to make sure the network is available
|
||||
if [[ -n "$LOCAL_FILE" ]]; then
|
||||
echo 'warn: Install Xray from a local file, but still need to make sure the network is available.'
|
||||
echo -n 'warn: Please make sure the file is valid because we cannot confirm it. (Press any key) ...'
|
||||
read -r
|
||||
install_software 'unzip' 'unzip'
|
||||
decompression "$LOCAL_FILE"
|
||||
else
|
||||
get_current_version
|
||||
if [[ "$REINSTALL" -eq '1' ]]; then
|
||||
if [[ -z "$CURRENT_VERSION" ]]; then
|
||||
echo "error: Xray is not installed"
|
||||
exit 1
|
||||
fi
|
||||
INSTALL_VERSION="$CURRENT_VERSION"
|
||||
echo "info: Reinstalling Xray $CURRENT_VERSION"
|
||||
elif [[ -n "$SPECIFIED_VERSION" ]]; then
|
||||
SPECIFIED_VERSION="v${SPECIFIED_VERSION#v}"
|
||||
if [[ "$CURRENT_VERSION" == "$SPECIFIED_VERSION" ]] && [[ "$FORCE" -eq '0' ]]; then
|
||||
echo "info: The current version is same as the specified version. The version is $CURRENT_VERSION ."
|
||||
exit 0
|
||||
fi
|
||||
INSTALL_VERSION="$SPECIFIED_VERSION"
|
||||
echo "info: Installing specified Xray version $INSTALL_VERSION for $(uname -m)"
|
||||
else
|
||||
install_software 'curl' 'curl'
|
||||
get_latest_version
|
||||
if [[ "$BETA" -eq '0' ]]; then
|
||||
INSTALL_VERSION="$RELEASE_LATEST"
|
||||
else
|
||||
INSTALL_VERSION="$PRE_RELEASE_LATEST"
|
||||
fi
|
||||
if ! version_gt "$INSTALL_VERSION" "$CURRENT_VERSION" && [[ "$FORCE" -eq '0' ]]; then
|
||||
echo "info: No new version. The current version of Xray is $CURRENT_VERSION ."
|
||||
exit 0
|
||||
fi
|
||||
echo "info: Installing Xray $INSTALL_VERSION for $(uname -m)"
|
||||
fi
|
||||
install_software 'curl' 'curl'
|
||||
install_software 'unzip' 'unzip'
|
||||
if ! download_xray; then
|
||||
"rm" -r "$TMP_DIRECTORY"
|
||||
echo "removed: $TMP_DIRECTORY"
|
||||
exit 1
|
||||
fi
|
||||
decompression "$ZIP_FILE"
|
||||
fi
|
||||
|
||||
# Determine if Xray is running
|
||||
if systemctl list-unit-files | grep -qw 'xray'; then
|
||||
if [[ -n "$(pidof xray)" ]]; then
|
||||
stop_xray
|
||||
XRAY_RUNNING='1'
|
||||
fi
|
||||
fi
|
||||
install_xray
|
||||
([[ "$N_UP_SERVICE" -eq '1' ]] && [[ -f '/etc/systemd/system/xray.service' ]]) || install_startup_service_file
|
||||
echo 'installed: /usr/local/bin/xray'
|
||||
# If the file exists, the content output of installing or updating geoip.dat and geosite.dat will not be displayed
|
||||
if [[ "$GEODATA" -eq '1' ]]; then
|
||||
echo "installed: ${DAT_PATH}/geoip.dat"
|
||||
echo "installed: ${DAT_PATH}/geosite.dat"
|
||||
fi
|
||||
if [[ "$CONFIG_NEW" -eq '1' ]]; then
|
||||
echo "installed: ${JSON_PATH}/config.json"
|
||||
fi
|
||||
if [[ "$CONFDIR" -eq '1' ]]; then
|
||||
echo "installed: ${JSON_PATH}/00_log.json"
|
||||
echo "installed: ${JSON_PATH}/01_api.json"
|
||||
echo "installed: ${JSON_PATH}/02_dns.json"
|
||||
echo "installed: ${JSON_PATH}/03_routing.json"
|
||||
echo "installed: ${JSON_PATH}/04_policy.json"
|
||||
echo "installed: ${JSON_PATH}/05_inbounds.json"
|
||||
echo "installed: ${JSON_PATH}/06_outbounds.json"
|
||||
echo "installed: ${JSON_PATH}/07_transport.json"
|
||||
echo "installed: ${JSON_PATH}/08_stats.json"
|
||||
echo "installed: ${JSON_PATH}/09_reverse.json"
|
||||
fi
|
||||
if [[ "$LOG" -eq '1' ]]; then
|
||||
echo 'installed: /var/log/xray/'
|
||||
echo 'installed: /var/log/xray/access.log'
|
||||
echo 'installed: /var/log/xray/error.log'
|
||||
fi
|
||||
if [[ "$SYSTEMD" -eq '1' ]]; then
|
||||
echo 'installed: /etc/systemd/system/xray.service'
|
||||
echo 'installed: /etc/systemd/system/xray@.service'
|
||||
fi
|
||||
"rm" -r "$TMP_DIRECTORY"
|
||||
echo "removed: $TMP_DIRECTORY"
|
||||
get_current_version
|
||||
echo "info: Xray $CURRENT_VERSION is installed."
|
||||
echo "You may need to execute a command to remove dependent software: $PACKAGE_MANAGEMENT_REMOVE curl unzip"
|
||||
if [[ "$XRAY_IS_INSTALLED_BEFORE_RUNNING_SCRIPT" -eq '1' ]] && [[ "$FORCE" -eq '0' ]] && [[ "$REINSTALL" -eq '0' ]]; then
|
||||
[[ "$XRAY_RUNNING" -eq '1' ]] && start_xray
|
||||
else
|
||||
systemctl start xray
|
||||
systemctl enable xray
|
||||
sleep 1s
|
||||
if systemctl -q is-active xray; then
|
||||
echo "info: Enable and start the Xray service"
|
||||
else
|
||||
echo "warning: Failed to enable and start the Xray service"
|
||||
fi
|
||||
fi
|
||||
}
|
||||
|
||||
main "$@"
|
||||
73
v2ray示例/Xray-终级方案/1-边际节点使用的Xray配置.json
Normal file
73
v2ray示例/Xray-终级方案/1-边际节点使用的Xray配置.json
Normal file
@@ -0,0 +1,73 @@
|
||||
{
|
||||
"inbounds": [
|
||||
{
|
||||
"tag": "proxy",
|
||||
"protocol": "socks",
|
||||
"listen": "0.0.0.0",
|
||||
"port": 1234,
|
||||
"settings": {
|
||||
"auth": "noauth",
|
||||
"udp": true,
|
||||
"ip": "127.0.0.1",
|
||||
"userLevel": 0
|
||||
}
|
||||
},
|
||||
{
|
||||
"protocol": "socks",
|
||||
"tag": "cloudflare",
|
||||
"listen": "0.0.0.0",
|
||||
"port": 1235,
|
||||
"settings": {
|
||||
"auth": "noauth",
|
||||
"udp": true,
|
||||
"userLevel": 0
|
||||
}
|
||||
}
|
||||
],
|
||||
"outbounds": [
|
||||
{
|
||||
"tag": "cloudflare",
|
||||
"protocol": "socks",
|
||||
"settings": {
|
||||
"servers": [
|
||||
{
|
||||
"address": "127.0.0.1",
|
||||
"port": 40000,
|
||||
"level": 0
|
||||
}
|
||||
]
|
||||
},
|
||||
"streamSettings": {
|
||||
"network": "tcp"
|
||||
},
|
||||
"mux": {
|
||||
"enabled": false,
|
||||
"concurrency": -1
|
||||
}
|
||||
},
|
||||
{
|
||||
"tag": "proxy",
|
||||
"protocol": "freedom"
|
||||
}
|
||||
],
|
||||
"routing": {
|
||||
"domainStrategy": "IPIfNonMatch",
|
||||
"rules": [
|
||||
{
|
||||
"type": "field",
|
||||
"inboundTag": [
|
||||
"cloudflare"
|
||||
],
|
||||
"outboundTag": "cloudflare"
|
||||
},
|
||||
{
|
||||
"type": "field",
|
||||
"inboundTag": [
|
||||
"proxy"
|
||||
],
|
||||
"outboundTag": "proxy"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
|
||||
226
v2ray示例/Xray-终级方案/Phonix-amd64-02实际使用的Xray配置.json
Normal file
226
v2ray示例/Xray-终级方案/Phonix-amd64-02实际使用的Xray配置.json
Normal file
@@ -0,0 +1,226 @@
|
||||
{
|
||||
"log": {
|
||||
"access": "/var/log/xray/access.log",
|
||||
"error": "/var/log/xray/error.log",
|
||||
"loglevel": "warning"
|
||||
},
|
||||
"inbounds": [
|
||||
{
|
||||
"port": 19990,
|
||||
"protocol": "vless",
|
||||
"settings": {
|
||||
"clients": [
|
||||
{
|
||||
"id": "adbd84eb-15fe-4c62-931c-b471791672ad",
|
||||
"flow": "xtls-rprx-direct",
|
||||
"level": 0,
|
||||
"email": "ice@gmail.com"
|
||||
}
|
||||
],
|
||||
"decryption": "none",
|
||||
"fallbacks": [
|
||||
{
|
||||
"dest": 60001,
|
||||
"alpn": "",
|
||||
"xver": 1
|
||||
},
|
||||
{
|
||||
"dest": 60002,
|
||||
"alpn": "h2",
|
||||
"xver": 1
|
||||
},
|
||||
{
|
||||
"path": "/v2ice-vless-ws/",
|
||||
"dest": 19998,
|
||||
"xver": 1
|
||||
},
|
||||
{
|
||||
"path": "/v2ice-vmess-tcp",
|
||||
"dest": 19997,
|
||||
"xver": 1
|
||||
},
|
||||
{
|
||||
"path": "/v2ice-vmess-ws",
|
||||
"dest": 19996,
|
||||
"xver": 1
|
||||
}
|
||||
]
|
||||
},
|
||||
"streamSettings": {
|
||||
"network": "tcp",
|
||||
"security": "xtls",
|
||||
"xtlsSettings": {
|
||||
"alpn": [
|
||||
"h2",
|
||||
"http/1.1"
|
||||
],
|
||||
"certificates": [
|
||||
{
|
||||
"certificateFile": "/root/.acme.sh/xx.s4.cc.hh.107421.xyz_ecc/fullchain.cer",
|
||||
"keyFile": "/root/.acme.sh/xx.s4.cc.hh.107421.xyz_ecc/xx.s4.cc.hh.107421.xyz.key"
|
||||
}
|
||||
]
|
||||
},
|
||||
"sniffing": {
|
||||
"enabled": true,
|
||||
"destOverride": [
|
||||
"http",
|
||||
"tls"
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"port": 19999,
|
||||
"listen": "127.0.0.1",
|
||||
"protocol": "trojan",
|
||||
"settings": {
|
||||
"clients": [
|
||||
{
|
||||
"password": "loveff.22",
|
||||
"level": 0,
|
||||
"email": "ice@gmail.com.cn",
|
||||
"flow": "xtls-rprx-direct"
|
||||
}
|
||||
],
|
||||
"fallbacks": [
|
||||
{
|
||||
"dest": 8080,
|
||||
"alpn": "",
|
||||
"xver": 1
|
||||
},
|
||||
{
|
||||
"dest": 8081,
|
||||
"alpn": "h2",
|
||||
"xver": 1
|
||||
}
|
||||
]
|
||||
},
|
||||
"streamSettings": {
|
||||
"network": "tcp",
|
||||
"security": "xtls",
|
||||
"xtlsSettings": {
|
||||
"alpn": [
|
||||
"h2",
|
||||
"http/1.1"
|
||||
],
|
||||
"certificates": [
|
||||
{
|
||||
"certificateFile": "/root/.acme.sh/xx.s4.cc.hh.107421.xyz_ecc/fullchain.cer",
|
||||
"keyFile": "/root/.acme.sh/xx.s4.cc.hh.107421.xyz_ecc/xx.s4.cc.hh.107421.xyz.key"
|
||||
}
|
||||
]
|
||||
},
|
||||
"sniffing": {
|
||||
"enabled": true,
|
||||
"destOverride": [
|
||||
"http",
|
||||
"tls"
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"port": 19998,
|
||||
"listen": "127.0.0.1",
|
||||
"protocol": "vless",
|
||||
"settings": {
|
||||
"clients": [
|
||||
{
|
||||
"id": "adbd84eb-15fe-4c62-931c-b471791672ad",
|
||||
"level": 0,
|
||||
"email": "ice@gmail.com"
|
||||
}
|
||||
],
|
||||
"decryption": "none"
|
||||
},
|
||||
"streamSettings": {
|
||||
"network": "ws",
|
||||
"security": "none",
|
||||
"wsSettings": {
|
||||
"acceptProxyProtocol": true,
|
||||
"path": "/v2ice-vless-ws/"
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"port": 19997,
|
||||
"listen": "127.0.0.1",
|
||||
"protocol": "vmess",
|
||||
"settings": {
|
||||
"clients": [
|
||||
{
|
||||
"id": "3da8aa3f-ddd7-49bf-94ba-950593f24471",
|
||||
"level": 0,
|
||||
"email": "ice@gmail.com"
|
||||
}
|
||||
]
|
||||
},
|
||||
"streamSettings": {
|
||||
"network": "tcp",
|
||||
"security": "auto",
|
||||
"tcpSettings": {
|
||||
"acceptProxyProtocol": true,
|
||||
"header": {
|
||||
"type": "http",
|
||||
"request": {
|
||||
"path": [
|
||||
"/v2ice-vmess-tcp"
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"port": 19996,
|
||||
"listen": "127.0.0.1",
|
||||
"protocol": "vmess",
|
||||
"settings": {
|
||||
"clients": [
|
||||
{
|
||||
"id": "c08e68f1-283c-4f91-9603-0b80484bb283",
|
||||
"level": 0,
|
||||
"email": "ice@gmail.com"
|
||||
}
|
||||
]
|
||||
},
|
||||
"streamSettings": {
|
||||
"network": "ws",
|
||||
"security": "auto",
|
||||
"wsSettings": {
|
||||
"acceptProxyProtocol": true,
|
||||
"path": "/v2ice-vmess-ws"
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"port": 19995,
|
||||
"listen": "0.0.0.0",
|
||||
"protocol": "vmess",
|
||||
"settings": {
|
||||
"clients": [
|
||||
{
|
||||
"id": "becaca40-b457-4572-9b46-ed66ecca7b4e",
|
||||
"level": 0,
|
||||
"alterId": 0,
|
||||
"email": "ice@cc.com"
|
||||
}
|
||||
]
|
||||
},
|
||||
"streamSettings": {
|
||||
"network": "ws",
|
||||
"security": "auto",
|
||||
"wsSettings": {
|
||||
"acceptProxyProtocol": false,
|
||||
"path": "/v2ice-default-ws"
|
||||
}
|
||||
}
|
||||
}
|
||||
],
|
||||
"outbounds": [
|
||||
{
|
||||
"protocol": "freedom"
|
||||
}
|
||||
]
|
||||
}
|
||||
225
v2ray示例/Xray-终级方案/Seoul1-实际使用的Xray配置.json
Normal file
225
v2ray示例/Xray-终级方案/Seoul1-实际使用的Xray配置.json
Normal file
@@ -0,0 +1,225 @@
|
||||
{
|
||||
"inbounds": [
|
||||
{
|
||||
"protocol": "trojan",
|
||||
"listen": "0.0.0.0",
|
||||
"port": 443,
|
||||
"settings": {
|
||||
"clients": [
|
||||
{
|
||||
"password": "V2ryStr0ngP0ss",
|
||||
"email": "lovemm@107421.xyz"
|
||||
}
|
||||
]
|
||||
},
|
||||
"streamSettings": {
|
||||
"network": "tcp",
|
||||
"security": "tls",
|
||||
"tlsSettings": {
|
||||
"alpn": [
|
||||
"h2",
|
||||
"http/1.1"
|
||||
],
|
||||
"certificates": [
|
||||
{
|
||||
"certificateFile": "/root/.acme.sh/xx.s4.cc.hh.107421.xyz_ecc/fullchain.cer",
|
||||
"keyFile": "/root/.acme.sh/xx.s4.cc.hh.107421.xyz_ecc/xx.s4.cc.hh.107421.xyz.key"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"tag": "Seoul-amd64-01"
|
||||
},
|
||||
{
|
||||
"protocol": "trojan",
|
||||
"listen": "0.0.0.0",
|
||||
"port": 19999,
|
||||
"settings": {
|
||||
"clients": [
|
||||
{
|
||||
"password": "V2ryStr0ngP0ss",
|
||||
"email": "lovemm@107421.xyz"
|
||||
}
|
||||
]
|
||||
},
|
||||
"streamSettings": {
|
||||
"network": "tcp",
|
||||
"security": "tls",
|
||||
"tlsSettings": {
|
||||
"alpn": [
|
||||
"h2",
|
||||
"http/1.1"
|
||||
],
|
||||
"certificates": [
|
||||
{
|
||||
"certificateFile": "/root/.acme.sh/xx.s4.cc.hh.107421.xyz_ecc/fullchain.cer",
|
||||
"keyFile": "/root/.acme.sh/xx.s4.cc.hh.107421.xyz_ecc/xx.s4.cc.hh.107421.xyz.key"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"tag": "Seoul-amd64-01->Tokyo-amd64-02"
|
||||
},
|
||||
{
|
||||
"protocol": "trojan",
|
||||
"listen": "0.0.0.0",
|
||||
"port": 19998,
|
||||
"settings": {
|
||||
"clients": [
|
||||
{
|
||||
"password": "V2ryStr0ngP0ss",
|
||||
"email": "lovemm@107421.xyz"
|
||||
}
|
||||
]
|
||||
},
|
||||
"streamSettings": {
|
||||
"network": "tcp",
|
||||
"security": "tls",
|
||||
"tlsSettings": {
|
||||
"alpn": [
|
||||
"h2",
|
||||
"http/1.1"
|
||||
],
|
||||
"certificates": [
|
||||
{
|
||||
"certificateFile": "/root/.acme.sh/xx.s4.cc.hh.107421.xyz_ecc/fullchain.cer",
|
||||
"keyFile": "/root/.acme.sh/xx.s4.cc.hh.107421.xyz_ecc/xx.s4.cc.hh.107421.xyz.key"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"tag": "Seoul-amd64-01->Phoenix-amd64-02"
|
||||
},
|
||||
{
|
||||
"protocol": "trojan",
|
||||
"listen": "0.0.0.0",
|
||||
"port": 19997,
|
||||
"settings": {
|
||||
"clients": [
|
||||
{
|
||||
"password": "V2ryStr0ngP0ss",
|
||||
"email": "lovemm@107421.xyz"
|
||||
}
|
||||
]
|
||||
},
|
||||
"streamSettings": {
|
||||
"network": "tcp",
|
||||
"security": "tls",
|
||||
"tlsSettings": {
|
||||
"alpn": [
|
||||
"h2",
|
||||
"http/1.1"
|
||||
],
|
||||
"certificates": [
|
||||
{
|
||||
"certificateFile": "/root/.acme.sh/xx.s4.cc.hh.107421.xyz_ecc/fullchain.cer",
|
||||
"keyFile": "/root/.acme.sh/xx.s4.cc.hh.107421.xyz_ecc/xx.s4.cc.hh.107421.xyz.key"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"tag": "Seoul-amd64-01->Osaka-amd64-01"
|
||||
}
|
||||
],
|
||||
"outbounds": [
|
||||
{
|
||||
"protocol": "freedom"
|
||||
},
|
||||
{
|
||||
"protocol": "freedom",
|
||||
"tag": "Seoul-amd64-01"
|
||||
},
|
||||
{
|
||||
"protocol": "blackhole",
|
||||
"tag": "block"
|
||||
},
|
||||
{
|
||||
"tag": "Seoul-amd64-01->Tokyo-amd64-02",
|
||||
"protocol": "socks",
|
||||
"settings": {
|
||||
"servers": [
|
||||
{
|
||||
"address": "140.238.52.228",
|
||||
"port": 1234
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
"tag": "Seoul-amd64-01->Phoenix-amd64-02",
|
||||
"protocol": "socks",
|
||||
"settings": {
|
||||
"servers": [
|
||||
{
|
||||
"address": "129.146.171.163",
|
||||
"port": 1234
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
"tag": "Seoul-amd64-01->London-amd64-01",
|
||||
"protocol": "socks",
|
||||
"settings": {
|
||||
"servers": [
|
||||
{
|
||||
"address": "141.147.99.91",
|
||||
"port": 1234
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
"tag": "Seoul-amd64-01->Osaka-amd64-01",
|
||||
"protocol": "socks",
|
||||
"settings": {
|
||||
"servers": [
|
||||
{
|
||||
"address": "140.83.84.142",
|
||||
"port": 1234
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
],
|
||||
"routing": {
|
||||
"domainStrategy": "IPIfNonMatch",
|
||||
"rules": [
|
||||
{
|
||||
"type": "field",
|
||||
"inboundTag": [
|
||||
"Seoul-amd64-01"
|
||||
],
|
||||
"outboundTag": "Seoul-amd64-01"
|
||||
},
|
||||
{
|
||||
"type": "field",
|
||||
"inboundTag": [
|
||||
"Seoul-amd64-01->Tokyo-amd64-02"
|
||||
],
|
||||
"outboundTag": "Seoul-amd64-01->Tokyo-amd64-02"
|
||||
},
|
||||
{
|
||||
"type": "field",
|
||||
"inboundTag": [
|
||||
"Seoul-amd64-01->Phoenix-amd64-02"
|
||||
],
|
||||
"outboundTag": "Seoul-amd64-01->Phoenix-amd64-02"
|
||||
},
|
||||
{
|
||||
"type": "field",
|
||||
"inboundTag": [
|
||||
"Seoul-amd64-01->London-amd64-01"
|
||||
],
|
||||
"outboundTag": "Seoul-amd64-01->London-amd64-01"
|
||||
},
|
||||
{
|
||||
"type": "field",
|
||||
"inboundTag": [
|
||||
"Seoul-amd64-01->Osaka-amd64-01"
|
||||
],
|
||||
"outboundTag": "Seoul-amd64-01->Osaka-amd64-01"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
135
v2ray示例/Xray-终级方案/Shanghai-实际中转使用.json
Normal file
135
v2ray示例/Xray-终级方案/Shanghai-实际中转使用.json
Normal file
@@ -0,0 +1,135 @@
|
||||
{
|
||||
"inbounds": [
|
||||
{
|
||||
"tag": "proxy-http",
|
||||
"port": 22889,
|
||||
"listen": "0.0.0.0",
|
||||
"protocol": "http",
|
||||
"settings": {
|
||||
"allowTransparent": true,
|
||||
"userLevel": 0
|
||||
}
|
||||
},
|
||||
{
|
||||
"tag": "proxy-socks",
|
||||
"port": 22888,
|
||||
"listen": "0.0.0.0",
|
||||
"protocol": "socks",
|
||||
"sniffing": {
|
||||
"enabled": true,
|
||||
"destOverride": [
|
||||
"http",
|
||||
"tls"
|
||||
],
|
||||
"routeOnly": false
|
||||
},
|
||||
"settings": {
|
||||
"auth": "password",
|
||||
"accounts": [
|
||||
{
|
||||
"user": "zeaslity",
|
||||
"pass": "lovemm.23"
|
||||
}
|
||||
],
|
||||
"udp": true,
|
||||
"allowTransparent": false
|
||||
}
|
||||
},
|
||||
{
|
||||
"tag": "direct",
|
||||
"port": 22887,
|
||||
"listen": "0.0.0.0",
|
||||
"protocol": "socks",
|
||||
"sniffing": {
|
||||
"enabled": true,
|
||||
"destOverride": [
|
||||
"http",
|
||||
"tls"
|
||||
],
|
||||
"routeOnly": false
|
||||
},
|
||||
"settings": {
|
||||
"auth": "password",
|
||||
"accounts": [
|
||||
{
|
||||
"user": "zeaslity",
|
||||
"pass": "lovemm.23"
|
||||
}
|
||||
],
|
||||
"udp": true,
|
||||
"allowTransparent": false
|
||||
}
|
||||
}
|
||||
],
|
||||
"outbounds": [
|
||||
{
|
||||
"tag": "proxy",
|
||||
"protocol": "trojan",
|
||||
"settings": {
|
||||
"servers": [
|
||||
{
|
||||
"address": "89.208.251.209",
|
||||
"ota": false,
|
||||
"password": "v2ryStr@ngPa.ss",
|
||||
"port": 29999,
|
||||
"level": 1
|
||||
}
|
||||
]
|
||||
},
|
||||
"streamSettings": {
|
||||
"network": "tcp",
|
||||
"security": "tls",
|
||||
"tlsSettings": {
|
||||
"allowInsecure": false,
|
||||
"serverName": "xx.l4.cc.nn.107421.xyz",
|
||||
"show": false
|
||||
}
|
||||
},
|
||||
"mux": {
|
||||
"enabled": false,
|
||||
"concurrency": -1
|
||||
}
|
||||
},
|
||||
{
|
||||
"tag": "direct",
|
||||
"protocol": "freedom",
|
||||
"settings": {}
|
||||
},
|
||||
{
|
||||
"tag": "block",
|
||||
"protocol": "blackhole",
|
||||
"settings": {
|
||||
"response": {
|
||||
"type": "http"
|
||||
}
|
||||
}
|
||||
}
|
||||
],
|
||||
"dns": {
|
||||
"servers": [
|
||||
"1.1.1.1",
|
||||
"8.8.8.8"
|
||||
]
|
||||
},
|
||||
"routing": {
|
||||
"domainStrategy": "IPIfNonMatch",
|
||||
"domainMatcher": "mph",
|
||||
"rules": [
|
||||
{
|
||||
"type": "field",
|
||||
"outboundTag": "proxy",
|
||||
"inboundTag": [
|
||||
"proxy-socks",
|
||||
"proxy-http"
|
||||
]
|
||||
},
|
||||
{
|
||||
"type": "field",
|
||||
"outboundTag": "direct",
|
||||
"inboundTag": [
|
||||
"direct"
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
125
v2ray示例/Xray-终级方案/xjyd-gpu实际使用的代理.json
Normal file
125
v2ray示例/Xray-终级方案/xjyd-gpu实际使用的代理.json
Normal file
@@ -0,0 +1,125 @@
|
||||
{
|
||||
"inbounds": [
|
||||
{
|
||||
"tag": "proxy-socks",
|
||||
"port": 22888,
|
||||
"listen": "127.0.0.1",
|
||||
"protocol": "socks",
|
||||
"sniffing": {
|
||||
"enabled": true,
|
||||
"destOverride": [
|
||||
"http",
|
||||
"tls"
|
||||
],
|
||||
"routeOnly": false
|
||||
},
|
||||
"settings": {
|
||||
"auth": "password",
|
||||
"accounts": [
|
||||
{
|
||||
"user": "zeaslity",
|
||||
"pass": "lovemm.23"
|
||||
}
|
||||
],
|
||||
"udp": true,
|
||||
"allowTransparent": false
|
||||
}
|
||||
},
|
||||
{
|
||||
"tag": "direct",
|
||||
"port": 22887,
|
||||
"listen": "0.0.0.0",
|
||||
"protocol": "socks",
|
||||
"sniffing": {
|
||||
"enabled": true,
|
||||
"destOverride": [
|
||||
"http",
|
||||
"tls"
|
||||
],
|
||||
"routeOnly": false
|
||||
},
|
||||
"settings": {
|
||||
"auth": "password",
|
||||
"accounts": [
|
||||
{
|
||||
"user": "zeaslity",
|
||||
"pass": "lovemm.23"
|
||||
}
|
||||
],
|
||||
"udp": true,
|
||||
"allowTransparent": false
|
||||
}
|
||||
}
|
||||
],
|
||||
"outbounds": [
|
||||
{
|
||||
"tag": "proxy",
|
||||
"protocol": "trojan",
|
||||
"settings": {
|
||||
"servers": [
|
||||
{
|
||||
"address": "140.238.14.103",
|
||||
"method": "chacha20",
|
||||
"ota": false,
|
||||
"password": "V2ryStr0ngP0ss",
|
||||
"port": 443,
|
||||
"level": 1
|
||||
}
|
||||
]
|
||||
},
|
||||
"streamSettings": {
|
||||
"network": "tcp",
|
||||
"security": "tls",
|
||||
"tlsSettings": {
|
||||
"allowInsecure": false,
|
||||
"serverName": "xx.s4.cc.hh.107421.xyz",
|
||||
"show": false
|
||||
}
|
||||
},
|
||||
"mux": {
|
||||
"enabled": false,
|
||||
"concurrency": -1
|
||||
}
|
||||
},
|
||||
{
|
||||
"tag": "direct",
|
||||
"protocol": "freedom",
|
||||
"settings": {}
|
||||
},
|
||||
{
|
||||
"tag": "block",
|
||||
"protocol": "blackhole",
|
||||
"settings": {
|
||||
"response": {
|
||||
"type": "http"
|
||||
}
|
||||
}
|
||||
}
|
||||
],
|
||||
"dns": {
|
||||
"servers": [
|
||||
"1.1.1.1",
|
||||
"8.8.8.8"
|
||||
]
|
||||
},
|
||||
"routing": {
|
||||
"domainStrategy": "IPIfNonMatch",
|
||||
"domainMatcher": "mph",
|
||||
"rules": [
|
||||
{
|
||||
"type": "field",
|
||||
"outboundTag": "proxy",
|
||||
"inboundTag": [
|
||||
"proxy-socks"
|
||||
]
|
||||
},
|
||||
{
|
||||
"type": "field",
|
||||
"outboundTag": "direct",
|
||||
"inboundTag": [
|
||||
"direct"
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
67
v2ray示例/Xray-终级方案/搬瓦工-洛杉矶-实际使用的Xray配置.json
Normal file
67
v2ray示例/Xray-终级方案/搬瓦工-洛杉矶-实际使用的Xray配置.json
Normal file
@@ -0,0 +1,67 @@
|
||||
{
|
||||
"inbounds": [
|
||||
{
|
||||
"protocol": "trojan",
|
||||
"listen": "0.0.0.0",
|
||||
"port": 443,
|
||||
"settings": {
|
||||
"clients": [
|
||||
{
|
||||
"password": "V2ryStr0ngP0ss",
|
||||
"email": "lovemm@107421.xyz"
|
||||
}
|
||||
]
|
||||
},
|
||||
"streamSettings": {
|
||||
"network": "tcp",
|
||||
"security": "tls",
|
||||
"tlsSettings": {
|
||||
"alpn": [
|
||||
"h2",
|
||||
"http/1.1"
|
||||
],
|
||||
"certificates": [
|
||||
{
|
||||
"certificateFile": "/root/.acme.sh/xx.l4.cc.nn.107421.xyz_ecc/fullchain.cer",
|
||||
"keyFile": "/root/.acme.sh/xx.l4.cc.nn.107421.xyz_ecc/xx.l4.cc.nn.107421.xyz.key"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"tag": "LosAngels-amd64-01"
|
||||
},
|
||||
{
|
||||
"protocol": "trojan",
|
||||
"listen": "0.0.0.0",
|
||||
"port": 29999,
|
||||
"settings": {
|
||||
"clients": [
|
||||
{
|
||||
"password": "v2ryStr@ngPa.ss"
|
||||
}
|
||||
]
|
||||
},
|
||||
"streamSettings": {
|
||||
"network": "tcp",
|
||||
"security": "tls",
|
||||
"tlsSettings": {
|
||||
"alpn": [
|
||||
"h2",
|
||||
"http/1.1"
|
||||
],
|
||||
"certificates": [
|
||||
{
|
||||
"certificateFile": "/root/.acme.sh/xx.l4.cc.nn.107421.xyz_ecc/fullchain.cer",
|
||||
"keyFile": "/root/.acme.sh/xx.l4.cc.nn.107421.xyz_ecc/xx.l4.cc.nn.107421.xyz.key"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
],
|
||||
"outbounds": [
|
||||
{
|
||||
"protocol": "freedom"
|
||||
}
|
||||
]
|
||||
}
|
||||
77
v2ray示例/Xray-终级方案/香港实际使用的Xray配置-新.json
Normal file
77
v2ray示例/Xray-终级方案/香港实际使用的Xray配置-新.json
Normal file
@@ -0,0 +1,77 @@
|
||||
{
|
||||
"log": {
|
||||
"loglevel": "error"
|
||||
},
|
||||
"inbounds": [
|
||||
{
|
||||
"protocol": "trojan",
|
||||
"listen": "0.0.0.0",
|
||||
"port": 443,
|
||||
"settings": {
|
||||
"clients": [
|
||||
{
|
||||
"password": "V2ryStr0ngP0ss"
|
||||
}
|
||||
]
|
||||
},
|
||||
"streamSettings": {
|
||||
"network": "tcp",
|
||||
"security": "tls",
|
||||
"tlsSettings": {
|
||||
"alpn": [
|
||||
"h2",
|
||||
"http/1.1"
|
||||
],
|
||||
"certificates": [
|
||||
{
|
||||
"certificateFile": "/root/.acme.sh/xx.tc.hk.go.107421.xyz_ecc/fullchain.cer",
|
||||
"keyFile": "/root/.acme.sh/xx.tc.hk.go.107421.xyz_ecc/xx.tc.hk.go.107421.xyz.key"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"tag": "hongkong-trojan"
|
||||
},
|
||||
{
|
||||
"port": 29999,
|
||||
"protocol": "vless",
|
||||
"settings": {
|
||||
"clients": [
|
||||
{
|
||||
"id": "fc903f5d-a007-482b-928c-570da9a851f9",
|
||||
"flow": "xtls-rprx-vision"
|
||||
}
|
||||
],
|
||||
"decryption": "none"
|
||||
},
|
||||
"streamSettings": {
|
||||
"network": "tcp",
|
||||
"security": "reality",
|
||||
"realitySettings": {
|
||||
"dest": "xx.tc.hk.go.107421.xyz:443",
|
||||
"serverNames": [
|
||||
"xx.tc.hk.go.107421.xyz"
|
||||
],
|
||||
"privateKey": "eOuEdWwYFkhKHAq6lhx3Txq2H7rZ9uy1csbKt4Jkq0E",
|
||||
"shortIds": [
|
||||
"ad570cbfab"
|
||||
]
|
||||
}
|
||||
},
|
||||
"sniffing": {
|
||||
"enabled": true,
|
||||
"destOverride": [
|
||||
"http",
|
||||
"tls",
|
||||
"quic"
|
||||
],
|
||||
"routeOnly": true
|
||||
}
|
||||
}
|
||||
],
|
||||
"outbounds": [
|
||||
{
|
||||
"protocol": "freedom"
|
||||
}
|
||||
]
|
||||
}
|
||||
89
v2ray示例/Xray-终级方案/香港实际使用的Xray配置.json
Normal file
89
v2ray示例/Xray-终级方案/香港实际使用的Xray配置.json
Normal file
@@ -0,0 +1,89 @@
|
||||
{
|
||||
"log": {
|
||||
"access": "/var/log/xray/access.log",
|
||||
"error": "/var/log/xray/error.log",
|
||||
"loglevel": "warning"
|
||||
},
|
||||
"inbounds": [
|
||||
{
|
||||
"port": 29999,
|
||||
"protocol": "vless",
|
||||
"settings": {
|
||||
"clients": [
|
||||
{
|
||||
"id": "fc903f5d-a007-482b-928c-570da9a851f9",
|
||||
"flow": "xtls-rprx-direct"
|
||||
}
|
||||
],
|
||||
"decryption": "none",
|
||||
"fallbacks": [
|
||||
{
|
||||
"dest": 60000,
|
||||
"alpn": "",
|
||||
"xver": 1
|
||||
},
|
||||
{
|
||||
"dest": 60001,
|
||||
"alpn": "h2",
|
||||
"xver": 1
|
||||
},
|
||||
{
|
||||
"dest": 60002,
|
||||
"path": "/0e03986e4baac9/",
|
||||
"xver": 1
|
||||
}
|
||||
]
|
||||
},
|
||||
"streamSettings": {
|
||||
"network": "tcp",
|
||||
"security": "xtls",
|
||||
"xtlsSettings": {
|
||||
"minVersion": "1.2",
|
||||
"certificates": [
|
||||
{
|
||||
"certificateFile": "/usr/local/etc/xray/self_signed_cert.pem",
|
||||
"keyFile": "/usr/local/etc/xray/self_signed_key.pem"
|
||||
},
|
||||
{
|
||||
"certificateFile": "/ssl/xray.crt",
|
||||
"keyFile": "/ssl/xray.key"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"sniffing": {
|
||||
"enabled": true,
|
||||
"destOverride": [
|
||||
"http",
|
||||
"tls"
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
"port": 60002,
|
||||
"listen": "127.0.0.1",
|
||||
"protocol": "vless",
|
||||
"settings": {
|
||||
"clients": [
|
||||
{
|
||||
"id": "fc903f5d-a007-482b-928c-570da9a851f9"
|
||||
}
|
||||
],
|
||||
"decryption": "none"
|
||||
},
|
||||
"streamSettings": {
|
||||
"network": "ws",
|
||||
"security": "none",
|
||||
"wsSettings": {
|
||||
"acceptProxyProtocol": true,
|
||||
"path": "/0e03986e4baac9/"
|
||||
}
|
||||
}
|
||||
}
|
||||
],
|
||||
"outbounds": [
|
||||
{
|
||||
"protocol": "freedom"
|
||||
}
|
||||
]
|
||||
}
|
||||
23
v2ray示例/firewalld防火墙规则/搬瓦工防火墙.txt
Normal file
23
v2ray示例/firewalld防火墙规则/搬瓦工防火墙.txt
Normal file
@@ -0,0 +1,23 @@
|
||||
# 默认禁止所有其他端口
|
||||
firewall-cmd --set-default-zone=drop
|
||||
|
||||
# 允许从任何源访问 22333、443、80 端口的 TCP 和 UDP 流量
|
||||
firewall-cmd --permanent --add-port=22333/tcp
|
||||
firewall-cmd --permanent --add-port=22333/udp
|
||||
firewall-cmd --permanent --add-port=443/tcp
|
||||
firewall-cmd --permanent --add-port=443/udp
|
||||
firewall-cmd --permanent --add-port=80/tcp
|
||||
firewall-cmd --permanent --add-port=80/udp
|
||||
|
||||
# 允许来自20000-30000的tcp udp端口
|
||||
firewall-cmd --zone=drop --add-port=20000-30000/tcp --permanent
|
||||
firewall-cmd --zone=drop --add-port=20000-30000/udp --permanent
|
||||
|
||||
# 允许icmp的ping请求
|
||||
firewall-cmd --permanent --add-rich-rule='rule family="ipv4" source address="0.0.0.0/0" protocol value="icmp" accept'
|
||||
firewall-cmd --zone=drop --add-icmp-block-inversion --permanent
|
||||
firewall-cmd --zone=public --add-icmp-block-inversion --permanent
|
||||
firewall-cmd --reload
|
||||
|
||||
# 重新载入防火墙规则
|
||||
firewall-cmd --reload
|
||||
32
v2ray示例/sync-proxy-config.ps1
Normal file
32
v2ray示例/sync-proxy-config.ps1
Normal file
@@ -0,0 +1,32 @@
|
||||
function SayHello
|
||||
{
|
||||
param (
|
||||
[string]$Name
|
||||
)
|
||||
Write-Host "Hello, $Name!"
|
||||
}
|
||||
|
||||
# 调用函数
|
||||
SayHello -Name "Test PowerShell"
|
||||
|
||||
function SetMinioAlias
|
||||
{
|
||||
# mc.exe alias set local http://10.250.0.100:9000 cmii B#923fC7mk
|
||||
# mc.exe alias set tc-sh http://42.192.52.227:9000 cmii B#923fC7mk
|
||||
mc.exe alias set seoul-1 https://cnk8d6fazu16.compat.objectstorage.ap-seoul-1.oraclecloud.com aed62d24d85e2da809ce02bf272420ba4ed74820 rQdEcn69K049+JkA1IGoQmC1k8zma8zfWvZvVS0h144=
|
||||
}
|
||||
|
||||
SetMinioAlias
|
||||
|
||||
# 获取当前工作目录
|
||||
$currentDirectory = Get-Location
|
||||
# 打印当前工作目录
|
||||
Write-Host "Current directory: $currentDirectory"
|
||||
Write-Host ""
|
||||
|
||||
# 获取当前目录的所有文件名
|
||||
mc.exe cp $currentDirectory\98-subscribe-clash.yaml seoul-1/seoul/
|
||||
mc.exe cp $currentDirectory\99-subscribe-octopus-latest.txt seoul-1/seoul/
|
||||
|
||||
Write-Host ""
|
||||
Write-Host "All proxy config has been synchronized !"
|
||||
56
v2ray示例/v2ray-Socks5/http-to-seoul1.json
Normal file
56
v2ray示例/v2ray-Socks5/http-to-seoul1.json
Normal file
@@ -0,0 +1,56 @@
|
||||
{
|
||||
"inbounds": [
|
||||
{
|
||||
"protocol": "http",
|
||||
"port": 58888,
|
||||
"listen": "192.168.11.241"
|
||||
}
|
||||
,
|
||||
{
|
||||
"protocol": "socks",
|
||||
"port": 58889,
|
||||
"listen": "192.168.11.241",
|
||||
"settings": {
|
||||
"auth": "noauth",
|
||||
"udp": true,
|
||||
"userLevel": 0
|
||||
}
|
||||
}
|
||||
],
|
||||
"dns": {
|
||||
"network": "udp",
|
||||
"address": "223.5.5.5",
|
||||
"port": 53
|
||||
},
|
||||
"outbounds": [
|
||||
{
|
||||
"tag": "proxy",
|
||||
"protocol": "trojan",
|
||||
"settings": {
|
||||
"servers": [
|
||||
{
|
||||
"address": "140.238.14.103",
|
||||
"method": "chacha20",
|
||||
"ota": false,
|
||||
"password": "V2ryStr0ngP0ss",
|
||||
"port": 443,
|
||||
"level": 1
|
||||
}
|
||||
]
|
||||
},
|
||||
"streamSettings": {
|
||||
"network": "tcp",
|
||||
"security": "tls",
|
||||
"tlsSettings": {
|
||||
"allowInsecure": false,
|
||||
"serverName": "xx.s4.cc.hh.107421.xyz",
|
||||
"show": false
|
||||
}
|
||||
},
|
||||
"mux": {
|
||||
"enabled": false,
|
||||
"concurrency": -1
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
31
v2ray示例/v2ray-Socks5/socks-http-代理服务器.json
Normal file
31
v2ray示例/v2ray-Socks5/socks-http-代理服务器.json
Normal file
@@ -0,0 +1,31 @@
|
||||
{
|
||||
"inbounds": [
|
||||
{
|
||||
"protocol": "http",
|
||||
"port": 58888,
|
||||
"listen": "10.20.1.130"
|
||||
}
|
||||
,
|
||||
{
|
||||
"protocol": "socks",
|
||||
"port": 58889,
|
||||
"listen": "10.20.1.130",
|
||||
"settings": {
|
||||
"auth": "noauth",
|
||||
"udp": true,
|
||||
"userLevel": 0
|
||||
}
|
||||
}
|
||||
],
|
||||
"dns": {
|
||||
"network": "udp",
|
||||
"address": "223.5.5.5",
|
||||
"port": 53
|
||||
},
|
||||
"outbounds": [
|
||||
{
|
||||
"protocol": "freedom",
|
||||
"settings": {}
|
||||
}
|
||||
]
|
||||
}
|
||||
41
v2ray示例/v2ray-Socks5/socks5中继服务器.json
Normal file
41
v2ray示例/v2ray-Socks5/socks5中继服务器.json
Normal file
@@ -0,0 +1,41 @@
|
||||
{
|
||||
"inbounds": [
|
||||
{
|
||||
"protocol": "socks",
|
||||
"port": 28888,
|
||||
"listen": "0.0.0.0",
|
||||
"settings": {
|
||||
"auth": "password",
|
||||
"accounts": [
|
||||
{
|
||||
"user": "zeaslity",
|
||||
"pass": "lovemm.23"
|
||||
}
|
||||
],
|
||||
"udp": true,
|
||||
"userLevel": 0
|
||||
}
|
||||
},
|
||||
{
|
||||
"protocol": "socks",
|
||||
"port": 58889,
|
||||
"listen": "0.0.0.0",
|
||||
"settings": {
|
||||
"auth": "noauth",
|
||||
"udp": true,
|
||||
"userLevel": 0
|
||||
}
|
||||
}
|
||||
],
|
||||
"dns": {
|
||||
"network": "udp",
|
||||
"address": "223.5.5.5",
|
||||
"port": 53
|
||||
},
|
||||
"outbounds": [
|
||||
{
|
||||
"protocol": "freedom",
|
||||
"settings": {}
|
||||
}
|
||||
]
|
||||
}
|
||||
601
v2ray示例/v2ray-Socks5/v2ray-install.sh
Normal file
601
v2ray示例/v2ray-Socks5/v2ray-install.sh
Normal file
@@ -0,0 +1,601 @@
|
||||
#!/bin/bash
|
||||
|
||||
# The files installed by the script conform to the Filesystem Hierarchy Standard:
|
||||
# https://wiki.linuxfoundation.org/lsb/fhs
|
||||
|
||||
# The URL of the script project is:
|
||||
# https://github.com/v2fly/fhs-install-v2ray
|
||||
|
||||
# The URL of the script is:
|
||||
# https://raw.githubusercontent.com/v2fly/fhs-install-v2ray/master/install-release.sh
|
||||
|
||||
# If the script executes incorrectly, go to:
|
||||
# https://github.com/v2fly/fhs-install-v2ray/issues
|
||||
|
||||
# You can set this variable whatever you want in shell session right before running this script by issuing:
|
||||
# export DAT_PATH='/usr/local/share/v2ray'
|
||||
DAT_PATH=${DAT_PATH:-/usr/local/share/v2ray}
|
||||
|
||||
# You can set this variable whatever you want in shell session right before running this script by issuing:
|
||||
# export JSON_PATH='/usr/local/etc/v2ray'
|
||||
JSON_PATH=${JSON_PATH:-/usr/local/etc/v2ray}
|
||||
|
||||
# Set this variable only if you are starting v2ray with multiple configuration files:
|
||||
# export JSONS_PATH='/usr/local/etc/v2ray'
|
||||
|
||||
# Set this variable only if you want this script to check all the systemd unit file:
|
||||
# export check_all_service_files='yes'
|
||||
|
||||
curl() {
|
||||
$(type -P curl) -L -q --retry 5 --retry-delay 10 --retry-max-time 60 "$@"
|
||||
}
|
||||
|
||||
systemd_cat_config() {
|
||||
if systemd-analyze --help | grep -qw 'cat-config'; then
|
||||
systemd-analyze --no-pager cat-config "$@"
|
||||
echo
|
||||
else
|
||||
echo "${aoi}~~~~~~~~~~~~~~~~"
|
||||
cat "$@" "$1".d/*
|
||||
echo "${aoi}~~~~~~~~~~~~~~~~"
|
||||
echo "${red}warning: ${green}The systemd version on the current operating system is too low."
|
||||
echo "${red}warning: ${green}Please consider to upgrade the systemd or the operating system.${reset}"
|
||||
echo
|
||||
fi
|
||||
}
|
||||
|
||||
check_if_running_as_root() {
|
||||
# If you want to run as another user, please modify $UID to be owned by this user
|
||||
if [[ "$UID" -ne '0' ]]; then
|
||||
echo "error: You must run this script as root!"
|
||||
exit 1
|
||||
fi
|
||||
}
|
||||
|
||||
identify_the_operating_system_and_architecture() {
|
||||
if [[ "$(uname)" == 'Linux' ]]; then
|
||||
case "$(uname -m)" in
|
||||
'i386' | 'i686')
|
||||
MACHINE='32'
|
||||
;;
|
||||
'amd64' | 'x86_64')
|
||||
MACHINE='64'
|
||||
;;
|
||||
'armv5tel')
|
||||
MACHINE='arm32-v5'
|
||||
;;
|
||||
'armv6l')
|
||||
MACHINE='arm32-v6'
|
||||
;;
|
||||
'armv7' | 'armv7l')
|
||||
MACHINE='arm32-v7a'
|
||||
;;
|
||||
'armv8' | 'aarch64')
|
||||
MACHINE='arm64-v8a'
|
||||
;;
|
||||
'mips')
|
||||
MACHINE='mips32'
|
||||
;;
|
||||
'mipsle')
|
||||
MACHINE='mips32le'
|
||||
;;
|
||||
'mips64')
|
||||
MACHINE='mips64'
|
||||
;;
|
||||
'mips64le')
|
||||
MACHINE='mips64le'
|
||||
;;
|
||||
'ppc64')
|
||||
MACHINE='ppc64'
|
||||
;;
|
||||
'ppc64le')
|
||||
MACHINE='ppc64le'
|
||||
;;
|
||||
'riscv64')
|
||||
MACHINE='riscv64'
|
||||
;;
|
||||
's390x')
|
||||
MACHINE='s390x'
|
||||
;;
|
||||
*)
|
||||
echo "error: The architecture is not supported."
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
if [[ ! -f '/etc/os-release' ]]; then
|
||||
echo "error: Don't use outdated Linux distributions."
|
||||
exit 1
|
||||
fi
|
||||
# Do not combine this judgment condition with the following judgment condition.
|
||||
## Be aware of Linux distribution like Gentoo, which kernel supports switch between Systemd and OpenRC.
|
||||
### Refer: https://github.com/v2fly/fhs-install-v2ray/issues/84#issuecomment-688574989
|
||||
if [[ -f /.dockerenv ]] || grep -q 'docker\|lxc' /proc/1/cgroup && [[ "$(type -P systemctl)" ]]; then
|
||||
true
|
||||
elif [[ -d /run/systemd/system ]] || grep -q systemd <(ls -l /sbin/init); then
|
||||
true
|
||||
else
|
||||
echo "error: Only Linux distributions using systemd are supported."
|
||||
exit 1
|
||||
fi
|
||||
if [[ "$(type -P apt)" ]]; then
|
||||
PACKAGE_MANAGEMENT_INSTALL='apt -y --no-install-recommends install'
|
||||
PACKAGE_MANAGEMENT_REMOVE='apt purge'
|
||||
package_provide_tput='ncurses-bin'
|
||||
elif [[ "$(type -P dnf)" ]]; then
|
||||
PACKAGE_MANAGEMENT_INSTALL='dnf -y install'
|
||||
PACKAGE_MANAGEMENT_REMOVE='dnf remove'
|
||||
package_provide_tput='ncurses'
|
||||
elif [[ "$(type -P yum)" ]]; then
|
||||
PACKAGE_MANAGEMENT_INSTALL='yum -y install'
|
||||
PACKAGE_MANAGEMENT_REMOVE='yum remove'
|
||||
package_provide_tput='ncurses'
|
||||
elif [[ "$(type -P zypper)" ]]; then
|
||||
PACKAGE_MANAGEMENT_INSTALL='zypper install -y --no-recommends'
|
||||
PACKAGE_MANAGEMENT_REMOVE='zypper remove'
|
||||
package_provide_tput='ncurses-utils'
|
||||
elif [[ "$(type -P pacman)" ]]; then
|
||||
PACKAGE_MANAGEMENT_INSTALL='pacman -Syu --noconfirm'
|
||||
PACKAGE_MANAGEMENT_REMOVE='pacman -Rsn'
|
||||
package_provide_tput='ncurses'
|
||||
else
|
||||
echo "error: The script does not support the package manager in this operating system."
|
||||
exit 1
|
||||
fi
|
||||
else
|
||||
echo "error: This operating system is not supported."
|
||||
exit 1
|
||||
fi
|
||||
}
|
||||
|
||||
## Demo function for processing parameters
|
||||
judgment_parameters() {
|
||||
while [[ "$#" -gt '0' ]]; do
|
||||
case "$1" in
|
||||
'--remove')
|
||||
if [[ "$#" -gt '1' ]]; then
|
||||
echo 'error: Please enter the correct parameters.'
|
||||
exit 1
|
||||
fi
|
||||
REMOVE='1'
|
||||
;;
|
||||
'--version')
|
||||
VERSION="${2:?error: Please specify the correct version.}"
|
||||
break
|
||||
;;
|
||||
'-c' | '--check')
|
||||
CHECK='1'
|
||||
break
|
||||
;;
|
||||
'-f' | '--force')
|
||||
FORCE='1'
|
||||
break
|
||||
;;
|
||||
'-h' | '--help')
|
||||
HELP='1'
|
||||
break
|
||||
;;
|
||||
'-l' | '--local')
|
||||
LOCAL_INSTALL='1'
|
||||
LOCAL_FILE="${2:?error: Please specify the correct local file.}"
|
||||
break
|
||||
;;
|
||||
'-p' | '--proxy')
|
||||
if [[ -z "${2:?error: Please specify the proxy server address.}" ]]; then
|
||||
exit 1
|
||||
fi
|
||||
PROXY="$2"
|
||||
shift
|
||||
;;
|
||||
*)
|
||||
echo "$0: unknown option -- -"
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
shift
|
||||
done
|
||||
}
|
||||
|
||||
install_software() {
|
||||
package_name="$1"
|
||||
file_to_detect="$2"
|
||||
type -P "$file_to_detect" > /dev/null 2>&1 && return
|
||||
if ${PACKAGE_MANAGEMENT_INSTALL} "$package_name"; then
|
||||
echo "info: $package_name is installed."
|
||||
else
|
||||
echo "error: Installation of $package_name failed, please check your network."
|
||||
exit 1
|
||||
fi
|
||||
}
|
||||
|
||||
get_version() {
|
||||
# 0: Install or update V2Ray.
|
||||
# 1: Installed or no new version of V2Ray.
|
||||
# 2: Install the specified version of V2Ray.
|
||||
if [[ -n "$VERSION" ]]; then
|
||||
RELEASE_VERSION="v${VERSION#v}"
|
||||
return 2
|
||||
fi
|
||||
# Determine the version number for V2Ray installed from a local file
|
||||
if [[ -f '/usr/local/bin/v2ray' ]]; then
|
||||
VERSION="$(/usr/local/bin/v2ray -version | awk 'NR==1 {print $2}')"
|
||||
CURRENT_VERSION="v${VERSION#v}"
|
||||
if [[ "$LOCAL_INSTALL" -eq '1' ]]; then
|
||||
RELEASE_VERSION="$CURRENT_VERSION"
|
||||
return
|
||||
fi
|
||||
fi
|
||||
# Get V2Ray release version number
|
||||
TMP_FILE="$(mktemp)"
|
||||
if ! curl -x "${PROXY}" -sS -H "Accept: application/vnd.github.v3+json" -o "$TMP_FILE" 'https://api.github.com/repos/v2fly/v2ray-core/releases/latest'; then
|
||||
"rm" "$TMP_FILE"
|
||||
echo 'error: Failed to get release list, please check your network.'
|
||||
exit 1
|
||||
fi
|
||||
RELEASE_LATEST="$(sed 'y/,/\n/' "$TMP_FILE" | grep 'tag_name' | awk -F '"' '{print $4}')"
|
||||
"rm" "$TMP_FILE"
|
||||
RELEASE_VERSION="v${RELEASE_LATEST#v}"
|
||||
# Compare V2Ray version numbers
|
||||
if [[ "$RELEASE_VERSION" != "$CURRENT_VERSION" ]]; then
|
||||
RELEASE_VERSIONSION_NUMBER="${RELEASE_VERSION#v}"
|
||||
RELEASE_MAJOR_VERSION_NUMBER="${RELEASE_VERSIONSION_NUMBER%%.*}"
|
||||
RELEASE_MINOR_VERSION_NUMBER="$(echo "$RELEASE_VERSIONSION_NUMBER" | awk -F '.' '{print $2}')"
|
||||
RELEASE_MINIMUM_VERSION_NUMBER="${RELEASE_VERSIONSION_NUMBER##*.}"
|
||||
# shellcheck disable=SC2001
|
||||
CURRENT_VERSIONSION_NUMBER="$(echo "${CURRENT_VERSION#v}" | sed 's/-.*//')"
|
||||
CURRENT_MAJOR_VERSION_NUMBER="${CURRENT_VERSIONSION_NUMBER%%.*}"
|
||||
CURRENT_MINOR_VERSION_NUMBER="$(echo "$CURRENT_VERSIONSION_NUMBER" | awk -F '.' '{print $2}')"
|
||||
CURRENT_MINIMUM_VERSION_NUMBER="${CURRENT_VERSIONSION_NUMBER##*.}"
|
||||
if [[ "$RELEASE_MAJOR_VERSION_NUMBER" -gt "$CURRENT_MAJOR_VERSION_NUMBER" ]]; then
|
||||
return 0
|
||||
elif [[ "$RELEASE_MAJOR_VERSION_NUMBER" -eq "$CURRENT_MAJOR_VERSION_NUMBER" ]]; then
|
||||
if [[ "$RELEASE_MINOR_VERSION_NUMBER" -gt "$CURRENT_MINOR_VERSION_NUMBER" ]]; then
|
||||
return 0
|
||||
elif [[ "$RELEASE_MINOR_VERSION_NUMBER" -eq "$CURRENT_MINOR_VERSION_NUMBER" ]]; then
|
||||
if [[ "$RELEASE_MINIMUM_VERSION_NUMBER" -gt "$CURRENT_MINIMUM_VERSION_NUMBER" ]]; then
|
||||
return 0
|
||||
else
|
||||
return 1
|
||||
fi
|
||||
else
|
||||
return 1
|
||||
fi
|
||||
else
|
||||
return 1
|
||||
fi
|
||||
elif [[ "$RELEASE_VERSION" == "$CURRENT_VERSION" ]]; then
|
||||
return 1
|
||||
fi
|
||||
}
|
||||
|
||||
download_v2ray() {
|
||||
DOWNLOAD_LINK="https://github.com/v2fly/v2ray-core/releases/download/$RELEASE_VERSION/v2ray-linux-$MACHINE.zip"
|
||||
echo "Downloading V2Ray archive: $DOWNLOAD_LINK"
|
||||
if ! curl -x "${PROXY}" -R -H 'Cache-Control: no-cache' -o "$ZIP_FILE" "$DOWNLOAD_LINK"; then
|
||||
echo 'error: Download failed! Please check your network or try again.'
|
||||
return 1
|
||||
fi
|
||||
echo "Downloading verification file for V2Ray archive: $DOWNLOAD_LINK.dgst"
|
||||
if ! curl -x "${PROXY}" -sSR -H 'Cache-Control: no-cache' -o "$ZIP_FILE.dgst" "$DOWNLOAD_LINK.dgst"; then
|
||||
echo 'error: Download failed! Please check your network or try again.'
|
||||
return 1
|
||||
fi
|
||||
if [[ "$(cat "$ZIP_FILE".dgst)" == 'Not Found' ]]; then
|
||||
echo 'error: This version does not support verification. Please replace with another version.'
|
||||
return 1
|
||||
fi
|
||||
|
||||
# Verification of V2Ray archive
|
||||
for LISTSUM in 'md5' 'sha1' 'sha256' 'sha512'; do
|
||||
SUM="$(${LISTSUM}sum "$ZIP_FILE" | sed 's/ .*//')"
|
||||
CHECKSUM="$(grep ${LISTSUM^^} "$ZIP_FILE".dgst | grep "$SUM" -o -a | uniq)"
|
||||
if [[ "$SUM" != "$CHECKSUM" ]]; then
|
||||
echo 'error: Check failed! Please check your network or try again.'
|
||||
return 1
|
||||
fi
|
||||
done
|
||||
}
|
||||
|
||||
decompression() {
|
||||
if ! unzip -q "$1" -d "$TMP_DIRECTORY"; then
|
||||
echo 'error: V2Ray decompression failed.'
|
||||
"rm" -r "$TMP_DIRECTORY"
|
||||
echo "removed: $TMP_DIRECTORY"
|
||||
exit 1
|
||||
fi
|
||||
echo "info: Extract the V2Ray package to $TMP_DIRECTORY and prepare it for installation."
|
||||
}
|
||||
|
||||
install_file() {
|
||||
NAME="$1"
|
||||
if [[ "$NAME" == 'v2ray' ]] || [[ "$NAME" == 'v2ctl' ]]; then
|
||||
install -m 755 "${TMP_DIRECTORY}/$NAME" "/usr/local/bin/$NAME"
|
||||
elif [[ "$NAME" == 'geoip.dat' ]] || [[ "$NAME" == 'geosite.dat' ]]; then
|
||||
install -m 644 "${TMP_DIRECTORY}/$NAME" "${DAT_PATH}/$NAME"
|
||||
fi
|
||||
}
|
||||
|
||||
install_v2ray() {
|
||||
# Install V2Ray binary to /usr/local/bin/ and $DAT_PATH
|
||||
install_file v2ray
|
||||
install_file v2ctl
|
||||
install -d "$DAT_PATH"
|
||||
# If the file exists, geoip.dat and geosite.dat will not be installed or updated
|
||||
if [[ ! -f "${DAT_PATH}/.undat" ]]; then
|
||||
install_file geoip.dat
|
||||
install_file geosite.dat
|
||||
fi
|
||||
|
||||
# Install V2Ray configuration file to $JSON_PATH
|
||||
# shellcheck disable=SC2153
|
||||
if [[ -z "$JSONS_PATH" ]] && [[ ! -d "$JSON_PATH" ]]; then
|
||||
install -d "$JSON_PATH"
|
||||
echo "{}" > "${JSON_PATH}/config.json"
|
||||
CONFIG_NEW='1'
|
||||
fi
|
||||
|
||||
# Install V2Ray configuration file to $JSONS_PATH
|
||||
if [[ -n "$JSONS_PATH" ]] && [[ ! -d "$JSONS_PATH" ]]; then
|
||||
install -d "$JSONS_PATH"
|
||||
for BASE in 00_log 01_api 02_dns 03_routing 04_policy 05_inbounds 06_outbounds 07_transport 08_stats 09_reverse; do
|
||||
echo '{}' > "${JSONS_PATH}/${BASE}.json"
|
||||
done
|
||||
CONFDIR='1'
|
||||
fi
|
||||
|
||||
# Used to store V2Ray log files
|
||||
if [[ ! -d '/var/log/v2ray/' ]]; then
|
||||
if id nobody | grep -qw 'nogroup'; then
|
||||
install -d -m 700 -o nobody -g nogroup /var/log/v2ray/
|
||||
install -m 600 -o nobody -g nogroup /dev/null /var/log/v2ray/access.log
|
||||
install -m 600 -o nobody -g nogroup /dev/null /var/log/v2ray/error.log
|
||||
else
|
||||
install -d -m 700 -o nobody -g nobody /var/log/v2ray/
|
||||
install -m 600 -o nobody -g nobody /dev/null /var/log/v2ray/access.log
|
||||
install -m 600 -o nobody -g nobody /dev/null /var/log/v2ray/error.log
|
||||
fi
|
||||
LOG='1'
|
||||
fi
|
||||
}
|
||||
|
||||
install_startup_service_file() {
|
||||
install -m 644 "${TMP_DIRECTORY}/systemd/system/v2ray.service" /etc/systemd/system/v2ray.service
|
||||
install -m 644 "${TMP_DIRECTORY}/systemd/system/v2ray@.service" /etc/systemd/system/v2ray@.service
|
||||
mkdir -p '/etc/systemd/system/v2ray.service.d'
|
||||
mkdir -p '/etc/systemd/system/v2ray@.service.d/'
|
||||
if [[ -n "$JSONS_PATH" ]]; then
|
||||
"rm" '/etc/systemd/system/v2ray.service.d/10-donot_touch_single_conf.conf' \
|
||||
'/etc/systemd/system/v2ray@.service.d/10-donot_touch_single_conf.conf'
|
||||
echo "# In case you have a good reason to do so, duplicate this file in the same directory and make your customizes there.
|
||||
# Or all changes you made will be lost! # Refer: https://www.freedesktop.org/software/systemd/man/systemd.unit.html
|
||||
[Service]
|
||||
ExecStart=
|
||||
ExecStart=/usr/local/bin/v2ray -confdir $JSONS_PATH" |
|
||||
tee '/etc/systemd/system/v2ray.service.d/10-donot_touch_multi_conf.conf' > \
|
||||
'/etc/systemd/system/v2ray@.service.d/10-donot_touch_multi_conf.conf'
|
||||
else
|
||||
"rm" '/etc/systemd/system/v2ray.service.d/10-donot_touch_multi_conf.conf' \
|
||||
'/etc/systemd/system/v2ray@.service.d/10-donot_touch_multi_conf.conf'
|
||||
echo "# In case you have a good reason to do so, duplicate this file in the same directory and make your customizes there.
|
||||
# Or all changes you made will be lost! # Refer: https://www.freedesktop.org/software/systemd/man/systemd.unit.html
|
||||
[Service]
|
||||
ExecStart=
|
||||
ExecStart=/usr/local/bin/v2ray -config ${JSON_PATH}/config.json" > \
|
||||
'/etc/systemd/system/v2ray.service.d/10-donot_touch_single_conf.conf'
|
||||
echo "# In case you have a good reason to do so, duplicate this file in the same directory and make your customizes there.
|
||||
# Or all changes you made will be lost! # Refer: https://www.freedesktop.org/software/systemd/man/systemd.unit.html
|
||||
[Service]
|
||||
ExecStart=
|
||||
ExecStart=/usr/local/bin/v2ray -config ${JSON_PATH}/%i.json" > \
|
||||
'/etc/systemd/system/v2ray@.service.d/10-donot_touch_single_conf.conf'
|
||||
fi
|
||||
echo "info: Systemd service files have been installed successfully!"
|
||||
echo "${red}warning: ${green}The following are the actual parameters for the v2ray service startup."
|
||||
echo "${red}warning: ${green}Please make sure the configuration file path is correctly set.${reset}"
|
||||
systemd_cat_config /etc/systemd/system/v2ray.service
|
||||
# shellcheck disable=SC2154
|
||||
if [[ x"${check_all_service_files:0:1}" = x'y' ]]; then
|
||||
echo
|
||||
echo
|
||||
systemd_cat_config /etc/systemd/system/v2ray@.service
|
||||
fi
|
||||
systemctl daemon-reload
|
||||
SYSTEMD='1'
|
||||
}
|
||||
|
||||
start_v2ray() {
|
||||
if [[ -f '/etc/systemd/system/v2ray.service' ]]; then
|
||||
if systemctl start "${V2RAY_CUSTOMIZE:-v2ray}"; then
|
||||
echo 'info: Start the V2Ray service.'
|
||||
else
|
||||
echo 'error: Failed to start V2Ray service.'
|
||||
exit 1
|
||||
fi
|
||||
fi
|
||||
}
|
||||
|
||||
stop_v2ray() {
|
||||
V2RAY_CUSTOMIZE="$(systemctl list-units | grep 'v2ray@' | awk -F ' ' '{print $1}')"
|
||||
if [[ -z "$V2RAY_CUSTOMIZE" ]]; then
|
||||
local v2ray_daemon_to_stop='v2ray.service'
|
||||
else
|
||||
local v2ray_daemon_to_stop="$V2RAY_CUSTOMIZE"
|
||||
fi
|
||||
if ! systemctl stop "$v2ray_daemon_to_stop"; then
|
||||
echo 'error: Stopping the V2Ray service failed.'
|
||||
exit 1
|
||||
fi
|
||||
echo 'info: Stop the V2Ray service.'
|
||||
}
|
||||
|
||||
check_update() {
|
||||
if [[ -f '/etc/systemd/system/v2ray.service' ]]; then
|
||||
(get_version)
|
||||
local get_ver_exit_code=$?
|
||||
if [[ "$get_ver_exit_code" -eq '0' ]]; then
|
||||
echo "info: Found the latest release of V2Ray $RELEASE_VERSION . (Current release: $CURRENT_VERSION)"
|
||||
elif [[ "$get_ver_exit_code" -eq '1' ]]; then
|
||||
echo "info: No new version. The current version of V2Ray is $CURRENT_VERSION ."
|
||||
fi
|
||||
exit 0
|
||||
else
|
||||
echo 'error: V2Ray is not installed.'
|
||||
exit 1
|
||||
fi
|
||||
}
|
||||
|
||||
remove_v2ray() {
|
||||
if systemctl list-unit-files | grep -qw 'v2ray'; then
|
||||
if [[ -n "$(pidof v2ray)" ]]; then
|
||||
stop_v2ray
|
||||
fi
|
||||
if ! ("rm" -r '/usr/local/bin/v2ray' \
|
||||
'/usr/local/bin/v2ctl' \
|
||||
"$DAT_PATH" \
|
||||
'/etc/systemd/system/v2ray.service' \
|
||||
'/etc/systemd/system/v2ray@.service' \
|
||||
'/etc/systemd/system/v2ray.service.d' \
|
||||
'/etc/systemd/system/v2ray@.service.d'); then
|
||||
echo 'error: Failed to remove V2Ray.'
|
||||
exit 1
|
||||
else
|
||||
echo 'removed: /usr/local/bin/v2ray'
|
||||
echo 'removed: /usr/local/bin/v2ctl'
|
||||
echo "removed: $DAT_PATH"
|
||||
echo 'removed: /etc/systemd/system/v2ray.service'
|
||||
echo 'removed: /etc/systemd/system/v2ray@.service'
|
||||
echo 'removed: /etc/systemd/system/v2ray.service.d'
|
||||
echo 'removed: /etc/systemd/system/v2ray@.service.d'
|
||||
echo 'Please execute the command: systemctl disable v2ray'
|
||||
echo "You may need to execute a command to remove dependent software: $PACKAGE_MANAGEMENT_REMOVE curl unzip"
|
||||
echo 'info: V2Ray has been removed.'
|
||||
echo 'info: If necessary, manually delete the configuration and log files.'
|
||||
if [[ -n "$JSONS_PATH" ]]; then
|
||||
echo "info: e.g., $JSONS_PATH and /var/log/v2ray/ ..."
|
||||
else
|
||||
echo "info: e.g., $JSON_PATH and /var/log/v2ray/ ..."
|
||||
fi
|
||||
exit 0
|
||||
fi
|
||||
else
|
||||
echo 'error: V2Ray is not installed.'
|
||||
exit 1
|
||||
fi
|
||||
}
|
||||
|
||||
# Explanation of parameters in the script
|
||||
show_help() {
|
||||
echo "usage: $0 [--remove | --version number | -c | -f | -h | -l | -p]"
|
||||
echo ' [-p address] [--version number | -c | -f]'
|
||||
echo ' --remove Remove V2Ray'
|
||||
echo ' --version Install the specified version of V2Ray, e.g., --version v4.18.0'
|
||||
echo ' -c, --check Check if V2Ray can be updated'
|
||||
echo ' -f, --force Force installation of the latest version of V2Ray'
|
||||
echo ' -h, --help Show help'
|
||||
echo ' -l, --local Install V2Ray from a local file'
|
||||
echo ' -p, --proxy Download through a proxy server, e.g., -p http://127.0.0.1:8118 or -p socks5://127.0.0.1:1080'
|
||||
exit 0
|
||||
}
|
||||
|
||||
main() {
|
||||
check_if_running_as_root
|
||||
identify_the_operating_system_and_architecture
|
||||
judgment_parameters "$@"
|
||||
|
||||
install_software "$package_provide_tput" 'tput'
|
||||
red=$(tput setaf 1)
|
||||
green=$(tput setaf 2)
|
||||
aoi=$(tput setaf 6)
|
||||
reset=$(tput sgr0)
|
||||
|
||||
# Parameter information
|
||||
[[ "$HELP" -eq '1' ]] && show_help
|
||||
[[ "$CHECK" -eq '1' ]] && check_update
|
||||
[[ "$REMOVE" -eq '1' ]] && remove_v2ray
|
||||
|
||||
# Two very important variables
|
||||
TMP_DIRECTORY="$(mktemp -d)"
|
||||
ZIP_FILE="${TMP_DIRECTORY}/v2ray-linux-$MACHINE.zip"
|
||||
|
||||
# Install V2Ray from a local file, but still need to make sure the network is available
|
||||
if [[ "$LOCAL_INSTALL" -eq '1' ]]; then
|
||||
echo 'warn: Install V2Ray from a local file, but still need to make sure the network is available.'
|
||||
echo -n 'warn: Please make sure the file is valid because we cannot confirm it. (Press any key) ...'
|
||||
read -r
|
||||
install_software 'unzip' 'unzip'
|
||||
decompression "$LOCAL_FILE"
|
||||
else
|
||||
# Normal way
|
||||
install_software 'curl' 'curl'
|
||||
get_version
|
||||
NUMBER="$?"
|
||||
if [[ "$NUMBER" -eq '0' ]] || [[ "$FORCE" -eq '1' ]] || [[ "$NUMBER" -eq 2 ]]; then
|
||||
echo "info: Installing V2Ray $RELEASE_VERSION for $(uname -m)"
|
||||
download_v2ray
|
||||
if [[ "$?" -eq '1' ]]; then
|
||||
"rm" -r "$TMP_DIRECTORY"
|
||||
echo "removed: $TMP_DIRECTORY"
|
||||
exit 0
|
||||
fi
|
||||
install_software 'unzip' 'unzip'
|
||||
decompression "$ZIP_FILE"
|
||||
elif [[ "$NUMBER" -eq '1' ]]; then
|
||||
echo "info: No new version. The current version of V2Ray is $CURRENT_VERSION ."
|
||||
exit 0
|
||||
fi
|
||||
fi
|
||||
|
||||
# Determine if V2Ray is running
|
||||
if systemctl list-unit-files | grep -qw 'v2ray'; then
|
||||
if [[ -n "$(pidof v2ray)" ]]; then
|
||||
stop_v2ray
|
||||
V2RAY_RUNNING='1'
|
||||
fi
|
||||
fi
|
||||
install_v2ray
|
||||
install_startup_service_file
|
||||
echo 'installed: /usr/local/bin/v2ray'
|
||||
echo 'installed: /usr/local/bin/v2ctl'
|
||||
# If the file exists, the content output of installing or updating geoip.dat and geosite.dat will not be displayed
|
||||
if [[ ! -f "${DAT_PATH}/.undat" ]]; then
|
||||
echo "installed: ${DAT_PATH}/geoip.dat"
|
||||
echo "installed: ${DAT_PATH}/geosite.dat"
|
||||
fi
|
||||
if [[ "$CONFIG_NEW" -eq '1' ]]; then
|
||||
echo "installed: ${JSON_PATH}/config.json"
|
||||
fi
|
||||
if [[ "$CONFDIR" -eq '1' ]]; then
|
||||
echo "installed: ${JSON_PATH}/00_log.json"
|
||||
echo "installed: ${JSON_PATH}/01_api.json"
|
||||
echo "installed: ${JSON_PATH}/02_dns.json"
|
||||
echo "installed: ${JSON_PATH}/03_routing.json"
|
||||
echo "installed: ${JSON_PATH}/04_policy.json"
|
||||
echo "installed: ${JSON_PATH}/05_inbounds.json"
|
||||
echo "installed: ${JSON_PATH}/06_outbounds.json"
|
||||
echo "installed: ${JSON_PATH}/07_transport.json"
|
||||
echo "installed: ${JSON_PATH}/08_stats.json"
|
||||
echo "installed: ${JSON_PATH}/09_reverse.json"
|
||||
fi
|
||||
if [[ "$LOG" -eq '1' ]]; then
|
||||
echo 'installed: /var/log/v2ray/'
|
||||
echo 'installed: /var/log/v2ray/access.log'
|
||||
echo 'installed: /var/log/v2ray/error.log'
|
||||
fi
|
||||
if [[ "$SYSTEMD" -eq '1' ]]; then
|
||||
echo 'installed: /etc/systemd/system/v2ray.service'
|
||||
echo 'installed: /etc/systemd/system/v2ray@.service'
|
||||
fi
|
||||
"rm" -r "$TMP_DIRECTORY"
|
||||
echo "removed: $TMP_DIRECTORY"
|
||||
if [[ "$LOCAL_INSTALL" -eq '1' ]]; then
|
||||
get_version
|
||||
fi
|
||||
echo "info: V2Ray $RELEASE_VERSION is installed."
|
||||
echo "You may need to execute a command to remove dependent software: $PACKAGE_MANAGEMENT_REMOVE curl unzip"
|
||||
if [[ "$V2RAY_RUNNING" -eq '1' ]]; then
|
||||
start_v2ray
|
||||
else
|
||||
echo 'Please execute the command: systemctl enable v2ray; systemctl start v2ray'
|
||||
fi
|
||||
}
|
||||
|
||||
main "$@"
|
||||
BIN
v2ray示例/v2ray-Socks5/v2ray-linux-64_v4.32.1.zip
Normal file
BIN
v2ray示例/v2ray-Socks5/v2ray-linux-64_v4.32.1.zip
Normal file
Binary file not shown.
65
v2ray示例/斐讯K2P升级padavan固件/k2p的使用.iptables
Normal file
65
v2ray示例/斐讯K2P升级padavan固件/k2p的使用.iptables
Normal file
@@ -0,0 +1,65 @@
|
||||
# 设置策略路由
|
||||
# 添加路由表 100
|
||||
sudo ip route add local default dev lo table 100
|
||||
# 为路由表 100 设定规则
|
||||
ip rule add fwmark 1 table 100
|
||||
|
||||
|
||||
# 创建XRAY过滤器链
|
||||
iptables -t mangle -N XRAY
|
||||
|
||||
# 代理局域网设备
|
||||
iptables -t mangle -A XRAY -d 10.0.0.0/8 -j RETURN
|
||||
iptables -t mangle -A XRAY -d 100.64.0.0/10 -j RETURN
|
||||
iptables -t mangle -A XRAY -d 127.0.0.0/8 -j RETURN
|
||||
iptables -t mangle -A XRAY -d 169.254.0.0/16 -j RETURN
|
||||
iptables -t mangle -A XRAY -d 172.16.0.0/12 -j RETURN
|
||||
iptables -t mangle -A XRAY -d 192.0.0.0/24 -j RETURN
|
||||
iptables -t mangle -A XRAY -d 224.0.0.0/4 -j RETURN
|
||||
iptables -t mangle -A XRAY -d 240.0.0.0/4 -j RETURN
|
||||
iptables -t mangle -A XRAY -d 255.255.255.255/32 -j RETURN
|
||||
|
||||
# 直连局域网,避免 XRAY 无法启动时无法连网关的 SSH,如果你配置的是其他网段(如 10.x.x.x 等),则修改成自己的
|
||||
iptables -t mangle -A XRAY -d 10.10.10.0/24 -p tcp -j RETURN
|
||||
|
||||
# 直连局域网,53 端口除外(因为要使用 XRAY 的 DNS)
|
||||
iptables -t mangle -A XRAY -d 10.10.10.0/24 -p udp ! --dport 53 -j RETURN
|
||||
|
||||
# 直连 SO_MARK 为 0xff 的流量(0xff 是 16 进制数,数值上等同与上面XRAY 配置的 255),此规则目的是解决XRAY占用大量CPU(https://github.com/XRAY/XRAY-core/issues/2621)
|
||||
#iptables -t mangle -A XRAY -j RETURN -m mark --mark 0xff
|
||||
|
||||
# 给 UDP 打标记 1,转发至 12345 端口
|
||||
iptables -t mangle -A XRAY -p udp -j TPROXY --on-port 12345 --tproxy-mark 1
|
||||
# 给 TCP 打标记 1,转发至 12345 端口
|
||||
iptables -t mangle -A XRAY -p tcp -j TPROXY --on-port 12345 --tproxy-mark 1
|
||||
# 应用规则
|
||||
iptables -t mangle -A PREROUTING -j XRAY
|
||||
|
||||
|
||||
# 代理网关本机
|
||||
iptables -t mangle -N XRAY_SELF
|
||||
iptables -t mangle -A XRAY_SELF -d 10.0.0.0/8 -j RETURN
|
||||
iptables -t mangle -A XRAY_SELF -d 100.64.0.0/10 -j RETURN
|
||||
iptables -t mangle -A XRAY_SELF -d 127.0.0.0/8 -j RETURN
|
||||
iptables -t mangle -A XRAY_SELF -d 169.254.0.0/16 -j RETURN
|
||||
iptables -t mangle -A XRAY_SELF -d 172.16.0.0/12 -j RETURN
|
||||
iptables -t mangle -A XRAY_SELF -d 192.0.0.0/24 -j RETURN
|
||||
iptables -t mangle -A XRAY_SELF -d 224.0.0.0/4 -j RETURN
|
||||
iptables -t mangle -A XRAY_SELF -d 240.0.0.0/4 -j RETURN
|
||||
iptables -t mangle -A XRAY_SELF -d 255.255.255.255/32 -j RETURN
|
||||
|
||||
iptables -t mangle -A XRAY_SELF -d 10.10.10.0/24 -p tcp -j RETURN # 直连局域网
|
||||
# 直连局域网,53 端口除外(因为要使用 XRAY 的 DNS)
|
||||
iptables -t mangle -A XRAY_SELF -d 10.10.10.0/24 -p udp ! --dport 53 -j RETURN
|
||||
|
||||
# 直连 SO_MARK 为 0xff 的流量(0xff 是 16 进制数,数值上等同与上面XRAY 配置的 255),此规则目的是避免代理本机(网关)流量出现回环问题
|
||||
#iptables -t mangle -A XRAY_SELF -m mark --mark 0xff -j RETURN
|
||||
|
||||
iptables -t mangle -A XRAY_SELF -m mark --mark 2 -j RETURN
|
||||
|
||||
# 给 UDP 打标记,重路由
|
||||
iptables -t mangle -A XRAY_SELF -p udp -j MARK --set-mark 1
|
||||
# 给 TCP 打标记,重路由
|
||||
iptables -t mangle -A XRAY_SELF -p tcp -j MARK --set-mark 1
|
||||
# 应用规则
|
||||
iptables -t mangle -A OUTPUT -j XRAY_SELF
|
||||
200
v2ray示例/斐讯K2P升级padavan固件/v2ray配置-透明代理.json
Normal file
200
v2ray示例/斐讯K2P升级padavan固件/v2ray配置-透明代理.json
Normal file
@@ -0,0 +1,200 @@
|
||||
{
|
||||
"log": {
|
||||
"loglevel": "warning"
|
||||
},
|
||||
"inbounds": [
|
||||
{
|
||||
"tag": "all-in",
|
||||
"port": 12345,
|
||||
"protocol": "dokodemo-door",
|
||||
"settings": {
|
||||
"network": "tcp,udp",
|
||||
"followRedirect": true
|
||||
},
|
||||
"sniffing": {
|
||||
"enabled": true,
|
||||
"destOverride": [
|
||||
"http",
|
||||
"tls"
|
||||
]
|
||||
},
|
||||
"streamSettings": {
|
||||
"sockopt": {
|
||||
"tproxy": "tproxy"
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"protocol": "socks",
|
||||
"port": 22999,
|
||||
"listen": "0.0.0.0",
|
||||
"sniffing": {
|
||||
"enabled": true,
|
||||
"destOverride": [
|
||||
"http",
|
||||
"tls"
|
||||
]
|
||||
},
|
||||
"settings": {
|
||||
"auth": "none",
|
||||
"udp": true,
|
||||
"userLevel": 10
|
||||
},
|
||||
"streamSettings": {
|
||||
"sockopt": {
|
||||
"tproxy": "tproxy"
|
||||
}
|
||||
}
|
||||
}
|
||||
],
|
||||
"outbounds": [
|
||||
{
|
||||
"tag": "direct",
|
||||
"protocol": "freedom",
|
||||
"settings": {
|
||||
"domainStrategy": "UseIPv4"
|
||||
},
|
||||
"streamSettings": {
|
||||
"sockopt": {
|
||||
"mark": 2
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"tag": "proxy",
|
||||
"protocol": "vless",
|
||||
"settings": {
|
||||
"vnext": [
|
||||
{
|
||||
"address": "43.154.83.213",
|
||||
"port": 29999,
|
||||
"users": [
|
||||
{
|
||||
"id": "fc903f5d-a007-482b-928c-570da9a851f9",
|
||||
"alterId": 0,
|
||||
"email": "192.168.11.19@qq.com",
|
||||
"security": "auto",
|
||||
"encryption": "none",
|
||||
"flow": "xtls-rprx-direct"
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
"streamSettings": {
|
||||
"network": "tcp",
|
||||
"security": "xtls",
|
||||
"xtlsSettings": {
|
||||
"serverName": "tencent-hk-11.17.107421.xyz",
|
||||
"allowInsecure": true,
|
||||
"rejectUnknownSni": false,
|
||||
"alpn": [
|
||||
"h2",
|
||||
"http/1.1"
|
||||
],
|
||||
"minVersion": "1.2",
|
||||
"maxVersion": "1.3"
|
||||
},
|
||||
"sockopt": {
|
||||
"mark": 2
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"tag": "block",
|
||||
"protocol": "blackhole",
|
||||
"settings": {
|
||||
"response": {
|
||||
"type": "http"
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"tag": "dns-out",
|
||||
"protocol": "dns",
|
||||
"settings": {
|
||||
"address": "8.8.8.8"
|
||||
},
|
||||
"proxySettings": {
|
||||
"tag": "proxy"
|
||||
},
|
||||
"streamSettings": {
|
||||
"sockopt": {
|
||||
"mark": 2
|
||||
}
|
||||
}
|
||||
}
|
||||
],
|
||||
"dns": {
|
||||
"hosts": {
|
||||
"icederce.io": "192.168.11.19"
|
||||
},
|
||||
"servers": [
|
||||
{
|
||||
"address": "223.5.5.5",
|
||||
"port": 53,
|
||||
"domains": [
|
||||
"geosite:cn"
|
||||
],
|
||||
"expectIPs": [
|
||||
"geoip:cn"
|
||||
]
|
||||
},
|
||||
{
|
||||
"address": "119.29.29.29",
|
||||
"port": 53,
|
||||
"domains": [
|
||||
"geosite:cn"
|
||||
],
|
||||
"expectIPs": [
|
||||
"geoip:cn"
|
||||
]
|
||||
},
|
||||
"8.8.8.8",
|
||||
"1.1.1.1",
|
||||
"https+local://doh.dns.sb/dns-query"
|
||||
]
|
||||
},
|
||||
"routing": {
|
||||
"domainStrategy": "IPIfNonMatch",
|
||||
"rules": [
|
||||
{
|
||||
"type": "field",
|
||||
"inboundTag": [
|
||||
"all-in"
|
||||
],
|
||||
"port": 53,
|
||||
"outboundTag": "dns-out"
|
||||
},
|
||||
{
|
||||
"type": "field",
|
||||
"ip": [
|
||||
"8.8.8.8",
|
||||
"1.1.1.1"
|
||||
],
|
||||
"outboundTag": "proxy"
|
||||
},
|
||||
{
|
||||
"type": "field",
|
||||
"domain": [
|
||||
"geosite:category-ads-all"
|
||||
],
|
||||
"outboundTag": "block"
|
||||
},
|
||||
{
|
||||
"type": "field",
|
||||
"domain": [
|
||||
"geosite:geolocation-!cn"
|
||||
],
|
||||
"outboundTag": "proxy"
|
||||
},
|
||||
{
|
||||
"type": "field",
|
||||
"domains": [
|
||||
"geosite:cn"
|
||||
],
|
||||
"outboundTag": "direct"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
76
v2ray示例/旁路由-透明代理/HomeProxy/Tproxy/iptables-homeProxy-实际使用.sh
Normal file
76
v2ray示例/旁路由-透明代理/HomeProxy/Tproxy/iptables-homeProxy-实际使用.sh
Normal file
@@ -0,0 +1,76 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
# 设置策略路由
|
||||
# 添加路由表 100
|
||||
sudo ip route add local default dev lo table 100
|
||||
# 为路由表 100 设定规则
|
||||
+ip rule add fwmark 1 table 100
|
||||
|
||||
|
||||
# 创建XRAY过滤器链
|
||||
iptables -t mangle -N XRAY
|
||||
|
||||
# 代理局域网设备
|
||||
iptables -t mangle -A XRAY -d 10.0.0.0/8 -j RETURN
|
||||
iptables -t mangle -A XRAY -d 100.64.0.0/10 -j RETURN
|
||||
iptables -t mangle -A XRAY -d 127.0.0.0/8 -j RETURN
|
||||
iptables -t mangle -A XRAY -d 169.254.0.0/16 -j RETURN
|
||||
iptables -t mangle -A XRAY -d 172.0.0.0/8 -j RETURN
|
||||
iptables -t mangle -A XRAY -d 224.0.0.0/4 -j RETURN
|
||||
iptables -t mangle -A XRAY -d 255.255.255.255/32 -j RETURN
|
||||
|
||||
# 直连局域网,避免 XRAY 无法启动时无法连网关的 SSH,如果你配置的是其他网段(如 10.x.x.x 等),则修改成自己的
|
||||
iptables -t mangle -A XRAY -d 192.168.233.0/24 -p tcp -j RETURN
|
||||
|
||||
# 直连局域网,53 端口除外(因为要使用 XRAY 的 DNS)
|
||||
iptables -t mangle -A XRAY -d 192.168.233.0/24 -p udp ! --dport 53 -j RETURN
|
||||
|
||||
|
||||
# 给 UDP 打标记 1,转发至 12345 端口
|
||||
iptables -t mangle -A XRAY -i ens3 -p udp -j TPROXY --on-port 12345 --tproxy-mark 1
|
||||
# 给 TCP 打标记 1,转发至 12345 端口
|
||||
iptables -t mangle -A XRAY -i ens3 -p tcp -j TPROXY --on-port 12345 --tproxy-mark 1
|
||||
# 应用规则
|
||||
iptables -t mangle -A PREROUTING -j XRAY
|
||||
|
||||
|
||||
# 代理网关本机
|
||||
iptables -t mangle -N XRAY_SELF
|
||||
|
||||
iptables -t mangle -A XRAY -d 10.0.0.0/8 -j RETURN
|
||||
iptables -t mangle -A XRAY -d 100.64.0.0/10 -j RETURN
|
||||
iptables -t mangle -A XRAY -d 127.0.0.0/8 -j RETURN
|
||||
iptables -t mangle -A XRAY -d 169.254.0.0/16 -j RETURN
|
||||
iptables -t mangle -A XRAY -d 172.0.0.0/8 -j RETURN
|
||||
iptables -t mangle -A XRAY -d 224.0.0.0/4 -j RETURN
|
||||
iptables -t mangle -A XRAY -d 255.255.255.255/32 -j RETURN
|
||||
|
||||
iptables -t mangle -A XRAY_SELF -d 192.168.233.0/24 -p tcp -j RETURN # 直连局域网
|
||||
# 直连局域网,53 端口除外(因为要使用 XRAY 的 DNS)
|
||||
iptables -t mangle -A XRAY_SELF -d 192.168.233.0/24 -p udp ! --dport 53 -j RETURN
|
||||
|
||||
|
||||
# 除了上述的所有流量,均为进入PostRouting的流量,需要判定mark标记,然后释放
|
||||
iptables -t mangle -A XRAY_SELF -m mark --mark 23 -j RETURN
|
||||
|
||||
# 为CoreDNS开启PostRouting流量
|
||||
|
||||
# 请求UDP-53的流量 放行请求国内dns的请求,直接出去
|
||||
iptables -t mangle -A XRAY_SELF -i ens3 -p udp --dport 53 -j RETURN
|
||||
# 请求DNS over TLS - 853 的流量 需要重新回到Xray中走代理
|
||||
#iptables -t mangle -A XRAY_SELF -p tcp --dport 853 -j RETURN
|
||||
#iptables -t mangle -A XRAY_SELF -p udp --dport 853 -j RETURN
|
||||
|
||||
# 所有其他流量,需要重路由
|
||||
# 给 UDP 打标记,重路由
|
||||
iptables -t mangle -A XRAY_SELF -i ens3 -p udp -j MARK --set-mark 1
|
||||
# 给 TCP 打标记,重路由
|
||||
iptables -t mangle -A XRAY_SELF -i ens3 -p tcp -j MARK --set-mark 1
|
||||
# 应用规则
|
||||
iptables -t mangle -A OUTPUT -j XRAY_SELF
|
||||
|
||||
# 新建 DIVERT 规则,避免已有连接的包二次通过 TPROXY,理论上有一定的性能提升
|
||||
iptables -t mangle -N DIVERT
|
||||
iptables -t mangle -A DIVERT -i ens3 -j MARK --set-mark 1
|
||||
iptables -t mangle -A DIVERT -j ACCEPT
|
||||
iptables -t mangle -I PREROUTING -p tcp -m socket -j DIVERT
|
||||
18
v2ray示例/旁路由-透明代理/HomeProxy/Tproxy/remove-tporxy-iptables.sh
Normal file
18
v2ray示例/旁路由-透明代理/HomeProxy/Tproxy/remove-tporxy-iptables.sh
Normal file
@@ -0,0 +1,18 @@
|
||||
#!/usr/bin/ bash
|
||||
|
||||
iptables -t mangle -F XRAY
|
||||
iptables -t mangle -F XRAY_SELF
|
||||
iptables -t mangle -F DIVERT
|
||||
|
||||
iptables -t mangle -D PREROUTING -j XRAY
|
||||
iptables -t mangle -D PREROUTING 1
|
||||
|
||||
iptables -t mangle -X XRAY
|
||||
iptables -t mangle -X DIVERT
|
||||
|
||||
iptables -t mangle -D OUTPUT -j XRAY_SELF
|
||||
iptables -t mangle -X XRAY_SELF
|
||||
|
||||
sudo ip route del local default dev lo table 100
|
||||
|
||||
iptables -t mangle -nL --line-number
|
||||
@@ -0,0 +1,185 @@
|
||||
{
|
||||
"log": {
|
||||
"loglevel": "warning",
|
||||
"error": "/var/log/xray/error.log",
|
||||
"access": "/var/log/xray/access.log"
|
||||
},
|
||||
"inbounds": [
|
||||
{
|
||||
"tag": "all-in",
|
||||
"port": 12345,
|
||||
"protocol": "dokodemo-door",
|
||||
"settings": {
|
||||
"network": "tcp,udp",
|
||||
"followRedirect": true
|
||||
},
|
||||
"sniffing": {
|
||||
"enabled": true,
|
||||
"destOverride": [
|
||||
"http",
|
||||
"tls"
|
||||
]
|
||||
},
|
||||
"streamSettings": {
|
||||
"sockopt": {
|
||||
"tproxy": "tproxy"
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"protocol": "socks",
|
||||
"port": 22999,
|
||||
"listen": "0.0.0.0",
|
||||
"sniffing": {
|
||||
"enabled": true,
|
||||
"destOverride": [
|
||||
"http",
|
||||
"tls"
|
||||
]
|
||||
},
|
||||
"settings": {
|
||||
"auth": "noauth",
|
||||
"udp": true,
|
||||
"userLevel": 10
|
||||
},
|
||||
"streamSettings": {
|
||||
"sockopt": {
|
||||
"tproxy": "tproxy"
|
||||
}
|
||||
}
|
||||
}
|
||||
],
|
||||
"outbounds": [
|
||||
{
|
||||
"tag": "direct",
|
||||
"protocol": "freedom",
|
||||
"settings": {
|
||||
"domainStrategy": "UseIPv4"
|
||||
},
|
||||
"streamSettings": {
|
||||
"sockopt": {
|
||||
"mark": 233
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"tag": "proxy",
|
||||
"protocol": "vless",
|
||||
"settings": {
|
||||
"vnext": [
|
||||
{
|
||||
"address": "43.154.83.213",
|
||||
"port": 29999,
|
||||
"users": [
|
||||
{
|
||||
"id": "fc903f5d-a007-482b-928c-570da9a851f9",
|
||||
"alterId": 0,
|
||||
"email": "192.168.11.19@qq.com",
|
||||
"security": "auto",
|
||||
"encryption": "none",
|
||||
"flow": "xtls-rprx-direct"
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
"streamSettings": {
|
||||
"network": "tcp",
|
||||
"security": "xtls",
|
||||
"xtlsSettings": {
|
||||
"serverName": "tencent-hk-11.17.107421.xyz",
|
||||
"allowInsecure": true,
|
||||
"rejectUnknownSni": false,
|
||||
"alpn": [
|
||||
"h2",
|
||||
"http/1.1"
|
||||
],
|
||||
"minVersion": "1.2",
|
||||
"maxVersion": "1.3"
|
||||
},
|
||||
"sockopt": {
|
||||
"mark": 233
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"tag": "block",
|
||||
"protocol": "blackhole",
|
||||
"settings": {
|
||||
"response": {
|
||||
"type": "http"
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"tag": "dns-out",
|
||||
"protocol": "dns",
|
||||
"streamSettings": {
|
||||
"sockopt": {
|
||||
"mark": 233
|
||||
}
|
||||
}
|
||||
}
|
||||
],
|
||||
"dns": {
|
||||
"hosts": {
|
||||
"proxy.io": "192.168.233.2"
|
||||
},
|
||||
"servers": [
|
||||
{
|
||||
"address": "223.5.5.5",
|
||||
"port": 53,
|
||||
"domains": [
|
||||
"geosite:cn"
|
||||
],
|
||||
"expectIPs": [
|
||||
"geoip:cn"
|
||||
]
|
||||
},
|
||||
{
|
||||
"address": "8.8.8.8",
|
||||
"port": 53,
|
||||
"domains": [
|
||||
"geosite:geolocation-!cn"
|
||||
]
|
||||
},
|
||||
"https+local://doh.dns.sb/dns-query"
|
||||
]
|
||||
},
|
||||
"routing": {
|
||||
"domainStrategy": "IPIfNonMatch",
|
||||
"rules": [
|
||||
{
|
||||
"type": "field",
|
||||
"inboundTag": [
|
||||
"all-in"
|
||||
],
|
||||
"port": 53,
|
||||
"outboundTag": "dns-out"
|
||||
},
|
||||
{
|
||||
"type": "field",
|
||||
"ip": [
|
||||
"8.8.8.8",
|
||||
"1.1.1.1"
|
||||
],
|
||||
"outboundTag": "proxy"
|
||||
},
|
||||
{
|
||||
"type": "field",
|
||||
"domain": [
|
||||
"geosite:category-ads-all"
|
||||
],
|
||||
"outboundTag": "block"
|
||||
},
|
||||
{
|
||||
"type": "field",
|
||||
"domain": [
|
||||
"travel.state.gov",
|
||||
"geosite:geolocation-!cn"
|
||||
],
|
||||
"outboundTag": "proxy"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,164 @@
|
||||
// 为了更好的分流体验,请替换默认路由规则文件为 Loyalsoldier/v2ray-rules-dat,否则 Xray-core 将无法加载本配置。
|
||||
//
|
||||
//sudo curl -oL /usr/local/share/xray/geoip.dat https://cdn.jsdelivr.net/gh/Loyalsoldier/v2ray-rules-dat@release/geoip.dat
|
||||
//sudo curl -oL /usr/local/share/xray/geosite.dat https://cdn.jsdelivr.net/gh/Loyalsoldier/v2ray-rules-dat@release/geosite.dat
|
||||
|
||||
// https://xtls.github.io/document/level-2/tproxy.html#xray-%E9%85%8D%E7%BD%AE
|
||||
{
|
||||
"log": {
|
||||
"loglevel": "warning",
|
||||
"error": "/var/log/xray/error.log",
|
||||
"access": "/var/log/xray/access.log"
|
||||
},
|
||||
"inbounds": [
|
||||
{
|
||||
"tag": "dns-in",
|
||||
"port": 53,
|
||||
"protocol": "dokodemo-door",
|
||||
"settings": {
|
||||
"address": "192.168.233.2",
|
||||
"port": 5353,
|
||||
"network": "udp",
|
||||
"userLevel": 1
|
||||
}
|
||||
},
|
||||
{
|
||||
"tag": "all-in",
|
||||
"port": 12345,
|
||||
"protocol": "dokodemo-door",
|
||||
"settings": {
|
||||
"network": "tcp,udp",
|
||||
"followRedirect": true
|
||||
},
|
||||
"sniffing": {
|
||||
"enabled": true,
|
||||
"destOverride": [
|
||||
"http",
|
||||
"tls"
|
||||
]
|
||||
},
|
||||
"streamSettings": {
|
||||
"sockopt": {
|
||||
"tproxy": "tproxy"
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"protocol": "socks",
|
||||
"port": 22999,
|
||||
"listen": "0.0.0.0",
|
||||
"sniffing": {
|
||||
"enabled": true,
|
||||
"destOverride": [
|
||||
"http",
|
||||
"tls"
|
||||
]
|
||||
},
|
||||
"settings": {
|
||||
"auth": "noauth",
|
||||
"udp": true,
|
||||
"userLevel": 10
|
||||
},
|
||||
"streamSettings": {
|
||||
"sockopt": {
|
||||
"tproxy": "tproxy"
|
||||
}
|
||||
}
|
||||
}
|
||||
],
|
||||
"outbounds": [
|
||||
{
|
||||
"tag": "proxy",
|
||||
"protocol": "vless",
|
||||
"settings": {
|
||||
"vnext": [
|
||||
{
|
||||
"address": "43.154.83.213",
|
||||
"port": 29999,
|
||||
"users": [
|
||||
{
|
||||
"id": "fc903f5d-a007-482b-928c-570da9a851f9",
|
||||
"alterId": 0,
|
||||
"email": "192.168.11.19@qq.com",
|
||||
"security": "auto",
|
||||
"encryption": "none",
|
||||
"flow": "xtls-rprx-direct"
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
"streamSettings": {
|
||||
"network": "tcp",
|
||||
"security": "xtls",
|
||||
"xtlsSettings": {
|
||||
"serverName": "tencent-hk-11.17.107421.xyz",
|
||||
"allowInsecure": true,
|
||||
"rejectUnknownSni": false,
|
||||
"alpn": [
|
||||
"h2",
|
||||
"http/1.1"
|
||||
],
|
||||
"minVersion": "1.2",
|
||||
"maxVersion": "1.3"
|
||||
},
|
||||
"sockopt": {
|
||||
"mark": 23
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"tag": "direct",
|
||||
"protocol": "freedom",
|
||||
"settings": {
|
||||
"domainStrategy": "UseIPv4"
|
||||
},
|
||||
"streamSettings": {
|
||||
"sockopt": {
|
||||
"mark": 23
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"tag": "block",
|
||||
"protocol": "blackhole"
|
||||
}
|
||||
],
|
||||
"routing": {
|
||||
"domainStrategy": "IPIfNonMatch",
|
||||
"rules": [
|
||||
{
|
||||
"type": "field",
|
||||
"ip": [
|
||||
"geoip:private",
|
||||
"geoip:cn"
|
||||
],
|
||||
"domain": [
|
||||
"geosite:cn",
|
||||
"geosite:apple-cn"
|
||||
],
|
||||
"outboundTag": "direct"
|
||||
},
|
||||
{
|
||||
"type": "field",
|
||||
"ip": [
|
||||
"8.8.8.8",
|
||||
"8.8.4.4",
|
||||
"1.1.1.1",
|
||||
"1.0.0.1"
|
||||
],
|
||||
"domain": [
|
||||
"geosite:geolocation-!cn"
|
||||
],
|
||||
"outboundTag": "proxy"
|
||||
},
|
||||
{
|
||||
"type": "field",
|
||||
"domain": [
|
||||
"geosite:category-ads-all"
|
||||
],
|
||||
"outboundTag": "block"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,167 @@
|
||||
{
|
||||
"log": {
|
||||
"loglevel": "warning",
|
||||
"error": "/var/log/xray/error.log",
|
||||
"access": "/var/log/xray/access.log"
|
||||
},
|
||||
"inbounds": [
|
||||
{
|
||||
"tag": "dns-in",
|
||||
"port": 53,
|
||||
"protocol": "dokodemo-door",
|
||||
"settings": {
|
||||
"address": "192.168.233.2",
|
||||
"port": 5353,
|
||||
"network": "udp",
|
||||
"userLevel": 1
|
||||
}
|
||||
},
|
||||
{
|
||||
"tag": "all-in",
|
||||
"port": 12345,
|
||||
"protocol": "dokodemo-door",
|
||||
"settings": {
|
||||
"network": "tcp,udp",
|
||||
"followRedirect": true
|
||||
},
|
||||
"sniffing": {
|
||||
"enabled": true,
|
||||
"destOverride": [
|
||||
"http",
|
||||
"tls"
|
||||
]
|
||||
},
|
||||
"streamSettings": {
|
||||
"sockopt": {
|
||||
"tproxy": "tproxy"
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"protocol": "socks",
|
||||
"port": 22999,
|
||||
"listen": "0.0.0.0",
|
||||
"sniffing": {
|
||||
"enabled": true,
|
||||
"destOverride": [
|
||||
"http",
|
||||
"tls"
|
||||
]
|
||||
},
|
||||
"settings": {
|
||||
"auth": "noauth",
|
||||
"udp": true,
|
||||
"userLevel": 10
|
||||
},
|
||||
"streamSettings": {
|
||||
"sockopt": {
|
||||
"tproxy": "tproxy"
|
||||
}
|
||||
}
|
||||
}
|
||||
],
|
||||
"outbounds": [
|
||||
{
|
||||
"tag": "direct",
|
||||
"protocol": "freedom",
|
||||
"settings": {
|
||||
"domainStrategy": "UseIPv4"
|
||||
},
|
||||
"streamSettings": {
|
||||
"sockopt": {
|
||||
"mark": 23
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"tag": "proxy",
|
||||
"protocol": "vless",
|
||||
"settings": {
|
||||
"vnext": [
|
||||
{
|
||||
"address": "43.154.83.213",
|
||||
"port": 29999,
|
||||
"users": [
|
||||
{
|
||||
"id": "fc903f5d-a007-482b-928c-570da9a851f9",
|
||||
"alterId": 0,
|
||||
"email": "192.168.11.19@qq.com",
|
||||
"security": "auto",
|
||||
"encryption": "none",
|
||||
"flow": "xtls-rprx-direct"
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
"streamSettings": {
|
||||
"network": "tcp",
|
||||
"security": "xtls",
|
||||
"xtlsSettings": {
|
||||
"serverName": "tencent-hk-11.17.107421.xyz",
|
||||
"allowInsecure": true,
|
||||
"rejectUnknownSni": false,
|
||||
"alpn": [
|
||||
"h2",
|
||||
"http/1.1"
|
||||
],
|
||||
"minVersion": "1.2",
|
||||
"maxVersion": "1.3"
|
||||
},
|
||||
"sockopt": {
|
||||
"mark": 23
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"tag": "block",
|
||||
"protocol": "blackhole"
|
||||
}
|
||||
],
|
||||
"routing": {
|
||||
"domainStrategy": "IPIfNonMatch",
|
||||
"rules": [
|
||||
{
|
||||
"type": "field",
|
||||
"ip": [
|
||||
"geoip:google",
|
||||
"geoip:us",
|
||||
"geoip:facebook",
|
||||
"geoip:jp",
|
||||
"geoip:facebook",
|
||||
"geoip:telegram",
|
||||
"geoip:twitter",
|
||||
"1.1.1.1/32",
|
||||
"1.0.0.1/32",
|
||||
"8.8.8.8/32",
|
||||
"8.8.4.4/32"
|
||||
],
|
||||
"domain": [
|
||||
"github.com",
|
||||
"youtube.com",
|
||||
"geosite:gfw",
|
||||
"geosite:greatfire",
|
||||
"chatgpt.107421.xyz"
|
||||
],
|
||||
"outboundTag": "proxy"
|
||||
},
|
||||
{
|
||||
"type": "field",
|
||||
"ip": [
|
||||
"223.5.5.5/32",
|
||||
"119.29.29.29/32",
|
||||
"180.76.76.76/32",
|
||||
"114.114.114.114/32",
|
||||
"geoip:cn",
|
||||
"geoip:private"
|
||||
],
|
||||
"domain": [
|
||||
"superwdd-my.sharepoint.com",
|
||||
"sharepoint.com",
|
||||
"geosite:apple-cn"
|
||||
],
|
||||
"outboundTag": "direct"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
27
v2ray示例/旁路由-透明代理/HomeProxy/Xray-Config/自动更新路由规则.sh
Normal file
27
v2ray示例/旁路由-透明代理/HomeProxy/Xray-Config/自动更新路由规则.sh
Normal file
@@ -0,0 +1,27 @@
|
||||
#!/bin/bash
|
||||
|
||||
LogPath=/var/log/xray/geoip_update.log
|
||||
|
||||
|
||||
rm -rf /usr/local/share/xray/geosite.dat
|
||||
rm -rf /usr/local/share/xray/geoip.dat
|
||||
echo "current time is $(date), start to update geo ip for xray" >> $LogPath
|
||||
|
||||
curl --connect-timeout 5 -s -o /dev/null https://www.google.com
|
||||
if [[ $? -eq 0 ]];then
|
||||
echo "start to download from github !"
|
||||
wget https://github.com/Loyalsoldier/v2ray-rules-dat/releases/latest/download/geosite.dat -O /usr/local/share/xray/geosite.dat
|
||||
|
||||
wget https://github.com/Loyalsoldier/v2ray-rules-dat/releases/latest/download/geoip.dat -O /usr/local/share/xray/geoip.dat
|
||||
else
|
||||
echo "start to download from jsdelivr !"
|
||||
wget https://cdn.jsdelivr.net/gh/Loyalsoldier/v2ray-rules-dat@release/geosite.dat -O /usr/local/share/xray/geosite.dat
|
||||
|
||||
wget https://cdn.jsdelivr.net/gh/Loyalsoldier/v2ray-rules-dat@release/geoip.dat -O /usr/local/share/xray/geoip.dat
|
||||
fi
|
||||
|
||||
|
||||
echo "start to restrat xray !" >> $LogPath
|
||||
systemctl restart xray
|
||||
|
||||
|
||||
@@ -0,0 +1,9 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
|
||||
docker run \
|
||||
-d \
|
||||
--name redis \
|
||||
-p 16379:6379 \
|
||||
-e ALLOW_EMPTY_PASSWORD=yes \
|
||||
bitnami/redis:6.2.7
|
||||
@@ -0,0 +1,72 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
cat > /etc/coredns/Corefile <<EOF
|
||||
# https://coredns.io/plugins/cache/
|
||||
(global_cache) {
|
||||
cache {
|
||||
# [5, 60]
|
||||
success 65536 7200 900
|
||||
# [1, 10]
|
||||
denial 8192 600 60
|
||||
prefetch 1 60m 10%
|
||||
}
|
||||
}
|
||||
|
||||
.:5353 {
|
||||
|
||||
ads {
|
||||
default-lists
|
||||
blacklist https://raw.githubusercontent.com/privacy-protection-tools/anti-AD/master/anti-ad-domains.txt
|
||||
whitelist https://files.krnl.eu/whitelist.txt
|
||||
log
|
||||
auto-update-interval 24h
|
||||
list-store ads-cache
|
||||
}
|
||||
|
||||
errors
|
||||
|
||||
# health
|
||||
# prometheus :9153
|
||||
|
||||
import global_cache
|
||||
|
||||
template ANY AAAA {
|
||||
rcode NXDOMAIN
|
||||
}
|
||||
|
||||
dnsredir accelerated-domains.china.conf google.china.conf apple.china.conf mydns.conf {
|
||||
expire 15s
|
||||
max_fails 3
|
||||
health_check 3s
|
||||
policy round_robin
|
||||
path_reload 2s
|
||||
|
||||
to 223.5.5.5 119.29.29.29 114.114.114.114
|
||||
no_ipv6
|
||||
}
|
||||
|
||||
hosts {
|
||||
fallthrough
|
||||
}
|
||||
|
||||
dnsredir . {
|
||||
expire 60s
|
||||
max_fails 5
|
||||
health_check 5s
|
||||
policy random
|
||||
spray
|
||||
|
||||
to tls://8.8.8.8@dns.google tls://8.8.4.4@dns.google
|
||||
to tls://1.1.1.1:853 tls://1.0.0.1:853
|
||||
# to tcp://8.8.8.8
|
||||
|
||||
# Global TLS server name
|
||||
# tls_servername cloudflare-dns.com
|
||||
}
|
||||
|
||||
log
|
||||
loop
|
||||
reload 6s
|
||||
}
|
||||
|
||||
EOF
|
||||
@@ -0,0 +1,24 @@
|
||||
#!bin/bash
|
||||
|
||||
cat > /etc/systemd/system/coredns.service << EOF
|
||||
[Unit]
|
||||
Description=CoreDNS DNS - Custom Build Plugins server
|
||||
Documentation=https://coredns.minidump.info/
|
||||
After=network.target
|
||||
|
||||
[Service]
|
||||
PermissionsStartOnly=true
|
||||
LimitNOFILE=1048576
|
||||
LimitNPROC=512
|
||||
CapabilityBoundingSet=CAP_NET_BIND_SERVICE
|
||||
AmbientCapabilities=CAP_NET_BIND_SERVICE
|
||||
NoNewPrivileges=true
|
||||
User=coredns
|
||||
WorkingDirectory=~
|
||||
ExecStart=/usr/local/bin/coredns -conf=/etc/coredns/Corefile
|
||||
ExecReload=/bin/kill -SIGUSR1 $MAINPID
|
||||
Restart=on-failure
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
||||
EOF
|
||||
16
v2ray示例/旁路由-透明代理/HomeProxy/自建CoreDNS服务器/3-update-coredns.sh
Normal file
16
v2ray示例/旁路由-透明代理/HomeProxy/自建CoreDNS服务器/3-update-coredns.sh
Normal file
@@ -0,0 +1,16 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
cat > /usr/local/bin/update_coredns.sh <<EOF
|
||||
#!/bin/bash
|
||||
|
||||
cd /usr/local/etc/
|
||||
|
||||
rm accelerated-domains.china.conf
|
||||
wget https://jsdelivr.icloudnative.io/gh/felixonmars/dnsmasq-china-list/accelerated-domains.china.conf -O /usr/local/etc/accelerated-domains.china.conf
|
||||
rm apple.china.conf
|
||||
wget https://jsdelivr.icloudnative.io/gh/felixonmars/dnsmasq-china-list/apple.china.conf -O /usr/local/etc/apple.china.conf
|
||||
rm google.china.conf
|
||||
wget https://jsdelivr.icloudnative.io/gh/felixonmars/dnsmasq-china-list/google.china.conf -O /usr/local/etc/google.china.conf
|
||||
EOF
|
||||
|
||||
sudo chmod +x /usr/local/bin/update_coredns.sh
|
||||
30
v2ray示例/旁路由-透明代理/HomeProxy/自建CoreDNS服务器/Corefile-GitHub
Normal file
30
v2ray示例/旁路由-透明代理/HomeProxy/自建CoreDNS服务器/Corefile-GitHub
Normal file
@@ -0,0 +1,30 @@
|
||||
.:5353 {
|
||||
ads {
|
||||
strict-default-lists
|
||||
blacklist https://raw.githubusercontent.com/privacy-protection-tools/anti-AD/master/anti-ad-domains.txt
|
||||
whitelist https://files.krnl.eu/whitelist.txt
|
||||
log
|
||||
auto-update-interval 48h
|
||||
list-store ads-cache
|
||||
}
|
||||
hosts {
|
||||
fallthrough
|
||||
}
|
||||
forward . tcp://8.8.8.8 127.0.0.1:53001 {
|
||||
|
||||
log
|
||||
cache
|
||||
redisc {
|
||||
endpoint 16379
|
||||
}
|
||||
health
|
||||
reload
|
||||
}
|
||||
|
||||
.:53001 {
|
||||
bind 127.0.0.1
|
||||
forward . tls://1.1.1.1:853 {
|
||||
tls_servername cloudflare-dns.com
|
||||
}
|
||||
cache
|
||||
}
|
||||
BIN
v2ray示例/旁路由-透明代理/HomeProxy/自建CoreDNS服务器/coredns-linux-amd64.zip
Normal file
BIN
v2ray示例/旁路由-透明代理/HomeProxy/自建CoreDNS服务器/coredns-linux-amd64.zip
Normal file
Binary file not shown.
BIN
v2ray示例/旁路由-透明代理/Xray透明代理配置/geoip.dat
Normal file
BIN
v2ray示例/旁路由-透明代理/Xray透明代理配置/geoip.dat
Normal file
Binary file not shown.
40452
v2ray示例/旁路由-透明代理/Xray透明代理配置/geosite.dat
Normal file
40452
v2ray示例/旁路由-透明代理/Xray透明代理配置/geosite.dat
Normal file
File diff suppressed because one or more lines are too long
191
v2ray示例/旁路由-透明代理/Xray透明代理配置/v2ray透明代理配置-2.json
Normal file
191
v2ray示例/旁路由-透明代理/Xray透明代理配置/v2ray透明代理配置-2.json
Normal file
@@ -0,0 +1,191 @@
|
||||
// https://guide.v2fly.org/app/tproxy.html#%E4%B8%BA-v2ray-%E9%85%8D%E7%BD%AE%E9%80%8F%E6%98%8E%E4%BB%A3%E7%90%86%E7%9A%84%E5%85%A5%E7%AB%99%E5%92%8C-dns-%E5%88%86%E6%B5%81
|
||||
{
|
||||
"inbounds": [
|
||||
{
|
||||
"tag":"transparent",
|
||||
"port": 12345,
|
||||
"protocol": "dokodemo-door",
|
||||
"settings": {
|
||||
"network": "tcp,udp",
|
||||
"followRedirect": true
|
||||
},
|
||||
"sniffing": {
|
||||
"enabled": true,
|
||||
"destOverride": [
|
||||
"http",
|
||||
"tls"
|
||||
]
|
||||
},
|
||||
"streamSettings": {
|
||||
"sockopt": {
|
||||
"tproxy": "tproxy", // 透明代理使用 TPROXY 方式
|
||||
"mark":255
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"port": 1080,
|
||||
"protocol": "socks", // 入口协议为 SOCKS 5
|
||||
"sniffing": {
|
||||
"enabled": true,
|
||||
"destOverride": ["http", "tls"]
|
||||
},
|
||||
"settings": {
|
||||
"auth": "noauth"
|
||||
}
|
||||
}
|
||||
],
|
||||
"outbounds": [
|
||||
{
|
||||
"tag": "proxy",
|
||||
"protocol": "vmess", // 代理服务器
|
||||
"settings": {
|
||||
"vnext": [
|
||||
...
|
||||
]
|
||||
},
|
||||
"streamSettings": {
|
||||
"sockopt": {
|
||||
"mark": 255
|
||||
}
|
||||
},
|
||||
"mux": {
|
||||
"enabled": true
|
||||
}
|
||||
},
|
||||
{
|
||||
"tag": "direct",
|
||||
"protocol": "freedom",
|
||||
"settings": {
|
||||
"domainStrategy": "UseIP"
|
||||
},
|
||||
"streamSettings": {
|
||||
"sockopt": {
|
||||
"mark": 255
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"tag": "block",
|
||||
"protocol": "blackhole",
|
||||
"settings": {
|
||||
"response": {
|
||||
"type": "http"
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"tag": "dns-out",
|
||||
"protocol": "dns",
|
||||
"streamSettings": {
|
||||
"sockopt": {
|
||||
"mark": 255
|
||||
}
|
||||
}
|
||||
}
|
||||
],
|
||||
"dns": {
|
||||
"servers": [
|
||||
{
|
||||
"address": "223.5.5.5", //中国大陆域名使用阿里的 DNS
|
||||
"port": 53,
|
||||
"domains": [
|
||||
"geosite:cn",
|
||||
"ntp.org", // NTP 服务器
|
||||
"$myserver.address" // 此处改为你 VPS 的域名
|
||||
]
|
||||
},
|
||||
{
|
||||
"address": "114.114.114.114", //中国大陆域名使用 114 的 DNS (备用)
|
||||
"port": 53,
|
||||
"domains": [
|
||||
"geosite:cn",
|
||||
"ntp.org", // NTP 服务器
|
||||
"$myserver.address" // 此处改为你 VPS 的域名
|
||||
]
|
||||
},
|
||||
{
|
||||
"address": "8.8.8.8", //非中国大陆域名使用 Google 的 DNS
|
||||
"port": 53,
|
||||
"domains": [
|
||||
"geosite:geolocation-!cn"
|
||||
]
|
||||
},
|
||||
{
|
||||
"address": "1.1.1.1", //非中国大陆域名使用 Cloudflare 的 DNS
|
||||
"port": 53,
|
||||
"domains": [
|
||||
"geosite:geolocation-!cn"
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
"routing": {
|
||||
"domainStrategy": "IPOnDemand",
|
||||
"rules": [
|
||||
{ // 劫持 53 端口 UDP 流量,使用 V2Ray 的 DNS
|
||||
"type": "field",
|
||||
"inboundTag": [
|
||||
"transparent"
|
||||
],
|
||||
"port": 53,
|
||||
"network": "udp",
|
||||
"outboundTag": "dns-out"
|
||||
},
|
||||
{ // 直连 123 端口 UDP 流量(NTP 协议)
|
||||
"type": "field",
|
||||
"inboundTag": [
|
||||
"transparent"
|
||||
],
|
||||
"port": 123,
|
||||
"network": "udp",
|
||||
"outboundTag": "direct"
|
||||
},
|
||||
{
|
||||
"type": "field",
|
||||
"ip": [
|
||||
// 设置 DNS 配置中的国内 DNS 服务器地址直连,以达到 DNS 分流目的
|
||||
"223.5.5.5",
|
||||
"114.114.114.114"
|
||||
],
|
||||
"outboundTag": "direct"
|
||||
},
|
||||
{
|
||||
"type": "field",
|
||||
"ip": [
|
||||
// 设置 DNS 配置中的国外 DNS 服务器地址走代理,以达到 DNS 分流目的
|
||||
"8.8.8.8",
|
||||
"1.1.1.1"
|
||||
],
|
||||
"outboundTag": "proxy" // 改为你自己代理的出站 tag
|
||||
},
|
||||
{ // 广告拦截
|
||||
"type": "field",
|
||||
"domain": [
|
||||
"geosite:category-ads-all"
|
||||
],
|
||||
"outboundTag": "block"
|
||||
},
|
||||
{ // BT 流量直连
|
||||
"type": "field",
|
||||
"protocol":["bittorrent"],
|
||||
"outboundTag": "direct"
|
||||
},
|
||||
{ // 直连中国大陆主流网站 ip 和 保留 ip
|
||||
"type": "field",
|
||||
"ip": [
|
||||
"geoip:private",
|
||||
"geoip:cn"
|
||||
],
|
||||
"outboundTag": "direct"
|
||||
},
|
||||
{ // 直连中国大陆主流网站域名
|
||||
"type": "field",
|
||||
"domain": [
|
||||
"geosite:cn"
|
||||
],
|
||||
"outboundTag": "direct"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
150
v2ray示例/旁路由-透明代理/Xray透明代理配置/xray透明代理配置-1.json
Normal file
150
v2ray示例/旁路由-透明代理/Xray透明代理配置/xray透明代理配置-1.json
Normal file
@@ -0,0 +1,150 @@
|
||||
// 为了更好的分流体验,请替换默认路由规则文件为 Loyalsoldier/v2ray-rules-dat,否则 Xray-core 将无法加载本配置。
|
||||
//
|
||||
//sudo curl -oL /usr/local/share/xray/geoip.dat https://cdn.jsdelivr.net/gh/Loyalsoldier/v2ray-rules-dat@release/geoip.dat
|
||||
//sudo curl -oL /usr/local/share/xray/geosite.dat https://cdn.jsdelivr.net/gh/Loyalsoldier/v2ray-rules-dat@release/geosite.dat
|
||||
|
||||
// https://xtls.github.io/document/level-2/tproxy.html#xray-%E9%85%8D%E7%BD%AE
|
||||
{
|
||||
"log": {
|
||||
"loglevel": "warning",
|
||||
"error": "/var/log/xray/error.log",
|
||||
"access": "/var/log/xray/access.log"
|
||||
},
|
||||
"inbounds": [
|
||||
{
|
||||
"tag": "all-in",
|
||||
"port": 12345,
|
||||
"protocol": "dokodemo-door",
|
||||
"settings": {
|
||||
"network": "tcp,udp",
|
||||
"followRedirect": true
|
||||
},
|
||||
"sniffing": {
|
||||
"enabled": true,
|
||||
"destOverride": ["http", "tls"]
|
||||
},
|
||||
"streamSettings": {
|
||||
"sockopt": {
|
||||
"tproxy": "tproxy"
|
||||
}
|
||||
}
|
||||
}
|
||||
],
|
||||
"outbounds": [
|
||||
{
|
||||
"tag": "direct",
|
||||
"protocol": "freedom",
|
||||
"settings": {
|
||||
"domainStrategy": "UseIPv4"
|
||||
},
|
||||
"streamSettings": {
|
||||
"sockopt": {
|
||||
"mark": 2
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"tag": "proxy",
|
||||
"protocol": "vless",
|
||||
"settings": {
|
||||
"vnext": [
|
||||
{
|
||||
"address": "服务端域名",
|
||||
"port": 443,
|
||||
"users": [
|
||||
{
|
||||
"id": "UUID",
|
||||
"flow": "xtls-rprx-splice",
|
||||
"encryption": "none"
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
"streamSettings": {
|
||||
"network": "tcp",
|
||||
"security": "xtls",
|
||||
"sockopt": {
|
||||
"mark": 2
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"tag": "block",
|
||||
"protocol": "blackhole",
|
||||
"settings": {
|
||||
"response": {
|
||||
"type": "http"
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"tag": "dns-out",
|
||||
"protocol": "dns",
|
||||
"settings": {
|
||||
"address": "8.8.8.8"
|
||||
},
|
||||
"proxySettings": {
|
||||
"tag": "proxy"
|
||||
},
|
||||
"streamSettings": {
|
||||
"sockopt": {
|
||||
"mark": 2
|
||||
}
|
||||
}
|
||||
}
|
||||
],
|
||||
"dns": {
|
||||
"hosts": {
|
||||
"服务端域名": "服务端 IP"
|
||||
},
|
||||
"servers": [
|
||||
{
|
||||
"address": "119.29.29.29",
|
||||
"port": 53,
|
||||
"domains": ["geosite:cn"],
|
||||
"expectIPs": ["geoip:cn"]
|
||||
},
|
||||
{
|
||||
"address": "223.5.5.5",
|
||||
"port": 53,
|
||||
"domains": ["geosite:cn"],
|
||||
"expectIPs": ["geoip:cn"]
|
||||
},
|
||||
"8.8.8.8",
|
||||
"1.1.1.1",
|
||||
"https+local://doh.dns.sb/dns-query"
|
||||
]
|
||||
},
|
||||
"routing": {
|
||||
"domainStrategy": "IPIfNonMatch",
|
||||
"rules": [
|
||||
{
|
||||
"type": "field",
|
||||
"inboundTag": ["all-in"],
|
||||
"port": 53,
|
||||
"outboundTag": "dns-out"
|
||||
},
|
||||
{
|
||||
"type": "field",
|
||||
"ip": ["8.8.8.8", "1.1.1.1"],
|
||||
"outboundTag": "proxy"
|
||||
},
|
||||
{
|
||||
"type": "field",
|
||||
"domain": ["geosite:category-ads-all"],
|
||||
"outboundTag": "block"
|
||||
},
|
||||
{
|
||||
"type": "field",
|
||||
"domain": ["geosite:geolocation-!cn"],
|
||||
"outboundTag": "proxy"
|
||||
},
|
||||
{
|
||||
"type": "field",
|
||||
"ip": ["geoip:telegram"],
|
||||
"outboundTag": "proxy"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,40 @@
|
||||
{
|
||||
"tag": "proxy",
|
||||
"protocol": "vless",
|
||||
"settings": {
|
||||
"vnext": [
|
||||
{
|
||||
"address": "43.154.83.213",
|
||||
"port": 29999,
|
||||
"users": [
|
||||
{
|
||||
"id": "fc903f5d-a007-482b-928c-570da9a851f9",
|
||||
"alterId": 0,
|
||||
"email": "192.168.11.19@qq.com",
|
||||
"security": "auto",
|
||||
"encryption": "none",
|
||||
"flow": "xtls-rprx-direct"
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
"streamSettings": {
|
||||
"network": "tcp",
|
||||
"security": "xtls",
|
||||
"xtlsSettings": {
|
||||
"serverName": "tencent-hk-11.17.107421.xyz",
|
||||
"allowInsecure": true,
|
||||
"rejectUnknownSni": false,
|
||||
"alpn": [
|
||||
"h2",
|
||||
"http/1.1"
|
||||
],
|
||||
"minVersion": "1.2",
|
||||
"maxVersion": "1.3"
|
||||
},
|
||||
"sockopt": {
|
||||
"mark": 2
|
||||
}
|
||||
}
|
||||
}
|
||||
25
v2ray示例/旁路由-透明代理/Xray透明代理配置/更新geoip的脚本.sh
Normal file
25
v2ray示例/旁路由-透明代理/Xray透明代理配置/更新geoip的脚本.sh
Normal file
@@ -0,0 +1,25 @@
|
||||
#!/bin/bash
|
||||
|
||||
LogPath=/var/log/xray/geoip_update.log
|
||||
|
||||
|
||||
rm -rf /usr/local/share/xray/geosite.dat
|
||||
rm -rf /usr/local/share/xray/geoip.dat
|
||||
echo "current time is $(date), start to update geo ip for xray" >> $LogPath
|
||||
|
||||
curl --connect-timeout 5 -s -o /dev/null https://www.google.com
|
||||
if [[ $? -eq 0 ]];then
|
||||
echo "start to download from github !"
|
||||
wget https://github.com/Loyalsoldier/v2ray-rules-dat/releases/latest/download/geosite.dat -O /usr/local/share/xray/geosite.dat
|
||||
|
||||
wget https://github.com/Loyalsoldier/v2ray-rules-dat/releases/latest/download/geoip.dat -O /usr/local/share/xray/geoip.dat
|
||||
else
|
||||
echo "start to download from jsdelivr !"
|
||||
wget https://cdn.jsdelivr.net/gh/Loyalsoldier/v2ray-rules-dat@release/geosite.dat -O /usr/local/share/xray/geosite.dat
|
||||
|
||||
wget https://cdn.jsdelivr.net/gh/Loyalsoldier/v2ray-rules-dat@release/geoip.dat -O /usr/local/share/xray/geoip.dat
|
||||
fi
|
||||
|
||||
|
||||
echo "start to restrat xray !" >> $LogPath
|
||||
systemctl restart xray
|
||||
40
v2ray示例/旁路由-透明代理/Xray透明代理配置/香港Xray节点.json
Normal file
40
v2ray示例/旁路由-透明代理/Xray透明代理配置/香港Xray节点.json
Normal file
@@ -0,0 +1,40 @@
|
||||
{
|
||||
"tag": "proxy",
|
||||
"protocol": "vless",
|
||||
"settings": {
|
||||
"vnext": [
|
||||
{
|
||||
"address": "43.154.83.213",
|
||||
"port": 29999,
|
||||
"users": [
|
||||
{
|
||||
"id": "fc903f5d-a007-482b-928c-570da9a851f9",
|
||||
"alterId": 0,
|
||||
"email": "192.168.11.19@qq.com",
|
||||
"security": "auto",
|
||||
"encryption": "none",
|
||||
"flow": "xtls-rprx-direct"
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
"streamSettings": {
|
||||
"network": "tcp",
|
||||
"security": "xtls",
|
||||
"xtlsSettings": {
|
||||
"serverName": "tencent-hk-11.17.107421.xyz",
|
||||
"allowInsecure": true,
|
||||
"rejectUnknownSni": false,
|
||||
"alpn": [
|
||||
"h2",
|
||||
"http/1.1"
|
||||
],
|
||||
"minVersion": "1.2",
|
||||
"maxVersion": "1.3"
|
||||
},
|
||||
"sockopt": {
|
||||
"mark": 2
|
||||
}
|
||||
}
|
||||
}
|
||||
65
v2ray示例/旁路由-透明代理/iptbles规则/实际使用的透明代理-192.168.11.19.iptables
Normal file
65
v2ray示例/旁路由-透明代理/iptbles规则/实际使用的透明代理-192.168.11.19.iptables
Normal file
@@ -0,0 +1,65 @@
|
||||
# 设置策略路由
|
||||
# 添加路由表 100
|
||||
sudo ip route add local default dev lo table 100
|
||||
# 为路由表 100 设定规则
|
||||
ip rule add fwmark 1 table 100
|
||||
|
||||
|
||||
# 创建XRAY过滤器链
|
||||
iptables -t mangle -N XRAY
|
||||
|
||||
# 代理局域网设备
|
||||
iptables -t mangle -A XRAY -d 10.0.0.0/8 -j RETURN
|
||||
iptables -t mangle -A XRAY -d 100.64.0.0/10 -j RETURN
|
||||
iptables -t mangle -A XRAY -d 127.0.0.0/8 -j RETURN
|
||||
iptables -t mangle -A XRAY -d 169.254.0.0/16 -j RETURN
|
||||
iptables -t mangle -A XRAY -d 172.16.0.0/12 -j RETURN
|
||||
iptables -t mangle -A XRAY -d 192.0.0.0/24 -j RETURN
|
||||
iptables -t mangle -A XRAY -d 224.0.0.0/4 -j RETURN
|
||||
iptables -t mangle -A XRAY -d 240.0.0.0/4 -j RETURN
|
||||
iptables -t mangle -A XRAY -d 255.255.255.255/32 -j RETURN
|
||||
|
||||
# 直连局域网,避免 XRAY 无法启动时无法连网关的 SSH,如果你配置的是其他网段(如 10.x.x.x 等),则修改成自己的
|
||||
iptables -t mangle -A XRAY -d 192.168.0.0/16 -p tcp -j RETURN
|
||||
|
||||
# 直连局域网,53 端口除外(因为要使用 XRAY 的 DNS)
|
||||
iptables -t mangle -A XRAY -d 192.168.0.0/16 -p udp ! --dport 53 -j RETURN
|
||||
|
||||
# 直连 SO_MARK 为 0xff 的流量(0xff 是 16 进制数,数值上等同与上面XRAY 配置的 255),此规则目的是解决XRAY占用大量CPU(https://github.com/XRAY/XRAY-core/issues/2621)
|
||||
#iptables -t mangle -A XRAY -j RETURN -m mark --mark 0xff
|
||||
|
||||
# 给 UDP 打标记 1,转发至 12345 端口
|
||||
iptables -t mangle -A XRAY -p udp -j TPROXY --on-port 12345 --tproxy-mark 1
|
||||
# 给 TCP 打标记 1,转发至 12345 端口
|
||||
iptables -t mangle -A XRAY -p tcp -j TPROXY --on-port 12345 --tproxy-mark 1
|
||||
# 应用规则
|
||||
iptables -t mangle -A PREROUTING -j XRAY
|
||||
|
||||
|
||||
# 代理网关本机
|
||||
iptables -t mangle -N XRAY_SELF
|
||||
iptables -t mangle -A XRAY_SELF -d 10.0.0.0/8 -j RETURN
|
||||
iptables -t mangle -A XRAY_SELF -d 100.64.0.0/10 -j RETURN
|
||||
iptables -t mangle -A XRAY_SELF -d 127.0.0.0/8 -j RETURN
|
||||
iptables -t mangle -A XRAY_SELF -d 169.254.0.0/16 -j RETURN
|
||||
iptables -t mangle -A XRAY_SELF -d 172.16.0.0/12 -j RETURN
|
||||
iptables -t mangle -A XRAY_SELF -d 192.0.0.0/24 -j RETURN
|
||||
iptables -t mangle -A XRAY_SELF -d 224.0.0.0/4 -j RETURN
|
||||
iptables -t mangle -A XRAY_SELF -d 240.0.0.0/4 -j RETURN
|
||||
iptables -t mangle -A XRAY_SELF -d 255.255.255.255/32 -j RETURN
|
||||
|
||||
iptables -t mangle -A XRAY_SELF -d 192.168.0.0/16 -p tcp -j RETURN # 直连局域网
|
||||
# 直连局域网,53 端口除外(因为要使用 XRAY 的 DNS)
|
||||
iptables -t mangle -A XRAY_SELF -d 192.168.0.0/16 -p udp ! --dport 53 -j RETURN
|
||||
|
||||
# 直连 SO_MARK 为 0xff 的流量(0xff 是 16 进制数,数值上等同与上面XRAY 配置的 255),此规则目的是避免代理本机(网关)流量出现回环问题
|
||||
#iptables -t mangle -A XRAY_SELF -m mark --mark 0xff -j RETURN
|
||||
|
||||
iptables -t mangle -A XRAY_SELF -m mark --mark 2 -j RETURN
|
||||
|
||||
# 给 UDP 打标记,重路由
|
||||
iptables -t mangle -A XRAY_SELF -p udp -j MARK --set-mark 1
|
||||
# 给 TCP 打标记,重路由
|
||||
iptables -t mangle -A XRAY_SELF -p tcp -j MARK --set-mark 1
|
||||
# 应用规则
|
||||
iptables -t mangle -A OUTPUT -j XRAY_SELF
|
||||
14
v2ray示例/旁路由-透明代理/iptbles规则/转发tailscale的33389端口的流量.iptables
Normal file
14
v2ray示例/旁路由-透明代理/iptbles规则/转发tailscale的33389端口的流量.iptables
Normal file
@@ -0,0 +1,14 @@
|
||||
iptables -t nat -A PREROUTING -p tcp --dport 3389 -j DNAT --to 192.168.126.37
|
||||
|
||||
iptables -t nat -A PREROUTING -p udp --dport 3389 -j DNAT --to 192.168.126.37
|
||||
|
||||
|
||||
iptables -t nat -A PREROUTING -p tcp --dport 3389 -j DNAT --to 192.168.126.41
|
||||
|
||||
iptables -t nat -A PREROUTING -p udp --dport 3389 -j DNAT --to 192.168.126.41
|
||||
|
||||
|
||||
|
||||
## tenda router
|
||||
iptables -t nat -A PREROUTING -p tcp --dport 3389 -j DNAT --to 192.168.126.32
|
||||
iptables -t nat -A PREROUTING -p udp --dport 3389 -j DNAT --to 192.168.126.32
|
||||
32
v2ray示例/旁路由-透明代理/iptbles规则/透明代理-v2ray官方.iptables
Normal file
32
v2ray示例/旁路由-透明代理/iptbles规则/透明代理-v2ray官方.iptables
Normal file
@@ -0,0 +1,32 @@
|
||||
# 设置策略路由
|
||||
ip rule add fwmark 1 table 100
|
||||
ip route add local 0.0.0.0/0 dev lo table 100
|
||||
|
||||
# 代理局域网设备
|
||||
iptables -t mangle -N V2RAY
|
||||
iptables -t mangle -A V2RAY -d 127.0.0.1/32 -j RETURN
|
||||
iptables -t mangle -A V2RAY -d 224.0.0.0/4 -j RETURN
|
||||
iptables -t mangle -A V2RAY -d 255.255.255.255/32 -j RETURN
|
||||
iptables -t mangle -A V2RAY -d 192.168.0.0/16 -p tcp -j RETURN # 直连局域网,避免 V2Ray 无法启动时无法连网关的 SSH,如果你配置的是其他网段(如 10.x.x.x 等),则修改成自己的
|
||||
iptables -t mangle -A V2RAY -d 192.168.0.0/16 -p udp ! --dport 53 -j RETURN # 直连局域网,53 端口除外(因为要使用 V2Ray 的 DNS)
|
||||
iptables -t mangle -A V2RAY -j RETURN -m mark --mark 0xff # 直连 SO_MARK 为 0xff 的流量(0xff 是 16 进制数,数值上等同与上面V2Ray 配置的 255),此规则目的是解决v2ray占用大量CPU(https://github.com/v2ray/v2ray-core/issues/2621)
|
||||
iptables -t mangle -A V2RAY -p udp -j TPROXY --on-ip 127.0.0.1 --on-port 12345 --tproxy-mark 1 # 给 UDP 打标记 1,转发至 12345 端口
|
||||
iptables -t mangle -A V2RAY -p tcp -j TPROXY --on-ip 127.0.0.1 --on-port 12345 --tproxy-mark 1 # 给 TCP 打标记 1,转发至 12345 端口
|
||||
iptables -t mangle -A PREROUTING -j V2RAY # 应用规则
|
||||
|
||||
# 代理网关本机
|
||||
iptables -t mangle -N V2RAY_MASK
|
||||
iptables -t mangle -A V2RAY_MASK -d 224.0.0.0/4 -j RETURN
|
||||
iptables -t mangle -A V2RAY_MASK -d 255.255.255.255/32 -j RETURN
|
||||
iptables -t mangle -A V2RAY_MASK -d 192.168.0.0/16 -p tcp -j RETURN # 直连局域网
|
||||
iptables -t mangle -A V2RAY_MASK -d 192.168.0.0/16 -p udp ! --dport 53 -j RETURN # 直连局域网,53 端口除外(因为要使用 V2Ray 的 DNS)
|
||||
iptables -t mangle -A V2RAY_MASK -j RETURN -m mark --mark 0xff # 直连 SO_MARK 为 0xff 的流量(0xff 是 16 进制数,数值上等同与上面V2Ray 配置的 255),此规则目的是避免代理本机(网关)流量出现回环问题
|
||||
iptables -t mangle -A V2RAY_MASK -p udp -j MARK --set-mark 1 # 给 UDP 打标记,重路由
|
||||
iptables -t mangle -A V2RAY_MASK -p tcp -j MARK --set-mark 1 # 给 TCP 打标记,重路由
|
||||
iptables -t mangle -A OUTPUT -j V2RAY_MASK # 应用规则
|
||||
|
||||
# 新建 DIVERT 规则,避免已有连接的包二次通过 TPROXY,理论上有一定的性能提升
|
||||
iptables -t mangle -N DIVERT
|
||||
iptables -t mangle -A DIVERT -j MARK --set-mark 1
|
||||
iptables -t mangle -A DIVERT -j ACCEPT
|
||||
iptables -t mangle -I PREROUTING -p tcp -m socket -j DIVERT
|
||||
40
v2ray示例/旁路由-透明代理/iptbles规则/透明代理-xray官方.iptables
Normal file
40
v2ray示例/旁路由-透明代理/iptbles规则/透明代理-xray官方.iptables
Normal file
@@ -0,0 +1,40 @@
|
||||
sudo ip route add local default dev lo table 100 # 添加路由表 100
|
||||
sudo ip rule add fwmark 1 table 100 # 为路由表 100 设定规则
|
||||
|
||||
iptables -t mangle -N XRAY
|
||||
iptables -t mangle -A XRAY -d 10.0.0.0/8 -j RETURN
|
||||
iptables -t mangle -A XRAY -d 100.64.0.0/10 -j RETURN
|
||||
iptables -t mangle -A XRAY -d 127.0.0.0/8 -j RETURN
|
||||
iptables -t mangle -A XRAY -d 169.254.0.0/16 -j RETURN
|
||||
iptables -t mangle -A XRAY -d 172.16.0.0/12 -j RETURN
|
||||
iptables -t mangle -A XRAY -d 192.0.0.0/24 -j RETURN
|
||||
iptables -t mangle -A XRAY -d 224.0.0.0/4 -j RETURN
|
||||
iptables -t mangle -A XRAY -d 240.0.0.0/4 -j RETURN
|
||||
iptables -t mangle -A XRAY -d 255.255.255.255/32 -j RETURN
|
||||
|
||||
iptables -t mangle -A XRAY -d 192.168.0.0/16 -p tcp ! --dport 53 -j RETURN
|
||||
iptables -t mangle -A XRAY -d 192.168.0.0/16 -p udp ! --dport 53 -j RETURN
|
||||
|
||||
iptables -t mangle -A XRAY -p tcp -j TPROXY --on-port 12345 --tproxy-mark 1
|
||||
iptables -t mangle -A XRAY -p udp -j TPROXY --on-port 12345 --tproxy-mark 1
|
||||
iptables -t mangle -A PREROUTING -j XRAY
|
||||
|
||||
iptables -t mangle -N XRAY_SELF
|
||||
iptables -t mangle -A XRAY_SELF -d 10.0.0.0/8 -j RETURN
|
||||
iptables -t mangle -A XRAY_SELF -d 100.64.0.0/10 -j RETURN
|
||||
iptables -t mangle -A XRAY_SELF -d 127.0.0.0/8 -j RETURN
|
||||
iptables -t mangle -A XRAY_SELF -d 169.254.0.0/16 -j RETURN
|
||||
iptables -t mangle -A XRAY_SELF -d 172.16.0.0/12 -j RETURN
|
||||
iptables -t mangle -A XRAY_SELF -d 192.0.0.0/24 -j RETURN
|
||||
iptables -t mangle -A XRAY_SELF -d 224.0.0.0/4 -j RETURN
|
||||
iptables -t mangle -A XRAY_SELF -d 240.0.0.0/4 -j RETURN
|
||||
iptables -t mangle -A XRAY_SELF -d 255.255.255.255/32 -j RETURN
|
||||
|
||||
iptables -t mangle -A XRAY_SELF -d 192.168.0.0/16 -p tcp ! --dport 53 -j RETURN
|
||||
iptables -t mangle -A XRAY_SELF -d 192.168.0.0/16 -p udp ! --dport 53 -j RETURN
|
||||
|
||||
iptables -t mangle -A XRAY_SELF -m mark --mark 2 -j RETURN
|
||||
iptables -t mangle -A XRAY_SELF -p tcp -j MARK --set-mark 1
|
||||
iptables -t mangle -A XRAY_SELF -p udp -j MARK --set-mark 1
|
||||
|
||||
iptables -t mangle -A OUTPUT -j XRAY_SELF
|
||||
0
v2ray示例/旁路由-透明代理/基于xray-splice转发的透明代理配置.json
Normal file
0
v2ray示例/旁路由-透明代理/基于xray-splice转发的透明代理配置.json
Normal file
35
v2ray示例/路由转发内核优化.sh
Normal file
35
v2ray示例/路由转发内核优化.sh
Normal file
@@ -0,0 +1,35 @@
|
||||
#!/bin/bash
|
||||
|
||||
kernel_config_file=/etc/sysctl.d/import_kernel.conf
|
||||
|
||||
cat >> ${kernel_config_file} <<EOF
|
||||
# 开启bbr
|
||||
net.ipv4.tcp_fastopen = 3
|
||||
net.core.default_qdisc = fq
|
||||
net.ipv4.tcp_congestion_control = bbr
|
||||
#增加缓冲区大小可以提高吞吐量
|
||||
net.core.rmem_max = 16777216
|
||||
net.core.wmem_max = 16777216
|
||||
#缩短超时时间可以提高响应速度。
|
||||
net.ipv4.tcp_fin_timeout = 15
|
||||
net.ipv4.tcp_keepalive_time = 1200
|
||||
net.ipv4.tcp_keepalive_probes = 5
|
||||
net.ipv4.tcp_keepalive_intvl = 15
|
||||
# 避免IP碎片化可以提高性能。
|
||||
net.ipv4.ipfrag_low_thresh = 65536
|
||||
net.ipv4.ipfrag_high_thresh = 131072
|
||||
# TCP SACK(选择确认)在路由器环境中通常不必要。
|
||||
net.ipv4.tcp_sack = 0
|
||||
# 快速转发可以提高转发性能。
|
||||
net.ipv4.ip_forward_fast_path = 1
|
||||
# 禁用日志记录可以节省资源。
|
||||
net.ipv4.conf.all.log_martians = 0
|
||||
net.ipv4.conf.default.log_martians = 0
|
||||
net.ipv4.route.flush=1
|
||||
# 缩短ARP超时时间可以提高ARP响应速度。
|
||||
net.ipv4.neigh.default.gc_stale_time = 120
|
||||
# 增加哈希表大小可以提高路由查找性能。
|
||||
net.ipv4.neigh.default.hash_buckets = 1024
|
||||
EOF
|
||||
|
||||
sysctl -p ${kernel_config_file}
|
||||
126
v2ray示例/香港节点/分层代理回落.json
Normal file
126
v2ray示例/香港节点/分层代理回落.json
Normal file
@@ -0,0 +1,126 @@
|
||||
{
|
||||
"log": {
|
||||
"loglevel": "debug"
|
||||
},
|
||||
"inbounds": [
|
||||
{
|
||||
"port": 443,
|
||||
"protocol": "vless",
|
||||
"settings": {
|
||||
"clients": [
|
||||
{
|
||||
"id": "b4bdf874-8c03-5bd8-8fd7-5e409dfd82c0",
|
||||
"flow": "xtls-rprx-vision"
|
||||
}
|
||||
],
|
||||
"decryption": "none",
|
||||
"fallbacks": [
|
||||
{
|
||||
"name": "xx.tc.hk.go.107421.xyz",
|
||||
"path": "/status",
|
||||
"dest": 5000,
|
||||
"xver": 1
|
||||
},
|
||||
{
|
||||
"name": "book.107421.xyz",
|
||||
"dest": 5003,
|
||||
"xver": 1
|
||||
},
|
||||
{
|
||||
"name": "book.107421.xyz",
|
||||
"alpn": "h2",
|
||||
"dest": 5004,
|
||||
"xver": 1
|
||||
},
|
||||
{
|
||||
"dest": 5001,
|
||||
"xver": 1
|
||||
},
|
||||
{
|
||||
"alpn": "h2",
|
||||
"dest": 5002,
|
||||
"xver": 1
|
||||
}
|
||||
]
|
||||
},
|
||||
"streamSettings": {
|
||||
"network": "tcp",
|
||||
"security": "tls",
|
||||
"tlsSettings": {
|
||||
"alpn": ["h2", "http/1.1"],
|
||||
"certificates": [
|
||||
{
|
||||
"certificateFile": "/root/.acme.sh/book.107421.xyz_ecc/fullchain.cer",
|
||||
"keyFile": "/root/.acme.sh/book.107421.xyz_ecc/book.107421.xyz.key"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"port": 5000,
|
||||
"listen": "127.0.0.1",
|
||||
"protocol": "vless",
|
||||
"settings": {
|
||||
"clients": [
|
||||
{
|
||||
"id": "481d1403-de9a-5ae1-b921-18c04a4a9da0",
|
||||
"level": 0,
|
||||
"email": "dd@qq.com"
|
||||
}
|
||||
],
|
||||
"decryption": "none"
|
||||
},
|
||||
"streamSettings": {
|
||||
"network": "ws",
|
||||
"security": "tls",
|
||||
"wsSettings": {
|
||||
"acceptProxyProtocol": true,
|
||||
"path": "/status"
|
||||
},
|
||||
"tlsSettings": {
|
||||
"alpn": ["h2", "http/1.1"],
|
||||
"certificates": [
|
||||
{
|
||||
"certificateFile": "/root/.acme.sh/xx.tc.hk.go.107421.xyz_ecc/fullchain.cer",
|
||||
"keyFile": "/root/.acme.sh/xx.tc.hk.go.107421.xyz_ecc/xx.tc.hk.go.107421.xyz.key"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"listen": "0.0.0.0",
|
||||
"port": 29999,
|
||||
"protocol": "trojan",
|
||||
"settings": {
|
||||
"clients": [
|
||||
{
|
||||
"password": "V2ryStr0ngP0ss"
|
||||
}
|
||||
]
|
||||
},
|
||||
"streamSettings": {
|
||||
"network": "tcp",
|
||||
"security": "tls",
|
||||
"tlsSettings": {
|
||||
"alpn": [
|
||||
"h2",
|
||||
"http/1.1"
|
||||
],
|
||||
"certificates": [
|
||||
{
|
||||
"certificateFile": "/root/.acme.sh/xx.tc.hk.go.107421.xyz_ecc/fullchain.cer",
|
||||
"keyFile": "/root/.acme.sh/xx.tc.hk.go.107421.xyz_ecc/xx.tc.hk.go.107421.xyz.key"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
],
|
||||
"outbounds": [
|
||||
{
|
||||
"protocol": "freedom"
|
||||
}
|
||||
]
|
||||
}
|
||||
19
v2ray示例/香港节点/在线安装nginx.sh
Normal file
19
v2ray示例/香港节点/在线安装nginx.sh
Normal file
@@ -0,0 +1,19 @@
|
||||
#!/bin/bash
|
||||
|
||||
|
||||
sudo apt install -y curl gnupg2 ca-certificates lsb-release ubuntu-keyring
|
||||
|
||||
curl https://nginx.org/keys/nginx_signing.key | gpg --dearmor \
|
||||
| sudo tee /usr/share/keyrings/nginx-archive-keyring.gpg >/dev/null
|
||||
|
||||
gpg --dry-run --quiet --no-keyring --import --import-options import-show /usr/share/keyrings/nginx-archive-keyring.gpg
|
||||
|
||||
echo "deb [signed-by=/usr/share/keyrings/nginx-archive-keyring.gpg] \
|
||||
http://nginx.org/packages/ubuntu `lsb_release -cs` nginx" \
|
||||
| sudo tee /etc/apt/sources.list.d/nginx.list
|
||||
|
||||
echo -e "Package: *\nPin: origin nginx.org\nPin: release o=nginx\nPin-Priority: 900\n" \
|
||||
| sudo tee /etc/apt/preferences.d/99nginx
|
||||
|
||||
sudo apt update
|
||||
sudo apt install -y nginx
|
||||
68
v2ray示例/香港节点/清除腾讯云Agent.sh
Normal file
68
v2ray示例/香港节点/清除腾讯云Agent.sh
Normal file
@@ -0,0 +1,68 @@
|
||||
|
||||
|
||||
green "正在删除防火墙。。。"
|
||||
ufw disable
|
||||
apt -y purge firewalld
|
||||
apt -y purge ufw
|
||||
systemctl stop firewalld
|
||||
systemctl disable firewalld
|
||||
$redhat_package_manager -y remove firewalld
|
||||
green "正在删除阿里云盾和腾讯云盾 (仅对阿里云和腾讯云服务器有效)。。。"
|
||||
#阿里云盾
|
||||
if [ $release == "ubuntu" ] || [ $release == "other-debian" ]; then
|
||||
systemctl stop CmsGoAgent
|
||||
systemctl disable CmsGoAgent
|
||||
rm -rf /usr/local/cloudmonitor
|
||||
rm -rf /etc/systemd/system/CmsGoAgent.service
|
||||
systemctl daemon-reload
|
||||
else
|
||||
systemctl stop cloudmonitor
|
||||
/etc/rc.d/init.d/cloudmonitor remove
|
||||
rm -rf /usr/local/cloudmonitor
|
||||
systemctl daemon-reload
|
||||
fi
|
||||
|
||||
systemctl stop aliyun
|
||||
systemctl disable aliyun
|
||||
rm -rf /etc/systemd/system/aliyun.service
|
||||
systemctl daemon-reload
|
||||
apt -y purge aliyun-assist
|
||||
$redhat_package_manager -y remove aliyun_assist
|
||||
rm -rf /usr/local/share/aliyun-assist
|
||||
rm -rf /usr/sbin/aliyun_installer
|
||||
rm -rf /usr/sbin/aliyun-service
|
||||
rm -rf /usr/sbin/aliyun-service.backup
|
||||
|
||||
pkill -9 AliYunDun
|
||||
pkill -9 AliHids
|
||||
/etc/init.d/aegis uninstall
|
||||
rm -rf /usr/local/aegis
|
||||
rm -rf /etc/init.d/aegis
|
||||
rm -rf /etc/rc2.d/S80aegis
|
||||
rm -rf /etc/rc3.d/S80aegis
|
||||
rm -rf /etc/rc4.d/S80aegis
|
||||
rm -rf /etc/rc5.d/S80aegis
|
||||
#腾讯云盾
|
||||
/usr/local/qcloud/stargate/admin/uninstall.sh
|
||||
/usr/local/qcloud/YunJing/uninst.sh
|
||||
/usr/local/qcloud/monitor/barad/admin/uninstall.sh
|
||||
systemctl daemon-reload
|
||||
systemctl stop YDService
|
||||
systemctl disable YDService
|
||||
rm -rf /lib/systemd/system/YDService.service
|
||||
systemctl daemon-reload
|
||||
sed -i 's#/usr/local/qcloud#rcvtevyy4f5d#g' /etc/rc.local
|
||||
sed -i '/rcvtevyy4f5d/d' /etc/rc.local
|
||||
rm -rf $(find /etc/udev/rules.d -iname *qcloud* 2>/dev/null)
|
||||
pkill -9 YDService
|
||||
pkill -9 YDLive
|
||||
pkill -9 sgagent
|
||||
pkill -9 /usr/local/qcloud
|
||||
pkill -9 barad_agent
|
||||
rm -rf /usr/local/qcloud
|
||||
rm -rf /usr/local/yd.socket.client
|
||||
rm -rf /usr/local/yd.socket.server
|
||||
mkdir /usr/local/qcloud
|
||||
mkdir /usr/local/qcloud/action
|
||||
mkdir /usr/local/qcloud/action/login_banner.sh
|
||||
mkdir /usr/local/qcloud/action/action.sh
|
||||
14
v2ray示例/香港节点/生成证书.sh
Normal file
14
v2ray示例/香港节点/生成证书.sh
Normal file
@@ -0,0 +1,14 @@
|
||||
#!/bin/bash
|
||||
|
||||
export DOMAIN_NAME=xx.tc.hk.go.107421.xyz
|
||||
export DOMAIN_NAME=book.107421.xyz
|
||||
|
||||
export CF_Token="oXJRP5XI8Zhipa_PtYtB_jy6qWL0I9BosrJEYE8p"
|
||||
export CF_Account_ID="dfaadeb83406ef5ad35da02617af9191"
|
||||
export CF_Zone_ID="511894a4f1357feb905e974e16241ebb"
|
||||
|
||||
acme.sh --issue --dns dns_cf -d ${DOMAIN_NAME} --keylength ec-256
|
||||
acme.sh --install-cert -d ${DOMAIN_NAME} --ecc \
|
||||
--key-file /etc/nginx/conf.d/ssl_key/${DOMAIN_NAME}.key.pem \
|
||||
--fullchain-file /etc/nginx/conf.d/ssl_key/${DOMAIN_NAME}.cert.pem \
|
||||
--reloadcmd "systemctl restart nginx --force"
|
||||
Reference in New Issue
Block a user