├── .github └── workflows │ └── buildsingbox.yml ├── README.md ├── autostart.sh ├── config.json ├── installReality.sh ├── meta.yaml └── readme.en.md /.github/workflows/buildsingbox.yml: -------------------------------------------------------------------------------- 1 | # This is a basic workflow to help you get started with Actions 2 | 3 | name: CI 4 | 5 | # Controls when the workflow will run 6 | on: 7 | # Triggers the workflow on push or pull request events but only for the "main" branch 8 | push: 9 | branches: [ "main" ] 10 | pull_request: 11 | branches: [ "main" ] 12 | 13 | # Allows you to run this workflow manually from the Actions tab 14 | workflow_dispatch: 15 | 16 | # A workflow run is made up of one or more jobs that can run sequentially or in parallel 17 | jobs: 18 | # This workflow contains a single job called "build" 19 | build: 20 | # The type of runner that the job will run on 21 | runs-on: ubuntu-latest 22 | 23 | # Steps represent a sequence of tasks that will be executed as part of the job 24 | steps: 25 | # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it 26 | - uses: actions/checkout@v3 27 | 28 | # Runs a single command using the runners shell 29 | - name: Run a one-line script 30 | run: echo Hello, world! 31 | 32 | # Runs a set of commands using the runners shell 33 | - name: Run a multi-line script 34 | run: | 35 | echo Add other actions to build, 36 | echo test, and deploy your project. 37 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | 2 | 3 | # Reality 小白一键安装脚本(目前仅提供meta客户端使用的配置文件) 4 | # [English‘s Readme](https://github.com/BoxXt/installReality/blob/main/readme.en.md) 5 | 6 | 7 | ## 如何使用脚本 8 | * 系统仅支持: Ubuntu 9 | * 登录vps 10 | * 输入以下指令,并按照指令提示操作即可 11 | ``` 12 | sudo curl -o installReality.sh https://raw.githubusercontent.com/BoxXt/installReality/main/installReality.sh && sh ./installReality.sh 13 | ``` 14 | * 最终得到 Meta 的客户端配置文件,选用支持 Clash.meta 的客户端导入使用即可 15 | * 脚本内已自动开启BBR加速 16 | 17 | ## 调试 18 | ```yaml 19 | #启动 20 | systemctl start sing-box 21 | #停止 22 | systemctl stop sing-box 23 | #强制停止 24 | systemctl kill sing-box 25 | #重启 26 | systemctl restart sing-box 27 | #实时日志 28 | journalctl -u sing-box --output cat -f 29 | ``` 30 | ## 客户端 31 | 能力有限目前暂时支持输出clash.meta客户端配置给到meta客户端使用,可使用客户端列表(待测试补充): 32 | * macOS: 33 | [ClashX.Meta](https://github.com/MetaCubeX/ClashX.Meta/releases/tag/v1.2.1) 34 | * 需要更新内核版本为alpha最新版本。 35 | 36 | * Windows: 37 | [Clash Verage](https://github.com/zzzgydi/clash-verge/releases/tag/v1.2.3) 38 | * 需要更新内核版本为alpha最新版本。 39 | 40 | * iOS: 41 | * [Singbox for iOS](https://testflight.apple.com/join/c6ylui2j) 配合 [Singbox config](https://sing-box.sagernet.org/configuration/inbound/hysteria/) 42 | * [Pharos Pro](https://apps.apple.com/app/pharos-pro/id1456610173) 配合 [Clash.Meta config](https://docs.metacubex.one/function/proxy/hysteria) 43 | 44 | * Android: 45 | [ClashMetaForAndroid](https://github.com/MetaCubeX/ClashMetaForAndroid/releases/tag/Prerelease-alpha) 46 | * 需要更新至最新版本。 47 | 48 | 49 | ## TODO 50 | * 自定义域名 51 | * 支持输出 singbox 客户端配置 52 | * 支持 grpc 53 | 54 | 55 | -------------------------------------------------------------------------------- /autostart.sh: -------------------------------------------------------------------------------- 1 | systemctl kill sing-box 2 | systemctl start sing-box -------------------------------------------------------------------------------- /config.json: -------------------------------------------------------------------------------- 1 | { 2 | "log": { 3 | "level": "trace", 4 | "timestamp": true 5 | }, 6 | "inbounds": [ 7 | { 8 | "type": "vless", 9 | "tag": "vless-in", 10 | "listen": "::", 11 | "listen_port": 443, 12 | "sniff": true, 13 | "sniff_override_destination": true, 14 | "users": [ 15 | { 16 | "uuid": "puuid", 17 | "flow": "xtls-rprx-vision" 18 | } 19 | ], 20 | "tls": { 21 | "enabled": true, 22 | "server_name": "www.yahoo.com", 23 | "reality": { 24 | "enabled": true, 25 | "handshake": { 26 | "server": "www.yahoo.com", 27 | "server_port": 443 28 | }, 29 | "private_key": "pkey", 30 | "short_id": [ 31 | "pshortid" 32 | ] 33 | } 34 | } 35 | } 36 | ], 37 | "outbounds": [ 38 | { 39 | "type": "direct", 40 | "tag": "direct" 41 | }, 42 | { 43 | "type": "block", 44 | "tag": "block" 45 | } 46 | ], 47 | "route": { 48 | "rules": [ 49 | { 50 | "geoip": "cn", 51 | "outbound": "block" 52 | }, 53 | { 54 | "geosite": "category-ads-all", 55 | "outbound": "block" 56 | } 57 | ], 58 | "final": "direct" 59 | } 60 | } 61 | -------------------------------------------------------------------------------- /installReality.sh: -------------------------------------------------------------------------------- 1 | echo -e "\033[32m 欢迎使用BoxXt提供的小白一键搭建 Xray Reality 脚本 \033[0m" 2 | echo "检查是否包含git环境" 3 | if ! [ -x "$(command -v git)" ]; then 4 | echo '没有git环境, 正在安装git...' >&2 5 | sudo apt update 6 | sudo apt install git -y 7 | fi 8 | echo 'git已经安装完成' 9 | 10 | systemctl kill sing-box 11 | 12 | echo '拉取singbox' 13 | rm -r sing-box 14 | git clone https://github.com/SagerNet/sing-box 15 | cd sing-box 16 | git switch dev-next 17 | echo "检查及自动安装go环境" 18 | if ! [ -x "$(command -v go)" ]; then 19 | curl -Lo go.tar.gz https://go.dev/dl/go1.20.1.linux-amd64.tar.gz 20 | sudo rm -rf /usr/local/go 21 | sudo tar -C /usr/local -xzf go.tar.gz 22 | rm go.tar.gz 23 | fi 24 | echo 'go环境已经安装完成' 25 | 26 | echo "安装singbox,请耐心等待" 27 | if [ -d /usr/local/go ]; then 28 | export PATH="$PATH:/usr/local/go/bin" 29 | fi 30 | 31 | go install -v -trimpath -ldflags "-s -w -buildid=" -tags with_quic,with_wireguard,with_acme,with_reality_server ./cmd/sing-box 32 | 33 | 34 | sudo cp $(go env GOPATH)/bin/sing-box /usr/local/bin/ 35 | sudo mkdir -p /var/lib/sing-box 36 | sudo mkdir -p /usr/local/etc/sing-box 37 | 38 | pwd=`pwd` 39 | echo "\033[31m $pwd \033[0m" 40 | 41 | sudo cp ./release/local/sing-box.service /etc/systemd/system 42 | sudo systemctl daemon-reload 43 | 44 | 45 | echo "拉取初始singbox配置文件" 46 | curl -o config.json https://raw.githubusercontent.com/BoxXt/installReality/main/config.json && mv -f config.json /usr/local/etc/sing-box/config.json 47 | curl -o meta.yaml https://raw.githubusercontent.com/BoxXt/installReality/main/meta.yaml && mv -f meta.yaml /usr/local/etc/sing-box/meta.yaml 48 | 49 | 50 | echo "启动singbox用于安装reality" 51 | echo "\033[32m 生成密钥对 \033[0m" 52 | result=`sing-box generate reality-keypair` 53 | pkey=$(echo $result | awk -F " " '{print $2}') 54 | pukey=$(echo $result | awk -F " " '{print $4}') 55 | sed -in "s/pkey/$pkey/g" /usr/local/etc/sing-box/config.json 56 | 57 | 58 | echo "生成uuid" 59 | uuid=`sing-box generate uuid` 60 | echo $uuid 61 | sed -in "s/puuid/$uuid/g" /usr/local/etc/sing-box/config.json 62 | 63 | echo "安装openssl" 64 | sudo apt-get update && sudo apt-get install openssl 65 | shortid=`openssl rand -hex 8` 66 | echo "随机生成short_id" 67 | echo $shortid 68 | sed -in "s/pshortid/$shortid/g" /usr/local/etc/sing-box/config.json 69 | 70 | echo "完成配置,启动singbox" 71 | echo "" 72 | systemctl start sing-box 73 | echo "设置开机自动启动" 74 | systemctl enable sing-box 75 | echo "" 76 | 77 | echo "=======开启BBR加速==========" 78 | echo net.core.default_qdisc=fq >> /etc/sysctl.conf 79 | echo net.ipv4.tcp_congestion_control=bbr >> /etc/sysctl.conf 80 | sysctl -p 81 | echo "===========================" 82 | echo "以下是支持reality的meta客户端所需要的配置信息:" 83 | echo "" 84 | echo "\033[31m servername: www.yahoo.com \033[0m" 85 | echo "\033[31m flow: xtls-rprx-vision \033[0m" 86 | echo "\033[31m uuid: $uuid \033[0m" 87 | echo "\033[31m PrivateKey: $pkey \033[0m" 88 | echo "\033[31m PublicKey: $pukey \033[0m" 89 | echo "\033[31m short_id: $shortid \033[0m" 90 | echo "" 91 | ip=`curl https://api.my-ip.io/ip -s` 92 | sed -in "s/vpsip/$ip/g" /usr/local/etc/sing-box/meta.yaml 93 | sed -in "s/pukey/$pukey/g" /usr/local/etc/sing-box/meta.yaml 94 | sed -in "s/pshortid/$shortid/g" /usr/local/etc/sing-box/meta.yaml 95 | sed -in "s/puuid/$uuid/g" /usr/local/etc/sing-box/meta.yaml 96 | echo "\033[32m 以下是你的meta客户端所需要的可用示例配置文件: \033[0m" 97 | echo "=========================================================" 98 | echo "" 99 | cat /usr/local/etc/sing-box/meta.yaml 100 | echo "" 101 | echo "=========================================================" 102 | echo "完成搭建" 103 | 104 | 105 | 106 | 107 | 108 | -------------------------------------------------------------------------------- /meta.yaml: -------------------------------------------------------------------------------- 1 | 2 | mixed-port: 7890 3 | external-controller: 127.0.0.1:9090 4 | allow-lan: false 5 | mode: rule 6 | log-level: debug 7 | ipv6: true 8 | 9 | dns: 10 | enable: true 11 | listen: 0.0.0.0:53 12 | enhanced-mode: fake-ip 13 | nameserver: 14 | - 8.8.8.8 15 | - 1.1.1.1 16 | - 114.114.114.114 17 | 18 | 19 | proxies: 20 | - name: reality 21 | type: vless 22 | server: vpsip 23 | port: 443 24 | uuid: puuid 25 | network: tcp 26 | tls: true 27 | udp: true 28 | xudp: true 29 | flow: xtls-rprx-vision 30 | servername: www.yahoo.com 31 | reality-opts: 32 | public-key: "pukey" 33 | short-id: "pshortid" 34 | client-fingerprint: chrome 35 | 36 | proxy-groups: 37 | - name: Proxy 38 | type: select 39 | proxies: 40 | - reality 41 | rules: 42 | - GEOSITE,CN,DIRECT 43 | - GEOIP,CN,DIRECT 44 | - MATCH,Proxy 45 | 46 | 47 | -------------------------------------------------------------------------------- /readme.en.md: -------------------------------------------------------------------------------- 1 | # Reality Xiaobai One-Click Installation Script: A Comprehensive Guide 2 | 3 | In the world of technology, efficiency is key. This is why we have developed the Reality Xiaobai one-click installation script. This script is designed to streamline the installation process, making it easier and faster for users to get their systems up and running. Currently, this script only provides configuration files used by meta clients. In this article, we will guide you on how to use this script. 4 | 5 | ## System Requirements 6 | 7 | Before we begin, it's important to note that this script is only supported on Ubuntu systems. Therefore, ensure that you have an Ubuntu system ready for the installation. 8 | 9 | ## Logging into VPS 10 | 11 | The first step is to log into your Virtual Private Server (VPS). This can be done using your preferred SSH client. 12 | 13 | ## Running the Installation Command 14 | 15 | Once logged into your VPS, enter the following command: 16 | 17 | ```bash 18 | sudo curl -o installReality.sh https://raw.githubusercontent.com/BoxXt/installReality/main/installReality.sh && sh ./installReality.sh 19 | ``` 20 | 21 | This command will download the installation script and execute it. Simply follow the instructions provided during the installation process. 22 | 23 | ## Meta Client Configuration 24 | 25 | After the installation, you will receive a Meta client configuration file. You can import this file into any client that supports Clash.meta. 26 | 27 | ## BBR Acceleration 28 | 29 | One of the key features of this script is that it automatically enables BBR acceleration. This feature optimizes your network speed, ensuring that you get the best performance out of your system. 30 | 31 | ## Debugging 32 | 33 | In case you encounter any issues, the script provides several commands for debugging: 34 | 35 | - To start the service, use `systemctl start sing-box` 36 | - To stop the service, use `systemctl stop sing-box` 37 | - To forcefully stop the service, use `systemctl kill sing-box` 38 | - To restart the service, use `systemctl restart sing-box` 39 | - To view real-time logs, use `journalctl -u sing-box --output cat -f` 40 | 41 | ## Client Support 42 | 43 | The script currently supports exporting clash.meta client configuration for use by meta clients. The list of available clients (which are still being tested and supplemented) includes: 44 | 45 | - macOS: [ClashX.Meta](https://github.com/MetaCubeX/ClashX.Meta/releases) (The kernel version needs to be updated to the latest version of alpha) 46 | - Windows: [Clash Verage](https://github.com/zzzgydi/clash-verge/releases) (The kernel version needs to be updated to the latest version of alpha) 47 | - iOS: [Singbox](https://testflight.apple.com/join/c6ylui2j) for iOS with Singbox config, [Pharos Pro](https://apps.apple.com/app/pharos-pro/id1456610173) with Clash.Meta config 48 | - Android: [ClashMetaForAndroid](https://github.com/MetaCubeX/ClashMetaForAndroid/releases) (Needs to be updated to the latest version) 49 | 50 | ## Additional Features 51 | 52 | The script also supports custom domain names and the output of singbox client configurations. It also supports gRPC, a high-performance, open-source universal RPC framework. 53 | 54 | In conclusion, the Reality Xiaobai one-click installation script is a powerful tool that simplifies the installation process, making it easier for users to get their systems up and running. With its automatic BBR acceleration and support for various clients, it's a must-have tool for any tech enthusiast. 55 | --------------------------------------------------------------------------------