CodeRed CLI Configuration#

Config Files#

Configuration files can be created using the name .cr.ini. The following locations are searched:

  • Home Directory (i.e. ~/.cr.ini)

  • The working directory (this generally should be your project root, unless you have specified --path to some commands).

A config file in the working directory will override values in a config file from home directory.

File Format#

The default section in the config file is [cr]. Other sections named after your webapp handles can override these values. For example:

# API token for my client.
[cr]
token = abc...

# These settings are for ``demo.codered.cloud``
[demo]
token = xyz...

Below is a list of all configuration options.

When specifying paths in the config file, always use forward slashes /.

Options#

deploy_exclude#

Any files or directories ignored by git will not be uploaded when running cr deploy or cr upload. Additional files or folders can also be excluded with deploy_exclude. These must be actual paths relative to the project root; regular expressions are not currently supported.

[demo]
# Exclude the dev settings file.
deploy_exclude = demo/settings/dev.py

[demo2]
# Multiple paths can also be specified by indenting each line.
deploy_exclude =
    demo2/settings/dev.py
    htmlcov/
    .gitignore
    Dockerfile
    REAME.md

deploy_include#

Files or directories ignored by git can also be forcibly uploaded during cr deploy or cr upload. These must be actual paths relative to the project root; regular expressions are not currently supported.

Subpaths of a path that is excluded will still not be included. This option can be used to negate specific directories or paths which are excluded, but not specific children of that path. For example, if you ignore the node_modules folder, you cannot force include a specific file in that folder, e.g. node_modules/dist/bootstrap.css.

[demo]
# Include a built CSS file which is normally ignored by git.
deploy_include = website/static/bootstrap.min.css

[demo2]
# Multiple paths can also be specified by indenting each line.
deploy_include =
    website/static/bootstrap.min.css
    website/static/webpack/
    secrets.env

download_exclude#

Skip specific file or folder paths on the server when downloading. These must be actual paths relative to the remote path (which by default is /www/); regular expressions are not currently supported.

By default, this is set to ignore cache and static because these usually contain generated files not relevent for development. It may also be useful to specify media or wp-content/uploads if your site has a lot of media files. If you want to download everything, set this to a nonexistant path such as /dev/null.

This setting will override the --exclude command line option.

[demo]
# Multiple paths can be specified by indenting each line.
download_exclude =
    cache/
    media/
    static/
    # Also exclude built CSS files.
    website/static/bootstrap.min.css

token#

An API token which has access to this webapp. This token will also identify which user initiated the deployment, for auditing purposes.

[demo]
token = abc...

[demo2]
token = xyz...

API tokens are secret and should be stored either in the CR_TOKEN environment variable, or in your personal config file at ~/.cr.ini.

Warning

Never commit or expose your tokens to public version control! If you do accidentally expose a token, it can be cycled through the CodeRed Cloud dashboard.