AW: use_backend: brackets/grouping not accepted in condition

2013-03-22 Thread Christian Ruppert
Hi Baptiste,

it is IMHO not really clear that brackets are for anonymous ACLs only.
Wouldn't it make sense to support it for use_backend as well?
It just makes things easier in my opinion.

Mit freundlichen Grüßen,
Christian Ruppert



Christian Ruppert
Systemadministrator

Babiel GmbH
Erkrather Str. 224 a
D-40233 Düsseldorf

Tel: 0211-179349 0
Fax: 0211-179349 29
E-Mail: c.rupp...@babiel.com
Internet: http://www.babiel.com

Geschäftsführer: Georg Babiel, Dr. Rainer Babiel, Harald Babiel Amtsgericht 
Düsseldorf HRB 38633

~~ DISCLAIMER ~~~

The information transmitted in this electronic mail message may contain 
confidential and or privileged materials. Any review, retransmission, 
dissemination or other use of or taking of any action in reliance upon, this 
information by persons or entities other than the intended recipient is 
prohibited. If you receive such e-mails in error, please contact the sender and 
delete the material from any computer.


 -Ursprüngliche Nachricht-
 Von: Baptiste [mailto:bed...@gmail.com]
 Gesendet: Donnerstag, 21. März 2013 20:00
 An: Christian Ruppert
 Cc: haproxy@formilux.org
 Betreff: Re: use_backend: brackets/grouping not accepted in condition
 
 Hi Christian,
 
 Brackets are for anonymous ACLs only.
 You seem to use named ACLs with brackets so it can't work.
 
 Either you do as you said:
  use_backend backend_test if request_domain1 allowed_ip_foo or
 request_domain1 allowed_ip_bar
 
 Or with 2 use_backend:
  use_backend backend_test if request_domain1 allowed_ip_foo
  use_backend backend_test if request_domain1 allowed_ip_bar
 
 Baptiste
 
 
 
 On Thu, Mar 21, 2013 at 6:25 PM, Christian Ruppert c.rupp...@babiel.com
 wrote:
  Hi Guys,
 
  I just tried to simplify some rules and I noticed that brackets {} doesn't 
  work
 with use_backend  while it works fine with default_backend.
 
  That doesn't work:
  use_backend backend_test if request_domain1 { allowed_ip_foo or
 allowed_ip_bar }
 
  That works:
  use_backend backend_test if request_domain1 allowed_ip_foo or
 request_domain1 allowed_ip_bar
 
  That works as well:
  default_backend backend_main if request_domain2 { allowed_ip_foo or
 allowed_ip_bar }
 
  I could also use multiple use_backend's but using brackets would make it a
 lot easier and better readable IMHO.
 
  https://code.google.com/p/haproxy-docs/wiki/UsingACLs
  That also sounds like the brackets should work almost everywhere.
 
  Some actions are only performed upon a valid condition. A condition is a
  combination of ACLs with operators. 3 operators are supported :
 
- AND (implicit)
- OR  (explicit with the or keyword or the || operator)
- Negation with the exclamation mark (!)
 
  A condition is formed as a disjunctive form:
 
 [!]acl1 [!]acl2 ... [!]acln  { or [!]acl1 [!]acl2 ... [!]acln } ...
 
  Such conditions are generally used after an if or unless statement,
  indicating when the condition will trigger the action.
 
  I would really like to see that fixed. Or is that on purpose?
 
  Mit freundlichen Grüßen,
  Christian Ruppert
 
  
 
  Christian Ruppert
  Systemadministrator
 
  Babiel GmbH
  Erkrather Str. 224 a
  D-40233 Düsseldorf
 
  Tel: 0211-179349 0
  Fax: 0211-179349 29
  E-Mail: c.rupp...@babiel.com
  Internet: http://www.babiel.com
 
  Geschäftsführer: Georg Babiel, Dr. Rainer Babiel, Harald Babiel Amtsgericht
 Düsseldorf HRB 38633
 
  ~~ DISCLAIMER ~~~
 
  The information transmitted in this electronic mail message may contain
 confidential and or privileged materials. Any review, retransmission,
 dissemination or other use of or taking of any action in reliance upon, this
 information by persons or entities other than the intended recipient is
 prohibited. If you receive such e-mails in error, please contact the sender 
 and
 delete the material from any computer.


Re: use_backend: brackets/grouping not accepted in condition

2013-03-22 Thread Bryan Talbot
On Fri, Mar 22, 2013 at 2:47 AM, Christian Ruppert c.rupp...@babiel.comwrote:

 Hi Baptiste,

 it is IMHO not really clear that brackets are for anonymous ACLs only.
 Wouldn't it make sense to support it for use_backend as well?


Those two are not mutually exclusive: you can use them with use_backend and
they are for anonymous acls.

for example:
  use_backend www if METH_POST or {path_beg /static /images /img /css}

-Bryan


AW: use_backend: brackets/grouping not accepted in condition

2013-03-22 Thread Christian Ruppert
Hi Bryan,

 

I am somewhat confused now..

So it sounds like the behavior of the brackets in combination with 
default_backend is wrong since it seems to work fine there even with IP ACLs.

 

And what I meant is, wouldn’t it make sense to support e.g. IP ACLs with either 
{} or () or whatever else to allow one to group the rules instead of writing 
multiple use_backend lines?

For small stuff, like in my example, it would make it slightly “easier”.

 

use_backend if somecondition (foo or bar)

vs.

use_backend if someconditoon foo

use_backend if someconditoon bar

 

Mit freundlichen Grüßen,

Christian Ruppert

 



 

Christian Ruppert

Systemadministrator

 

Babiel GmbH

Erkrather Str. 224 a

D-40233 Düsseldorf

 

Tel: 0211-179349 0

Fax: 0211-179349 29

E-Mail: c.rupp...@babiel.com

Internet: http://www.babiel.com http://www.babiel.com/ 

 

Geschäftsführer: Georg Babiel, Dr. Rainer Babiel, Harald Babiel Amtsgericht 
Düsseldorf HRB 38633

 

~~ DISCLAIMER ~~~

 

The information transmitted in this electronic mail message may contain 
confidential and or privileged materials. Any review, retransmission, 
dissemination or other use of or taking of any action in reliance upon, this 
information by persons or entities other than the intended recipient is 
prohibited. If you receive such e-mails in error, please contact the sender and 
delete the material from any computer.

 

Von: Bryan Talbot [mailto:btal...@aeriagames.com] 
Gesendet: Freitag, 22. März 2013 16:35
An: Christian Ruppert
Cc: Baptiste; HAproxy Mailing Lists
Betreff: Re: use_backend: brackets/grouping not accepted in condition

 

On Fri, Mar 22, 2013 at 2:47 AM, Christian Ruppert c.rupp...@babiel.com wrote:

Hi Baptiste,

it is IMHO not really clear that brackets are for anonymous ACLs only.
Wouldn't it make sense to support it for use_backend as well?

 

 

Those two are not mutually exclusive: you can use them with use_backend and 
they are for anonymous acls.

 

for example: 

  use_backend www if METH_POST or {path_beg /static /images /img /css}

 

-Bryan

 



use_backend: brackets/grouping not accepted in condition

2013-03-21 Thread Christian Ruppert
Hi Guys,

I just tried to simplify some rules and I noticed that brackets {} doesn't work 
with use_backend  while it works fine with default_backend.

That doesn't work:
use_backend backend_test if request_domain1 { allowed_ip_foo or allowed_ip_bar }

That works:
use_backend backend_test if request_domain1 allowed_ip_foo or request_domain1 
allowed_ip_bar

That works as well:
default_backend backend_main if request_domain2 { allowed_ip_foo or 
allowed_ip_bar }

I could also use multiple use_backend's but using brackets would make it a lot 
easier and better readable IMHO.

https://code.google.com/p/haproxy-docs/wiki/UsingACLs
That also sounds like the brackets should work almost everywhere.

Some actions are only performed upon a valid condition. A condition is a
combination of ACLs with operators. 3 operators are supported :

  - AND (implicit)
  - OR  (explicit with the or keyword or the || operator)
  - Negation with the exclamation mark (!)

A condition is formed as a disjunctive form:

   [!]acl1 [!]acl2 ... [!]acln  { or [!]acl1 [!]acl2 ... [!]acln } ...

Such conditions are generally used after an if or unless statement,
indicating when the condition will trigger the action.

I would really like to see that fixed. Or is that on purpose?

Mit freundlichen Grüßen,
Christian Ruppert



Christian Ruppert
Systemadministrator

Babiel GmbH
Erkrather Str. 224 a
D-40233 Düsseldorf

Tel: 0211-179349 0
Fax: 0211-179349 29
E-Mail: c.rupp...@babiel.com
Internet: http://www.babiel.com

Geschäftsführer: Georg Babiel, Dr. Rainer Babiel, Harald Babiel Amtsgericht 
Düsseldorf HRB 38633

~~ DISCLAIMER ~~~

The information transmitted in this electronic mail message may contain 
confidential and or privileged materials. Any review, retransmission, 
dissemination or other use of or taking of any action in reliance upon, this 
information by persons or entities other than the intended recipient is 
prohibited. If you receive such e-mails in error, please contact the sender and 
delete the material from any computer.


Re: use_backend: brackets/grouping not accepted in condition

2013-03-21 Thread Baptiste
Hi Christian,

Brackets are for anonymous ACLs only.
You seem to use named ACLs with brackets so it can't work.

Either you do as you said:
 use_backend backend_test if request_domain1 allowed_ip_foo or
request_domain1 allowed_ip_bar

Or with 2 use_backend:
 use_backend backend_test if request_domain1 allowed_ip_foo
 use_backend backend_test if request_domain1 allowed_ip_bar

Baptiste



On Thu, Mar 21, 2013 at 6:25 PM, Christian Ruppert c.rupp...@babiel.com wrote:
 Hi Guys,

 I just tried to simplify some rules and I noticed that brackets {} doesn't 
 work with use_backend  while it works fine with default_backend.

 That doesn't work:
 use_backend backend_test if request_domain1 { allowed_ip_foo or 
 allowed_ip_bar }

 That works:
 use_backend backend_test if request_domain1 allowed_ip_foo or request_domain1 
 allowed_ip_bar

 That works as well:
 default_backend backend_main if request_domain2 { allowed_ip_foo or 
 allowed_ip_bar }

 I could also use multiple use_backend's but using brackets would make it a 
 lot easier and better readable IMHO.

 https://code.google.com/p/haproxy-docs/wiki/UsingACLs
 That also sounds like the brackets should work almost everywhere.

 Some actions are only performed upon a valid condition. A condition is a
 combination of ACLs with operators. 3 operators are supported :

   - AND (implicit)
   - OR  (explicit with the or keyword or the || operator)
   - Negation with the exclamation mark (!)

 A condition is formed as a disjunctive form:

[!]acl1 [!]acl2 ... [!]acln  { or [!]acl1 [!]acl2 ... [!]acln } ...

 Such conditions are generally used after an if or unless statement,
 indicating when the condition will trigger the action.

 I would really like to see that fixed. Or is that on purpose?

 Mit freundlichen Grüßen,
 Christian Ruppert

 

 Christian Ruppert
 Systemadministrator

 Babiel GmbH
 Erkrather Str. 224 a
 D-40233 Düsseldorf

 Tel: 0211-179349 0
 Fax: 0211-179349 29
 E-Mail: c.rupp...@babiel.com
 Internet: http://www.babiel.com

 Geschäftsführer: Georg Babiel, Dr. Rainer Babiel, Harald Babiel Amtsgericht 
 Düsseldorf HRB 38633

 ~~ DISCLAIMER ~~~

 The information transmitted in this electronic mail message may contain 
 confidential and or privileged materials. Any review, retransmission, 
 dissemination or other use of or taking of any action in reliance upon, this 
 information by persons or entities other than the intended recipient is 
 prohibited. If you receive such e-mails in error, please contact the sender 
 and delete the material from any computer.