updated README and setup.py

pull/6/head
nitred 2 years ago
parent 22c596dc69
commit 3f71360b26

@ -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

@ -1,25 +1,30 @@
# About # 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. * 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
***WARNING: This project contains scripts that run shell commands using root access. DO NOT USE IN PRODUCTION.*** ***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.*** ***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. 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 # Installation
Install the following on both the WG server and WG peer 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] [Interface]
... ...
MTU = 1420 # <----- ADD THIS LINE IF NOT ALREADY EXISTS MTU = 1420 # <----- ADD THIS LINE IF NOT ALREADY EXISTS
[Peer] [Peer]
... ...
``` ```
@ -90,7 +95,7 @@ Install the following on both the WG server and WG peer
[Interface] [Interface]
... ...
MTU = 1420 # <----- ADD THIS LINE IF NOT ALREADY EXISTS MTU = 1420 # <----- ADD THIS LINE IF NOT ALREADY EXISTS
[Peer] [Peer]
... ...
``` ```
@ -138,7 +143,7 @@ Install the following on both the WG server and WG peer
``` ```
iperf3 -s 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? ### How does the server script work?
@ -158,5 +163,3 @@ Install the following on both the WG server and WG peer
## License ## License
MIT MIT

@ -4,13 +4,6 @@ from os import path
from setuptools import find_packages, setup 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 # Get version without importing, which avoids dependency issues
def get_version(): def get_version():
with open("nr_wg_mtu_finder/__init__.py") as version_file: with open("nr_wg_mtu_finder/__init__.py") as version_file:
@ -20,19 +13,18 @@ def get_version():
install_requires = [ install_requires = [
"pandas>=0.23.4", "pandas>=0.23.4,<1.4",
"matplotlib", "matplotlib<3.5",
"seaborn", "seaborn<0.12",
"pydantic", "pydantic<1.9",
"requests", "requests<2.28",
"flask", "flask<2.1",
] ]
setup( setup(
name="nr-wg-mtu-finder", name="nr-wg-mtu-finder",
description="Scripts to find the optimal MTU for Wireguard server and peers.", description="Scripts to find the optimal MTU for Wireguard server and peers.",
long_description=long_description,
version=get_version(), version=get_version(),
include_package_data=True, include_package_data=True,
install_requires=install_requires, install_requires=install_requires,

Loading…
Cancel
Save