Exemple #1
0
def load_conf(path):
    if path is None or path == '':
        config = config_schema.validate({})
    else:
        print('Janus-proxy loads the config file: {}'.format(
            os.path.abspath(path)))
        config = parse_config(path, config_schema)

    # set up the default cert pathname
    if config['certificates'].get('cert_key') is None:
        config['certificates']['cert_key'] = resource_filename(
            "januscloud", "certs/mycert.key")
    if config['certificates'].get('cert_pem') is None:
        config['certificates']['cert_pem'] = resource_filename(
            "januscloud", "certs/mycert.pem")

    # check other configure option is valid or not
    # TODO

    if config['general']['configs_folder'] == '':
        if path is None or path == '':
            config['general']['configs_folder'] = '/etc/janus-cloud'
        else:
            config['general']['configs_folder'] = os.path.dirname(
                os.path.abspath(path))

    # print('configs_folders: {}'.format(config['general']['configs_folder']))

    return config
Exemple #2
0
def load_conf(path):
    if path is None or path == '':
        config = config_schema.validate({})
    else:
        config = parse_config(path, config_schema)

    for i in range(len(config['posters'])):
        if config['posters'][i]['post_type'] == 'http':
            config['posters'][i] = http_poster_schema.validate(
                config['posters'][i])
        else:
            raise JanusCloudError(
                'poster_type {} not support'.format(
                    config['posters'][i]['post_type']),
                JANUS_ERROR_NOT_IMPLEMENTED)

    # check other configure option is valid or not
    # TODO

    return config
Exemple #3
0
    def read_config(config_file):

        p2pcall_config_schema = Schema({
            Optional("general"): Default({
                Optional("user_db"): Default(StrVal(), default='memory'),
                AutoDel(str): object  # for all other key we don't care
            }, default={}),
            DoNotCare(str): object  # for all other key we don't care

        })
        #print('config file:', config_file)
        if config_file is None or config_file == '':
            config = p2pcall_config_schema.validate({})
        else:
            log.info('P2Pcall plugin loads the config file: {}'.format(os.path.abspath(config_file)))
            config = parse_config(config_file, p2pcall_config_schema)

        # check other configure option is valid or not

        return config
Exemple #4
0
    def read_config(config_file):

        videocall_config_schema = Schema({
            Optional("general"):
            Default(
                {
                    Optional("user_db"): Default(StrVal(), default='memory'),
                    AutoDel(str): object  # for all other key we don't care
                },
                default={}),
            DoNotCare(str):
            object  # for all other key we don't care
        })
        #print('config file:', config_file)
        if config_file is None or config_file == '':
            config = videocall_config_schema.validate({})
        else:
            config = parse_config(config_file, videocall_config_schema)

        # check other configure option is valid or not

        return config