Rev903, FeedQuery command only available for ADMIN sites, Show bad files in sidebar, Log unknown messages, Add and check inner_path and site address on sign/verify, Better peer cleanup limit, Log site load times, Testcase for address and inner_path verification, Re-sign testsite with new fields, Fix unnecessary loading screen display when browsing sub-folder with index.html, Fix safari notification width
This commit is contained in:
parent
4885d2be79
commit
1dbc33445f
20 changed files with 218 additions and 123 deletions
|
@ -12,6 +12,9 @@ class UiWebsocketPlugin(object):
|
|||
self.response(to, feeds)
|
||||
|
||||
def actionFeedQuery(self, to):
|
||||
if "ADMIN" not in self.site.settings["permissions"]:
|
||||
return self.response(to, "FeedQuery not allowed")
|
||||
|
||||
from Site import SiteManager
|
||||
rows = []
|
||||
for address, site_data in self.user.sites.iteritems():
|
||||
|
|
|
@ -254,6 +254,21 @@ class UiWebsocketPlugin(object):
|
|||
</li>
|
||||
""".format(**locals()))
|
||||
|
||||
def sidebarRenderBadFiles(self, body, site):
|
||||
body.append("""
|
||||
<li>
|
||||
<label>Missing files:</label>
|
||||
<ul class='filelist'>
|
||||
""")
|
||||
|
||||
for bad_file in site.bad_files.keys():
|
||||
body.append("<li class='color-red'>%s</li>" % bad_file)
|
||||
|
||||
body.append("""
|
||||
</ul>
|
||||
</li>
|
||||
""")
|
||||
|
||||
def sidebarRenderDbOptions(self, body, site):
|
||||
if not site.storage.db:
|
||||
return False
|
||||
|
@ -352,6 +367,8 @@ class UiWebsocketPlugin(object):
|
|||
has_optional = self.sidebarRenderOptionalFileStats(body, site)
|
||||
if has_optional:
|
||||
self.sidebarRenderOptionalFileSettings(body, site)
|
||||
if site.bad_files:
|
||||
self.sidebarRenderBadFiles(body, site)
|
||||
self.sidebarRenderDbOptions(body, site)
|
||||
self.sidebarRenderIdentity(body, site)
|
||||
|
||||
|
|
|
@ -65,6 +65,9 @@
|
|||
.graph-legend b { text-align: right; display: inline-block; width: 50px; float: right; font-weight: normal; }
|
||||
.graph-legend li:before { content: '\2022'; font-size: 23px; line-height: 0px; vertical-align: -3px; margin-right: 5px; }
|
||||
|
||||
.filelist { font-size: 12px; font-family: monospace; margin: 0px; padding: 0px; list-style-type: none; line-height: 1.5em; }
|
||||
.filelist li:before { content: '\2022'; font-size: 11px; line-height: 0px; vertical-align: 0px; margin-right: 5px; color: #FFBE00; }
|
||||
|
||||
/* COLORS */
|
||||
|
||||
.back-green { background-color: #2ECC71 }
|
||||
|
|
|
@ -119,6 +119,9 @@
|
|||
.graph-legend b { text-align: right; display: inline-block; width: 50px; float: right; font-weight: normal; }
|
||||
.graph-legend li:before { content: '\2022'; font-size: 23px; line-height: 0px; vertical-align: -3px; margin-right: 5px; }
|
||||
|
||||
.filelist { font-size: 12px; font-family: monospace; margin: 0px; padding: 0px; list-style-type: none; line-height: 1.5em; }
|
||||
.filelist li:before { content: '\2022'; font-size: 11px; line-height: 0px; vertical-align: 0px; margin-right: 5px; color: #FFBE00; }
|
||||
|
||||
/* COLORS */
|
||||
|
||||
.back-green { background-color: #2ECC71 }
|
||||
|
|
|
@ -8,7 +8,7 @@ class Config(object):
|
|||
|
||||
def __init__(self, argv):
|
||||
self.version = "0.3.6"
|
||||
self.rev = 900
|
||||
self.rev = 903
|
||||
self.argv = argv
|
||||
self.action = None
|
||||
self.config_file = "zeronet.conf"
|
||||
|
|
|
@ -257,10 +257,11 @@ class Connection(object):
|
|||
self.server.handleRequest(self, message)
|
||||
else: # Old style response, no req_id definied
|
||||
if config.debug_socket:
|
||||
self.log("Old style response, waiting: %s" % self.waiting_requests.keys())
|
||||
last_req_id = min(self.waiting_requests.keys()) # Get the oldest waiting request and set it true
|
||||
self.waiting_requests[last_req_id].set(message)
|
||||
del self.waiting_requests[last_req_id] # Remove from waiting request
|
||||
self.log("Unknown message: %s, waiting: %s" % (message, self.waiting_requests.keys()))
|
||||
if self.waiting_requests:
|
||||
last_req_id = min(self.waiting_requests.keys()) # Get the oldest waiting request and set it true
|
||||
self.waiting_requests[last_req_id].set(message)
|
||||
del self.waiting_requests[last_req_id] # Remove from waiting request
|
||||
|
||||
# Incoming handshake set request
|
||||
def handleHandshake(self, message):
|
||||
|
|
|
@ -379,10 +379,12 @@ class ContentManager(object):
|
|||
|
||||
new_content["modified"] = time.time() # Add timestamp
|
||||
if inner_path == "content.json":
|
||||
new_content["address"] = self.site.address
|
||||
new_content["zeronet_version"] = config.version
|
||||
new_content["signs_required"] = content.get("signs_required", 1)
|
||||
|
||||
new_content["address"] = self.site.address
|
||||
new_content["inner_path"] = inner_path
|
||||
|
||||
# Verify private key
|
||||
from Crypt import CryptBitcoin
|
||||
self.log.info("Verifying private key...")
|
||||
|
@ -484,6 +486,16 @@ class ContentManager(object):
|
|||
|
||||
site_size_limit = self.site.getSizeLimit() * 1024 * 1024
|
||||
|
||||
# Check site address
|
||||
if content.get("address") and content["address"] != self.site.address:
|
||||
self.log.error("%s: Wrong site address: %s != %s" % (inner_path, content["address"], self.site.address))
|
||||
return False
|
||||
|
||||
# Check file inner path
|
||||
if content.get("inner_path") and content["inner_path"] != inner_path:
|
||||
self.log.error("%s: Wrong inner_path: %s" % (inner_path, content["inner_path"]))
|
||||
return False
|
||||
|
||||
# Check total site size limit
|
||||
if site_size > site_size_limit:
|
||||
self.log.error("%s: Site too large %s > %s, aborting task..." % (inner_path, site_size, site_size_limit))
|
||||
|
|
|
@ -777,7 +777,7 @@ class Site(object):
|
|||
if time.time() - peer.time_found > 60 * 60 * 4: # Not found on tracker or via pex in last 4 hour
|
||||
peer.remove()
|
||||
removed += 1
|
||||
if removed > 5: # Don't remove too much at once
|
||||
if removed > len(peers)*0.1: # Don't remove too much at once
|
||||
break
|
||||
|
||||
if removed:
|
||||
|
|
|
@ -2,6 +2,7 @@ import json
|
|||
import logging
|
||||
import re
|
||||
import os
|
||||
import time
|
||||
|
||||
from Plugin import PluginManager
|
||||
from Config import config
|
||||
|
@ -23,7 +24,9 @@ class SiteManager(object):
|
|||
# Load new adresses
|
||||
for address in json.load(open("%s/sites.json" % config.data_dir)):
|
||||
if address not in self.sites and os.path.isfile("%s/%s/content.json" % (config.data_dir, address)):
|
||||
s = time.time()
|
||||
self.sites[address] = Site(address)
|
||||
logging.debug("Loaded site %s in %.3fs" % (address, time.time()-s))
|
||||
added += 1
|
||||
address_found.append(address)
|
||||
|
||||
|
@ -77,8 +80,8 @@ class SiteManager(object):
|
|||
|
||||
# Lazy load sites
|
||||
def list(self):
|
||||
logging.debug("Loading sites...")
|
||||
if self.sites is None: # Not loaded yet
|
||||
logging.debug("Loading sites...")
|
||||
self.load()
|
||||
return self.sites
|
||||
|
||||
|
|
|
@ -132,3 +132,44 @@ class TestContent:
|
|||
file_info_optional = site.content_manager.getFileInfo("data/users/1CjfbrbwtP8Y2QjPy12vpTATkUT7oSiPQ9/peanut-butter-jelly-time.gif")
|
||||
assert "sha512" in file_info_optional
|
||||
assert file_info_optional["optional"] is True
|
||||
|
||||
def testVerify(self, site):
|
||||
privatekey = "5KUh3PvNm5HUWoCfSUfcYvfQ2g3PrRNJWr6Q9eqdBGu23mtMntv"
|
||||
inner_path = "data/test_include/content.json"
|
||||
data_dict = site.content_manager.contents[inner_path]
|
||||
data = StringIO(json.dumps(data_dict))
|
||||
|
||||
# Re-sign
|
||||
data_dict["signs"] = {
|
||||
"1TeSTvb4w2PWE81S2rEELgmX2GCCExQGT": CryptBitcoin.sign(json.dumps(data_dict, sort_keys=True), privatekey)
|
||||
}
|
||||
assert site.content_manager.verifyFile(inner_path, data, ignore_same=False)
|
||||
|
||||
# Wrong address
|
||||
data_dict["address"] = "Othersite"
|
||||
del data_dict["signs"]
|
||||
data_dict["signs"] = {
|
||||
"1TeSTvb4w2PWE81S2rEELgmX2GCCExQGT": CryptBitcoin.sign(json.dumps(data_dict, sort_keys=True), privatekey)
|
||||
}
|
||||
data = StringIO(json.dumps(data_dict))
|
||||
assert not site.content_manager.verifyFile(inner_path, data, ignore_same=False)
|
||||
|
||||
# Wrong inner_path
|
||||
data_dict["address"] = "1TeSTvb4w2PWE81S2rEELgmX2GCCExQGT"
|
||||
data_dict["inner_path"] = "content.json"
|
||||
del data_dict["signs"]
|
||||
data_dict["signs"] = {
|
||||
"1TeSTvb4w2PWE81S2rEELgmX2GCCExQGT": CryptBitcoin.sign(json.dumps(data_dict, sort_keys=True), privatekey)
|
||||
}
|
||||
data = StringIO(json.dumps(data_dict))
|
||||
assert not site.content_manager.verifyFile(inner_path, data, ignore_same=False)
|
||||
|
||||
# Everything right again
|
||||
data_dict["address"] = "1TeSTvb4w2PWE81S2rEELgmX2GCCExQGT"
|
||||
data_dict["inner_path"] = inner_path
|
||||
del data_dict["signs"]
|
||||
data_dict["signs"] = {
|
||||
"1TeSTvb4w2PWE81S2rEELgmX2GCCExQGT": CryptBitcoin.sign(json.dumps(data_dict, sort_keys=True), privatekey)
|
||||
}
|
||||
data = StringIO(json.dumps(data_dict))
|
||||
assert site.content_manager.verifyFile(inner_path, data, ignore_same=False)
|
||||
|
|
|
@ -1,136 +1,137 @@
|
|||
{
|
||||
"address": "1TeSTvb4w2PWE81S2rEELgmX2GCCExQGT",
|
||||
"background-color": "white",
|
||||
"description": "Blogging platform Demo",
|
||||
"domain": "Blog.ZeroNetwork.bit",
|
||||
"address": "1TeSTvb4w2PWE81S2rEELgmX2GCCExQGT",
|
||||
"background-color": "white",
|
||||
"description": "Blogging platform Demo",
|
||||
"domain": "Blog.ZeroNetwork.bit",
|
||||
"files": {
|
||||
"css/all.css": {
|
||||
"sha512": "65ddd3a2071a0f48c34783aa3b1bde4424bdea344630af05a237557a62bd55dc",
|
||||
"sha512": "65ddd3a2071a0f48c34783aa3b1bde4424bdea344630af05a237557a62bd55dc",
|
||||
"size": 112710
|
||||
},
|
||||
},
|
||||
"data-default/data.json": {
|
||||
"sha512": "3f5c5a220bde41b464ab116cce0bd670dd0b4ff5fe4a73d1dffc4719140038f2",
|
||||
"sha512": "3f5c5a220bde41b464ab116cce0bd670dd0b4ff5fe4a73d1dffc4719140038f2",
|
||||
"size": 196
|
||||
},
|
||||
},
|
||||
"data-default/users/content-default.json": {
|
||||
"sha512": "0603ce08f7abb92b3840ad0cf40e95ea0b3ed3511b31524d4d70e88adba83daa",
|
||||
"sha512": "0603ce08f7abb92b3840ad0cf40e95ea0b3ed3511b31524d4d70e88adba83daa",
|
||||
"size": 679
|
||||
},
|
||||
},
|
||||
"data/data.json": {
|
||||
"sha512": "0f2321c905b761a05c360a389e1de149d952b16097c4ccf8310158356e85fb52",
|
||||
"sha512": "0f2321c905b761a05c360a389e1de149d952b16097c4ccf8310158356e85fb52",
|
||||
"size": 31126
|
||||
},
|
||||
},
|
||||
"data/img/autoupdate.png": {
|
||||
"sha512": "d2b4dc8e0da2861ea051c0c13490a4eccf8933d77383a5b43de447c49d816e71",
|
||||
"sha512": "d2b4dc8e0da2861ea051c0c13490a4eccf8933d77383a5b43de447c49d816e71",
|
||||
"size": 24460
|
||||
},
|
||||
},
|
||||
"data/img/direct_domains.png": {
|
||||
"sha512": "5f14b30c1852735ab329b22496b1e2ea751cb04704789443ad73a70587c59719",
|
||||
"sha512": "5f14b30c1852735ab329b22496b1e2ea751cb04704789443ad73a70587c59719",
|
||||
"size": 16185
|
||||
},
|
||||
},
|
||||
"data/img/domain.png": {
|
||||
"sha512": "ce87e0831f4d1e95a95d7120ca4d33f8273c6fce9f5bbedf7209396ea0b57b6a",
|
||||
"sha512": "ce87e0831f4d1e95a95d7120ca4d33f8273c6fce9f5bbedf7209396ea0b57b6a",
|
||||
"size": 11881
|
||||
},
|
||||
},
|
||||
"data/img/memory.png": {
|
||||
"sha512": "dd56515085b4a79b5809716f76f267ec3a204be3ee0d215591a77bf0f390fa4e",
|
||||
"sha512": "dd56515085b4a79b5809716f76f267ec3a204be3ee0d215591a77bf0f390fa4e",
|
||||
"size": 12775
|
||||
},
|
||||
},
|
||||
"data/img/multiuser.png": {
|
||||
"sha512": "88e3f795f9b86583640867897de6efc14e1aa42f93e848ed1645213e6cc210c6",
|
||||
"sha512": "88e3f795f9b86583640867897de6efc14e1aa42f93e848ed1645213e6cc210c6",
|
||||
"size": 29480
|
||||
},
|
||||
},
|
||||
"data/img/progressbar.png": {
|
||||
"sha512": "23d592ae386ce14158cec34d32a3556771725e331c14d5a4905c59e0fe980ebf",
|
||||
"sha512": "23d592ae386ce14158cec34d32a3556771725e331c14d5a4905c59e0fe980ebf",
|
||||
"size": 13294
|
||||
},
|
||||
},
|
||||
"data/img/slides.png": {
|
||||
"sha512": "1933db3b90ab93465befa1bd0843babe38173975e306286e08151be9992f767e",
|
||||
"sha512": "1933db3b90ab93465befa1bd0843babe38173975e306286e08151be9992f767e",
|
||||
"size": 14439
|
||||
},
|
||||
},
|
||||
"data/img/slots_memory.png": {
|
||||
"sha512": "82a250e6da909d7f66341e5b5c443353958f86728cd3f06e988b6441e6847c29",
|
||||
"sha512": "82a250e6da909d7f66341e5b5c443353958f86728cd3f06e988b6441e6847c29",
|
||||
"size": 9488
|
||||
},
|
||||
},
|
||||
"data/img/trayicon.png": {
|
||||
"sha512": "e7ae65bf280f13fb7175c1293dad7d18f1fcb186ebc9e1e33850cdaccb897b8f",
|
||||
"sha512": "e7ae65bf280f13fb7175c1293dad7d18f1fcb186ebc9e1e33850cdaccb897b8f",
|
||||
"size": 19040
|
||||
},
|
||||
},
|
||||
"dbschema.json": {
|
||||
"sha512": "7b756e8e475d4d6b345a24e2ae14254f5c6f4aa67391a94491a026550fe00df8",
|
||||
"sha512": "7b756e8e475d4d6b345a24e2ae14254f5c6f4aa67391a94491a026550fe00df8",
|
||||
"size": 1529
|
||||
},
|
||||
},
|
||||
"img/loading.gif": {
|
||||
"sha512": "8a42b98962faea74618113166886be488c09dad10ca47fe97005edc5fb40cc00",
|
||||
"sha512": "8a42b98962faea74618113166886be488c09dad10ca47fe97005edc5fb40cc00",
|
||||
"size": 723
|
||||
},
|
||||
},
|
||||
"index.html": {
|
||||
"sha512": "c4039ebfc4cb6f116cac05e803a18644ed70404474a572f0d8473f4572f05df3",
|
||||
"sha512": "c4039ebfc4cb6f116cac05e803a18644ed70404474a572f0d8473f4572f05df3",
|
||||
"size": 4667
|
||||
},
|
||||
},
|
||||
"js/all.js": {
|
||||
"sha512": "034c97535f3c9b3fbebf2dcf61a38711dae762acf1a99168ae7ddc7e265f582c",
|
||||
"sha512": "034c97535f3c9b3fbebf2dcf61a38711dae762acf1a99168ae7ddc7e265f582c",
|
||||
"size": 201178
|
||||
}
|
||||
},
|
||||
},
|
||||
"files_optional": {
|
||||
"data/img/zeroblog-comments.png": {
|
||||
"sha512": "efe4e815a260e555303e5c49e550a689d27a8361f64667bd4a91dbcccb83d2b4",
|
||||
"sha512": "efe4e815a260e555303e5c49e550a689d27a8361f64667bd4a91dbcccb83d2b4",
|
||||
"size": 24001
|
||||
},
|
||||
},
|
||||
"data/img/zeroid.png": {
|
||||
"sha512": "b46d541a9e51ba2ddc8a49955b7debbc3b45fd13467d3c20ef104e9d938d052b",
|
||||
"sha512": "b46d541a9e51ba2ddc8a49955b7debbc3b45fd13467d3c20ef104e9d938d052b",
|
||||
"size": 18875
|
||||
},
|
||||
},
|
||||
"data/img/zeroname.png": {
|
||||
"sha512": "bab45a1bb2087b64e4f69f756b2ffa5ad39b7fdc48c83609cdde44028a7a155d",
|
||||
"sha512": "bab45a1bb2087b64e4f69f756b2ffa5ad39b7fdc48c83609cdde44028a7a155d",
|
||||
"size": 36031
|
||||
},
|
||||
},
|
||||
"data/img/zerotalk-mark.png": {
|
||||
"sha512": "a335b2fedeb8d291ca68d3091f567c180628e80f41de4331a5feb19601d078af",
|
||||
"sha512": "a335b2fedeb8d291ca68d3091f567c180628e80f41de4331a5feb19601d078af",
|
||||
"size": 44862
|
||||
},
|
||||
},
|
||||
"data/img/zerotalk-upvote.png": {
|
||||
"sha512": "b1ffd7f948b4f99248dde7efe256c2efdfd997f7e876fb9734f986ef2b561732",
|
||||
"sha512": "b1ffd7f948b4f99248dde7efe256c2efdfd997f7e876fb9734f986ef2b561732",
|
||||
"size": 41092
|
||||
},
|
||||
},
|
||||
"data/img/zerotalk.png": {
|
||||
"sha512": "54d10497a1ffca9a4780092fd1bd158c15f639856d654d2eb33a42f9d8e33cd8",
|
||||
"sha512": "54d10497a1ffca9a4780092fd1bd158c15f639856d654d2eb33a42f9d8e33cd8",
|
||||
"size": 26606
|
||||
},
|
||||
},
|
||||
"data/optional.txt": {
|
||||
"sha512": "c6f81db0e9f8206c971c9e5826e3ba823ffbb1a3a900f8047652a8bf78ea98fd",
|
||||
"sha512": "c6f81db0e9f8206c971c9e5826e3ba823ffbb1a3a900f8047652a8bf78ea98fd",
|
||||
"size": 6
|
||||
}
|
||||
},
|
||||
"ignore": "((js|css)/(?!all.(js|css))|data/.*db|data/users/.*/.*|data/test_include/.*)",
|
||||
},
|
||||
"ignore": "((js|css)/(?!all.(js|css))|data/.*db|data/users/.*/.*|data/test_include/.*)",
|
||||
"includes": {
|
||||
"data/test_include/content.json": {
|
||||
"added": 1424976057,
|
||||
"files_allowed": "data.json",
|
||||
"includes_allowed": false,
|
||||
"max_size": 20000,
|
||||
"signers": [ "15ik6LeBWnACWfaika1xqGapRZ1zh3JpCo" ],
|
||||
"signers_required": 1,
|
||||
"user_id": 47,
|
||||
"added": 1424976057,
|
||||
"files_allowed": "data.json",
|
||||
"includes_allowed": false,
|
||||
"max_size": 20000,
|
||||
"signers": [ "15ik6LeBWnACWfaika1xqGapRZ1zh3JpCo" ],
|
||||
"signers_required": 1,
|
||||
"user_id": 47,
|
||||
"user_name": "test"
|
||||
},
|
||||
},
|
||||
"data/users/content.json": {
|
||||
"signers": [ "1LSxsKfC9S9TVXGGNSM3vPHjyW82jgCX5f" ],
|
||||
"signers": [ "1LSxsKfC9S9TVXGGNSM3vPHjyW82jgCX5f" ],
|
||||
"signers_required": 1
|
||||
}
|
||||
},
|
||||
"modified": 1447360051.327,
|
||||
"optional": "(data/img/zero.*|data/optional.txt)",
|
||||
},
|
||||
"inner_path": "content.json",
|
||||
"modified": 1455627530.109,
|
||||
"optional": "(data/img/zero.*|data/optional.txt)",
|
||||
"sign": [
|
||||
56704502697521630823845805057259088854630715424341172278564490141452525844500,
|
||||
111213707061262926968239474633357178510296590563162180659113023094835495771512
|
||||
],
|
||||
"signers_sign": "HDNmWJHM2diYln4pkdL+qYOvgE7MdwayzeG+xEUZBgp1HtOjBJS+knDEVQsBkjcOPicDG2it1r6R1eQrmogqSP0=",
|
||||
56763270038560745436697526128861466167000101701098791135393385088076329237645,
|
||||
46423470772308783254156002360537851856745613551416274134961612754829184383599
|
||||
],
|
||||
"signers_sign": "HDNmWJHM2diYln4pkdL+qYOvgE7MdwayzeG+xEUZBgp1HtOjBJS+knDEVQsBkjcOPicDG2it1r6R1eQrmogqSP0=",
|
||||
"signs": {
|
||||
"1TeSTvb4w2PWE81S2rEELgmX2GCCExQGT": "G9Q5OVyYWlrvBX/s3AQTwchJr2ZefBwQdQEWyhkBJKsMDLZS6nt7o3hBsxm26FpKaBmpOfGpg2O1MQv6U0nUkiI="
|
||||
},
|
||||
"signs_required": 1,
|
||||
"title": "ZeroBlog",
|
||||
"zeronet_version": "0.3.3"
|
||||
"1TeSTvb4w2PWE81S2rEELgmX2GCCExQGT": "G/FMSzye50ajO+23QXkWG1BubOlDGj85qD6U4rg3H4eZNpVhb0o6M+l16HpFka+F/VUg+fYXlaZhLjlLj2tJ4HY="
|
||||
},
|
||||
"signs_required": 1,
|
||||
"title": "ZeroBlog",
|
||||
"zeronet_version": "0.3.6"
|
||||
}
|
|
@ -1,12 +1,14 @@
|
|||
{
|
||||
"address": "1TeSTvb4w2PWE81S2rEELgmX2GCCExQGT",
|
||||
"files": {
|
||||
"data.json": {
|
||||
"sha512": "369d4e780cc80504285f13774ca327fe725eed2d813aad229e62356b07365906",
|
||||
"sha512": "369d4e780cc80504285f13774ca327fe725eed2d813aad229e62356b07365906",
|
||||
"size": 505
|
||||
}
|
||||
},
|
||||
"modified": 1443088412.024,
|
||||
},
|
||||
"inner_path": "data/test_include/content.json",
|
||||
"modified": 1455627532.816,
|
||||
"signs": {
|
||||
"1TeSTvb4w2PWE81S2rEELgmX2GCCExQGT": "HPpRa/7ic/03aJ6vfz3zt3ezsnkDeaet85HGS3Rm9vCXWGsdOXboMynb/sZcTfPMC1bQ3zLRdUNMqmifKw/gnNg="
|
||||
"1TeSTvb4w2PWE81S2rEELgmX2GCCExQGT": "HO9fdfTZUqwp8j0WfimcopME7Ki7qHWfrTP7VT/jyFGZWkiL3H7wfBZfNYTG2H48foa+O8X3KMZnFcdsUXsEn60="
|
||||
}
|
||||
}
|
|
@ -1,22 +1,24 @@
|
|||
{
|
||||
"cert_auth_type": "web",
|
||||
"cert_sign": "HBsTrjTmv+zD1iY93tSci8n9DqdEtYwzxJmRppn4/b+RYktcANGm5tXPOb+Duw3AJcgWDcGUvQVgN1D9QAwIlCw=",
|
||||
"cert_user_id": "toruser@zeroid.bit",
|
||||
"address": "1TeSTvb4w2PWE81S2rEELgmX2GCCExQGT",
|
||||
"cert_auth_type": "web",
|
||||
"cert_sign": "HBsTrjTmv+zD1iY93tSci8n9DqdEtYwzxJmRppn4/b+RYktcANGm5tXPOb+Duw3AJcgWDcGUvQVgN1D9QAwIlCw=",
|
||||
"cert_user_id": "toruser@zeroid.bit",
|
||||
"files": {
|
||||
"data.json": {
|
||||
"sha512": "4868b5e6d70a55d137db71c2e276bda80437e0235ac670962acc238071296b45",
|
||||
"sha512": "4868b5e6d70a55d137db71c2e276bda80437e0235ac670962acc238071296b45",
|
||||
"size": 168
|
||||
}
|
||||
},
|
||||
},
|
||||
"files_optional": {
|
||||
"peanut-butter-jelly-time.gif": {
|
||||
"sha512": "a238fd27bda2a06f07f9f246954b34dcf82e6472aebdecc2c5dc1f01a50721ef",
|
||||
"sha512": "a238fd27bda2a06f07f9f246954b34dcf82e6472aebdecc2c5dc1f01a50721ef",
|
||||
"size": 1606
|
||||
}
|
||||
},
|
||||
"modified": 1447360055.489,
|
||||
"optional": ".*\\.(jpg|png|gif)",
|
||||
},
|
||||
"inner_path": "data/users/1CjfbrbwtP8Y2QjPy12vpTATkUT7oSiPQ9/content.json",
|
||||
"modified": 1455627534.538,
|
||||
"optional": ".*\\.(jpg|png|gif)",
|
||||
"signs": {
|
||||
"1TeSTvb4w2PWE81S2rEELgmX2GCCExQGT": "HKdnxBP3KnBM57lsCFtqV2C2k60zWzD9hNVfvbY7uytzvGiFhFaV6VP4qcvhCWTBUnbuVzk3xPNFOctSdUCcoPk="
|
||||
"1TeSTvb4w2PWE81S2rEELgmX2GCCExQGT": "HIZ4xRMkGntdfcAtKdDPAHpuuW/wcufkDtiek0tfH3y8WUoUi3deAnidT9jqogFXyBiB4rzyOpRt9P44BrlVTk4="
|
||||
}
|
||||
}
|
|
@ -1,15 +1,17 @@
|
|||
{
|
||||
"cert_auth_type": "web",
|
||||
"cert_sign": "HBsTrjTmv+zD1iY93tSci8n9DqdEtYwzxJmRppn4/b+RYktcANGm5tXPOb+Duw3AJcgWDcGUvQVgN1D9QAwIlCw=",
|
||||
"cert_user_id": "toruser@zeroid.bit",
|
||||
"address": "1TeSTvb4w2PWE81S2rEELgmX2GCCExQGT",
|
||||
"cert_auth_type": "web",
|
||||
"cert_sign": "HBsTrjTmv+zD1iY93tSci8n9DqdEtYwzxJmRppn4/b+RYktcANGm5tXPOb+Duw3AJcgWDcGUvQVgN1D9QAwIlCw=",
|
||||
"cert_user_id": "toruser@zeroid.bit",
|
||||
"files": {
|
||||
"data.json": {
|
||||
"sha512": "4868b5e6d70a55d137db71c2e276bda80437e0235ac670962acc238071296b45",
|
||||
"sha512": "4868b5e6d70a55d137db71c2e276bda80437e0235ac670962acc238071296b45",
|
||||
"size": 168
|
||||
}
|
||||
},
|
||||
"modified": 1447360055.88,
|
||||
},
|
||||
"inner_path": "data/users/1J6UrZMkarjVg5ax9W4qThir3BFUikbW6C/content.json",
|
||||
"modified": 1455627535.065,
|
||||
"signs": {
|
||||
"1TeSTvb4w2PWE81S2rEELgmX2GCCExQGT": "G6HTP9PzwOM2Wee+FpXWBEHtj0MM+7qdBYvioW94ehZBjp8hUI1hQE4JGWSGm9ra+LIg5Cf6jPxLa8onQscn5z0="
|
||||
"1TeSTvb4w2PWE81S2rEELgmX2GCCExQGT": "G8u8uWLCcPSFlcEGJEM6LNEOeF+e0SNStXjECd3UKRvSXVB5H4so0RpSCmNxINmN1aLzy3+UTOHO7lvrua1lqzg="
|
||||
}
|
||||
}
|
|
@ -1,27 +1,29 @@
|
|||
{
|
||||
"files": {},
|
||||
"ignore": ".*",
|
||||
"modified": 1447360051.802,
|
||||
"address": "1TeSTvb4w2PWE81S2rEELgmX2GCCExQGT",
|
||||
"files": {},
|
||||
"ignore": ".*",
|
||||
"inner_path": "data/users/content.json",
|
||||
"modified": 1455627530.754,
|
||||
"signs": {
|
||||
"1TeSTvb4w2PWE81S2rEELgmX2GCCExQGT": "G9Io0btASe4xDPfiCMpP8TwNZ/35BTNlCQqIRpMtXtQjnNEEEJ5H4eFdDma+GMcnzT9SSxmQ07sG8fQL61r2H/o="
|
||||
},
|
||||
"1TeSTvb4w2PWE81S2rEELgmX2GCCExQGT": "HN7lUpibow9whR2O1C0reOX847Vs7PqCLuLfycV4cG++YlQ7xOxcYzEI3heSz7NnjVa63YU60mwndvxNEGow3Ag="
|
||||
},
|
||||
"user_contents": {
|
||||
"cert_signers": {
|
||||
"zeroid.bit": [ "1iD5ZQJMNXu43w1qLB8sfdHVKppVMduGz" ]
|
||||
},
|
||||
},
|
||||
"permission_rules": {
|
||||
".*": {
|
||||
"files_allowed": "data.json",
|
||||
"files_allowed_optional": ".*\\.(png|jpg|gif)",
|
||||
"max_size": 10000,
|
||||
"max_size_optional": 10000000,
|
||||
"files_allowed": "data.json",
|
||||
"files_allowed_optional": ".*\\.(png|jpg|gif)",
|
||||
"max_size": 10000,
|
||||
"max_size_optional": 10000000,
|
||||
"signers": [ "14wgQ4VDDZNoRMFF4yCDuTrBSHmYhL3bet" ]
|
||||
},
|
||||
"bitid/.*@zeroid.bit": { "max_size": 40000 },
|
||||
},
|
||||
"bitid/.*@zeroid.bit": { "max_size": 40000 },
|
||||
"bitmsg/.*@zeroid.bit": { "max_size": 15000 }
|
||||
},
|
||||
},
|
||||
"permissions": {
|
||||
"bad@zeroid.bit": false,
|
||||
"bad@zeroid.bit": false,
|
||||
"nofish@zeroid.bit": { "max_size": 100000 }
|
||||
}
|
||||
}
|
||||
|
|
|
@ -219,6 +219,9 @@ class UiRequest(object):
|
|||
if not file_inner_path:
|
||||
file_inner_path = "index.html" # If inner path defaults to index.html
|
||||
|
||||
if file_inner_path.endswith("/"):
|
||||
file_inner_path = file_inner_path + "index.html"
|
||||
|
||||
address = re.sub("/.*", "", path.lstrip("/"))
|
||||
if self.isProxyRequest() and (not path or "/" in path[1:]):
|
||||
file_url = re.sub(".*/", "", inner_path)
|
||||
|
|
|
@ -384,7 +384,7 @@ else
|
|||
ws_url = proto.ws + ":" + origin.replace(proto.http+":", "") + "/Websocket?wrapper_key=" + window.wrapper_key
|
||||
|
||||
|
||||
if window.opener
|
||||
if window.opener and window.postmessage_nonce_security == false
|
||||
# Window opener security problem workaround: Open a new window, close this one
|
||||
console.log "Opener present:", window.opener
|
||||
setTimeout ( -> # Wait 200ms to parent tab closing
|
||||
|
@ -400,6 +400,6 @@ if window.opener
|
|||
window.location.reload()
|
||||
# Opener gone, continue init
|
||||
# window.wrapper = new Wrapper(ws_url)
|
||||
), 100
|
||||
), 150
|
||||
else
|
||||
window.wrapper = new Wrapper(ws_url)
|
|
@ -49,7 +49,7 @@ a { color: black }
|
|||
text-align: center; background-color: #e74c3c; line-height: 45px; vertical-align: bottom; font-size: 40px; color: white;
|
||||
}
|
||||
.notification .body {
|
||||
max-width: 560px; padding-left: 14px; padding-right: 60px; height: 40px; vertical-align: middle; display: table;
|
||||
padding-left: 14px; padding-right: 60px; height: 40px; vertical-align: middle; display: table;
|
||||
background-color: white; left: 50px; top: 0; position: relative; padding-top: 5px; padding-bottom: 5px;
|
||||
}
|
||||
.notification.long .body { padding-top: 10px; padding-bottom: 10px }
|
||||
|
|
|
@ -54,7 +54,7 @@ a { color: black }
|
|||
text-align: center; background-color: #e74c3c; line-height: 45px; vertical-align: bottom; font-size: 40px; color: white;
|
||||
}
|
||||
.notification .body {
|
||||
max-width: 560px; padding-left: 14px; padding-right: 60px; height: 40px; vertical-align: middle; display: table;
|
||||
padding-left: 14px; padding-right: 60px; height: 40px; vertical-align: middle; display: table;
|
||||
background-color: white; left: 50px; top: 0; position: relative; padding-top: 5px; padding-bottom: 5px;
|
||||
}
|
||||
.notification.long .body { padding-top: 10px; padding-bottom: 10px }
|
||||
|
|
|
@ -1266,7 +1266,7 @@ jQuery.extend( jQuery.easing,
|
|||
|
||||
ws_url = proto.ws + ":" + origin.replace(proto.http + ":", "") + "/Websocket?wrapper_key=" + window.wrapper_key;
|
||||
|
||||
if (window.opener) {
|
||||
if (window.opener && window.postmessage_nonce_security === false) {
|
||||
console.log("Opener present:", window.opener);
|
||||
setTimeout((function() {
|
||||
var elem;
|
||||
|
@ -1281,7 +1281,7 @@ jQuery.extend( jQuery.easing,
|
|||
} else {
|
||||
return window.location.reload();
|
||||
}
|
||||
}), 100);
|
||||
}), 150);
|
||||
} else {
|
||||
window.wrapper = new Wrapper(ws_url);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue