Re: 'include' directive in squid-2.HEAD

2008-01-09 Thread Amos Jeffries

Amos Jeffries wrote:

Adrian Chadd wrote:

On Wed, Jan 09, 2008, Amos Jeffries wrote:

Precisely, the goal I'm vectoring in from is a basic squid.conf 
installed as currently done.
And also providing an online community-developed library of 
relatively self-complete include files to perform certain common or 
tricky actions.


Rather than installing any splits in the default install.


Hey I don't care how we split things in the default install, except:

* The squid.conf installed by default is insanely huge and should be 
trimmed

  right back, and
* We do -something- about it..



First steps can already be taken:

1) bundle cfgman with releases.
  ** someone very familiar with the snapshot and release scripts needs 
to do that. I tried it and got it wrong here before xmas.


Just going back to that. It looks simple, but could someone who knows it 
well even just add comments to it please?


Amos



2) drop cfgman comments from squid.conf.default
  ** any of us could do that *after* the above to by removing the 
comment print from get_conf() in cf_gen.cc


That alone drops squid.conf to around 4KB IIRC.

Amos



--
Please use Squid 2.6STABLE17 or 3.0STABLE1.
There are serious security advisories out on all earlier releases.



Re: 'include' directive in squid-2.HEAD

2008-01-09 Thread Amos Jeffries

Adrian Chadd wrote:

On Wed, Jan 09, 2008, Amos Jeffries wrote:

Precisely, the goal I'm vectoring in from is a basic squid.conf 
installed as currently done.
And also providing an online community-developed library of relatively 
self-complete include files to perform certain common or tricky actions.


Rather than installing any splits in the default install.


Hey I don't care how we split things in the default install, except:

* The squid.conf installed by default is insanely huge and should be trimmed
  right back, and
* We do -something- about it..



First steps can already be taken:

1) bundle cfgman with releases.
  ** someone very familiar with the snapshot and release scripts needs 
to do that. I tried it and got it wrong here before xmas.


2) drop cfgman comments from squid.conf.default
  ** any of us could do that *after* the above to by removing the 
comment print from get_conf() in cf_gen.cc


That alone drops squid.conf to around 4KB IIRC.

Amos
--
Please use Squid 2.6STABLE17 or 3.0STABLE1.
There are serious security advisories out on all earlier releases.


Re: 'include' directive in squid-2.HEAD

2008-01-09 Thread Adrian Chadd
On Wed, Jan 09, 2008, Amos Jeffries wrote:

> Precisely, the goal I'm vectoring in from is a basic squid.conf 
> installed as currently done.
> And also providing an online community-developed library of relatively 
> self-complete include files to perform certain common or tricky actions.
> 
> Rather than installing any splits in the default install.

Hey I don't care how we split things in the default install, except:

* The squid.conf installed by default is insanely huge and should be trimmed
  right back, and
* We do -something- about it..



Adrian

-- 
- Xenion - http://www.xenion.com.au/ - VPS Hosting - Commercial Squid Support -
- $25/pm entry-level VPSes w/ capped bandwidth charges available in WA -


Re: 'include' directive in squid-2.HEAD

2008-01-08 Thread Amos Jeffries

Henrik Nordström wrote:

tis 2008-01-08 klockan 00:47 +0900 skrev Adrian Chadd:


My next trick will be breaking up cf.data.pre along the documentation
boundary lines and have seperate configuration file chunks for various
tasks.


cf.data.pre should be split in one file per directive, using the
existing scripts.

the default suqid.conf should be just the config part, not the
documentation. Can be generated from cf.data.pre quite easily. Some
comments may need to be added for it to make sense but not much.

the documentation should be installed separately.

and yes, having include support is nice. But squid.conf rarely gets that
big that it makes a big difference.

It's not easy to provide a default split as many things are dependent,
and having it split by default may cause people to think that it must be
split along those lines.. personally I always order things quite
differently with most acls defined next to where they are used, with
only generic acls elsewhere.


Precisely, the goal I'm vectoring in from is a basic squid.conf 
installed as currently done.
And also providing an online community-developed library of relatively 
self-complete include files to perform certain common or tricky actions.


Rather than installing any splits in the default install.

Amos
--
Please use Squid 2.6STABLE17 or 3.0STABLE1.
There are serious security advisories out on all earlier releases.



Re: 'include' directive in squid-2.HEAD

2008-01-08 Thread Henrik Nordström

tis 2008-01-08 klockan 00:47 +0900 skrev Adrian Chadd:

> My next trick will be breaking up cf.data.pre along the documentation
> boundary lines and have seperate configuration file chunks for various
> tasks.

cf.data.pre should be split in one file per directive, using the
existing scripts.

the default suqid.conf should be just the config part, not the
documentation. Can be generated from cf.data.pre quite easily. Some
comments may need to be added for it to make sense but not much.

the documentation should be installed separately.

and yes, having include support is nice. But squid.conf rarely gets that
big that it makes a big difference.

It's not easy to provide a default split as many things are dependent,
and having it split by default may cause people to think that it must be
split along those lines.. personally I always order things quite
differently with most acls defined next to where they are used, with
only generic acls elsewhere.

Regards
Henrik



signature.asc
Description: Detta är en digitalt signerad	meddelandedel


Re: 'include' directive in squid-2.HEAD

2008-01-07 Thread Adrian Chadd
On Tue, Jan 08, 2008, Robert Collins wrote:

> > I looked at this for 3.1, but the config parser there confused me with 
> > its multiple meanings of 'file'.
> > I'd definately like to see how you are doing it in 2 for a side-port.
> 
> I implemented one about 5 years back. Now where did I put it  it's
> not in my local arch repo; it may be on devel.

It really wasn't hard:

* break out parseConfigFile() into two parts, one that parsed a file, one
  that did the extra stuff (set defaults, call parseOneConfigFile(squid.conf);
  check error counts, finalise the cnfig.)
* parseOneConfigFile() does the line/config parsing, and handles calling itself
  for files referenced via "include".
* there's a pair of globals used for config file and line numbers - shows up in
  acl.c mainly - so make sure you save and restore these each pass through
  parseOneConfigFile().

(Wow, I finally had a chance to write recursive code in Squid..)




Adrian



Re: 'include' directive in squid-2.HEAD

2008-01-07 Thread Robert Collins

On Tue, 2008-01-08 at 16:33 +1300, Amos Jeffries wrote:
> Adrian Chadd wrote:
> > On Tue, Jan 08, 2008, Mark Nottingham wrote:
> >> +1, and in 2.7 ASAP; I've already implemented this in my own hacky way  
> >> (external to squid); would be nice to have 'real' includes.
> > 
> > Well, test it out, make sure broken things like ACL lines give the right
> > source file and line number, and let me know if it works out.
> > 
> > 2.7 is meant to be a stable release, and although I'm hesitant to suggest
> > including this in 2.7 I think its a good idea and, if it does the right
> > thing, will only benefit users.
> 
> I looked at this for 3.1, but the config parser there confused me with 
> its multiple meanings of 'file'.
> I'd definately like to see how you are doing it in 2 for a side-port.

I implemented one about 5 years back. Now where did I put it  it's
not in my local arch repo; it may be on devel.

-Rob
-- 
GPG key available at: .


signature.asc
Description: This is a digitally signed message part


Re: 'include' directive in squid-2.HEAD

2008-01-07 Thread Adrian Chadd
On Tue, Jan 08, 2008, Amos Jeffries wrote:

> I looked at this for 3.1, but the config parser there confused me with 
> its multiple meanings of 'file'.
> I'd definately like to see how you are doing it in 2 for a side-port.

Well, its in the tree. :)

> FWIW; I believe we should with 3.1 and 2.7 be shipping the cfgman pages 
> as the docs instead of squid.conf.default.
> Thats just a re-ordering of the release script to build them into 
> docs/cfgman before bundling.

Yeah. I think its a bit late in the game to be doing that for squid-2.7
(unless someone can do it right now!) but I really want to see a cleaner
default configuration file breakdown in Squid-2.8, including a default
"local" acl example.



Adrian



Re: 'include' directive in squid-2.HEAD

2008-01-07 Thread Amos Jeffries

Adrian Chadd wrote:

On Tue, Jan 08, 2008, Mark Nottingham wrote:
+1, and in 2.7 ASAP; I've already implemented this in my own hacky way  
(external to squid); would be nice to have 'real' includes.


Well, test it out, make sure broken things like ACL lines give the right
source file and line number, and let me know if it works out.

2.7 is meant to be a stable release, and although I'm hesitant to suggest
including this in 2.7 I think its a good idea and, if it does the right
thing, will only benefit users.


I looked at this for 3.1, but the config parser there confused me with 
its multiple meanings of 'file'.

I'd definately like to see how you are doing it in 2 for a side-port.

FWIW; I believe we should with 3.1 and 2.7 be shipping the cfgman pages 
as the docs instead of squid.conf.default.
Thats just a re-ordering of the release script to build them into 
docs/cfgman before bundling.


Amos
--
Please use Squid 2.6STABLE17 or 3.0STABLE1.
There are serious security advisories out on all earlier releases.



Re: 'include' directive in squid-2.HEAD

2008-01-07 Thread Adrian Chadd
On Tue, Jan 08, 2008, Mark Nottingham wrote:
> +1, and in 2.7 ASAP; I've already implemented this in my own hacky way  
> (external to squid); would be nice to have 'real' includes.

Well, test it out, make sure broken things like ACL lines give the right
source file and line number, and let me know if it works out.

2.7 is meant to be a stable release, and although I'm hesitant to suggest
including this in 2.7 I think its a good idea and, if it does the right
thing, will only benefit users.




Adrian



Re: 'include' directive in squid-2.HEAD

2008-01-07 Thread Mark Nottingham
+1, and in 2.7 ASAP; I've already implemented this in my own hacky way  
(external to squid); would be nice to have 'real' includes.



On 08/01/2008, at 2:47 AM, Adrian Chadd wrote:

I gave in and coded up a very, very simplistic and naive  
implementation

for "include". You can now include configuration file snippets from
squid.conf, or any included config file.

My next trick will be breaking up cf.data.pre along the documentation
boundary lines and have seperate configuration file chunks for various
tasks. Something like:

squid.conf
 - squid.conf.auth
 - squid.conf.acl
 - squid.conf.cache
 - squid.conf.http
 - squid.conf.ftp
 - squid.conf.peer
 - squid.conf.htcp
 - squid.conf.icp
 - squid.conf.digests
 - squid.conf.misc

I'd also really, really like to generate these files without any
inline comments, leaving the inline comments for squid.conf.default.
I'm sorry, but that enormous config file is a horrible, horrible thing
for first timers to look at. I always suggest this:

cat squid.conf | grep -v ^# | grep -v ^$ > squid.conf

.. and I think we should ship the default config files looking  
somewhat

similar.

Unless there are reasoned objections I'll:

* be porting the include thing to squid-2.7, as I believe its a non- 
intrusive

 change that people who will upgrade to 2.7 will benefit from;
* look at breaking out cf.data.pre into something resembling the  
above for
 new installs in Squid-2.HEAD at some point in the future (read:  
when I next

 need a distraction from my other squid-2 related butchery.)




Adrian



--
Mark Nottingham   [EMAIL PROTECTED]