Closed sindresorhus closed 10 years ago
Since this hasn't been fixed for 5 month's I hope it's a bit more severe than just fixing the regexp in validate? :-P
def validate super errors.add(:url, 'is not correct format') if url !~ /^git:\/\// end
That should do it.
Can we also include "a better error message" as part of the scope of this?
"Please use git:// or https:// urls" would be a huge improvement.
The ssh and https protocols can reference public and private repositories. One cannot simply allow registration without actually attempting to fetch them. If it fails with an authentication failure it means it's private. Otherwise it's public. @danheberden perhaps we need to include this in the server rewrite.
@danheberden @satazor is there any eta on when this will be fixed? I have a package on Bitbucket I want to register but am unable to because of this bug :(
@seancurtis Welcome to the club :/
@danheberden @benschwarz @satazor is there an update on this? I'd really love to be able to publish my Fancy File Input (https://bitbucket.org/atlassianlabs/fancy-file-input/) component to Bower.
@sheerun any thoughts on how bitbucket repos play into auth?
They apparently don't support git://
prefix, and when trying to register https://
version I get:
bower register fancy-file-input https://bitbucket.org/atlassianlabs/fancy-file-input.git
bower EINVFORMAT The registry only accepts URLs starting with git://
Why not allow https urls?
So... we're never gonna be able to register a bitbucket public repo?
… or any other host that doesn't support the Git protocol.
Just adding a +1 to supporting hosts-other-than-github ;)
I agree, I am in the same boat here, I want to register my Bitbucket repos.
Is there any reason bower shouldn't support https?
If not can someone please fix this? :)
I'm in the same boat. My project is hosted on bitbucket and I have no interest in migrating it over to github. If the git CLI can access my repo, why shouldn't bower also be able to? Fix it, please
I was able to bypass the problem by adding:
[url "https://"]
insteadOf = git://
to my ~/.gitconfig file. At least I think it worked for publishing
Of course, it doesn't help people trying to actually 'retrieve' the package. Unless they've done the same
@kode4food "Fix it, please" is only going to make project maintainers want to shoot this issue to the moon.
@sheerun As far as I'm aware, https protocol is disabled because we use --depth 1
and github enterprise/https has issues.
It'd be good to recover from shallow clone errors and use a full clone… Thoughts?
Was 'please' not the right word? Seems not very different than "If not can someone please fix this? :)" Should I have added a smiley face?
Hey, any updates? I would really like to publish my bower component from my bitbucket repository :( :+1:
I guess we can implement this in 1.4.x and disable --depth
for https repositories.
PR is welcome.
@sheerun that would be fantastic, thanks!
In the meantime, is there a workaround?
You can put repo url as dependency version.
{
"dependencies": {
"foo": "https://bitbucket.org/foo/foo.git#1.2.3"
}
}
or something like that.
@sheerun thanks!
edit: never mind, unable to get that to work. @kode4food Have you been able to register a bower component with just that in your .gitignore file? How does the register command look?
@plestik Can't remember the command, but I believe I was registering it like "bower register interpol git://..." The registration works, but users would have to make the same .gitconfig change in order to retrieve the package. So it really didn't solve the problem.
As I said earlier, the problem is not the --depth
(that is a whole separate issue). The issue is that we must ensure the repo you are trying to register is public. The git://
protocol is public only, while https or ssh can point to both public and private. To allow other protocols, we must ensure that we are able to fetch them without auth. This must be done in the bower/registry
server.
@sheerun please don't simply remove the constraint without actually doing the validation I'm mentioning above, otherwise we will have a complete mess of other issues.
I was seeing this error and finally found out the problem was that I was trying to register the package as FxPay
when my git URL was in lower case as fxpay
. When I changed everything to lower case it worked.
@kumar303 b/c spec says lowercase only, however we need better error messages
When trying to register a package using an https url, Bower fails with a generic error message.
This works fine however:
Sidenote: The error message is not very descriptive either, at first I thought it was the package