Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

May be a cache for the public bower packages #3

Closed
youknowriad opened this issue May 5, 2014 · 13 comments
Closed

May be a cache for the public bower packages #3

youknowriad opened this issue May 5, 2014 · 13 comments

Comments

@youknowriad
Copy link

Hi,

It would be interessting to cache the public bower packages to avoid depending on github etc when it's down.

Thanks

@Hacklone
Copy link
Owner

Hacklone commented May 5, 2014

Would be nice, I'll look at it.

@Hacklone
Copy link
Owner

Hacklone commented May 7, 2014

Now the public registry is cached. Did you mean to cache the actual packages?

@lbod
Copy link

lbod commented May 7, 2014

I could be misunderstanding how your package works, I had a quick look through the code and couldn't quickly see, however...
There's a number of blogs etc which explain how to define your own internal bower registry.

My use case is this:
A corporate doesn't allow direct connections to the DMZ for tools like git, bower, npm etc. Is it possible to host a private, in house bower registry with this package running on a machine that's properly security hardened and it will cache public bower packages when requested?
i.e. we'll never make bower install go directly through the DMZ and only request from our internal bower registry

@Hacklone
Copy link
Owner

Hacklone commented May 7, 2014

In that case you'll have to clone the repositories you want to use. Publish the repos internally and then register them as packages.

  • git clone git://github.com/angular/bower-angular.git
  • make this repo internally available (ssh and so on)
  • register the package to the private registry

http://bowerRegistryServer:5678/registerPackage -> POST json: { "name": "angular", "repo": "git://yourInternalGitServer/angular-package" }

and then you can easily use "bower install angular" :)

private-bower is just a registry it doesn't download packages, though it can be an improvement :)

@lbod
Copy link

lbod commented May 7, 2014

Sounds like a possible enhancement issue then? I don't mind having a look implementing

Bower needs an easy internally hosted registry like npm and git already provide for.
edit: actually it wouldn't need to automatically download them, as long as automatic registering could be achieved via a manual download

@Hacklone
Copy link
Owner

Hacklone commented May 7, 2014

So you mean when someone downloads a public package, then it should clone and host the package on the registry server and register a private package with the same name to the private registry? :) Sounds interesting, will take a closer look at it tomorrow :)

@lbod
Copy link

lbod commented May 7, 2014

Basically yes... Or a simpler solution would be if it's not registered in the internal registry return an error "internal package not found" prompting the administrator of the machine to register it.

Along the lines of the npm internal registry e.g. https://www.npmjs.org/doc/misc/npm-registry.html though that, IMO, is far too heavyweight continuously replicating the public registry (unneeded disk usage)

@Hacklone
Copy link
Owner

Hacklone commented May 7, 2014

So to clear up, you just want the "fallback to public bower registry" feature to be switchable :)
I could add a cli parameter easily so you can turn that feature off

@lbod
Copy link

lbod commented May 7, 2014

Is that all it'd take? I've only browsed your code and haven't ran/debugged it

The "fallback to public bower registry" case in pseudo code could be:

if (fallback to public option config set == false) {
  if (packagerequested == found) {
    return package;
  } else {
    if (install from public config option set) {
       bower install into local registry;
       return package;
    } else {
      return new Error("private registry for package not found")
    }
  }
} else {
 use public registry;
}

edit: like i say this is better in a separate enhancement issue

@Hacklone
Copy link
Owner

Hacklone commented May 7, 2014

Just published version 0.0.9 add '-np' argument and see if it's suitable 4 u :)

@Hacklone
Copy link
Owner

Hacklone commented May 7, 2014

@youknowriad the main issue was about caching the github repo or the registry entry?

@youknowriad
Copy link
Author

The main issue was about caching a repo (not only a github repo), the first time you request it, to avoid calling the main registry if the same version is needed

@Hacklone
Copy link
Owner

Hacklone commented May 8, 2014

Ok then I close this a s a duplicate to #4

@Hacklone Hacklone closed this as completed May 8, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants