From: Tianling Shen Date: Wed, 3 Feb 2021 15:22:14 +0000 (+0800) Subject: xray-core: add example configs X-Git-Url: http://git.cdn.openwrt.org/?a=commitdiff_plain;h=c8c2564012aae4f19434b69cbdeb868f9d84a9d8;p=feed%2Fpackages.git xray-core: add example configs Thry're from v2fly/v2ray-core wikis, used as examples. Signed-off-by: Tianling Shen --- diff --git a/net/xray-core/Makefile b/net/xray-core/Makefile index 2fdbdafd70..f886985f49 100644 --- a/net/xray-core/Makefile +++ b/net/xray-core/Makefile @@ -40,10 +40,18 @@ define Package/xray-core PROVIDES:=v2ray-core endef +define Package/xray-example + $(call Package/xray/template) + TITLE+= (example configs) + DEPENDS:=xray-core + PKGARCH:=all +endef + define Package/xray-geodata $(call Package/xray/template) TITLE+= (geodata files) DEPENDS:=xray-core + PKGARCH:=all endef define Package/xray/description @@ -55,6 +63,12 @@ define Package/xray-core/description $(call Package/xray/description) endef +define Package/xray-example/description + $(call Package/xray/description) + + This includes example configuration files for xray-core. +endef + define Package/xray-geodata/description $(call Package/xray/description) @@ -97,6 +111,12 @@ define Package/xray-core/install $(LN) xray $(1)/usr/bin/v2ray endef +define Package/xray-example/install + $(INSTALL_DIR) $(1)/etc/xray/ + $(INSTALL_CONF) $(CURDIR)/files/vpoint_socks_vmess.json $(1)/etc/xray/ + $(INSTALL_CONF) $(CURDIR)/files/vpoint_vmess_freedom.json $(1)/etc/xray/ +endef + define Package/xray-geodata/install $(INSTALL_DIR) $(1)/usr/share/xray/ $(INSTALL_DATA) $(DL_DIR)/$(GEOIP_FILE) $(1)/usr/share/xray/geoip.dat @@ -104,4 +124,5 @@ define Package/xray-geodata/install endef $(eval $(call BuildPackage,xray-core)) +$(eval $(call BuildPackage,xray-example)) $(eval $(call BuildPackage,xray-geodata)) diff --git a/net/xray-core/files/vpoint_socks_vmess.json b/net/xray-core/files/vpoint_socks_vmess.json new file mode 100644 index 0000000000..789cd270af --- /dev/null +++ b/net/xray-core/files/vpoint_socks_vmess.json @@ -0,0 +1,25 @@ +{ + "log": { + "loglevel": "warning" + }, + "inbounds": [{ + "port": 1080, + "listen": "127.0.0.1", + "protocol": "socks", + "settings": { + "auth": "noauth", + "udp": false, + "ip": "127.0.0.1" + } + }], + "outbounds": [{ + "protocol": "freedom", + "settings": {}, + "tag": "direct" + }], + "policy": { + "levels": { + "0": {"uplinkOnly": 0} + } + } +} diff --git a/net/xray-core/files/vpoint_vmess_freedom.json b/net/xray-core/files/vpoint_vmess_freedom.json new file mode 100644 index 0000000000..de51e9f240 --- /dev/null +++ b/net/xray-core/files/vpoint_vmess_freedom.json @@ -0,0 +1,32 @@ +{ + "inbounds": [{ + "port": 10086, + "protocol": "vmess", + "settings": { + "clients": [ + { + "id": "23ad6b10-8d1a-40f7-8ad0-e3e35cd38297", + "level": 1, + "alterId": 64 + } + ] + } + }], + "outbounds": [{ + "protocol": "freedom", + "settings": {} + },{ + "protocol": "blackhole", + "settings": {}, + "tag": "blocked" + }], + "routing": { + "rules": [ + { + "type": "field", + "ip": ["geoip:private"], + "outboundTag": "blocked" + } + ] + } +}