summaryrefslogtreecommitdiff
path: root/roles/xray/templates/config.json.j2
diff options
context:
space:
mode:
Diffstat (limited to 'roles/xray/templates/config.json.j2')
-rw-r--r--roles/xray/templates/config.json.j2131
1 files changed, 131 insertions, 0 deletions
diff --git a/roles/xray/templates/config.json.j2 b/roles/xray/templates/config.json.j2
new file mode 100644
index 00000000..35e78b75
--- /dev/null
+++ b/roles/xray/templates/config.json.j2
@@ -0,0 +1,131 @@
+{
+ "log": {
+ "loglevel": "debug",
+ "access": "/logs/xray-access.log",
+ "error": "/logs/xray-error.log",
+ "dnsLog": false
+ },
+ "stats": {},
+ "api": {
+ "tag": "api",
+ "services": [
+ "StatsService"
+ ]
+ },
+ "policy": {
+ "levels": {
+ "0": {
+ "statsUserUplink": true,
+ "statsUserDownlink": true
+ }
+ }
+ },
+ "inbounds": [
+{% if inventory_hostname in (groups['trojan']|default([])) + (groups['all_vpns']|default([])) %}
+ {
+ "listen": "0.0.0.0",
+ "port": {{ trojan_port|default(4436) }},
+ "protocol": "trojan",
+ "settings": {
+ "clients": []
+ },
+ "streamSettings": {
+ "network": "tcp",
+ "security": "reality",
+ "realitySettings": {
+ "show": false,
+ "dest": "behindthename.com:443",
+ "serverNames": [
+ "behindthename.com",
+ "www.behindthename.com"
+ ],
+ "xver": 0,
+ "privateKey": "{{ xray_private_key }}",
+ "maxTimeDiff": 0,
+ "shortIds": [""]
+ }
+ }
+ },
+{% endif %}
+{% if inventory_hostname in (groups['vless']|default([])) + (groups['all_vpns']|default([])) %}
+ {
+ "listen": "0.0.0.0",
+ "port": {{ vless_port|default(4437) }},
+ "protocol": "vless",
+ "settings": {
+ "decryption": "none",
+ "clients": []
+ },
+ "streamSettings": {
+ "network": "tcp",
+ "security": "reality",
+ "realitySettings": {
+ "show": false,
+ "dest": "behindthename.com:443",
+ "serverNames": [
+ "behindthename.com",
+ "www.behindthename.com"
+ ],
+ "xver": 0,
+ "privateKey": "{{ xray_private_key }}",
+ "maxTimeDiff": 0,
+ "shortIds": [""]
+ }
+ }
+ },
+{% endif %}
+{% if inventory_hostname in (groups['vmess']|default([])) + (groups['all_vpns']|default([])) %}
+ {
+ "listen": "0.0.0.0",
+ "port": {{ vmess_port|default(4438) }},
+ "protocol": "vmess",
+ "settings": {
+ "clients": []
+ },
+ "streamSettings": {
+ "network": "tcp",
+ "security": "reality",
+ "realitySettings": {
+ "show": false,
+ "dest": "behindthename.com:443",
+ "serverNames": [
+ "behindthename.com",
+ "www.behindthename.com"
+ ],
+ "xver": 0,
+ "privateKey": "{{ xray_private_key }}",
+ "maxTimeDiff": 0,
+ "shortIds": [""]
+ }
+ }
+ },
+{% endif %}
+ {
+ "listen": "127.0.0.1",
+ "port": 10085,
+ "protocol": "dokodemo-door",
+ "settings": {
+ "address": "127.0.0.1"
+ },
+ "tag": "api"
+ }
+ ],
+ "outbounds": [
+ {
+ "protocol": "freedom",
+ "tag": "direct"
+ }
+ ],
+ "routing": {
+ "rules": [
+ {
+ "inboundTag": [
+ "api"
+ ],
+ "outboundTag": "api",
+ "type": "field"
+ }
+ ]
+ }
+}
+