8000 GitHub - pilosus/Xray-ansible: Deploy XTLS/Xray with Ansible
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

pilosus/Xray-ansible

Repository files navigation

xray-ansible: get XTLS/Xray server up & running using Ansible

Get your XTLS/Xray server up and running with Ansible.

Requirements

  1. A Linux machine with systemd (tested with DigitalOcean's 1vCPU-512MB-10GB Ubuntu 23.10 droplet)
  2. SSH config to access the Linux machine as a root (to make Ansible playbook work)
  3. Python & pip
  4. (Optional) NekoRay/NekoBox client (tested with v3.23)

Provision the Linux machine

  1. Clone the repo
  2. Change directory
cd xray-ansible
  1. Install requirements
pip install -r requirements.txt
  1. Add your Linux machine IP address to the Ansible inventory file, e.g. ~/.ansible/hosts:
[xray]
xray-az-label-1 ansible_host=your.machine.ip.address
  1. Run the playbook with verbosity 1:
ansible-playbook -v --limit xray playbook-xray-setup.yaml \
    --inventory ~/.ansible/hosts \
    --user root
  1. Note the ansible_facts from the step xray: Decode and set Xray variables from file, you will need them to set up your client

Variables

The playbook is parametrized with the following variables:

  • xray_version - version string of the Xray-core [default v1.8.1]
  • xray_platform - platform the binary compiled for, see Xray-core releases for more platforms [default linux-64]
  • xray_path - path for the Xray-core installation [default /opt/xray]

Use -e variable=value Ansible CLI argument to change default values, e.g.:

ansible-playbook -v --limit xray playbook-xray-setup.yaml \
    --inventory ~/.ansible/hosts \
    --user root \
    -e xray_version=v1.8.4

Set up the client

  1. Download the NekoRay client
  2. Unzip
  3. Change directory to unzipped client
  4. Run as ./launcher
  5. Preferences -> Basic Settings -> Core -> sign box
  6. Server -> New profile -> Type VLESS
  7. Edit settings:
Common:
Name: you profile name
Address: your Linux machine IP address/DNS
Port: 443

VLESS:
UUID: ansible_facts -> xray -> uuid
Flow: xtls-rprx-vision

Settings:
Settings: tcp
Security: tls
Packet encoding: xudp

TLS security settings:
SNI: www.microsoft.com
ALPN: h2

TLS camouflage Settings:
uTLS: chrome
Reality Pbk: ansible_facts -> xray -> x25519_public
Reaily Sid: ansible_facts -> xray -> short_id
  1. Save settings
  2. Select the new profile in the list -> right mouse click -> Start
  3. Select the new profile in the list -> right mouse click -> Current Select -> URL test
  4. If test from the previous step is ok, then select the checkbox System proxy
  5. Enjoy

Credits

The Ansible playbook and the xray role have been developed by dmgening and productionized by pilosus.

The playbook relies heavily on the tutorial (in Russian; last accessed on 25.10.23) by MiraclePtr.

About

Deploy XTLS/Xray with Ansible

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

0