Configuration reference (AER 2.30)

Anaconda Repository will load configuration files with the extension .yaml from the following locations:

  • /etc/binstar/
  • /etc/anaconda-server/
  • $PREFIX/etc/anaconda-server

$PREFIX is the location where Anaconda Repository was installed.

Files are loaded from these directories in order, with later files overriding earlier files. Files are loaded from each directory in alphabetical order.

If an environment variable ANACONDA_SERVER_CONFIG is set with the path of a configuration file, this file is loaded after the three already listed. Its settings will override any conflicting settings in the earlier files.

Each configuration setting variable can have its value set with the anaconda-server-config --set command, or by editing a configuration file.

For example, you can set a value named VALUE_ONE to 50 by adding this to a configuration file:

VALUE_ONE: 50

Or you can set a value named VALUE_ONE to 50 with this command:

anaconda-server-config --set VALUE_ONE 50

Usernames

USER_REGEX

A regular expression that defines the allowable user names.

For example, this setting specifies that user names will contain only lowercase letters and the period, plus, and minus characters (. + and -):

USER_REGEX: '^[a-z.+-]+$'

NOTE: The default value for USER_REGEX is ^[a-z0-9_][a-z0-9_-]+$ which translates to: at least one alphanumeric character or underscore, followed by zero or more alphanumeric, dash or underscore characters.

NOTE: Escape any extra instances of the single quote character ' as \', and do not use the slash and ampersand characters / and & which have special meanings in URLs.

NOTE: If USER_REGEX is changed and the server is restarted, existing usernames that do not match the new USER_REGEX will not cause errors.

Database

Anaconda Repository uses MongoDB as the database backend.

MONGO_URL

A MongoDB connection URI used to connect to the MongoDB database server. It can be used to configure the hostname and port, as well as database authentication.

For example:

MONGO_URL: mongodb://anaconda-server:Pa55w0rd@mongodb.serv/

MONGO_DBNAME

The MongoDB database where Anaconda Repository will store its data.

MQ_DBNAME

The MongoDB database where Anaconda Repository will store data used for asynchronous processing.

MONGO_REPLICA_SET

The name of a MongoDB replica set Anaconda Repository will connect to after establishing a connection to the database server.

File storage

Anaconda Repository can serve package contents from a local file-system, or from Amazon Web Services Simple Storage Service (AWS S3).

storage_type

The storage mechanism to use. Valid choices are fs (for file-system storage) or s3 (for AWS S3 storage).

fs_storage_root

The absolute path to a directory where Anaconda Repository will store all uploaded packages, if configured to use file-system storage.

PACKAGE_BUCKET_ID

The name of an AWS S3 bucket where Anaconda Repository will store uploaded packages, if configured to use AWS S3 storage.

You can identify the name of your bucket by the <bucket> in your http://<bucket>.s3.amazonaws.com URL.

S3_REGION_NAME

The S3 region that the bucket is located in. The available regions can be found in the Amazon AWS documentation.

S3_SERVER_SIDE_ENCRYPTION

This can be set to AES256 to enable server-side encryption for packages stored in the S3 bucket.

Notebooks

MAX_IPYNB_SIZE

This is the maximum allowed size when uploading notebooks to the server. The default is 25 MB. This variable can be set in config.yaml.

Web server

SERVER_NAME

The name and port number of the server. This option is required for subdomain support.

For example:

SERVER_NAME: anaconda.srv:8080

port

The port number of the server. Defaults to 8080.

subdomains

If set to true, Anaconda Repository will serve conda package from a separate subdomain. Defaults to false.

For example:

SERVER_NAME: anaconda.srv:8080
subdomains: true

Allows access to conda packages at http://conda.anaconda.srv:8080/.

USER_CONTENT_DOMAIN

As a cross-site scripting (XSS) protection, notebook content can be served from a separate domain name. If this option is configured, Anaconda Repository will only serve rendered notebooks from this domain.

See here.

ssl_options

Anaconda Repository can serve content over HTTPS, using user-provided SSL certificates.

For example:

ssl_options:
    certfile: /etc/anaconda-server/server.crt
    keyfile: /etc/anaconda-server/server.key
PREFERRED_URL_SCHEME: https

certfile

The absolute path to a PEM-formatted X.509 certificate file.

keyfile

The absolute path to a PEM-formatted private key for the associated certificate.

PREFERRED_URL_SCHEME

The preferred scheme that will be used to generate URLs. Set this to https if HTTPS is configured.

gunicorn

Anaconda Repository uses Gunicorn. The most commonly used options are timeout and workers. A complete list of settings can be found in Gunicorn’s documentation.

For example:

gunicorn:
    timeout: 60
    workers: 5

timeout

The number of seconds that a worker is allowed to process a request for, before being forcefully terminated. Defaults to 120.

workers

The number of workers that gunicorn will spawn to serve Anaconda Repository. Defaults to 2 × the number of CPUs + 1.

Authentication

AUTH_TYPE

The method Anaconda Repository will use to authenticate users. Valid choices are NATIVE (for built-in authentication), KERBEROS (for Kerberos) and LDAP.

LDAP

Options for configuring LDAP authentication and group synchronization.

For example:

LDAP : 
    URI :  ldap : // ldap . 服务器
    BIND_DN  cn = Anaconda 存储库cn =用户dc =示例dc = com 
    BIND_AUTH  Pa55w0rd

    USER_SEARCH : 
        base :  cn =用户, dc =示例, dc = com
        过滤器:  sAMAccountName =% (用户名) s

    KEY_MAP :
        名称:  cn

    选项
        OPT_NETWORK_TIMEOUT  60 
        OPT_TIMEOUT  60

请参阅LDAP 和 TLS 配置选项

LOCK_DOWN

使匿名用户无法访问所有视图,欢迎页面和登录表单除外。

电子邮件

Anaconda Repository 可以配置为出于各种原因发送电子邮件,包括重置忘记的用户名和密码。可以使用 SMTP 协议或通过 Amazon Web Services Simple Email Service (AWS SES) 发送电子邮件。

SMTP_HOST

SMTP 服务器的主机名。

SMTP_PORT

SMTP 服务器的端口。

SMTP_TLS

如果设置为true,Anaconda Repository 将尝试与 SMTP 服务器建立 SSL 连接。

SMTP_用户名

在尝试发送电子邮件之前对 SMTP 服务器进行身份验证的用户名。

SMTP_PASSWORD

在尝试发送电子邮件之前对 SMTP 服务器进行身份验证的密码。

USE_SES

如果设置为true,Anaconda Repository 将使用 AWS SES 发送电子邮件。要向 AWS 进行身份验证,服务器应配置 适当的 IAM 角色,或具有在Boto 配置文件中指定的凭证 。

返回地址

From:Anaconda Repository 将用作发件人的电子邮件地址。

ALLOW_DUPLICATED_EMAILS

如果设置为true,Anaconda Repository 将允许不同的用户共享相同的电子邮件辅助电子邮件。默认为false

require_email_validation

如果设置为true,Anaconda Repository 将通过电子邮件向新用户发送一个唯一令牌,以在允许他们登录之前验证他们的电子邮件地址。

高级

PARCELS_ROOT

生成 Cloudera 宗地的前缀。默认为/opt/cloudera/parcels.

PARCEL_DISTRO_SUFFIXES

生成 Cloudera 包的分布。默认为 .['el5', 'el6', 'el7', 'lucid', 'precise', 'trusty', 'wheezy', 'jessie', 'squeeze', 'sles11', 'sles12']

例如,如果您只想支持 Ubuntu:

PARCEL_DISTRO_SUFFIXES : 
    - 清晰
    - 精确
    - 值得信赖

DEFAULT_CHANNELS

使用捆绑的 Anaconda 发行版安装的环境将从中提取软件包的 Anaconda 存储库帐户 。默认为.['anaconda', 'r-channel']

例如,要添加一个附加custom帐户:

DEFAULT_CHANNELS : 
    -  anaconda 
    -  r -频道
    - 自定义

CONDA_CACHE_SIZE

repodata.json在临时文件存储中缓存的请求数。设置0为禁用repodata.json缓存。