:: Re: [devuan-dev] Introducing apt-pa…
Top Page
Delete this message
Reply to this message
Author: onefang
Date:  
To: devuan-dev
Subject: Re: [devuan-dev] Introducing apt-panopticon, my Devuan mirror checker script.
On Fri, 8 Nov 2019 13:15:20 +0100 Irrwahn said :
> (Sorry for the late reply, have been busy.)


No worries, I was busy melting.

[SNIP]
> [SNIP]> The language chosen is Lua. So lua-socket was used to
> provide the
> > HTTP / HTTPS / FTP / EMAIL functions. Lua-socket is commonly used
> > for these things in Lua scripts.
> [SNIP]
> > The latest version of lua-socket that isn't available for ASCII, not
> > even in backports, properly supported HTTPS. Lua-sec is
> > essentially a wrapper around lua-socket that does support HTTPS, so
> > I now use both. They are both a few versions behind, and there are
> > several fixes for the SSL parts of lua-sec.
>
> Uh, is Lua really the right choice then? Just a thought, as I
> haven't dug into what other frameworks offer in this regard (Python,
> Go, ...). Sorry I can't be of much help here. (FWIW, presented with
> the task I probably would've coded in C, but that'd be just me having
> fun shooting my own foot. ;-P)


C and Lua, and even C + Lua, are my current favourite programming
languages, along with some assembler when needed. I've been a
professional programmer since the late '70s, and I have used 100
programming languages in my career, so I consider myself to have
earned the right to be a language bigot. B-)

Usually I'll go with Lua if there is no need for speed, though I'll
tend to use LuaJIT for all my Lua needs, coz speed. Scripting
languages tend to be a little easier to write in than low level things
like C. Plus it's easier to install and run from source, which fit
into my "make it easy to use" goal. Sure I intend to bundle it up as a
package later, but that's a low priority, so for now people need to
grab the source repo. Apt-panopticon doesn't really need speed, it's
mostly waiting for remote servers to respond. It does need to run a lot
of the checks in parallel though, so I can be waiting for a bunch of
servers all at the same time.

[SNIP]

> > So switching to using curl or wget to do those tests might not help.
> > There is a lua-curl, though it's hard to tell which of several
> > different things with that or similar name it actually is without
> > digging deep.
> >
> > One thing I should do is to check what apt-transport-https actually
> > does in this situation.
>
> Good plan. Naively I would have thought it'd simply fail, as I never
> expect a hostname mismatch in an HTTPS request to just work without
> taking special care, like correctly setting up the SNI server_name
> parameter for the TLS negotiation, however this is usually one - my
> knowledge is quite limited in this area.


Apt-transport-https is part of apt, they are part of the apt source
package, though they build different packages. It's written in C++,
and uses libcurl. The curl version supplied with ASCII can be
convinced to use SNI, it's just not obvious how. I have now tried that
with mirror.stinpriza.org using curl command line, and it did work this
time.

So switching to lua-curl might be my best bet. Unfortunately the
"docs" that come with it for ASCII say this -

"This file was automatically generated by LuaDoc in 18 of August of
2006."

Though the changelog says the last change was 28 Jan 2017. As I
mentioned before, there seems to be several Lua curl things with
variations on the name on the web. Finding proper docs might be a
challenge. A challenge I'm up to. It looks to be just a thin wrapper
around libcurl anyway, so the libcurl docs should be sufficient. I've
used libcurl in the past, from C++.

Lua-socket is usually recommended for Lua network stuff, so I tried it
first.

> > I have various options to investigate. Today it got to 33 C, and
> > tomorrow it'll hit 37 C, though it'll cool down to merely 30 C the
> > next day. I have no air conditioning. I may not get much work
> > done for a while.
>
> It's a chilly 9°C here, now I'd like to trade places for a day. ;-D


I hate the cold. No trade. ;-P

--
A big old stinking pile of genius that no one wants
coz there are too many silver coated monkeys in the world.