Repository: fcying/IBMYes Branch: master Commit: d263e93ec857 Files: 8 Total size: 8.6 KB Directory structure: gitextract_cmoel384/ ├── .github/ │ └── workflows/ │ ├── ibm.yml │ └── leanengine.yml ├── .gitignore ├── README.md ├── config/ │ ├── config_vless.json │ ├── config_vmess.json │ └── manifest.yml └── deploy.sh ================================================ FILE CONTENTS ================================================ ================================================ FILE: .github/workflows/ibm.yml ================================================ name: IBM Cloud Deploy on: workflow_dispatch: push: branches: [ master ] schedule: - cron: '0 7 * * 3' defaults: run: shell: bash env: IBM_ACCOUNT: ${{ secrets.IBM_ACCOUNT }} RESOURSE_ID: ${{ secrets.RESOURSE_ID }} IBM_APP_NAME: ${{ secrets.IBM_APP_NAME }} IBM_MEMORY: ${{ secrets.IBM_MEMORY }} V2_ID: ${{ secrets.V2_ID }} V2_PATH: ${{ secrets.V2_PATH }} ALTER_ID: ${{ secrets.ALTER_ID }} VLESS_EN: ${{ secrets.VLESS_EN }} jobs: deploy: runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 - name: Deploy run: | ./deploy.sh ================================================ FILE: .github/workflows/leanengine.yml ================================================ name: LeanEngine Deploy on: workflow_dispatch: jobs: deploy: runs-on: ubuntu-latest steps: - name: Deploy to LeanEngine uses: enflo/curl-action@v1.2 with: curl: -X POST https://console.leancloud.app/1.1/engine/groups/web/production/version?gitTag=${{ github.sha }}&token=${{ secrets.DEPLOY_TOKEN }} ================================================ FILE: .gitignore ================================================ config/v2ctl config/v2ray config/geoip.dat config/geosite.dat Bluemix_CLI test.sh ================================================ FILE: README.md ================================================ fork [https://github.com/CCChieh/IBMYes](https://github.com/CCChieh/IBMYes) # fork修改内容: * `Secrets` 加入 `V2_ID`, `V2_PATH`, `ALTER_ID`, 对应`vmess id`, `ws path`, `alterId` * 使用actions, 每周自动更新`v2ray`, 部署到 `IBM Cloud Foundray`. # 配置流程 ### 配置IBM Cloud Fonudray * 注册并登录[https://cloud.ibm.com/](https://cloud.ibm.com/) * 点击右侧 创建资源 * 点击`Cloud Foundray` * 创建公共应用程序 * 填写相关信息: 区域达拉斯(免费). 内存最高256M. 应用名称. 配置资源选Python * 应用程序域名 就是 应用名称+域, 比如: `ibmyes.us-south.cf.appdomain.cloud` * 点击右侧 创建 ### 配置 Cloudflare 高速节点中转 这部分不配置也可以直接连 应用程序域名 使用, 就是有点慢. * 注册并登录[https://www.cloudflare.com/](https://www.cloudflare.com/) * 点击 Workers * 点击 创建Worker * 在脚本位置加入下面这段, `url.hostname`修改为对应的 应用程序域名. ``` addEventListener( "fetch",event => { let url=new URL(event.request.url); url.hostname="ibmyes.us-south.cf.appdomain.cloud"; let request=new Request(url,event.request); event.respondWith( fetch(request) ) } ) ``` * 点击保存并部署, 这里会给一个网址(比如`cloudflare_workers.dev`), 这个就是 v2ray 客户端要连的地址. ### 利用Github Actions 自动部署 IBM Cloud Fonudray * 返回 github, 到本项目 [https://github.com/fcying/IBMYes](https://github.com/fcying/IBMYes) * 点击右上角 `Use this template`, 生成一个自己的仓库(设为`public`,如果要用`private`,需要修改`deploy.sh`,提供一个可以下载的`config.json`连接) * 点击自己仓库的 Settings. * 点击 `Secrets` 建立以下几个`secret`, 不修改默认值的可以不建: | | | | ---- | ---- | | IBM_ACCOUNT | IBM Cloud的登录邮箱和密码, 一行邮箱, 一行密码. | | IBM_APP_NAME | IBM应用的名称.| | IBM_MEMORY | IBM应用内存大小, 默认值`128M`.| | V2_ID | vmess id, 默认值`d007eab8-ac2a-4a7f-287a-f0d50ef08680`.| | V2_PATH | ws path, 默认值`path`.| | ALTER_ID | alterId, 默认值`1`.| | VLESS_EN | 是否使用`vless`, 默认值`false`.| * 点击项目 `Actions`, 点击`IBM Cloud Deploy`, 点击`Run workflow`, 后续每周会自动部署一次(IBM 10天不用会停). * 如果需要其他配置, 可以编辑自己仓库的`config/config.json`文件. ### 客户端设置 #### Clash 下面为对应的`vmess`部分设置.修改其中的`server`,`uuid`,`alterId`,`path`就好了. ``` - name: "IBM" type: vmess server: cloudflare_workers.dev port: 443 uuid: V2_ID alterId: ALTER_ID cipher: none udp: true tls: true network: ws ws-path: /V2_PATH ``` #### v2rayng ``` address: cloudflare_workers.dev port: 443 id: V2_ID alterId: ALTER_ID security: none network: ws path: /V2_PATH 底层传输安全: tls ``` `server` `address` 可以使用 `cloudflare.com`或者别的`CF`的比较快的IP,对应的加一个伪装设置就行. ``` clash: server: cloudflare.com ws-headers: Host: cloudflare_workers.dev v2rayng: address: cloudflare.com 伪装域名: cloudflare_workers.dev ``` ================================================ FILE: config/config_vless.json ================================================ { "inbounds": [ { "sniffing": { "enabled": true, "destOverride": ["http", "tls"] }, "port": 8080, "listen":"0.0.0.0", "protocol": "vless", "settings": { "decryption": "none", "clients": [ { "id": "V2_ID" } ] }, "streamSettings": { "network": "ws", "wsSettings": { "path": "/V2_PATH" } } } ], "outbounds": [ { "protocol": "freedom", "settings": {}, "tag": "direct" }, { "protocol": "blackhole", "settings": {}, "tag": "block" } ], "routing": { "domainStrategy": "AsIs", "rules": [ { "type": "field", "outboundTag": "block", "protocol": ["bittorrent"] }, { "type": "field", "outboundTag": "block", "ip": [ "0.0.0.0/8", "10.0.0.0/8", "127.0.0.0/8", "172.16.0.0/12", "192.168.0.0/16" ] } ] } } ================================================ FILE: config/config_vmess.json ================================================ { "inbounds": [ { "sniffing": { "enabled": true, "destOverride": ["http", "tls"] }, "port": 8080, "listen":"0.0.0.0", "protocol": "vmess", "settings": { "clients": [ { "alterId": ALTER_ID, "security": "none", "id": "V2_ID" } ] }, "streamSettings": { "network": "ws", "wsSettings": { "path": "/V2_PATH" } } } ], "outbounds": [ { "protocol": "freedom", "settings": {}, "tag": "direct" }, { "protocol": "blackhole", "settings": {}, "tag": "block" } ], "routing": { "domainStrategy": "AsIs", "rules": [ { "type": "field", "outboundTag": "block", "protocol": ["bittorrent"] }, { "type": "field", "outboundTag": "block", "ip": [ "0.0.0.0/8", "10.0.0.0/8", "127.0.0.0/8", "172.16.0.0/12", "192.168.0.0/16" ] } ] } } ================================================ FILE: config/manifest.yml ================================================ applications: - path: . name: IBM_APP_NAME instances: 1 random-route: true disk_quota: 128M memory: IBM_MEMORY command: ./d.sh && ./IBM_APP_NAME -c config.json buildpacks: - binary_buildpack ================================================ FILE: deploy.sh ================================================ #! /bin/bash cd $(dirname $0) IBMCLOUD=$(pwd)/Bluemix_CLI/bin/ibmcloud CF=~/.bluemix/.cf/cfcli/cf #BLUE="\e[00;34m" #RED="\e[00;31m" #END="\e[0m" BLUE="" RED="" END="===================================" if [ ! -f "$IBMCLOUD" ]; then echo "${BLUE}download ibm-cloud-cli-release${END}" ver=$(curl -s https://github.com/IBM-Cloud/ibm-cloud-cli-release/releases/latest | grep -Po "(\d+\.){2}\d+") #ver=1.1.0 wget -q -Oibm_cli.tgz https://clis.cloud.ibm.com/download/bluemix-cli/$ver/linux64 if [ $? -eq 0 ]; then tar xzf ibm_cli.tgz else echo "${RED}download new version failed!${END}" exit 1 fi rm -fv ibm_cli.tgz fi # set default env IBM_MEMORY=${IBM_MEMORY:-"128M"} V2_ID=${V2_ID:-"d007eab8-ac2a-4a7f-287a-f0d50ef08680"} V2_PATH=${V2_PATH:-"path"} ALTER_ID=${ALTER_ID:-"1"} VLESS_EN=${VLESS_EN:-"false"} mkdir -p $IBM_APP_NAME if [ ! -f "./config/v2ray" ]; then echo "${BLUE}download v2ray${END}" pushd ./config new_ver=$(curl -s https://github.com/v2fly/v2ray-core/releases/latest | grep -Po "(\d+\.){2}\d+") wget -q -Ov2ray.zip https://github.com/v2fly/v2ray-core/releases/download/v${new_ver}/v2ray-linux-64.zip if [ $? -eq 0 ]; then 7z x v2ray.zip v2ray v2ctl *.dat chmod 700 v2ctl v2ray else echo "${RED}download new version failed!${END}" exit 1 fi rm -fv v2ray.zip popd fi # cloudfoundry config cp -rvf ./config/manifest.yml ./$IBM_APP_NAME/ sed "s/IBM_APP_NAME/${IBM_APP_NAME}/" ./$IBM_APP_NAME/manifest.yml -i sed "s/IBM_MEMORY/${IBM_MEMORY}/" ./$IBM_APP_NAME/manifest.yml -i # v2ray config cp -vf ./config/v2ray ./$IBM_APP_NAME/$IBM_APP_NAME cp -vf ./config/v2ctl ./$IBM_APP_NAME/ branch=${GITHUB_REF#refs/heads/} if [ $VLESS_EN == "false" ]; then { echo "#! /bin/bash" echo "wget -Oconfig.json https://raw.githubusercontent.com/$GITHUB_REPOSITORY/$branch/config/config_vmess.json" echo "sed 's/V2_ID/$V2_ID/' config.json -i" echo "sed 's/V2_PATH/$V2_PATH/' config.json -i" echo "sed 's/ALTER_ID/$ALTER_ID/' config.json -i" } > ./$IBM_APP_NAME/d.sh else { echo "#! /bin/bash" echo "wget -Oconfig.json https://raw.githubusercontent.com/$GITHUB_REPOSITORY/$branch/config/config_vless.json" echo "sed 's/V2_ID/$V2_ID/' config.json -i" echo "sed 's/V2_PATH/$V2_PATH/' config.json -i" } > ./$IBM_APP_NAME/d.sh fi chmod +x ./$IBM_APP_NAME/d.sh #cat ./$IBM_APP_NAME/d.sh #exit 0 if [ ! -f "$CF" ]; then echo "${BLUE}ibmcloud cf install${END}" $IBMCLOUD cf install -f fi echo "${BLUE}cf login${END}" $CF login -a https://api.us-south.cf.cloud.ibm.com <