Thread View: news.software.nntp
11 messages
11 total messages
Started by Jon Bendtsen
Wed, 22 Apr 2009 12:37
autocreate groups when someone posts to a nonexisting group?
Author: Jon Bendtsen
Date: Wed, 22 Apr 2009 12:37
Date: Wed, 22 Apr 2009 12:37
7 lines
1076 bytes
1076 bytes
Hi Can i autocreate groups when someone posts to a nonexisting group? JonB
Re: autocreate groups when someone posts to a nonexisting group?
Author: Jon Bendtsen
Date: Wed, 22 Apr 2009 12:59
Date: Wed, 22 Apr 2009 12:59
26 lines
1985 bytes
1985 bytes
Jon Bendtsen wrote: > Hi > > Can i autocreate groups when someone posts to a nonexisting group? Maybe i should explain what i want, because there might be a better way of doing it. I want to post SVN change emails to my own news server. But i dont just want one group. I want to divide into just the right group, such that there is a group for each branch or tag. So i would post to: $projectname.tags.$tagname $projectname.branches.$branchname $projectname.trunk (HEAD) But i want to do all that automatic, even when someone creates a new branch or tag, where a corresponding group obviously does not yet exist. Someone already made a NNTP posting patch, but it requires that the group you post to exist. I know i need to be able to post to groups that does not exist before someone commits to SVN, but it needs to exist after the commit. JonB
Re: autocreate groups when someone posts to a nonexisting group?
Author: Bo Lindbergh
Date: Wed, 22 Apr 2009 13:11
Date: Wed, 22 Apr 2009 13:11
12 lines
1411 bytes
1411 bytes
In article <gsn31b$37q$1@munin.diku.dk>, Jon Bendtsen <noone@example.com> wrote: > Can i autocreate groups when someone posts to a nonexisting group? Bad idea. Your active file would fill up with a never-ending stream of typos of existing group names (nes.software.nntp, news.software.mmtp, and so on, et cetera, og så videre). (Isn't this in a FAQ somewhere?) /Bo Lindbergh
Re: autocreate groups when someone posts to a nonexisting group?
Author: Jon Bendtsen
Date: Wed, 22 Apr 2009 13:32
Date: Wed, 22 Apr 2009 13:32
19 lines
1812 bytes
1812 bytes
Bo Lindbergh wrote: > In article <gsn31b$37q$1@munin.diku.dk>, Jon Bendtsen <noone@example.com> > wrote: >> Can i autocreate groups when someone posts to a nonexisting group? > > Bad idea. Your active file would fill up with a never-ending > stream of typos of existing group names (nes.software.nntp, > news.software.mmtp, and so on, et cetera, og så videre). No, it wont for my setup, see my other more detailed posting to why typos wont matter. The poster is mainly a python script that takes project, branch and tag names from subversion. Further more, in subversion my users can create projects themselves, and there hasnt been any problem with people making typos. JonB
Re: autocreate groups when someone posts to a nonexisting group?
Author: Jeffrey M. Vinocur
Date: Wed, 22 Apr 2009 13:46
Date: Wed, 22 Apr 2009 13:46
32 lines
2324 bytes
2324 bytes
In article <gsn4bh$3ad$1@munin.diku.dk>, Jon Bendtsen <noone@example.com> wrote: > >I want to post SVN change emails to my own news server. But i dont >just want one group. I want to divide into just the right group, >such that there is a group for each branch or tag. [...] > >Someone already made a NNTP posting patch, but it requires that the >group you post to exist. I know i need to be able to post to groups >that does not exist before someone commits to SVN, but it needs to >exist after the commit. Hmmmmmmmm. You might be able to do this in a posting filter (although I'm not actually sure if the check for group existance happens before or after the filters get called), but if you're already using a script to do the posting, it might be easier (at least if the script is on the same server) to do it from there. There's no harm in calling `ctlinnd newgroup` on groups that already exist (except for cluttering up the logs), so you could get something working in a few minutes that way. The only issue would be whether the subversion script is being run as a user with permission to access ctlinnd -- you could use a little wrapper to validate the group name and then call ctlinnd with it if you needed to. -- Jeffrey M. Vinocur jeff@litech.org
Re: autocreate groups when someone posts to a nonexisting group?
Author: Jon Bendtsen
Date: Wed, 22 Apr 2009 14:13
Date: Wed, 22 Apr 2009 14:13
44 lines
3074 bytes
3074 bytes
Jeffrey M. Vinocur wrote: > In article <gsn4bh$3ad$1@munin.diku.dk>, > Jon Bendtsen <noone@example.com> wrote: >> I want to post SVN change emails to my own news server. But i dont >> just want one group. I want to divide into just the right group, >> such that there is a group for each branch or tag. [...] >> >> Someone already made a NNTP posting patch, but it requires that the >> group you post to exist. I know i need to be able to post to groups >> that does not exist before someone commits to SVN, but it needs to >> exist after the commit. > > Hmmmmmmmm. > > You might be able to do this in a posting filter (although I'm > not actually sure if the check for group existance happens before > or after the filters get called), but if you're already using a > script to do the posting, it might be easier (at least if the > script is on the same server) to do it from there. It is not on the same server, but SSH can be limited to only allow a specific program to run, and with ssh key login that is one solution. > There's no harm in calling `ctlinnd newgroup` on groups that > already exist (except for cluttering up the logs), so you could > get something working in a few minutes that way. The only issue > would be whether the subversion script is being run as a user > with permission to access ctlinnd -- you could use a little > wrapper to validate the group name and then call ctlinnd with it > if you needed to. The subversion script is in python, so i would have to extend it with running an external command. But python also has exceptions, which should allow me to only run the external command if the 1. attempt to post returned with a 441, no valid group. I figure that there might be an easier way, to just allow anyone to create a group, and since we are only about 50 users behind a firewall i dont see any problems with abuse. JonB
Re: autocreate groups when someone posts to a nonexisting group?
Author: Curt Welch
Date: Wed, 22 Apr 2009 17:27
Date: Wed, 22 Apr 2009 17:27
46 lines
3815 bytes
3815 bytes
Bo Lindbergh <blgl@hagernas.com> wrote: > In article <gsn31b$37q$1@munin.diku.dk>, Jon Bendtsen <noone@example.com> > wrote: > > Can i autocreate groups when someone posts to a nonexisting group? > > Bad idea. Your active file would fill up with a never-ending > stream of typos of existing group names (nes.software.nntp, > news.software.mmtp, and so on, et cetera, og så videre). > > (Isn't this in a FAQ somewhere?) > > /Bo Lindbergh On the subject of auto creating groups, my server did it for many years and it worked just fine. It's it's done right, it's not a bad idea at all (at least for alt groups). The only trick is that you have to auto-delete them as well because of the typo problem. I used a rather complex algorithm in the server which first would "hide" the group from the active list when it was idle after an extended period and then later delete it. You don't want to lose the article numbering just because a group went quite for a month but by hiding the groups that seemed to have died, it kept the size of the active file a bit more reasonable. The other improvement I thought up, but never got around to implementing, is to not auto-create on cross post for articles received from peers. That basically meant that other servers had to create the group and someone had to post directly to that new group without cross posting, before it would be auto-created on mine. That would have greatly cut down on the typo and junk groups. Still, even without that, the active file was reasonable in length- around 125K - where as most commercial services have active files near that size already. The OP however has a special need where auto creating might work just fine. I don't know if INN has an auto create feature? Diablo does. If he has control over the subversion archives, he might consider adding hooks in subversion that would trigger the creation of groups whenever the new branches etc were created? Not sure if that's possible for what he needs but I know subversion has some ability to trigger scripts. The other idea (if there's not a simple auto-create option on the server), is to use a more advanced mail-to-news code that does the auto-create of the group for you if it doesn't exist? -- Curt Welch http://CurtWelch.Com/ curt@kcwc.com http://NewsReader.Com/
Re: autocreate groups when someone posts to a nonexisting group?
Author: Julien ÉLIE
Date: Wed, 22 Apr 2009 18:33
Date: Wed, 22 Apr 2009 18:33
24 lines
2295 bytes
2295 bytes
Hi Jon, > The subversion script is in python, so i would have to extend it > with running an external command. But python also has exceptions, > which should allow me to only run the external command if the 1. > attempt to post returned with a 441, no valid group. You could also do it before trying to post. Just send "GROUP news.group.name" and see whether you receive 411 (no such newsgroup). In case you receive 411, you could send what is called a "newgroup control article" (see control.ctl and controlchan for more information about how to deal with control articles). It will create the newsgroup on your server within a few seconds. Just send "GROUP news.group.name" until you obtain a 211 answer (with of course a timeout, in case something went wrong). -- Julien ÉLIE « -- L'argent n'a pas d'odeur. -- C'est pourtant le produit de l'urine. » (Réplique de Titus à Vespasien)
Re: autocreate groups when someone posts to a nonexisting group?
Author: Jon Bendtsen
Date: Thu, 23 Apr 2009 09:24
Date: Thu, 23 Apr 2009 09:24
31 lines
2457 bytes
2457 bytes
Thank you for your input Curt Welch wrote: [cuuuuuut] > The OP however has a special need where auto creating might work just fine. > I don't know if INN has an auto create feature? Diablo does. If he has > control over the subversion archives, he might consider adding hooks in > subversion that would trigger the creation of groups whenever the new > branches etc were created? Not sure if that's possible for what he needs > but I know subversion has some ability to trigger scripts. I does have complete control of my inn and SVN server. Oh yeah, there are other hooks than just the one i use to send emails/nntp. I might be able to use those, but i already started changing the email script to run an external command on posting fail. > The other idea (if there's not a simple auto-create option on the server), > is to use a more advanced mail-to-news code that does the auto-create of > the group for you if it doesn't exist? I would like to avoid email because it just adds time from commit to the post is out. Because the email will be spam + virus scanned since i would just use the regular smtp server and pop3 with fetchmail. I already use that for my "mailing lists", but i would prefer to avoid sending unneeded stuff through that. JonB
Re: autocreate groups when someone posts to a nonexisting group?
Author: Jon Bendtsen
Date: Thu, 23 Apr 2009 09:27
Date: Thu, 23 Apr 2009 09:27
35 lines
2715 bytes
2715 bytes
Julien ÉLIE wrote: > Hi Jon, > >> The subversion script is in python, so i would have to extend it >> with running an external command. But python also has exceptions, >> which should allow me to only run the external command if the 1. >> attempt to post returned with a 441, no valid group. > > You could also do it before trying to post. > Just send "GROUP news.group.name" and see whether you receive 411 > (no such newsgroup). > > In case you receive 411, you could send what is called a "newgroup > control article" (see control.ctl and controlchan for more information > about how to deal with control articles). It will create the newsgroup > on your server within a few seconds. Just send "GROUP news.group.name" > until you obtain a 211 answer (with of course a timeout, in case > something went wrong). Yes, but since i started down this path, i have been thinking. What do i do if i get an error message which is not "no such group" ? At the moment all my scripts does is throw up to the comitter. I have started hooking into the mailer.py script from subversion so i can run an external program if there is an error. At the very least this program can log the error message so the user wont see something they dont understand and cant fix anyway. I plan to use this script to just create a group if it is missing, and this will also avoid growing a huge group list if someone makes a typo when posting news. Thanks for all your input.
Re: autocreate groups when someone posts to a nonexisting group?
Author: D. Stussy
Date: Thu, 23 Apr 2009 20:08
Date: Thu, 23 Apr 2009 20:08
37 lines
2767 bytes
2767 bytes
"Jon Bendtsen" <noone@example.com> wrote in message
news:gsn69g$3f3$1@munin.diku.dk...
> Bo Lindbergh wrote:
> > In article <gsn31b$37q$1@munin.diku.dk>, Jon Bendtsen
<noone@example.com>
> > wrote:
> >> Can i autocreate groups when someone posts to a nonexisting group?
> >
> > Bad idea. Your active file would fill up with a never-ending
> > stream of typos of existing group names (nes.software.nntp,
> > news.software.mmtp, and so on, et cetera, og så videre).
>
> No, it wont for my setup, see my other more detailed posting to why
> typos wont matter. The poster is mainly a python script that takes
> project, branch and tag names from subversion.
>
> Further more, in subversion my users can create projects themselves,
> and there hasnt been any problem with people making typos.
I too have experimented with this. I'm not certain what kind of filter you
plan on using to prevent the misspelled groups; they are a problem.
As alot of the misspelled groups contain only spam, what I do is when I run
my script that scans the {newslog}"/unwanted.log" file is to create any
validly-named group (via a regex) with a moderation flag of "j" (so it will
be passed only to peers that want the "junk" pseudogroup). This is often
followed with a pass of using actsync feeding mod-active to remove some of
the invalid names that get past the regex (like names that have an
all-numeric component, "bork" groups, etc.).
~news/bin/actsync -p 0 -b 2 -d 2 -t 2 ./active ./active |
~news/bin/mod-active
Mod-active is your friend in this. Issuing individual "ctlinnd newgroup"
commands is not.
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