Skip to content

Commit

Permalink
Add github api bypass
Browse files Browse the repository at this point in the history
  • Loading branch information
ARTI5T committed Aug 28, 2024
1 parent 5e6c723 commit 29a870a
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 2 deletions.
1 change: 1 addition & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ RUN apt install -y jq
ARG BUNGEE_HOME=/server
ENV FRP_HOME=/frp
ENV UNION_API_ROOT=https://skin.mualliance.ltd/api/union
ENV GITHUB_API_ROOT=https://github-api-bypass.sjmc.club

COPY --chmod=755 scripts/* /usr/bin
COPY --chmod=644 frp ${FRP_HOME}
Expand Down
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,8 @@
暴露的端口为7001(tcp), 7002(kcp), 7003(quic)和7500(admin panel)。25565为玩家连接端口。通过`FRPS_WEBSERVER_USER`和`FRPS_WEBSERVER_PASSWORD`设置admin panel的用户名密码。
如要更换GitHub API镜像,请设置`GITHUB_API_ROOT`环境变量,如`https://api.github.com`。
2. (可选) 启用quic支持。
- 永久修改:
- 修改`/etc/sysctl.d/10-network-tcp-buff.conf`:
Expand Down
4 changes: 2 additions & 2 deletions scripts/github.sh
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,9 @@ IFS="/" read -r owner repo <<< "$repo"

# Use the GitHub API to fetch the latest release information, including pre-releases if specified
if [ "$pre_release" = true ]; then
latest_release=$(wget -qO- "https://api.github.com/repos/$owner/$repo/releases" | jq -r ".[0]")
latest_release=$(wget -qO- "${GITHUB_API_ROOT}/repos/$owner/$repo/releases" | jq -r ".[0]")
else
latest_release=$(wget -qO- "https://api.github.com/repos/$owner/$repo/releases/latest")
latest_release=$(wget -qO- "${GITHUB_API_ROOT}/repos/$owner/$repo/releases/latest")
fi

# Extract the download URL for the release asset that matches the filename pattern
Expand Down

0 comments on commit 29a870a

Please sign in to comment.