diff --git a/mitmproxy/.appveyor.yml b/.appveyor.yml similarity index 100% rename from mitmproxy/.appveyor.yml rename to .appveyor.yml diff --git a/.env b/.env new file mode 100644 index 000000000..a1b8db7f1 --- /dev/null +++ b/.env @@ -0,0 +1,6 @@ +DIR="$( dirname "${BASH_SOURCE[0]}" )" +ACTIVATE_DIR="$(if [ -f "$DIR/venv/bin/activate" ]; then echo 'bin'; else echo 'Scripts'; fi;)" +if [ -z "$VIRTUAL_ENV" ] && [ -f "$DIR/venv/$ACTIVATE_DIR/activate" ]; then + echo "Activating mitmproxy virtualenv..." + source "$DIR/venv/$ACTIVATE_DIR/activate" +fi diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 000000000..53ec8dff4 --- /dev/null +++ b/.gitattributes @@ -0,0 +1,2 @@ +mitmproxy/libmproxy/web/static/**/* -diff +mitmproxy/web/src/js/filt/filt.js -diff \ No newline at end of file diff --git a/.gitignore b/.gitignore new file mode 100644 index 000000000..da02b73e3 --- /dev/null +++ b/.gitignore @@ -0,0 +1,19 @@ +.DS_Store +MANIFEST +*/build +*/dist +*/tmp +/venv +*.py[cdo] +*.swp +*.swo +*.egg-info/ +.coverage +.idea +.cache/ + +# UI + +node_modules +bower_components +*.map diff --git a/mitmproxy/.landscape.yml b/.landscape.yml similarity index 80% rename from mitmproxy/.landscape.yml rename to .landscape.yml index 9dfa62b0c..2f7b85e12 100644 --- a/mitmproxy/.landscape.yml +++ b/.landscape.yml @@ -1,8 +1,8 @@ ignore-paths: - - docs - - examples - - libmproxy/contrib - - web + - mitmproxy/docs + - mitmproxy/examples + - mitmproxy/libmproxy/contrib + - mitmproxy/web max-line-length: 140 pylint: options: diff --git a/mitmproxy/.travis.yml b/.travis.yml similarity index 93% rename from mitmproxy/.travis.yml rename to .travis.yml index f32a58c17..4edf52296 100644 --- a/mitmproxy/.travis.yml +++ b/.travis.yml @@ -57,7 +57,9 @@ install: source "$HOME/virtualenvs/pypy-$PYPY_VERSION/bin/activate" fi - "pip install -U pip setuptools" - - "pip install --src .. -r requirements.txt" + - "pip install -e ./netlib[dev]" + - "pip install -e ./pathod[dev]" + - "pip install -e ./mitmproxy[dev,contentviews,examples]" before_script: - "openssl version -a" diff --git a/mitmproxy/CONTRIBUTING.md b/CONTRIBUTING.md similarity index 100% rename from mitmproxy/CONTRIBUTING.md rename to CONTRIBUTING.md diff --git a/mitmproxy/CONTRIBUTORS b/CONTRIBUTORS similarity index 100% rename from mitmproxy/CONTRIBUTORS rename to CONTRIBUTORS diff --git a/mitmproxy/LICENSE b/LICENSE similarity index 100% rename from mitmproxy/LICENSE rename to LICENSE diff --git a/mitmproxy/dev b/dev similarity index 68% rename from mitmproxy/dev rename to dev index fe1a619b4..2e29c8e19 100644 --- a/mitmproxy/dev +++ b/dev @@ -1,10 +1,12 @@ #!/bin/bash set -e -VENV=../venv.mitmproxy +VENV=./venv python -m virtualenv $VENV --always-copy . $VENV/bin/activate -pip install --src .. -r requirements.txt +pip install -e ./netlib[dev] +pip install -e ./pathod[dev] +pip install -e ./mitmproxy[dev,examples,contentviews] echo "" echo "* Created virtualenv environment in $VENV." diff --git a/mitmproxy/dev.bat b/dev.bat similarity index 62% rename from mitmproxy/dev.bat rename to dev.bat index 68b584b7e..62b76fbd4 100644 --- a/mitmproxy/dev.bat +++ b/dev.bat @@ -1,11 +1,15 @@ @echo off -set VENV=..\venv.mitmproxy +set VENV=.\venv virtualenv %VENV% --always-copy if %errorlevel% neq 0 exit /b %errorlevel% call %VENV%\Scripts\activate.bat if %errorlevel% neq 0 exit /b %errorlevel% -pip install --src .. -r requirements.txt +pip install -e ./netlib[dev] +if %errorlevel% neq 0 exit /b %errorlevel% +pip install -e ./pathod[dev] +if %errorlevel% neq 0 exit /b %errorlevel% +pip install -e ./mitmproxy[dev,examples,contentviews] if %errorlevel% neq 0 exit /b %errorlevel% echo. diff --git a/mitmproxy/.env b/mitmproxy/.env deleted file mode 100644 index 69ac3f052..000000000 --- a/mitmproxy/.env +++ /dev/null @@ -1,6 +0,0 @@ -DIR="$( dirname "${BASH_SOURCE[0]}" )" -ACTIVATE_DIR="$(if [ -f "$DIR/../venv.mitmproxy/bin/activate" ]; then echo 'bin'; else echo 'Scripts'; fi;)" -if [ -z "$VIRTUAL_ENV" ] && [ -f "$DIR/../venv.mitmproxy/$ACTIVATE_DIR/activate" ]; then - echo "Activating mitmproxy virtualenv..." - source "$DIR/../venv.mitmproxy/$ACTIVATE_DIR/activate" -fi diff --git a/mitmproxy/.gitattributes b/mitmproxy/.gitattributes deleted file mode 100644 index 8984c4bd8..000000000 --- a/mitmproxy/.gitattributes +++ /dev/null @@ -1,2 +0,0 @@ -libmproxy/web/static/**/* -diff -web/src/js/filt/filt.js -diff \ No newline at end of file diff --git a/mitmproxy/.gitignore b/mitmproxy/.gitignore deleted file mode 100644 index fc63a7ca7..000000000 --- a/mitmproxy/.gitignore +++ /dev/null @@ -1,28 +0,0 @@ -.DS_Store -MANIFEST -/build -/dist -/tmp -/doc -/venv -/libmproxy/gui -/release/build -*.py[cdo] -*.swp -*.swo -mitmproxy.egg-info/ -mitmproxyc -mitmdumpc -.coverage -.idea -netlib -pathod -libpathod -.cache/ - -# UI - -node_modules -bower_components -*.compiled.js -*.map diff --git a/mitmproxy/libmproxy/version.py b/mitmproxy/libmproxy/version.py index 664c2b280..63f60a8d1 100644 --- a/mitmproxy/libmproxy/version.py +++ b/mitmproxy/libmproxy/version.py @@ -1,11 +1,3 @@ from __future__ import (absolute_import, print_function, division) -IVERSION = (0, 17) -VERSION = ".".join(str(i) for i in IVERSION) -MINORVERSION = ".".join(str(i) for i in IVERSION[:2]) -NAME = "mitmproxy" -NAMEVERSION = NAME + " " + VERSION - -NEXT_MINORVERSION = list(IVERSION) -NEXT_MINORVERSION[1] += 1 -NEXT_MINORVERSION = ".".join(str(i) for i in NEXT_MINORVERSION[:2]) +from netlib.version import * \ No newline at end of file diff --git a/mitmproxy/requirements.txt b/mitmproxy/requirements.txt deleted file mode 100644 index 49f86b9a6..000000000 --- a/mitmproxy/requirements.txt +++ /dev/null @@ -1,3 +0,0 @@ --e git+https://github.com/mitmproxy/netlib.git#egg=netlib --e git+https://github.com/mitmproxy/pathod.git#egg=pathod --e .[dev,examples,contentviews] diff --git a/netlib/.appveyor.yml b/netlib/.appveyor.yml deleted file mode 100644 index cd1354c20..000000000 --- a/netlib/.appveyor.yml +++ /dev/null @@ -1,11 +0,0 @@ -version: '{build}' -shallow_clone: true -environment: - matrix: - - PYTHON: "C:\\Python27" -install: - - "%PYTHON%\\Scripts\\pip install --src . -r requirements.txt" - - "%PYTHON%\\python -c \"from OpenSSL import SSL; print(SSL.SSLeay_version(SSL.SSLEAY_VERSION))\"" -build: off # Not a C# project -test_script: - - "%PYTHON%\\Scripts\\py.test -n 4 --timeout 10" diff --git a/netlib/.env b/netlib/.env deleted file mode 100644 index 69ac3f052..000000000 --- a/netlib/.env +++ /dev/null @@ -1,6 +0,0 @@ -DIR="$( dirname "${BASH_SOURCE[0]}" )" -ACTIVATE_DIR="$(if [ -f "$DIR/../venv.mitmproxy/bin/activate" ]; then echo 'bin'; else echo 'Scripts'; fi;)" -if [ -z "$VIRTUAL_ENV" ] && [ -f "$DIR/../venv.mitmproxy/$ACTIVATE_DIR/activate" ]; then - echo "Activating mitmproxy virtualenv..." - source "$DIR/../venv.mitmproxy/$ACTIVATE_DIR/activate" -fi diff --git a/netlib/.gitignore b/netlib/.gitignore deleted file mode 100644 index d8ffb588b..000000000 --- a/netlib/.gitignore +++ /dev/null @@ -1,16 +0,0 @@ -MANIFEST -/build -/dist -/tmp -/doc -*.py[cdo] -*.swp -*.swo -.coverage -.idea/ -__pycache__ -_cffi__* -.eggs/ -netlib.egg-info/ -pathod/ -.cache/ \ No newline at end of file diff --git a/netlib/.landscape.yml b/netlib/.landscape.yml deleted file mode 100644 index 9a3b615f7..000000000 --- a/netlib/.landscape.yml +++ /dev/null @@ -1,16 +0,0 @@ -max-line-length: 120 -pylint: - options: - dummy-variables-rgx: _$|.+_$|dummy_.+ - - disable: - - missing-docstring - - protected-access - - too-few-public-methods - - too-many-arguments - - too-many-instance-attributes - - too-many-locals - - too-many-public-methods - - too-many-return-statements - - too-many-statements - - unpacking-non-sequence \ No newline at end of file diff --git a/netlib/.travis.yml b/netlib/.travis.yml deleted file mode 100644 index 651fdae8c..000000000 --- a/netlib/.travis.yml +++ /dev/null @@ -1,98 +0,0 @@ -sudo: false -language: python - -matrix: - fast_finish: true - include: - - python: 2.7 - - python: 2.7 - env: OPENSSL=1.0.2 - addons: - apt: - sources: - # Debian sid currently holds OpenSSL 1.0.2 - # change this with future releases! - - debian-sid - packages: - - libssl-dev - - python: 3.5 - - python: 3.5 - env: OPENSSL=1.0.2 - addons: - apt: - sources: - # Debian sid currently holds OpenSSL 1.0.2 - # change this with future releases! - - debian-sid - packages: - - libssl-dev - - python: pypy - - python: pypy - env: OPENSSL=1.0.2 - addons: - apt: - sources: - # Debian sid currently holds OpenSSL 1.0.2 - # change this with future releases! - - debian-sid - packages: - - libssl-dev - -install: - - | - if [[ $TRAVIS_OS_NAME == "osx" ]] - then - brew update || brew update # try again if it fails - brew outdated openssl || brew upgrade openssl - brew install python - fi - - | - if [ "$TRAVIS_PYTHON_VERSION" = "pypy" ]; then - export PYENV_ROOT="$HOME/.pyenv" - if [ -f "$PYENV_ROOT/bin/pyenv" ]; then - pushd "$PYENV_ROOT" && git pull && popd - else - rm -rf "$PYENV_ROOT" && git clone --depth 1 https://github.com/yyuu/pyenv.git "$PYENV_ROOT" - fi - export PYPY_VERSION="4.0.1" - "$PYENV_ROOT/bin/pyenv" install --skip-existing "pypy-$PYPY_VERSION" - virtualenv --python="$PYENV_ROOT/versions/pypy-$PYPY_VERSION/bin/python" "$HOME/virtualenvs/pypy-$PYPY_VERSION" - source "$HOME/virtualenvs/pypy-$PYPY_VERSION/bin/activate" - fi - - "pip install -U pip setuptools" - - "pip install --src . -r requirements.txt" - -before_script: - - "openssl version -a" - -script: - - "py.test -s --cov netlib --timeout 10" - -after_success: - - coveralls - -notifications: - irc: - channels: - - "irc.oftc.net#mitmproxy" - on_success: change - on_failure: always - slack: - rooms: - - mitmproxy:YaDGC9Gt9TEM7o8zkC2OLNsu#ci - on_success: always - on_failure: always - -# exclude cryptography from cache -# it depends on libssl-dev version -# which needs to be compiled specifically to each version -before_cache: - - pip uninstall -y cryptography - -cache: - directories: - - $HOME/.cache/pip - - /home/travis/virtualenv/python2.7.9/lib/python2.7/site-packages - - /home/travis/virtualenv/python2.7.9/bin - - /home/travis/virtualenv/pypy-2.5.0/site-packages - - /home/travis/virtualenv/pypy-2.5.0/bin diff --git a/netlib/CONTRIBUTORS b/netlib/CONTRIBUTORS deleted file mode 100644 index 3a4b9b469..000000000 --- a/netlib/CONTRIBUTORS +++ /dev/null @@ -1,22 +0,0 @@ - 253 Aldo Cortesi - 230 Maximilian Hils - 123 Thomas Kriechbaumer - 8 Chandler Abraham - 8 Kyle Morton - 5 Sam Cleveland - 3 Benjamin Lee - 3 Sandor Nemes - 2 Brad Peabody - 2 Israel Nir - 2 Matthias Urlichs - 2 Pedro Worcel - 2 Sean Coates - 1 Andrey Plotnikov - 1 Bradley Baetz - 1 Felix Yan - 1 M. Utku Altinkaya - 1 Paul - 1 Pritam Baral - 1 Rouli - 1 Tim Becker - 1 kronick diff --git a/netlib/LICENSE b/netlib/LICENSE deleted file mode 100644 index c08a0186d..000000000 --- a/netlib/LICENSE +++ /dev/null @@ -1,19 +0,0 @@ -Copyright (c) 2013, Aldo Cortesi. All rights reserved. - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. diff --git a/netlib/check_coding_style.sh b/netlib/check_coding_style.sh deleted file mode 100755 index a1c94e030..000000000 --- a/netlib/check_coding_style.sh +++ /dev/null @@ -1,20 +0,0 @@ -#!/bin/bash - -autopep8 -i -r -a -a . -if [[ -n "$(git status -s)" ]]; then - echo "autopep8 yielded the following changes:" - git status -s - git --no-pager diff - exit 0 # don't be so strict about coding style errors -fi - -autoflake -i -r --remove-all-unused-imports --remove-unused-variables . -if [[ -n "$(git status -s)" ]]; then - echo "autoflake yielded the following changes:" - git status -s - git --no-pager diff - exit 0 # don't be so strict about coding style errors -fi - -echo "Coding style seems to be ok." -exit 0 diff --git a/netlib/requirements.txt b/netlib/requirements.txt deleted file mode 100644 index aefbcb6d2..000000000 --- a/netlib/requirements.txt +++ /dev/null @@ -1 +0,0 @@ --e .[dev] diff --git a/pathod/.appveyor.yml b/pathod/.appveyor.yml deleted file mode 100644 index dbb6d2fa6..000000000 --- a/pathod/.appveyor.yml +++ /dev/null @@ -1,11 +0,0 @@ -version: '{build}' -shallow_clone: true -environment: - matrix: - - PYTHON: "C:\\Python27" -install: - - "%PYTHON%\\Scripts\\pip install --src . -r requirements.txt" - - "%PYTHON%\\python -c \"from OpenSSL import SSL; print(SSL.SSLeay_version(SSL.SSLEAY_VERSION))\"" -build: off # Not a C# project -test_script: - - "%PYTHON%\\Scripts\\py.test -n 4" \ No newline at end of file diff --git a/pathod/.env b/pathod/.env deleted file mode 100644 index 69ac3f052..000000000 --- a/pathod/.env +++ /dev/null @@ -1,6 +0,0 @@ -DIR="$( dirname "${BASH_SOURCE[0]}" )" -ACTIVATE_DIR="$(if [ -f "$DIR/../venv.mitmproxy/bin/activate" ]; then echo 'bin'; else echo 'Scripts'; fi;)" -if [ -z "$VIRTUAL_ENV" ] && [ -f "$DIR/../venv.mitmproxy/$ACTIVATE_DIR/activate" ]; then - echo "Activating mitmproxy virtualenv..." - source "$DIR/../venv.mitmproxy/$ACTIVATE_DIR/activate" -fi diff --git a/pathod/.gitignore b/pathod/.gitignore deleted file mode 100644 index 7eeeb6142..000000000 --- a/pathod/.gitignore +++ /dev/null @@ -1,15 +0,0 @@ -# Python object files -*.py[cd] -MANIFEST -/build -/dist -# Vim swap files -*.swp -/doc -.coverage -.noseids -netlib -venv -.idea/ -pathod.egg-info/ -.cache/ \ No newline at end of file diff --git a/pathod/.landscape.yml b/pathod/.landscape.yml deleted file mode 100644 index 9a3b615f7..000000000 --- a/pathod/.landscape.yml +++ /dev/null @@ -1,16 +0,0 @@ -max-line-length: 120 -pylint: - options: - dummy-variables-rgx: _$|.+_$|dummy_.+ - - disable: - - missing-docstring - - protected-access - - too-few-public-methods - - too-many-arguments - - too-many-instance-attributes - - too-many-locals - - too-many-public-methods - - too-many-return-statements - - too-many-statements - - unpacking-non-sequence \ No newline at end of file diff --git a/pathod/.travis.yml b/pathod/.travis.yml deleted file mode 100644 index 92634df7f..000000000 --- a/pathod/.travis.yml +++ /dev/null @@ -1,70 +0,0 @@ -sudo: false -language: python - -matrix: - fast_finish: true - include: - - python: 2.7 - - python: 2.7 - env: OPENSSL=1.0.2 - addons: - apt: - sources: - # Debian sid currently holds OpenSSL 1.0.2 - # change this with future releases! - - debian-sid - packages: - - libssl-dev - - python: pypy - - python: pypy - env: OPENSSL=1.0.2 - addons: - apt: - sources: - # Debian sid currently holds OpenSSL 1.0.2 - # change this with future releases! - - debian-sid - packages: - - libssl-dev - allow_failures: - # We allow pypy to fail until Travis fixes their infrastructure to a pypy - # with a recent enought CFFI library to run cryptography 1.0+. - - python: pypy - -install: - - "pip install --src . -r requirements.txt" - -before_script: - - "openssl version -a" - -script: - - "py.test --cov libpathod -v" - -after_success: - - coveralls - -notifications: - irc: - channels: - - "irc.oftc.net#mitmproxy" - on_success: change - on_failure: always - slack: - rooms: - - mitmproxy:YaDGC9Gt9TEM7o8zkC2OLNsu#ci - on_success: always - on_failure: always - -# exclude cryptography from cache -# it depends on libssl-dev version -# which needs to be compiled specifically to each version -before_cache: - - pip uninstall -y cryptography - -cache: - directories: - - $HOME/.cache/pip - - /home/travis/virtualenv/python2.7.9/lib/python2.7/site-packages - - /home/travis/virtualenv/python2.7.9/bin - - /home/travis/virtualenv/pypy-2.5.0/site-packages - - /home/travis/virtualenv/pypy-2.5.0/bin diff --git a/pathod/CONTRIBUTORS b/pathod/CONTRIBUTORS deleted file mode 100644 index ab76a35c4..000000000 --- a/pathod/CONTRIBUTORS +++ /dev/null @@ -1,6 +0,0 @@ - 426 Aldo Cortesi - 74 Maximilian Hils - 50 Thomas Kriechbaumer - 1 Felix Yan - 1 requires.io - 1 starenka diff --git a/pathod/LICENSE b/pathod/LICENSE deleted file mode 100644 index 908aa13f7..000000000 --- a/pathod/LICENSE +++ /dev/null @@ -1,19 +0,0 @@ -Copyright (c) 2008, Aldo Cortesi. All rights reserved. - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. diff --git a/pathod/libpathod/version.py b/pathod/libpathod/version.py index b99ae40b5..63f60a8d1 100644 --- a/pathod/libpathod/version.py +++ b/pathod/libpathod/version.py @@ -1,11 +1,3 @@ from __future__ import (absolute_import, print_function, division) -IVERSION = (0, 17) -VERSION = ".".join(str(i) for i in IVERSION) -MINORVERSION = ".".join(str(i) for i in IVERSION[:2]) -NAME = "pathod" -NAMEVERSION = NAME + " " + VERSION - -NEXT_MINORVERSION = list(IVERSION) -NEXT_MINORVERSION[1] += 1 -NEXT_MINORVERSION = ".".join(str(i) for i in NEXT_MINORVERSION[:2]) +from netlib.version import * \ No newline at end of file diff --git a/pathod/requirements.txt b/pathod/requirements.txt deleted file mode 100644 index 69bd183b2..000000000 --- a/pathod/requirements.txt +++ /dev/null @@ -1,2 +0,0 @@ --e git+https://github.com/mitmproxy/netlib.git#egg=netlib --e .[dev] \ No newline at end of file diff --git a/mitmproxy/release/mitmdump.spec b/release/mitmdump.spec similarity index 100% rename from mitmproxy/release/mitmdump.spec rename to release/mitmdump.spec diff --git a/mitmproxy/release/mitmproxy.spec b/release/mitmproxy.spec similarity index 100% rename from mitmproxy/release/mitmproxy.spec rename to release/mitmproxy.spec diff --git a/mitmproxy/release/mitmweb.spec b/release/mitmweb.spec similarity index 100% rename from mitmproxy/release/mitmweb.spec rename to release/mitmweb.spec diff --git a/pathod/release/pathoc.spec b/release/pathoc.spec similarity index 100% rename from pathod/release/pathoc.spec rename to release/pathoc.spec diff --git a/pathod/release/pathod.spec b/release/pathod.spec similarity index 100% rename from pathod/release/pathod.spec rename to release/pathod.spec