Rocksolid Light

Welcome to RetroBBS

mail  files  register  newsreader  groups  login

Message-ID:  

Maybe it's time to break that. -- Larry Wall in <199710311718.JAA19082@wall.org>


devel / comp.infosystems.gemini / Re: python gemini server?

SubjectAuthor
* python gemini server?gbbgu
+- Re: python gemini server?rek2 hispagatos
+* Re: python gemini server?John McCue
|`* Re: python gemini server?John
| `- Re: python gemini server?gbbgu
`* Re: python gemini server?SugarBug
 `- Re: python gemini server?SugarBug

1
python gemini server?

<EmcBN.400439$7sbb.261366@fx16.iad>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=528&group=comp.infosystems.gemini#528

  copy link   Newsgroups: comp.infosystems.gemini
Path: i2pn2.org!i2pn.org!weretis.net!feeder6.news.weretis.net!panix!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!peer03.iad!feed-me.highwinds-media.com!news.highwinds-media.com!fx16.iad.POSTED!not-for-mail
From: gbbgu@gbbgu.com (gbbgu)
Newsgroups: comp.infosystems.gemini
Subject: python gemini server?
X-Face: +|sL/Gh{tYJ*kM#HR<@Y%`FkF/`Y?+8N4m(2YM]:<r_Uo0Io4e^g"lX:Q0V~j.7,+rc8E=, \]E.gCS^Hk1h%vMI/66h689CFD=CXqW`VF(wt&\A'jMdQrh$CV2h2_p<(x&j:e1.>6q_=51=a}^zF\ yu4#DmCl'?T9Na5#U<#WnV]V<\ywSJhiV=)TtqQn?tc7T*z4Nz0t[t.S)63N58*HUCH`x
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8; format=fixed
Content-Transfer-Encoding: 8bit
User-Agent: Usenapp for MacOS
X-Usenapp: v1.27.2/l - Full License
Lines: 14
Message-ID: <EmcBN.400439$7sbb.261366@fx16.iad>
X-Complaints-To: abuse@frugalusenet.com
NNTP-Posting-Date: Wed, 21 Feb 2024 01:30:12 UTC
Organization: frugalusenet - www.frugalusenet.com
Date: Wed, 21 Feb 2024 01:30:12 GMT
X-Received-Bytes: 1072
 by: gbbgu - Wed, 21 Feb 2024 01:30 UTC

Is there a simple way to test gemini pages locally, the way you can with
python?

python3 -m http.server

I tried the following, expecting it to not work:

python3 -m http.server 1965

No surprise it didn't. Returned a "TLS/SSL handshake failed"

--
gbbgu

Re: python gemini server?

<ur3scc$1h3m2$1@matrix.hispagatos.org>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=529&group=comp.infosystems.gemini#529

  copy link   Newsgroups: comp.infosystems.gemini
Path: i2pn2.org!i2pn.org!news.hispagatos.org!.POSTED!not-for-mail
From: rek2@hispagatos.org.invalid (rek2 hispagatos)
Newsgroups: comp.infosystems.gemini
Subject: Re: python gemini server?
Date: Wed, 21 Feb 2024 03:58:04 -0000 (UTC)
Organization: Hispagatos
Message-ID: <ur3scc$1h3m2$1@matrix.hispagatos.org>
References: <EmcBN.400439$7sbb.261366@fx16.iad>
Reply-To: ReK2 <rek2@hispagatos.org>
Injection-Date: Wed, 21 Feb 2024 03:58:04 -0000 (UTC)
Injection-Info: matrix.hispagatos.org;
logging-data="1609410"; mail-complaints-to="abuse@hispagatos.org"
User-Agent: slrn/pre1.0.4-9 (Linux)
 by: rek2 hispagatos - Wed, 21 Feb 2024 03:58 UTC

On 2024-02-21, gbbgu <gbbgu@gbbgu.com> wrote:
> Is there a simple way to test gemini pages locally, the way you can with
> python?
>
> python3 -m http.server
>
> I tried the following, expecting it to not work:
>
> python3 -m http.server 1965
>
> No surprise it didn't. Returned a "TLS/SSL handshake failed"
>
>

Differente protocol all together, python is a scripting language
with a lot of high level libs like http.* you will need a gemini.* lib
to speak gemini or use the lower level tcp/ip socket python library
and build the gemini lib yourself.
I wrote some C/GO/Rust gemini servers for fun, did not try with python
but I am sure python have a lower level tcp stack you can use.

Happy Hacking
ReK2

--
- {gemini,https}://{,rek2.}hispagatos.org - mastodon: @rek2@hispagatos.space
- [https|gemini]://2600.Madrid - https://hispagatos.space/@rek2
- https://keyoxide.org/A31C7CE19D9C58084EA42BA26C0B0D11E9303EC5

Re: python gemini server?

<ur5504$37j3i$1@dont-email.me>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=530&group=comp.infosystems.gemini#530

  copy link   Newsgroups: comp.infosystems.gemini
Path: i2pn2.org!i2pn.org!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: jmccue@qball.jmcunx.com (John McCue)
Newsgroups: comp.infosystems.gemini
Subject: Re: python gemini server?
Date: Wed, 21 Feb 2024 15:31:16 -0000 (UTC)
Organization: A noiseless patient Spider
Lines: 21
Message-ID: <ur5504$37j3i$1@dont-email.me>
References: <EmcBN.400439$7sbb.261366@fx16.iad>
Reply-To: jmclnx@SPAMisBADgmail.com
Injection-Date: Wed, 21 Feb 2024 15:31:16 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="a3afbdd3c65fa02c7be444b46bef39a4";
logging-data="3394674"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+Mk4IlfFAU4ImfvFVUbD5A"
User-Agent: tin/2.6.2-20221225 ("Pittyvaich") (OpenBSD/7.4 (amd64))
Cancel-Lock: sha1:k4LjGVJ+1Yn1J0w+wqfNeHNDR6s=
X-OS-Version: OpenBSD 7.4 amd64
 by: John McCue - Wed, 21 Feb 2024 15:31 UTC

gbbgu <gbbgu@gbbgu.com> wrote:
> Is there a simple way to test gemini pages locally, the
> way you can with python?

Question is a bit unclear. Are you asking if there is a way
for you to view a gemini text file as if you are viewing it
using amafora or bombadillo ?

This simple utility should work, *but* links will not work,
it just formats the document on stdout.

gemini://gem.sdf.org/jmccue/computer/repoinfo/jgemini.gmi

<snip>

HTH
John

--
[t]csh(1) - "An elegant shell, for a more... civilized age."
- Paraphrasing Star Wars

Re: python gemini server?

<86ttm190zt.fsf@building-m.net>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=531&group=comp.infosystems.gemini#531

  copy link   Newsgroups: comp.infosystems.gemini
Path: i2pn2.org!i2pn.org!weretis.net!feeder6.news.weretis.net!news.quux.org!news.building-m.net!.POSTED.localhost!not-for-mail
From: john@building-m.simplistic-anti-spam-measure.net (John)
Newsgroups: comp.infosystems.gemini
Subject: Re: python gemini server?
Date: Wed, 21 Feb 2024 17:32:38 +0000
Organization: Building M
Message-ID: <86ttm190zt.fsf@building-m.net>
References: <EmcBN.400439$7sbb.261366@fx16.iad> <ur5504$37j3i$1@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain
Injection-Info: ritvax.building-m.net; posting-host="localhost:::1";
logging-data="3644276"; mail-complaints-to="abuse@building-m.net"
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.2 (gnu/linux)
Cancel-Lock: sha1:CPIjoLZGfOd6QvLCJf8STkp+Gno=
 by: John - Wed, 21 Feb 2024 17:32 UTC

John McCue <jmccue@qball.jmcunx.com> writes:

> gbbgu <gbbgu@gbbgu.com> wrote:
>> Is there a simple way to test gemini pages locally, the
>> way you can with python?
>
> Question is a bit unclear. Are you asking if there is a way
> for you to view a gemini text file as if you are viewing it
> using amafora or bombadillo ?
>
> This simple utility should work, *but* links will not work,
> it just formats the document on stdout.
>
> gemini://gem.sdf.org/jmccue/computer/repoinfo/jgemini.gmi
>
> <snip>
>
> HTH
> John

OP was clearly asking for a Gemini server which can be fired up quickly
without installation or configuration; the python HTTP server example he
provided does exactly that.

Unfortunately Google's Gemini AI service has already completely polluted
the search results for "python gemini server", so I wasn't able to find
anything, but take heart: Gemini is so simple you can write a server in
an afternoon, and you shouldn't deprive yourself of that experience
either, because "I wrote a Gemini [server|client] in an afternoon" is
pretty much required content on any Gemini host so you'll want your own.

john

Re: python gemini server?

<ur5r0t$1qqor$1@novabbs.org>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=532&group=comp.infosystems.gemini#532

  copy link   Newsgroups: comp.infosystems.gemini
Path: i2pn2.org!rocksolid2!.POSTED!not-for-mail
From: 3883@sugar.bug (SugarBug)
Newsgroups: comp.infosystems.gemini
Subject: Re: python gemini server?
Date: Wed, 21 Feb 2024 21:47:09 -0000 (UTC)
Organization: Baggy Jeans Mafia (sybershock.com)
Message-ID: <ur5r0t$1qqor$1@novabbs.org>
References: <EmcBN.400439$7sbb.261366@fx16.iad>
MIME-Version: 1.0
Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: 7bit
Injection-Date: Wed, 21 Feb 2024 21:47:09 -0000 (UTC)
Injection-Info: novabbs.org;
logging-data="1927963"; mail-complaints-to="usenet@novabbs.org";
posting-account="TzG3Hl99Aa0Fgb506WreKRgRTO2mG9+aGjVDifyfNqo";
X-Spam-Checker-Version: SpamAssassin 4.0.0
X-Newsreader: 3883.7766
 by: SugarBug - Wed, 21 Feb 2024 21:47 UTC

On Wed, 21 Feb 2024 01:30:12 GMT
gbbgu <gbbgu@gbbgu.com> wrote:

> Is there a simple way to test gemini pages locally, the way you can with
> python?
>
> python3 -m http.server
>
> I tried the following, expecting it to not work:
>
> python3 -m http.server 1965
>
> No surprise it didn't. Returned a "TLS/SSL handshake failed"

No, there is no such simple way but you can create your own simple analogue with a shell function.

The problem doing this with gemini is the mandatory TLS. Gemini servers and clients _require_ TLS. In order to test on a local server you must set up TLS certificates. Gemini clients AFIAK also always check for TLS certificates so testing without certificates would probably not work.

You may try 'molly-brown' gemini server in the Debian repos. It is designed to be simple for local testing. You will need to set up TLS certificates, a custom config, and a shell alias. You can generate TLS certificates with OpenSSL and store them in an arbitrary directory. Then you can configure a custom config file for molly-brown, pointing to these certs. Then you can create a bash alias function to invoke molly-brown using this config which will operate in the local shell directory similar to python simple http server. You will need to import that alias in your .bashrc or .profile.

There are many online tutorials for generating the OpenSSL PEM keypairs so I won't replicate that in this post.

So it is doable. You you have about a half-dozen steps to set it up. Then afterward the function command will do what you are seeking.

I hope this makes sense for you. After you set it up perhaps you could script the setup so others could do it with just a shell script.

Install on Debian: $ sudo apt-get install molly-brown

Molly-Brown gemini server: https://tildegit.org/solderpunk/molly-brown.

--
3883@sugar.bug | sybershock.com

Re: python gemini server?

<ur5rg7$1qrks$1@novabbs.org>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=533&group=comp.infosystems.gemini#533

  copy link   Newsgroups: comp.infosystems.gemini
Path: i2pn2.org!rocksolid2!.POSTED!not-for-mail
From: 3883@sugar.bug (SugarBug)
Newsgroups: comp.infosystems.gemini
Subject: Re: python gemini server?
Date: Wed, 21 Feb 2024 21:55:19 -0000 (UTC)
Organization: Baggy Jeans Mafia (sybershock.com)
Message-ID: <ur5rg7$1qrks$1@novabbs.org>
References: <EmcBN.400439$7sbb.261366@fx16.iad>
<ur5r0t$1qqor$1@novabbs.org>
MIME-Version: 1.0
Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: 7bit
Injection-Date: Wed, 21 Feb 2024 21:55:19 -0000 (UTC)
Injection-Info: novabbs.org;
logging-data="1928860"; mail-complaints-to="usenet@novabbs.org";
posting-account="TzG3Hl99Aa0Fgb506WreKRgRTO2mG9+aGjVDifyfNqo";
X-Spam-Checker-Version: SpamAssassin 4.0.0
X-Newsreader: 3883.7766
 by: SugarBug - Wed, 21 Feb 2024 21:55 UTC

On Wed, 21 Feb 2024 21:47:09 -0000 (UTC)
SugarBug <3883@sugar.bug> wrote:

> There are many online tutorials for generating the OpenSSL PEM keypairs so I won't replicate that in this post.

P.S. I failed to mention that there is a tool for quickly generating gemini TLS keypairs:

gemcert: https://tildegit.org/solderpunk/gemcert

--
3883@sugar.bug | https://sybershock.com

Re: python gemini server?

<2JvBN.519239$p%Mb.386290@fx15.iad>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=534&group=comp.infosystems.gemini#534

  copy link   Newsgroups: comp.infosystems.gemini
Path: i2pn2.org!i2pn.org!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!peer01.iad!feed-me.highwinds-media.com!news.highwinds-media.com!fx15.iad.POSTED!not-for-mail
From: gbbgu@gbbgu.com (gbbgu)
Newsgroups: comp.infosystems.gemini
Subject: Re: python gemini server?
X-Face: +|sL/Gh{tYJ*kM#HR<@Y%`FkF/`Y?+8N4m(2YM]:<r_Uo0Io4e^g"lX:Q0V~j.7,+rc8E=, \]E.gCS^Hk1h%vMI/66h689CFD=CXqW`VF(wt&\A'jMdQrh$CV2h2_p<(x&j:e1.>6q_=51=a}^zF\ yu4#DmCl'?T9Na5#U<#WnV]V<\ywSJhiV=)TtqQn?tc7T*z4Nz0t[t.S)63N58*HUCH`x
References: <EmcBN.400439$7sbb.261366@fx16.iad> <ur5504$37j3i$1@dont-email.me> <86ttm190zt.fsf@building-m.net>
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8; format=fixed
Content-Transfer-Encoding: 8bit
User-Agent: Usenapp for MacOS
X-Usenapp: v1.27.2/l - Full License
Lines: 48
Message-ID: <2JvBN.519239$p%Mb.386290@fx15.iad>
X-Complaints-To: abuse@frugalusenet.com
NNTP-Posting-Date: Wed, 21 Feb 2024 23:31:10 UTC
Organization: frugalusenet - www.frugalusenet.com
Date: Wed, 21 Feb 2024 23:31:10 GMT
X-Received-Bytes: 2647
 by: gbbgu - Wed, 21 Feb 2024 23:31 UTC

On 22 Feb 2024, John wrote:

> John McCue <jmccue@qball.jmcunx.com> writes:
>
>> gbbgu <gbbgu@gbbgu.com> wrote:
>>> Is there a simple way to test gemini pages locally, the
>>> way you can with python?
>>
>> Question is a bit unclear. Are you asking if there is a way
>> for you to view a gemini text file as if you are viewing it
>> using amafora or bombadillo ?
>>
>> This simple utility should work, *but* links will not work,
>> it just formats the document on stdout.
>>
>> gemini://gem.sdf.org/jmccue/computer/repoinfo/jgemini.gmi
>>
>> <snip>
>>
>> HTH
>> John
>
> OP was clearly asking for a Gemini server which can be fired up quickly
> without installation or configuration; the python HTTP server example he
> provided does exactly that.
>
> Unfortunately Google's Gemini AI service has already completely polluted
> the search results for "python gemini server", so I wasn't able to find
> anything, but take heart: Gemini is so simple you can write a server in
> an afternoon, and you shouldn't deprive yourself of that experience
> either, because "I wrote a Gemini [server|client] in an afternoon" is
> pretty much required content on any Gemini host so you'll want your own.
>
> john

Thanks John, that describes what I was after. Quickly run an adhoc local
server and point Lagrange at 127.0.0.1 so that I can check formatting of files
before I sync them to main site.

I'll give writting my own a go, there's also a suggestion for molly-brown
which I need to look at.

First step to writting code for me is to find out what others have done. Maybe
it turns out that someone has already scratched that same itch better than
anythnig I can write.

--
gbbgu

1
server_pubkey.txt

rocksolid light 0.9.81
clearnet tor