Pub-dev: Can I set up private pub server without Google Cloud?

Created on 20 Nov 2018  路  10Comments  路  Source: dart-lang/pub-dev

Can I set up private pub server without Google Cloud?

Thanks!

Most helpful comment

There are a lot of big companies that need a company's internal pub repository so that many departments share the flutter components, but these components can't be submitted to the central repository because they are related to the company's business.

All 10 comments

No - the whole server is written to be run on google cloud infrastructure. You can of course write your own server implementing the api, but I guess that is not what you're asking about.

Can I set up private pub server without Google Cloud?

Yes and no. No: https://github.com/dart-lang/pub-dartlang-dart is designed to run on google cloud.

However, you can use https://github.com/dart-lang/pub_server which is considered the canonical server for APIs used by the pub client. You can see example backend repositories for it here:
https://github.com/dart-lang/pub_server/tree/master/example/src/examples

The later one is only to host the package contents, you won't get the web UI nor the package analysis bits out of it.

It's also possible to reference git tags from your pubspec:
https://www.dartlang.org/tools/pub/dependencies#git-packages

I haven't tried it with private git repositories.. if it doesn't I wonder if it would be hard to fix though...

If you really want a pub server, I know that there are others running pub-dartlang-dart behind a VPN, but I'm not sure exactly how they've configured things..

@koudle, actually, I'm curious what is you motivation?

  • why run a private pub server?
  • why run it outside google cloud?

I don't think we're likely to refactor pub-dartlang-dart, but if there is enough users, maybe it's not unrealistic to start a project to write a minimalistic standalone pub server...

@jonasfj
Hi,
* I want to run a private pub server,because:
1. I want to manage private packages, like private maven repositories
2. The others ways like git or pub server, although able to manage private packages, but no web UI

  • I want run it outside google cloud,because:
  • Google Cloud is not free.If our package gets bigger and bigger锛宨t's too expensive to use Google Cloud.
  • Google Cloud is not very easy to use

@koudle As you don't need the UI and the rest of it, you should take a look at the pub_server package I've linked to earlier. It provides an example to host the pub server on a local filesystem, which you can then use to host your private packages. pub client uses PUB_HOSTED_URL to target it instead of the public repository.

There are a lot of big companies that need a company's internal pub repository so that many departments share the flutter components, but these components can't be submitted to the central repository because they are related to the company's business.

@bobzhou80: package:pub_server has an example in its repository how to create a simple self-hosted version.

@bobzhou80, also checkout @v7lin's simple_pub_server, it's pretty cool.

Was this page helpful?
0 / 5 - 0 ratings