-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'fix/15464-ci-directives_r1' into develop
- Loading branch information
Showing
3 changed files
with
71 additions
and
19 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
#!/usr/bin/env bash | ||
|
||
set -x -- | ||
|
||
SUDO= | ||
APT_GET=$(which apt-get) | ||
APT_FLAGS='-q --no-install-suggests --no-install-recommends' | ||
PIP=$(which pip) | ||
PIP_FLAGS='--no-use-wheel' | ||
DEPENDS="build-essential openssl sqlite3 python-dev python-setuptools" | ||
DEPENDS="${DEPENDS} libgeoip-dev geoip-database libjpeg-dev" | ||
HERE=$(dirname $0) | ||
|
||
if [ "$EUID" != "0" ] ; then SUDO=$(which sudo); fi | ||
# pip is pre-installed on Travis-CI machines in their Python environment, so | ||
# we should avoid reinstalling it (as that might do odd things to the | ||
# virtualenv that we're already inside): | ||
if [ "$TRAVIS" == "true" ] ; then | ||
DEPENDS="${DEPENDS} realpath" | ||
else | ||
DEPENDS="${DEPENDS} python-pip" | ||
fi | ||
|
||
MISSING="" | ||
for dep in $DEPENDS ; do | ||
if ! test "$(dpkg -l $dep | grep \"ii $dep\")" ; then | ||
MISSING="${MISSING} $dep" | ||
fi | ||
done | ||
|
||
$SUDO $APT_GET install ${APT_FLAGS} ${MISSING} | ||
|
||
# When running on Travis, be sure that environment variables are passed from | ||
# .travis.yml to this script: | ||
if [ "$TRAVIS" == "true" ] ; then | ||
$PIP install $PIP_FLAGS -r "$HERE/../.travis.requirements.txt" | ||
$PIP install $PIP_FLAGS "Twisted==$TWISTED_VERSION" "pyOpenSSL==$PYOPENSSL_VERSION" | ||
else | ||
$PIP install $PIP_FLAGS -r "$HERE/../requirements.txt" | ||
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
#!/usr/bin/env bash | ||
|
||
set -x -- | ||
|
||
THIS_SCRIPT="$(realpath $0)" | ||
HERE="$THIS_SCRIPT" | ||
|
||
while [ "${HERE##*/}" != "bridgedb" ] ; do HERE="${HERE%/*}" ; done | ||
|
||
THERE="$HERE" | ||
echo "Found top-level repo directory: $THERE" | ||
cd $THERE | ||
|
||
mkdir run | ||
cp -R -t run bridgedb.conf captchas .gnupg | ||
# Add '127.0.0.1' to EMAIL_DOMAINS in bridgedb.conf. This should ONLY be | ||
# done on testing servers, never on production servers. | ||
sed -r -i -e "s/(EMAIL_DOMAINS)(.*)(])/\1\2\, '127.0.0.1']/" run/bridgedb.conf | ||
# Change EMAIL_SMTP_PORT to 2525: | ||
sed -r -i -e "s/(EMAIL_SMTP_PORT = )([1-9]{2,5})/\12525/" run/bridgedb.conf | ||
# Enable plaintext HTTP distribution, otherwise the mechanize-based tests in | ||
# test_https.py will fail with CERTIFICATE_VERIFY_FAILED because urllib2 | ||
# won't recognize our self-signed certificate: | ||
sed -r -i -e "s/(HTTP_UNENCRYPTED_BIND_IP = )(None)/\1'127.0.0.1'/" run/bridgedb.conf | ||
sed -r -i -e "s/(HTTP_UNENCRYPTED_PORT = )(None)/\16788/" run/bridgedb.conf | ||
leekspin -n 100 | ||
cp -t run networkstatus-bridges cached-extrainfo* bridge-descriptors | ||
./scripts/make-ssl-cert | ||
cp -t run privkey.pem cert |