summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Makefile8
-rw-r--r--leekspin/server.py21
-rw-r--r--requirements.txt3
3 files changed, 28 insertions, 4 deletions
diff --git a/Makefile b/Makefile
index 02dd4d6..e50d615 100644
--- a/Makefile
+++ b/Makefile
@@ -14,6 +14,7 @@
.DEFAULT: install test
VERSION:=$(shell git describe)
+GNUPG:=$(shell which gpg2)
all:
python setup.py build
@@ -83,6 +84,7 @@ coverage:
-firefox coverage-html/index.html
upload: clean-all
- torsocks python setup.py bdist_egg upload --sign
- #torsocks python setup.py bdist_wheel upload --sign
- torsocks python setup.py sdist --formats=gztar,zip upload --sign
+ python setup.py bdist_egg
+ #python setup.py bdist_wheel
+ python setup.py sdist --formats=gztar,zip
+ twine upload --sign --sign-with "$(GNUPG)" --skip-existing dist/*
diff --git a/leekspin/server.py b/leekspin/server.py
index 00fd9e1..ae1afcf 100644
--- a/leekspin/server.py
+++ b/leekspin/server.py
@@ -56,6 +56,9 @@ def generateServerDescriptor(nick, fingerprint, timestamp,
if not bridge:
doc.append(b"%s" % makeHSDirLine(vers))
+ if bridge:
+ doc.append(b"%s" % makeBridgeDistributionRequestLine())
+
doc.append(b"contact Somebody <somebody@example.com>")
if publicNTORKey is not None:
@@ -68,6 +71,24 @@ def generateServerDescriptor(nick, fingerprint, timestamp,
return unsignedDescriptor
+def makeBridgeDistributionRequestLine():
+ """Generate a ``bridge-distribution-request`` line.
+
+ :rtype: str
+ :returns: An ``@type bridge-server-descriptor``
+ ``bridge-distribution-request`` line.
+ """
+ methods = [
+ "any",
+ "none",
+ "https",
+ "email",
+ "moat",
+ "hyphae",
+ ]
+
+ return b"bridge-distribution-request %s" % random.choice(methods)
+
def makeProtocolsLine(version=None):
"""Generate an appropriate ``[bridge-]server-descriptor`` ``protocols``
line.
diff --git a/requirements.txt b/requirements.txt
index 8d8252d..ab1c103 100644
--- a/requirements.txt
+++ b/requirements.txt
@@ -1,4 +1,5 @@
ipaddr==2.1.10
PyNaCl==0.2.3
-PyOpenSSL==0.14
+PyOpenSSL==16.2.0
pycrypto==2.6.1
+twine==1.9.1