Update to 0.1.7 (#12)

* Update python dependancies

* Update python dependacies and set default tor version to 3

* remove travis

Co-authored-by: Chirstophe Mehay <cmehay@student.42.fr>
master
Christophe Mehay 2 years ago committed by GitHub
parent 99a4225d75
commit da3a5ecf0b

@ -1,24 +0,0 @@
language: python
python:
- '3.8'
install: pip install tox-travis pre-commit poetry
env:
global:
- secure: iCK2XVegBPAsOfMCv+X2oLweZNnwK9Yx0o1fm14R41tHmrn7b3uJQIf951S5Ga9q3tyUXcOgTf+fYMm/llFFu+UIygNBPK/pawkcGy5ipf9CrFD3unSjHpM0HAqnHsfNWhCZU8bfgripYukJ3Ib9ZO9QfayK2Vpx2XzUsuFi0AIfslmp4FyVp0xiqfX8u0RylGbuvzGtojJltcmO58tBPOlzyky5Bz9P59eoQ34E8KRisQ3eW4Q8bXHOdqTKc/VnmRyhGDKqkPDk5h0dF57VArByzPnwkyXKArA13J6GoU4tmnsCBBR4m36gvOFyaIH3q3p47n89N75eMCWfIuDdqWplPNuaU4lTnLB353wnqdHMEMltsg/6EG3NJ7Dr8oxenc5Sgy0ohdnUve0TMalkDaw8t3ceN/RgYsr/+8mhb/gFNhGACMKujCDMSRZ5w47E53K4iK4Pz0OdyUZfEjf194RfDU9I+euk+tUvvCZPbpqqvovL5vHhZ8Oo3rKzrVIS35hmtRM/ZgJeFd/2acKbNwp6A+FCNhGFvhD5x2VdHrfKLriv/3gswcxl+Kg6tIFNhKuX63R2lBcFsu7ZuFhlPMZGq/f0McBSU0UTim6t9J18rH8geJszCnwvV9m4z7h2KR6rciXJRMG/Ang7Wo0ww5D7lJrLcF3KYm1hCtcnQnA=
- secure: EbeYbq0a9eD/T3PyU5aH8kcvKds7LiW6/PRrLtoWc8EajZDenBoGKDkKO8XQettxUePCRoUQeHqoWMkhQq7QJdx25bNhd5/0NOoGV30jIq6c9TTMIrN4Db0sguccN6t2paWEt3wjw9ferxmX06eydBzTYmyPgdJWas+IEZj5ihsiVjYQDFKEKe/Hnj5zsv+n8yk+YlnTXwT84DhvHNDhf7KYYjcocnuAsF4G2M6GtZMSiQBz8/BV0AaX4nw0SJLVN0vQCTcRY2HNrPXxKG1VveV6ufbjLB1/m345kHj/u9PW88w0h/P4LWfpOLGPdUwBhLj+mW/agNInjYEwQqiEolzuEms5BlLC4NqzGEa9sha2mGsLBD+wFJs3HdquMcX7bUirKCy82VJPmZHA33kRkXORSLPLMEI1WBKFDnE+B0CvH6EDw2SFJm5MrtiO5thtoAmmq1veQJgXCI4sL1b56cWOrni4Ltr5qhGbSUyncl7qDBjmppm5ZWuBsCw+FFqlt2sBIq9FLd9N7ENyHX5CTFL+2UEq1dw1JDkH7RPfNdf6OUu+UaBchaLY5HNMHTIEP+7/ak2Bbq/kOmnZlNnsGdCixmfMGVdkhvo+SxHlPlKpHbsGvFXPldEhGNUp5Y6NJUzeOACje+KW8tBum/f1ACG5ybuYG6KwylF20SCLx1I=
script:
- pre-commit run --all-files
- tox
before_deploy:
- poetry config pypi-token.pypi $PYPI_PASS
deploy:
- provider: script
script: poetry publish --build
on:
repo: cmehay/pytor
branch: master
python: '3.8'
tags: true

@ -2,8 +2,24 @@
`pytor` is a simple python library to create and manager tor hidden services in version 2 and 3. `pytor` is a simple python library to create and manager tor hidden services in version 2 and 3.
```
$ mkdir test
$ pytor new-hidden-service test
FYI: Binary data is base64 encoded
path:
test
hostname:
byb3bkhwi2ccbrctsqkowckpvk3tok36geddzg4l2m6yn6mrw626nqid.onion
hs_ed25519_secret_key:
PT0gZWQyNTUxOXYxLXNlY3JldDogdHlwZTAgPT0AAAAwIFsWaVtOk8r3RvXnkZcmxwIaDmmOdV8D7KaVf6yBWjVUIUTPpOWNQ9+hEiPKUclJ1RpflZ9FSdPgSj0j0tE3
hs_ed25519_public_key:
PT0gZWQyNTUxOXYxLXB1YmxpYzogdHlwZTAgPT0AAAAOA7Co9kaEIMRTlBTrCU+qtzcrfjEGPJuL0z2G+ZG3tQ==
```
Version 2 is is not working anymore on tor network but the toll can still created ones
```sh ```sh
$ pytor new $ pytor new --version 2
hostname: hostname:
cljfodghi4w5frc6.onion cljfodghi4w5frc6.onion
private_key: private_key:
@ -23,19 +39,3 @@ rboGe61UTI+Ks8Q8kV7/urSI8imNkwHSUT8cMHiLs/IxBOM/p0KvVOa/OQJAHlXY
w96jWD0AEePqKKdWofLImi074zMSyMKuu6RFrkBSUuI= w96jWD0AEePqKKdWofLImi074zMSyMKuu6RFrkBSUuI=
-----END RSA PRIVATE KEY----- -----END RSA PRIVATE KEY-----
``` ```
```
$ mkdir test
$ pytor new-hidden-service test --version 3
FYI: Binary data is base64 encoded
path:
test
hostname:
byb3bkhwi2ccbrctsqkowckpvk3tok36geddzg4l2m6yn6mrw626nqid.onion
hs_ed25519_secret_key:
PT0gZWQyNTUxOXYxLXNlY3JldDogdHlwZTAgPT0AAAAwIFsWaVtOk8r3RvXnkZcmxwIaDmmOdV8D7KaVf6yBWjVUIUTPpOWNQ9+hEiPKUclJ1RpflZ9FSdPgSj0j0tE3
hs_ed25519_public_key:
PT0gZWQyNTUxOXYxLXB1YmxpYzogdHlwZTAgPT0AAAAOA7Co9kaEIMRTlBTrCU+qtzcrfjEGPJuL0z2G+ZG3tQ==
```
(more doc soon, I'm tired right now ~)

875
poetry.lock generated

File diff suppressed because it is too large Load Diff

@ -1,7 +1,7 @@
[tool] [tool]
[tool.poetry] [tool.poetry]
name = "pytor" name = "pytor"
version = "0.1.6" version = "0.1.7"
description = "Manage Tor hidden services keys" description = "Manage Tor hidden services keys"
license = "WTFPL" license = "WTFPL"
classifiers = ["Programming Language :: Python", "Development Status :: 1 - Planning", "License :: OSI Approved :: BSD License", "Natural Language :: English", "Operating System :: POSIX :: Linux", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3.6", "Programming Language :: Python :: 3.7"] classifiers = ["Programming Language :: Python", "Development Status :: 1 - Planning", "License :: OSI Approved :: BSD License", "Natural Language :: English", "Operating System :: POSIX :: Linux", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3.6", "Programming Language :: Python :: 3.7"]
@ -10,7 +10,7 @@ repository = "https://pypi.org/project/pytor/"
authors = ["Christophe Mehay <cmehay@nospam.student.42.fr>"] authors = ["Christophe Mehay <cmehay@nospam.student.42.fr>"]
[tool.poetry.dependencies] [tool.poetry.dependencies]
python = ">= 3.6.12, < 3.9" python = ">= 3.6.12, < 3.10"
pycryptodome = ">=3.9.4" pycryptodome = ">=3.9.4"
fire = ">=0.3.1" fire = ">=0.3.1"
pyyaml = ">=5.3.1" pyyaml = ">=5.3.1"

@ -38,7 +38,7 @@ class Pytor(object):
3: OnionV3, 3: OnionV3,
} }
def __init__(self, version: int = 2, format: str = "plain"): def __init__(self, version: int = 3, format: str = "plain"):
if version not in self._obj: if version not in self._obj:
raise Exception("Onion version not valid") raise Exception("Onion version not valid")
self._version = version self._version = version

@ -1,5 +1,6 @@
import os import os
import re import re
import warnings
from abc import ABC from abc import ABC
from abc import abstractmethod from abc import abstractmethod
from base64 import b32encode from base64 import b32encode
@ -47,6 +48,11 @@ class Onion(ABC):
def __init__( def __init__(
self, private_key: bytes = None, hidden_service_path: str = None self, private_key: bytes = None, hidden_service_path: str = None
): ):
if self._version == 2:
warnings.warn(
"Onion addresses version 2 are not supported anymore by tor",
UserWarning
)
if hidden_service_path: if hidden_service_path:
try: try:

@ -1,5 +1,5 @@
[tox] [tox]
envlist = py36, py37, py38 envlist = py36, py37, py38, py39
skip_missing_interpreters = true skip_missing_interpreters = true
isolated_build = true isolated_build = true

Loading…
Cancel
Save