pkgxdev / libpkgx

`import`… but with pkging powers
https://npmjs.com/libpkgx
Apache License 2.0
62 stars 11 forks source link

pkgx distribution host endpoint override #71

Open vin-thai opened 3 months ago

vin-thai commented 3 months ago

Would be great if the distribution host endpoint https://dist.pkgx.dev can be override with env value. This would allow users behind corp firewall to reroute it via middleware such as gateway or Artifactory.

e.g. export XDG_DIST_URI=https://corp-endpoint/pkgx

jhheider commented 3 months ago

This is a perfectly reasonable idea. Until it is implemented, it should be reasonably trivial for a corporate network to point its local network's dns record for dist.pkgx.dev to an IP of its liking (though they'll have to do some SSL tricks as well).

My guess is most of this logic is in libpkgx, without looking just at the moment. So, it should be fairly easy to fork that and build a pkgx client that uses the forked libpkgx.

vin-thai commented 3 months ago

yes, the url is hardcoded in libpkgx - src/hooks/useOffLicense.ts file.

function url(stowage: Stowage) {
  return new URL(`https://dist.pkgx.dev/${key(stowage)}`)
}