dart-lang / pub-dev

The pub.dev website
https://pub.dev
BSD 3-Clause "New" or "Revised" License
777 stars 145 forks source link

Using proxy repo in Secured environment #7773

Closed srveerla closed 3 months ago

srveerla commented 4 months ago

We would like user internal proxy repo for pub.dev in out organization, we have respective PUB_HOST_URL to same however flutter is pointing to archive_url while trying to download the images. How can we fix this, such that it points to artifactory only.

isoos commented 4 months ago

@srveerla: It is not clear to me: what kind of repository are you using internally? If it follows the https://github.com/dart-lang/pub/blob/master/doc/repository-spec-v2.md it can specify internal URLs for the images that would get downloaded.

Also to make it sure: it needs to use PUB_HOSTED_URL and not PUB_HOST_URL.

sigurdm commented 4 months ago

Maybe you also need to set FLUTTER_STORAGE_BASE_URL for the flutter artifacts.

See: https://docs.flutter.dev/community/china#configure-your-machine-to-use-this-mirror

acestark12 commented 4 months ago

@isoos I am facing the same issue. I am working on building a Docker image for flutter for my organization. I have added the dart pub token and set PUB_HOSTED_URL and FLUTTER_STORAGE_BASE_URL to a hosted repo link. On running flutter pub get; GET <hosted-url>/api/packages/<package> request is made. The archive url in package version listed in the response json file doesn't have <hosted-url> as its prefix. Therefore all the redirects are ending up on https://pub.dev . The hosted repo is mirror of https//pub.dev in a jfrog artifactory. Is it something with the hosted repo, or something needs to be done from client side to have archive url has hosted url prefix?

isoos commented 4 months ago

@acestark12: I'm not sure: what would be your expectation here be?

You are using a third-party mirror, that doesn't changes the content it is serving. What can we do here to help this use case? It seems to me that the mirroring/artifactory serving needs to be updated.

github-actions[bot] commented 3 months ago

Without additional information we're not able to resolve this issue. Feel free to add more info or respond to any questions above and we can reopen the case. Thanks for your contribution!