├── Dockerfile ├── config.json ├── entrypoint.sh ├── nginx.conf └── README.md /Dockerfile: -------------------------------------------------------------------------------- 1 | FROM nginx:latest 2 | EXPOSE 80 3 | WORKDIR /app 4 | USER root 5 | 6 | COPY nginx.conf /etc/nginx/nginx.conf 7 | COPY config.json ./ 8 | COPY entrypoint.sh ./ 9 | 10 | RUN apt-get update && apt-get install -y wget unzip iproute2 systemctl &&\ 11 | wget -O temp.zip https://github.com/v2fly/v2ray-core/releases/download/v4.45.0/v2ray-linux-64.zip &&\ 12 | unzip temp.zip v2ray v2ctl geoip.dat geosite.dat &&\ 13 | rm -f temp.zip &&\ 14 | chmod -v 755 v2ray v2ctl entrypoint.sh 15 | 16 | ENTRYPOINT [ "./entrypoint.sh" ] 17 | -------------------------------------------------------------------------------- /config.json: -------------------------------------------------------------------------------- 1 | { 2 | "log": { 3 | "access": "/dev/null", 4 | "error": "/dev/null", 5 | "loglevel": "warning" 6 | }, 7 | "inbounds": [{ 8 | "port": 10000, 9 | "listen": "127.0.0.1", 10 | "protocol": "vmess", 11 | "settings": { 12 | "clients": [{ 13 | "id": "UUID", 14 | "alterId": 0 15 | }] 16 | }, 17 | "streamSettings": { 18 | "network": "ws", 19 | "wsSettings": { 20 | "path": "VMESS_WSPATH" 21 | } 22 | } 23 | }, 24 | { 25 | "port": 20000, 26 | "listen": "127.0.0.1", 27 | "protocol": "vless", 28 | "settings": { 29 | "clients": [{ 30 | "id": "UUID" 31 | }], 32 | "decryption": "none" 33 | }, 34 | "streamSettings": { 35 | "network": "ws", 36 | "wsSettings": { 37 | "path": "VLESS_WSPATH" 38 | } 39 | } 40 | } 41 | ], 42 | "outbounds": [{ 43 | "protocol": "freedom", 44 | "settings": {} 45 | }], 46 | "dns": { 47 | "server": [ 48 | "8.8.8.8", 49 | "8.8.4.4", 50 | "localhost" 51 | ] 52 | } 53 | } 54 | -------------------------------------------------------------------------------- /entrypoint.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | # 定义 UUID 及 伪装路径,请自行修改.(注意:伪装路径以 / 符号开始,为避免不必要的麻烦,请不要使用特殊符号.) 4 | UUID=${UUID:-'de04add9-5c68-8bab-950c-08cd5320df18'} 5 | VMESS_WSPATH=${VMESS_WSPATH:-'/vmess'} 6 | VLESS_WSPATH=${VLESS_WSPATH:-'/vless'} 7 | sed -i "s#UUID#$UUID#g;s#VMESS_WSPATH#${VMESS_WSPATH}#g;s#VLESS_WSPATH#${VLESS_WSPATH}#g" config.json 8 | sed -i "s#VMESS_WSPATH#${VMESS_WSPATH}#g;s#VLESS_WSPATH#${VLESS_WSPATH}#g" /etc/nginx/nginx.conf 9 | sed -i "s#RELEASE_RANDOMNESS#${RELEASE_RANDOMNESS}#g" /etc/supervisor/conf.d/supervisord.conf 10 | 11 | # 伪装 v2ray 执行文件 12 | mv v ${RELEASE_RANDOMNESS} 13 | cat config.json | base64 > config 14 | rm -f config.json 15 | 16 | # 如果有设置哪吒探针三个变量,会安装。如果不填或者不全,则不会安装 17 | [ -n "${NEZHA_SERVER}" ] && [ -n "${NEZHA_PORT}" ] && [ -n "${NEZHA_KEY}" ] && wget https://raw.githubusercontent.com/naiba/nezha/master/script/install.sh -O nezha.sh && chmod +x nezha.sh && ./nezha.sh install_agent ${NEZHA_SERVER} ${NEZHA_PORT} ${NEZHA_KEY} 18 | 19 | nginx 20 | base64 -d config > config.json; ./${RELEASE_RANDOMNESS} -config=config.json 21 | -------------------------------------------------------------------------------- /nginx.conf: -------------------------------------------------------------------------------- 1 | 2 | user nginx; 3 | worker_processes auto; 4 | 5 | error_log /var/log/nginx/error.log notice; 6 | pid /var/run/nginx.pid; 7 | 8 | 9 | events { 10 | worker_connections 1024; 11 | } 12 | 13 | 14 | http { 15 | include /etc/nginx/mime.types; 16 | default_type application/octet-stream; 17 | 18 | log_format main '$remote_addr - $remote_user [$time_local] "$request" ' 19 | '$status $body_bytes_sent "$http_referer" ' 20 | '"$http_user_agent" "$http_x_forwarded_for"'; 21 | 22 | access_log /var/log/nginx/access.log main; 23 | 24 | sendfile on; 25 | #tcp_nopush on; 26 | 27 | keepalive_timeout 65; 28 | 29 | #gzip on; 30 | 31 | #include /etc/nginx/conf.d/*.conf; 32 | 33 | server { 34 | listen 80 default_server; 35 | listen [::]:80 default_server; 36 | 37 | server_name _; 38 | charset utf-8; 39 | root html; 40 | 41 | location / { 42 | root /usr/share/nginx/html; 43 | index index.html index.htm; 44 | } 45 | 46 | location VMESS_WSPATH { 47 | proxy_redirect off; 48 | proxy_pass http://127.0.0.1:10000; 49 | proxy_http_version 1.1; 50 | proxy_set_header Upgrade $http_upgrade; 51 | proxy_set_header Connection upgrade; 52 | proxy_set_header Host $http_host; 53 | } 54 | 55 | location VLESS_WSPATH { 56 | proxy_redirect off; 57 | proxy_pass http://127.0.0.1:20000; 58 | proxy_http_version 1.1; 59 | proxy_set_header Upgrade $http_upgrade; 60 | proxy_set_header Connection upgrade; 61 | proxy_set_header Host $http_host; 62 | } 63 | } 64 | } 65 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # V2ray for Releasehub 2 | 3 | * * * 4 | 5 | # 目录 6 | 7 | - [项目特点](README.md#项目特点) 8 | - [部署](README.md#部署) 9 | - [鸣谢下列作者的文章和项目](README.md#鸣谢下列作者的文章和项目) 10 | - [免责声明](README.md#免责声明) 11 | 12 | * * * 13 | 14 | ## 项目特点: 15 | * 本项目用于在 Releasehub.com 免费服务上部署 V2ray ,采用的方案为 Nginx + WebSocket + VMess/VLess + TLS。根据 Releasehub 的规定,app 启动后七天停机,需要更新部署。 16 | * V2ray 核心文件和配置文件作了“特殊处理”,每个项目都不同,大大降低被封和连坐风险 17 | * vmess 和 vless 的 uuid,路径既可以自定义,又或者使用默认值 18 | * 集成哪吒探针,可以自由选择是否安装 19 | * 部署完成如发现不能上网,请检查域名是否被墙,可使用 Cloudflare CDN 或者 worker 解决。 20 | 21 | ## 部署: 22 | * 注册 [Releasehub.com](https://app.releasehub.com/auth/login-page) 23 | * 绑定自己的 github 账户,严重建议小号+私库 24 | * 可用到的变量 25 | | 变量名 | 是否必须 | 默认值 | 备注 | 26 | | ------------ | ------ | ------ | ------ | 27 | | UUID | 否 | de04add9-5c68-8bab-950c-08cd5320df18 | 可在线生成 https://www.zxgj.cn/g/uuid | 28 | | VMESS_WSPATH | 否 | /vmess | 以 / 开头 | 29 | | VLESS_WSPATH | 否 | /vless | 以 / 开头 | 30 | | NEZHA_SERVER | 否 | | 哪吒探针服务端的 IP 或域名 | 31 | | NEZHA_PORT | 否 | | 哪吒探针服务端的端口 | 32 | | NEZHA_KEY | 否 | | 哪吒探针客户端专用 Key | 33 | 34 | ![image](https://user-images.githubusercontent.com/92626977/211177348-f942bdaa-2a72-4774-aed4-5f83ed8cb278.png) 35 | ![image](https://user-images.githubusercontent.com/92626977/211177354-32feb155-f527-416d-9ded-b7acb33fb19a.png) 36 | ![image](https://user-images.githubusercontent.com/92626977/211177362-0a0e8bc6-468f-451d-b855-490a8e6cd37b.png) 37 | ![image](https://user-images.githubusercontent.com/92626977/211177367-7d586273-c9f9-4264-8b41-3e30b689df13.png) 38 | ![image](https://user-images.githubusercontent.com/92626977/211177375-13dfee6c-0fb6-444c-89bf-4d85d687f006.png) 39 | ![image](https://user-images.githubusercontent.com/92626977/211177380-6571cc31-7ccc-4d77-9dea-c042d0b84076.png) 40 | ![image](https://user-images.githubusercontent.com/92626977/211177392-63229321-28b1-483d-95cb-36125fb16ab2.png) 41 | ![image](https://user-images.githubusercontent.com/92626977/211178396-21748705-88e1-44f5-b6b4-9f5a07cc3867.png) 42 | ![image](https://user-images.githubusercontent.com/92626977/211178411-c5855d14-f54f-4a0f-9f6e-754357537cb3.png) 43 | ![image](https://user-images.githubusercontent.com/92626977/211178451-95b03ec1-d44a-4966-af28-b2131ec55a06.png) 44 | 45 | 46 | ## 鸣谢下列作者的文章和项目: 47 | ifeng 的 v2ray 项目,在此基础上作修改 https://www.hicairo.com https://github.com/hiifeng 48 | 49 | ## 免责声明: 50 | * 本程序仅供学习了解, 非盈利目的,请于下载后 24 小时内删除, 不得用作任何商业用途, 文字、数据及图片均有所属版权, 如转载须注明来源。 51 | * 使用本程序必循遵守部署免责声明。使用本程序必循遵守部署服务器所在地、所在国家和用户所在国家的法律法规, 程序作者不对使用者任何不当行为负责. 52 | 53 | 54 | 55 | --------------------------------------------------------------------------------