我有一个设置了基本 HTTP 身份验证的 Satis 服务器。
配置文件如下所示:
{
"name": "MySatisServer",
"homepage": "https:\/\/satis.example.co.uk",
"repositories": [
{
"type": "git",
"url": "git@github.com:Org\/Repo1.git"
},
{
"type": "git",
"url": "git@github.com:Org\/Repo2.git"
},
{
"type": "git",
"url": "git@github.com:Org\/Repo3.git"
},
{
"type": "git",
"url": "git@github.com:Org\/Repo4.git"
}
],
"require-all": true,
"require-dependencies": true,
"require-dev-dependencies": true,
"archive": {
"directory": "dist",
"format": "zip",
"prefix-url": "https://satis.example.co.uk"
}
}
我已经运行了 satis 构建,它使用packages.json
看起来正确的文件创建了我的 dist 目录。
我可以https://satis.example.co.uk
在我的浏览器中访问并下载我想要的任何版本的存储库作为 ZIP 并且它工作正常。
当我尝试通过 composer 使用 repo 时出现问题。
我的composer.json
文件看起来像这样:
{
"name": "some/project",
"description": "",
"license": "proprietary",
"authors": [],
"require": {
"org/repo-4": "^1.0"
},
"repositories": [
{
"type": "composer",
"url": "https://satis.example.co.uk"
}
]
}
由于 Satis 服务器支持基本 HTTP 身份验证,因此我还有一个auth.json
文件,如下所示:
{
"http-basic": {
"satis.example.co.uk": {
"username": "my-username",
"password": "my-password"
}
}
}
运行 acomposer install
给我以下输出:
- Installing org/repo-4 (1.0.0): Downloading (failed) Failed to download org/repo-4 from dist: The "https://api.github.com/repos/Org/Repo4/zipball/128f63b6a91cf71d5cda8f84861254452ff3a1af" file could not be downloaded (HTTP/1.1 404 Not Found)
Now trying to download from source
- Installing org/repo-4 (1.0.0): Cloning failed using an ssh key for authentication, enter your GitHub credentials to access private repos
Head to https://github.com/settings/tokens/new?scopes=repo&description=Composer+on+box359.localdomain+2017-04-18+1416
to retrieve a token. It will be stored in "/home/ubuntu/CashbackEngine/auth.json" for future use by Composer.
Token (hidden):
从上面可以看出,它完全忽略了它需要下载的文件位于 的事实,而是https://satis.example.co.uk/dist/org/repo-4/repo-4-1.0.0-e1cd03.zip
直接跳到 GitHub 上尝试从源中获取,这不是想要的结果,因为它是私有的GitHub 存储库。
看起来它甚至没有意识到有不同的 dist 版本可用。
我的设置有问题吗?
任何帮助表示赞赏。