Beispiel #1
0
    return ABFS_CLUSTERS['default'].WEBHDFS_URL.get()


def get_default_abfs_fs():
    return ABFS_CLUSTERS['default'].FS_DEFAULTFS.get()


ADLS_CLUSTERS = UnspecifiedConfigSection(
    "adls_clusters",
    help="One entry for each ADLS cluster",
    each=ConfigSection(
        help="Information about a single ADLS cluster",
        members=dict(
            FS_DEFAULTFS=Config(
                "fs_defaultfs",
                help="adl://<account_name>.azuredatalakestore.net",
                type=str,
                default=None),
            WEBHDFS_URL=Config(
                "webhdfs_url",
                help="https://<account_name>.azuredatalakestore.net/webhdfs/v1",
                type=str,
                default=None),
        )))

AZURE_ACCOUNTS = UnspecifiedConfigSection(
    "azure_accounts",
    help="One entry for each Azure account",
    each=ConfigSection(
        help="Information about a single azure account",
        members=dict(
Beispiel #2
0
from desktop.lib.conf import Config, UnspecifiedConfigSection, ConfigSection


def coerce_string(value):
    if type(value) == list:
        return ','.join(value)
    else:
        return value


CLUSTERS = UnspecifiedConfigSection(
    "clusters",
    help="One entry for each Zookeeper cluster",
    each=ConfigSection(
        help="Information about a single Zookeeper cluster",
        members=dict(
            HOST_PORTS=Config(
                "host_ports",
                help=
                "Zookeeper ensemble. Comma separated list of Host/Port, e.g. localhost:2181,localhost:2182,localhost:2183",
                default="localhost:2181",
                type=coerce_string,
            ),
            REST_URL=Config(
                "rest_url",
                help="The URL of the REST contrib service.",
                default="http://localhost:9998",
                type=str,
            ),
        )))
Beispiel #3
0
DATABASES = UnspecifiedConfigSection(
    key="databases",
    help=_t("RDBMS server configurations."),
    each=ConfigSection(
        help=_t("RDBMS server configuration."),
        members=dict(
            NICE_NAME=Config(
                key='nice_name',
                help=_t('Nice name of server.'),
                type=str,
                default=None,
            ),
            NAME=Config(
                key='name',
                help=_t(
                    'Database name or path to database file. If provided, then choosing other databases will not be permitted.'
                ),
                type=str,
                default='',
            ),
            ENGINE=Config(
                key='engine',
                help=_t(
                    'Database engine, such as postgresql_psycopg2, mysql, or sqlite3.'
                ),
                type=coerce_database,
                default='django.db.backends.sqlite3',
            ),
            USER=Config(
                key='user',
                help=_t('Database username.'),
                type=str,
                default='',
            ),
            PASSWORD=Config(
                key='password',
                help=_t('Database password.'),
                type=str,
                default='',
            ),
            PASSWORD_SCRIPT=Config(
                key='password_script',
                help=_t(
                    'Execute this script to produce the database password. This will be used when `password` is not set.'
                ),
                type=coerce_password_from_script,
                default=None,
            ),
            HOST=Config(
                key='host',
                help=_t('Database host.'),
                type=str,
                default='',
            ),
            PORT=Config(
                key='port',
                help=_t('Database port.'),
                type=int,
                default=0,
            ),
            OPTIONS=Config(
                key='options',
                help=_t(
                    'Database options to send to the server when connecting.'),
                type=coerce_json_dict,
                default='{}'))))
Beispiel #4
0
            default="https://api.twitter.com/oauth/request_token"),
        ACCESS_TOKEN_URL=Config(
            key="access_token_url",
            help=_("The Access token URL."),
            type=str,
            default="https://api.twitter.com/oauth/access_token"),
        AUTHENTICATE_URL=Config(
            key="authenticate_url",
            help=_("The Authorize URL."),
            type=str,
            default="https://api.twitter.com/oauth/authorize"),
    ))

LOCAL_FILESYSTEMS = UnspecifiedConfigSection(
    key="local_filesystems",
    help=_(
        "Paths on the local file system that users should be able to browse."),
    each=ConfigSection(members=dict(PATH=Config(
        "path", required=True, help=_("The path on the local filesystem.")))))


def default_feedback_url():
    """A version-specific URL."""
    return "http://groups.google.com/a/cloudera.org/group/hue-user"


FEEDBACK_URL = Config(key="feedback_url",
                      help=_("Link for 'feedback' tab."),
                      type=str,
                      dynamic_default=default_feedback_url)

SEND_DBUG_MESSAGES = Config(
Beispiel #5
0
CLUSTERS = UnspecifiedConfigSection(
    key="clusters",
    help="One entry for each Zookeeper cluster",
    each=ConfigSection(
        help="Information about a single Zookeeper cluster",
        members=dict(
            ZK_HOST_PORTS=Config(
                key="zk_host_ports",
                help=
                "Zookeeper ensemble. Comma separated list of Host/Port, e.g. localhost:2181,localhost:2182,localhost:2183",
                default="localhost:2181",
                type=coerce_string),
            BROKERS_PATH=Config(
                key="brokers_path",
                help=
                "Path to brokers info in Zookeeper Znode hierarchy, e.g. /brokers/ids",
                default="/brokers/ids",
                type=str),
            CONSUMERS_PATH=Config(
                key="consumers_path",
                help=
                "Path to consumers info in Zookeeper Znode hierarchy, e.g. /consumers",
                default="/consumers",
                type=str),
            TOPICS_PATH=Config(
                key="topics_path",
                help=
                "Path to topics info in Zookeeper Znode hierarchy, e.g. /brokers/topics",
                default="/brokers/topics",
                type=str),
            GANGLIA_SERVER=Config(key="ganglia_server",
                                  help="GANGLIA Server",
                                  default="http://localhost",
                                  type=str),
            GANGLIA_DATA_SOURCE=Config(key="ganglia_data_source",
                                       help="Ganglia Data Source",
                                       default="my cluster",
                                       type=str),
        )))
Beispiel #6
0
    LDAP_SERVERS = UnspecifiedConfigSection(
      key="ldap_servers",
      help=_("LDAP server record."),
      each=ConfigSection(
        members=dict(
          BASE_DN=Config("base_dn",
                         default=None,
                         help=_("The base LDAP distinguished name to use for LDAP search.")),
          NT_DOMAIN=Config("nt_domain",
                           default=None,
                           help=_("The NT domain used for LDAP authentication.")),
          LDAP_URL=Config("ldap_url",
                           default=None,
                           help=_("The LDAP URL to connect to.")),
          USE_START_TLS=Config("use_start_tls",
                               default=True,
                               type=coerce_bool,
                               help=_("Use StartTLS when communicating with LDAP server.")),
          LDAP_CERT=Config("ldap_cert",
                           default=None,
                           help=_("A PEM-format file containing certificates for the CA's that Hue will trust for authentication over TLS. The certificate for the CA that signed the LDAP server certificate must be included among these certificates. See more here http://www.openldap.org/doc/admin24/tls.html.")),
          LDAP_USERNAME_PATTERN=Config("ldap_username_pattern",
                                       default=None,
                                       help=_("A pattern to use for constructing LDAP usernames.")),
          BIND_DN=Config("bind_dn",
                         default=None,
                         help=_("The distinguished name to bind as, when importing from LDAP.")),
          BIND_PASSWORD=Config("bind_password",
                               default=None,
                               private=True,
                               help=_("The password for the bind user.")),
          BIND_PASSWORD_SCRIPT=Config("bind_password_script",
                                    default=None,
                                    private=True,
                                    type=coerce_password_from_script,
                                    help=_("Execute this script to produce the LDAP bind user password. This will be used when `bind_password` is not set.")),
          SEARCH_BIND_AUTHENTICATION=Config("search_bind_authentication",
                                            default=True,
                                            type=coerce_bool,
                                            help=_("Use search bind authentication.")),
          FOLLOW_REFERRALS = Config("follow_referrals",
                                    help=_("Whether or not to follow referrals."),
                                    type=coerce_bool,
                                    default=False),

          DEBUG = Config("debug",
            type=coerce_bool,
            default=False,
            help=_("Set to a value to enable python-ldap debugging.")),
          DEBUG_LEVEL = Config("debug_level",
            default=255,
            type=int,
            help=_("Sets the debug level within the underlying LDAP C lib.")),
          TRACE_LEVEL = Config("trace_level",
            default=0,
            type=int,
            help=_("Possible values for trace_level are 0 for no logging, 1 for only logging the method calls with arguments,"
                   "2 for logging the method calls with arguments and the complete results and 9 for also logging the traceback of method calls.")),

          USERS = ConfigSection(
            key="users",
            help=_("Configuration for LDAP user schema and search."),
            members=dict(
              USER_FILTER=Config("user_filter",
                                 default="objectclass=*",
                                 help=_("A base filter for use when searching for users.")),
              USER_NAME_ATTR=Config("user_name_attr",
                                    default="sAMAccountName",
                                    help=_("The username attribute in the LDAP schema. "
                                         "Typically, this is 'sAMAccountName' for AD and 'uid' "
                                         "for other LDAP systems.")),
            )
          ),

          GROUPS = ConfigSection(
            key="groups",
            help=_("Configuration for LDAP group schema and search."),
            members=dict(
              GROUP_FILTER=Config("group_filter",
                                 default="objectclass=*",
                                 help=_("A base filter for use when searching for groups.")),
              GROUP_NAME_ATTR=Config("group_name_attr",
                                    default="cn",
                                    help=_("The group name attribute in the LDAP schema. "
                                        "Typically, this is 'cn'.")),
              GROUP_MEMBER_ATTR=Config("group_member_attr",
                                       default="member",
                                       help=_("The LDAP attribute which specifies the "
                                            "members of a group.")),
            ))))),
Beispiel #7
0
def get_default_region():
  return ""

def get_default_adls_url():
  return ADLS_CLUSTERS['default'].WEBHDFS_URL.get()

def get_default_adls_fs():
  return ADLS_CLUSTERS['default'].FS_DEFAULTFS.get()

ADLS_CLUSTERS = UnspecifiedConfigSection(
  "adls_clusters",
  help="One entry for each ADLS cluster",
  each=ConfigSection(
    help="Information about a single ADLS cluster",
    members=dict(
      FS_DEFAULTFS=Config("fs_defaultfs", help="adl://<account_name>.azuredatalakestore.net", type=str, default=None),
      WEBHDFS_URL=Config("webhdfs_url",
                         help="https://<account_name>.azuredatalakestore.net/webhdfs/v1",
                         type=str, default=None),
    )
  )
)

AZURE_ACCOUNTS = UnspecifiedConfigSection(
  "azure_accounts",
  help="One entry for each Azure account",
  each=ConfigSection(
    help="Information about a single azure account",
    members=dict(
      CLIENT_ID=Config("client_id", help="", default=None),
      CLIENT_SECRET=Config("client_secret", help="", default=None),
Beispiel #8
0
    private=True,
    type = human_size,
    default="100MB")

HUE_ENV = Config(
    key = "hue_env",
    help = "The environment of HUE: DEV/TEST/PROD",
    private = True,
    type = ucase,
    default = "DEV")

DATABASES = UnspecifiedConfigSection(
    key = "databases",
    help = "The databases are supported for exporting",
    each = ConfigSection(members=dict(
      DEFAULT_SCHEMA = Config(key="default_schema",
        help = "The default schema of the databse for exporting",
        private = True),
      DEFAULT_TABLESPACE = Config(key="default_tablespace",
        help = "The default tablespace of the databse for exporting",
        private = True))) )

EXPORT_DBS = UnspecifiedConfigSection(
    key = "export_dbs",
    help = "The databases for exporting in different environments",
    each = ConfigSection(members=dict(
      DBS = Config(key="dbs",
        help = "Comma separated database names",
        private = True))))

def to_uppercase(conf):
  if isinstance(conf, dict):
Beispiel #9
0
HDFS_CLUSTERS = UnspecifiedConfigSection(
    "hdfs_clusters",
    help="One entry for each HDFS cluster",
    each=ConfigSection(
        help="Information about a single HDFS cluster",
        members=dict(
            FS_DEFAULTFS=Config(
                "fs_defaultfs",
                help="The equivalent of fs.defaultFS (aka fs.default.name)",
                default="hdfs://localhost:8020"),
            LOGICAL_NAME=Config("logical_name",
                                default="",
                                type=str,
                                help=_t('NameNode logical name.')),
            WEBHDFS_URL=Config(
                "webhdfs_url",
                help="The URL to WebHDFS/HttpFS service. Defaults to " +
                "the WebHDFS URL on the NameNode.",
                type=str,
                default="http://localhost:50070/webhdfs/v1"),
            NN_KERBEROS_PRINCIPAL=Config(
                "nn_kerberos_principal",
                help="Kerberos principal for NameNode",
                default="hdfs",
                type=str),
            DN_KERBEROS_PRINCIPAL=Config(
                "dn_kerberos_principal",
                help="Kerberos principal for DataNode",
                default="hdfs",
                type=str),
            SECURITY_ENABLED=Config(
                "security_enabled",
                help="Is running with Kerberos authentication",
                default=False,
                type=coerce_bool),
            TEMP_DIR=Config("temp_dir",
                            help="HDFS directory for temporary files",
                            default='/tmp',
                            type=str),
        )))
Beispiel #10
0
HDFS_CLUSTERS = UnspecifiedConfigSection(
    "hdfs_clusters",
    help="One entry for each HDFS cluster",
    each=ConfigSection(
        help="Information about a single HDFS cluster",
        members=dict(
            NN_HOST=Config("namenode_host", help="IP for name node"),
            NN_THRIFT_PORT=Config("thrift_port",
                                  help="Thrift port for name node",
                                  default=10090,
                                  type=int),
            NN_HDFS_PORT=Config("hdfs_port",
                                help="Hadoop IPC port for the name node",
                                default=8020,
                                type=int),
            NN_HTTP_PORT=Config("http_port",
                                help="Hadoop HTTP port for the name node",
                                default=50070,
                                type=int),
            NN_KERBEROS_PRINCIPAL=Config(
                "nn_kerberos_principal",
                help="Kerberos principal for NameNode",
                default="hdfs",
                type=str),
            DN_KERBEROS_PRINCIPAL=Config(
                "dn_kerberos_principal",
                help="Kerberos principal for DataNode",
                default="hdfs",
                type=str),
            SECURITY_ENABLED=Config(
                "security_enabled",
                help="Is running with Kerberos authentication",
                default=False,
                type=coerce_bool),
            TEMP_DIR=Config("temp_dir",
                            help="HDFS directory for temporary files",
                            default='/tmp',
                            type=str),
        )))
Beispiel #11
0
CLUSTERS = UnspecifiedConfigSection(
  "clusters",
  help="One entry for each Zookeeper cluster",
  each=ConfigSection(
    help="Information about a single Zookeeper cluster",
    members=dict(
        ZK_HOST_PORTS=Config(
          "zk_host_ports",
          help="Zookeeper ensemble. Comma separated list of Host/Port, e.g. localhost:2181,localhost:2182,localhost:2183",
          default="localhost:2181",
          type=coerce_string,
        ),
        ZK_REST_URL=Config(
          "zk_rest_url",
          help="The URL of the REST contrib service.",
          default="http://localhost:9998",
          type=str,
        ),
        BROKERS_PATH=Config(
          "brokers_path",
          help="Path to brokers info in Zookeeper Znode hierarchy, e.g. /brokers/ids",
          default="/brokers/ids",
          type=str,
        ),
        CONSUMERS_PATH=Config(
          "consumers_path",
          help="Path to consumers info in Zookeeper Znode hierarchy, e.g. /consumers",
          default="/consumers",
          type=str,
        ),
        TOPICS_PATH=Config(
          "topics_path",
          help="Path to topics info in Zookeeper Znode hierarchy, e.g. /brokers/topics",
          default="/brokers/topics",
          type=str,
        ),
    )
  )
)
Beispiel #12
0
# See the License for the specific language governing permissions and
# limitations under the License.
"""
Configuration options for the Shell UI.
This file specifies the structure that the shell configuration should follow.
See conf/hue.ini to configure which shells are available.
"""
from desktop.lib.conf import Config, ConfigSection, UnspecifiedConfigSection
import shell.utils as utils

SHELL_TYPES = UnspecifiedConfigSection(
    key='shelltypes',
    each=ConfigSection(
        members=dict(nice_name=Config(key='nice_name', required=True),
                     command=Config(key='command', required=True),
                     help_doc=Config(key='help', required=False),
                     environment=UnspecifiedConfigSection(
                         key='environment',
                         each=ConfigSection(members=dict(
                             value=Config(key='value', required=True),
                             doc=Config(key='doc', required=False)))))))

SHELL_BUFFER_AMOUNT = Config(
    key="shell_buffer_amount",
    help="Configure the number of output characters buffered for each shell",
    default=524288,
    type=int)

SHELL_TIMEOUT = Config(key="shell_timeout",
                       help="Number of seconds to keep shells open for users",
                       default=600,
Beispiel #13
0
    return ADLS_CLUSTERS['default'].WEBHDFS_URL.get()


def get_default_adls_fs():
    return ADLS_CLUSTERS['default'].FS_DEFAULTFS.get()


ADLS_CLUSTERS = UnspecifiedConfigSection(
    "adls_clusters",
    help="One entry for each ADLS cluster",
    each=ConfigSection(
        help="Information about a single ADLS cluster",
        members=dict(
            FS_DEFAULTFS=Config(
                "fs_defaultfs",
                help="adl://<account_name>.azuredatalakestore.net",
                type=str,
                default=None),
            WEBHDFS_URL=Config(
                "webhdfs_url",
                help="https://<account_name>.azuredatalakestore.net/webhdfs/v1",
                type=str,
                default=None),
        )))

AZURE_ACCOUNTS = UnspecifiedConfigSection(
    "azure_accounts",
    help="One entry for each Azure account",
    each=ConfigSection(help="Information about a single azure account",
                       members=dict(CLIENT_ID=Config("client_id",
                                                     help="",
Beispiel #14
0
AWS_ACCOUNTS = UnspecifiedConfigSection(
  'aws_accounts',
  help='One entry for each AWS account',
  each=ConfigSection(
    help='Information about single AWS account',
    members=dict(
      ACCESS_KEY_ID=Config(
        key='access_key_id',
        type=str,
        private=True
      ),
      SECRET_ACCESS_KEY=Config(
        key='secret_access_key',
        type=str,
        private=True
      ),
      ALLOW_ENVIRONMENT_CREDENTIALS=Config(
        help='Allow to use environment sources of credentials (environment variables, EC2 profile).',
        key='allow_environment_credentials',
        default=True,
        type=coerce_bool
      ),
      REGION=Config(
        key='region',
        default='us-east-1',
        type=str
      )
    )
  )
)
Beispiel #15
0
AWS_ACCOUNTS = UnspecifiedConfigSection(
    'aws_accounts',
    help=_('One entry for each AWS account'),
    each=ConfigSection(
        help=_('Information about single AWS account'),
        members=dict(
            ACCESS_KEY_ID=Config(key='access_key_id',
                                 type=str,
                                 private=True,
                                 dynamic_default=get_default_access_key_id),
            ACCESS_KEY_ID_SCRIPT=Config(
                key='access_key_id_script',
                default=None,
                private=True,
                type=coerce_password_from_script,
                help=_(
                    "Execute this script to produce the AWS access key ID.")),
            SECRET_ACCESS_KEY=Config(key='secret_access_key',
                                     type=str,
                                     private=True,
                                     dynamic_default=get_default_secret_key),
            SECRET_ACCESS_KEY_SCRIPT=Config(
                key='secret_access_key_script',
                default=None,
                private=True,
                type=coerce_password_from_script,
                help=_(
                    "Execute this script to produce the AWS secret access key."
                )),
            SECURITY_TOKEN=Config(
                key='security_token',
                type=str,
                private=True,
            ),
            ALLOW_ENVIRONMENT_CREDENTIALS=Config(
                help=
                _('Allow to use environment sources of credentials (environment variables, EC2 profile).'
                  ),
                key='allow_environment_credentials',
                default=True,
                type=coerce_bool),
            REGION=Config(key='region',
                          default=AWS_ACCOUNT_REGION_DEFAULT,
                          type=str),
            HOST=Config(help=_('Alternate address for the S3 endpoint.'),
                        key='host',
                        default=None,
                        type=str),
            PROXY_ADDRESS=Config(
                help=_('Proxy address to use for the S3 connection.'),
                key='proxy_address',
                default=None,
                type=str),
            PROXY_PORT=Config(
                help=_('Proxy port to use for the S3 connection.'),
                key='proxy_port',
                default=8080,
                type=int),
            PROXY_USER=Config(
                help=_('Proxy user to use for the S3 connection.'),
                key='proxy_user',
                default=None,
                type=str),
            PROXY_PASS=Config(
                help=_('Proxy password to use for the S3 connection.'),
                key='proxy_pass',
                default=None,
                type=str),
            CALLING_FORMAT=Config(key='calling_format',
                                  default=DEFAULT_CALLING_FORMAT,
                                  type=str),
            IS_SECURE=Config(key='is_secure', default=True,
                             type=coerce_bool))))
Beispiel #16
0
  help=_("Beeswax or Hive Server 2 Thrift API used. Choices are: 'beeswax' or 'hiveserver2'."),
  default="beeswax")


QUERY_SERVERS = UnspecifiedConfigSection(
  "query_servers",
  help=_("One entry for each Query Server that can execute some queries."),
  each=ConfigSection(
    help=_("Information about a single Query Server"),
    members=dict(
      SERVER_HOST = Config(
        key="server_host",
        help=_("Host where the Query Server Thrift daemon is running."),
        private=True,
        default="localhost"),
      SERVER_PORT = Config(
        key="server_port",
        help=_("Configure the port the Query Server Thrift server."),
        default=8002,
        type=int),
      SUPPORT_DDL = Config(
        key='support_ddl',
        default=True,
        type=coerce_bool,
        help=_('If DDL queries are supported (e.g. DROP can be sent directly to this server).'))
    )
  )
)

# Deprecated! To remove in Hue 3
# Multiple sections are now available in QUERY_SERVERS
BEESWAX_SERVER_HOST = Config(
Beispiel #17
0
HDFS_CLUSTERS = UnspecifiedConfigSection(
  "hdfs_clusters",
  help="One entry for each HDFS cluster",
  each=ConfigSection(
    help="Information about a single HDFS cluster",
    members=dict(
      # Deprecated
      NN_HOST=Config("namenode_host", help="Host/IP for name node"),

      NN_THRIFT_PORT=Config("thrift_port", help="Thrift port for name node", default=10090,
                            type=int),
      NN_HDFS_PORT=Config("hdfs_port", help="Hadoop IPC port for the name node", default=8020,
                            type=int),
      # End deprecation
      FS_DEFAULTFS=Config("fs_defaultfs", help="The equivalent of fs.defaultFS (aka fs.default.name)",
                          default="hdfs://localhost:8020"),
      WEBHDFS_URL=Config("webhdfs_url",
                         help="The URL to WebHDFS/HttpFS service. Defaults to " +
                         "the WebHDFS URL on the NameNode.",
                         type=str, default=None),
      NN_KERBEROS_PRINCIPAL=Config("nn_kerberos_principal", help="Kerberos principal for NameNode",
                                   default="hdfs", type=str),
      DN_KERBEROS_PRINCIPAL=Config("dn_kerberos_principal", help="Kerberos principal for DataNode",
                                   default="hdfs", type=str),
      SECURITY_ENABLED=Config("security_enabled", help="Is running with Kerberos authentication",
                              default=False, type=coerce_bool),
      TEMP_DIR=Config("temp_dir", help="HDFS directory for temporary files",
                      default='/tmp', type=str),

      HADOOP_HDFS_HOME = Config(
        key="hadoop_hdfs_home",
        default=os.environ.get("HADOOP_HDFS_HOME", "/usr/lib/hadoop-hdfs"),
        help=("Path to Hadoop HDFS home - HADOOP_HOME or HADOOP_HDFS_HOME in " +
              "hadoop parlance. For tarball installations, it is the root of " +
              "the untarred directory. For packages, " +
              "it is /usr/lib/hadoop-hdfs." +
              "Defaults to the environment varible HADOOP_BIN when set, " +
              "or '/usr/bin/hadoop'."),
      ),
      HADOOP_BIN = Config(
        key="hadoop_bin",
        default=os.environ.get("HADOOP_BIN", "/usr/bin/hadoop"),
        help=("Path to your Hadoop launcher script. E.g. /usr/bin/hadoop. " +
              "Defaults to the environment varible HADOOP_BIN when set, " +
              "or '/usr/bin/hadoop'.")
      ),
      HADOOP_CONF_DIR = Config(
        key="hadoop_conf_dir",
        default=os.environ.get("HADOOP_CONF_DIR", "/etc/hadoop/conf"),
        help=("Directory to pass to hadoop_bin (from Hadoop configuration) " +
              "as the --config flag. Defaults to the environment variable " +
              "HADOOP_CONF_DIR when set, or '/etc/hadoop/conf'.")
      ),
    )
  )
)
Beispiel #18
0
            default="desktop.auth.backend.AllowFirstUserDjangoBackend",
            help="Authentication backend.  Common settings are "
            "django.contrib.auth.backends.ModelBackend (fully Django backend), "
            + "desktop.auth.backend.AllowAllBackend (allows everyone), " +
            "desktop.auth.backend.AllowFirstUserDjangoBackend (relies on Django and user manager, after the first login), "
        ),
        USER_AUGMENTOR=Config(
            "user_augmentor",
            default="desktop.auth.backend.DefaultUserAugmentor",
            help="Class which defines extra accessor methods for User objects."
        ),
    ))

LOCAL_FILESYSTEMS = UnspecifiedConfigSection(
    key="local_filesystems",
    help="Paths on the local file system that users should be able to browse",
    each=ConfigSection(members=dict(
        PATH=Config("path", required=True, help="The path on the local FS"))))


def default_feedback_url():
    """A version-specific URL."""
    return "http://groups.google.com/a/cloudera.org/group/hue-user"


FEEDBACK_URL = Config(key="feedback_url",
                      help="Link for 'feedback' tab.",
                      type=str,
                      dynamic_default=default_feedback_url)

SEND_DBUG_MESSAGES = Config(
Beispiel #19
0
    } for i in reordered_interpreters]


INTERPRETERS = UnspecifiedConfigSection(
    "interpreters",
    help="One entry for each type of snippet.",
    each=ConfigSection(
        help=_t(
            "Define the name and how to connect and execute the language."),
        members=dict(
            NAME=Config(
                "name",
                help=_t("The name of the snippet."),
                default="SQL",
                type=str,
            ),
            INTERFACE=Config(
                "interface",
                help=
                "The backend connection to use to communicate with the server.",
                default="hiveserver2",
                type=str,
            ),
            OPTIONS=Config(
                key='options',
                help=_t('Specific options for connecting to the server.'),
                type=coerce_json_dict,
                default='{}'))))

INTERPRETERS_SHOWN_ON_WHEEL = Config(
    key="interpreters_shown_on_wheel",
Beispiel #20
0
AWS_ACCOUNTS = UnspecifiedConfigSection(
    'aws_accounts',
    help='One entry for each AWS account',
    each=ConfigSection(
        help='Information about single AWS account',
        members=dict(
            ACCESS_KEY_ID=Config(key='access_key_id',
                                 type=str,
                                 private=True,
                                 dynamic_default=get_default_access_key_id),
            ACCESS_KEY_ID_SCRIPT=Config(
                key='access_key_id_script',
                default=None,
                private=True,
                type=coerce_password_from_script,
                help=_(
                    "Execute this script to produce the AWS access key ID.")),
            SECRET_ACCESS_KEY=Config(key='secret_access_key',
                                     type=str,
                                     private=True,
                                     dynamic_default=get_default_secret_key),
            SECRET_ACCESS_KEY_SCRIPT=Config(
                key='secret_access_key_script',
                default=None,
                private=True,
                type=coerce_password_from_script,
                help=_(
                    "Execute this script to produce the AWS secret access key."
                )),
            SECURITY_TOKEN=Config(
                key='security_token',
                type=str,
                private=True,
            ),
            ALLOW_ENVIRONMENT_CREDENTIALS=Config(
                help=
                'Allow to use environment sources of credentials (environment variables, EC2 profile).',
                key='allow_environment_credentials',
                default=True,
                type=coerce_bool),
            REGION=Config(key='region', default='us-east-1', type=str))))
Beispiel #21
0
Datei: conf.py Projekt: ztwu/hue
HDFS_CLUSTERS = UnspecifiedConfigSection(
    "hdfs_clusters",
    help="One entry for each HDFS cluster",
    each=ConfigSection(
        help="Information about a single HDFS cluster",
        members=dict(
            FS_DEFAULTFS=Config(
                "fs_defaultfs",
                help="The equivalent of fs.defaultFS (aka fs.default.name)",
                default="hdfs://localhost:8020"),
            LOGICAL_NAME=Config("logical_name",
                                default="",
                                type=str,
                                help=_t('NameNode logical name.')),
            WEBHDFS_URL=Config(
                "webhdfs_url",
                help="The URL to WebHDFS/HttpFS service. Defaults to " +
                "the WebHDFS URL on the NameNode.",
                type=str,
                default="http://localhost:50070/webhdfs/v1"),
            NN_KERBEROS_PRINCIPAL=Config(
                "nn_kerberos_principal",
                help="Kerberos principal for NameNode",  # Unused
                default="hdfs",
                type=str),
            DN_KERBEROS_PRINCIPAL=Config(
                "dn_kerberos_principal",
                help="Kerberos principal for DataNode",  # Unused
                default="hdfs",
                type=str),
            SECURITY_ENABLED=Config(
                "security_enabled",
                help="Is running with Kerberos authentication",
                default=False,
                type=coerce_bool),
            SSL_CERT_CA_VERIFY=Config(
                "ssl_cert_ca_verify",
                help=
                "In secure mode (HTTPS), if SSL certificates from YARN Rest APIs have to be verified against certificate authority",
                dynamic_default=default_ssl_validate,
                type=coerce_bool),
            TEMP_DIR=Config("temp_dir",
                            help="HDFS directory for temporary files",
                            default='/tmp',
                            type=str),
            HADOOP_CONF_DIR=Config(
                key="hadoop_conf_dir",
                default=os.environ.get(
                    "HADOOP_CONF_DIR",
                    "/etc/hadoop/conf"),
                help=
                ("Directory of the Hadoop configuration) Defaults to the environment variable "
                 + "HADOOP_CONF_DIR when set, or '/etc/hadoop/conf'.")))))
Beispiel #22
0
    type=int,
    default=10)
SECRET_KEY = Config(key="secret_key",
                    help=_("Used in hashing algorithms for sessions."),
                    default="")
X_FRAME_OPTIONS = Config(key="x_frame_options",
                         help=_("Options for X_FRAME_OPTIONS header."),
                         default="SAMEORIGIN")

USER_ACCESS_HISTORY_SIZE = Config(
    key="user_access_history_size",
    help=_("Number of user access to remember per view per user."),
    type=int,
    default=10)

SUPERVISEES_CONTROL = UnspecifiedConfigSection(key='supervisor',
                                               each=Config(type=coerce_bool))


def is_https_enabled():
    return bool(SSL_CERTIFICATE.get() and SSL_PRIVATE_KEY.get())


#
# Email (SMTP) settings
#
_default_from_email = None


def default_from_email():
    """Email for hue@<host-fqdn>"""
    global _default_from_email
Beispiel #23
0
            'analytics':
            settings.get('sql') and settings['sql'].get('analytics'),
            'nesting':
            settings.get('sql') and settings['sql'].get('nesting'),
        } for interpreter in get_ordered_interpreters(user)
                    if interpreter['interface'] in ('hiveserver2', 'jdbc',
                                                    'rdbms')]

    return engines


ENGINES = UnspecifiedConfigSection(
    "engines",
    help="One entry for each type of snippet.",
    each=ConfigSection(help=_t(
        "Name of the interface to use as query engine for the dashboard, e.g. solr, sql."
    ),
                       members=dict(
                           ANALYTICS=Config(
                               "analytics",
                               help=_t("Support analytics facets or not."),
                               default=False,
                               type=coerce_bool,
                           ),
                           NESTING=Config(
                               "nesting",
                               help=_t("Support nested documents or not."),
                               default=False,
                               type=coerce_bool,
                           ),
                       )))
Beispiel #24
0
HDFS_CLUSTERS = UnspecifiedConfigSection(
    "hdfs_clusters",
    help="One entry for each HDFS cluster",
    each=ConfigSection(
        help="Information about a single HDFS cluster",
        members=dict(
            FS_DEFAULTFS=Config(
                "fs_defaultfs",
                help="The equivalent of fs.defaultFS (aka fs.default.name)",
                default="hdfs://localhost:8020"),
            LOGICAL_NAME=Config("logical_name",
                                default="",
                                type=str,
                                help=_t('NameNode logical name.')),
            WEBHDFS_URL=Config(
                "webhdfs_url",
                help="The URL to WebHDFS/HttpFS service. Defaults to " +
                "the WebHDFS URL on the NameNode.",
                type=str,
                default="http://localhost:50070/webhdfs/v1"),
            NN_KERBEROS_PRINCIPAL=Config(
                "nn_kerberos_principal",
                help="Kerberos principal for NameNode",
                default="hdfs",
                type=str),
            DN_KERBEROS_PRINCIPAL=Config(
                "dn_kerberos_principal",
                help="Kerberos principal for DataNode",
                default="hdfs",
                type=str),
            SECURITY_ENABLED=Config(
                "security_enabled",
                help="Is running with Kerberos authentication",
                default=False,
                type=coerce_bool),
            TEMP_DIR=Config("temp_dir",
                            help="HDFS directory for temporary files",
                            default='/tmp',
                            type=str),
        )))