rlidwka / sinopia

Private npm repository server
5.51k stars 656 forks source link

Frontend HTTPS proxy does not play well with sinopia #232

Open seebi opened 9 years ago

seebi commented 9 years ago

we have installed sinopia as a docker container and want to allow access to it via a an ssl enabled proxy server. using sinopia directly on the docker host works fine (http, port 4873). however, using the proxied URL (https, port 443) we only get the following error message:

can't access restricted package, you are not logged in

Can I tell sinopia allow access via these proxied HTTPS URLs?

seebi commented 9 years ago

@yamalight, @hknochi: fyi ...

RnbWd commented 9 years ago

It's actually an easy fix (one liner). https://github.com/RnbWd/sinopia/commit/526bfbaf0dcdf525408c9eadc29f71c10422bd13

Are you using rnbwd/sinopia or nginx-proxy by chance? (I might need to update my repo). If you're not using the VIRTUAL_HOST env var, then I'd recommend forking sinopia or changing that line inside the container generically. It should work (works for me)

RnbWd commented 9 years ago

I should probably submit a pull request and just add it into the config.json config.yaml file

yamalight commented 9 years ago

@RnbWd using your fork and VIRTUAL_HOST helped, now it works perfectly fine! would be good to have that merged into main repo and configurable through config.yml, so please do a PR :)