[HTTPS-Everywhere] <target host="example.com" />

Seth David Schoen schoen at eff.org
Wed Nov 3 17:00:53 PDT 2010


As part of a development effort to make HTTPS Everywhere scale
properly (so that we can ship the 253 pending rules as part of
the default install!), we are adding a mandatory new feature to
the rule syntax.  In the future, every ruleset must contain
at least one "target" tag.  "target" is similar to "match_rule"
but (1) it is mandatory, and (2) it does _not_ use regular
expression syntax.

Here is an example ruleset for example.com which would match
against www.example.com or example.com.

<ruleset name="Example">
  <target host="www.example.com" />
  <target host="example.com" />

  <rule from="^http://(www\.)?example\.com/" to="http://www.example.com/" />
</ruleset>

Each target can also contain at most one asterisk as a wildcard which
matches a single part of a domain.

<ruleset name="Example 2">
  <target host="*.example.org" />
  <target host="example.org" />

  <rule from="^http://example\.org/" to="http://www.example.org/" />
  <rule from="^http://([^/:@]*)\.example\.org/" to="http://$1.example.org/" />
</ruleset>


<ruleset name="Example Intl.">
  <target host="www.example.org.*" />
  <target host="example.org.*" />

  <rule from="^http://(www\.)?example\.org\.([^/:@])*/" to="http://www.example.org.$2/" />
</ruleset>

The master branch has two simple shell scripts in the pending-rules
directly.  One is called make-trivial-rule, and it creates a naive
rewrite rule for example.com and www.example.com to their HTTPS
versions.  The other is called trivial-validate, and it looks at
all the XML files in the current directory to find those that fail
some simple validity checks.  Both of them have just been updated
to reflect the new target tag.

All of the current rules fail the check for presence of the target
tag. :-)  But I'll fix them...

I suspect match_rule will be removed in the future in favor of
target.

-- 
Seth Schoen
Senior Staff Technologist                         schoen at eff.org
Electronic Frontier Foundation                    https://www.eff.org/
454 Shotwell Street, San Francisco, CA  94110     +1 415 436 9333 x107



More information about the HTTPS-everywhere mailing list