From 3f71360b26e28c31fd128e8db658b407d2266b07 Mon Sep 17 00:00:00 2001 From: nitred Date: Wed, 12 Jan 2022 22:43:11 +0100 Subject: [PATCH] updated README and setup.py --- Makefile | 36 ------------------------------------ README.md | 27 +++++++++++++++------------ setup.py | 20 ++++++-------------- 3 files changed, 21 insertions(+), 62 deletions(-) delete mode 100644 Makefile diff --git a/Makefile b/Makefile deleted file mode 100644 index 37ec116..0000000 --- a/Makefile +++ /dev/null @@ -1,36 +0,0 @@ -.DEFAULT_GOAL := help - -help: ## Show available options with this Makefile - @fgrep -h "##" $(MAKEFILE_LIST) | fgrep -v fgrep | sed -e 's/\\$$//' | sed -e 's/##//' - -.PHONY : test -test: ## Run all the tests -test: - python setup.py test - -.PHONY : recreate_pyenv -recreate_pyenv: ## Create the python environment. Recreates if the env exists already. -recreate_pyenv: - conda env create --force -f dev_environment.yml - -.PHONY : readme_to_rst -readme_to_rst: ## Convert README.md to README.rst for the sake of pip documentation. -readme_to_rst: - m2r --overwrite README.md - -.PHONY : upload_test_pypi -upload_test_pypi: ## Build and upload distribution to testpypi server -upload_test_pypi: readme_to_rst - python setup.py bdist_wheel --dist-dir dist && \ - twine upload --skip-existing --repository testpypi dist/* - -.PHONY : upload_pypi -upload_pypi: ## Build and upload distribution to pypi server -upload_pypi: readme_to_rst - python setup.py bdist_wheel --dist-dir dist && \ - twine upload --skip-existing --repository pypi dist/* - -.PHONY : lint -lint: ## Run flake8 linter -lint: - flake8 nr_pypackage diff --git a/README.md b/README.md index 6b2f2af..fba1399 100644 --- a/README.md +++ b/README.md @@ -1,25 +1,30 @@ # About -A python 3 project to help find optimal MTUs for a Wireguard peer and server. +A python project to help find the optimal MTU values that maximize upload or download speeds between a peer and server. It also helps find bandwidth dead zones caused due to a poor choice of MTUs. + +I built the project to help myself find the right MTU values for my WG server and peer. I inadvertently found that the default MTU values for the server and peer in my case put my WG connection in a bandwidth dead zone. [Related reddit post](https://www.reddit.com/r/WireGuard/comments/plm8y7/finding_the_optimal_mtu_for_wg_server_and_wg_peer/). -***Please read the following documentation carefully, especially the WARNING section***. +***Please read the following documentation carefully, especially the WARNING section***. * This project offers no warranties, therefore do not use in production. Ideally trying using two VMs that are similar to your production setup. -* The project was developed and tested against a WG peer and WG server running Ubuntu 20.04. +* The project was developed and tested against a WG peer and WG server running Ubuntu 20.04. + +# Example Bandwidth Plot +* Light green and white areas indicate good to optimal MTU values. +* Green areas indicate bad MTU values. +* Dark green areas are dead zones. + +![Bandwidth Plot](./examples/example.png) # Warning ***WARNING: This project contains scripts that run shell commands using root access. DO NOT USE IN PRODUCTION.*** ***WARNING: This project tears down and spins up the Wireguard interface in the order of a thousand times. DO NOT USE IN PRODUCTION.*** - That being said, if you're an experienced python developer, please go through the code to verify that it meets your security standards. -# Example Bandwidth Plot -![Bandwidth Plot](./examples/example.png) - # Installation Install the following on both the WG server and WG peer @@ -74,7 +79,7 @@ Install the following on both the WG server and WG peer [Interface] ... MTU = 1420 # <----- ADD THIS LINE IF NOT ALREADY EXISTS - + [Peer] ... ``` @@ -90,7 +95,7 @@ Install the following on both the WG server and WG peer [Interface] ... MTU = 1420 # <----- ADD THIS LINE IF NOT ALREADY EXISTS - + [Peer] ... ``` @@ -138,7 +143,7 @@ Install the following on both the WG server and WG peer ``` iperf3 -s ``` -1. If the server has finishing cycling through all of its MTUs and then receives a request from peer script that it is ready for a new cycle, then the server sends a `SHUTDOWN` signal to the peer script via the `sync_server`. +1. If the server has finishing cycling through all of its MTUs and then receives a request from peer script that it is ready for a new cycle, then the server sends a `SHUTDOWN` signal to the peer script via the `sync_server`. ### How does the server script work? @@ -158,5 +163,3 @@ Install the following on both the WG server and WG peer ## License MIT - - diff --git a/setup.py b/setup.py index 708f37d..7c73787 100644 --- a/setup.py +++ b/setup.py @@ -4,13 +4,6 @@ from os import path from setuptools import find_packages, setup -here = path.abspath(path.dirname(__file__)) - -# Get the long description from the relevant file -with open(path.join(here, "README.md"), encoding="utf-8") as f: - long_description = f.read() - - # Get version without importing, which avoids dependency issues def get_version(): with open("nr_wg_mtu_finder/__init__.py") as version_file: @@ -20,19 +13,18 @@ def get_version(): install_requires = [ - "pandas>=0.23.4", - "matplotlib", - "seaborn", - "pydantic", - "requests", - "flask", + "pandas>=0.23.4,<1.4", + "matplotlib<3.5", + "seaborn<0.12", + "pydantic<1.9", + "requests<2.28", + "flask<2.1", ] setup( name="nr-wg-mtu-finder", description="Scripts to find the optimal MTU for Wireguard server and peers.", - long_description=long_description, version=get_version(), include_package_data=True, install_requires=install_requires,