示例#1
0
 def __init__(self, CaptainstreasureChest = False):
     super().__init__()
     self.policyJSONFile = {
                             "levels": {
                                 "0": {
                                     "handshake": 4,
                                     "connIdle": 300,
                                     "uplinkOnly": 5,
                                     "downlinkOnly": 30
                                     }
                                 }
                            }
     
     self.template = {
                "handshake": 4,
                "connIdle": 300,
                "uplinkOnly": 5,
                "downlinkOnly": 30
             }
     self.translate = QCoreApplication.translate
     if (CaptainstreasureChest):
         self.treasureChest = CaptainstreasureChest
     else:
         self.treasureChest = treasureChest.treasureChest()  ### a empty treasure chest
     self.__groupPolicyTitle = self.translate("policyTab", "Policy Setting")
     self.levels = {}
    def __init__(self, CaptainstreasureChest=False):
        super().__init__()
        # don not delete this self.inboundJSONFile setting, debug will use it
        self.inboundJSONFile = {
            "protocol": "socks",
            "port": "1080",
            "tag": "Inbound",
            "listen": "127.0.0.1",
            "allocate": {
                "strategy": "random",
                "refresh": 5,
                "concurrency": 3
            },
            "settings": {},
            "streamSettings": {},
            "domainOverride": [""]
        }
        self.tableWidgetInboundVerticalHeaderLabels = ["Inbound"]
        if (CaptainstreasureChest):
            self.treasureChest = CaptainstreasureChest
        else:
            self.treasureChest = treasureChest.treasureChest(
            )  # a empty treasure chest
        self.updateList = self.treasureChest.updateList

        self.translate = QCoreApplication.translate

        self.labelHeaderInbound = (self.translate("InboundPanel", "Tag name"),
                                   self.translate("InboundPanel",
                                                  "Listen: port"),
                                   self.translate("InboundPanel", "Protocol"))
示例#3
0
    def __init__(self, CaptainstreasureChest=False):
        super().__init__()
        self.outboundJSONFile = {
            "sendThrough": "0.0.0.0",
            "protocol": "vmess",
            "settings": {},
            "tag": "Outbound",
            "streamSettings": {},
            "proxySettings": {
                "tag": "another-outbound-tag"
            },
            "mux": {}
        }
        self.tableWidgetOutboundVerticalHeaderLabels = ["Outbound"]

        if (CaptainstreasureChest):
            self.treasureChest = CaptainstreasureChest
        else:
            self.treasureChest = treasureChest.treasureChest(
            )  # ## a empty treasure chest

        self.updateList = self.treasureChest.updateList
        self.translate = QCoreApplication.translate

        self.labelHeaderOutbound = (self.translate("OutboundPanel",
                                                   "Tag name"),
                                    self.translate("OutboundPanel",
                                                   "Protocol"))
示例#4
0
    def __init__(self, CaptainstreasureChest=False):
        super().__init__()

        self._windowTitle = "Edit JSON File"

        self.treasureChest = CaptainstreasureChest
        if (not CaptainstreasureChest):
            self.treasureChest = treasureChest.treasureChest()

        self.createPanel()
示例#5
0
    def __init__(self, CaptainstreasureChest=False):
        super(apiTAB, self).__init__()
        self.apiJSONFILE = {
            "tag": "api",
            "services": ["HandlerService", "LoggerService"]
        }

        self.translate = QCoreApplication.translate
        if (CaptainstreasureChest):
            self.treasureChest = CaptainstreasureChest
        else:
            self.treasureChest = treasureChest.treasureChest()
示例#6
0
 def getProxyAddressFromJSONFile(self, filePath):
     from bridgehouse.editMap.port import treasureChest, openV2rayJSONFile
     tempTreasureChest = treasureChest.treasureChest()
     openV2rayJSONFile.openV2rayJSONFile(filePath, tempTreasureChest, disableLog = True).initboundJSONData()
     inbound   = tempTreasureChest.getInbound()
     if (inbound):
         protocol  = inbound["protocol"]
         ipAddress = inbound["listen"]
         port      = inbound["port"]
         if (protocol == "socks" or protocol == "http"):
             return "{}:{}:{}".format(protocol, ipAddress, port)
         else:
             return False
     else:
         return False
 def __init__(self, filePath=False):
     super().__init__()
     self.configJSONFile = {
         "log": {},
         "dns": {},
         "routing": {},
         "policy": {},
         "inbound": {},
         "outbound": {},
         "inboundDetour": [],
         "outboundDetour": [],
         "transport": {}
     }
     self.filePath = filePath
     self.treasureChest = treasureChest.treasureChest()
     self.translate = QCoreApplication.translate
示例#8
0
    def __init__(self,
                 filePath=False,
                 CaptainstreasureChest=False,
                 disableLog=False):
        self.translate = QCoreApplication.translate
        self.JSONData = False
        if (disableLog):
            logbook.setisOpenJSONFile(False)
        else:
            logbook.setisOpenJSONFile(True)
        if (filePath):
            self.JSONData = self.openJSONData(filePath)

        self.treasureChest = CaptainstreasureChest
        if (not self.treasureChest):
            self.treasureChest = treasureChest.treasureChest()
        self.msgBox = QMessageBox()
        self.fly = QApplication.desktop().screen().rect().center(
        ) - self.msgBox.rect().center()