Rocksolid Light

Welcome to RetroBBS

mail  files  register  newsreader  groups  login

Message-ID:  

To downgrade the human mind is bad theology. -- C. K. Chesterton


computers / news.software.nntp / alternative nnrpd external auth to postgresql

SubjectAuthor
* alternative nnrpd external auth to postgresqlrek2 hispagatos
`* Re: alternative nnrpd external auth to postgresqlrek2 hispagatos
 `* Re: alternative nnrpd external auth to postgresqlgo-while
  `* Re: alternative nnrpd external auth to postgresqlrek2 hispagatos
   `* Re: alternative nnrpd external auth to postgresqlgo-while
    `* Re: alternative nnrpd external auth to postgresqlrek2 hispagatos
     `* Re: alternative nnrpd external auth to postgresqlgo-while
      `* Re: alternative nnrpd external auth to postgresqlrek2 hispagatos
       `* Re: alternative nnrpd external auth to postgresqlBilly G. (go-while)
        +* Re: alternative nnrpd external auth to postgresqlBilly G. (go-while)
        |`* Re: alternative nnrpd external auth to postgresqlrek2 hispagatos
        | `* Re: alternative nnrpd external auth to postgresqlBilly G. (go-while)
        |  `* Re: alternative nnrpd external auth to postgresqlJulien ÉLIE
        |   `* Re: alternative nnrpd external auth to postgresqlrek2 hispagatos
        |    `- Re: alternative nnrpd external auth to postgresqlJulien ÉLIE
        `- Re: alternative nnrpd external auth to postgresqlrek2 hispagatos

1
alternative nnrpd external auth to postgresql

<u9jlnh$getb$1@matrix.hispagatos.org>

  copy mid

https://www.rocksolidbbs.com/computers/article-flat.php?id=1966&group=news.software.nntp#1966

  copy link   Newsgroups: news.software.nntp
Path: i2pn2.org!i2pn.org!news.hispagatos.org!.POSTED.47.60.37.165!not-for-mail
From: rek2@hispagatos.org.invalid (rek2 hispagatos)
Newsgroups: news.software.nntp
Subject: alternative nnrpd external auth to postgresql
Date: Sun, 23 Jul 2023 16:49:53 -0000 (UTC)
Organization: Hispagatos
Message-ID: <u9jlnh$getb$1@matrix.hispagatos.org>
Reply-To: ReK2 <rek2@hispagatos.org>
Injection-Date: Sun, 23 Jul 2023 16:49:53 -0000 (UTC)
Injection-Info: matrix.hispagatos.org; posting-host="47.60.37.165";
logging-data="539563"; mail-complaints-to="usenet@matrix.hispagatos.org"
User-Agent: slrn/pre1.0.4-9 (Linux)
 by: rek2 hispagatos - Sun, 23 Jul 2023 16:49 UTC

Work in progress, will deploy soon and let you guys know when is ready,
I still need to add some features so is generic, usable on other
situtions.

https://git.sr.ht/~rek2/nnrpd-password
Also writing a Usenet/Matrix portal, also work in progress.

Happy Hacking
ReK2

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

Re: alternative nnrpd external auth to postgresql

<u9uh09$a5ql$1@matrix.hispagatos.org>

  copy mid

https://www.rocksolidbbs.com/computers/article-flat.php?id=1996&group=news.software.nntp#1996

  copy link   Newsgroups: news.software.nntp
Path: i2pn2.org!i2pn.org!news.hispagatos.org!.POSTED.static-135-116-26-46.ipcom.comunitel.net!not-for-mail
From: rek2@hispagatos.org.invalid (rek2 hispagatos)
Newsgroups: news.software.nntp
Subject: Re: alternative nnrpd external auth to postgresql
Date: Thu, 27 Jul 2023 19:36:41 -0000 (UTC)
Organization: Hispagatos
Message-ID: <u9uh09$a5ql$1@matrix.hispagatos.org>
References: <u9jlnh$getb$1@matrix.hispagatos.org>
Reply-To: ReK2 <rek2@hispagatos.org>
Injection-Date: Thu, 27 Jul 2023 19:36:41 -0000 (UTC)
Injection-Info: matrix.hispagatos.org; posting-host="static-135-116-26-46.ipcom.comunitel.net:46.26.116.135";
logging-data="333653"; mail-complaints-to="usenet@matrix.hispagatos.org"
User-Agent: slrn/pre1.0.4-9 (Linux)
 by: rek2 hispagatos - Thu, 27 Jul 2023 19:36 UTC

On 2023-07-23, rek2 hispagatos <rek2@hispagatos.org.invalid> wrote:
> Work in progress, will deploy soon and let you guys know when is ready,
> I still need to add some features so is generic, usable on other
> situtions.
>
> https://git.sr.ht/~rek2/nnrpd-password
> Also writing a Usenet/Matrix portal, also work in progress.

OK this is already deployed and working, feel free to submit patches,
there are a lot to do still but is working now and is live on my own
server.

Happy Hacking
ReK2

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

Re: alternative nnrpd external auth to postgresql

<YJAwM.249652$Y1R7.117864@fx04.ams4>

  copy mid

https://www.rocksolidbbs.com/computers/article-flat.php?id=1997&group=news.software.nntp#1997

  copy link   Newsgroups: news.software.nntp
Path: i2pn2.org!i2pn.org!weretis.net!feeder8.news.weretis.net!newsreader4.netcologne.de!news.netcologne.de!peer01.ams1!peer.ams1.xlned.com!news.xlned.com!peer03.ams4!peer.am4.highwinds-media.com!news.highwinds-media.com!fx04.ams4.POSTED!not-for-mail
MIME-Version: 1.0
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101
Thunderbird/102.13.0
Subject: Re: alternative nnrpd external auth to postgresql
Newsgroups: news.software.nntp
References: <u9jlnh$getb$1@matrix.hispagatos.org>
<u9uh09$a5ql$1@matrix.hispagatos.org>
Content-Language: en-US
From: no-reply@no.spam (go-while)
In-Reply-To: <u9uh09$a5ql$1@matrix.hispagatos.org>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Lines: 24
Message-ID: <YJAwM.249652$Y1R7.117864@fx04.ams4>
X-Complaints-To: abuse@blocknews.net
NNTP-Posting-Date: Thu, 27 Jul 2023 20:47:52 UTC
Organization: blocknews - www.blocknews.net
Date: Thu, 27 Jul 2023 23:30:01 +0200
X-Received-Bytes: 1508
 by: go-while - Thu, 27 Jul 2023 21:30 UTC

On 27.07.23 21:36, rek2 hispagatos wrote:
> OK this is already deployed and working, feel free to submit patches,
> there are a lot to do still but is working now and is live on my own
> server.
>
> Happy Hacking
> ReK2
>

great work!

i dont know about rust and pgsql so i need ask question:

this code is safe against sql injection?

let creds = sqlx::query_as!(
Creds,
"SELECT usenet_password FROM users WHERE usenet_username = $1",
username
)

no need to check if username is alphanum before passing to db?

fn clean() splits by whitespace and parses to string only?

Re: alternative nnrpd external auth to postgresql

<u9vdi7$akhf$2@matrix.hispagatos.org>

  copy mid

https://www.rocksolidbbs.com/computers/article-flat.php?id=1998&group=news.software.nntp#1998

  copy link   Newsgroups: news.software.nntp
Path: i2pn2.org!i2pn.org!news.hispagatos.org!.POSTED.static-135-116-26-46.ipcom.comunitel.net!not-for-mail
From: rek2@hispagatos.org.invalid (rek2 hispagatos)
Newsgroups: news.software.nntp
Subject: Re: alternative nnrpd external auth to postgresql
Date: Fri, 28 Jul 2023 03:44:07 -0000 (UTC)
Organization: Hispagatos
Message-ID: <u9vdi7$akhf$2@matrix.hispagatos.org>
References: <u9jlnh$getb$1@matrix.hispagatos.org>
<u9uh09$a5ql$1@matrix.hispagatos.org> <YJAwM.249652$Y1R7.117864@fx04.ams4>
Reply-To: ReK2 <rek2@hispagatos.org>
Injection-Date: Fri, 28 Jul 2023 03:44:07 -0000 (UTC)
Injection-Info: matrix.hispagatos.org; posting-host="static-135-116-26-46.ipcom.comunitel.net:46.26.116.135";
logging-data="348719"; mail-complaints-to="usenet@matrix.hispagatos.org"
User-Agent: slrn/pre1.0.4-9 (Linux)
 by: rek2 hispagatos - Fri, 28 Jul 2023 03:44 UTC

On 2023-07-27, go-while <no-reply@no.spam> wrote:
> On 27.07.23 21:36, rek2 hispagatos wrote:
>> OK this is already deployed and working, feel free to submit patches,
>> there are a lot to do still but is working now and is live on my own
>> server.
>>
>> Happy Hacking
>> ReK2
>>
>
> great work!
>
> i dont know about rust and pgsql so i need ask question:
>
> this code is safe against sql injection?
>

Indeed, is my first time using this libs and I asked myself the same
question when I was reading thru their documentation, so I have put it
on my TODO list to research and use better prepared queries
this is from their documentation:
```
Prepared queries have their query plan cached, use a binary mode of
communication (lower bandwidth and faster decoding),
and utilize parameters to avoid SQL injection.
```
Is in my TODO list, if I get help even better ;)

> no need to check if username is alphanum before passing to db?

Yes some checks and balances will be nice to add also on my todo list, I
did this tool at the same time I was making a portal for my users to be
able to register for our usenet server(inn2) or
matrix server(dendrite) and later on maybe our mastodon instance.
So made the tool to plug inn and the portal,
but much work still to do, a lot more :)

> fn clean() splits by whitespace and parses to string only?
yes, I am learning rust so I am sure there is more idiomatic ways and
elegant but as of now testing the inn stdout to the program it give us the
6 or 7 diff pieces of information, including the ClientAuthname,
ClientPassword (paste below) so I have it all put into a
slice/array and grab only 2 and sends it to the clean() function
and does exaccly that you mention, so later we can compare it vs
the database entries.

I was testing against the information I got from:
https://www.eyrie.org/~eagle/software/inn/docs-2.7/external-auth.html
But I found it to be mistaken or I did not understood it right, because
it says it only sends 2 pieces of information the Name and Password
information but it actually sends more so I had to do adjustments like:

["ClientHost: domain.net", "ClientIP: x.x.x.x", "ClientPort: 52014",
"LocalIP: x.x.x.x", "LocalPort: 563", "ClientAuthname: rek2",
"ClientPassword: HerePassword", ".", ""]

also was using for testing:
echo -e "Auth rek2\r\nPassword: testest222\r\n | cargo run
and from the ckpasswd man page:
(echo 'ClientAuthname: rek2' ; echo 'ClientPassword: testmeow') | nnrpd-password

Writing this super late 5:40 am been up all night coding, going to bed
if you find lot of bad grammar and stuff is because of that and that I
am not a native English speaker ;)

Happy Hacking
--
{gemini,https}://{,rek2.}hispagatos.org
https://hispagatos.space/@rek2

Re: alternative nnrpd external auth to postgresql

<36IwM.106011$euB5.66059@fx05.ams4>

  copy mid

https://www.rocksolidbbs.com/computers/article-flat.php?id=1999&group=news.software.nntp#1999

  copy link   Newsgroups: news.software.nntp
Path: i2pn2.org!i2pn.org!weretis.net!feeder8.news.weretis.net!feeder1.feed.usenet.farm!feed.usenet.farm!peer03.ams4!peer.am4.highwinds-media.com!news.highwinds-media.com!fx05.ams4.POSTED!not-for-mail
MIME-Version: 1.0
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101
Thunderbird/102.13.0
Subject: Re: alternative nnrpd external auth to postgresql
Content-Language: en-US
Newsgroups: news.software.nntp
References: <u9jlnh$getb$1@matrix.hispagatos.org>
<u9uh09$a5ql$1@matrix.hispagatos.org> <YJAwM.249652$Y1R7.117864@fx04.ams4>
<u9vdi7$akhf$2@matrix.hispagatos.org>
From: no-reply@no.spam (go-while)
In-Reply-To: <u9vdi7$akhf$2@matrix.hispagatos.org>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Lines: 15
Message-ID: <36IwM.106011$euB5.66059@fx05.ams4>
X-Complaints-To: abuse@blocknews.net
NNTP-Posting-Date: Fri, 28 Jul 2023 05:11:27 UTC
Organization: blocknews - www.blocknews.net
Date: Fri, 28 Jul 2023 07:53:49 +0200
X-Received-Bytes: 1485
 by: go-while - Fri, 28 Jul 2023 05:53 UTC

On 28.07.23, rek2 hispagatos wrote:

> I was testing against the information I got from:
> https://www.eyrie.org/~eagle/software/inn/docs-2.7/external-auth.html
> But I found it to be mistaken or I did not understood it right, because
> it says it only sends 2 pieces of information the Name and Password
> information but it actually sends more so I had to do adjustments like:
>

"In addition, nnrpd generally also passes, if available, the fields
mentioned as intended for resolvers; in rare instances this data may be
useful for authenticators."

But everytime i read rust, i dont like their syntax xD

Re: alternative nnrpd external auth to postgresql

<ua0mlt$bb7j$1@matrix.hispagatos.org>

  copy mid

https://www.rocksolidbbs.com/computers/article-flat.php?id=2000&group=news.software.nntp#2000

  copy link   Newsgroups: news.software.nntp
Path: i2pn2.org!i2pn.org!news.hispagatos.org!.POSTED.static-135-116-26-46.ipcom.comunitel.net!not-for-mail
From: rek2@hispagatos.org.invalid (rek2 hispagatos)
Newsgroups: news.software.nntp
Subject: Re: alternative nnrpd external auth to postgresql
Date: Fri, 28 Jul 2023 15:25:49 -0000 (UTC)
Organization: Hispagatos
Message-ID: <ua0mlt$bb7j$1@matrix.hispagatos.org>
References: <u9jlnh$getb$1@matrix.hispagatos.org>
<u9uh09$a5ql$1@matrix.hispagatos.org> <YJAwM.249652$Y1R7.117864@fx04.ams4>
<u9vdi7$akhf$2@matrix.hispagatos.org> <36IwM.106011$euB5.66059@fx05.ams4>
Reply-To: ReK2 <rek2@hispagatos.org>
Injection-Date: Fri, 28 Jul 2023 15:25:49 -0000 (UTC)
Injection-Info: matrix.hispagatos.org; posting-host="static-135-116-26-46.ipcom.comunitel.net:46.26.116.135";
logging-data="371955"; mail-complaints-to="usenet@matrix.hispagatos.org"
User-Agent: slrn/pre1.0.4-9 (Linux)
 by: rek2 hispagatos - Fri, 28 Jul 2023 15:25 UTC

On 2023-07-28, go-while <no-reply@no.spam> wrote:
> On 28.07.23, rek2 hispagatos wrote:
>
>> I was testing against the information I got from:
>> https://www.eyrie.org/~eagle/software/inn/docs-2.7/external-auth.html
>> But I found it to be mistaken or I did not understood it right, because
>> it says it only sends 2 pieces of information the Name and Password
>> information but it actually sends more so I had to do adjustments like:
>>
>
>
> "In addition, nnrpd generally also passes, if available, the fields
> mentioned as intended for resolvers; in rare instances this data may be
> useful for authenticators."
>
> But everytime i read rust, i dont like their syntax xD

Yes indeed, I figure that out the hard way :D :D with debuggin :D I get
lost in translation a lot.

Yeah I used to hate rust syntax as well, specially when they add their weird
traits, but I got used to it and most people do not use many since they
are advised to not use complicated traits because it makes it hard for
other people to understand.
I still pick up GO for most of my work and some times I go back to C if
is for specific proyects, but im curious so been learning
rust for the last 3-4 months now that I did it does have its good
things.

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

Re: alternative nnrpd external auth to postgresql

<KWUwM.143252$MB_8.99644@fx01.ams4>

  copy mid

https://www.rocksolidbbs.com/computers/article-flat.php?id=2001&group=news.software.nntp#2001

  copy link   Newsgroups: news.software.nntp
Path: i2pn2.org!i2pn.org!weretis.net!feeder8.news.weretis.net!feeder1.feed.usenet.farm!feed.usenet.farm!peer02.ams4!peer.am4.highwinds-media.com!news.highwinds-media.com!fx01.ams4.POSTED!not-for-mail
MIME-Version: 1.0
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101
Thunderbird/102.13.0
Subject: Re: alternative nnrpd external auth to postgresql
Content-Language: en-US
Newsgroups: news.software.nntp
References: <u9jlnh$getb$1@matrix.hispagatos.org>
<u9uh09$a5ql$1@matrix.hispagatos.org> <YJAwM.249652$Y1R7.117864@fx04.ams4>
<u9vdi7$akhf$2@matrix.hispagatos.org> <36IwM.106011$euB5.66059@fx05.ams4>
<ua0mlt$bb7j$1@matrix.hispagatos.org>
From: no-reply@no.spam (go-while)
In-Reply-To: <ua0mlt$bb7j$1@matrix.hispagatos.org>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Lines: 33
Message-ID: <KWUwM.143252$MB_8.99644@fx01.ams4>
X-Complaints-To: abuse@blocknews.net
NNTP-Posting-Date: Fri, 28 Jul 2023 19:46:50 UTC
Organization: blocknews - www.blocknews.net
Date: Fri, 28 Jul 2023 22:29:38 +0200
X-Received-Bytes: 1807
 by: go-while - Fri, 28 Jul 2023 20:29 UTC

On 28.07.23, rek2 hispagatos wrote:
>
> Yes indeed, I figure that out the hard way :D :D with debuggin :D
> I get lost in translation a lot.
>
> .....
> Happy Hacking
> reK2

who writes with debugs is king!
and much more king if you dont know what you're doing :D

i wrote a little too with greece coffee!

https://github.com/go-while/go-inn2-auth

same binary as daemon and authenticator/resolver? .oO*
daemon listens on tcp port (maybe socket later)
cli talks via tcp textproto with daemon
multiple workers and parallel requests
daemon can act as cache, less requests to databases (later)
read users from json file, reloads every 60s if hash changed
places for mysql, pgsql, redis are there but need testing first

test on command line looks good for me but did not install to try...
not sure how to configure inn.conf xD

Re: alternative nnrpd external auth to postgresql

<ua32rk$cjct$1@matrix.hispagatos.org>

  copy mid

https://www.rocksolidbbs.com/computers/article-flat.php?id=2009&group=news.software.nntp#2009

  copy link   Newsgroups: news.software.nntp
Path: i2pn2.org!i2pn.org!news.hispagatos.org!.POSTED.static-135-116-26-46.ipcom.comunitel.net!not-for-mail
From: rek2@hispagatos.org.invalid (rek2 hispagatos)
Newsgroups: news.software.nntp
Subject: Re: alternative nnrpd external auth to postgresql
Date: Sat, 29 Jul 2023 13:05:56 -0000 (UTC)
Organization: Hispagatos
Message-ID: <ua32rk$cjct$1@matrix.hispagatos.org>
References: <u9jlnh$getb$1@matrix.hispagatos.org>
<u9uh09$a5ql$1@matrix.hispagatos.org> <YJAwM.249652$Y1R7.117864@fx04.ams4>
<u9vdi7$akhf$2@matrix.hispagatos.org> <36IwM.106011$euB5.66059@fx05.ams4>
<ua0mlt$bb7j$1@matrix.hispagatos.org> <KWUwM.143252$MB_8.99644@fx01.ams4>
Reply-To: ReK2 <rek2@hispagatos.org>
Injection-Date: Sat, 29 Jul 2023 13:05:56 -0000 (UTC)
Injection-Info: matrix.hispagatos.org; posting-host="static-135-116-26-46.ipcom.comunitel.net:46.26.116.135";
logging-data="413085"; mail-complaints-to="usenet@matrix.hispagatos.org"
User-Agent: slrn/pre1.0.4-9 (Linux)
 by: rek2 hispagatos - Sat, 29 Jul 2023 13:05 UTC

On 2023-07-28, go-while <no-reply@no.spam> wrote:
> On 28.07.23, rek2 hispagatos wrote:
> >
> > Yes indeed, I figure that out the hard way :D :D with debuggin :D
> > I get lost in translation a lot.
> >
> > .....
> > Happy Hacking
> > reK2
>
>
> who writes with debugs is king!
> and much more king if you dont know what you're doing :D

LOL :)

> i wrote a little too with greece coffee!
>
> https://github.com/go-while/go-inn2-auth
>
> same binary as daemon and authenticator/resolver? .oO*
> daemon listens on tcp port (maybe socket later)
> cli talks via tcp textproto with daemon
> multiple workers and parallel requests
> daemon can act as cache, less requests to databases (later)
> read users from json file, reloads every 60s if hash changed
> places for mysql, pgsql, redis are there but need testing first
>
> test on command line looks good for me but did not install to try...
> not sure how to configure inn.conf xD

Looking good, I will test it, everything seems so much simpler with Go
;) only reason I started my proyect with Rust is to get familiar with
the language, but go is been my choice for the last 7 years for most
tooling I write for work and myself.

Is good that we updating some old usenet tools to talk to other most
used today daemons like postgresql, redis etc.

I will love to engage to write a small two way gateway between a
usergroup and a lemmy group( a reddit alike decentralized service part
of the fediverse ).

Happy Hacking
ReK2
--
{gemini,https}://{,rek2.}hispagatos.org
https://hispagatos.space/@rek2

Re: alternative nnrpd external auth to postgresql

<CEoxM.253486$yXa4.99057@fx14.ams4>

  copy mid

https://www.rocksolidbbs.com/computers/article-flat.php?id=2017&group=news.software.nntp#2017

  copy link   Newsgroups: news.software.nntp
Path: i2pn2.org!i2pn.org!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!peer02.iad!feed-me.highwinds-media.com!peer01.ams4!peer.am4.highwinds-media.com!news.highwinds-media.com!fx14.ams4.POSTED!not-for-mail
MIME-Version: 1.0
User-Agent: NoZilla/3.11 (Hackint; Unicorn; rv:0.8.15) go-while/19720229
NewsRW/4.2.0
Subject: Re: alternative nnrpd external auth to postgresql
Content-Language: en-US
Newsgroups: news.software.nntp
References: <u9jlnh$getb$1@matrix.hispagatos.org>
<u9uh09$a5ql$1@matrix.hispagatos.org> <YJAwM.249652$Y1R7.117864@fx04.ams4>
<u9vdi7$akhf$2@matrix.hispagatos.org> <36IwM.106011$euB5.66059@fx05.ams4>
<ua0mlt$bb7j$1@matrix.hispagatos.org> <KWUwM.143252$MB_8.99644@fx01.ams4>
<ua32rk$cjct$1@matrix.hispagatos.org>
From: no-reply@no.spam (Billy G. (go-while))
Organization: github.com/go-while
In-Reply-To: <ua32rk$cjct$1@matrix.hispagatos.org>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Lines: 57
Message-ID: <CEoxM.253486$yXa4.99057@fx14.ams4>
X-Complaints-To: abuse@blocknews.net
NNTP-Posting-Date: Sun, 30 Jul 2023 07:52:02 UTC
Date: Sun, 30 Jul 2023 10:35:58 +0200
X-Received-Bytes: 2805
 by: Billy G. (go-while) - Sun, 30 Jul 2023 08:35 UTC

On 29.07.23, rek2 hispagatos wrote:

> Looking good, I will test it

can you provide a readme to your tool?
with your inn config for readers and how to implement the binary?

still had no time to test mine, not even tried to lookup the config :D
i don't know if this code does anything good
at least it dit not crash over night in infinite loop
hammered with millions of requests and mem <20KB?! with 3 users added

> ...
> , everything seems so much simpler with Go
> ;)
>
> I will love to engage to write a small two way gateway between a
> usergroup and a lemmy group( a reddit alike decentralized service part
> of the fediverse ).
>
> Happy Hacking
> ReK2

go textproto + nntp... easy
only be careful when sending strings over the network

for example the tp.Cmd() eats a formated string

lets say you have read a msgid fine
from another peer or server or file

but msgid contains a % (percent sign)
like:
msgid := "<abcd1234..%...@test.com>"

we construct cmdline to send request to another peer
cmdline := "IHAVE "+msgid
this is fine, prints correctly

but if you pass cmdline to 'tp.Cmd(cmdline)'
go adds formats to string: result in total garbage after % data is lost.
as soon as it leaves your networkcard
you can see it going out with weird things added to the 'cmdline' string

use 'tp.Cmd("%s", cmdline)'
you send it fine and receiver reads correctly

i'm writing websrv in go talking to nntp, could be useful for a lemmygw
maybe first release is ready in few weeks

GET:
http(s)://.../groups/(?json)
http(s)://.../group/msgnum/[head|body|head+body](/?json)
http(s)://.../msgid/[head|body|head+body](/?json)

happy sunday!

Re: alternative nnrpd external auth to postgresql

<hwFxM.47952$sU56.7318@fx08.ams4>

  copy mid

https://www.rocksolidbbs.com/computers/article-flat.php?id=2025&group=news.software.nntp#2025

  copy link   Newsgroups: news.software.nntp
Path: i2pn2.org!i2pn.org!weretis.net!feeder8.news.weretis.net!feeder1.feed.usenet.farm!feed.usenet.farm!peer02.ams4!peer.am4.highwinds-media.com!news.highwinds-media.com!fx08.ams4.POSTED!not-for-mail
MIME-Version: 1.0
User-Agent: NoZilla/3.11 (Hackint; Unicorn; rv:0.8.15) go-while/19720229
NewsRW/4.2.0
Subject: Re: alternative nnrpd external auth to postgresql
Content-Language: en-US
Newsgroups: news.software.nntp
References: <u9jlnh$getb$1@matrix.hispagatos.org>
<u9uh09$a5ql$1@matrix.hispagatos.org> <YJAwM.249652$Y1R7.117864@fx04.ams4>
<u9vdi7$akhf$2@matrix.hispagatos.org> <36IwM.106011$euB5.66059@fx05.ams4>
<ua0mlt$bb7j$1@matrix.hispagatos.org> <KWUwM.143252$MB_8.99644@fx01.ams4>
<ua32rk$cjct$1@matrix.hispagatos.org> <CEoxM.253486$yXa4.99057@fx14.ams4>
From: no-reply@no.spam (Billy G. (go-while))
Organization: github.com/go-while
In-Reply-To: <CEoxM.253486$yXa4.99057@fx14.ams4>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Lines: 7
Message-ID: <hwFxM.47952$sU56.7318@fx08.ams4>
X-Complaints-To: abuse@blocknews.net
NNTP-Posting-Date: Mon, 31 Jul 2023 03:03:41 UTC
Date: Mon, 31 Jul 2023 05:48:11 +0200
X-Received-Bytes: 1195
 by: Billy G. (go-while) - Mon, 31 Jul 2023 03:48 UTC

ok i'm near to have a working test bench

you are using "res" in your config?

would explain why you got all lines

will provide instruction soon

Re: alternative nnrpd external auth to postgresql

<ua9qtu$2cg8$1@matrix.hispagatos.org>

  copy mid

https://www.rocksolidbbs.com/computers/article-flat.php?id=2030&group=news.software.nntp#2030

  copy link   Newsgroups: news.software.nntp
Path: i2pn2.org!i2pn.org!weretis.net!feeder8.news.weretis.net!eternal-september.org!news.eternal-september.org!news.hispagatos.org!.POSTED.static-135-116-26-46.ipcom.comunitel.net!not-for-mail
From: rek2@hispagatos.org.invalid (rek2 hispagatos)
Newsgroups: news.software.nntp
Subject: Re: alternative nnrpd external auth to postgresql
Date: Tue, 1 Aug 2023 02:33:34 -0000 (UTC)
Organization: Hispagatos
Message-ID: <ua9qtu$2cg8$1@matrix.hispagatos.org>
References: <u9jlnh$getb$1@matrix.hispagatos.org>
<u9uh09$a5ql$1@matrix.hispagatos.org> <YJAwM.249652$Y1R7.117864@fx04.ams4>
<u9vdi7$akhf$2@matrix.hispagatos.org> <36IwM.106011$euB5.66059@fx05.ams4>
<ua0mlt$bb7j$1@matrix.hispagatos.org> <KWUwM.143252$MB_8.99644@fx01.ams4>
<ua32rk$cjct$1@matrix.hispagatos.org> <CEoxM.253486$yXa4.99057@fx14.ams4>
Reply-To: ReK2 <rek2@hispagatos.org>
Injection-Date: Tue, 1 Aug 2023 02:33:34 -0000 (UTC)
Injection-Info: matrix.hispagatos.org; posting-host="static-135-116-26-46.ipcom.comunitel.net:46.26.116.135";
logging-data="78344"; mail-complaints-to="usenet@hispagatos.org"
User-Agent: slrn/pre1.0.4-9 (Linux)
 by: rek2 hispagatos - Tue, 1 Aug 2023 02:33 UTC

On 2023-07-30, Billy G. (go-while) <no-reply@no.spam> wrote:
> On 29.07.23, rek2 hispagatos wrote:
>
> > Looking good, I will test it
>
> can you provide a readme to your tool?
> with your inn config for readers and how to implement the binary?
>
> still had no time to test mine, not even tried to lookup the config :D
> i don't know if this code does anything good
> at least it dit not crash over night in infinite loop
> hammered with millions of requests and mem <20KB?! with 3 users added
>

I will, is not really finish yet, but I will write a readme as soon I
get a bit of time after work.
I have not tried yours neither yet, just now I had time to pop open slrn
at 4:32 am before bed to check on msg's.

--
{gemini,https}://{,rek2.}hispagatos.org
https://hispagatos.space/@rek2

Re: alternative nnrpd external auth to postgresql

<ua9r0s$2cg8$2@matrix.hispagatos.org>

  copy mid

https://www.rocksolidbbs.com/computers/article-flat.php?id=2031&group=news.software.nntp#2031

  copy link   Newsgroups: news.software.nntp
Path: i2pn2.org!i2pn.org!eternal-september.org!news.eternal-september.org!news.hispagatos.org!.POSTED.static-135-116-26-46.ipcom.comunitel.net!not-for-mail
From: rek2@hispagatos.org.invalid (rek2 hispagatos)
Newsgroups: news.software.nntp
Subject: Re: alternative nnrpd external auth to postgresql
Date: Tue, 1 Aug 2023 02:35:08 -0000 (UTC)
Organization: Hispagatos
Message-ID: <ua9r0s$2cg8$2@matrix.hispagatos.org>
References: <u9jlnh$getb$1@matrix.hispagatos.org>
<u9uh09$a5ql$1@matrix.hispagatos.org> <YJAwM.249652$Y1R7.117864@fx04.ams4>
<u9vdi7$akhf$2@matrix.hispagatos.org> <36IwM.106011$euB5.66059@fx05.ams4>
<ua0mlt$bb7j$1@matrix.hispagatos.org> <KWUwM.143252$MB_8.99644@fx01.ams4>
<ua32rk$cjct$1@matrix.hispagatos.org> <CEoxM.253486$yXa4.99057@fx14.ams4>
<hwFxM.47952$sU56.7318@fx08.ams4>
Reply-To: ReK2 <rek2@hispagatos.org>
Injection-Date: Tue, 1 Aug 2023 02:35:08 -0000 (UTC)
Injection-Info: matrix.hispagatos.org; posting-host="static-135-116-26-46.ipcom.comunitel.net:46.26.116.135";
logging-data="78344"; mail-complaints-to="usenet@hispagatos.org"
User-Agent: slrn/pre1.0.4-9 (Linux)
 by: rek2 hispagatos - Tue, 1 Aug 2023 02:35 UTC

On 2023-07-31, Billy G. (go-while) <no-reply@no.spam> wrote:
> ok i'm near to have a working test bench

nice!

> you are using "res" in your config?

I do not think so, also remember my tool is part of 3-4 other pieces a
portal front end for usenet, matrix etc.

> would explain why you got all lines

Very possible,

> will provide instruction soon

cool thanks!

--
{gemini,https}://{,rek2.}hispagatos.org
https://hispagatos.space/@rek2

Re: alternative nnrpd external auth to postgresql

<wXqyM.407381$8uM.337941@fx11.ams4>

  copy mid

https://www.rocksolidbbs.com/computers/article-flat.php?id=2034&group=news.software.nntp#2034

  copy link   Newsgroups: news.software.nntp
Path: i2pn2.org!i2pn.org!news.neodome.net!feeder1.feed.usenet.farm!feed.usenet.farm!peer03.ams4!peer.am4.highwinds-media.com!news.highwinds-media.com!fx11.ams4.POSTED!not-for-mail
MIME-Version: 1.0
User-Agent: NoZilla/3.11 (Hackint; Unicorn; rv:0.8.15) go-while/19720229
NewsRW/4.2.0
Subject: Re: alternative nnrpd external auth to postgresql
Content-Language: en-US
Newsgroups: news.software.nntp
References: <u9jlnh$getb$1@matrix.hispagatos.org>
<u9uh09$a5ql$1@matrix.hispagatos.org> <YJAwM.249652$Y1R7.117864@fx04.ams4>
<u9vdi7$akhf$2@matrix.hispagatos.org> <36IwM.106011$euB5.66059@fx05.ams4>
<ua0mlt$bb7j$1@matrix.hispagatos.org> <KWUwM.143252$MB_8.99644@fx01.ams4>
<ua32rk$cjct$1@matrix.hispagatos.org> <CEoxM.253486$yXa4.99057@fx14.ams4>
<hwFxM.47952$sU56.7318@fx08.ams4> <ua9r0s$2cg8$2@matrix.hispagatos.org>
From: no-reply@no.spam (Billy G. (go-while))
Organization: github.com/go-while
In-Reply-To: <ua9r0s$2cg8$2@matrix.hispagatos.org>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Lines: 45
Message-ID: <wXqyM.407381$8uM.337941@fx11.ams4>
X-Complaints-To: abuse@blocknews.net
NNTP-Posting-Date: Wed, 02 Aug 2023 11:17:48 UTC
Date: Wed, 2 Aug 2023 14:03:57 +0200
X-Received-Bytes: 2291
 by: Billy G. (go-while) - Wed, 2 Aug 2023 12:03 UTC

On 01.08.23, rek2 hispagatos wrote:
> On 2023-07-31, Billy G. (go-while) <no-reply@no.spam> wrote:
>> ok i'm near to have a working test bench
>
>
> nice!
>
>> you are using "res" in your config?
>
>> would explain why you got all lines

this was just an idea i had before testing. was wrong.

would be nice to know under which circumstances inn2 sends user+pass
only or more lines, as reference documentation states, or does it always
pass all 7 lines to stdin actually?
but with my "auth" part taken 1:1 from example docs (without explicit
use of "res" which should be resolver i guess?) i got all 7 lines
delivered to my tool, not ClientAuthname+ClientPassword.

auth "foreignokay" {
auth: "go-inn2-auth -config /etc/news/config.json"
default: "<unauthenticated>"
}

access "authenticatedpeople" {
users: "*"
newsgroups: "*,!junk,!control,!control.*"
}

access "restrictive" {
users: "<unauthenticated>"
newsgroups: "!*"
} access "readonly" {
users: "<unauthenticated>"
read: "local.*"
post: "!*"
}

https://www.eyrie.org/~eagle/software/inn/docs/external-auth.html

Re: alternative nnrpd external auth to postgresql

<uaegsu$jaa7$1@news.trigofacile.com>

  copy mid

https://www.rocksolidbbs.com/computers/article-flat.php?id=2035&group=news.software.nntp#2035

  copy link   Newsgroups: news.software.nntp
Path: i2pn2.org!i2pn.org!weretis.net!feeder8.news.weretis.net!news.trigofacile.com!.POSTED.176-143-2-105.abo.bbox.fr!not-for-mail
From: iulius@nom-de-mon-site.com.invalid (Julien ÉLIE)
Newsgroups: news.software.nntp
Subject: Re: alternative nnrpd external auth to postgresql
Date: Wed, 2 Aug 2023 23:13:01 +0200
Organization: Groupes francophones par TrigoFACILE
Message-ID: <uaegsu$jaa7$1@news.trigofacile.com>
References: <u9jlnh$getb$1@matrix.hispagatos.org>
<u9uh09$a5ql$1@matrix.hispagatos.org> <YJAwM.249652$Y1R7.117864@fx04.ams4>
<u9vdi7$akhf$2@matrix.hispagatos.org> <36IwM.106011$euB5.66059@fx05.ams4>
<ua0mlt$bb7j$1@matrix.hispagatos.org> <KWUwM.143252$MB_8.99644@fx01.ams4>
<ua32rk$cjct$1@matrix.hispagatos.org> <CEoxM.253486$yXa4.99057@fx14.ams4>
<hwFxM.47952$sU56.7318@fx08.ams4> <ua9r0s$2cg8$2@matrix.hispagatos.org>
<wXqyM.407381$8uM.337941@fx11.ams4>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
Injection-Date: Wed, 2 Aug 2023 21:13:02 -0000 (UTC)
Injection-Info: news.trigofacile.com; posting-account="julien"; posting-host="176-143-2-105.abo.bbox.fr:176.143.2.105";
logging-data="633159"; mail-complaints-to="abuse@trigofacile.com"
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:102.0)
Gecko/20100101 Thunderbird/102.13.0
Cancel-Lock: sha1:2x6A+cpXyfBU0JG4QMyYzHrTRq0= sha256:zfG8Z4O6AogM2Wabj5Hi463lP/A1TaqoV/uKQ+3cb6g=
sha1:N+u3k3Wsf1q4HH7XkYCsvbOtiFM= sha256:eP7RChI3P1fxnx0qG8VSmopciOHpLdIWXl1sV1bW4M8=
In-Reply-To: <wXqyM.407381$8uM.337941@fx11.ams4>
 by: Julien ÉLIE - Wed, 2 Aug 2023 21:13 UTC

Hi Billy,

> would be nice to know under which circumstances inn2 sends user+pass
> only or more lines, as reference documentation states, or does it always
> pass all 7 lines to stdin actually?

Actually, nnrpd always provides the 7 lines (when of course the related
information is available).
The documentation needs fixing. Thanks for having pointed that out!

--
Julien ÉLIE

« Lupus est matrem suum. »

Re: alternative nnrpd external auth to postgresql

<uaf2ug$o34$2@matrix.hispagatos.org>

  copy mid

https://www.rocksolidbbs.com/computers/article-flat.php?id=2036&group=news.software.nntp#2036

  copy link   Newsgroups: news.software.nntp
Path: i2pn2.org!i2pn.org!news.hispagatos.org!.POSTED.static-135-116-26-46.ipcom.comunitel.net!not-for-mail
From: rek2@hispagatos.org.invalid (rek2 hispagatos)
Newsgroups: news.software.nntp
Subject: Re: alternative nnrpd external auth to postgresql
Date: Thu, 3 Aug 2023 02:21:04 -0000 (UTC)
Organization: Hispagatos
Message-ID: <uaf2ug$o34$2@matrix.hispagatos.org>
References: <u9jlnh$getb$1@matrix.hispagatos.org>
<u9uh09$a5ql$1@matrix.hispagatos.org> <YJAwM.249652$Y1R7.117864@fx04.ams4>
<u9vdi7$akhf$2@matrix.hispagatos.org> <36IwM.106011$euB5.66059@fx05.ams4>
<ua0mlt$bb7j$1@matrix.hispagatos.org> <KWUwM.143252$MB_8.99644@fx01.ams4>
<ua32rk$cjct$1@matrix.hispagatos.org> <CEoxM.253486$yXa4.99057@fx14.ams4>
<hwFxM.47952$sU56.7318@fx08.ams4> <ua9r0s$2cg8$2@matrix.hispagatos.org>
<wXqyM.407381$8uM.337941@fx11.ams4> <uaegsu$jaa7$1@news.trigofacile.com>
Reply-To: ReK2 <rek2@hispagatos.org>
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: 8bit
Injection-Date: Thu, 3 Aug 2023 02:21:04 -0000 (UTC)
Injection-Info: matrix.hispagatos.org; posting-host="static-135-116-26-46.ipcom.comunitel.net:46.26.116.135";
logging-data="24676"; mail-complaints-to="abuse@hispagatos.org"
User-Agent: slrn/pre1.0.4-9 (Linux)
 by: rek2 hispagatos - Thu, 3 Aug 2023 02:21 UTC

On 2023-08-02, Julien ÉLIE <iulius@nom-de-mon-site.com.invalid> wrote:
> Hi Billy,
>
>> would be nice to know under which circumstances inn2 sends user+pass
>> only or more lines, as reference documentation states, or does it always
>> pass all 7 lines to stdin actually?
>
> Actually, nnrpd always provides the 7 lines (when of course the related
> information is available).
> The documentation needs fixing. Thanks for having pointed that out!
>

I was going to reply this, when I was debugging because my tool was not
working I notice that will always send all the 7 lines no matter what,
so I changed my authentificator to grab all 7 into an slice/array and
use what I need, in case later on I need the other info.

PD: Julien, check the start of the thread, the documentation about
authentificator does need an update please, I was going nuts until I
hadd debug/logging features to my program because it was not following
what was there (in the doc) :)

Cheers
Happy Hacking.

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

Re: alternative nnrpd external auth to postgresql

<uaji8g$mnft$1@news.trigofacile.com>

  copy mid

https://www.rocksolidbbs.com/computers/article-flat.php?id=2042&group=news.software.nntp#2042

  copy link   Newsgroups: news.software.nntp
Path: i2pn2.org!i2pn.org!weretis.net!feeder8.news.weretis.net!news.trigofacile.com!.POSTED.176.143-2-105.abo.bbox.fr!not-for-mail
From: iulius@nom-de-mon-site.com.invalid (Julien ÉLIE)
Newsgroups: news.software.nntp
Subject: Re: alternative nnrpd external auth to postgresql
Date: Fri, 4 Aug 2023 21:06:56 +0200
Organization: Groupes francophones par TrigoFACILE
Message-ID: <uaji8g$mnft$1@news.trigofacile.com>
References: <u9jlnh$getb$1@matrix.hispagatos.org>
<u9uh09$a5ql$1@matrix.hispagatos.org> <YJAwM.249652$Y1R7.117864@fx04.ams4>
<u9vdi7$akhf$2@matrix.hispagatos.org> <36IwM.106011$euB5.66059@fx05.ams4>
<ua0mlt$bb7j$1@matrix.hispagatos.org> <KWUwM.143252$MB_8.99644@fx01.ams4>
<ua32rk$cjct$1@matrix.hispagatos.org> <CEoxM.253486$yXa4.99057@fx14.ams4>
<hwFxM.47952$sU56.7318@fx08.ams4> <ua9r0s$2cg8$2@matrix.hispagatos.org>
<wXqyM.407381$8uM.337941@fx11.ams4> <uaegsu$jaa7$1@news.trigofacile.com>
<uaf2ug$o34$2@matrix.hispagatos.org>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
Injection-Date: Fri, 4 Aug 2023 19:06:56 -0000 (UTC)
Injection-Info: news.trigofacile.com; posting-account="julien"; posting-host="176.143-2-105.abo.bbox.fr:176.143.2.105";
logging-data="744957"; mail-complaints-to="abuse@trigofacile.com"
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:102.0)
Gecko/20100101 Thunderbird/102.14.0
Cancel-Lock: sha1:nXFE2HIpqYDQ/b46IaBhyRgZ850= sha256:jurDOxk3hyKiFn5Sf2gZPgBDioZDS2kkXS3b/u51UiE=
sha1:VlLSiydAr8Nyntjc/74VCBpjXb8= sha256:mZEC2oimakWiJaKojVg8eiK/+hrlUqQZcn3aB30oG7c=
In-Reply-To: <uaf2ug$o34$2@matrix.hispagatos.org>
 by: Julien ÉLIE - Fri, 4 Aug 2023 19:06 UTC

Hi rek2,

>>> would be nice to know under which circumstances inn2 sends user+pass
>>> only or more lines, as reference documentation states, or does it always
>>> pass all 7 lines to stdin actually?
>>
>> Actually, nnrpd always provides the 7 lines (when of course the related
>> information is available).
>> The documentation needs fixing. Thanks for having pointed that out!
>
> PD: Julien, check the start of the thread, the documentation about
> authentificator does need an update please, I was going nuts until I
> hadd debug/logging features to my program because it was not following
> what was there (in the doc) :)

Seems like the only change to do is to remove the "also" adverb?
The rest of the documentation looks OK to me.

where I<user> and I<pass> are the username and password provided by the
-client (e.g. using AUTHINFO). In addition, B<nnrpd> generally also passes,
+client (e.g. using AUTHINFO). In addition, B<nnrpd> also passes,
if available, the fields mentioned as intended for resolvers; in rare
instances, this data may be useful for authenticators.

--
Julien ÉLIE

« I think it's a new feature. Don't tell anyone it was an accident. »
(Larry Wall)

1
server_pubkey.txt

rocksolid light 0.9.8
clearnet tor