├── Dockerfile ├── README.md ├── docker-compose.yml └── out └── 0.txt /Dockerfile: -------------------------------------------------------------------------------- 1 | FROM ubuntu:latest 2 | RUN apt-get update \ 3 | && apt-get install curl -y \ 4 | && apt-get install wget -y \ 5 | && apt-get install systemd -y \ 6 | && apt-get install systemctl -y \ 7 | && wget -O /bin/install.sh https://raw.githubusercontent.com/vaxilu/x-ui/master/install.sh \ 8 | && chmod +x /bin/install.sh \ 9 | && bash /bin/install.sh 10 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | ## 介绍 2 | 3 | 该项目依托于[docker](https://www.docker.com/)、[docker-compose](https://github.com/docker/awesome-compose)、[x-ui](https://github.com/vaxilu/x-ui)、[acme.sh](https://github.com/acmesh-official/acme.sh),能够快速搭建出跳跃节点。 4 | 5 | ## 使用docker-compose示例 6 | 7 | ### docker-compose配置文件说明 8 | 9 | ```yml 10 | version: '3' 11 | services: 12 | acme.sh: 13 | image: neilpang/acme.sh 14 | restart: always 15 | volumes: 16 | - "$PWD/out:/acme.sh:z" 17 | environment: 18 | - CF_Key="xxxxxxxxxxxxxxxxxxxx" 19 | - CF_Email="xxxxxxxx@gmail.com" 20 | command: daemon 21 | x-ui: 22 | image: srcrs/x-ui 23 | restart: always 24 | network_mode: "host" 25 | volumes: 26 | - "$PWD/out:/root/out" 27 | command: 28 | - /bin/bash 29 | - -c 30 | - | 31 | x-ui start 32 | sleep infinity 33 | ``` 34 | 35 | CF_Key位于[api-tokens](https://dash.cloudflare.com/profile/api-tokens)页,Global API Key。 36 | 37 | CF_Email是cloudflare登陆的邮箱。 38 | 39 | out文件夹用于存储acme生成的证书。 40 | 41 | ### 生成域名证书 42 | 43 | ```sh 44 | #注册邮箱 45 | docker-compose run acme.sh --register-account -m xxxxxx@gmail.com --debug 46 | #以下二选一 47 | #泛域名证书 48 | docker-compose run acme.sh --issue --dns dns_cf -d mytest.com -d *.mytest.com --debug 49 | #单独域名证书 50 | docker-compose run acme.sh --issue --dns dns_cf -d proxy.mytest.com --debug 51 | ``` 52 | 53 | ## 使用docker示例 54 | 55 | ### 运行x-ui 56 | 57 | ```sh 58 | docker run -itd --name x-ui --privileged --restart always -v $PWD/out:/root/out --network host srcrs/x-ui bash -c "x-ui start && sleep infinity" 59 | ``` 60 | 61 | ### 运行acme.sh 62 | 63 | ```sh 64 | docker run -itd --name acme.sh --privileged --restart always -v $PWD/out:/root/out neilpang/acme.sh daemon 65 | ``` 66 | 67 | ### 生成域名证书 68 | 69 | ```sh 70 | #注册邮箱 71 | docker exec acme.sh --register-account -m xxxxxx@gmail.com --debug 72 | #以下二选一 73 | #泛域名证书 74 | docker exec acme.sh --issue --dns dns_cf -d mytest.com -d *.mytest.com --debug 75 | #单独域名证书 76 | docker exec acme.sh --issue --dns dns_cf -d proxy.mytest.com --debug 77 | ``` 78 | 79 | ## 登陆x-ui面板 80 | 81 | 默认使用端口为54321,用户名和密码都为admin。 82 | 83 | 登陆地址: ip:54321 84 | 85 | ## 添加tls节点证书路径 86 | 87 | 添加节点为tls或者tls+cdn模式时,需要在x-ui面板填写对应的证书路径,使用时mytest.com换成对应的代理域名即可。 88 | 89 | 公钥文件路径 /root/out/mytest.com/mytest.com.cer 90 | 91 | 密钥文件路径 /root/out/mytest.com/mytest.com.key 92 | 93 | 使用docker只需要找到对应的镜像,取执行命令效果一样。 94 | 95 | 需要注意的是,域名要被cloudfale代理,参考文章[CloudFlare免费CDN加速使用方法](https://zhuanlan.zhihu.com/p/29891330)。 96 | 97 | ## 致谢 98 | 99 | - [docker](https://www.docker.com/) 100 | - [docker-compose](https://github.com/docker/awesome-compose) 101 | - [x-ui](https://github.com/vaxilu/x-ui) 102 | - [acme.sh](https://github.com/acmesh-official/acme.sh) 103 | -------------------------------------------------------------------------------- /docker-compose.yml: -------------------------------------------------------------------------------- 1 | version: '3' 2 | services: 3 | acme.sh: 4 | image: neilpang/acme.sh 5 | restart: always 6 | volumes: 7 | - "./out:/acme.sh:z" 8 | environment: 9 | - CF_Key="xxxxxxxxxxxxxxxxxxxx" 10 | - CF_Email="xxxxxxxx@gmail.com" 11 | command: daemon 12 | x-ui: 13 | image: srcrs/x-ui 14 | restart: always 15 | network_mode: "host" 16 | volumes: 17 | - "./out:/root/out" 18 | command: 19 | - /bin/bash 20 | - -c 21 | - | 22 | x-ui start 23 | sleep infinity 24 | -------------------------------------------------------------------------------- /out/0.txt: -------------------------------------------------------------------------------- 1 | 0 2 | --------------------------------------------------------------------------------