123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198 |
- #!/bin/bash
- clear
- if [[ "$EUID" -ne 0 ]]; then
- echo -e "\033[1;31mScript need to be run as root!\033[0m"; exit 1
- fi
- apt-get -qq update
- wget -q -O - https://raw.githubusercontent.com/XTLS/Xray-install/main/install-release.sh | bash
- touch /usr/local/etc/xray/.xray
- cp /etc/letsencrypt/live/vpn.aidan.my/fullchain.pem /usr/local/etc/xray/xray.crt
- cp /etc/letsencrypt/live/vpn.aidan.my/privkey.pem /usr/local/etc/xray/xray.key
- chmod 644 /usr/local/etc/xray/xray.crt; chmod 644 /usr/local/etc/xray/xray.key
- alamat_ip=$(wget -qO- ipv4.icanhazip.com)
- alamat_port=$(shuf -i 1025-9999 -n 1)
- alamat_hos=$(cat /etc/environment | grep 'DOMAIN' | cut -d '=' -f 2 | head -n 1)
- alamat_emel=$(cat /etc/environment | grep 'EMAIL' | cut -d '=' -f 2)
- user_uid="$(cat '/proc/sys/kernel/random/uuid')"
- user_aid=$(shuf -i 1-254 -n 1)
- cat > xray-xtls.json <<-xray-xtls
- {
- "log": {
- "loglevel": "warning"
- },
- "inbounds": [
- {
- "port": $alamat_port,
- "protocol": "vless",
- "settings": {
- "clients": [
- {
- "id": "1d716ea0-9670-4359-800b-ed8d783ec04b",
- "flow": "xtls-rprx-direct",
- "level": 0,
- "email": "$alamat_emel"
- }
- ],
- "decryption": "none",
- "fallbacks": [
- {
- "dest": 1310,
- "xver": 1
- },
- {
- "path": "/websocket",
- "dest": 1234,
- "xver": 1
- },
- {
- "path": "/vmesstcp",
- "dest": 2345,
- "xver": 1
- },
- {
- "path": "/vmessws",
- "dest": 3456,
- "xver": 1
- }
- ]
- },
- "streamSettings": {
- "network": "tcp",
- "security": "xtls",
- "xtlsSettings": {
- "alpn": [
- "http/1.1"
- ],
- "certificates": [
- {
- "certificateFile": "/usr/local/etc/v2ray/v2ray.crt",
- "keyFile": "/usr/local/etc/v2ray/v2ray.key"
- }
- ]
- }
- }
- },
- {
- "port": 1310,
- "listen": "127.0.0.1",
- "protocol": "trojan",
- "settings": {
- "clients": [
- {
- "password": "",
- "level": 0,
- "email": "$alamat_emel"
- }
- ],
- "fallbacks": [
- {
- "dest": 80
- }
- ]
- },
- "streamSettings": {
- "network": "tcp",
- "security": "none",
- "tcpSettings": {
- "acceptProxyProtocol": true
- }
- }
- },
- {
- "port": 1234,
- "listen": "127.0.0.1",
- "protocol": "vless",
- "settings": {
- "clients": [
- {
- "id": "",
- "level": 0,
- "email": "$alamat_emel"
- }
- ],
- "decryption": "none"
- },
- "streamSettings": {
- "network": "ws",
- "security": "none",
- "wsSettings": {
- "acceptProxyProtocol": true,
- "path": "/websocket"
- }
- }
- },
- {
- "port": 2345,
- "listen": "127.0.0.1",
- "protocol": "vmess",
- "settings": {
- "clients": [
- {
- "id": "",
- "level": 0,
- "email": "$alamat_emel"
- }
- ]
- },
- "streamSettings": {
- "network": "tcp",
- "security": "none",
- "tcpSettings": {
- "acceptProxyProtocol": true,
- "header": {
- "type": "http",
- "request": {
- "path": [
- "/vmesstcp"
- ]
- }
- }
- }
- }
- },
- {
- "port": 3456,
- "listen": "127.0.0.1",
- "protocol": "vmess",
- "settings": {
- "clients": [
- {
- "id": "",
- "level": 0,
- "email": "$alamat_emel"
- }
- ]
- },
- "streamSettings": {
- "network": "ws",
- "security": "none",
- "wsSettings": {
- "acceptProxyProtocol": true,
- "path": "/vmessws"
- }
- }
- }
- ],
- "outbounds": [
- {
- "protocol": "freedom"
- }
- ]
- }
- xray-xtls
- systemctl enable xray@xray-xtls; systemctl start xray@xray-xtls
- echo
- echo -e "\033[1;32mCongratulation, We are done with the xray installation.\033[0m"
- echo
- echo 'Use my referral link https://m.do.co/c/a28a40414d6a'
- echo 'to gets $100 credit into your DigitalOcean account.'
- echo 'Created by Doctype, Powered by Cybertize'
- echo 'Copyright 2021, Allright reserved.'
- echo; sleep 5
|