diff options
-rw-r--r-- | Report-web_2.html | 5 | ||||
-rw-r--r-- | apt-panopticommon.lua | 29 | ||||
-rwxr-xr-x | apt-panopticon-report-email-web.lua | 4 | ||||
-rwxr-xr-x | apt-panopticon.lua | 17 | ||||
-rwxr-xr-x | update_apt-panopticon | 6 |
5 files changed, 50 insertions, 11 deletions
diff --git a/Report-web_2.html b/Report-web_2.html index 592e8c6..2882179 100644 --- a/Report-web_2.html +++ b/Report-web_2.html | |||
@@ -1,5 +1,8 @@ | |||
1 | <p><font style='background-color:red; color:black'>EXPERIMENTAL CODE - double check all results you see here, and read the logs if it's important.</font></p> | 1 | <p><font style='background-color:red; color:black'>EXPERIMENTAL CODE - double check all results you see here, and read the logs if it's important.</font></p> |
2 | <p>The full list of Devuan package mirrors is available at the URL: <a href='https://pkgmaster.devuan.org/mirror_list.txt'>https://pkgmaster.devuan.org/mirror_list.txt</a></p> | 2 | <p>The full list of Devuan package mirrors is available at the URL: <a href='https://pkgmaster.devuan.org/mirror_list.txt'>https://pkgmaster.devuan.org/mirror_list.txt</a></p> |
3 | <p>Due to the nature of the tests, some errors or warnings will be counted several times. The links in the table and DNS list go to the detailed testing logs.</p> | 3 | <p>Due to the nature of the tests, some errors or warnings will be counted several times. There will be some duplication.</p> |
4 | <p>Due to the nature of the tests, some errors or warnings will be counted several times. There will be some duplication.</p> | ||
5 | <p>Due to the nature of the tests, some errors or warnings will be counted several times. There will be some duplication.</p> | ||
6 | <p>The links in the table and DNS list go to the detailed testing logs.</p> | ||
4 | 7 | ||
5 | <hr> | 8 | <hr> |
diff --git a/apt-panopticommon.lua b/apt-panopticommon.lua index e31c22f..982ff21 100644 --- a/apt-panopticommon.lua +++ b/apt-panopticommon.lua | |||
@@ -90,7 +90,7 @@ APT.options = | |||
90 | { | 90 | { |
91 | typ = "number", | 91 | typ = "number", |
92 | help = "", | 92 | help = "", |
93 | value = 5, | 93 | value = 24, |
94 | }, | 94 | }, |
95 | timeouts = | 95 | timeouts = |
96 | { | 96 | { |
@@ -501,6 +501,8 @@ APT.readCmd = function(cmd) | |||
501 | table.insert(result, l) | 501 | table.insert(result, l) |
502 | end | 502 | end |
503 | end | 503 | end |
504 | -- While this does return the same things as os.execute(), it's just as useless. | ||
505 | output:close() | ||
504 | return result | 506 | return result |
505 | end | 507 | end |
506 | 508 | ||
@@ -590,8 +592,9 @@ APT.exe = function(c) | |||
590 | I'm getting 7168 or 0. No idea what the fuck that is. | 592 | I'm getting 7168 or 0. No idea what the fuck that is. |
591 | local ok, rslt, status = os.execute(s) | 593 | local ok, rslt, status = os.execute(s) |
592 | ]] | 594 | ]] |
595 | |||
593 | local f = APT.readCmd(self.cmd, 'r') | 596 | local f = APT.readCmd(self.cmd, 'r') |
594 | -- The last line will be the command's returned status, collect everything else in result. | 597 | -- The last line will be the command's returned status, collect everything else in result. |
595 | self.status = '' -- Otherwise the result starts with 0. | 598 | self.status = '' -- Otherwise the result starts with 0. |
596 | self.result = '\n' | 599 | self.result = '\n' |
597 | for i,l in ipairs(f) do | 600 | for i,l in ipairs(f) do |
@@ -608,6 +611,28 @@ APT.exe = function(c) | |||
608 | E("status |" .. self.status .. '| ' .. self.command) | 611 | E("status |" .. self.status .. '| ' .. self.command) |
609 | end | 612 | end |
610 | end | 613 | end |
614 | |||
615 | --[[ While this is more reliable, it breaks stuff that's likely making assumptions that match the old way. | ||
616 | TODO - fix it later. | ||
617 | local f = APT.readCmd(self.cmd .. '; echo "$?"', 'r') | ||
618 | -- The last line will be the command's returned status, collect everything else in result. | ||
619 | self.status = tonumber(f[#f]) | ||
620 | f[#f] = nil | ||
621 | self.result = '\n' | ||
622 | for i,l in ipairs(f) do | ||
623 | self.result = self.result .. l .. "\n" | ||
624 | end | ||
625 | if (137 == self.status) or (124 == self.status) then | ||
626 | print("timeout killed " .. self.status .. ' ' .. self.command) | ||
627 | print('ERROR ' .. "timeout killed " .. self.status .. ' ' .. self.command) | ||
628 | elseif (nil == self.status) then | ||
629 | print("status |" .. "NIL" .. '| ' .. self.command) | ||
630 | E("status |" .. "NIL" .. '| ' .. self.command) | ||
631 | elseif (0 ~= self.status) then | ||
632 | -- print("status |" .. self.status .. '| ' .. self.command) | ||
633 | E("status |" .. self.status .. '| ' .. self.command) | ||
634 | end | ||
635 | ]] | ||
611 | return self | 636 | return self |
612 | end | 637 | end |
613 | function exe:fork(host) | 638 | function exe:fork(host) |
diff --git a/apt-panopticon-report-email-web.lua b/apt-panopticon-report-email-web.lua index 2a13975..7f010cb 100755 --- a/apt-panopticon-report-email-web.lua +++ b/apt-panopticon-report-email-web.lua | |||
@@ -444,7 +444,9 @@ if nil == email then C("opening mirrors file - " .. e) else | |||
444 | "The full results of the mirror checking is available at the URLs:\n\n" .. | 444 | "The full results of the mirror checking is available at the URLs:\n\n" .. |
445 | " https://borta.devuan.dev/apt-panopticon/results/Report-web.html\n (updated once every hour)\n" .. | 445 | " https://borta.devuan.dev/apt-panopticon/results/Report-web.html\n (updated once every hour)\n" .. |
446 | " https://sledjhamr.org/apt-panopticon/results/Report-web.html\n (updated once every ten minutes)\n\n" .. | 446 | " https://sledjhamr.org/apt-panopticon/results/Report-web.html\n (updated once every ten minutes)\n\n" .. |
447 | "Due to the nature of the tests, some errors or warnings will be \ncounted several times. " .. | 447 | "Due to the nature of the tests, some errors or warnings will be \ncounted several times. There will be some duplication.\n\n" .. |
448 | "Due to the nature of the tests, some errors or warnings will be \ncounted several times. There will be some duplication.\n\n" .. | ||
449 | "Due to the nature of the tests, some errors or warnings will be \ncounted several times. There will be some duplication.\n\n" .. | ||
448 | "Refer to the logs on the web page for details.\n\n" .. | 450 | "Refer to the logs on the web page for details.\n\n" .. |
449 | "Please see below the current status of the Devuan Package Mirror \nnetwork:\n\n" .. | 451 | "Please see below the current status of the Devuan Package Mirror \nnetwork:\n\n" .. |
450 | "==== package mirror status " .. os.date("!%F %H:%M") .. " GMT ====\n" .. | 452 | "==== package mirror status " .. os.date("!%F %H:%M") .. " GMT ====\n" .. |
diff --git a/apt-panopticon.lua b/apt-panopticon.lua index d7efc0e..30bff59 100755 --- a/apt-panopticon.lua +++ b/apt-panopticon.lua | |||
@@ -36,9 +36,9 @@ local notExist = | |||
36 | local referenceDebs = | 36 | local 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_2024.09.22_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+deb12u5_all.deb", |
42 | } | 42 | } |
43 | local referenceDevs = | 43 | local referenceDevs = |
44 | { | 44 | { |
@@ -277,7 +277,11 @@ checkHEAD = function (host, URL, r, retry, sanity) | |||
277 | if "http" == PU.scheme then | 277 | if "http" == PU.scheme then |
278 | hdr = '-H "Host: ' .. host .. '"' | 278 | hdr = '-H "Host: ' .. host .. '"' |
279 | end | 279 | end |
280 | 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 | ||
281 | fname = host .. "_" .. pu.host .. '_' .. PU.host .. "_" .. PU.path:gsub("/", "_") .. ".txt" | 285 | fname = host .. "_" .. pu.host .. '_' .. PU.host .. "_" .. PU.path:gsub("/", "_") .. ".txt" |
282 | end | 286 | end |
283 | 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) |
@@ -629,6 +633,10 @@ end | |||
629 | 633 | ||
630 | 634 | ||
631 | local validateURL = function(m) | 635 | local 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 | ||
632 | if " " == m.BaseURL:sub(-1, -1) then | 640 | if " " == m.BaseURL:sub(-1, -1) then |
633 | 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) |
634 | m.BaseURL = m.BaseURL:sub(1, -2) | 642 | m.BaseURL = m.BaseURL:sub(1, -2) |
@@ -641,7 +649,7 @@ local validateURL = function(m) | |||
641 | if nil == p.path then p.path = '' end | 649 | if nil == p.path then p.path = '' end |
642 | if nil ~= p.port then p.authority = authority .. ':' .. p.port end | 650 | if nil ~= p.port then p.authority = authority .. ':' .. p.port end |
643 | 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 |
644 | 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 |
645 | end | 653 | end |
646 | 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 |
647 | 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 |
@@ -1163,6 +1171,7 @@ if 0 < #arg then | |||
1163 | checkFiles(pu.host, pu.host, pu.path:sub(1, -1), file); | 1171 | checkFiles(pu.host, pu.host, pu.path:sub(1, -1), file); |
1164 | end | 1172 | end |
1165 | else | 1173 | else |
1174 | if "-6" == APT.IPv46 then arg[2] = '[' .. arg[2] .. ']' end | ||
1166 | checkHost(pu.host, pu.host, pu.path, arg[2], arg[3]) | 1175 | checkHost(pu.host, pu.host, pu.path, arg[2], arg[3]) |
1167 | end | 1176 | end |
1168 | 1177 | ||
diff --git a/update_apt-panopticon b/update_apt-panopticon index dde18a5..969cc8f 100755 --- a/update_apt-panopticon +++ b/update_apt-panopticon | |||
@@ -6,12 +6,12 @@ PANOPATH="/var/www/html/apt-panopticon" | |||
6 | cd ${PANOPATH}/apt-panopticon_cgp | 6 | cd ${PANOPATH}/apt-panopticon_cgp |
7 | if [ -d .git ] ; then | 7 | if [ -d .git ] ; then |
8 | git pull > /dev/null | 8 | git pull > /dev/null |
9 | chown -R www-data:www-data * | 9 | chown -hR www-data:www-data * |
10 | fi | 10 | fi |
11 | cd ${PANOPATH}/apt-panopticon | 11 | cd ${PANOPATH}/apt-panopticon |
12 | if [ -d .git ] ; then | 12 | if [ -d .git ] ; then |
13 | git pull > /dev/null | 13 | git pull > /dev/null |
14 | chown -R www-data:www-data * | 14 | chown -hR www-data:www-data * |
15 | fi | 15 | fi |
16 | 16 | ||
17 | # Check if the lock file still exists. | 17 | # Check if the lock file still exists. |
@@ -49,7 +49,7 @@ if [ -f apt-panopticon.lock ] ; then | |||
49 | fi | 49 | fi |
50 | rm ../results; ln -s apt-panopticon/results ../results | 50 | rm ../results; ln -s apt-panopticon/results ../results |
51 | 51 | ||
52 | chown -R www-data:www-data * | 52 | chown -hR www-data:www-data * |
53 | 53 | ||
54 | # Clean up any mess left over from THIS failed run. | 54 | # Clean up any mess left over from THIS failed run. |
55 | find results_* -maxdepth 2 ! -name "pkgmaster.devuan.org" -name "*.*" -type d -print0 | xargs -0rt /bin/rm -fr | 55 | find results_* -maxdepth 2 ! -name "pkgmaster.devuan.org" -name "*.*" -type d -print0 | xargs -0rt /bin/rm -fr |