🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: rocksolid.nodes
84 messages
84 total messages Page 1 of 2 Started by anon Mon, 11 May 2020 22:03
Page 1 of 2 • 84 total messages
hey, what do know ? vichan supports nntp
#235
Author: anon
Date: Mon, 11 May 2020 22:03
13 lines
1147 bytes
see here:
https://github.com/vichan-devel/vichan/blob/master/inc/config.php
almost at the bottom of the page. I knew that overchan/nntpchan was build on vichan, but I never knew that this was also part of vichan itelf.
wouldn't it be nice if we could use vichan on rocksolid ?
ok, it is still php, and it is not developed anymore, but on the other hand it is a very mature code base, and the layout and feature list sits well with many users (and the code is less old than fudforum).
I smell a little coding project....

cheers

trw

Posted on def4
Re: hey, what do know ? vichan supports nntp
#232
Author: Retro Guy
Date: Tue, 12 May 2020 23:00
19 lines
1751 bytes
anon wrote:

> 
> the more I think about it, the more I like the idea. i mean, it is a lot
> easier and faster to just code the interface to nntp (and I believe I
> could base that on the work you have already done for rslight, or even
> just use the rslight code), and to remote control the post mechanism than
> to do something from scratch (like here with def4). it should be really
> easy...

A chan style interface to rocksolid would be great. def4 is very good, but 
as you say it's probably not the way to go forward, modifying an existing 
project like vichan shouldn't be too hard.

Yes, there is probably most of the the (php) nntp code necessary already in 
rslight. We just extract what's needed, mod as necessary, etc. The rslight 
nntp server also supports multiple methods of posting to it.

Retro Guy
Re: hey, what do know ? vichan supports nntp
#236
Author: Retro Guy
Date: Tue, 12 May 2020 23:44
13 lines
1474 bytes
anon wrote:

> 
> that sounds really great. and has even more potential, btw, because i also
> discovered that vichan has a json api, so you could easily update several
> instances of it with each other without using nntp at all (or only on one
> instance, to make the connection to rocksolid). This would practically add
> one more protocol for rocksolid syncs (http).
> 
> I think I am going to start to work on this, right after my rslight is
> functional.
 
Nice! bbs, ff, rslight and vichan as choices of interfaces would be great.
Re: hey, what do know ? vichan supports nntp
#239
Author: anon
Date: Tue, 12 May 2020 23:53
5 lines
1086 bytes
the more I think about it, the more I like the idea. i mean, it is a lot easier and faster to just code the interface to nntp (and I believe I could base that on the work you have already done for rslight, or even just use the rslight code), and to remote control the post mechanism than to do something from scratch (like here with def4). 
it should be really easy...

Posted on def4
Re: hey, what do know ? vichan supports nntp
#241
Author: anon
Date: Tue, 12 May 2020 23:55
4 lines
880 bytes
in total contrast to what i said in another thread, btw, where i stated that it would be easier to do a css and make everything look exactly like you wanted it to.

Posted on def4
Re: hey, what do know ? vichan supports nntp
#243
Author: anon
Date: Wed, 13 May 2020 00:31
10 lines
1191 bytes
that sounds really great. and has even more potential, btw, because i also discovered that vichan has a json api, so you could easily update several instances of it with each other without using nntp at all (or only on one instance, to make the connection to rocksolid). This would practically add one more protocol for rocksolid syncs (http).

I think I am going to start to work on this, right after my rslight is functional.

cheers

trw 

Posted on def4
Re: hey, what do know ? vichan supports nntp
#244
Author: anon
Date: Wed, 13 May 2020 22:10
4 lines
881 bytes
seems like this thing needs php7.0....my current version is 7.4..., and this seems to be a problem. of course i can just downgrade the package....

Posted on def4
Re: hey, what do know ? vichan supports nntp
#240
Author: anon
Date: Wed, 13 May 2020 23:19
13 lines
1353 bytes
seems to be a real issue for the project, see here:
https://github.com/vichan-devel/vichan/issues/363

question is , is there any real issue to just stay on a specific php version forever ? i guess as long as critical bugs are still fixed in the older ones, one could do it that way...i would have to research a bit...for sure all the existing instances are either on older php versions or have done some individual fixing (like we did on ff, just the kind of thing i hoped to avoid...).
maybe better to invest dev time in something that is a little better maintained. 
i had a good impression on maniwani. hmm....

cheers

trw

Posted on def4
Re: hey, what do know ? vichan supports nntp
#242
Author: Retro Guy
Date: Thu, 14 May 2020 03:53
40 lines
2798 bytes
anon wrote:

> 
> seems to be a real issue for the project, see here:
> https://github.com/vichan-devel/vichan/issues/363
> 
> question is , is there any real issue to just stay on a specific php
> version forever ? i guess as long as critical bugs are still fixed in the
> older ones, one could do it that way...i would have to research a
> bit...for sure all the existing instances are either on older php versions
> or have done some individual fixing (like we did on ff, just the kind of
> thing i hoped to avoid...). maybe better to invest dev time in something
> that is a little better maintained. i had a good impression on maniwani.
> hmm....

Wow, and here I thought you were running older versions of Debian. The 
newest I've tested rslight on is php 7.2.29. I'll need to try 7.4 when I get 
a chance.

When I started rslight, which is really a fork of newsportal, I had to deal 
with the fact that newsportal discontinued development while still trying to 
clean up and support php 5.0. It simply would not work on anything newer 
than 5.0, so that was probably my biggest challenge. In all the searching I 
did for a decent web based newsreader, almost all of them were out of date 
and needed major work to even just load a page. I just picked the one I 
liked best and dove in. It took quite a while to get it to even show 
articles.

rslight is probably unrecognizable now as newsportal, but it's taken many 
hours of first, making it work at all, then only after that making changes 
to it. I've made so many changes by now that it feels like my own software 
and I don't worry about breaking the original code, as I usually just end up 
changing it.

Point is, a nice chan interface might be worth the effort, and it sure is a 
great way to get more familiar with php.

Now, I still need to try rslight on 7.4 :)

Retro Guy
Re: hey, what do know ? vichan supports nntp
#248
Author: anon
Date: Thu, 14 May 2020 09:02
5 lines
922 bytes
ok, it had nothing to do with the php version (although they do complain a lot about this in the thread that i linked).
i have a test installation running now, and it is handling nicely.

Posted on def4
Re: hey, what do know ? vichan supports nntp
#245
Author: anon
Date: Thu, 14 May 2020 15:15
13 lines
1310 bytes
so vichan has a very simple to use api, see here for example:
https://lainchan.org/%CE%A9/catalog.json
so i guess all one needs to do is to write an interface from that json to ./post.php on rslight, generating and translating some information like threading and message id and so forth.
this would be to get messages from a vichan instance to a rslight instance.
for the other way round, i will first start with the buildin nntp option of vichan, and if it does not work, and replace it by the rslight nntp client code.
altogether this seems to be a simple excercise....

cheers

trw

Posted on def4
Re: hey, what do know ? vichan supports nntp
#249
Author: anon
Date: Thu, 14 May 2020 16:27
6 lines
852 bytes
https://github.com/vichan-devel/vichan/blob/master/inc/nntpchan/nntpchan.php

That one should take care of posting to an nntp server.

Posted on def4
Re: hey, what do know ? vichan supports nntp
#246
Author: anonymous
Date: Thu, 14 May 2020 20:47
28 lines
1854 bytes
and here is where the hacking starts:

function nntp_publish($msg, $id) {
        global $config;
        $server = $config["nntpchan"]["server"];
        $s = fsockopen("tcp://$server");
        fgets($s);
        fputs($s, "MODE STREAMrn");
        fgets($s);
        fputs($s, "TAKETHIS $idrn");
        fputs($s, $msg);
        fputs($s, "rn.rn");
        fgets($s);
        fputs($s, "QUITrn");
        fclose($s);
}


they have no auth in this, and i seem to remember that this was solved by some ssl certificates or other (in the case of overchan). so if i just replace this function with the appropriate counterpart from rslight/post.php, that should be it.

I have an instance of vichan running on the same machine as rslight now, and it should be possible to just use the rslight news server directly.

cheers

trw
-- 
Posted on def2
z5bqfv5v75kxy7pj.onion
Re: hey, what do know ? vichan supports nntp
#252
Author: Retro Guy
Date: Fri, 15 May 2020 06:55
6 lines
1073 bytes
anon wrote:

> work, and replace it by the rslight nntp client code. altogether this
> seems to be a simple excercise....

...said every programmer in history :)
Re: hey, what do know ? vichan supports nntp
#247
Author: Retro Guy
Date: Fri, 15 May 2020 07:04
50 lines
2629 bytes
anonymous wrote:

> and here is where the hacking starts:
> 
> function nntp_publish($msg, $id) {
>         global $config;
>         $server = $config["nntpchan"]["server"];
>         $s = fsockopen("tcp://$server");
>         fgets($s);
>         fputs($s, "MODE STREAMrn");
>         fgets($s);
>         fputs($s, "TAKETHIS $idrn");
>         fputs($s, $msg);
>         fputs($s, "rn.rn");
>         fgets($s);
>         fputs($s, "QUITrn");
>         fclose($s);
> }
> 
> 
> they have no auth in this, and i seem to remember that this was solved by
> some ssl certificates or other (in the case of overchan). so if i just
> replace this function with the appropriate counterpart from
> rslight/post.php, that should be it.

Yeah, no auth at all. It's a simple function it seems, so adding auth 
shouldn't be difficult at all:

      fputs($s,"AUTHINFO USER $server_auth_user\r\n");
      $weg=line_read($s);
      fputs($s,"AUTHINFO PASS $server_auth_pass\r\n");
      $weg=line_read($s);
      if (substr($weg,0,3) != "281" {
        AUTH FAILED
        can't do stuff...
      } else {
        IT DIDN"T FAIL, YAY!
        do stuff...
      }

> I have an instance of vichan running on the same machine as rslight now,
> and it should be possible to just use the rslight news server directly.

Do you know if this is sending one message at a time? If so, STREAM isn't 
really necessary and could easily be MODE READER. If it's more than one 
message, then I can add STREAM to nntp.php
rslight news server doesn't currently support MODE STREAM (I didn't need 
it), but it can be added.

Retro Guy
Re: hey, what do know ? vichan supports nntp
#250
Author: Retro Guy
Date: Fri, 15 May 2020 09:15
17 lines
1478 bytes
anon wrote:

> 
>>Do you know if this is sending one message at a time?
> 
> from the way the code is written, i would say yes (post.php is called when
> you make a post), can't be sure though. i will try around a little. if
> need be, i can also connect to one of the inn servers (i mean if i need
> stream right now).

Sounds good. I'll add mode stream soon anyway so it's able to connect if it 
really requires stream.

I need to get a copy of vichan (post.php really) and take a look at it. I 
can do that in a few days.

Retro Guy
Re: hey, what do know ? vichan supports nntp
#251
Author: anonymous
Date: Fri, 15 May 2020 09:57
12 lines
1616 bytes
I can upload it somewhere, if you want me to. but you can also get everything from github (be sure to take the devel version, though).
If I understand post.php right, the inserting of messages (from another node into the vichan instance) is solved by using http. You just hand over all the parameters in a get request and post.php imports the message. That would be very nice (don't understand how attachments wor with that, yet).
So in this case you could post with wget or curl. Very nice.

Hope I can spend some time on this soon.

cheers

trw
-- 
Posted on def2
z5bqfv5v75kxy7pj.onion
Re: hey, what do know ? vichan supports nntp
#259
Author: anon
Date: Fri, 15 May 2020 10:14
11 lines
1048 bytes
>Do you know if this is sending one message at a time?

from the way the code is written, i would say yes (post.php is called when you make a post), can't be sure though.
i will try around a little. if need be, i can also connect to one of the inn servers (i mean if i need stream right now).

cheers

trw 

Posted on def4
Re: hey, what do know ? vichan supports nntp
#253
Author: Retro Guy
Date: Fri, 15 May 2020 10:19
21 lines
2025 bytes
anonymous wrote:

> I can upload it somewhere, if you want me to. but you can also get
> everything from github (be sure to take the devel version, though). If I
> understand post.php right, the inserting of messages (from another node
> into the vichan instance) is solved by using http. You just hand over all
> the parameters in a get request and post.php imports the message. That
> would be very nice (don't understand how attachments wor with that, yet).
> So in this case you could post with wget or curl. Very nice.

I'll download it soon (the devel version) and take a look.

Sounds like a simple matter of maybe just one function to send via http, or 
a simple script on the vichan end to pull articles via nntp, then just 
forward them via http to vichan.  spoolnews.php could be easily modified to 
do that.

This would require no changes on the remote end, it doesn't even need to 
care if it's vichan getting messages, or some other nntp server.

Retro Guy
Re: hey, what do know ? vichan supports nntp
#254
Author: anonymous
Date: Fri, 15 May 2020 20:07
13 lines
1676 bytes
the big question for me is: push or pull ? I think pull makes more sense for this kind of deployment, it will have a higher latency, but be more reliable and not require any changes on any existing node (or newsserver).
so the installation instructions would be something like:
-get vichan to run
-get the rslight nntp server and spoolnews, and install them on the same machine 
-set up a cronjob to update
-patch post.php (or replace it with some patched version)

that sound really nice.

trw
-- 
Posted on def2
z5bqfv5v75kxy7pj.onion
Re: hey, what do know ? vichan supports nntp
#255
Author: Retro Guy
Date: Fri, 15 May 2020 22:40
11 lines
1326 bytes
anon wrote:

> 
> if i enter MODE READER on the rslight nntp server, it says:
> 200 Rocksolid Light NNRP Server ready (no posting)
> seems like posting in this mode does not work ?

It doesn't actually change anything, it just sends the '200' reply.

You can post once authenticated. Try the same commands with an inn server 
and you should see almost exactly the same response.
Re: hey, what do you know: vichan supports nntp
#256
Author: Retro Guy
Date: Fri, 15 May 2020 22:48
69 lines
3581 bytes
anon wrote:

> 
> fputs($s,"AUTHINFO USER $server_auth_user
> ");
>       $weg=line_read($s);
>       fputs($s,"AUTHINFO PASS $server_auth_pass
> ");
>       $weg=line_read($s);
>       if (substr($weg,0,3) != "281" {
>         AUTH FAILED
>         can't do stuff...
>       } else {
>         IT DIDN"T FAIL, YAY!
>         do stuff...
>       }
> 
> And I guess the "do stuff" would be some variant of message_post and
> message_post_with_attachment from /lib/post.inc.php. not sure it is better
> to just put that code into the vichan function, or to call some function
> in the rslight framework. i guess the latter, this way we can do minimal
> changes on the vichan code. actually, the way this is done in vi might be
> superior, because the whole message is already composed and then sent in
> one go (instead of composing and sending the individual pieces). now it
> gets a bit tricky, i have to read up a bit on nntp before i can continue.

Yes, rslight builds the message. I wouldn't use message_post with vichan, 
it's not necessary. If the message is already built, it's easy to post 
straight to the nntp server. See the 'post_articles' function in send.php. 
It just sends messages sitting in a folder but as long as it has a message 
it's a simple matter to send it:

if(!is_file($outgoing_dir.$message)) {
      continue;
    }
    echo "Sending: ".$outgoing_dir.$message."\r\n";
    fputs($ns, "MODE READER\r\n");
    $response = line_read($ns);
    if (strcmp(substr($response,0,3),"200") != 0) {
        file_put_contents($logfile, "\n".format_log_date()." ".
$config_name." Unexpected response to MODE command: ".$respon
se, FILE_APPEND);
      return $response;
    }
    fputs($ns, "POST\r\n");
    $response = line_read($ns);
    if (strcmp(substr($response,0,3),"340") != 0) {
      file_put_contents($logfile, "\n".format_log_date()." ".$config_name." 
Unexpected response to POST command: ".$response
, FILE_APPEND);
      return $response;
    }
    $message_fp = fopen($outgoing_dir.$message, "rb");
    while (($msgline = fgets($message_fp, 4096)) !== false) {
      fputs($ns, $msgline);
    }
    fputs($ns, ".\r\n");
    fclose($message_fp);
    $response = line_read($ns);
    if (strcmp(substr($response,0,3),"240") == 0) {
      unlink($outgoing_dir.$message);
      file_put_contents($logfile, "\n".format_log_date()." ".$config_name." 
Posted: ".$message.": ".$response, FILE_APPEND);
    } else {
      file_put_contents($logfile, "\n".format_log_date()." ".$config_name." 
Failed to POST: ".$message.": ".$response, FILE_
APPEND);
      continue;
    }
Re: hey, what do know ? vichan supports nntp
#262
Author: anon
Date: Fri, 15 May 2020 22:52
6 lines
939 bytes
if i enter MODE READER on the rslight nntp server, it says:
200 Rocksolid Light NNRP Server ready (no posting)
seems like posting in this mode does not work ?

Posted on def4
Re: hey, what do you know: vichan supports nntp
#257
Author: Retro Guy
Date: Fri, 15 May 2020 23:32
24 lines
1894 bytes
anon wrote:

> 
>>See the 'post_articles' function in send.php.
> 
> I don't have any send.php, ok, strike that, i found it.
> 
> why do need to put the scripts in /etc/rslight/ ? (rant over).

Well, they need to be somewhere :) That's just where I settled as I didn't 
want yet another directory to be necessary. I don't want them accessible by 
a browser also.

> i guess in your example there would have to be some auth before ? and then
> you would need to import a whole bunch of libs again to do it in the
> rslight way ? or directly like you have written before. maybe the easiest
> way is the best here: just drop the message in the spool, and let rslight
> take care of the rest ?

Yes, if you drop a properly formatted message in the spool 
/var/spool/rslight/rocksolid/outgoing, it should be sent.

Since vichan makes a full message with headers, I don't think there is going 
to be much difficulty to send it by several different methods. 
Re: hey, what do you know: vichan supports nntp
#258
Author: anon
Date: Fri, 15 May 2020 23:42
24 lines
1643 bytes
fputs($s,"AUTHINFO USER $server_auth_user
");
      $weg=line_read($s);
      fputs($s,"AUTHINFO PASS $server_auth_pass
");
      $weg=line_read($s);
      if (substr($weg,0,3) != "281" {
        AUTH FAILED
        can't do stuff...
      } else {
        IT DIDN"T FAIL, YAY!
        do stuff...
      }

And I guess the "do stuff" would be some variant of message_post and message_post_with_attachment from /lib/post.inc.php. not sure it is better to just put that code into the vichan function, or to call some function in the rslight framework. i guess the latter, this way we can do minimal changes on the vichan code. 
actually, the way this is done in vi might be superior, because the whole message is already composed and then sent in one go (instead of composing and sending the individual pieces).
now it gets a bit tricky, i have to read up a bit on nntp before i can continue.

cheers

trw

Posted on def4
Re: hey, what do you know: vichan supports nntp
#267
Author: anon
Date: Sat, 16 May 2020 00:13
11 lines
1212 bytes
>See the 'post_articles' function in send.php. 

I don't have any send.php, ok, strike that, i found it.

why do need to put the scripts in /etc/rslight/ ? (rant over).

i guess in your example there would have to be some auth before ? and then you would need to import a whole bunch of libs again to do it in the rslight way ? or directly like you have written before.
maybe the easiest way is the best here: just drop the message in the spool, and let rslight take care of the rest ?

Posted on def4
Re: hey, what do know ? vichan supports nntp
#260
Author: Retro Guy
Date: Sat, 16 May 2020 08:17
37 lines
2224 bytes
anonymous wrote:

> and here is where the hacking starts:
> 
> function nntp_publish($msg, $id) {
>         global $config;
>         $server = $config["nntpchan"]["server"];
>         $s = fsockopen("tcp://$server");
>         fgets($s);
>         fputs($s, "MODE STREAMrn");
>         fgets($s);
>         fputs($s, "TAKETHIS $idrn");
>         fputs($s, $msg);
>         fputs($s, "rn.rn");
>         fgets($s);
>         fputs($s, "QUITrn");
>         fclose($s);
> }

It might help a lot to see exactly how vichan formats a post it wants to 
send via nntp. Maybe if we temporarily change this function to:

function nntp_publish($msg, $id) {
	$save_postfh = fopen("/tmp/vichanpost.txt", 'w');
	fputs($save_postfh, $msg);
	fclose($save_postfh);
}

then we have a saved copy of a post to look at. If we need to modify it to 
post properly to inn, rslight etc., we can modify it right in this function 
before sending it (for example, maybe we need to add a Message-ID or convert 
line breaks, etc.) Maybe adding auth here might be a good place also.

It also looks like this function doesn't return anything so vichan has no 
way of knowing if the posting was successful (looks like that anyway).

Retro Guy
Re: hey, what do know ? vichan supports nntp
#261
Author: anonymous
Date: Sat, 16 May 2020 16:46
19 lines
1553 bytes
this is a text message generated by vichan:

--------------------------------------------
Message-Id: <ts.6.3iy3w3@anon.com>
Newsgroups: rocksolid.nodes
Date: Sat, 16 May 2020 09:37:58 -0700
Subject: and the reply
From: Anonymous <poster@anon.com>
References: <ts.3.3xowan@anon.com>
Content-Type: text/plain; charset=UTF-8

reply


--------------------------------------------
That should do, doesn't look anything strange.
-- 
Posted on def2
z5bqfv5v75kxy7pj.onion
Re: hey, what do know ? vichan supports nntp
#263
Author: anonymous
Date: Sat, 16 May 2020 17:07
29 lines
3109 bytes
and this is a message with a picture attached:

Message-Id: <ts.7.geb57@anon.com>
Newsgroups: rocksolid.nodes
Date: Sat, 16 May 2020 09:55:47 -0700
Subject: and one with a picture
From: Anonymous <poster@anon.com>
References: <ts.3.3xowan@anon.com>
Content-Type: multipart/mixed; boundary=1e4369a05339eca512b691687b1adb267f4539a1
Mime-Version: 1.0

--1e4369a05339eca512b691687b1adb267f4539a1

(lots of b64 encoded chars here)-----------------------------------------------
AABAVgMAAAAAZDUAAAAAZDUAAAAAQFYDAAAAQFYDAAAAAGQ1AAAAAEBWAwAAAEBWAwAAAABkNQAAAABkNQAAAABAVgMAAAAAZDUAAAAAZDUAAAAAQFYDAAAAQFYDAAAAAGQ1AAAAAEBWAwAAAEBWAwAAAABkNQAAAABkNQAAAABAVgMAAAAAZDUAAAAAZDUAAAAAQFYDAAAAQFYDAAAAAGQ1AAAAAEBWAwAAAEBWAwAAAABkNQAAAABkNQAAAABAVgMAAAAAZDUAAAAAZDUAAAAAuF8kRPTf/svPlk5SjbX/UPyLpVOCPo6WAoDH1S9/9T4aAQA2blb7b//lZ//bf/rN0km+ItOPRn+9dIpCxdBSAAAAAA8eroECAAAAIKsBAAAAALIaAAAAALIaAAAAACCrAQAAACCrAQAAAACyGgAAAAAgqwEAAAAgqwEAAAAAshoAAAAAshoAAAAAIKsBAAAAALIaAAAAALIaAAAAACCrAQAAACCrAQAAAACyGgAAAAAgqwEAAAAgqwEAAAAAshoAAAAAshoAAAAAbBx/M/jtl3dMUo21/1C8b+mUoI+jpQAA4PGgUDE0Amw0b7zx69Onf3HHlHhW2/lMwx1z+4pMPxq9gG4NAACPJQxAwAZ0+vQvFsPZHXANFAAAAGDjQlYDAAAAQFYDAAAAAGQ1AAAAAGQ1AAAAAEBWAwAAAEBWAwAAAABkNQAAAABAVgMAAABAVgMAAAAAZDUAAAAAZDUAAAAAQFYDAAAAAGQ1AAAAAGQ1AAAAAEBWAwAAAEBWAwAAAABkNQAAAABAVgMAAABAVgMAAAAAZDUAAAAAZDUAAAAAQFYDAAAAAGQ1AAAAAGQ1AAAAAEBWAwAAAEBWAwAAAABkNQAAAABAVgMAAABAVgMAAAAAZDUAAAAAZDUAAAAAQFYDAAAAAGQ1AAAAAGQ1AAAAAEBWAwAAAEBWAwAAAABkNQAAAABAVgMAAABAVgMAAAAAZDUAAAAAZDUAAAAAQFYDAAAAAGQ1AAAAAGQ1AAAAAEBWAwAAAEBWAwAAAABkNQAAAABAVgMAAABAVgMAAAAAZDUAAAAAZDUAAAAAQFYDAAAAAGQ1AAAAAGQ1AAAAAEBWAwAAAEBWAwAAAABkNQAAAABAVgMAAABAVgMAAAAAZDUAAAAAZDUAAAAAQFYDAAAAAGQ1AAAAgI3s/wdQfeE
tK64S+QAAAABJRU5ErkJggg==
--1e4369a05339eca512b691687b1adb267f4539a1--

-------------------------------------------------------------------------------
looks good as well.

i will try and just put the files in the outspool.

cheers

trw
-- 
Posted on def2
z5bqfv5v75kxy7pj.onion
Re: hey, what do know ? vichan supports nntp
#264
Author: anonymous
Date: Sat, 16 May 2020 18:01
19 lines
2024 bytes
ok, just inserting those two into the outspool of rslight made them appear on rocksolid.shared.test (this was the defined group). works out of the box.

to do:

-threading is broken (guess the header is not correct by our standards)
-attachment is lost (guess the b64 way of doing things is not overall appreciated)

but wow, here i thought i needed to actually code something, and instead it just works and merely needs some tweaks. great.

btw, i can see now why the software was appreciated so widely, it is just done very nicely, lots of features and still easy to use (and being able to see and understand what is under the hood). one of the nicer features for developmnt is the debug output to the webserver. just very convenient.

this is gonna be great.

cheers

trw
-- 
Posted on def2
z5bqfv5v75kxy7pj.onion
Re: hey, what do know ? vichan supports nntp
#265
Author: anonymous
Date: Sat, 16 May 2020 18:05
6 lines
1551 bytes
>-attachment is lost (guess the b64 way of doing things is not overall appreciated)

actually, the attached pic displays on rslight, but the name is lost. bbs and ff cannot apparently not read it correctly and don't recognize that there is an attachment.
-- 
Posted on def2
z5bqfv5v75kxy7pj.onion
Re: hey, what do know ? vichan supports nntp
#266
Author: anonymous
Date: Sat, 16 May 2020 19:26
10 lines
1572 bytes
ok, and threading works as well, but the start of the tread must be present for it to work, as all messages in the thread refer to it (not to each other).

looks really good. now the other way round.

cheers

trw
-- 
Posted on def2
z5bqfv5v75kxy7pj.onion
Re: hey, what do know ? vichan supports nntp
#268
Author: anonymous
Date: Sat, 16 May 2020 20:25
5 lines
1830 bytes
while this should be easy enough, it is not. they used a get request to sent over all the parameters for the message, including the body. and also the attachments. 
to use a get request to post information is somewhat bad style, but ok. but for the hell of it, i cannot figure out how they did binary uploads with a get request. guess i will use post instead of get, and insert the commands somewhere in spoolnews.
-- 
Posted on def2
z5bqfv5v75kxy7pj.onion
Re: hey, what do know ? vichan supports nntp
#269
Author: anonymous
Date: Sat, 16 May 2020 20:47
5 lines
1650 bytes
this will take me a while to figure out, the function in question is >800 lines.
i hoped to look up the code that nntpchan used, but to my surprise it is no longer on github,
-- 
Posted on def2
z5bqfv5v75kxy7pj.onion
Re: hey, what do know ? vichan supports nntp
#270
Author: Retro Guy Retro Guy
Date: Sat, 16 May 2020 23:49
21 lines
2010 bytes
anonymous wrote:

> ok, just inserting those two into the outspool of rslight made them appear on rocksolid.shared.test (this was the defined group). works out of the box.

Nice! The format of the messages looks good, shouldn't be a problem.

> to do:

> -threading is broken (guess the header is not correct by our standards)

As I posted in r.s.test, it may be that vichan only wants one Reference.

> -attachment is lost (guess the b64 way of doing things is not overall appreciated)

I tried a header change in a test spool on the message, but still 'unnamed'. I'll look a bit more into this.

Retro Guy

-- 
Posted on: Rocksolid Light
news.novabbs.com
Re: hey, what do know ? vichan supports nntp
#271
Author: Retro Guy Retro Guy
Date: Sun, 17 May 2020 00:04
27 lines
2706 bytes
anonymous wrote:

> this will take me a while to figure out, the function in question is >800 lines.
> i hoped to look up the code that nntpchan used, but to my surprise it is no longer on github,

Is this post.php in vichan?

Looking at this file, I agree it's probably better to send it as vichan expects (via http, whether get or post), instead of trying to insert a complete message as this would require major modification to this file (not fun).

If we can write one function to take a complete article, and break it into what's needed to send it as a post request for vichan, spoolnews can call that function as it's writing to it's own spool. A simple:

if($isset($enable_vichan) && $enable_vichan === true) {
    vichan_post($article;
}

function vichan_post($article) {
    read $article and break it into pieces necessary to send to vichan;
    send to vichan;
}

We could also modify any headers as necessary here, before sending so vichan doesn't reject the post (like stripping down to one Reference and one Newsgroup if necessary).

Retro Guy

-- 
Posted on: Rocksolid Light
news.novabbs.com
Re: hey, what do know ? vichan supports nntp
#272
Author: anonymous
Date: Sun, 17 May 2020 16:46
40 lines
2530 bytes
>Is this post.php in vichan?

yes.

>Looking at this file, I agree it's probably better to send it as vichan expects (via http, whether get or post), instead of trying to insert a complete message as this would require major modification to this file (not fun).

yes, i concur. 

>If we can write one function to take a complete article, and break it into what's needed to send it as a post request for vichan, spoolnews can call that function as it's writing to it's own spool.

yes, i had that in mind too. it comes down to :
-parsing the message
-sending a post stream including the attachments (if any), probably using curl
-modying post.php on vichan to accept a message number from the post stream instead of creating it itself

>doesn't reject the post (like stripping down to one Reference and one group

either that or we modify vichan. guess it is better to modify the message.


















-- 
Posted on def2
z5bqfv5v75kxy7pj.onion
Re: hey, what do know ? vichan supports nntp
#273
Author: anonymous
Date: Sun, 17 May 2020 18:27
4 lines
2008 bytes
maybe i will go the full 9 yards and make a hacked version of vichans post.php, i am just not sure yet what it would mean to include and run it from rslights side. i guess part of the environment would be different...but i just like the idea to skip the webserver and operate directly on the php code of vichan (via the webserver it is easier, of course...). 
-- 
Posted on def2
z5bqfv5v75kxy7pj.onion
Re: hey, what do know ? vichan supports nntp
#274
Author: anonymous
Date: Sun, 17 May 2020 19:30
15 lines
2218 bytes
these are the parameters that post.php expects for importing messages:
$_GET['Newsgroups']
$_GET['Message-Id']
$_GET['References']
$_GET['Date'])
$_GET['Content-Type']
$_GET['Subject']
$_GET['From']
$_GET['X_Sage']
So no need to change anything for the message id, it already uses it.
Even for text only messages though the content is written raw in the request body, just as files, i guess. 
Seeing that both the files and the message are already present as local files, maybe i can redirect this.
-- 
Posted on def2
z5bqfv5v75kxy7pj.onion
Re: hey, what do know ? vichan supports nntp
#275
Author: anonymous
Date: Sun, 17 May 2020 20:40
4 lines
2004 bytes
i guess the best would be to insert the function to post to vichan in spoolnews.php, function get_articles line 233 and following. all the data from the current message is nicely parsed at this point and can just be forwarded to vichan.
-- 
Posted on def2
z5bqfv5v75kxy7pj.onion
Re: hey, what do know ? vichan supports nntp
#276
Author: Retro Guy Retro Guy
Date: Mon, 18 May 2020 10:28
25 lines
2845 bytes
anonymous wrote:

> i guess the best would be to insert the function to post to vichan in spoolnews.php, function get_articles line 233 and following. all the data from the current message is nicely parsed at this point and can just be forwarded to vichan.

These are the variables that contain the data for these requests in 
spoolnews.php (function get_articles) near where you specified:

$_GET['Newsgroups'] = $group
$_GET['Message-Id'] = $mid[1]
$_GET['References'] = $references (all of them)
$_GET['Date'] = $finddate[1] is a date string from the message
		$article_date is a unix timestamp of same date
$_GET['Content-Type'] = not currently extracted in spoolnews, but can be
$_GET['Subject'] = $subject[1]
$_GET['From'] = $from[1]
$_GET['X_Sage'] = I'm guessing this header won't be in messages sent to vichan
		unless from another vichan instance

Do you want to switch to a POST request? Since GET has length restrictions, it 
might be best, but requres changes in vichan (post.php)

Retro Guy
-- 
Posted on: Rocksolid Light
news.novabbs.com
Re: hey, what do know ? vichan supports nntp
#277
Author: anonymous
Date: Mon, 18 May 2020 12:26
8 lines
2060 bytes
thanks for digging that out.
x-sage is vichan specific and can be omitted.

i decided to try the GET method first, just to test quickly if this would work. 
after that i guess it must be post (unless i figure how to put the message and attachments in the GET request body).
-- 
Posted on def2
z5bqfv5v75kxy7pj.onion
Re: hey, what do know ? vichan supports nntp
#278
Author: anonymous
Date: Wed, 20 May 2020 23:16
13 lines
2863 bytes
ok, will skip the testing bullshit and get right to POST method. i could cut post.php to some 730 lines that are needed for this, out of which i need to modify some 13 lines to read POST instead of GET. Then will use something like this here:
https://www.codexworld.com/post-receive-json-data-using-php-curl/
to send over the data. so this means b64 encoding for the attachments.

i checked some sources now, and while it is technically feasible to put large texts and files into GET request bodies, it goes against all standards and almost everybody advised against it. never mind that a GET request per definition should have not have any impact on the servers state. 
so i really wonder why it was designed like that. maybe there is some sneaky scheme here that i just don't get :-).

i also dug out the old sources of nntp chan (which was a little tricky), and checked the way they do it. but to my surprise all i could find was the nntp way of exchanging messages (so between two nntp instances), but not the way that is implemented in vichan, using http.

well never mind, i will hack that into shape, i think. :-)
-- 
Posted on def2
z5bqfv5v75kxy7pj.onion
Re: hey, what do know ? vichan supports nntp
#279
Author: Retro Guy Retro Guy
Date: Thu, 21 May 2020 08:50
16 lines
2899 bytes
anonymous wrote:

> i also dug out the old sources of nntp chan (which was a little tricky), and checked the way they do it. but to my surprise all i could find was the nntp way of exchanging messages (so between two nntp instances), but not the way that is implemented in vichan, using http.

If you plan to run vichan as dependent on the rslight nntp server, you would have a news server local that you could talk to. rslight would be the "other" nntp instance. Is that of any value?

This is how rslight works. Newsportal could only send/receive from a nntp server, so now it sends/receives from it's own built in nntp server, but the code for the interface is really just talking to any nntp server, I just happen to have placed one on the same machine. That's why you can run it without the built in server, and it doesn't know the difference (it's just way slower).

> well never mind, i will hack that into shape, i think. :-)

Good luck! We're all counting on you! (movie quote, lol)

Retro Guy
-- 
Posted on: Rocksolid Light
news.novabbs.com
Re: hey, what do know ? vichan supports nntp
#280
Author: anonymous
Date: Thu, 21 May 2020 19:04
10 lines
2102 bytes
ok, i did a proof of concept for posting, this works. in the end i skipped the webserver and stuff with curl, and just handed over the message as a file which the modified post.php parses (json encoded). so far so good. as long as both nntp server and vichan run on the same machine, this is a viable solution.

now for the files (so far it is text only).

cheers

trw
-- 
Posted on def2
z5bqfv5v75kxy7pj.onion
Re: hey, what do know ? vichan supports nntp
#281
Author: anonymous
Date: Thu, 21 May 2020 19:20
22 lines
3056 bytes
>If you plan to run vichan as dependent on the rslight nntp server,

Yes, that is the plan. And I would also keep rslight running on the tor side.


> you would have a news server local that you could talk to. rslight would be the "other" nntp instance. Is that of any value?

Yes, absolutely. Right now the syncing from vichan to the news server works by just dropping the message in the outspool. Works well, and will most like stay that way.
The original way (for which I only have half the code from the vichan sources) worked based on ip addresses, which is not good in my case anyway.
The other way round (so from rslight to vichan) will work like I described in the message before, there is just no need for any complicated constructs if both applications are running on the same machine.

The nntp to nntp connection to update vichan is something I would not use if I have easier ways, and it seems I do (I leave it to rslight, and just read and write files).
So eventually this mod for vichan would be a plugin to an rslight installation.

And about forking: I guess that is little heavy for me, but I will upload my mods somewhere eventually (once this it is done well enough to see the light of day, so a little down the road).

cheers

trw
-- 
Posted on def2
z5bqfv5v75kxy7pj.onion
Re: hey, what do know ? vichan supports nntp
#282
Author: Retro Guy Retro Guy
Date: Fri, 22 May 2020 08:40
10 lines
2284 bytes
anonymous wrote:

> The nntp to nntp connection to update vichan is something I would not use if I have easier ways, and it seems I do (I leave it to rslight, and just read and write files).
> So eventually this mod for vichan would be a plugin to an rslight installation.

So if I understand correctly, vichan will read a message from a file and apply it to it's database. If that is correct, how will vichan know the file exists, will it poll a directory? 

-- 
Posted on: Rocksolid Light
news.novabbs.com
Re: hey, what do know ? vichan supports nntp
#284
Author: Retro Guy Retro Guy
Date: Fri, 22 May 2020 09:24
24 lines
1973 bytes
anon wrote:


>>So if I understand correctly, vichan will read a message from a file and apply it to it's database. If that is correct, how will vichan know the file exists, will it poll a directory? 

> that's correct. i was planning to call the vichan script  from rslight in case of updates (guess from spoolnews).

> Posted on def4

If you are reading each message as a file, would it work for rslight to just send vichan basically the equivalent of what you saw in /var/spool/rslight/rocksolid/local_groups.txt:
rocksolid.nodes:158
rocksolid.nodes.help:53
etc...

This could tell vichan where rslight has set message pointers and vichan can keep it's own list, then it can go pull the articles it doesn't have and update it's pointer list. If the pointers all match, there are no articles to import.

Is this idea of any use?

Retro Guy


-- 
Posted on: Rocksolid Light
news.novabbs.com
Re: hey, what do know ? vichan supports nntp
#285
Author: anonymous
Date: Fri, 22 May 2020 10:46
18 lines
1994 bytes
Yes, that approach could work as well. The downside would be that you would have to parse the messages again, while spoolnews is doing that already. Think I'd rather hand something very simple to vichan from the spoolnews script, like this:
{   
    "Newsgroups": "rocksolid.shared.test",
    "Message-ID": "<83434435e73f113dcce2d23d237b6237$1@z5bqfv5v75kxy7pj.onion>",
    "References": "",
    "Date": "Thu, 14 May 2020 16:16 UTC",
    "Subject": "nother post",
    "From": "anonymous@anon.com (anonymous)",
    "Content-Type": "text/plain; charset=utf-8; format=flowed",
    "Content": "This is a test text"
}
It is way easier to just do json_decode and have all the values, than to parse the files from the spool (this somewhat messy part is already taken care of, so I would not like to do it again).
Of course it is just a question of taste where the code should reside, at rslight or at vichan.

trw
-- 
Posted on def2
z5bqfv5v75kxy7pj.onion
Re: hey, what do know ? vichan supports nntp
#287
Author: anonymous
Date: Fri, 22 May 2020 19:24
57 lines
2742 bytes
ok, that was easy, i took message_read and put all articles into something like this:

{   
    "header": {
        "number": 100,
        "id": "<96042908114f73b92a4b25ecaf31371d@def4>",
        "from": "anon@anon.com",
        "name": "anon",
        "subject": "Re: sync trest def2",
        "newsgroups": "rocksolid.shared.test",
        "followup": null,
        "date": 1589462807,
        "date_thread": null,
        "organization": "def5",
        "xnoarchive": null,
        "references": [
            "<46f0e0c1993dc510ec8653ac72cb4445$1@z5bqfv5v75kxy7pj.onion>"
        ],
        "bestreference": null,
        "content_transfer_encoding": "8bit",
        "mime_version": null,
        "content_type": [
            "text/plain"
        ],
        "content_type_charset": [
            "utf-8"
        ],
        "content_type_name": [
            "unnamed"
        ],
        "content_type_boundary": null,
        "content_type_format": [
            "flowed"
        ],
        "answers": null,
        "isAnswer": false,
        "username": "anon",
        "user_agent": null,
        "isReply": null,
        "threadsize": null
    },
    "body": [
        "nok, seen on def4nnPosted on def4n"
    ]
}

that is the json encoded array that you get when you typecaste the object that message_read returns.
now i only read this into my import routine from vichan. 

right now i work on a batch import function, and try to wrap my head around some of the details of vichan (which is harder for me than it probably sounds). :-)

cheers

trw 
-- 
Posted on def2
z5bqfv5v75kxy7pj.onion
Re: hey, what do know ? vichan supports nntp
#289
Author: anonymous
Date: Fri, 22 May 2020 20:53
8 lines
1361 bytes
ok, i got a kind of lame import routine working (lame because it has to be called per message). but at least it works. got all the boards created too.

cheers

trw
-- 
Posted on def2
z5bqfv5v75kxy7pj.onion
Page 1 of 2 • 84 total messages
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads