-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
9eb562e
commit d462bb5
Showing
8 changed files
with
160 additions
and
19 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
|
||
- name: Create user's directory | ||
file: | ||
path: "{{ users_configs_static_root_local }}/{{ users_configs_user_uuid }}" | ||
state: directory | ||
|
||
- name: Render hiddify config | ||
template: | ||
src: hiddify.j2 | ||
dest: "{{ users_configs_static_root_local }}/{{ users_configs_user_uuid }}/{{ user_configs_hiddify_filename }}" | ||
|
||
- name: Render hiddify config (index.html for backward compatibility) | ||
template: | ||
src: hiddify.j2 | ||
dest: "{{ users_configs_static_root_local }}/{{ users_configs_user_uuid }}/index.html" | ||
|
||
- name: Render client configs | ||
template: | ||
src: client-xray-config.json.j2 | ||
dest: "{{ users_configs_static_root_local }}/{{ users_configs_user_uuid }}/{{ user_configs_client_xray_config_filename }}" | ||
|
||
- name: Render urls map | ||
template: | ||
src: urls-map.json.j2 | ||
dest: "{{ users_configs_static_root_local }}/{{ users_configs_user_uuid }}/{{ users_configs_urls_map_filename }}" |
120 changes: 120 additions & 0 deletions
120
roles/users-configs/templates/client-xray-config.json.j2
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,120 @@ | ||
{ | ||
"inbounds": [ | ||
{ | ||
"tag": "inbound", | ||
"listen": "0.0.0.0", | ||
"port": 1080, | ||
"protocol": "socks", | ||
"settings": { | ||
"auth": "noauth", | ||
"udp": false | ||
}, | ||
"streamSettings": { | ||
"network": "raw", | ||
"security": "none" | ||
} | ||
} | ||
], | ||
"outbounds": [ | ||
{% for server_item in users_configs_servers | dict2items %} | ||
{% set users_configs_server_uuid = server_item.key %} | ||
{% set users_configs_server = server_item.value %} | ||
{% set server_index = loop.index %} | ||
|
||
{% for sni, fingerprint in users_configs_server.supported_snis | product(users_configs_server.fingerprints) %} | ||
{ | ||
"protocol": "vless", | ||
"sendThrough": "0.0.0.0", | ||
"settings": { | ||
"vnext": [ | ||
{ | ||
"address": "{{ users_configs_server.host }}", | ||
"port": {{ users_configs_server.port }}, | ||
"users": [ | ||
{ | ||
"id": "{{ users_configs_user_uuid }}", | ||
"encryption": "none", | ||
"flow": "{{ users_configs_server.flow }}", | ||
"level": 0 | ||
} | ||
] | ||
} | ||
] | ||
}, | ||
"tag": "outbound-vless-{{ server_index }}-{{ loop.index }}-{{ users_configs_server.name | urlencode }}", | ||
"streamSettings": { | ||
"network": "tcp", | ||
"security": "reality", | ||
"realitySettings": { | ||
"fingerprint": "{{ fingerprint }}", | ||
"serverName": "{{ sni }}", | ||
"publicKey": "{{ users_configs_server.public_key }}", | ||
"spiderX": "/&", | ||
"shortId": "" | ||
} | ||
} | ||
}, | ||
{% endfor %} | ||
{% endfor %} | ||
{ | ||
"tag": "outbound-freedom", | ||
"protocol": "freedom" | ||
} | ||
], | ||
"routing": { | ||
"domainStrategy": "AsIs", | ||
"domainMatcher": "hybrid", | ||
"rules": [ | ||
{ | ||
"inboundTag": [ | ||
"inbound" | ||
], | ||
"outboundTag": "outbound-freedom", | ||
"domain": [ | ||
"geosite:category-ru", | ||
"geosite:microsoft" | ||
] | ||
}, | ||
{ | ||
"inboundTag": [ | ||
"inbound" | ||
], | ||
"outboundTag": "outbound-freedom", | ||
"ip": [ | ||
"geoip:private", | ||
"geoip:ru" | ||
] | ||
}, | ||
{ | ||
"inboundTag": [ | ||
"inbound" | ||
], | ||
"balancerTag": "balancer" | ||
} | ||
], | ||
"balancers": [ | ||
{ | ||
"tag": "balancer", | ||
"selector": [ | ||
"outbound-vless" | ||
], | ||
"strategy": { | ||
"type": "leastLoad", | ||
"settings": {} | ||
} | ||
} | ||
] | ||
}, | ||
"burstObservatory": { | ||
"subjectSelector":[ | ||
"outbound" | ||
], | ||
"pingConfig": { | ||
"destination": "https://connectivitycheck.gstatic.com/generate_204", | ||
"connectivity": "", | ||
"interval": "1h", | ||
"sampling": 3, | ||
"timeout": "30s" | ||
} | ||
} | ||
} |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
{ | ||
{% set instruction_url = '/' + users_configs_instruction_filename + '#' + users_configs_user_uuid %} | ||
"{{ user_configs_instruction_url_field_name }}": "{{ instruction_url }}", | ||
"instruction_url": "{{ instruction_url }}", | ||
"xray_client_config_url": "/{{ users_configs_user_uuid }}/{{ user_configs_client_xray_config_filename }}", | ||
"hiddify_url": "/{{ users_configs_user_uuid }}/{{ user_configs_hiddify_filename }}" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,7 @@ | ||
instruction_url_field_name: admin_login_url | ||
user_configs_instruction_url_field_name: admin_login_url | ||
|
||
user_configs_frontend_html_url: https://github.com/ed-asriyan/xray-server-frontend/releases/latest/download/index.html | ||
|
||
users_configs_urls_map_filename: urls-map.json | ||
user_configs_hiddify_filename: hiddify | ||
user_configs_client_xray_config_filename: client-xray-config.json |