aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/apt-panopticon.lua
diff options
context:
space:
mode:
Diffstat (limited to 'apt-panopticon.lua')
-rwxr-xr-xapt-panopticon.lua28
1 files changed, 21 insertions, 7 deletions
diff --git a/apt-panopticon.lua b/apt-panopticon.lua
index 5658d48..50e6177 100755
--- a/apt-panopticon.lua
+++ b/apt-panopticon.lua
@@ -21,7 +21,7 @@ local releaseFiles =
21 "Release.gpg", -- 21 "Release.gpg", --
22-- "InRelease", -- 3.7 MB 22-- "InRelease", -- 3.7 MB
23-- "main/binary-all/Packages.xz", -- 2.6 GB for all that changed recently. 23-- "main/binary-all/Packages.xz", -- 2.6 GB for all that changed recently.
24 -- Contents files. -- 3.3 GB 24-- Contents files. -- 3.3 GB
25-- "main/Contents-all.xz", 25-- "main/Contents-all.xz",
26-- "main/Contents-amd64.xz", 26-- "main/Contents-amd64.xz",
27-- "main/Contents-arm64.xz", 27-- "main/Contents-arm64.xz",
@@ -36,15 +36,16 @@ local notExist =
36local referenceDebs = 36local referenceDebs =
37{ 37{
38 -- Debian package. 38 -- Debian package.
39 "merged/pool/DEBIAN/main/d/debian-keyring/debian-keyring_2024.03.24_all.deb", 39 "merged/pool/DEBIAN/main/d/debian-keyring/debian-keyring_2025.03.23_all.deb",
40 -- Debian security package. NOTE this one should always be redirected? 40 -- Debian security package. NOTE this one should always be redirected?
41 "merged/pool/DEBIAN-SECURITY/updates/main/a/apt/apt-transport-https_1.8.2.2_all.deb", 41 "merged/pool/DEBIAN-SECURITY/updates/main/e/exim4/exim4_4.96-15+deb12u7_all.deb",
42} 42}
43local referenceDevs = 43local referenceDevs =
44{ 44{
45 -- Devuan package. NOTE this one should not get redirected, but that's more a warning than an error. 45 -- Devuan package. NOTE this one should not get redirected, but that's more a warning than an error.
46 "merged/pool/DEVUAN/main/d/devuan-keyring/devuan-keyring_2023.10.07_all.deb", -- Devuan keeps changing this since the key expiry incident. 46 "merged/pool/DEVUAN/main/d/devuan-keyring/devuan-keyring_2025.06.02_all.deb", -- Devuan keeps changing this since the key expiry incident.
47 "merged/pool/DEVUAN/main/b/base-files/base-files_13.2devuan1_all.deb", 47 -- Hmmm used to be _all, but it was split to the individual archs. Seems pointless, each one is the same size as the previous all.
48 "merged/pool/DEVUAN/main/b/base-files/base-files_13.8devuan1_amd64.deb",
48} 49}
49 50
50local keyring = "/usr/share/keyrings/devuan-archive-keyring.gpg" 51local keyring = "/usr/share/keyrings/devuan-archive-keyring.gpg"
@@ -276,7 +277,11 @@ checkHEAD = function (host, URL, r, retry, sanity)
276 if "http" == PU.scheme then 277 if "http" == PU.scheme then
277 hdr = '-H "Host: ' .. host .. '"' 278 hdr = '-H "Host: ' .. host .. '"'
278 end 279 end
279 IP = '--connect-to "' .. pu.host .. '::' .. PU.host .. ':"' 280 if '-6' == APT.IPv46 then
281 IP = '--connect-to "' .. pu.host .. '::[' .. PU.host .. ']:"'
282 else
283 IP = '--connect-to "' .. pu.host .. '::' .. PU.host .. ':"'
284 end
280 fname = host .. "_" .. pu.host .. '_' .. PU.host .. "_" .. PU.path:gsub("/", "_") .. ".txt" 285 fname = host .. "_" .. pu.host .. '_' .. PU.host .. "_" .. PU.path:gsub("/", "_") .. ".txt"
281 end 286 end
282 os.execute('rm -f results/HEADERS_' .. fname .. ' 2>/dev/null; rm -f results/STATUS_' .. fname .. ' 2>/dev/null; touch results/STATUS_' .. fname) 287 os.execute('rm -f results/HEADERS_' .. fname .. ' 2>/dev/null; rm -f results/STATUS_' .. fname .. ' 2>/dev/null; touch results/STATUS_' .. fname)
@@ -307,6 +312,10 @@ checkHEAD = function (host, URL, r, retry, sanity)
307 if "https" == PU.scheme and APT.options.roundRobin.value == host then 312 if "https" == PU.scheme and APT.options.roundRobin.value == host then
308 I(spcd .. "Not testing " .. APT.lnk(URL) .. " mirrors wont have the correct HTTPS certificate for the round robin.", host) 313 I(spcd .. "Not testing " .. APT.lnk(URL) .. " mirrors wont have the correct HTTPS certificate for the round robin.", host)
309 return 314 return
315-- TODO - For some odd reason, sometimes one of these is nil. Dig deeper to figure out why.
316 elseif "https" == PU.scheme and (APT.mirrors[host] ~= nil) and (APT.mirrors[host].Protocols ~= nil) and (not APT.mirrors[host].Protocols.https) then
317 I(spcd .. "Not testing " .. APT.lnk(URL) .. " host doesn't support HTTPS.", host)
318 return
310 else 319 else
311 I(spcd .. check .. " " .. APT.lnk(URL), host) 320 I(spcd .. check .. " " .. APT.lnk(URL), host)
312 end 321 end
@@ -624,6 +633,10 @@ end
624 633
625 634
626local validateURL = function(m) 635local validateURL = function(m)
636 if "http://" == m.BaseURL:sub(1, 7) then
637 W("HTTP at beginning of BaseURL in mirror_list.txt! " .. m.BaseURL, "", "", m.FQDN)
638 m.BaseURL = m.BaseURL:sub(1, -2)
639 end
627 if " " == m.BaseURL:sub(-1, -1) then 640 if " " == m.BaseURL:sub(-1, -1) then
628 W("space at end of BaseURL in mirror_list.txt! " .. m.BaseURL, "", "", m.FQDN) 641 W("space at end of BaseURL in mirror_list.txt! " .. m.BaseURL, "", "", m.FQDN)
629 m.BaseURL = m.BaseURL:sub(1, -2) 642 m.BaseURL = m.BaseURL:sub(1, -2)
@@ -636,7 +649,7 @@ local validateURL = function(m)
636 if nil == p.path then p.path = '' end 649 if nil == p.path then p.path = '' end
637 if nil ~= p.port then p.authority = authority .. ':' .. p.port end 650 if nil ~= p.port then p.authority = authority .. ':' .. p.port end
638 if nil == m.FQDN then W("Something wrong in FQDN from mirror_list.txt! nil", "", "", p.authority) else 651 if nil == m.FQDN then W("Something wrong in FQDN from mirror_list.txt! nil", "", "", p.authority) else
639 if m.FQDN ~= p.authority then W("Something wrong in FDQN from mirror_list.txt! " .. m.FDQN, "", "", p.authority) end 652 if m.FQDN ~= p.authority then W("Something wrong in FQDN from mirror_list.txt! " .. m.FQDN, "", "", p.authority) end
640 end 653 end
641 if nil == m.BaseURL then W("Something wrong in BaseURL from mirror_list.txt! nil", "", "", p.authority) else 654 if nil == m.BaseURL then W("Something wrong in BaseURL from mirror_list.txt! nil", "", "", p.authority) else
642 if m.BaseURL ~= (p.authority .. p.path) then W("Something wrong in BaseURL from mirror_list.txt! " .. m.BaseURL, "", "", p.authority) end 655 if m.BaseURL ~= (p.authority .. p.path) then W("Something wrong in BaseURL from mirror_list.txt! " .. m.BaseURL, "", "", p.authority) end
@@ -1158,6 +1171,7 @@ if 0 < #arg then
1158 checkFiles(pu.host, pu.host, pu.path:sub(1, -1), file); 1171 checkFiles(pu.host, pu.host, pu.path:sub(1, -1), file);
1159 end 1172 end
1160 else 1173 else
1174 if "-6" == APT.IPv46 then arg[2] = '[' .. arg[2] .. ']' end
1161 checkHost(pu.host, pu.host, pu.path, arg[2], arg[3]) 1175 checkHost(pu.host, pu.host, pu.path, arg[2], arg[3])
1162 end 1176 end
1163 1177