12

Assuming that I'm running my own instance of pub-dartlang for a private pub feed; how do I indicate in pubspec.yaml which packages come from the private feed vs pub.dartlang.org?

Danny Tuppeny
  • 40,147
  • 24
  • 151
  • 275
  • I'm am trying to do the same thing. How did you make yours private? I would like to limit the users with access to our organization's Google Apps Domain. – computmaxer Jun 08 '15 at 16:03
  • @computmaxer I never actually got around to it; I was just asking for future reference. I was actually just looking for a way to point pub at a private URL, not to apply any authentication. I suspect IP restriction might be the easiest way to do this if the url is public? – Danny Tuppeny Jun 16 '15 at 11:19

1 Answers1

14

You can set the environment variable PUB_HOSTED_URL so it points to your custom pub repo server. This way pub loads all packages which don't have a server specified from this server.

You can define exceptions in pubspec.yaml like

dependencies:
  transmogrify:
    hosted:
      name: transmogrify
      url: http://some-package-server.com

see https://www.dartlang.org/tools/pub/dependencies.html for more details.

There is another package that seems to provide a custom Pub repo https://pub.dartlang.org/packages/pub_proxy_server

Günter Zöchbauer
  • 623,577
  • 216
  • 2,003
  • 1,567