自动扩展更新无法处理来自github的zip文件? [英] automatic extension update can't handle zip file from github?
问题描述
我有一个扩展托管在github上,为此我想提供自动更新。但是,当我将URL提供给附加到发布的文件时,Joomla只报告以下内容以尝试自动更新:
Fehler beim Verbindungsaufbau zum服务器:错误未知
UngültigeWebadresse
翻译
连接到服务器时出错:错误未知
无效的网址
当通过扩展 - 安装页面尝试从网址安装时,情况也是如此。
在浏览器中,我可以很好地下载文件。
有人知道这是为什么吗?这是github方面,还是Joomla's方面的错误?
或者它是github方面的一些安全或安全机制?
我能做些什么来避免它?或者做这两个只是不玩?
示例网址: https://github.com/codeling/bfstop/releases/download/1.2.0/pkg_bfstop-1.2.0.zip
编辑:
插入downloadPackage方法的补丁(gist.github.com/piotr
解析重定向后传递给方法的URL: https://s3.amazonaws.com/github-cloud/releases/6794712/f2aa5eb4-7838-11e3-837a-c6be2639e4ca.zip?response-content-disposition=attachment%3B%20filename%3Dpkg_bfstop-1.2.0.zip& ; AWSAccessKeyId = AKIAISTNZFOVBIJMK3TQ&Expires = 1389455424& Signature = Nnyl6TnWueTqK8bPkPXUidM8UzQ%3D
新插入的行后面的网址: https ://s3.amazonaws.com/github-cloud/releases/6794712/f2aa5eb4-7838-11e3-837a-c6be263 9e4ca.zip?response-content-disposition=attachment; filename = pkg_bfstop-1.2.0.zip& AWSAccessKeyId = AKIAISTNZFOVBIJMK3TQ& Expires = 1389455424& Signature = Nnyl6TnWueTqK8bPkPXUidM8UzQ =
响应仍然是505错误:
响应:JHttpResponse对象
(
[code] => 505
[header] => Array
(
[Date] =&Sat; 2014年1月11日15:49:24 GMT
[Connection] => close
[Server ] => AmazonS3
)
[body] =>
)
所以我想编码并不重要。错误505确实会指示http版本问题?为什么Joomla和Amazon不同意HTTP版本?绝对不是HTTP专家,但版本1.1应该是自10多年以来未改变的标准版本?
结论:<通过GitHub的标签和发布自动生成的下载 / b> / em>在此刻(2014年1月)与Joomla Installer兼容,只要存储库名称与扩展名(元素)匹配即可。 Joomla Installer能够使用以下扩展:-
直接找到文件和文件夹:
mod_mymodule.zip:
结果在
/mod_mymodule.xml
/mod_mymodule.php
$ c $或者让档案和文件夹位于与存档相同名称的文件夹中(请参阅) github.com/joomla/joomla-cms/blob/staging/libraries/cms/installer/helper.php#L143rel =nofollow noreferrer>JInstallerHelper :: unpack
):
mod_mymodule.zip:
/ mod_mymodule
/ mod_mymodule /mod_mymodule.xml
/mod_mymodule/mod_mymodule.php
这就是GitHub 标签和发布版现已开始制作。自动生成的
mod_mymodule mod_mymodule- [tag / branch] .zip
档案中自动生成下载< > mod_mymodule- [标签/分支] 子文件夹。当我们标记扩展名1.0.0-beta
时:mod_mymodule- 1.0.0-beta.zip:
/mod_mymodule-1.0.0-beta
/mod_mymodule-1.0.0-beta/mod_mymodule.xml
/mod_mymodule-1.0.0 -beta / mod_mymodule.php
注意:档案建立方式有所改变请参阅自动扩展更新:未知存档类型)
添加到GitHub发行版的手动附加二进制文件
505 HTTP版本不支持
,但我们尚未找到针对此问题的解决方案。 只要您使用自动生成的下载,最终可以使用GitHub作为Joomla扩展更新服务器(这很方便)。
GitHub提供了版本控制服务,而不是更新服务器,因此构建可下载档案的方式可能会在未来再次发生变化。
在我们找到一种方法来使用Joomla Installer下载附加二进制文件(其中一个可以完全控制存档的名称和结构)的情况下,GitHub不应该被视为Joomla的可靠工具扩展更新。我相信有一种方法可以修补 JInstaller 软件包与AWS兼容(下载可以使用命令行 curl
)正常工作。
感谢 ccpl 和 RandolphCarter 获取这个答案的信息。
I have an extension hosted on github, for which I want to provide automatic updates. However, when I provide the URL to a file attached to a release, Joomla just reports the following on trying to automatically update:
Fehler beim Verbindungsaufbau zum Server: Error Unknown
Ungültige Webadresse
Translation
Error in connecting to server: Error Unknown
Invalid web address
It's the same when trying to install from the web address via the Extensions - Install page. From the browser, I can download the file just fine however. Anybody got an idea why that is? Is it an error on github side, or on Joomla's? Or is it some "safety" or "security" mechanism on github side? What can I do to avoid it? Or do those two just not play along?
Example URL: https://github.com/codeling/bfstop/releases/download/1.2.0/pkg_bfstop-1.2.0.zip
Edit:
Inserted the patch for downloadPackage method (gist.github.com/piotr-cz/8316210) mentioned by piotr_cz in the comments below the answer into my Joomla installation now.
URL passed into the method after resolving the redirect: https://s3.amazonaws.com/github-cloud/releases/6794712/f2aa5eb4-7838-11e3-837a-c6be2639e4ca.zip?response-content-disposition=attachment%3B%20filename%3Dpkg_bfstop-1.2.0.zip&AWSAccessKeyId=AKIAISTNZFOVBIJMK3TQ&Expires=1389455424&Signature=Nnyl6TnWueTqK8bPkPXUidM8UzQ%3D
URL after the newly inserted lines: https://s3.amazonaws.com/github-cloud/releases/6794712/f2aa5eb4-7838-11e3-837a-c6be2639e4ca.zip?response-content-disposition=attachment; filename=pkg_bfstop-1.2.0.zip&AWSAccessKeyId=AKIAISTNZFOVBIJMK3TQ&Expires=1389455424&Signature=Nnyl6TnWueTqK8bPkPXUidM8UzQ=
The response is still a 505 error:
response: JHttpResponse Object
(
[code] => 505
[headers] => Array
(
[Date] => Sat, 11 Jan 2014 15:49:24 GMT
[Connection] => close
[Server] => AmazonS3
)
[body] =>
)
So I suppose the encoding doesn't matter. The error 505 would indeed indicate http version problems? Why would Joomla and Amazon disagree on HTTP versions? Definitely not an HTTP expert here but version 1.1 should be the unchanged standard version since more than 10 years now?
Conclusions:
Automatically generated downloads by GitHub's Tags and Releases are compatible with Joomla Installer at this moment (Jan 2014) as long as the repository name matches extension name (element). Joomla Installer is able to work with an extension which:
Have files and folders located directly:
mod_mymodule.zip: /mod_mymodule.xml /mod_mymodule.php
Or have files and folders located in a folder of the same name as the archive (see
JInstallerHelper::unpack
):mod_mymodule.zip: /mod_mymodule /mod_mymodule/mod_mymodule.xml /mod_mymodule/mod_mymodule.php
This is how GitHub Tags and Releases are built now. Automatically generated downloads of repository
mod_mymodule
results inmod_mymodule-[tag/branch].zip
archive withmod_mymodule-[tag/branch]
subfolder. Say when we tag extension1.0.0-beta
:mod_mymodule-1.0.0-beta.zip: /mod_mymodule-1.0.0-beta /mod_mymodule-1.0.0-beta/mod_mymodule.xml /mod_mymodule-1.0.0-beta/mod_mymodule.php
Note: There were some changes in how archive is built (see Automatic Extension Update: Unknown Archive type)
Manually attached Binaries added to a GitHub Release are hosted in the Amazon Web Services. Request to download these by JInstallerHelper::downloadPackage results in an response
505 HTTP Version Not Supported
and we didn't find a working solution for this problem yet.
In the end one may use GitHub as an Joomla Extensions Update server (it's pretty convenient), as long as you use automatically generated downloads.
GitHub provides Version Control service, not an Update server so the way how downloadable archive is built may change again in future.
Until we find out a way how to download Attached Binaries (where one have full control over archive's name and structure) using Joomla Installer, GitHub should not be perceived as a reliable tool for Joomla extension updates. I believe there's a way to patch the JInstaller package to be compatible with the AWS (download works fine using command-line curl
).
Thanks for ccpl and RandolphCarter on getting information for this answer.
这篇关于自动扩展更新无法处理来自github的zip文件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!