On Fri, 22 Mar 2019 at 12:46:12 +0100, William Gathoye wrote:
> On 3/21/19 5:46 PM, Guilhem Moulin wrote:
>> JOIN'ing (ON h.sha256) the result of that query with a similar one (on
>> downloadarchive) we should be able to populate a static map for
>> ngx_http_map_module.  That's likely to be more robust than a map
>> obtained by manually scrapping HTML :-P
> 
> For sure, but how will be materialized this map table in practice, in
> terms of links?

Assuming a point in the future where 6.1.5, 6.2.1, and testing/6.2.2 are
no longer served by the mirror network, but stable/6.2.2 still is:

    curl -sw"%{http_code} %{redirect_url}\\n" \
        -o/dev/null 
https://download.documentfoundation.org/libreoffice/stable/6.1.5/mac/x86_64/LibreOffice_6.1.5_MacOS_x86-64.dmg
 \
        -o/dev/null 
https://download.documentfoundation.org/libreoffice/stable/6.2.1/deb/x86_64/LibreOffice_6.2.1_Linux_x86-64_deb.tar.gz
 \
        -o/dev/null 
https://download.documentfoundation.org/libreoffice/stable/6.2.2/win/x86/LibreOffice_6.2.2_Win_x86.msi
 \
        -o/dev/null 
https://download.documentfoundation.org/libreoffice/testing/6.2.2/win/x86/LibreOffice_6.2.2.2_Win_x86.msi
    302 
https://downloadarchive.documentfoundation.org/libreoffice/old/6.1.5.2/mac/x86_64/LibreOffice_6.1.5.2_MacOS_x86-64.dmg
    302 
https://downloadarchive.documentfoundation.org/libreoffice/old/6.2.1.2/deb/x86_64/LibreOffice_6.2.1.2_Linux_x86-64_deb.tar.gz
    302 
$MIRROR_BASEURL/libreoffice/testing/6.2.2/win/x86/LibreOffice_6.2.2.2_Win_x86.msi
    302 
https://downloadarchive.documentfoundation.org/libreoffice/old/6.2.2.2/win/x86/LibreOffice_6.2.2.2_Win_x86.msi

For the glory details, the map for ngx_http_map_module, populated from
the JOIN'ed queries:

    map $uri $archived_uri {
        
"/libreoffice/stable/6.1.5/mac/x86_64/LibreOffice_6.1.5_MacOS_x86-64.dmg"       
 "/libreoffice/old/6.1.5.2/mac/x86_64/LibreOffice_6.1.5.2_MacOS_x86-64.dmg";
        
"/libreoffice/stable/6.2.1/deb/x86_64/LibreOffice_6.2.1_Linux_x86-64_deb.tar.gz"
 
"/libreoffice/old/6.2.1.2/deb/x86_64/LibreOffice_6.2.1.2_Linux_x86-64_deb.tar.gz";
        "/libreoffice/stable/6.2.2/win/x86/LibreOffice_6.2.2_Win_x86.msi"       
         "/libreoffice/old/6.2.2.2/win/x86/LibreOffice_6.2.2.2_Win_x86.msi";
        "/libreoffice/testing/6.2.2/win/x86/LibreOffice_6.2.2.2_Win_x86.msi"    
         "/libreoffice/old/6.2.2.2/win/x86/LibreOffice_6.2.2.2_Win_x86.msi";
        […]
    }

Then in a 404 handler for the proxy's status code (not tested):

    if ($archived_uri != "") {
        return 302 https://downloadarchive.documentfoundation.org$archived_uri;
    }
    return 404 /path/to/404.html;

>> I can certainly do that, but to be useful that map would need to be
>> automatically updated during the releng process, so I'll let cloph
>> decide if that's viable.
> 
> Yes. If you can update us of his answer in this list, as soon you get
> more info that would be nice.

I assume he'll be reading this once he's back from vacation :-)
 
> Also, I forgot to mention, but if you could offer a link that point to
> the latest versions for both branch still and fresh, that would be nice
> of you. Or at least something that can be parsed with ease (to determine
> the latest version and link to these latest versions). Chocolatey and
> Homebrew, both using a fragile parsing solution for LibreOffice, will
> appreciate.

This was brought up during the Dec 2018 infra call, and rejected.  See
the minutes for the discussion.

-- 
Guilhem.

-- 
To unsubscribe e-mail to: [email protected]
Problems? https://www.libreoffice.org/get-help/mailing-lists/how-to-unsubscribe/
Posting guidelines + more: https://wiki.documentfoundation.org/Netiquette
List archive: https://listarchives.libreoffice.org/global/website/
Privacy Policy: https://www.documentfoundation.org/privacy

Reply via email to