rev278, Allow clone sites that does not have domain, Publishing without peers is a success, File size 0 on non exists files, Benchmark TLS1

This commit is contained in:
HelloZeroNet 2015-07-07 03:14:45 +02:00
parent 3bd1c119eb
commit 417c6eb96f
6 changed files with 12 additions and 6 deletions

View file

@ -45,6 +45,7 @@ Decentralized websites using Bitcoin crypto and the BitTorrent network - http://
other peers.
#### [Slideshow about ZeroNet cryptography, site updates, multi-user sites »](https://docs.google.com/presentation/d/1_2qK1IuOKJ51pgBvllZ9Yu7Au2l551t3XBgyTSvilew/pub?start=false&loop=false&delayms=3000)
#### [Frequently asked questions »](http://zeronet.readthedocs.org/en/latest/faq/)

View file

@ -4,7 +4,7 @@ import ConfigParser
class Config(object):
def __init__(self):
self.version = "0.3.1"
self.rev = 267
self.rev = 278
self.parser = self.createArguments()
argv = sys.argv[:] # Copy command line arguments
argv = self.parseConfig(argv) # Add arguments from config file

View file

@ -327,7 +327,8 @@ class Site:
# Copy root content.json
if not new_site.storage.isFile("content.json") and not overwrite: # Content.json not exist yet, create a new one from source site
content_json = self.storage.loadJson("content.json")
del content_json["domain"]
if "domain" in content_json:
del content_json["domain"]
content_json["title"] = "my"+content_json["title"]
content_json["cloned_from"] = self.address
if address_index: content_json["address_index"] = address_index # Site owner's BIP32 index

View file

@ -179,7 +179,11 @@ class SiteStorage:
# Get file size
def getSize(self, inner_path):
return os.path.getsize(self.getPath(inner_path))
path = self.getPath(inner_path)
if os.path.isfile(path):
return os.path.getsize(path)
else:
return 0
# File exist

View file

@ -31,7 +31,7 @@ def handle(sock_raw, addr):
break
elif line == "gotssl\n":
sock.sendall("yes\n")
sock = gevent.ssl.wrap_socket(sock_raw, server_side=True, keyfile='data/key-rsa.pem', certfile='data/cert-rsa.pem', ciphers=ciphers)
sock = gevent.ssl.wrap_socket(sock_raw, server_side=True, keyfile='data/key-rsa.pem', certfile='data/cert-rsa.pem', ciphers=ciphers, ssl_version=ssl.PROTOCOL_TLSv1)
else:
sock.sendall(data)
except Exception, err:
@ -54,7 +54,7 @@ server.start()
total_num = 0
total_bytes = 0
clipher = None
ciphers = "ECDHE-ECDSA-AES128-GCM-SHA256:ECDH+AES128:ECDHE-RSA-AES128-GCM-SHA256:AES128-GCM-SHA256:AES128-SHA256:HIGH:!aNULL:!eNULL:!EXPORT:!DSS:!DES:!RC4:!3DES:!MD5:!PSK"
ciphers = "ECDHE-ECDSA-AES128-GCM-SHA256:ECDH+AES128:ECDHE-RSA-AES128-GCM-SHA256:AES128-GCM-SHA256:AES128-SHA256:AES128-SHA:HIGH:!aNULL:!eNULL:!EXPORT:!DSS:!DES:!RC4:!3DES:!MD5:!PSK"
# ctx = ssl.SSLContext(ssl.PROTOCOL_SSLv23)

View file

@ -277,7 +277,7 @@ class UiWebsocket(object):
if len(site.peers) == 0:
if sys.modules["main"].file_server.port_opened:
if notification: self.cmd("notification", ["info", "No peers found, but your content is ready to access."])
self.response(to, "No peers found, but your content is ready to access.")
self.response(to, "ok")
else:
if notification: self.cmd("notification", ["info", "Your network connection is restricted. Please, open <b>"+str(config.fileserver_port)+"</b> port <br>on your router to make your site accessible for everyone."])
self.response(to, "Port not opened.")