121 Commits

Author SHA1 Message Date
Tianling Shen
9aeea00793
download.pl: update cdn domain
Signed-off-by: Tianling Shen <cnsztl@immortalwrt.org>
(cherry picked from commit 3ddf2d6612f08cca008c1881a297bf55753d8901)
2023-03-15 17:44:47 +08:00
Tianling Shen
243cb791ed
download.pl: fix typo error
Signed-off-by: Tianling Shen <cnsztl@immortalwrt.org>
(cherry picked from commit 9b3db09fe3a28af0bae0d972b2234cbf6a99a6c8)
2022-12-11 22:38:34 +08:00
Tianling Shen
cd25afbc7e
scripts/download.pl: update mirrors
Signed-off-by: Tianling Shen <cnsztl@immortalwrt.org>
(cherry picked from commit 3d37d7b1c0c823feea90c4cf632710ff83d87ce6)
2022-12-11 13:46:52 +08:00
Tianling Shen
fb16e01fc9
Revert "download.pl: remove broken mirror"
mirror2 now points to mirrors.gigenet.com.

This reverts commit 9fbf1751eced799a4320fed8095b78fbde2d5116.

Signed-off-by: Tianling Shen <cnsztl@immortalwrt.org>
(cherry picked from commit 4fb0bd80d53566ac918d6391b032639aad6ce84c)
2022-12-11 12:52:52 +08:00
Tianling Shen
cec31d8c48
Merge Official Source
Signed-off-by: Tianling Shen <cnsztl@immortalwrt.org>
2022-09-27 17:07:22 +08:00
Petr Štetiar
c07c565ea6 scripts/download.pl: fix downloads with wget
Several users of wget for downloads (curl is not available in the
system) have reported broken download functionality:

 wget --tries=5 --timeout=20 --output-document=-  https://cdn.kernel.org/pub/linux/kernel/v5.x/linux-5.10.142.tar.xz
 http://: Invalid host name.

Thats all happening due to '' was passed as an argument, which got later
expanded to http://.

In the context of a list constructor '' is not nothing, it is an empty
string element.  So fix it by using () as it will yield "nothing" and
thus not introduce an empty string element.

Fixes: #10692
Fixes: 90c6e3aedf16 ("scripts: always check certificates")
Signed-off-by: Jo-Philipp Wich <jo@mein.io> [shellwords() -> ()]
Signed-off-by: Petr Štetiar <ynezz@true.cz>
(cherry picked from commit 50a48faa1b8424e6b4b436b7118fffa2cba14b18)
2022-09-21 11:52:40 +02:00
Petr Štetiar
f14d7cef7c scripts/download.pl: silence can't exec curl warning
When running build in verbose mode `make V=s` we can see a lot of
following warnings when curl is not available in the system:

 Can't exec "curl": No such file or directory at scripts/download.pl line 77.

So lets fix it by redirecting of the stderr to null hole.

Signed-off-by: Petr Štetiar <ynezz@true.cz>
(cherry picked from commit c836ca84e8f641e10a8349a8f9b7432b33d6cec1)
2022-09-21 11:52:40 +02:00
Josh Roys
f0bca34f16 scripts: always check certificates
Remove flags from wget and curl instructing them to ignore bad server
certificates. Although other mechanisms can protect against malicious
modifications of downloads, other vectors of attack may be available
to an adversary.

TLS certificate verification can be disabled by turning oof the
"Enable TLS certificate verification during package download" option
enabled by default in the "Global build settings" in "make menuconfig"

Signed-off-by: Josh Roys <roysjosh@gmail.com>
[ add additional info on how to disable this option ]
Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
Signed-off-by: Petr Štetiar <ynezz@true.cz> [backport]
(cherry picked from commit 90c6e3aedf167b0ae1baf376e7800a631681e69a)
2022-09-21 11:52:40 +02:00
Tianling Shen
f150238b1d
download.pl: add ImmortalWrt fallback
Fixes: 759

Signed-off-by: Tianling Shen <cnsztl@immortalwrt.org>
(cherry picked from commit a19080494926ad523e636d7e075717b69e2f3e47)
2022-08-17 20:42:31 +08:00
Tianling Shen
117cd892e7
download.pl: remove broken mirror
Signed-off-by: Tianling Shen <cnsztl@immortalwrt.org>
(cherry picked from commit 9fbf1751eced799a4320fed8095b78fbde2d5116)
2022-08-06 18:50:11 +08:00
Tianling Shen
009fbb76d2
scripts/download.pl: drop broken mirror
Signed-off-by: Tianling Shen <cnsztl@immortalwrt.org>
(cherry picked from commit 02edeb14690c14bd7021b4be2270286bb4bb9108)
2022-05-06 22:11:22 +08:00
Tianling Shen
e80786fa7e
scripts/download.pl: drop cqu mirror
Signed-off-by: Tianling Shen <cnsztl@immortalwrt.org>
(cherry picked from commit 7807fb01194e29936cdac7cb84790624c3f4cc81)
2022-03-17 20:00:08 +08:00
Tianling Shen
af4829a642
scripts/download.pl: add new mirror
Signed-off-by: Tianling Shen <cnsztl@immortalwrt.org>
(cherry picked from commit 13c56d272d4218a706c986ef37de5be020aeafd6)
2021-11-30 20:43:52 +08:00
Tianling Shen
af64623418
scripts/download.pl: tweak default mirrors
Signed-off-by: Tianling Shen <cnsztl@immortalwrt.org>
2021-11-29 13:24:39 +08:00
Tianling Shen
b3d3ea94b1
scripts/download.pl: reorder self-hosted mirrors
Signed-off-by: Tianling Shen <cnsztl@immortalwrt.org>
(cherry picked from commit d26b4ff4de28af014b55a1040d5dd7fe01c026fb)
2021-11-29 00:44:47 +08:00
Tianling Shen
1480f5c9c4
scripts/download.pl: add immortalwrt's mirrors
Signed-off-by: Tianling Shen <cnsztl@immortalwrt.org>
(cherry picked from commit 30da20e2c5f4f29c3e6e6898775c9451b1c2f71e)
2021-11-23 02:08:23 +08:00
SuLingGG
67e8f2075e
scripts/download.pl: update openwrt.cc mirror url
[updated url]
Signed-off-by: Tianling Shen <cnsztl@immortalwrt.org>
(cherry picked from commit 009c17217107834cdf5ccc336e791ef0b33eada1)
2021-08-30 23:07:08 +08:00
Tianling Shen
5ef4b8e1de
download.pl: add some mirrors disabled by default
To avoid abuse, these mirrors will not be used until you enable them
manually.

Signed-off-by: Tianling Shen <cnsztl@immortalwrt.org>
(cherry picked from commit a3325e5051307bb92c2c3feaf44b0980421eb98c)
2021-07-15 22:38:10 +08:00
Tianling Shen
37f3ec2632
scripts/download: update mirror url
Signed-off-by: Tianling Shen <cnsztl@immortalwrt.org>
2021-05-26 22:18:23 +08:00
Tianling Shen
929818e613
scripts/download.pl: only call our own mirror when failed to download
Signed-off-by: Tianling Shen <cnsztl@immortalwrt.org>
2021-04-19 01:39:17 +08:00
Tianling Shen
244109d01b
scripts/download.pl: add aliyun(cn) mirror
Signed-off-by: Tianling Shen <cnsztl@immortalwrt.org>
2021-04-19 01:38:54 +08:00
Tianling Shen
a058fd9880
scripts/download.pl: remove unavailable mirror
Signed-off-by: Tianling Shen <cnsztl@immortalwrt.org>
2021-04-17 00:13:23 +08:00
Tianling Shen
b0f006510e
scripts/download.pl: update mirrors
Signed-off-by: Tianling Shen <cnsztl@immortalwrt.org>
2021-04-13 21:35:09 +08:00
Tianling Shen
9312dbaafe
scripts/download.pl: re-order mirrors
Signed-off-by: Tianling Shen <cnsztl@immortalwrt.org>
2021-03-26 22:17:32 +08:00
Tianling Shen
42f947d355
scripts/download.pl: correct branch name of self-hosted mirror
Signed-off-by: Tianling Shen <cnsztl@immortalwrt.org>
2021-03-26 21:32:06 +08:00
Tianling Shen
ae2a20dbf1
scripts/download.pl: add self-hosted mirror
Signed-off-by: Tianling Shen <cnsztl@immortalwrt.org>
2021-03-26 21:31:30 +08:00
Tianling Shen
9fa524a1b3
Revert "treewide: add mirrors for GitHub Codeload"
This reverts commit a8d2e30339d30d9dbcac16a0605fbc58bc5ff3ca.

Signed-off-by: Tianling Shen <cnsztl@immortalwrt.org>
2021-03-23 16:59:39 +08:00
Tianling Shen
b168db44e5
Revert "treewide: add mirrors for GitHub Archives"
This reverts commit c49d9634b52cb068b3f81958de1dfe03b56eade0.
2021-03-23 16:58:40 +08:00
Tianling Shen
4aee3088ea
scripts/download.pl: add download mirrors hosted by SuLingGG
Signed-off-by: Tianling Shen <cnsztl@immortalwrt.org>
2021-03-22 23:22:23 +08:00
Tianling Shen
1e0e462e2b
download.pl: fix path to mirror 182.140.223.146
Closes: #327

Signed-off-by: Tianling Shen <cnsztl@immortalwrt.org>
2021-03-22 17:11:02 +08:00
Tianling Shen
c49d9634b5
treewide: add mirrors for GitHub Archives
Signed-off-by: Tianling Shen <cnsztl@immortalwrt.org>
2021-03-15 15:05:02 +08:00
Tianling Shen
a8d2e30339
treewide: add mirrors for GitHub Codeload
Signed-off-by: Tianling Shen <cnsztl@immortalwrt.org>
2021-03-15 14:28:52 +08:00
Tianling Shen
2273d49ade
scripts/download.pl: add global mirror for mainland China users
Signed-off-by: Tianling Shen <cnsztl@immortalwrt.org>
2021-03-15 11:22:52 +08:00
Tianling Shen
cd48c34584
treewide: adjust tencent mirror
Signed-off-by: Tianling Shen <cnsztl@immortalwrt.org>
2021-03-11 14:58:34 +08:00
Tianling Shen
0d4a1f1dbd
Merge Official Source
Signed-off-by: Tianling Shen <cnsztl@immortalwrt.org>
2021-03-01 20:05:47 +08:00
David Bauer
f647d9e6bb download: remove broken mirrors
These mirrors don't exist anymore. Remove them.

Signed-off-by: David Bauer <mail@david-bauer.net>
(cherry picked from commit f04e0074915f03249cdebb460d4dc92875091c63)
2021-02-24 20:24:09 +01:00
CN_SZTL
c7a5137a82
Merge Official Source
Signed-off-by: CN_SZTL <cnsztl@project-openwrt.eu.org>
2021-02-06 23:30:24 +08:00
Paul Spooren
8286f3a3d3 treewide: unify OpenWrt hosted source via @OPENWRT
Multiple sources are hosted on OpenWrts source server only. The source
URLs to point to the server vary based on different epochs in OpenWrts
history.

Replace all by @OPENWRT which is an "empty" mirror, therefore using the
fallback servers sources.cdn.openwrt.org and sources.openwrt.org.

Signed-off-by: Paul Spooren <mail@aparcar.org>
2021-02-05 12:00:24 -10:00
CN_SZTL
1db9bd9bcd
Merge Official Source
Signed-off-by: CN_SZTL <cnsztl@project-openwrt.eu.org>
2021-01-28 19:39:04 +08:00
Paul Spooren
7521aedff4 scripts: sources CDN as fallback in download.pl
In case the default sources for a package fail use the CDN rather than
our own mirror. In case the CDN fails, fallback to our mirror.

Also remove mirror1 which isn't available anymore.

Signed-off-by: Paul Spooren <mail@aparcar.org>
2021-01-27 22:46:08 -10:00
CN_SZTL
769ae66506
Merge Official Source 2020-11-28 17:10:30 +08:00
Petr Štetiar
52a5d0d27f download.pl: properly cleanup intermediate .hash file
It seems like after a build the /dl dir seems to now contain a .hash
file for each source file due to inproper cleanup so fix it by removing
those intermediate files before leaving the download action.

Fixes: 4e19cbc55335 ("download: handle possibly invalid local tarballs")
Reported-by: Hannu Nyman <hannu.nyman@iki.fi>
Signed-off-by: Petr Štetiar <ynezz@true.cz>
2020-11-27 22:27:08 +01:00
Petr Štetiar
4e19cbc553 download: handle possibly invalid local tarballs
Currently it's assumed, that already downloaded tarballs are always
fine, so no checksum checking is performed and the tarball is used even
if it might be corrupted.

From now on, we're going to always check the downloaded tarballs before
considering them valid.

Steps to reproduce:

 1. Remove cached tarball

   rm dl/libubox-2020-08-06-9e52171d.tar.xz

 2. Download valid tarball again

   make package/libubox/download

 3. Invalidate the tarball

   sed -i 's/PKG_MIRROR_HASH:=../PKG_MIRROR_HASH:=ff/' package/libs/libubox/Makefile

 4. Now compile with corrupt tarball source

   make package/libubox/{clean,compile}

Signed-off-by: Petr Štetiar <ynezz@true.cz>
2020-11-27 14:46:13 +01:00
CN_SZTL
d19ba6f55d
Merge Official Source 2020-11-21 16:58:10 +08:00
David Bauer
d369993898 scripts: download.pl: retry download using filename
With this commit, the download script will try downloading source files
using the filename instead of the url-filename in case the previous
download attempt using the url-filename failed.

This is required, as the OpenWrt sources mirrors serve files using the
filename files might be renamed to after downloading. If the original
mirror for a file where url-filename and filename do not match goes
down, the download failed prior to this patch.

Further improvement can be done by performing this only for the
OpenWrt sources mirrors.

Signed-off-by: David Bauer <mail@david-bauer.net>
2020-11-20 02:35:43 +01:00
CN_SZTL
800a771f59
Merge Official Source 2020-09-12 00:08:25 +08:00
David Bauer
fe82ea049e scripts: download.pl: fix indentation
Signed-off-by: David Bauer <mail@david-bauer.net>
2020-09-11 17:35:19 +02:00
CN_SZTL
a3ea5e5076
Merge Official Source 2020-08-25 13:31:18 +08:00
Jo-Philipp Wich
bf96eb55c8 Revert "scripts/download: add sources CDN as first mirror"
This reverts commit c737a9ee6a9c47b6e553ac81bf293b1161e59799.

The source CDN has been discontinued in its current form and will take a
while to be reestablished. Even then it makes little sense to put a CDN
before other CDNs such as kernel.org, apache.org, sourceforge etc.

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2020-08-24 15:55:14 +02:00
CN_SZTL
38f947926c
scripts/download.pl: add cqu mirror for kernel downloading 2020-08-01 01:29:32 +08:00