├── Dockerfile ├── LICENSE ├── README.md ├── docker-compose.yaml └── entrypoint.sh /Dockerfile: -------------------------------------------------------------------------------- 1 | FROM alpine:latest 2 | 3 | ADD entrypoint.sh /opt/entrypoint.sh 4 | 5 | RUN apk add --no-cache --virtual .build-deps ca-certificates curl \ 6 | && chmod +x /opt/entrypoint.sh 7 | 8 | ENTRYPOINT ["sh", "-c", "/opt/entrypoint.sh"] 9 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2019 Yuki Kikuchi 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # oktetov2ray 2 | # V2Ray Okteto 3 | 4 | ## 注意本项目有封号的风险,不要用常用的github账号 5 | 6 | ## 概述 7 | 8 | ### 注册地址:https://okteto.com/ 9 | 本专案用于在 Okteto上部署 V2Ray WebSocket, 10 | 11 | 部署完成后,每次启动应用时,运行的 V2Ray 将始终为最新版本 12 | 13 | ## 首先声明一下 14 | 15 | ### 本项目为 https://github.com/bclswl0827/v2ray-heroku 大佬的heroku项目修改,因为有人反映同时fork二者会有冲突,我才将此重新上传改为本人的项目 16 | ### 不是剽窃,感谢bclswl0827大佬的付出,谢谢! 17 | 18 | ## 部署 19 | 20 | ### 步骤 21 | 22 | 1. Fork 本专案到自己的 GitHub 账户(用户名以 `example` 为例) 23 | 2. 如果有需要,修改UUID 在 `entrypoint.sh` 这个文件里修改 24 | 3. 点击部署 ![image](https://user-images.githubusercontent.com/89477009/133904828-38ef592c-ece3-45e7-a85e-812af23b756a.png) 25 | 4. 按要求链接后,找到本项目 ![image](https://user-images.githubusercontent.com/89477009/133905123-d40e3b72-49a5-46ca-9755-995f15dd49e5.png) 部署就行了 26 | 27 | 28 | 29 | ### 变量 30 | 31 | 对部署时需设定的变量名称做如下说明。 32 | 33 | | 变量 | 默认值 | 说明 | 34 | | :--- | :--- | :--- | 35 | | `ID` | `ad806487-2d26-4636-98b6-ab85cc8521f7` | VMess 用户主 ID,用于身份验证,为 UUID 格式 | 36 | | `AID` | `64` | 为进一步防止被探测所设额外 ID,即 AlterID,范围为 0 至 65535 | 37 | | `WSPATH` | `/` | WebSocket 所使用的 HTTP 协议路径 | 38 | 39 | ## 接入 CloudFlare 40 | 41 | 以下两种方式均可以将应用接入 CloudFlare,从而在一定程度上提升速度。 42 | 43 | 1. 为应用绑定域名,并将该域名接入 CloudFlare 44 | 2. 通过 CloudFlare Workers 反向代理 45 | 46 | 47 | -------------------------------------------------------------------------------- /docker-compose.yaml: -------------------------------------------------------------------------------- 1 | services: 2 | oktetov2ray: 3 | build: . 4 | shm_size: 2.6gb 5 | ports: 6 | - "80:80" 7 | -------------------------------------------------------------------------------- /entrypoint.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | # Global variables 4 | DIR_CONFIG="/etc/v2ray" 5 | DIR_RUNTIME="/usr/bin" 6 | DIR_TMP="$(mktemp -d)" 7 | 8 | ID=ad806487-2d26-4636-98b6-ab85cc8521f7 9 | AID=64 10 | WSPATH=/ 11 | PORT=80 12 | 13 | # Write V2Ray configuration 14 | cat << EOF > ${DIR_TMP}/heroku.json 15 | { 16 | "inbounds": [{ 17 | "port": ${PORT}, 18 | "protocol": "vmess", 19 | "settings": { 20 | "clients": [{ 21 | "id": "${ID}", 22 | "alterId": ${AID} 23 | }] 24 | }, 25 | "streamSettings": { 26 | "network": "ws", 27 | "wsSettings": { 28 | "path": "${WSPATH}" 29 | } 30 | } 31 | }], 32 | "outbounds": [{ 33 | "protocol": "freedom" 34 | }] 35 | } 36 | EOF 37 | 38 | # Get V2Ray executable release 39 | curl --retry 10 --retry-max-time 60 -H "Cache-Control: no-cache" -fsSL github.com/v2fly/v2ray-core/releases/latest/download/v2ray-linux-64.zip -o ${DIR_TMP}/v2ray_dist.zip 40 | busybox unzip ${DIR_TMP}/v2ray_dist.zip -d ${DIR_TMP} 41 | 42 | # Convert to protobuf format configuration 43 | mkdir -p ${DIR_CONFIG} 44 | ${DIR_TMP}/v2ctl config ${DIR_TMP}/heroku.json > ${DIR_CONFIG}/config.pb 45 | 46 | # Install V2Ray 47 | install -m 755 ${DIR_TMP}/v2ray ${DIR_RUNTIME} 48 | rm -rf ${DIR_TMP} 49 | 50 | # Run V2Ray 51 | ${DIR_RUNTIME}/v2ray -config=${DIR_CONFIG}/config.pb 52 | --------------------------------------------------------------------------------