bower / registry

The Bower registry
https://registry.bower.io/packages
MIT License
292 stars 66 forks source link

Accept ssh scheme for package registration #96

Closed kodi closed 9 years ago

kodi commented 10 years ago

This simple fix allowed us to use registry with private git repo that is not supporting https or git protocol (we insist on ssh keys only)

It would be great if we could include this into node_rewrite branch, and eventually even in stable

it works really easy, you just register url with ssh://git@your-private-domain.com/repo.git

kodi commented 10 years ago

also, sorry about git ignore, i couldn't find a way to remove it from pull request :)

patrickkettner commented 10 years ago

Hey @kodi! This looks ok to me, two things though.

  1. from within the repo, you can run git reset --soft HEAD~1 && git checkout .gitignore && git commit -m '.' && git rebase -i HEAD~2, and then change the bottom commit (whose message is just .) from pick to f, and save. That will rebase the change, then git push --force the change to get it up here.
  2. You won't be able to register private urls on the public registry. If by "private" you mean personal, then totally - thats fine. But if the repo can't be resolved by anyone on the internet, then it needs to go in a private bower registry.

cheers!

kodi commented 10 years ago

Hi @patrickkettner,

The sole purpose of this fix was to enable our company to use Bower registry with our private git repo. Will try to do the git sorcery you suggested, thanks!

kodi commented 10 years ago

Ok, i think i did it :)

kodi : /data/opensource/my_github/registry $ git reset --soft HEAD~1 && git checkout .gitignore && git commit -m '.' && git rebase -i HEAD~2 [node_rewrite b2506c6] . 1 file changed, 1 insertion(+), 1 deletion(-) [detached HEAD e8629ed] fix gitignore 2 files changed, 3 insertions(+), 1 deletion(-) Successfully rebased and updated refs/heads/node_rewrite. kodi : /data/opensource/my_github/registry $ git push --force Counting objects: 1, done. Writing objects: 100% (1/1), 191 bytes | 0 bytes/s, done. Total 1 (delta 0), reused 0 (delta 0) To git@github.com:kodi/registry.git

patrickkettner commented 10 years ago

Doesn't look like it :[

The gitignore file is still there. Maybe it would be easier for you to just create a new PR

kodi commented 10 years ago

just commited again with reverted changes, its gone now.

I also understand that this may carry the risk of someone pushing his private ssh:// url, but trust me, this was the deal-breaker in our scenario, luckily for us, the fix was rather simple.

sheerun commented 9 years ago

We don't want to allow ssh urls for public registry. This needs to be behind a flag.

btw. on master branch I implemented ignoring validations and normalizations:

https://github.com/bower/registry/commit/d84b1095e5bed0b7cdfe35b05cfe364d1af0c4c0

kodi commented 9 years ago

Thanks @sheerun for giving us the config flag!!!