LoginHomeBugs & FeaturesDocumentationDownloadForums

STR #22

Status:5 - New
Priority:1 - Request for Enhancement, e.g. asking for a feature
Scope:3 - Applies to all machines and operating systems
Subsystem:Unassigned
Summary:Default options for new groups
Version:2.0-feature
Created By:AdminTreenet
Assigned To:Unassigned
Fix Version:Unassigned
Update Notification:

Receive EMails Don't Receive EMails


Trouble Report Files:

Post File

No files


Trouble Report Dialog:

Post Text

Name/Time/DateText
AdminTreenet
06:19 Jun 15, 2006
At present there is no (at least documented) method of altering the defaults offered when creating a new group.

Allowing some defaults for the .conf file to be specified, perhapse in the newsd.conf would be very helpful for admin wanting or needing to enforce uniform settings across a number of groups.
erco
10:20 Jun 15, 2006
I'd considered other alternatives such as templates, but templates don't allow for logic, and are not all the flexible. Plus you have to come up with a variable syntax, etc.. yuck.

Maybe the easiest way to make this flexible is to make newsd.conf option that allows one to specify a 'post filter' script that 'newsd -newgroup' invokes after it creates a new group, passing the script the new groupname and group dir as arguments, eg.

----
# NewGroup.Script
#    This script will be called immediately after 'newsd -newgroup'
#    creates a new group, so local defaults can be applied.
#    New group's name and path will be passed as arguments.
#
# NewGroup.Script "/path/to/my/script"
NewGroup.Script "-"
----

Then you can implement whatever local logic you want to alter the existing .config file, create new default messages (ie. 'rules of posting'), etc.

A simple example could be included in the docs, eg:

----
#!/bin/sh
# newgroup-defaults - Sample newsd 'NewGroup.Script'
groupname = $1
groupdir  = $2

# Always cc the archive, force post limit to 1000
echo 'ccpost news_archive@localhost' >> $groupdir/.config

# Force post limit to 4096
(echo '%s/postlimit.*/postlimit 4096/'; echo wq) | ex $groupdir/.config
----