实测时间:2026-11-18 01:xx(这台机器,无需代理)
github.com:443不通;但下面这些是通的:api.github.com、raw.githubusercontent.com、codeload.github.com、ssh.github.com:443(能完成 SSH 握手)、gitee.com(含 git 推拉)、registry.npmjs.org、unpkg.com、ghproxy.net。 结论:GitHub 网页被墙,但 GitHub API / SSH-443 / 各种镜像可用;不依赖 GitHub 也能先”上架”DSH 发现页。
DSH 的”插件市场”其实有两层:
| 入口 | 数据来源 | 没有 GitHub 能不能上 |
|---|---|---|
| 插件 → 发现(Discover)→ 索引源 | 任意 https 的 format-1 索引 JSON | ✅ 能(Gitee raw / npm + unpkg 都行) |
| 插件 → 插件市场(dshmarket) | 社区精选目录 awesome-dsh-plugin(GitHub 仓库 PR) |
❌ 必须 GitHub 仓库被收录 |
所以先选路线:
不需要 GitHub,Gitee 网页和 git 都通。
解压 my-fish-1.1.0-github-repo.zip,在目录里:
git init -b main
git add -A
git commit -m "my fish 1.1.0"
打开 https://gitee.com 新建仓库 my-fish(公开),然后:
git remote add gitee https://gitee.com/<你的Gitee用户名>/my-fish.git
git push -u gitee main
生成 Gitee 版索引(把 git 来源写成 gitee):
node market/build-index.mjs --owner <你的Gitee用户名> --repo my-fish --platform gitee
git add -A && git commit -m "market index" && git push
在收件人机器上:插件 → 发现 → 索引源 添加
https://gitee.com/<你的Gitee用户名>/my-fish/raw/main/market/index.json
(首次需要先启用实验性插件「自定义插件索引 / Custom plugin indexes」。)
直接安装也可以:
dsh plugin --profile <profile> add git+https://gitee.com/<你的Gitee用户名>/my-fish.git#<commit>
限制:dshmarket 可视市场不会收录 Gitee 仓库;但 DSH 自带「发现」页能搜索/安装,这已经算”插件市场识别”。
npm registry 通,unpkg 也通;npm 网站 npmjs.com 用浏览器一般能开(curl 403 是反爬,不代表浏览器不行)。
登录并发布(先确认 my-fish 包名没被占;占了就改 package.json 的 name,同时改 cordis.patch.yml 的 id/name 和 profile 依赖名):
npm login
npm publish --access public
生成 npm 版索引(不需要 git commit):
node market/build-index.mjs --owner <你的名字> --repo my-fish --npm
git add market/index.json market/icons && git commit -m "npm market index" && git push
用户添加索引源:
https://unpkg.com/my-fish@1.1.0/market/index.json
直接安装:
dsh plugin --profile <profile> add my-fish@1.1.0
说明:
package.json的files已包含market,发布后 unpkg 能直接取到索引和图标。
官方目录只收 GitHub 仓库,所以最终还是要传到 GitHub。github.com 网页不通,但以下三条实测可行:
ssh.github.com:443 实测能握手,只是缺 SSH key。
运行本仓库脚本(生成 key + 写 SSH 配置):
powershell -ExecutionPolicy Bypass -File tools/setup-github-ssh.ps1
把脚本打印的公钥加到 GitHub:用能访问 GitHub 的设备/网络(手机热点、公司网络、朋友的电脑、或临时 VPN)打开 https://github.com/settings/keys → New SSH key → 粘贴公钥。 若你有 PAT token,也可以在任意能跑命令的机器上:
curl -X POST -H "Authorization: token $GITHUB_TOKEN" \
-H "Accept: application/vnd.github+json" \
https://api.github.com/user/keys \
-d "{\"title\":\"my-fish\",\"key\":\"$(cat ~/.ssh/my-fish_github.pub)\"}"
验证并推送:
ssh -T git@github.com # 应显示 "Hi <你>! You've successfully authenticated"
git remote add origin git@github.com:<你的GitHub用户名>/my-fish.git
git branch -M main
git push -u origin main
有 PAT 的话,不需要 github.com 网页:
export GITHUB_TOKEN=ghp_xxx # PAT,需 repo 权限
node tools/upload-github-api.mjs --owner <你的GitHub用户名> --repo my-fish
脚本会:创建仓库(若不存在)→ 用 Git Data API 逐个上传文件(含 .github、market、assets)→ 给仓库加 dsh-plugin topic。
之后收录 PR 也可以用 API 提(或等能访问网页时再提)。
选项(任选其一):
git remote add origin git@github.com:<GitHub用户名>/my-fish.git
git push -u origin main
然后按 PUBLISH-GITHUB.md 第 4 步向 awesome-dsh-plugin 提收录 PR(仓库满 1 天后)。
--platform gitee 索引,或 npm + unpkg 索引。git remote 就能同步。git/npm 只是分发方式,装到 ~/.dsh/plugins/my-fish 后照常运行。