Rocksolid Light

Welcome to Rocksolid Light

register   nodelist   faq  


rocksolid / rocksolid.programming / Re: posting to new server

SubjectAuthor
* vichan to do listAnonymous
+- threadsAnonymous
+* subjectAnonymous
|`* Re: subjectRetro Guy
| `* Re: subjectRetro Guy
|  `* Re: subjectRetro Guy
|   `- Re: subjectanon
+* status updateAnonymous
|`* Re: status updateRetro Guy
| `* Re: status updateRetro Guy
|  +- Re: status updateRetro Guy
|  `* Re: status updateanon
|   +* Re: status updateanon
|   |`* Re: status updateRetro Guy
|   | `* Re: status updateanon
|   |  `* Re: status updateanon
|   |   `* Re: status updateRetro Guy
|   |    +- Re: status updateRetro Guy
|   |    `* Re: status updateanon
|   |     `* Re: status updateRetro Guy
|   |      `- Re: status updateRetro Guy
|   `- Re: status updateRetro Guy
+* Re: vichan to do listanon
|+- Re: vichan to do listRetro Guy
|`* Re: vichan to do listanon
| `* Re: vichan to do listRetro Guy
|  `* Re: vichan to do listRetro Guy
|   `* Re: vichan to do listRetro Guy
|    `* Re: vichan to do listanonymous
|     `* Re: vichan to do listRetro Guy
|      `* Re: vichan to do listanon
|       `* Re: vichan to do listRetro Guy
|        `* Re: vichan to do listRetro Guy
|         `* Re: vichan to do listRetro Guy
|          `* Re: vichan to do listanon
|           +- Re: vichan to do listanon
|           `* Re: vichan to do listRetro Guy
|            `* Re: vichan to do listRetro Guy
|             `* Re: vichan to do listanonymous
|              `* Re: vichan to do listanonymous
|               +- Re: vichan to do listanonymous
|               `- Re: vichan to do listRetro Guy
+* Re: vichan to do listanon
|`* Re: vichan to do listanon
| `- Re: vichan to do listMarc SCHAEFER
+* Re: vichan to do listanon
|`- Re: vichan to do listRetro Guy
+* i just uploaded my code hereAnonymous
|`- Re: i just uploaded my code hereRetro Guy
+- so far seems to workAnonymous
+- alright, multi server updateAnonymous
+* posting to new serverAnonymous
|`- Re: posting to new serverRetro Guy
+- errorAnonymous
+* posting articlesAnonymous
|`- Re: posting articlesRetro Guy
+* alright, i have it goingAnonymous
|`* Re: alright, i have it goingRetro Guy
| `- Re: alright, i have it goingRetro Guy
+* overchanAnonymous
|`- Re: overchanRetro Guy
+- send to rslightAnonymous
+- btw, what about your vichan ?Anonymous
+* jsonAnonymous
|`- Re: jsonMarc SCHAEFER
+- jsonAnonymous
+- date problemsAnonymous
+- ok, fixed the dateAnonymous
+* almost donetrw
|`- Re: almost doneRetro Guy
+- almost doneAnonymous
`* latest codeAnonymous
 `* Re: latest codeRetro Guy
  `* Re: latest codeRetro Guy
   `* Re: latest codeanon
    `* Re: latest codeRetro Guy
     `* Re: latest codeanon
      `* Re: latest codeanon
       `* Re: latest codeanon
        `- Re: latest codeanon

Subject: posting to new server
From: poster@anon.com (Anonymous)
Newsgroups: rocksolid.programming
Organization: i2pn2 (i2pn.org)
Date: Mon, 8 Jun 2020 02:41 UTC
for some reason the almost identical code sequence that works for send.php in rslight for posting messages to a news server (using the post command),
produces a 480 - posting not allowed when i try to use it for vichan (with the same server). guess i do something for the auth.
this is clearly not RESTful :-)

--
Posted on def2


Subject: Re: posting to new server
From: Retro Guy@rslight.i2p (Retro Guy)
Newsgroups: rocksolid.programming
Organization: Rocksolid Light
Date: Mon, 8 Jun 2020 09:09 UTC
Anonymous wrote:

for some reason the almost identical code sequence that works for send.php in rslight for posting messages to a news server (using the post command), produces a 480 - posting not allowed when i try to use it for vichan (with the same server). guess i do something for the auth.

Are you setting $remote_auth_user and $remote_auth_pass in the file? In rslight these are pulled from config. If that's ok, when exactly do you see the error? After AUTHINFO commands? After POST command?

The function nntp2_open in send.php uses language variables to display some errors. If you're not linked to rslight, you probably won't see the errors from it. You can just change those lines to display the text you want for the error.

BTW, the function nntp2_open in send.php and the modified vichan_nntp.php are identical functions. If you link the two files (include one in the other), you'll need to drop the function from the secondary function.

send.php does not include some functions it uses that are in newsportal.php. If you are running it not including that file, it probably won't work. The best way to handle it for now is to just copy the functions into the send.php you want to use. (vichan_send.php maybe?)

Retro Guy

--
Posted on: Rocksolid Light
www.novabbs.com



Subject: error
From: poster@anon.com (Anonymous)
Newsgroups: rocksolid.programming
Organization: i2pn2 (i2pn.org)
Date: Mon, 8 Jun 2020 15:05 UTC
when exactly do you see the error? After AUTHINFO commands? After POST command?

i am not sure, because with telnet everything works, and with the program, i don't see exactly what happens. some screwing up the auth, i think.
actually, ihave or takethis would be better than post.
this will take a but more tinkering.

--
Posted on def2


Subject: posting articles
From: poster@anon.com (Anonymous)
Newsgroups: rocksolid.programming
Organization: i2pn2 (i2pn.org)
Date: Mon, 8 Jun 2020 16:53 UTC
Are you setting $remote_auth_user and
$remote_auth_pass in the file?

i set the vars right (passing them on from the calling script), tested that before.

when exactly do you see the error? After AUTHINFO commands? After POST command?

i don't know, because i don't see the intermediate stages. i guess i also had a mistake in parsing the the responses from the news server.
doing the same in telnet i get no error at all. guess it is not exactly the same that i do in telnet.


The best way to handle it for now is to just copy the
functions into the send.php you want to use.
(vichan_send.php maybe?)

that is the question. i tried to make nntpchan.php from vichan working, which it did not for some reason. when i do the psoting to the news server there, i can't (or don't want) to drag a lot of libs in, because that will end up messy i guess, and i don't understand the vichan code well enough to really integrate it well.
the other option is to do the posting in the import script i have already (which would also become an export script than), in this case one more lib doesn't hurt. or maybe the posting function could be included in vichan_nntp.php ?
what i don't understand yet is how rslight can use POST to post an article with an existing message id ? i understand that normally the news server generates the number for you when you use POST (like for fudforum for example).
forwarding existing messages should (according to RFC) be done with IHAVE or TAKETHIS.
not that i will complain about this point if i can find a way to make this work, mind you :-).
the advantage of using POST is maybe that more news servers will let you use it vs streaming with IHAVE or TAKETHIS.
but anyway, it is maybe best to take that code outside from vichan and just continue to drop the messages as files in a defined directory. this way i can also implement a followup (post successful or not).

cheers

trw

--
Posted on def2


Subject: Re: posting articles
From: Retro Guy@rslight.i2p (Retro Guy)
Newsgroups: rocksolid.programming
Organization: Rocksolid Light
Date: Mon, 8 Jun 2020 23:19 UTC
Anonymous wrote:

The best way to handle it for now is to just copy the
functions into the send.php you want to use.
(vichan_send.php maybe?)

that is the question. i tried to make nntpchan.php from vichan working, which it did not for some reason. when i do the psoting to the news server there, i can't (or don't want) to drag a lot of libs in, because that will end up messy i guess, and i don't understand the vichan code well enough to really integrate it well.
the other option is to do the posting in the import script i have already (which would also become an export script than), in this case one more lib doesn't hurt. or maybe the posting function could be included in vichan_nntp.php ?

That shouldn't be a problem, especially since send and retrieving articles share some functions.

what i don't understand yet is how rslight can use POST to post an article with an existing message id ? i understand that normally the news server generates the number for you when you use POST (like for fudforum for example). forwarding existing messages should (according to RFC) be done with IHAVE or TAKETHIS.

inn and rslight news servers will accept articles which include a message-id, and retain that when receiving via the POST command. Both servers will create a m-id if one is not included, but will not change it if it is included.

Consider that rslight spools a message posted to it right away. It can't wait until after it's posted to an upstream server to then get a m-id, it needs one immediately to spool a proper article. It is intentional that when clicking 'Post' when sending a message in rslight, you need not wait for communication with an upstream server before moving along. On i2p especially, this is important.

But when posting to inn or rslight from vichan, including a message-id in your message is not required, it's just supported.

not that i will complain about this point if i can find a way to make this work, mind you :-). the advantage of using POST is maybe that more news servers will let you use it vs streaming with IHAVE or TAKETHIS.

Exactly. Most servers will not allow IHAVE or TAKETHIS (streaming), but any server you can post to with a reader will respond to POST properly.

but anyway, it is maybe best to take that code outside from vichan and just continue to drop the messages as files in a defined directory. this way i can also implement a followup (post successful or not).

Since you already have a properly formatted message coming out of vichan, it really should be a simple matter of (taken from send.php):

  $messages = scandir($outgoing_dir);
  foreach($messages as $message) {
    if(!is_file($outgoing_dir.$message)) {
      continue;
    }
    echo "Sending: ".$outgoing_dir.$message."rn";
    fputs($ns, "MODE READERrn");
    $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: ".$response, FILE_APPEND);
      return $response;
    }
    fputs($ns, "POSTrn");
    $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, ".rn");
    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;
    }
  }
  return "Messages sentrn";

The above is sending from a file, but could just as easily be sending from a variable.

Retro Guy

--
Posted on: Rocksolid Light
www.novabbs.com



Subject: alright, i have it going
From: poster@anon.com (Anonymous)
Newsgroups: rocksolid.programming
Organization: def2
Date: Tue, 9 Jun 2020 08:50 UTC
thanks for the code. i had to change a few places, like:
echo "Sending: ".$outgoing_dir.$message."rn";
to
echo "Sending: ".$outgoing_dir.$message."\n\r";
and, more importantly:
fputs($ns, "MODE READERrn");
to
fputs($ns, "MODE READER\r\n");
and like that in all the places sending this sequence.

in the process i discovered that subjects with "\" will break something in bbs :-).

anyway, it is working, and vichan posts directly to news servers now.
so now, it can run without any local news server, meaning you should be able to sync any existing installation to newsgroups.
very cool.
i need to clean up my code, it is still horrible right now, and i guess it can be done in half of the lines.
after that, maybe we should publish that somewhere it can be found (thinking some fork on github or so...). i know i said earlier a fork would be too heavy for me, but maybe we can offer it to some existing fork ? what do you think ?
i just have the feeling it would be unfair to build on something existing and than not sharing your results.

anyway, it is working. very nice. :-)

cheers

trw

--
Posted on def2


Subject: overchan
From: poster@anon.com (Anonymous)
Newsgroups: rocksolid.programming
Organization: i2pn2 (i2pn.org)
Date: Tue, 9 Jun 2020 09:17 UTC
btw, this setup should also be a compliant implementation of overchan. i wonder whatever became of this project. it was really huge in terms of numbers of nodes once.

--
Posted on def2


Subject: Re: alright, i have it going
From: Retro Guy@rslight.i2p (Retro Guy)
Newsgroups: rocksolid.programming
Organization: Rocksolid Light
Date: Tue, 9 Jun 2020 09:18 UTC
Anonymous wrote:

thanks for the code. i had to change a few places, like:
echo "Sending: ".$outgoing_dir.$message."rn";
to
echo "Sending: ".$outgoing_dir.$message."nr";
and, more importantly:
fputs($ns, "MODE READERrn");
to
fputs($ns, "MODE READERrn");
and like that in all the places sending this sequence.

Yes, rslight removes the backslash when displaying the code. What I sent had the backslashes but they were stripped for display.

in the process i discovered that subjects with "" will break something in bbs :-).

There's always something new in everybody's code :)

anyway, it is working, and vichan posts directly to news servers now. so now, it can run without any local news server, meaning you should be able to sync any existing installation to newsgroups.
very cool.

One of the links I sent in r.s.encryption is an rslight nntp server. If you want to test syncing vichan directly to rslight and back, it might be a great test to prove no inn servers are required. I already sync one rslight site to another successfully. (My freebsd test site to rslight.i2p)

i need to clean up my code, it is still horrible right now, and i guess it can be done in half of the lines.

Uh, yeah, me too :)

after that, maybe we should publish that somewhere it can be found (thinking some fork on github or so...). i know i said earlier a fork would be too heavy for me, but maybe we can offer it to some existing fork ? what do you think ?
i just have the feeling it would be unfair to build on something existing and than not sharing your results.

I agree that when it's working well, provide a download at least. That's all I do for rslight. I have no github, cvs or anything, but it can be downloaded. I'd do the same for vichan. If someone wants to fork what you wrote, that's great, but it's nice to keep your own fork for your own mods, etc.

anyway, it is working. very nice. :-)

I'm amazed at how fast you got this working! Great work!

Retro Guy


--
Posted on: Rocksolid Light
www.novabbs.com



Subject: Re: overchan
From: Retro Guy@rslight.i2p (Retro Guy)
Newsgroups: rocksolid.programming
Organization: Rocksolid Light
Date: Tue, 9 Jun 2020 09:24 UTC
Anonymous wrote:

btw, this setup should also be a compliant implementation of overchan. i wonder whatever became of this project. it was really huge in terms of numbers of nodes once.

It's odd how it just kind of went away. It seemed to work fine.

--
Posted on: Rocksolid Light
www.novabbs.com



Subject: Re: alright, i have it going
From: Retro Guy@rslight.i2p (Retro Guy)
Newsgroups: rocksolid.programming
Organization: Rocksolid Light
Date: Tue, 9 Jun 2020 09:26 UTC
Retro Guy wrote:

Anonymous wrote:

in the process i discovered that subjects with "" will break something in bbs :-).

There's always something new in everybody's code :)

I noticed earlier today that rslight's overboard did not display koi-8 correctly. The article would display properly, but not in the overboard. That's fixed now :)

Retro Guy

--
Posted on: Rocksolid Light
www.novabbs.com



Pages:12345678
rocksolid light 0.6.5e
clearnet i2p tor