libpkgx icon indicating copy to clipboard operation
libpkgx copied to clipboard

pkgx distribution host endpoint override

Open vin-thai opened this issue 1 year ago • 2 comments

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

vin-thai avatar May 09 '24 22:05 vin-thai

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.

jhheider avatar May 10 '24 05:05 jhheider

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)}`)
}

vin-thai avatar May 10 '24 05:05 vin-thai