ericpaulbishop / gargoyle

Gargoyle Router Management Utility
http://www.gargoyle-router.com
467 stars 221 forks source link

gpkg - problem with openwrt repo #874

Closed obsy closed 4 years ago

obsy commented 4 years ago

for example:

root@Gargoyle:~# cat /etc/opkg.conf 

dest root /
dest ram /tmp
dest plugin_root /plugin_root
lists_dir ext /var/opkg-lists
option overlay_root /overlay
src/gz openwrt_base http://downloads.openwrt.org/releases/packages-19.07/x86_64/base
root@Gargoyle:~# opkg update
Downloading package list for openwrt_base source...
Package list for openwrt_base downloaded successfully.

root@Gargoyle:~# cat /tmp/opkg-lists/openwrt_base 
<html>
<head><title>301 Moved Permanently</title></head>
<body bgcolor="white">
<center><h1>301 Moved Permanently</h1></center>
<hr><center>nginx/1.10.3</center>
</body>
</html>

Gargoyle 1.13, on OpenWrt 19.07. I specially cut out another repo to show what the problem is. OpenWrt 19.07 normally download it, but gpkg show redirect, not proper content.

obsy commented 4 years ago

Problem with library?

root@Gargoyle:~# ewget -O - http://downloads.openwrt.org/releases/packages-19.07/x86_64/base/Packages
<html>
<head><title>301 Moved Permanently</title></head>
<body bgcolor="white">
<center><h1>301 Moved Permanently</h1></center>
<hr><center>nginx/1.10.3</center>
</body>
</html>
root@Gargoyle:~# wget -O - http://downloads.openwrt.org/releases/packages-19.07/x86_64/base/Packages
Downloading 'http://downloads.openwrt.org/releases/packages-19.07/x86_64/base/Packages'
Connecting to 176.9.48.73:80
Writing to stdout
Package: 464xlat
Version: 12
Depends: libc, kmod-nat46, ip
License: GPL-2.0
Section: net
Architecture: x86_64
Installed-Size: 4110
Filename: 464xlat_12_x86_64.ipk
Size: 4907
SHA256sum: 26d46990babcd92c811df45be0c83d579de680495d3987d437d17ebcf6435404
Description:  464xlat provides support to deploy limited IPv4 access services to mobile
 and wireline IPv6-only edge networks without encapsulation (RFC6877)

Package: 6in4
Version: 25-1
....
lantis1008 commented 4 years ago

Yes, libewget does not support following redirects. I've half written a patch for this. Should be done over the weekend. Temporary workaround is to change all URLs to HTTPS so they don't need to redirect.

lantis1008 commented 4 years ago

@obsy can you please test and confirm working + resolves issue? If ok, I will backport to 1.12 as well.

http://downloads.openwrt.org/releases/packages-19.07/x86_64/base/Packages should redirect to https://downloads.openwrt.org/releases/packages-19.07/x86_64/base/Packages

http://google.com should redirect to http://www.google.com

I have currently set it so that redirects are always followed, up to a depth of 3. Any further and it will fail to fetch the url with the standard error.

obsy commented 4 years ago

Yes, good job!

ewget - works, can download google or packages from openwrt repo. gpkg - works, can download package list from http source.

Seems ok.

lantis1008 commented 4 years ago

Fixed in master and 1.12. Will merge master into the ipv6 branch at some point as well.