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:
parent
3bd1c119eb
commit
417c6eb96f
6 changed files with 12 additions and 6 deletions
|
@ -45,6 +45,7 @@ Decentralized websites using Bitcoin crypto and the BitTorrent network - http://
|
||||||
other peers.
|
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)
|
#### [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/)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -4,7 +4,7 @@ import ConfigParser
|
||||||
class Config(object):
|
class Config(object):
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
self.version = "0.3.1"
|
self.version = "0.3.1"
|
||||||
self.rev = 267
|
self.rev = 278
|
||||||
self.parser = self.createArguments()
|
self.parser = self.createArguments()
|
||||||
argv = sys.argv[:] # Copy command line arguments
|
argv = sys.argv[:] # Copy command line arguments
|
||||||
argv = self.parseConfig(argv) # Add arguments from config file
|
argv = self.parseConfig(argv) # Add arguments from config file
|
||||||
|
|
|
@ -327,7 +327,8 @@ class Site:
|
||||||
# Copy root content.json
|
# 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
|
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")
|
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["title"] = "my"+content_json["title"]
|
||||||
content_json["cloned_from"] = self.address
|
content_json["cloned_from"] = self.address
|
||||||
if address_index: content_json["address_index"] = address_index # Site owner's BIP32 index
|
if address_index: content_json["address_index"] = address_index # Site owner's BIP32 index
|
||||||
|
|
|
@ -179,7 +179,11 @@ class SiteStorage:
|
||||||
|
|
||||||
# Get file size
|
# Get file size
|
||||||
def getSize(self, inner_path):
|
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
|
# File exist
|
||||||
|
|
|
@ -31,7 +31,7 @@ def handle(sock_raw, addr):
|
||||||
break
|
break
|
||||||
elif line == "gotssl\n":
|
elif line == "gotssl\n":
|
||||||
sock.sendall("yes\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:
|
else:
|
||||||
sock.sendall(data)
|
sock.sendall(data)
|
||||||
except Exception, err:
|
except Exception, err:
|
||||||
|
@ -54,7 +54,7 @@ server.start()
|
||||||
total_num = 0
|
total_num = 0
|
||||||
total_bytes = 0
|
total_bytes = 0
|
||||||
clipher = None
|
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)
|
# ctx = ssl.SSLContext(ssl.PROTOCOL_SSLv23)
|
||||||
|
|
||||||
|
|
|
@ -277,7 +277,7 @@ class UiWebsocket(object):
|
||||||
if len(site.peers) == 0:
|
if len(site.peers) == 0:
|
||||||
if sys.modules["main"].file_server.port_opened:
|
if sys.modules["main"].file_server.port_opened:
|
||||||
if notification: self.cmd("notification", ["info", "No peers found, but your content is ready to access."])
|
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:
|
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."])
|
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.")
|
self.response(to, "Port not opened.")
|
||||||
|
|
Loading…
Reference in a new issue