def confirm_onion_config_valid()

in files/validate_config.py [0:0]


    def confirm_onion_config_valid(self):
        """
        Only v3 onion services are supported.
        """
        if "hidserv" not in self.config:
            raise ValidationError('"hidserv" is not defined in config.json')

        # Verify the hostname
        if "hostname" not in self.config["hidserv"]:
            raise ValidationError("hidden service hostname is not defined in config.json")
        if not re.match(TOR_V3_HOSTNAME_REGEX, self.config["hidserv"]["hostname"]):
            raise ValidationError("Invalid hidden service hostname specified")

        # Verify the key
        if "key" not in self.config["hidserv"]:
            raise ValidationError("hidden service key is not defined in config.json")
        if not re.match(TOR_V3_AUTH_REGEX, self.config["hidserv"]["key"]):
            raise ValidationError("Invalid hidden service key specified")