Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .codecov-env.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#!/bin/sh

echo -e CODECOV_ENV -e CODECOV_TOKEN -e CODECOV_URL -e CODECOV_SLUG -e VCS_COMMIT_ID -e VCS_BRANCH_NAME -e VCS_PULL_REQUEST -e VCS_SLUG -e VCS_TAG -e CI_BUILD_URL -e CI_BUILD_ID -e CI_JOB_ID -e CI -e TRAVIS -e SHIPPABLE -e TRAVIS_BRANCH -e TRAVIS_COMMIT -e TRAVIS_JOB_NUMBER -e TRAVIS_PULL_REQUEST -e TRAVIS_JOB_ID -e TRAVIS_REPO_SLUG -e TRAVIS_TAG -e TRAVIS_OS_NAME
2 changes: 2 additions & 0 deletions .coveragerc
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
[run]
parallel=True
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[submodule "t"]
path = t
url = https://github.com/cheako/tor2web-tests.git
23 changes: 16 additions & 7 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,17 @@
language: python
dist: trusty
sudo: required
python:
- "2.7"
install: true
services:
- docker

# Don't assume ruby.
language: generic

before_install:
- docker build -t tor2web .
- echo CID=`docker run -d tor2web tail -f /dev/null` | tee cid

script:
- $TRAVIS_BUILD_DIR/scripts/travis.sh
# - scripts/travis.sh
- . cid; docker exec -e TTWLANG=python $CID /bin/sh -c 'cd /usr/src/github/Tor2web; python2 setup.py install && { prove -v -f t/tx || true; prove -f; }'

# Generate and deploy documentation
after_success:
- . cid; docker exec `./.codecov-env.sh` $CID /bin/sh -c 'cd /usr/src/github/Tor2web; head /dev/null .coverage*; python-coverage combine; python-coverage xml -i; head /dev/null .coverage*; codecov -X gcov'
6 changes: 6 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
FROM debian:stretch
LABEL Description="This image is used to test Tor2web" Version="0.1"
RUN apt-get -yq update && apt-get -yq --no-install-suggests --no-install-recommends --allow-downgrades --allow-remove-essential --allow-change-held-packages install strace libio-socket-socks-perl libproc-daemon-perl libipc-run-perl libcommon-sense-perl libhttp-daemon-perl libio-socket-ssl-perl python-pip python-setuptools python-dev libffi-dev libssl1.0-dev apparmor apparmor-utils build-essential python-zope.component python-zope.event python-zope.interface python-coverage python-wheel python-requests python-idna python-certifi git procps
RUN ln -s python-coverage /usr/bin/coverage; pip install codecov
COPY . /usr/src/github/Tor2web
RUN pip2 install -r /usr/src/github/Tor2web/requirements.txt
2 changes: 1 addition & 1 deletion requirements/requirements-trusty.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ cryptography==1.2.3
enum34==0.9.23
idna==2.0
pyOpenSSL==0.15.1
pyasn1==0.1.9
pyasn1==0.3.4
pycparser==2.10
service_identity==16.0.0
six==1.5.2
Expand Down
2 changes: 1 addition & 1 deletion requirements/requirements-xenial.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ cryptography==1.2.3
enum34==1.1.2
idna==2.0
pyOpenSSL==0.15.1
pyasn1==0.1.9
pyasn1==0.3.4
pycparser==2.14
service_identity==16.0.0
six==1.10.0
Expand Down
1 change: 1 addition & 0 deletions t
Submodule t added at 1f8b21
19 changes: 19 additions & 0 deletions test-intermediate.pem
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
-----BEGIN CERTIFICATE-----
MIIDBDCCAeygAwIBAgIJAK25kuAT+ZsMMA0GCSqGSIb3DQEBCwUAMBcxFTATBgNV
BAMMDCoub25pb24udGVzdDAeFw0xNzA5MTEwOTQ2NDhaFw0yNzA5MDkwOTQ2NDha
MBcxFTATBgNVBAMMDCoub25pb24udGVzdDCCASIwDQYJKoZIhvcNAQEBBQADggEP
ADCCAQoCggEBAKrfBwR43axQKVjX3jD3dBfWnCp9vRMAV9JGHU2a/WF8gg0b1zTa
/LQCcRgJFIWKaTUedC/OiVlLkx807Q34RNAglzG6auoHJoepTY50Ef+ZnCqDG+ho
s2DZp7/S8xejh8liw+iIKFxFcolnms5SoluMx658BdflMJwS3zPqaVXtI7ZmgZN+
X1e+orN2zbHUiORNqG1G2Bck31JbQZDgnkZxzVR9EAEm7uKFtvuONsZICMB6x+Vl
dojhHQnILWaJkQ/uDUR51E+06gXQZQ85zfcrUMcpW0bUG//k2PaucG7Xt28Qp/W2
ZT4rkKqMItvwSBzYNAZunlDXd/HAdIlUePECAwEAAaNTMFEwHQYDVR0OBBYEFKjx
AkZaUg6nAzO0hfk66NbPIxTcMB8GA1UdIwQYMBaAFKjxAkZaUg6nAzO0hfk66NbP
IxTcMA8GA1UdEwEB/wQFMAMBAf8wDQYJKoZIhvcNAQELBQADggEBABwIKtlImJ/S
SNP0HWzxgSz5sLGWJc1Nmw2rW0nQ8u42pzAjaslwH/FPEy/A6g7S5F8FN1fua+2m
pDxQmYM+bTno4mNwcATw3MCEvPjOqOdp8Di1xEj7m2jlMY2uNuKImBXsU2sgKCKw
TUHAaQXya1rx/SA7CjBUrTPRfVJJAwIzYgXuzx/GvOi+c3t/uMlGz5h6DpuTcgO/
YJdRbrrzKLeJjpFDBOpVhWrlUib3kCgc2pRjeuVb7Yb+ZoN9aI++wKTCS/g/LZTW
4DoZQ1fWh7PBDJiDbGVeJC6fxJxVR1bTyzTwvCA7NO9541mUHwsXHBS6w0FuQiKe
5pmX5LNJxlc=
-----END CERTIFICATE-----
16 changes: 9 additions & 7 deletions tor2web/t2w.py
Original file line number Diff line number Diff line change
Expand Up @@ -213,14 +213,18 @@ def processExited(self, reason):


def spawnT2W(father, childFDs, fds_https, fds_http):
executable = sys.executable;
cmdline = [ sys.executable, __file__] + sys.argv[1:];
if os.environ.has_key('TTW_COVERAGE'):
executable = os.environ['TTW_COVERAGE'];
cmdline = [ os.environ['TTW_COVERAGE'], 'run', __file__] + sys.argv[1:];

child_env = os.environ.copy()
child_env['T2W_FDS_HTTPS'] = fds_https
child_env['T2W_FDS_HTTP'] = fds_http

return reactor.spawnProcess(T2WPP(father, childFDs, fds_https, fds_http),
sys.executable,
[sys.executable, __file__] + sys.argv[1:],
env=child_env,
executable,cmdline,env=child_env,
childFDs=childFDs)


Expand Down Expand Up @@ -1312,7 +1316,7 @@ def daemon_shutdown(self):
self.quitting = True

for pid in self.subprocesses:
os.kill(pid, signal.SIGINT)
os.kill(pid, signal.SIGTERM)

self.subprocesses = []

Expand Down Expand Up @@ -1394,7 +1398,7 @@ def SigQUIT(SIG, FRM):

sys.excepthook = None

set_pdeathsig(signal.SIGINT)
set_pdeathsig(signal.SIGTERM)

# #########################
# Security UMASK hardening
Expand Down Expand Up @@ -1560,8 +1564,6 @@ def nullStartedConnecting(self, connector):
os.chmod(os.path.join(config.rundir, "rpc.socket"), 0600)

signal.signal(signal.SIGUSR1, SigQUIT)
signal.signal(signal.SIGTERM, SigQUIT)
signal.signal(signal.SIGINT, SigQUIT)

start_worker()

Expand Down