import configparser


def get_config(conf_file, section=None):
    """Reads init type configuration file.
    Returns JSON with config detail

    :param conf_file: string containing file path
    :param section: (Optional) string containing section name in config file
    :return: dict
    """
    parser = configparser.ConfigParser()
    parser.read_file(open(conf_file))
    if not section:
        return {sect: dict(parser.items(sect)) for sect in parser.sections()}
    else:
        return dict(parser.items(section))