├── README.md ├── .github └── workflows │ └── update.yml ├── templates ├── v2raya-git.rb ├── v2raya.rb └── v2raya-unstable.rb ├── Formula ├── v2raya-git.rb ├── v2raya.rb └── v2raya-unstable.rb ├── updaters ├── v2raya-git.ps1 ├── v2raya.sh ├── v2raya-unstable.sh └── v2raya-unstable.ps1 └── LICENSE /README.md: -------------------------------------------------------------------------------- 1 | # homebrew-v2raya 2 | 3 | v2rayA's homebrew tap, mostly for macOS users, but also for Linux x64 users who are using linuxbrew. 4 | 5 | ## Tap this repository 6 | 7 | ```bash 8 | brew tap v2raya/v2raya 9 | ``` 10 | 11 | Install v2rayA 12 | 13 | ```bash 14 | brew install v2raya 15 | ``` 16 | 17 | Package `v2ray` from `homwbrew-core` will be installed as a dependency package. 18 | 19 | ## Run v2rayA 20 | 21 | Run on Terminal 22 | 23 | ```bash 24 | v2raya --lite 25 | ``` 26 | 27 | Run as a brew service 28 | 29 | ```bash 30 | brew services start v2raya 31 | ``` 32 | 33 | ## Open the Web Panel 34 | 35 | Open , and you will see the web panel, add your proxy servers and start proxing! 36 | -------------------------------------------------------------------------------- /.github/workflows/update.yml: -------------------------------------------------------------------------------- 1 | name: Update Formulas 2 | 3 | on: 4 | workflow_dispatch: 5 | schedule: 6 | - cron: '20 */8 * * *' 7 | jobs: 8 | update: 9 | runs-on: ubuntu-latest 10 | steps: 11 | - uses: actions/checkout@v3 12 | with: 13 | persist-credentials: false 14 | fetch-depth: 0 15 | - name: Run Updaters 16 | run: | 17 | sudo apt install jq -y >> /dev/null 18 | ls -lh 19 | git config --local user.email "41898282+github-actions[bot]@users.noreply.github.com" 20 | git config --local user.name "github-actions[bot]" 21 | bash -c "$(cat ./updaters/v2raya.sh)" 22 | bash -c "$(cat ./updaters/v2raya-unstable.sh)" 23 | # pwsh -c ./updaters/v2raya-unstable.ps1 24 | pwsh -c ./updaters/v2raya-git.ps1 25 | - name: Push 26 | uses: ad-m/github-push-action@master 27 | with: 28 | github_token: ${{ secrets.GITHUB_TOKEN }} 29 | branch: ${{ github.ref }} 30 | -------------------------------------------------------------------------------- /templates/v2raya-git.rb: -------------------------------------------------------------------------------- 1 | class V2rayaGit < Formula 2 | desc "Web-based GUI client of Project V" 3 | homepage "https://v2raya.org" 4 | license "AGPL-3.0-only" 5 | version "Current_Version" 6 | 7 | url "Current_Source_Url" 8 | sha256 "Current_File_Hash" 9 | 10 | depends_on "v2ray" 11 | depends_on "go" => :build 12 | depends_on "node" => :build 13 | depends_on "yarn" => :build 14 | 15 | def install 16 | ENV.deparallelize 17 | # ENV['PATH'] = "#{HOMEBREW_PREFIX}/opt/node@20/bin:#{ENV['PATH']}" 18 | chdir "gui" do 19 | system "yarn" 20 | system "yarn", "build" 21 | end 22 | cp_r "web", "service/server/router/" 23 | chdir "service" do 24 | system "go build -o \"v2raya\" -ldflags \"-X github.com/v2rayA/v2rayA/conf.Version=unstable-#{version} -s -w\"" 25 | end 26 | cp_r "service/v2raya", "v2raya-git" 27 | bin.install "v2raya-git" 28 | end 29 | 30 | service do 31 | environment_variables V2RAYA_LOG_FILE: "/tmp/v2raya-git.log", XDG_DATA_DIRS: "#{HOMEBREW_PREFIX}/share:/usr/local/share:/usr/share", PATH: "/usr/local/sbin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:#{HOMEBREW_PREFIX}/bin:" 32 | run [bin/"v2raya-git", "--lite"] 33 | keep_alive true 34 | end 35 | end 36 | -------------------------------------------------------------------------------- /Formula/v2raya-git.rb: -------------------------------------------------------------------------------- 1 | class V2rayaGit < Formula 2 | desc "Web-based GUI client of Project V" 3 | homepage "https://v2raya.org" 4 | license "AGPL-3.0-only" 5 | version "20251214.766c65e" 6 | 7 | url "https://github.com/v2rayA/v2rayA/archive/766c65e245df623bd56ed5f063ed7f81a09807f6.zip" 8 | sha256 "FF4AA21E1850E3E5E1B9AD39291FEECC96AB1F35D19AACA79E9C09910A3555B5" 9 | 10 | depends_on "v2ray" 11 | depends_on "go" => :build 12 | depends_on "node" => :build 13 | depends_on "yarn" => :build 14 | 15 | def install 16 | ENV.deparallelize 17 | # ENV['PATH'] = "#{HOMEBREW_PREFIX}/opt/node@20/bin:#{ENV['PATH']}" 18 | chdir "gui" do 19 | system "yarn" 20 | system "yarn", "build" 21 | end 22 | cp_r "web", "service/server/router/" 23 | chdir "service" do 24 | system "go build -o \"v2raya\" -ldflags \"-X github.com/v2rayA/v2rayA/conf.Version=unstable-#{version} -s -w\"" 25 | end 26 | cp_r "service/v2raya", "v2raya-git" 27 | bin.install "v2raya-git" 28 | end 29 | 30 | service do 31 | environment_variables V2RAYA_LOG_FILE: "/tmp/v2raya-git.log", XDG_DATA_DIRS: "#{HOMEBREW_PREFIX}/share:/usr/local/share:/usr/share", PATH: "/usr/local/sbin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:#{HOMEBREW_PREFIX}/bin:" 32 | run [bin/"v2raya-git", "--lite"] 33 | keep_alive true 34 | end 35 | end 36 | -------------------------------------------------------------------------------- /templates/v2raya.rb: -------------------------------------------------------------------------------- 1 | class V2raya < Formula 2 | desc "Web-based GUI client of Project V" 3 | homepage "https://v2raya.org" 4 | license "AGPL-3.0-only" 5 | version "TheRealVersion" 6 | 7 | $v2rayA_version = "TheRealVersion" 8 | $url_linux_x64 = "https://github.com/v2rayA/homebrew-v2raya/releases/download/TheRealVersion/v2raya-x86_64-linux.zip" 9 | $sha_linux_x64 = "RealSha256_Linux_x64" 10 | $url_macos_x64 = "https://github.com/v2rayA/homebrew-v2raya/releases/download/TheRealVersion/v2raya-x86_64-macos.zip" 11 | $sha_macos_x64 = "RealSha256_MacOS_x64" 12 | $url_macos_arm64 = "https://github.com/v2rayA/homebrew-v2raya/releases/download/TheRealVersion/v2raya-aarch64-macos.zip" 13 | $sha_macos_arm64 = "RealSha256_MacOS_arm64" 14 | 15 | if OS.linux? 16 | url $url_linux_x64 17 | sha256 $sha_linux_x64 18 | elsif Hardware::CPU.intel? 19 | url $url_macos_x64 20 | sha256 $sha_macos_x64 21 | else 22 | url $url_macos_arm64 23 | sha256 $sha_macos_arm64 24 | end 25 | 26 | depends_on "v2ray" 27 | 28 | def install 29 | bin.install "v2raya" 30 | puts "If you forget your password, stop running v2raya, then run `v2raya --lite --reset-password` to reset password." 31 | end 32 | 33 | service do 34 | environment_variables V2RAYA_LOG_FILE: "/tmp/v2raya.log", XDG_DATA_DIRS: "#{HOMEBREW_PREFIX}/share:/usr/local/share:/usr/share", PATH: "/usr/local/sbin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:#{HOMEBREW_PREFIX}/bin:" 35 | run [bin/"v2raya", "--lite"] 36 | keep_alive true 37 | end 38 | end 39 | -------------------------------------------------------------------------------- /Formula/v2raya.rb: -------------------------------------------------------------------------------- 1 | class V2raya < Formula 2 | desc "Web-based GUI client of Project V" 3 | homepage "https://v2raya.org" 4 | license "AGPL-3.0-only" 5 | version "2.2.7.4" 6 | 7 | $v2rayA_version = "2.2.7.4" 8 | $url_linux_x64 = "https://github.com/v2rayA/homebrew-v2raya/releases/download/2.2.7.4/v2raya-x86_64-linux.zip" 9 | $sha_linux_x64 = "69f61726fd5fa29c8720033b7748b260c8de1408e9d400688772724de7ca7a42" 10 | $url_macos_x64 = "https://github.com/v2rayA/homebrew-v2raya/releases/download/2.2.7.4/v2raya-x86_64-macos.zip" 11 | $sha_macos_x64 = "d24152a0bac58a2572e1f6677e75484b8940151f2a58bc9eb7b27702f185ba60" 12 | $url_macos_arm64 = "https://github.com/v2rayA/homebrew-v2raya/releases/download/2.2.7.4/v2raya-aarch64-macos.zip" 13 | $sha_macos_arm64 = "db789e90c8288ec462b5b6b8107086553bfe453d7dcae7fa5cf99cba530f65e6" 14 | 15 | if OS.linux? 16 | url $url_linux_x64 17 | sha256 $sha_linux_x64 18 | elsif Hardware::CPU.intel? 19 | url $url_macos_x64 20 | sha256 $sha_macos_x64 21 | else 22 | url $url_macos_arm64 23 | sha256 $sha_macos_arm64 24 | end 25 | 26 | depends_on "v2ray" 27 | 28 | def install 29 | bin.install "v2raya" 30 | puts "If you forget your password, stop running v2raya, then run `v2raya --lite --reset-password` to reset password." 31 | end 32 | 33 | service do 34 | environment_variables V2RAYA_LOG_FILE: "/tmp/v2raya.log", XDG_DATA_DIRS: "#{HOMEBREW_PREFIX}/share:/usr/local/share:/usr/share", PATH: "/usr/local/sbin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:#{HOMEBREW_PREFIX}/bin:" 35 | run [bin/"v2raya", "--lite"] 36 | keep_alive true 37 | end 38 | end 39 | -------------------------------------------------------------------------------- /templates/v2raya-unstable.rb: -------------------------------------------------------------------------------- 1 | class V2rayaUnstable < Formula 2 | desc "Web-based GUI client of Project V" 3 | homepage "https://v2raya.org" 4 | license "AGPL-3.0-only" 5 | version "TheRealVersion" 6 | 7 | $v2raya_version = "TheRealVersion" 8 | $url_linux_x64 = "RealUrl_Linux_x64" 9 | $sha_linux_x64 = "RealSha256_Linux_x64" 10 | $url_macos_x64 = "RealUrl_MacOS_x64" 11 | $sha_macos_x64 = "RealSha256_MacOS_x64" 12 | $url_macos_arm64 = "RealUrl_MacOS_arm64" 13 | $sha_macos_arm64 = "RealSha256_MacOS_arm64" 14 | 15 | if OS.linux? 16 | url $url_linux_x64 17 | sha256 $sha_linux_x64 18 | $os_type = "linux_x64" 19 | elsif Hardware::CPU.intel? 20 | url $url_macos_x64 21 | sha256 $sha_macos_x64 22 | $os_type = "darwin_x64" 23 | else 24 | url $url_macos_arm64 25 | sha256 $sha_macos_arm64 26 | $os_type = "darwin_arm64" 27 | end 28 | 29 | depends_on "v2ray" 30 | 31 | def install 32 | bin.install "v2raya_#{$os_type}_unstable-#{version}" => "v2raya-unstable" 33 | puts "v2raya-unstable installed, don't run both v2raya and v2raya-unstable service at the same time, or write launchd's plist file yourself to specify ports used by v2raya-unstable." 34 | puts "If you forget your password, stop running v2raya-unstable, then run `v2raya-unstable --lite --reset-password` to reset password." 35 | end 36 | 37 | service do 38 | environment_variables V2RAYA_LOG_FILE: "/tmp/v2raya-unstable.log", XDG_DATA_DIRS: "#{HOMEBREW_PREFIX}/share:/usr/local/share:/usr/share", PATH: "/usr/local/sbin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:#{HOMEBREW_PREFIX}/bin:" 39 | run [bin/"v2raya-unstable", "--lite"] 40 | keep_alive true 41 | end 42 | end 43 | -------------------------------------------------------------------------------- /updaters/v2raya-git.ps1: -------------------------------------------------------------------------------- 1 | $Latest_Commit_ID = (((Invoke-RestMethod -Uri "https://api.github.com/repos/v2rayA/v2rayA/commits/main").commit).url).Split('/')[8] 2 | $Latest_Source_Url = "https://github.com/v2rayA/v2rayA/archive/$Latest_Commit_ID.zip" 3 | 4 | Set-PSDebug -Strict -Trace 1 5 | 6 | Invoke-WebRequest -Uri $Latest_Source_Url -OutFile "./v2rayA-$Latest_Commit_ID" 7 | $Latest_File_Hash = (Get-FileHash "./v2rayA-$Latest_Commit_ID").hash 8 | 9 | $Latest_Version_Date = ((((((Invoke-RestMethod -Uri "https://api.github.com/repos/v2rayA/v2rayA/commits/main").commit).author) | ConvertTo-Json).Split('"')[11]).Split('T')[0]) -replace '-','' 10 | $Latest_Version = $Latest_Version_Date + "." + $(($Latest_Commit_ID)|cut -b 1-7) 11 | 12 | $Current_Version = Get-Content -Path "./Formula/v2raya-git.rb" | Select-String 'version ' | ForEach-Object { ([string]$_).split('"')[1]} 13 | 14 | if ([String]::IsNullOrEmpty($Latest_Commit_ID)) { 15 | Write-Output "GitHub API rate limit exceeded, please try again later." 16 | exit 17 | } 18 | 19 | if ($Current_Version -eq $Latest_Version) { 20 | Write-Output "Nothing to do, you have the latest version of v2raya-git." 21 | }else{ 22 | (Get-Content -Path "./templates/v2raya-git.rb") -replace "Current_Source_Url", $Latest_Source_Url | Out-File "./Formula/v2raya-git.rb" 23 | (Get-Content -Path "./Formula/v2raya-git.rb") -replace "Current_Version", $Latest_Version | Out-File "./Formula/v2raya-git.rb" 24 | (Get-Content -Path "./Formula/v2raya-git.rb") -replace "Current_File_Hash", $Latest_File_Hash | Out-File "./Formula/v2raya-git.rb" 25 | git commit "./Formula/v2raya-git.rb" -m "v2raya-git: update to version $Latest_Version" 26 | } 27 | 28 | Set-PSDebug -Off 29 | -------------------------------------------------------------------------------- /Formula/v2raya-unstable.rb: -------------------------------------------------------------------------------- 1 | class V2rayaUnstable < Formula 2 | desc "Web-based GUI client of Project V" 3 | homepage "https://v2raya.org" 4 | license "AGPL-3.0-only" 5 | version "" 6 | 7 | $v2raya_version = "" 8 | $url_linux_x64 = "https://nightly.link/v2rayA/v2rayA/actions/runs//.zip" 9 | $sha_linux_x64 = "795f3f4bfc2ab395ad6249e8f8a963b754f1dc91d2acbf7733596a546f8708ad" 10 | $url_macos_x64 = "https://nightly.link/v2rayA/v2rayA/actions/runs//.zip" 11 | $sha_macos_x64 = "795f3f4bfc2ab395ad6249e8f8a963b754f1dc91d2acbf7733596a546f8708ad" 12 | $url_macos_arm64 = "https://nightly.link/v2rayA/v2rayA/actions/runs//.zip" 13 | $sha_macos_arm64 = "795f3f4bfc2ab395ad6249e8f8a963b754f1dc91d2acbf7733596a546f8708ad" 14 | 15 | if OS.linux? 16 | url $url_linux_x64 17 | sha256 $sha_linux_x64 18 | $os_type = "linux_x64" 19 | elsif Hardware::CPU.intel? 20 | url $url_macos_x64 21 | sha256 $sha_macos_x64 22 | $os_type = "darwin_x64" 23 | else 24 | url $url_macos_arm64 25 | sha256 $sha_macos_arm64 26 | $os_type = "darwin_arm64" 27 | end 28 | 29 | depends_on "v2ray" 30 | 31 | def install 32 | bin.install "v2raya_#{$os_type}_unstable-#{version}" => "v2raya-unstable" 33 | puts "v2raya-unstable installed, don't run both v2raya and v2raya-unstable service at the same time, or write launchd's plist file yourself to specify ports used by v2raya-unstable." 34 | puts "If you forget your password, stop running v2raya-unstable, then run `v2raya-unstable --lite --reset-password` to reset password." 35 | end 36 | 37 | service do 38 | environment_variables V2RAYA_LOG_FILE: "/tmp/v2raya-unstable.log", XDG_DATA_DIRS: "#{HOMEBREW_PREFIX}/share:/usr/local/share:/usr/share", PATH: "/usr/local/sbin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:#{HOMEBREW_PREFIX}/bin:" 39 | run [bin/"v2raya-unstable", "--lite"] 40 | keep_alive true 41 | end 42 | end 43 | -------------------------------------------------------------------------------- /updaters/v2raya.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | set -x 4 | 5 | if ! curl -sL https://api.github.com/repos/v2rayA/homebrew-v2raya/releases/latest > /tmp/v2raya.json; then 6 | echo "GitHub API rate limit exceeded, please try again later." 7 | exit 8 | fi 9 | latest_version=$(cat /tmp/v2raya.json | jq -r '.tag_name') 10 | if [ "$latest_version" == "null" ]; then 11 | echo "GitHub API rate limit exceeded, please try again later." 12 | exit 13 | fi 14 | current_version=$(cat ./Formula/v2raya.rb | grep 'v2rayA_version =' | awk -F '"' '{print $2}') 15 | if [ "$current_version" != "$latest_version" ]; then 16 | if ! curl -sL https://github.com/v2rayA/homebrew-v2raya/releases/download/$latest_version/v2raya-x86_64-linux.zip.sha256.txt > /tmp/v2raya-linux.sha256; then 17 | echo "GitHub API rate limit exceeded, please try again later." 18 | exit 19 | else 20 | latest_sha_linux_x64="$(cat /tmp/v2raya-linux.sha256 | awk '{print $1}')" 21 | fi 22 | if ! curl -sL https://github.com/v2rayA/homebrew-v2raya/releases/download/$latest_version/v2raya-x86_64-macos.zip.sha256.txt > /tmp/v2raya-macos.sha256; then 23 | echo "GitHub API rate limit exceeded, please try again later." 24 | exit 25 | else 26 | latest_sha_macos_x64="$(cat /tmp/v2raya-macos.sha256 | awk '{print $1}')" 27 | fi 28 | if ! curl -Ls https://github.com/v2rayA/homebrew-v2raya/releases/download/$latest_version/v2raya-aarch64-macos.zip.sha256.txt > /tmp/v2raya-macos-arm64.sha256; then 29 | echo "GitHub API rate limit exceeded, please try again later." 30 | exit 31 | else 32 | latest_sha_macos_arm64="$(cat /tmp/v2raya-macos-arm64.sha256 | awk '{print $1}')" 33 | fi 34 | cat ./templates/v2raya.rb | sed "s|TheRealVersion|$latest_version|g" > ./Formula/v2raya.rb 35 | sed -i "s|RealSha256_MacOS_arm64|$latest_sha_macos_arm64|g" ./Formula/v2raya.rb 36 | sed -i "s|RealSha256_MacOS_x64|$latest_sha_macos_x64|g" ./Formula/v2raya.rb 37 | sed -i "s|RealSha256_Linux_x64|$latest_sha_linux_x64|g" ./Formula/v2raya.rb 38 | git commit ./Formula/v2raya.rb -m "v2raya: update to $latest_version" 39 | else 40 | echo "Nothing to do, you have the latest version of v2raya." 41 | fi 42 | -------------------------------------------------------------------------------- /updaters/v2raya-unstable.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | set -x 4 | 5 | latest_action_id=$(curl -sL https://scoop-apps.vercel.app/v2rayA/v2rayA | grep 'data-url=' | grep 'summary_partial' | awk -F '"' '{print $2}' | awk -F '/' '{print $6}') 6 | latest_linux_x64=$(curl -sL https://scoop-apps.vercel.app/v2rayA/v2rayA | grep v2raya_linux_x64 |awk 'NR==1' |awk '{print $1}') 7 | latest_darwin_x64=$(curl -sL https://scoop-apps.vercel.app/v2rayA/v2rayA | grep v2raya_darwin_x64 |awk 'NR==1' |awk '{print $1}') 8 | latest_darwin_arm64=$(curl -sL https://scoop-apps.vercel.app/v2rayA/v2rayA | grep v2raya_darwin_arm64 |awk 'NR==1' |awk '{print $1}') 9 | 10 | 11 | url_linux_x64='https://nightly.link/v2rayA/v2rayA/actions/runs/'"$latest_action_id""/$latest_linux_x64.zip" 12 | url_darwin_x64='https://nightly.link/v2rayA/v2rayA/actions/runs/'"$latest_action_id""/$latest_darwin_x64.zip" 13 | url_darwin_arm64='https://nightly.link/v2rayA/v2rayA/actions/runs/'"$latest_action_id""/$latest_darwin_arm64.zip" 14 | 15 | version=$(echo "$latest_darwin_x64" | cut -d'-' -f2) 16 | current_version=$(cat ./Formula/v2raya-unstable.rb | grep 'version =' | awk -F '"' '{print $2}') 17 | 18 | if [ "$current_version" != "$version" ]; then 19 | ## Replace version 20 | cat ./templates/v2raya-unstable.rb | sed "s|TheRealVersion|$version|g" > ./Formula/v2raya-unstable.rb 21 | ## Replace linux x64 22 | curl -sL "$url_linux_x64" -o v2raya_linux_x64.zip 23 | sha_linux_x64=$(sha256sum v2raya_linux_x64.zip | awk '{print $1}'); rm v2raya_linux_x64.zip 24 | sed -i "s|RealUrl_Linux_x64|$url_linux_x64|g" ./Formula/v2raya-unstable.rb 25 | sed -i "s|RealSha256_Linux_x64|$sha_linux_x64|g" ./Formula/v2raya-unstable.rb 26 | ## Replace sha256 darwin x64 27 | curl -sL "$url_darwin_x64" -o v2raya_darwin_x64.zip 28 | sha_darwin_x64=$(sha256sum v2raya_darwin_x64.zip | awk '{print $1}'); rm v2raya_darwin_x64.zip 29 | sed -i "s|RealUrl_MacOS_x64|$url_darwin_x64|g" ./Formula/v2raya-unstable.rb 30 | sed -i "s|RealSha256_MacOS_x64|$sha_darwin_x64|g" ./Formula/v2raya-unstable.rb 31 | ## Replace sha256 darwin arm64 32 | curl -sL "$url_darwin_arm64" -o v2raya_darwin_arm64.zip 33 | sha_darwin_arm64=$(sha256sum v2raya_darwin_arm64.zip | awk '{print $1}'); rm v2raya_darwin_arm64.zip 34 | sed -i "s|RealUrl_MacOS_arm64|$url_darwin_arm64|g" ./Formula/v2raya-unstable.rb 35 | sed -i "s|RealSha256_MacOS_arm64|$sha_darwin_arm64|g" ./Formula/v2raya-unstable.rb 36 | ## Commit 37 | git commit ./Formula/v2raya-unstable.rb -m "v2raya-unstable: update to $version" 38 | else 39 | echo "Nothing to do, you have the latest version of v2raya-unstable." 40 | fi -------------------------------------------------------------------------------- /updaters/v2raya-unstable.ps1: -------------------------------------------------------------------------------- 1 | $latest_run_id = ((Invoke-RestMethod "https://api.github.com/repos/v2rayA/v2rayA/actions/workflows/release_main.yml/runs").workflow_runs).jobs_url | Select-Object -First 1 | ForEach-Object { ([string]$_).split('/')[8]} 2 | $latest_unstable_version = ((Invoke-RestMethod "https://api.github.com/repos/v2rayA/v2rayA/actions/runs/$latest_run_id/artifacts").artifacts).name | Select-Object -First 1 | ForEach-Object { ([string]$_).split('-')[1]} | ForEach-Object { ([string]$_).split('.pkg')[0]} 3 | $current_unstable_version = Get-Content ./Formula/v2raya-unstable.rb | Select-String 'v2raya_version' | ForEach-Object { ([string]$_).split('"')[1]} 4 | if ($latest_unstable_version) { 5 | Write-Output "Get $latest_unstable_version from GitHub API." 6 | }else{ 7 | Write-Output "Get null from GitHub API, don't update v2raya-unstable." 8 | exit 9 | } 10 | if ($current_unstable_version -eq $latest_unstable_version) { 11 | Write-Output "Nothing to do, you have the latest version of v2raya-unstable." 12 | }else{ 13 | $latest_linux_x64 = "https://nightly.link/v2rayA/v2rayA/actions/runs/$latest_run_id/v2raya_linux_x64_unstable-$latest_unstable_version.zip" 14 | Write-Output $latest_linux_x64 15 | $latest_darwin_x64 = "https://nightly.link/v2rayA/v2rayA/actions/runs/$latest_run_id/v2raya_darwin_x64_unstable-$latest_unstable_version.zip" 16 | Write-Output $latest_darwin_x64 17 | $latest_darwin_arm64 = "https://nightly.link/v2rayA/v2rayA/actions/runs/$latest_run_id/v2raya_darwin_arm64_unstable-$latest_unstable_version.zip" 18 | Write-Output $latest_darwin_arm64 19 | $latest_linux_x64, $latest_darwin_x64, $latest_darwin_arm64 | ForEach-Object { 20 | $filename = $_.Split('/')[-1] 21 | $filepath = "./$filename" 22 | if (Test-Path $filepath) { 23 | Write-Output "$filepath already exists." 24 | }else{ 25 | Invoke-WebRequest -Uri $_ -OutFile $filepath 26 | } 27 | } 28 | $sha256_linux_x64 = ((Get-FileHash "./v2raya_linux_x64_unstable-$latest_unstable_version.zip" -Algorithm SHA256).Hash).ToLower() 29 | Write-Output $sha256_linux_x64 30 | $sha256_darwin_x64 = ((Get-FileHash "./v2raya_darwin_x64_unstable-$latest_unstable_version.zip" -Algorithm SHA256).Hash).ToLower() 31 | Write-Output $sha256_darwin_x64 32 | $sha256_darwin_arm64 = ((Get-FileHash "./v2raya_darwin_arm64_unstable-$latest_unstable_version.zip" -Algorithm SHA256).Hash).ToLower() 33 | Write-Output $sha256_darwin_arm64 34 | Get-Content "./templates/v2raya-unstable.rb" | ForEach-Object { $_ -replace 'TheRealVersion', $latest_unstable_version } | ForEach-Object { $_ -replace 'RealUrl_Linux_x64', $latest_linux_x64 } | ForEach-Object { $_ -replace 'RealUrl_MacOS_x64', $latest_darwin_x64 } | ForEach-Object { $_ -replace 'RealUrl_MacOS_arm64', $latest_darwin_arm64 } | ForEach-Object { $_ -replace 'TheRealVersion', $latest_unstable_version } | ForEach-Object { $_ -replace 'RealSha256_Linux_x64', $sha256_linux_x64 } | ForEach-Object { $_ -replace 'RealSha256_MacOS_x64', $sha256_darwin_x64 } | ForEach-Object { $_ -replace 'RealSha256_MacOS_arm64', $sha256_darwin_arm64 } | Set-Content "./Formula/v2raya-unstable.rb" 35 | Remove-Item -Path "v2raya_*.zip" -Force -Recurse 36 | git commit "./Formula/v2raya-unstable.rb" -m "v2raya-unstable: update to $latest_unstable_version" 37 | } 38 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | Creative Commons Legal Code 2 | 3 | CC0 1.0 Universal 4 | 5 | CREATIVE COMMONS CORPORATION IS NOT A LAW FIRM AND DOES NOT PROVIDE 6 | LEGAL SERVICES. DISTRIBUTION OF THIS DOCUMENT DOES NOT CREATE AN 7 | ATTORNEY-CLIENT RELATIONSHIP. CREATIVE COMMONS PROVIDES THIS 8 | INFORMATION ON AN "AS-IS" BASIS. CREATIVE COMMONS MAKES NO WARRANTIES 9 | REGARDING THE USE OF THIS DOCUMENT OR THE INFORMATION OR WORKS 10 | PROVIDED HEREUNDER, AND DISCLAIMS LIABILITY FOR DAMAGES RESULTING FROM 11 | THE USE OF THIS DOCUMENT OR THE INFORMATION OR WORKS PROVIDED 12 | HEREUNDER. 13 | 14 | Statement of Purpose 15 | 16 | The laws of most jurisdictions throughout the world automatically confer 17 | exclusive Copyright and Related Rights (defined below) upon the creator 18 | and subsequent owner(s) (each and all, an "owner") of an original work of 19 | authorship and/or a database (each, a "Work"). 20 | 21 | Certain owners wish to permanently relinquish those rights to a Work for 22 | the purpose of contributing to a commons of creative, cultural and 23 | scientific works ("Commons") that the public can reliably and without fear 24 | of later claims of infringement build upon, modify, incorporate in other 25 | works, reuse and redistribute as freely as possible in any form whatsoever 26 | and for any purposes, including without limitation commercial purposes. 27 | These owners may contribute to the Commons to promote the ideal of a free 28 | culture and the further production of creative, cultural and scientific 29 | works, or to gain reputation or greater distribution for their Work in 30 | part through the use and efforts of others. 31 | 32 | For these and/or other purposes and motivations, and without any 33 | expectation of additional consideration or compensation, the person 34 | associating CC0 with a Work (the "Affirmer"), to the extent that he or she 35 | is an owner of Copyright and Related Rights in the Work, voluntarily 36 | elects to apply CC0 to the Work and publicly distribute the Work under its 37 | terms, with knowledge of his or her Copyright and Related Rights in the 38 | Work and the meaning and intended legal effect of CC0 on those rights. 39 | 40 | 1. Copyright and Related Rights. A Work made available under CC0 may be 41 | protected by copyright and related or neighboring rights ("Copyright and 42 | Related Rights"). Copyright and Related Rights include, but are not 43 | limited to, the following: 44 | 45 | i. the right to reproduce, adapt, distribute, perform, display, 46 | communicate, and translate a Work; 47 | ii. moral rights retained by the original author(s) and/or performer(s); 48 | iii. publicity and privacy rights pertaining to a person's image or 49 | likeness depicted in a Work; 50 | iv. rights protecting against unfair competition in regards to a Work, 51 | subject to the limitations in paragraph 4(a), below; 52 | v. rights protecting the extraction, dissemination, use and reuse of data 53 | in a Work; 54 | vi. database rights (such as those arising under Directive 96/9/EC of the 55 | European Parliament and of the Council of 11 March 1996 on the legal 56 | protection of databases, and under any national implementation 57 | thereof, including any amended or successor version of such 58 | directive); and 59 | vii. other similar, equivalent or corresponding rights throughout the 60 | world based on applicable law or treaty, and any national 61 | implementations thereof. 62 | 63 | 2. Waiver. To the greatest extent permitted by, but not in contravention 64 | of, applicable law, Affirmer hereby overtly, fully, permanently, 65 | irrevocably and unconditionally waives, abandons, and surrenders all of 66 | Affirmer's Copyright and Related Rights and associated claims and causes 67 | of action, whether now known or unknown (including existing as well as 68 | future claims and causes of action), in the Work (i) in all territories 69 | worldwide, (ii) for the maximum duration provided by applicable law or 70 | treaty (including future time extensions), (iii) in any current or future 71 | medium and for any number of copies, and (iv) for any purpose whatsoever, 72 | including without limitation commercial, advertising or promotional 73 | purposes (the "Waiver"). Affirmer makes the Waiver for the benefit of each 74 | member of the public at large and to the detriment of Affirmer's heirs and 75 | successors, fully intending that such Waiver shall not be subject to 76 | revocation, rescission, cancellation, termination, or any other legal or 77 | equitable action to disrupt the quiet enjoyment of the Work by the public 78 | as contemplated by Affirmer's express Statement of Purpose. 79 | 80 | 3. Public License Fallback. Should any part of the Waiver for any reason 81 | be judged legally invalid or ineffective under applicable law, then the 82 | Waiver shall be preserved to the maximum extent permitted taking into 83 | account Affirmer's express Statement of Purpose. In addition, to the 84 | extent the Waiver is so judged Affirmer hereby grants to each affected 85 | person a royalty-free, non transferable, non sublicensable, non exclusive, 86 | irrevocable and unconditional license to exercise Affirmer's Copyright and 87 | Related Rights in the Work (i) in all territories worldwide, (ii) for the 88 | maximum duration provided by applicable law or treaty (including future 89 | time extensions), (iii) in any current or future medium and for any number 90 | of copies, and (iv) for any purpose whatsoever, including without 91 | limitation commercial, advertising or promotional purposes (the 92 | "License"). The License shall be deemed effective as of the date CC0 was 93 | applied by Affirmer to the Work. Should any part of the License for any 94 | reason be judged legally invalid or ineffective under applicable law, such 95 | partial invalidity or ineffectiveness shall not invalidate the remainder 96 | of the License, and in such case Affirmer hereby affirms that he or she 97 | will not (i) exercise any of his or her remaining Copyright and Related 98 | Rights in the Work or (ii) assert any associated claims and causes of 99 | action with respect to the Work, in either case contrary to Affirmer's 100 | express Statement of Purpose. 101 | 102 | 4. Limitations and Disclaimers. 103 | 104 | a. No trademark or patent rights held by Affirmer are waived, abandoned, 105 | surrendered, licensed or otherwise affected by this document. 106 | b. Affirmer offers the Work as-is and makes no representations or 107 | warranties of any kind concerning the Work, express, implied, 108 | statutory or otherwise, including without limitation warranties of 109 | title, merchantability, fitness for a particular purpose, non 110 | infringement, or the absence of latent or other defects, accuracy, or 111 | the present or absence of errors, whether or not discoverable, all to 112 | the greatest extent permissible under applicable law. 113 | c. Affirmer disclaims responsibility for clearing rights of other persons 114 | that may apply to the Work or any use thereof, including without 115 | limitation any person's Copyright and Related Rights in the Work. 116 | Further, Affirmer disclaims responsibility for obtaining any necessary 117 | consents, permissions or other rights required for any use of the 118 | Work. 119 | d. Affirmer understands and acknowledges that Creative Commons is not a 120 | party to this document and has no duty or obligation with respect to 121 | this CC0 or use of the Work. 122 | --------------------------------------------------------------------------------