Skip to content

Commit 166d559

Browse files
author
MB
committed
Merge branch 'master' of github.com:EFForg/HTTPS-Everywhere
2 parents 05cdc28 + d75d15c commit 166d559

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

43 files changed

+640
-130
lines changed

makecrx.sh

Lines changed: 13 additions & 57 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,9 @@
1818
# "dummy-chromium.pem" private key for you to sign your own local releases,
1919
# but these .crx files won't detect and upgrade to official HTTPS Everywhere
2020
# releases signed by EFF :/. We should find a more elegant arrangement.
21+
22+
cd $(dirname $0)
23+
RULESETS_UNVALIDATED="$PWD/pkg/rulesets.unvalidated.sqlite"
2124
RULESETS_SQLITE="$PWD/src/defaults/rulesets.sqlite"
2225

2326
if [ -n "$1" ]; then
@@ -37,67 +40,20 @@ VERSION=`python -c "import json ; print(json.loads(open('chromium/manifest.json'
3740

3841
echo "Building chrome version" $VERSION
3942

40-
# Build the SQLite DB even though we don't yet use it in the Chrome extension,
41-
# because trivial-validate.py depends on it.
42-
if [ "$1" != "--fast" -o ! -f "$RULESETS_SQLITE" ] ; then
43+
# Only generate the sqlite database if any rulesets have changed. Tried
44+
# implementing this with make, but make is very slow with 15k+ input files.
45+
needs_update() {
46+
find src/chrome/content/rules/ -newer $RULESETS_UNVALIDATED |\
47+
grep -q .
48+
}
49+
if [ ! -f "$RULESETS_UNVALIDATED" ] || needs_update ; then
50+
# Build the SQLite DB even though we don't yet use it in the Chrome extension,
51+
# because trivial-validate.py depends on it.
4352
echo "Generating sqlite DB"
4453
python2.7 ./utils/make-sqlite.py
54+
bash utils/validate.sh
4555
fi
4656

47-
# =============== BEGIN VALIDATION ================
48-
# Unless we're in a hurry, validate the ruleset library & locales
49-
50-
die() {
51-
echo >&2 "ERROR:" "$@"
52-
exit 1
53-
}
54-
55-
if [ "$1" != "--fast" ] ; then
56-
if python2.7 ./utils/trivial-validate.py --quiet --db $RULESETS_SQLITE >&2
57-
then
58-
echo Validation of included rulesets completed. >&2
59-
echo >&2
60-
else
61-
die "Validation of rulesets failed."
62-
fi
63-
64-
# Check for xmllint.
65-
type xmllint >/dev/null || die "xmllint not available"
66-
67-
GRAMMAR="utils/relaxng.xml"
68-
if [ -f "$GRAMMAR" ]
69-
then
70-
# xmllint spams stderr with "<FILENAME> validates, even with the --noout
71-
# flag. We can't grep -v for that line, because the pipeline will mask error
72-
# status from xmllint. Instead we run it once going to /dev/null, and if
73-
# there's an error run it again, showing only error output.
74-
validate_grammar() {
75-
find src/chrome/content/rules -name "*.xml" | \
76-
xargs xmllint --noout --relaxng utils/relaxng.xml
77-
}
78-
if validate_grammar 2>/dev/null
79-
then
80-
echo Validation of rulesets against $GRAMMAR succeeded. >&2
81-
else
82-
validate_grammar 2>&1 | grep -v validates
83-
die "Validation of rulesets against $GRAMMAR failed."
84-
fi
85-
else
86-
echo Validation of rulesets against $GRAMMAR SKIPPED. >&2
87-
fi
88-
89-
if [ -x ./utils/compare-locales.sh ] >&2
90-
then
91-
if ./utils/compare-locales.sh >&2
92-
then
93-
echo Validation of included locales completed. >&2
94-
else
95-
die "Validation of locales failed."
96-
fi
97-
fi
98-
fi
99-
# =============== END VALIDATION ================
100-
10157
sed -e "s/VERSION/$VERSION/g" chromium/updates-master.xml > chromium/updates.xml
10258

10359
[ -d pkg ] || mkdir -p pkg

makexpi.sh

Lines changed: 15 additions & 53 deletions
Original file line numberDiff line numberDiff line change
@@ -16,16 +16,14 @@ APP_NAME=https-everywhere
1616
# ./makexpi.sh 0.2.3.development.2
1717

1818
cd "`dirname $0`"
19+
RULESETS_UNVALIDATED="$PWD/pkg/rulesets.unvalidated.sqlite"
1920
RULESETS_SQLITE="$PWD/src/defaults/rulesets.sqlite"
2021
ANDROID_APP_ID=org.mozilla.firefox
21-
if [ "$1" == "--fast" ]; then
22-
FAST=true
23-
fi
2422

2523
[ -d pkg ] || mkdir pkg
2624

2725
# If the command line argument is a tag name, check that out and build it
28-
if [ -n "$1" ] && [ "$2" != "--no-recurse" ] && [ -z "$FAST" ] ; then
26+
if [ -n "$1" ] && [ "$2" != "--no-recurse" ] ; then
2927
BRANCH=`git branch | head -n 1 | cut -d \ -f 2-`
3028
SUBDIR=checkout
3129
[ -d $SUBDIR ] || mkdir $SUBDIR
@@ -54,15 +52,20 @@ if [ -n "$1" ] && [ "$2" != "--no-recurse" ] && [ -z "$FAST" ] ; then
5452
exit 0
5553
fi
5654

57-
if [ -z "$FAST" -o ! -f "$RULESETS_SQLITE" ] ; then
55+
# Only generate the sqlite database if any rulesets have changed. Tried
56+
# implementing this with make, but make is very slow with 15k+ input files.
57+
needs_update() {
58+
find src/chrome/content/rules/ -newer $RULESETS_UNVALIDATED |\
59+
grep -q .
60+
}
61+
if [ ! -f "$RULESETS_UNVALIDATED" ] || needs_update ; then
5862
# This is an optimization to get the OS reading the rulesets into RAM ASAP;
5963
# it's useful on machines with slow disk seek times; doing several of these
6064
# at once allows the IO subsystem to seek more efficiently.
6165
for firstchar in `echo {a..z} {A..Z} {0..9}` ; do
6266
# Those cover everything but it wouldn't matter if they didn't
6367
nohup cat src/chrome/content/rules/"$firstchar"*.xml >/dev/null 2>/dev/null &
6468
done
65-
6669
echo "Generating sqlite DB"
6770
python2.7 ./utils/make-sqlite.py
6871
fi
@@ -75,55 +78,15 @@ die() {
7578
exit 1
7679
}
7780

78-
if [ -z "$FAST" ] ; then
79-
if python2.7 ./utils/trivial-validate.py --quiet --db $RULESETS_SQLITE >&2
80-
then
81-
echo Validation of included rulesets completed. >&2
82-
echo >&2
83-
else
84-
die "Validation of rulesets failed."
85-
fi
86-
87-
# Check for xmllint.
88-
type xmllint >/dev/null || die "xmllint not available"
89-
90-
GRAMMAR="utils/relaxng.xml"
91-
if [ -f "$GRAMMAR" ]
92-
then
93-
# xmllint spams stderr with "<FILENAME> validates, even with the --noout
94-
# flag. We can't grep -v for that line, because the pipeline will mask error
95-
# status from xmllint. Instead we run it once going to /dev/null, and if
96-
# there's an error run it again, showing only error output.
97-
validate_grammar() {
98-
find src/chrome/content/rules -name "*.xml" | \
99-
xargs xmllint --noout --relaxng utils/relaxng.xml
100-
}
101-
if validate_grammar 2>/dev/null
102-
then
103-
echo Validation of rulesets against $GRAMMAR succeeded. >&2
104-
else
105-
validate_grammar 2>&1 | grep -v validates
106-
die "Validation of rulesets against $GRAMMAR failed."
107-
fi
108-
else
109-
echo Validation of rulesets against $GRAMMAR SKIPPED. >&2
110-
fi
111-
112-
if [ -x ./utils/compare-locales.sh ] >&2
113-
then
114-
if sh ./utils/compare-locales.sh >&2
115-
then
116-
echo Validation of included locales completed. >&2
117-
else
118-
die "Validation of locales failed."
119-
fi
120-
fi
81+
# If the unvalidated rulesets have changed, validate and copy to the validated
82+
# rulesets file.
83+
if [ "$RULESETS_UNVALIDATED" -nt "$RULESETS_SQLITE" ] ; then
84+
bash utils/validate.sh
12185
fi
122-
# =============== END VALIDATION ================
12386

12487
# The name/version of the XPI we're building comes from src/install.rdf
12588
XPI_NAME="pkg/$APP_NAME-`grep em:version src/install.rdf | sed -e 's/[<>]/ /g' | cut -f3`"
126-
if [ "$1" -a -z "$FAST" ] ; then
89+
if [ "$1" ]; then
12790
XPI_NAME="$XPI_NAME"
12891
else
12992
# During development, generate packages named with the short hash of HEAD.
@@ -139,8 +102,7 @@ fi
139102
cp -a src/ pkg/xpi-eff/
140103
rm -r pkg/xpi-eff/chrome/content/rules
141104
[ -e pkg/xpi-amo ] && rm -rf pkg/xpi-amo
142-
cp -a src/ pkg/xpi-amo/
143-
rm -r pkg/xpi-amo/chrome/content/rules
105+
cp -a pkg/xpi-eff/ pkg/xpi-amo/
144106
# The AMO version of the package cannot contain the updateKey or updateURL tags
145107
sed -i.bak -e '/updateKey/d' -e '/updateURL/d' pkg/xpi-amo/install.rdf
146108
rm pkg/xpi-amo/install.rdf.bak
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
<!--
2+
Problematic subdomains:
3+
4+
- chat ¹
5+
6+
¹: Refused
7+
-->
8+
<ruleset name="Agariomods.com">
9+
10+
<target host="agariomods.com" />
11+
<target host="www.agariomods.com" />
12+
13+
<target host="connect.agariomods.com" />
14+
<target host="skins.agariomods.com" />
15+
16+
<rule from="^http:"
17+
to="https:" />
18+
19+
</ruleset>
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
<ruleset name="Aucklandairport.co.nz">
2+
<target host="aucklandairport.co.nz" />
3+
<target host="www.aucklandairport.co.nz" />
4+
5+
<rule from="^http:" to="https:" />
6+
</ruleset>
Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
1-
<ruleset name="CodingTeam (expired)" default_off="expired">
2-
<target host="codingteam.net"/>
3-
<target host="www.codingteam.net"/>
1+
<ruleset name="CodingTeam.net">
2+
3+
<target host="codingteam.net"/>
4+
<target host="www.codingteam.net"/>
5+
6+
7+
<rule from="^http://(?:www\.)?codingteam\.net/"
8+
to="https://codingteam.net/"/>
49

5-
<rule from="^http://(?:www\.)?codingteam\.net/" to="https://codingteam.net/"/>
610
</ruleset>

src/chrome/content/rules/CoinWorker.xml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
1-
<ruleset name="CoinWorker.com" default_off="mismatch">
1+
<ruleset name="CoinWorker.com">
22

3-
<!-- Cert: *.heroku.com -->
43
<target host="coinworker.com" />
54
<target host="www.coinworker.com" />
65

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
<ruleset name="Edlund.dk">
2+
<target host="edlund.dk" />
3+
<target host="www.edlund.dk" />
4+
5+
<securecookie host="(www)?\.?edlund\.dk" name=".*" />
6+
7+
<rule from="^http:"
8+
to="https:" />
9+
</ruleset>
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
<ruleset name="Emply.net">
2+
<target host="herlev.emply.net" />
3+
4+
<test url="http://herlev.emply.net/overview/herlev.aspx?mediaId=f1fb8e12-1928-4328-88fd-9918a34a2bf2" />
5+
6+
<securecookie host="herlev\.emply\.net" name=".*" />
7+
8+
<rule from="^http:"
9+
to="https:" />
10+
</ruleset>
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
<ruleset name="Ethical Data">
2+
3+
<target host="ethicaldata.co.uk" />
4+
<target host="*.ethicaldata.co.uk" />
5+
6+
7+
<rule from="^http:"
8+
to="https:" />
9+
10+
</ruleset>
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
<!--
2+
Other ESET rulesets:
3+
- Eset.xml
4+
- ESET.at.xml
5+
- ESET.co.uk.xml
6+
- ESET.de.xml
7+
- ESET_NOD32.xml
8+
- ESET_static.com.xml
9+
- Sicontact.at.xml
10+
-->
11+
<ruleset name="GoExplore.net">
12+
<target host= "goexplore.net" />
13+
<target host= "www.goexplore.net" />
14+
<target host="static.goexplore.net" />
15+
16+
<securecookie host="^www\.goexplore\.net$" name=".+" />
17+
18+
<!-- cert only matches www -->
19+
<rule from="^http://goexplore\.net/"
20+
to="https://www.goexplore.net/" />
21+
22+
<rule from="^http:"
23+
to="https:" />
24+
</ruleset>

0 commit comments

Comments
 (0)