Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

alist存储:github发布、github API 能否增加 ghproxy、CDN加速 通用的代理,而不是alist-proxy,因为ghproxy、CDN加速 实在是太多了 #7963

Open
4 tasks done
chrisdong opened this issue Feb 8, 2025 · 6 comments
Labels
enhancement New feature or request

Comments

@chrisdong
Copy link

chrisdong commented Feb 8, 2025

Please make sure of the following things

  • I have read the documentation.
  • I'm sure there are no duplicate issues or discussions.
  • I'm sure this feature is not implemented.
  • I'm sure it's a reasonable and popular requirement.

Description of the feature / 需求描述

#7844 (comment) 这里提到AlistGo/alist-proxy 作为代理,但是有一个问题, 非80和443端口,无法用 cloudflare搭建的 alist代理。

因为 宽带运营商不给80和443端口,我家里有公网ip,在小主机上搭建alist 用的5244端口,无法用 cloudflare搭建的 alist代理(已实测5244不可以)。

建议 github 发布 存储 增加一项 ghproxy的地址栏,这种github专用代理非常多,失效可以随时换成其他的。

GitHub API 采用 CDN加速github仓库里的文件
https://cdn.jsdelivr.net/gh/{github用户名}/{仓库名}@{分支名}/,其中 {github用户名}、{仓库名}、{分支名}分别对应Github用户名、仓库名、分支名。 这个是 jsdelivr 提供的加速CDN,有点不稳定,但有N个 jsdelivr 开源项目可用。
某个仓库里的一个iptv文件直链加速链接是 https://cdn.jsdmirror.cn/gh/wwb521/live/movies.json ,这个链接可以直接用在 iptv app里面。
洛雪音乐源 https://fastly.jsdelivr.net/gh/Huibq/keep-alive/render_api.js

Image

ghproxy 加速releases文件
ghproxy 原作者 https://github.com/hunshcn/gh-proxy
ghproxy各种代理合集、测速 https://yishijie.gitlab.io/ziyuan/

CDN加速 仓库里的文件
免费的CDN加速网址(有12个) https://github.com/jsdmirror/JSDMirrorhttps://cnb.cool/jsdmirror/jsdmirror
利用vercel一键搭建CDN稳定(要绑定自己的域名) https://github.com/rong6/jsd

github releases有一个实用的案例,就是 把常用的github开源软件 搭建到alist里,如果软件有新版,直接到alist去找。
github api 实用案例,加速一个在 github仓库里的 iptv文件或者 在线音乐源文件给 空壳播放器用。

Suggested solution / 实现思路

No response

Additional context / 附件

No response

@chrisdong chrisdong added the enhancement New feature or request label Feb 8, 2025
@yyyytawa
Copy link

yyyytawa commented Feb 8, 2025

你可以选择使用代理地址,然后代理地址再重定向到ghproxy曲线救国

@chrisdong
Copy link
Author

你可以选择使用代理地址,然后代理地址再重定向到ghproxy

Image

麻烦问一下 在alist里 如何操作?

@yyyytawa
Copy link

yyyytawa commented Feb 8, 2025

打开web代理 然后填入你的代理url(随便写一个你能用的) 例如说我这边是https://sub.example.com
然后随便点一个文件下载,肯定会无法下载的,然后记下获取到的链接,例如
https://test2.yyyyt.top/test/ghr/alist-web-gh/3.42.0/dist.zip?sign=sIEvFcGnLSDGTUdOvadldOy2Q775Omjv-kO4mvuZ8OI=:1739037789
紧接着建一个站点在sub.example.com 让nginx重定向请求(也可以用cf的重定向功能)保留url参数. 例如说我这边挂在到的是/test/ghr 挂载alist的web的发布到alist-web-gh文件夹下那么就让nginx重定向请求并保留url

让nginx把https://sub.example.com/test/ghr/alist-web-gh/*的请求重定向到 https://ghmirror.cn/https://github.com/此处省略一大堆/
同时保留url
这个不太方便用语言说...可能会说不清楚
反正就是利用后面的路径都一样 只是前面不一样 然后让alist返回代理地址,代理地址再依靠后面的路径重定向到ghmirror的地址来实现的
比如说上面那个例子实现起来就是这样
alist重定向到https://test2.yyyyt.top/test/ghr/alist-web-gh/3.42.0/dist.zip?sign=sIEvFcGnLSDGTUdOvadldOy2Q775Omjv-kO4mvuZ8OI=:1739037789
然后test2.yyyyt.top/test/ghr/alist-web-gh/3.42.0/dist.zip?xxxxx
再重定向给https://ghmirror/https://github.com/AlistGo/alist-web/releases/download/3.42.0/dist.zip
实现调用ghmirror
说白了就是根据后面的路径如/3.42.0/dist.zip 都是一样的然后可以靠代理地址二次重定向来实现的

@chrisdong chrisdong changed the title github releases 存储 能否增加 ghproxy通用的代理,而不是alist-proxy,因为ghproxy实在是太多了 github releases 存储 能否增加 ghproxy或CDN加速 通用的代理,而不是alist-proxy,因为ghproxy、CDN加速 实在是太多了 Feb 9, 2025
@chrisdong chrisdong changed the title github releases 存储 能否增加 ghproxy或CDN加速 通用的代理,而不是alist-proxy,因为ghproxy、CDN加速 实在是太多了 github发布、github API 存储 能否增加 ghproxy、CDN加速 通用的代理,而不是alist-proxy,因为ghproxy、CDN加速 实在是太多了 Feb 9, 2025
@chrisdong chrisdong changed the title github发布、github API 存储 能否增加 ghproxy、CDN加速 通用的代理,而不是alist-proxy,因为ghproxy、CDN加速 实在是太多了 alist存储:github发布、github API 能否增加 ghproxy、CDN加速 通用的代理,而不是alist-proxy,因为ghproxy、CDN加速 实在是太多了 Feb 9, 2025
@chrisdong
Copy link
Author

打开web代理 然后填入你的代理url(随便写一个你能用的) 例如说我这边是https://sub.example.com 然后随便点一个文件下载,肯定会无法下载的,然后记下获取到的链接,例如 https://test2.yyyyt.top/test/ghr/alist-web-gh/3.42.0/dist.zip?sign=sIEvFcGnLSDGTUdOvadldOy2Q775Omjv-kO4mvuZ8OI=:1739037789 紧接着建一个站点在sub.example.com 让nginx重定向请求(也可以用cf的重定向功能)保留url参数. 例如说我这边挂在到的是/test/ghr 挂载alist的web的发布到alist-web-gh文件夹下那么就让nginx重定向请求并保留url

让nginx把https://sub.example.com/test/ghr/alist-web-gh/*的请求重定向到 https://ghmirror.cn/https://github.com/此处省略一大堆/ 同时保留url 这个不太方便用语言说...可能会说不清楚 反正就是利用后面的路径都一样 只是前面不一样 然后让alist返回代理地址,代理地址再依靠后面的路径重定向到ghmirror的地址来实现的 比如说上面那个例子实现起来就是这样 alist重定向到https://test2.yyyyt.top/test/ghr/alist-web-gh/3.42.0/dist.zip?sign=sIEvFcGnLSDGTUdOvadldOy2Q775Omjv-kO4mvuZ8OI=:1739037789 然后test2.yyyyt.top/test/ghr/alist-web-gh/3.42.0/dist.zip?xxxxx 再重定向给https://ghmirror/https://github.com/AlistGo/alist-web/releases/download/3.42.0/dist.zip 实现调用ghmirror 说白了就是根据后面的路径如/3.42.0/dist.zip 都是一样的然后可以靠代理地址二次重定向来实现的

谢谢,我试试,也许搞不定

@YangRucheng
Copy link
Contributor

新 pr 合并了 #7938
beta 可用了

可以填入 https://ghproxy.net/github.com
会将原下载链接 https://github.com/AlistGo/alist/releases/download/v3.42.0/alist-linux-amd64.tar.gz
替换为 https://ghproxy.net/github.com/AlistGo/alist/releases/download/v3.42.0/alist-linux-amd64.tar.gz

一些公开示例:

  • https://ghproxy.net/github.com
  • https://gh-proxy.com/github.com
  • https://ghproxy.cn/https://github.com

也可以使用 ymyuuu/Cloudflare-Workers-Proxy

  • 填入 https://example.com/https://github.com

@chrisdong
Copy link
Author

新 pr 合并了 #7938。 beta 可用了

可以填入 https://ghproxy.net/github.com 会将原下载链接 https://github.com/AlistGo/alist/releases/download/v3.42.0/alist-linux-amd64.tar.gz 替换为 https://ghproxy.net/github.com/AlistGo/alist/releases/download/v3.42.0/alist-linux-amd64.tar.gz

一些公开示例:

  • https://ghproxy.net/github.com
  • https://gh-proxy.com/github.com
  • https://ghproxy.cn/https://github.com

也可以使用 ymyuuu/Cloudflare-Workers-Proxy

  • 填入 https://example.com/https://github.com

docker更新到main后 支持gh-proxy了,非常感谢

Image

github api 能考虑增加 jsDelivr 一类的cdn吗?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants