<div dir="ltr">Great point, Simon. Thank you for sharing that.</div><div class="gmail_extra"><br><div class="gmail_quote">On Thu, Dec 21, 2017 at 8:26 AM, Simon Baatz <span dir="ltr"><<a href="mailto:gmbnomis@gmail.com" target="_blank">gmbnomis@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class="">On Tue, Dec 19, 2017 at 12:41:08PM -0500, Dennis Kliban wrote:<br>
>    Crane cannot perform a rewrite of the redirect URL at this time. This<br>
>    seems like a reasonable feature request. I recommend filing a story -<br>
>    we can discuss the feature details on there.<br>
><br>
<br>
</span>That would be a nice feature indeed.  In the meantime, you could try<br>
to let Apache rewrite the "Location" header used for redirection<br>
(using the mod_headers module in Apache 2.4).<br>
<br>
We did not fully test this (let alone use it in production), but for<br>
a test setup with Pulp & crane running in a VM and port forwardings<br>
(Host 5000 -> VM 5000, Host 9443 -> VM 443), we can 'docker pull' on<br>
the host from crane using the following Apache config:<br>
<br>
<VirtualHost *:5000><br>
    Header edit Location "^https://[^/]+" "<a href="https://localhost:9443" rel="noreferrer" target="_blank">https://localhost:9443</a>"<br>
    WSGIScriptAlias / /usr/share/crane/crane.wsgi<br>
    <Location /crane><br>
        Require host localhost<br>
    </Location><br>
    <Directory /usr/share/crane/><br>
        Require all granted<br>
    </Directory><br>
</VirtualHost><br>
<br>
For example, without changing "Location", you would get this on<br>
the host:<br>
<br>
$ docker pull <a href="http://127.0.0.1:5000/busybox:latest" rel="noreferrer" target="_blank">127.0.0.1:5000/busybox:latest</a><br>
Trying to pull repository <a href="http://127.0.0.1:5000/busybox" rel="noreferrer" target="_blank">127.0.0.1:5000/busybox</a> ...<br>
Get <a href="https://default-bento-centos-74.vagrantup.com/pulp/docker/v2/busybox/manifests/list/latest" rel="noreferrer" target="_blank">https://default-bento-centos-<wbr>74.vagrantup.com/pulp/docker/<wbr>v2/busybox/manifests/list/<wbr>latest</a>: Not Found<br>
<br>
Using the cofiguration from above, you get:<br>
<br>
$ docker pull <a href="http://127.0.0.1:5000/busybox:1.27.0-glibc" rel="noreferrer" target="_blank">127.0.0.1:5000/busybox:1.27.0-<wbr>glibc</a><br>
Trying to pull repository <a href="http://127.0.0.1:5000/busybox" rel="noreferrer" target="_blank">127.0.0.1:5000/busybox</a> ...<br>
sha256:<wbr>ebeb530823bf0f229b2e2559a1ea92<wbr>298d7f1ce2efabd9030c5d2b1deac8<wbr>3af6: Pulling from <a href="http://127.0.0.1:5000/busybox
02b2b239e358" rel="noreferrer" target="_blank">127.0.0.1:5000/busybox<br>
02b2b239e358</a>: Pull complete<br>
<br>
<br>
- Simon<br>
<span class=""><br>
<br>
>    On Wed, Dec 13, 2017 at 11:29 AM, Mihai Ibanescu<br>
</span><div><div class="h5">>    <[1]<a href="mailto:mihai.ibanescu@gmail.com">mihai.ibanescu@gmail.com</a>> wrote:<br>
><br>
>    Hi,<br>
>    In our current setup, we have a purely internal pulp deployment, that<br>
>    publishes to an NFS share.<br>
>    HTTP frontend machines handle the cert-based authn/authz and serve the<br>
>    content from the NFS share.<br>
>    We have an internal set of HTTP frontend machines, and an internal<br>
>    customer has access to published content for all development stages<br>
>    (dev/test/prod).<br>
>    We also have an external set of HTTP frontend machines, that handle<br>
>    external customer requests, and only serve the prod stage. Content from<br>
>    the internal NFS share is selectively rsynced into the external disk<br>
>    share.<br>
>    This all works great for rpm and such.<br>
>    I believe there is a problem with docker. We would have one internal<br>
>    and one external crane deployment, as expected. Content would be<br>
>    rsynced, as usual. However, because the redirect URL is "baked" into<br>
>    the redirect json files, the external Crane would redirect to the<br>
>    internal system, which is not helpful.<br>
>    We would prefer not to republish / recreate the redirect files in our<br>
>    transition from internal to external content.<br>
>    One way to handle this would be a Crane configuration option that<br>
>    directs crane to rewrite the redirect URL. In that case, internal and<br>
>    external crane systems would be configured differently.<br>
>    The questions:<br>
>    * Is there such an option in Crane? (looking at the code, I believe the<br>
>    answer is no)<br>
>    * Is there a feature request for something like this already?<br>
>    * If not, do you agree what I've described above is a valid customer<br>
>    use case, and should I file it as a feature request?<br>
>    Thanks!<br>
>    Mihai<br>
><br>
>      ______________________________<wbr>_________________<br>
>      Pulp-dev mailing list<br>
</div></div>>      [2]<a href="mailto:Pulp-dev@redhat.com">Pulp-dev@redhat.com</a><br>
>      [3]<a href="https://www.redhat.com/mailman/listinfo/pulp-dev" rel="noreferrer" target="_blank">https://www.redhat.com/<wbr>mailman/listinfo/pulp-dev</a><br>
><br>
> References<br>
><br>
>    1. mailto:<a href="mailto:mihai.ibanescu@gmail.com">mihai.ibanescu@gmail.<wbr>com</a><br>
>    2. mailto:<a href="mailto:Pulp-dev@redhat.com">Pulp-dev@redhat.com</a><br>
>    3. <a href="https://www.redhat.com/mailman/listinfo/pulp-dev" rel="noreferrer" target="_blank">https://www.redhat.com/<wbr>mailman/listinfo/pulp-dev</a><br>
<div class="HOEnZb"><div class="h5"><br>
> ______________________________<wbr>_________________<br>
> Pulp-dev mailing list<br>
> <a href="mailto:Pulp-dev@redhat.com">Pulp-dev@redhat.com</a><br>
> <a href="https://www.redhat.com/mailman/listinfo/pulp-dev" rel="noreferrer" target="_blank">https://www.redhat.com/<wbr>mailman/listinfo/pulp-dev</a><br>
</div></div></blockquote></div><br></div>