💾 Archived View for gemi.dev › gemini-mailing-list › 000381.gmi captured on 2023-11-04 at 12:45:30. Gemini links have been rewritten to link to archived content

View Raw

More Information

➡️ Next capture (2023-12-28)

-=-=-=-=-=-=-

Announcing gmni, a line-mode gemini browser and curl-esque utility program

Drew DeVault <sir (a) cmpwn.com>

Hiya! I felt that the Gemini space has a lot of cool browers, but was
missing the basic works-everywhere client with few-to-no dependencies.

gmni fills that role:

https://sr.ht/~sircmpwn/gmni

Here's a recording which shows off some of its features:

https://asciinema.org/a/Y7viodM01e0AXYyf40CwSLAVA

Two tools are provided: gmni, a curl-like utility which executes Gemini
requests and writes the response to stdout, and gmnlm, a line-mode
interactive browser. The latter is demonstrated in the recording above.

The whole thing clocks in at approximately 3,000 lines of C11. It'll
grow a little bit with TOFU and client-side certificate support, but
otherwise it's pretty close to done. The only dependencies are a
POSIX-like system and OpenSSL.

The Gemini protocol implementation is pretty concise and
straightforward:

https://git.sr.ht/~sircmpwn/gmni/tree/master/include/gmni.h
https://git.sr.ht/~sircmpwn/gmni/tree/master/src/client.c
https://git.sr.ht/~sircmpwn/gmni/tree/master/src/parser.c

If there's any demand for it, I'll package these up into a library you
can link to. I also plan on writing a Gemini server in C with a similar
design approach.

Enjoy!

Link to individual message.

Kevin Sangeelee <kevin (a) susa.net>

 I get a weird sense of catharsis from stuff written in C - thanks for this.

I'm struck by the fact that URL parsing accounts for about half the code -
a stark reminder both of the effort required to handle formal
specifications properly, and of the value of the GPL.

Good stuff!

On Mon, 21 Sep 2020 at 03:30, Drew DeVault <sir at cmpwn.com> wrote:

> Hiya! I felt that the Gemini space has a lot of cool browers, but was
> missing the basic works-everywhere client with few-to-no dependencies.
>
> gmni fills that role:
>
> https://sr.ht/~sircmpwn/gmni
>
> Here's a recording which shows off some of its features:
>
> https://asciinema.org/a/Y7viodM01e0AXYyf40CwSLAVA
>
> Two tools are provided: gmni, a curl-like utility which executes Gemini
> requests and writes the response to stdout, and gmnlm, a line-mode
> interactive browser. The latter is demonstrated in the recording above.
>
> The whole thing clocks in at approximately 3,000 lines of C11. It'll
> grow a little bit with TOFU and client-side certificate support, but
> otherwise it's pretty close to done. The only dependencies are a
> POSIX-like system and OpenSSL.
>
> The Gemini protocol implementation is pretty concise and
> straightforward:
>
> https://git.sr.ht/~sircmpwn/gmni/tree/master/include/gmni.h
> https://git.sr.ht/~sircmpwn/gmni/tree/master/src/client.c
> https://git.sr.ht/~sircmpwn/gmni/tree/master/src/parser.c
>
> If there's any demand for it, I'll package these up into a library you
> can link to. I also plan on writing a Gemini server in C with a similar
> design approach.
>
> Enjoy!
>

Link to individual message.

Magnus Wild <magnus (a) kalasarn.se>

On Sun, Sep 20, 2020 at 10:12:26PM -0400, Drew DeVault wrote:
> Hiya! I felt that the Gemini space has a lot of cool browers, but was
> missing the basic works-everywhere client with few-to-no dependencies.

This is cool. I managed to build it on openbsd-current with a small
modification;

--- a/src/gmnlm.c
+++ b/src/gmnlm.c
@@ -10,6 +10,7 @@
 #include <sys/ioctl.h>
 #include <termios.h>
 #include <unistd.h>
+#include <limits.h>
 #include "gmni.h"
 #include "url.h"
 #include "util.h"

The error I got before this modification can be seen below.

openbsd-build$ make
CC      src/client.o
CC      src/escape.o
CC      src/gmni.o
CC      src/url.o
CCLD    gmni
CC      src/gmnlm.o
src/gmnlm.c:127:19: error: use of undeclared identifier 'PATH_MAX'
        static char path[PATH_MAX+1];
                         ^
src/gmnlm.c:155:19: error: use of undeclared identifier 'PATH_MAX'
        static char path[PATH_MAX+1];
                         ^
src/gmnlm.c:157:18: error: use of undeclared identifier 'PATH_MAX'
        static char url[PATH_MAX+1+7];
                        ^
3 errors generated.

-g  -std=c11  -D_XOPEN_SOURCE=700  -Wall  -Wextra  -Werror  -pedan...)

The program is really small and seems very useful. Thanks a lot for 
spending time on this and sharing it!

/Magnus

Link to individual message.

Drew DeVault <sir (a) cmpwn.com>

On Mon Sep 21, 2020 at 7:01 AM EDT, Magnus Wild wrote:
> This is cool. I managed to build it on openbsd-current with a small
> modification;
>
> --- a/src/gmnlm.c
> +++ b/src/gmnlm.c
> @@ -10,6 +10,7 @@
> #include <sys/ioctl.h>
> #include <termios.h>
> #include <unistd.h>
> +#include <limits.h>
> #include "gmni.h"
> #include "url.h"
> #include "util.h"

Thanks, I just pushed this change upstream.

> The program is really small and seems very useful. Thanks a lot for
> spending time on this and sharing it!

Cheers!

Link to individual message.

Magnus Wild <magnus (a) kalasarn.se>

On Mon, Sep 21, 2020 at 07:56:33AM -0400, Drew DeVault wrote:
> 
> Thanks, I just pushed this change upstream.
> 

Nice! That was quick. Thanks a lot! :)

/Magnus

Link to individual message.

Terry Brennan <tcb913 (a) gmail.com>

Hi! I read this message and thought I'd install the browser. To make a 
long story short:

I built and installed scdoc with no problems.

I ran configure in the gmni directory with no problems.

When I ran "make" in gmni directory, I got four errors:

     in client.c, line 126: implicit declaration of SSL_CTX_up_ref

     in client.c, line 128: implicit declaration of TLS_method

     in client.c, line 128: implicit conversion from int to pointer in 
arg to SSL_CTX_new

     in client.c, line 135: implicit declaration of SSL_up_ref

Seems like something's missing. I find no

BTW, you define CC as cc in config.sh. On my system cc is an alias for 
gcc-5.3.0. That should not be a problem.

Terry Brennan

On 09/20/2020 10:12 PM, Drew DeVault wrote:
> Hiya! I felt that the Gemini space has a lot of cool browers, but was
> missing the basic works-everywhere client with few-to-no dependencies.
>
> gmni fills that role:
>
> https://sr.ht/~sircmpwn/gmni
>
> Here's a recording which shows off some of its features:
>
> https://asciinema.org/a/Y7viodM01e0AXYyf40CwSLAVA
>
> Two tools are provided: gmni, a curl-like utility which executes Gemini
> requests and writes the response to stdout, and gmnlm, a line-mode
> interactive browser. The latter is demonstrated in the recording above.
>
> The whole thing clocks in at approximately 3,000 lines of C11. It'll
> grow a little bit with TOFU and client-side certificate support, but
> otherwise it's pretty close to done. The only dependencies are a
> POSIX-like system and OpenSSL.
>
> The Gemini protocol implementation is pretty concise and
> straightforward:
>
> https://git.sr.ht/~sircmpwn/gmni/tree/master/include/gmni.h
> https://git.sr.ht/~sircmpwn/gmni/tree/master/src/client.c
> https://git.sr.ht/~sircmpwn/gmni/tree/master/src/parser.c
>
> If there's any demand for it, I'll package these up into a library you
> can link to. I also plan on writing a Gemini server in C with a similar
> design approach.
>
> Enjoy!

Link to individual message.

Drew DeVault <sir (a) cmpwn.com>

That's quite bizzare. Are you perhaps using a system with LibreSSL
instead of OpenSSL?

Link to individual message.

Terry Brennan <tcb913 (a) gmail.com>

No, definitely using openssl. Lots of library stuff, and header files.

BTW, error messages did not report missing header files.

My openssl lib is libgnutils-openssl.so.27.0.2, if this helps.

tb


On 09/21/2020 03:28 PM, Drew DeVault wrote:
> That's quite bizzare. Are you perhaps using a system with LibreSSL
> instead of OpenSSL?

Link to individual message.

Drew DeVault <sir (a) cmpwn.com>

gnutls-openssl is not openssl.

Link to individual message.

Terry Brennan <tcb913 (a) gmail.com>

OK.

The include files openssl/bio.h, openssl/err.h, and openssl/ssl.h are 
there. Which openssl library does your Makefile want? (It's not clear, 
but configure does not throw any errors.

tb


On 09/21/2020 04:43 PM, Drew DeVault wrote:
> gnutls-openssl is not openssl.

Link to individual message.

Drew DeVault <sir (a) cmpwn.com>

On Wed Sep 23, 2020 at 8:40 AM EDT, Terry Brennan wrote:
> Which openssl library does your Makefile want? (It's not clear, but
> configure does not throw any errors.

It wants OpenSSL. This should be evident by the fact that it calls for
OpenSSL, and not for any other library.

https://www.openssl.org

Link to individual message.

Kevin Sangeelee <kevin (a) susa.net>

Hi Terry,

As has been alluded to elsewhere, you're not actually using OpenSSL, you
have GnuTLS with an OpenSSL compatibility layer (that's not fully
compatible, as you've seen).

On Debian, I have packages 'openssl' and 'libssl-dev' installed, you may
want to try installing these and then recompile gmni. I'm assuming OpenSSL
can co-exist with GnuTLS, but I haven't tried.

Kevin


On Mon, 21 Sep 2020 at 21:42, Terry Brennan <tcb913 at gmail.com> wrote:

> No, definitely using openssl. Lots of library stuff, and header files.
>
> BTW, error messages did not report missing header files.
>
> My openssl lib is libgnutils-openssl.so.27.0.2, if this helps.
>
> tb
>
>
> On 09/21/2020 03:28 PM, Drew DeVault wrote:
> > That's quite bizzare. Are you perhaps using a system with LibreSSL
> > instead of OpenSSL?
>
>

Link to individual message.

Terry Brennan <tcb913 (a) gmail.com>

Thanks, I'll try that.

tb


On 09/24/2020 04:22 PM, Kevin Sangeelee wrote:
> Hi Terry,
>
> As has been alluded to elsewhere, you're not actually using OpenSSL, 
> you have GnuTLS with an OpenSSL compatibility layer (that's not fully 
> compatible, as you've seen).
>
> On Debian, I have packages 'openssl' and 'libssl-dev' installed, you 
> may want to try installing these and then recompile gmni. I'm assuming 
> OpenSSL can co-exist with GnuTLS, but I haven't tried.
>
> Kevin
>
>
> On Mon, 21 Sep 2020 at 21:42, Terry Brennan <tcb913 at gmail.com 
> <mailto:tcb913 at gmail.com>> wrote:
>
>     No, definitely using openssl. Lots of library stuff, and header files.
>
>     BTW, error messages did not report missing header files.
>
>     My openssl lib is libgnutils-openssl.so.27.0.2, if this helps.
>
>     tb
>
>
>     On 09/21/2020 03:28 PM, Drew DeVault wrote:
>     > That's quite bizzare. Are you perhaps using a system with LibreSSL
>     > instead of OpenSSL?
>

Link to individual message.

Terry Brennan <tcb913 (a) gmail.com>

Kevin, thanks. I downloaded the ssl package from openssl.org, compiled 
and installed it, and the compile problems disappeared.

Interesting that Slackware does not offer openssl or libressl.

Terry Brennan


On 09/24/2020 04:22 PM, Kevin Sangeelee wrote:
> Hi Terry,
>
> As has been alluded to elsewhere, you're not actually using OpenSSL, 
> you have GnuTLS with an OpenSSL compatibility layer (that's not fully 
> compatible, as you've seen).
>
> On Debian, I have packages 'openssl' and 'libssl-dev' installed, you 
> may want to try installing these and then recompile gmni. I'm assuming 
> OpenSSL can co-exist with GnuTLS, but I haven't tried.
>
> Kevin
>
>
> On Mon, 21 Sep 2020 at 21:42, Terry Brennan <tcb913 at gmail.com 
> <mailto:tcb913 at gmail.com>> wrote:
>
>     No, definitely using openssl. Lots of library stuff, and header files.
>
>     BTW, error messages did not report missing header files.
>
>     My openssl lib is libgnutils-openssl.so.27.0.2, if this helps.
>
>     tb
>
>
>     On 09/21/2020 03:28 PM, Drew DeVault wrote:
>     > That's quite bizzare. Are you perhaps using a system with LibreSSL
>     > instead of OpenSSL?
>

Link to individual message.

Kevin Sangeelee <kevin (a) susa.net>

Glad you got it compiled (though it was Drew who pointed you there), the
whole SSL/TLS thing is a bit of a complicated mess on lots of levels. It's
a slog to grok (I'm not sure that's even achievable!).

Kevin

On Sat, 26 Sep 2020 at 19:15, Terry Brennan <tcb913 at gmail.com> wrote:

> Kevin, thanks. I downloaded the ssl package from openssl.org, compiled
> and installed it, and the compile problems disappeared.
>
> Interesting that Slackware does not offer openssl or libressl.
>
> Terry Brennan
>
> On 09/24/2020 04:22 PM, Kevin Sangeelee wrote:
>
> Hi Terry,
>
> As has been alluded to elsewhere, you're not actually using OpenSSL, you
> have GnuTLS with an OpenSSL compatibility layer (that's not fully
> compatible, as you've seen).
>
> On Debian, I have packages 'openssl' and 'libssl-dev' installed, you may
> want to try installing these and then recompile gmni. I'm assuming OpenSSL
> can co-exist with GnuTLS, but I haven't tried.
>
> Kevin
>
>
> On Mon, 21 Sep 2020 at 21:42, Terry Brennan <tcb913 at gmail.com> wrote:
>
>> No, definitely using openssl. Lots of library stuff, and header files.
>>
>> BTW, error messages did not report missing header files.
>>
>> My openssl lib is libgnutils-openssl.so.27.0.2, if this helps.
>>
>> tb
>>
>>
>> On 09/21/2020 03:28 PM, Drew DeVault wrote:
>> > That's quite bizzare. Are you perhaps using a system with LibreSSL
>> > instead of OpenSSL?
>>
>>
>

Link to individual message.

---

Previous Thread: Should Gemini clients alert users upon redirect?

Next Thread: Using normal tls certificates with gemini