diff mbox series

[OpenWrt-Devel] scripts/download: add sources CDN as first mirror

Message ID 20200406115319.43682-1-mail@aparcar.org
State Accepted
Delegated to: Daniel Golle
Headers show
Series [OpenWrt-Devel] scripts/download: add sources CDN as first mirror | expand

Commit Message

Paul Spooren April 6, 2020, 11:53 a.m. UTC
OpenWrt now has a CDN for sources at sources.cdn.openwrt.org which
mirrors sources.openwrt.org.

Downloading sources outside Europe or US (mainland) could
result in low throughput, extremely slowing down the first compilation of
the build system.

This patch adds sources.cdn.openwrt.org as the first mirror to offer
worldwide fast download speeds by default. If the CDN goes down for
whatever reason, the script jumps to the next available mirror and
downloads requested files as before (in regional varying speed).

Signed-off-by: Paul Spooren <mail@aparcar.org>
---
 scripts/download.pl | 1 +
 1 file changed, 1 insertion(+)

Comments

Eneas U de Queiroz April 6, 2020, 12:08 p.m. UTC | #1
Acked-by: Eneas U de Queiroz <cotequeiroz@gmail.com>

> Em 6 de abr de 2020, à(s) 08:53, Paul Spooren <mail@aparcar.org> escreveu:
> 
> OpenWrt now has a CDN for sources at sources.cdn.openwrt.org which
> mirrors sources.openwrt.org.
> 
> Downloading sources outside Europe or US (mainland) could
> result in low throughput, extremely slowing down the first compilation of
> the build system.
> 
> This patch adds sources.cdn.openwrt.org as the first mirror to offer
> worldwide fast download speeds by default. If the CDN goes down for
> whatever reason, the script jumps to the next available mirror and
> downloads requested files as before (in regional varying speed).
> 
> Signed-off-by: Paul Spooren <mail@aparcar.org>
> ---
> scripts/download.pl | 1 +
> 1 file changed, 1 insertion(+)
> 
> diff --git a/scripts/download.pl b/scripts/download.pl
> index dd49255367..1d3ff02c5b 100755
> --- a/scripts/download.pl
> +++ b/scripts/download.pl
> @@ -258,6 +258,7 @@ foreach my $mirror (@ARGV) {
>    }
> }
> 
> +unshift @mirrors, 'https://sources.cdn.openwrt.org';
> #push @mirrors, 'https://mirror1.openwrt.org';
> push @mirrors, 'https://sources.openwrt.org';
> push @mirrors, 'https://mirror2.openwrt.org/sources';
> -- 
> 2.25.1
> 
> 
> _______________________________________________
> openwrt-devel mailing list
> openwrt-devel@lists.openwrt.org
> https://lists.openwrt.org/mailman/listinfo/openwrt-devel
Paul Spooren April 14, 2020, 1 a.m. UTC | #2
Works fine locally and in my test infrastructure, worst case the CDN ever goes
offline is that it falls back to regular mirrors.

In case you set up your own feeds, the download.pl would still ask the CDN for
your self created package, what could be considered as a privacy leak. Should
this become options or at least disable-able via a option?

On Mon, 2020-04-06 at 01:53 -1000, Paul Spooren wrote:
> OpenWrt now has a CDN for sources at sources.cdn.openwrt.org which
> mirrors sources.openwrt.org.
> 
> Downloading sources outside Europe or US (mainland) could
> result in low throughput, extremely slowing down the first compilation of
> the build system.
> 
> This patch adds sources.cdn.openwrt.org as the first mirror to offer
> worldwide fast download speeds by default. If the CDN goes down for
> whatever reason, the script jumps to the next available mirror and
> downloads requested files as before (in regional varying speed).
> 
> Signed-off-by: Paul Spooren <mail@aparcar.org>
> ---
>  scripts/download.pl | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/scripts/download.pl b/scripts/download.pl
> index dd49255367..1d3ff02c5b 100755
> --- a/scripts/download.pl
> +++ b/scripts/download.pl
> @@ -258,6 +258,7 @@ foreach my $mirror (@ARGV) {
>  	}
>  }
>  
> +unshift @mirrors, 'https://sources.cdn.openwrt.org';
>  #push @mirrors, 'https://mirror1.openwrt.org';
>  push @mirrors, 'https://sources.openwrt.org';
>  push @mirrors, 'https://mirror2.openwrt.org/sources';
diff mbox series

Patch

diff --git a/scripts/download.pl b/scripts/download.pl
index dd49255367..1d3ff02c5b 100755
--- a/scripts/download.pl
+++ b/scripts/download.pl
@@ -258,6 +258,7 @@  foreach my $mirror (@ARGV) {
 	}
 }
 
+unshift @mirrors, 'https://sources.cdn.openwrt.org';
 #push @mirrors, 'https://mirror1.openwrt.org';
 push @mirrors, 'https://sources.openwrt.org';
 push @mirrors, 'https://mirror2.openwrt.org/sources';