#2961 proxies/forge: proxy attachment requests from Forge to Pagure
Opened 19 days ago by t0xic0der. Modified 2 days ago
fedora-infra/ t0xic0der/ansible prox  into  main

@@ -0,0 +1,8 @@ 

+ # Redirect links from Fedora Forge for Pagure attachments

+ {% if env == "staging" %}

+ ProxyPassMatch ^/(.+?)/issue/raw/files/(.*)$ https://stg.pagure.io/$1/issue/raw/files/$2

+ {% else %}

+ ProxyPassMatch ^/(.+?)/issue/raw/files/(.*)$ https://pagure.io/$1/issue/raw/files/$2

+ {% endif %}

+ 

+ {% include 'reversepassproxy.conf' %} 

\ No newline at end of file

redirect attachment file requests from Fedora Forge to Pagure for migrated
projects, allowing attachments to remain on this existing instance without
needing to be migrated.

Signed-off-by: Akashdeep Dhar akashdeep.dhar@gmail.com

Maybe the (.+?) is causing the problem? Can Apache do non-greedy matching? You could try something like ([^/]+) maybe?

@abompard correct me if I am mistaken but your regex would only work for single level repositories and not for those down one level (i.e. "namespace/repository" like "fedora-council/tickets"). Is this patch worth trying as compared to the likes #2959 and #2960?

Ah, right, there can be a / in repo names, I forgot.

So, this would then transparently proxy these for folks, so they would still see the forge url, etc, but apache would fetch from pagure on the backend?

I think we should test this in staging... so fine with me to merge and just deploy to staging.
Perhaps we drop the prod part for now pending that testing tho?

Metadata