You are viewing a plain text version of this content. The canonical link for it is here.
Posted to rivet-dev@tcl.apache.org by Massimo Manghi <ma...@biol.unipr.it> on 2003/02/20 17:55:27 UTC
rivet initialization directives
Dear developers
I was introduced to Rivet by David Welton and
I've been playing around with it for a while now.
(My intention is to use it to build a web based
administration tool for the network of my department)
I found something that it seems it doesn't match the
documentation and something else that behaves in
a weird way.
I tried to understand how to use the three classes
of directives (User, Dir and Server) we can declare
in the configuration files. I restricted my tests to
the [Before|After|Error]Script definitions which
are those of interest to me by now.
1) First of all the directives work as if in a hierarchy:
i mean that RivetServerConf is overridden by RivetUserConf
which in turn can be overridden by RivetDirConf.
I found no mention of this fact in the manual and I
think it would be worth of being noticed.
(it seems to me that the rationale behind this fact
is correct)
2) I have been able to specify values for RivetDirConf in
a <Directory ...> structure in httpd.conf but when i moved
those definition in .htaccess (as stated by the manual)
apache ran in a Internal Server Error. The error log had
this line printed
[Mon Feb 17 16:49:08 2003] [alert] [client 127.0.0.1]
/home/manghi/www/dbefnet/.htaccess: RivetDirConf not allowed here
which seems to explicitly disagree with the manual
3) The last thing might be connected to the caching
system. Consider the case when in httpd.conf you have
RivetServerConf BeforeScript "source <some script>"
RivetServerConf AfterScript "source <some other script>"
as i said when i put in .htaccess these lines
RivetUserConf BeforeScript "source <some local script>"
RivetUserConf AfterScript "source <some other local script>"
the latter procedures get run each time i access one
of the pages in the directory where .htaccess is created.
Then i removed the .htaccess file altoghether and reloaded
the page: the local procedures are still run
until i restart completly apache (I think this is
fundamentally bad and maybe even wrong in a multiuser
environment)
thank you for your attention.
-- Massimo Manghi
---------------------------------------------------------------------
To unsubscribe, e-mail: rivet-dev-unsubscribe@tcl.apache.org
For additional commands, e-mail: rivet-dev-help@tcl.apache.org
Re: rivet initialization directives
Posted by "David N. Welton" <da...@dedasys.com>.
davidw@dedasys.com (David N. Welton) writes:
> I'll go ahead and make the changes I mentioned.
Done.
--
David N. Welton
Consulting: http://www.dedasys.com/
Personal: http://www.dedasys.com/davidw/
Free Software: http://www.dedasys.com/freesoftware/
Apache Tcl: http://tcl.apache.org/
---------------------------------------------------------------------
To unsubscribe, e-mail: rivet-dev-unsubscribe@tcl.apache.org
For additional commands, e-mail: rivet-dev-help@tcl.apache.org
Re: rivet initialization directives
Posted by "David N. Welton" <da...@dedasys.com>.
Damon Courtney <da...@your.unreality.com> writes:
> > What a mess:-)
>
> We just need to scrap all this shit and use a Tcl-level
> configuration. 0-]
I think I mentioned that before, but... the consensus was that we've
worked hard to make things work with the apache system. I don't know
how we would do stuff like .htaccess files in pure Tcl in any case.
I'll go ahead and make the changes I mentioned.
--
David N. Welton
Consulting: http://www.dedasys.com/
Personal: http://www.dedasys.com/davidw/
Free Software: http://www.dedasys.com/freesoftware/
Apache Tcl: http://tcl.apache.org/
---------------------------------------------------------------------
To unsubscribe, e-mail: rivet-dev-unsubscribe@tcl.apache.org
For additional commands, e-mail: rivet-dev-help@tcl.apache.org
Re: rivet initialization directives
Posted by Damon Courtney <da...@your.unreality.com>.
> Good enough for me. I have implemented it this way. I also made one
> other important change, to fix the bug Massimo reported: byte code
> cacheing is invalidated if UserConf scripts have been changed.
>
> I want to do something else, but I thought I'd bounce it here first:
>
> Rivet_AppendToScript shouldn't append, in the case of
> Before/After/Error scripts. Which means that it really ought to have
> a more descriptive name.
>
> Untill we do this, DirConf will still append the scripts...
>
> What a mess:-)
We just need to scrap all this shit and use a Tcl-level configuration. 0-]
D
---------------------------------------------------------------------
To unsubscribe, e-mail: rivet-dev-unsubscribe@tcl.apache.org
For additional commands, e-mail: rivet-dev-help@tcl.apache.org
Re: rivet initialization directives
Posted by "David N. Welton" <da...@dedasys.com>.
Damon Courtney <da...@your.unreality.com> writes:
> As I envision it, each directive lower in the heirarchy
> overrides the higher directive. BeforeScript as a User directive
> will override Dir and Server directives. Is this not the behavior
> we're looking for?
Good enough for me. I have implemented it this way. I also made one
other important change, to fix the bug Massimo reported: byte code
cacheing is invalidated if UserConf scripts have been changed.
I want to do something else, but I thought I'd bounce it here first:
Rivet_AppendToScript shouldn't append, in the case of
Before/After/Error scripts. Which means that it really ought to have
a more descriptive name.
Untill we do this, DirConf will still append the scripts...
What a mess:-)
--
David N. Welton
Consulting: http://www.dedasys.com/
Personal: http://www.dedasys.com/davidw/
Free Software: http://www.dedasys.com/freesoftware/
Apache Tcl: http://tcl.apache.org/
---------------------------------------------------------------------
To unsubscribe, e-mail: rivet-dev-unsubscribe@tcl.apache.org
For additional commands, e-mail: rivet-dev-help@tcl.apache.org
Re: rivet initialization directives
Posted by "David N. Welton" <da...@dedasys.com>.
Damon Courtney <da...@your.unreality.com> writes:
> > I guess the user can get out of this one, so using Before/After
> > scripts isn't going to be of much use in any case... Let's just
> > make the override, shall we?
> > I would like to be able to find a way to do environments where
> > users don't necessarily trust one another. Time to start
> > experimenting with the Interp commands, although it's a pity it's
> > not scriptable.
> NeoWebScript handled all of this beautifully. That's where we
> need to start looking. I've already given quite a bit of thought to
> all of this, and it'll be some work, but I know it's possible. I
> still use NWS in some places simply because I am working with an
> untrusted userbase. 0-]
I'm thinking that getting this right could give us a leg up on
tclhttpd and aolserver, at least in that department. I really want to
retire NWS and mod_dtcl off the web page, too... We need more focus as
'apache/tcl'.
--
David N. Welton
Consulting: http://www.dedasys.com/
Personal: http://www.dedasys.com/davidw/
Free Software: http://www.dedasys.com/freesoftware/
Apache Tcl: http://tcl.apache.org/
---------------------------------------------------------------------
To unsubscribe, e-mail: rivet-dev-unsubscribe@tcl.apache.org
For additional commands, e-mail: rivet-dev-help@tcl.apache.org
Re: rivet initialization directives
Posted by Damon Courtney <da...@your.unreality.com>.
> I guess the user can get out of this one, so using Before/After
> scripts isn't going to be of much use in any case... Let's just make
> the override, shall we?
>
> I would like to be able to find a way to do environments where users
> don't necessarily trust one another. Time to start experimenting with
> the Interp commands, although it's a pity it's not scriptable.
NeoWebScript handled all of this beautifully. That's where we need
to start looking. I've already given quite a bit of thought to all of
this, and it'll be some work, but I know it's possible. I still use
NWS in some places simply because I am working with an untrusted userbase.
0-]
D
---------------------------------------------------------------------
To unsubscribe, e-mail: rivet-dev-unsubscribe@tcl.apache.org
For additional commands, e-mail: rivet-dev-help@tcl.apache.org
Re: rivet initialization directives
Posted by "David N. Welton" <da...@dedasys.com>.
davidw@dedasys.com (David N. Welton) writes:
> Ick, I vote no on that:-) I don't like special characters like that.
> If anything, maybe an optional fourth component to the
> directive....?
> RivetUserConf BeforeScript "tcl script" OverRide
> I don't know... this stuff is already nasty enough:-/
Basically... I think the decision we need to make is
1) Is it possible to 'contain' user code with BeforeScript and
AfterScript using something like this:
set pageinterp [interp create]
interp eval $pageinterp {
... user page ...
}
interp delete $pageinterp
I guess the user can get out of this one, so using Before/After
scripts isn't going to be of much use in any case... Let's just make
the override, shall we?
I would like to be able to find a way to do environments where users
don't necessarily trust one another. Time to start experimenting with
the Interp commands, although it's a pity it's not scriptable.
--
David N. Welton
Consulting: http://www.dedasys.com/
Personal: http://www.dedasys.com/davidw/
Free Software: http://www.dedasys.com/freesoftware/
Apache Tcl: http://tcl.apache.org/
---------------------------------------------------------------------
To unsubscribe, e-mail: rivet-dev-unsubscribe@tcl.apache.org
For additional commands, e-mail: rivet-dev-help@tcl.apache.org
Re: rivet initialization directives
Posted by "David N. Welton" <da...@dedasys.com>.
Damon Courtney <da...@your.unreality.com> writes:
> > Either way works ok for me, although I wish people using, or
> > considering Rivet would speak up so that we can write what you
> > want.
> > I guess we could always make a global directive that changes the
> > behaviour, but it's complicated enough as things stand right now,
> > I think.
> We could do something similar to the bind behavior and do something like:
> RivetUserConf BeforeScript "puts foo"
> This would overwrite any higher-level script.
> RivetUserConf BeforeScript "+puts foo"
> Would append to any higher level script.
> *shrug* I think that works pretty well for me. 0-]
Ick, I vote no on that:-) I don't like special characters like that.
If anything, maybe an optional fourth component to the directive....?
RivetUserConf BeforeScript "tcl script" OverRide
I don't know... this stuff is already nasty enough:-/
--
David N. Welton
Consulting: http://www.dedasys.com/
Personal: http://www.dedasys.com/davidw/
Free Software: http://www.dedasys.com/freesoftware/
Apache Tcl: http://tcl.apache.org/
---------------------------------------------------------------------
To unsubscribe, e-mail: rivet-dev-unsubscribe@tcl.apache.org
For additional commands, e-mail: rivet-dev-help@tcl.apache.org
Re: rivet initialization directives
Posted by Damon Courtney <da...@your.unreality.com>.
> Either way works ok for me, although I wish people using, or
> considering Rivet would speak up so that we can write what you want.
>
> I guess we could always make a global directive that changes the
> behaviour, but it's complicated enough as things stand right now, I
> think.
We could do something similar to the bind behavior and do something like:
RivetUserConf BeforeScript "puts foo"
This would overwrite any higher-level script.
RivetUserConf BeforeScript "+puts foo"
Would append to any higher level script.
*shrug* I think that works pretty well for me. 0-]
D
---------------------------------------------------------------------
To unsubscribe, e-mail: rivet-dev-unsubscribe@tcl.apache.org
For additional commands, e-mail: rivet-dev-help@tcl.apache.org
Re: rivet initialization directives
Posted by "David N. Welton" <da...@dedasys.com>.
Damon Courtney <da...@your.unreality.com> writes:
> > This seems to work, although I still need to add something that
> > forces a reload of the file if an .htaccess has been parsed.
> > While working with this, though... I'm wondering if .htaccess
> > BeforeScripts and AfterScripts should replace or be run 'inside'
> > (after and before) the Server and Dir scripts. This would provide
> > a global way to make sure that something is happening. The
> > default right now is that .htaccess completely overrides.
> > Hrm. I guess I could see it both ways - if it's a multi-user
> > installation, it would be nice to be able to specify some things
> > that happen, regardless of what the user does. On the other hand,
> > if you're creating a site, it might be nice to be able to override
> > global settings completely on a per-directory basis.
> > Thoughts? Votes?
> Well, what's the general consensus? How do we want this to work?
> As I envision it, each directive lower in the heirarchy
> overrides the higher directive. BeforeScript as a User directive
> will override Dir and Server directives. Is this not the behavior
> we're looking for?
> How would we want it to work otherwise?
The only reason I could see for it to work otherwise was if the site
admin wanted to lock people into having certain header/footers, so
that the hierarchy would look something like this:
global_site_script {
local_user_script {
page_stuff ...
}
}
Either way works ok for me, although I wish people using, or
considering Rivet would speak up so that we can write what you want.
I guess we could always make a global directive that changes the
behaviour, but it's complicated enough as things stand right now, I
think.
--
David N. Welton
Consulting: http://www.dedasys.com/
Personal: http://www.dedasys.com/davidw/
Free Software: http://www.dedasys.com/freesoftware/
Apache Tcl: http://tcl.apache.org/
---------------------------------------------------------------------
To unsubscribe, e-mail: rivet-dev-unsubscribe@tcl.apache.org
For additional commands, e-mail: rivet-dev-help@tcl.apache.org
Re: rivet initialization directives
Posted by Damon Courtney <da...@your.unreality.com>.
> This seems to work, although I still need to add something that forces
> a reload of the file if an .htaccess has been parsed.
>
> While working with this, though... I'm wondering if .htaccess
> BeforeScripts and AfterScripts should replace or be run 'inside'
> (after and before) the Server and Dir scripts. This would provide a
> global way to make sure that something is happening. The default
> right now is that .htaccess completely overrides.
>
> Hrm. I guess I could see it both ways - if it's a multi-user
> installation, it would be nice to be able to specify some things that
> happen, regardless of what the user does. On the other hand, if
> you're creating a site, it might be nice to be able to override global
> settings completely on a per-directory basis.
>
> Thoughts? Votes?
Well, what's the general consensus? How do we want this to work?
As I envision it, each directive lower in the heirarchy overrides
the higher directive. BeforeScript as a User directive will override
Dir and Server directives. Is this not the behavior we're looking for?
How would we want it to work otherwise?
Damon
---------------------------------------------------------------------
To unsubscribe, e-mail: rivet-dev-unsubscribe@tcl.apache.org
For additional commands, e-mail: rivet-dev-help@tcl.apache.org
Re: rivet initialization directives
Posted by "David N. Welton" <da...@dedasys.com>.
davidw@dedasys.com (David N. Welton) writes:
> I'm still not sure about the best answer. Maybe for UserConfig
> scripts, they should not be stored in the same place as the
> DirConfig and ServerConfig scripts. If they're in a seperate place,
> they can be checked and used as needs be 'at run time' so to speak.
> This means that they will also correctly dissappear depending on the
> .htaccess file.
This seems to work, although I still need to add something that forces
a reload of the file if an .htaccess has been parsed.
While working with this, though... I'm wondering if .htaccess
BeforeScripts and AfterScripts should replace or be run 'inside'
(after and before) the Server and Dir scripts. This would provide a
global way to make sure that something is happening. The default
right now is that .htaccess completely overrides.
Hrm. I guess I could see it both ways - if it's a multi-user
installation, it would be nice to be able to specify some things that
happen, regardless of what the user does. On the other hand, if
you're creating a site, it might be nice to be able to override global
settings completely on a per-directory basis.
Thoughts? Votes?
--
David N. Welton
Consulting: http://www.dedasys.com/
Personal: http://www.dedasys.com/davidw/
Free Software: http://www.dedasys.com/freesoftware/
Apache Tcl: http://tcl.apache.org/
---------------------------------------------------------------------
To unsubscribe, e-mail: rivet-dev-unsubscribe@tcl.apache.org
For additional commands, e-mail: rivet-dev-help@tcl.apache.org
Re: rivet initialization directives
Posted by "David N. Welton" <da...@dedasys.com>.
Ok, we now have a test case in the test suite (config.test to be
specific) to check for this problem.
I'm still not sure about the best answer. Maybe for UserConfig
scripts, they should not be stored in the same place as the DirConfig
and ServerConfig scripts. If they're in a seperate place, they can be
checked and used as needs be 'at run time' so to speak. This means
that they will also correctly dissappear depending on the .htaccess
file.
--
David N. Welton
Consulting: http://www.dedasys.com/
Personal: http://www.dedasys.com/davidw/
Free Software: http://www.dedasys.com/freesoftware/
Apache Tcl: http://tcl.apache.org/
---------------------------------------------------------------------
To unsubscribe, e-mail: rivet-dev-unsubscribe@tcl.apache.org
For additional commands, e-mail: rivet-dev-help@tcl.apache.org
Re: rivet initialization directives
Posted by Massimo Manghi <ma...@biol.unipr.it>.
David N. Welton wrote:
>>1) First of all the directives work as if in a hierarchy: i mean
>>that RivetServerConf is overridden by RivetUserConf which in turn
>>can be overridden by RivetDirConf. I found no mention of this fact
>>in the manual and I think it would be worth of being noticed. (it
>>seems to me that the rationale behind this fact is correct)
>>
>>
>
>Ok, I have included this in the docs - just out of curiousity, how did
>you test this?
>
>
This is a good point: in fact I didn't test if the way they override
each other depends on the order you
phase in the directives. It turned out that RivetUserConf overrides
RivetDirConf if an
.htaccess file is created after the RivetDirConf lines are inserted in
httpd.conf and apache restarted.
>[...]
>
>
-- Massimo
---------------------------------------------------------------------
To unsubscribe, e-mail: rivet-dev-unsubscribe@tcl.apache.org
For additional commands, e-mail: rivet-dev-help@tcl.apache.org
Re: rivet initialization directives
Posted by "David N. Welton" <da...@dedasys.com>.
Massimo Manghi <ma...@biol.unipr.it> writes:
> I was introduced to Rivet by David Welton and I've been playing
> around with it for a while now. (My intention is to use it to build
> a web based administration tool for the network of my department)
> I found something that it seems it doesn't match the documentation
> and something else that behaves in a weird way.
> I tried to understand how to use the three classes of directives
> (User, Dir and Server) we can declare in the configuration files. I
> restricted my tests to the [Before|After|Error]Script definitions
> which are those of interest to me by now.
> 1) First of all the directives work as if in a hierarchy: i mean
> that RivetServerConf is overridden by RivetUserConf which in turn
> can be overridden by RivetDirConf. I found no mention of this fact
> in the manual and I think it would be worth of being noticed. (it
> seems to me that the rationale behind this fact is correct)
Ok, I have included this in the docs - just out of curiousity, how did
you test this?
> 2) I have been able to specify values for RivetDirConf in a
> <Directory ...> structure in httpd.conf but when i moved those
> definition in .htaccess (as stated by the manual) apache ran in a
> Internal Server Error. The error log had this line printed
> [Mon Feb 17 16:49:08 2003] [alert] [client 127.0.0.1]
> /home/manghi/www/dbefnet/.htaccess: RivetDirConf not allowed here
> which seems to explicitly disagree with the manual
Right. Changed.
So far, so good:-)
> 3) The last thing might be connected to the caching system. Consider
> the case when in httpd.conf you have
> RivetServerConf BeforeScript "source <some script>"
> RivetServerConf AfterScript "source <some other script>"
> as i said when i put in .htaccess these lines
> RivetUserConf BeforeScript "source <some local script>"
> RivetUserConf AfterScript "source <some other local script>"
> the latter procedures get run each time i access one of the pages in
> the directory where .htaccess is created. Then i removed the
> .htaccess file altoghether and reloaded the page: the local
> procedures are still run until i restart completly apache (I think
> this is fundamentally bad and maybe even wrong in a multiuser
> environment)
You are right again, but this one is more complicated. I'll have to
think about it. The problem is not related to caching per se, but due
to the fact that once it gets set, its absence isn't unsetting it. I
hate the config directives... they are no end of trouble:-)
Damon, you have any brilliant ideas on this one? I'll have to do some
looking around at what other systems that use .htaccess do.
--
David N. Welton
Consulting: http://www.dedasys.com/
Personal: http://www.dedasys.com/davidw/
Free Software: http://www.dedasys.com/freesoftware/
Apache Tcl: http://tcl.apache.org/
---------------------------------------------------------------------
To unsubscribe, e-mail: rivet-dev-unsubscribe@tcl.apache.org
For additional commands, e-mail: rivet-dev-help@tcl.apache.org