Rev493, Fix trayicon autostart detect, Dont leak details on ui_restrict
This commit is contained in:
parent
0241001205
commit
713baeab63
4 changed files with 11 additions and 13 deletions
|
@ -117,7 +117,7 @@ class ActionsPlugin(object):
|
||||||
cmd = " ".join(args)
|
cmd = " ".join(args)
|
||||||
|
|
||||||
# Dont open browser on autorun
|
# Dont open browser on autorun
|
||||||
cmd = cmd.replace("start.py", "zeronet.py").replace('"--open_browser"', "").replace('"default_browser"', "")
|
cmd = cmd.replace("start.py", "zeronet.py").replace('"--open_browser"', "").replace('"default_browser"', "").strip()
|
||||||
|
|
||||||
return "@echo off\ncd /D %s \n%s" % (os.getcwd(), cmd)
|
return "@echo off\ncd /D %s \n%s" % (os.getcwd(), cmd)
|
||||||
|
|
||||||
|
|
|
@ -8,7 +8,7 @@ class Config(object):
|
||||||
|
|
||||||
def __init__(self, argv):
|
def __init__(self, argv):
|
||||||
self.version = "0.3.2"
|
self.version = "0.3.2"
|
||||||
self.rev = 480
|
self.rev = 493
|
||||||
self.argv = argv
|
self.argv = argv
|
||||||
self.action = None
|
self.action = None
|
||||||
self.createParser()
|
self.createParser()
|
||||||
|
|
|
@ -4,8 +4,6 @@ import os
|
||||||
import mimetypes
|
import mimetypes
|
||||||
import json
|
import json
|
||||||
import cgi
|
import cgi
|
||||||
import string
|
|
||||||
import random
|
|
||||||
|
|
||||||
from Config import config
|
from Config import config
|
||||||
from Site import SiteManager
|
from Site import SiteManager
|
||||||
|
@ -44,7 +42,7 @@ class UiRequest(object):
|
||||||
# Call the request handler function base on path
|
# Call the request handler function base on path
|
||||||
def route(self, path):
|
def route(self, path):
|
||||||
if config.ui_restrict and self.env['REMOTE_ADDR'] not in config.ui_restrict: # Restict Ui access by ip
|
if config.ui_restrict and self.env['REMOTE_ADDR'] not in config.ui_restrict: # Restict Ui access by ip
|
||||||
return self.error403()
|
return self.error403(details=False)
|
||||||
|
|
||||||
path = re.sub("^http://zero[/]+", "/", path) # Remove begining http://zero/ for chrome extension
|
path = re.sub("^http://zero[/]+", "/", path) # Remove begining http://zero/ for chrome extension
|
||||||
path = re.sub("^http://", "/", path) # Remove begining http for chrome extension .bit access
|
path = re.sub("^http://", "/", path) # Remove begining http for chrome extension .bit access
|
||||||
|
@ -454,9 +452,9 @@ class UiRequest(object):
|
||||||
return self.formatError("Bad Request", message)
|
return self.formatError("Bad Request", message)
|
||||||
|
|
||||||
# You are not allowed to access this
|
# You are not allowed to access this
|
||||||
def error403(self, message=""):
|
def error403(self, message="", details=True):
|
||||||
self.sendHeader(403)
|
self.sendHeader(403)
|
||||||
return self.formatError("Forbidden", message)
|
return self.formatError("Forbidden", message, details=details)
|
||||||
|
|
||||||
# Send file not found error
|
# Send file not found error
|
||||||
def error404(self, path=""):
|
def error404(self, path=""):
|
||||||
|
|
Loading…
Reference in a new issue